@will-ui/vue 1.0.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/LICENSE +21 -0
- package/README.md +48 -0
- package/TAILWIND.md +282 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/components/audioPlayer/AudioPlayer.d.ts +123 -0
- package/dist/components/audioPlayer/AudioPlayer.js +375 -0
- package/dist/components/audioPlayer/AudioPlayer.js.map +1 -0
- package/dist/components/audioPlayer/index.d.ts +2 -0
- package/dist/components/audioPlayer/style/index.css +1 -0
- package/dist/components/btn/Btn.d.ts +45 -0
- package/dist/components/btn/Btn.js +165 -0
- package/dist/components/btn/Btn.js.map +1 -0
- package/dist/components/btn/config.d.ts +33 -0
- package/dist/components/btn/config.js +20 -0
- package/dist/components/btn/config.js.map +1 -0
- package/dist/components/btn/context.d.ts +12 -0
- package/dist/components/btn/context.js +6 -0
- package/dist/components/btn/context.js.map +1 -0
- package/dist/components/btn/index.d.ts +5 -0
- package/dist/components/btn/style/index.css +1 -0
- package/dist/components/btnGroup/BtnGroup.d.ts +46 -0
- package/dist/components/btnGroup/BtnGroup.js +43 -0
- package/dist/components/btnGroup/BtnGroup.js.map +1 -0
- package/dist/components/btnGroup/config.d.ts +14 -0
- package/dist/components/btnGroup/config.js +11 -0
- package/dist/components/btnGroup/config.js.map +1 -0
- package/dist/components/btnGroup/index.d.ts +3 -0
- package/dist/components/btnGroup/style/index.css +1 -0
- package/dist/components/cascade/Cascade.d.ts +1957 -0
- package/dist/components/cascade/Cascade.js +283 -0
- package/dist/components/cascade/Cascade.js.map +1 -0
- package/dist/components/cascade/config.d.ts +30 -0
- package/dist/components/cascade/config.js +18 -0
- package/dist/components/cascade/config.js.map +1 -0
- package/dist/components/cascade/index.d.ts +3 -0
- package/dist/components/cascade/style/index.css +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +241 -0
- package/dist/components/checkbox/Checkbox.js +182 -0
- package/dist/components/checkbox/Checkbox.js.map +1 -0
- package/dist/components/checkbox/config.d.ts +18 -0
- package/dist/components/checkbox/config.js +11 -0
- package/dist/components/checkbox/config.js.map +1 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/checkbox/style/index.css +1 -0
- package/dist/components/choose/Choose.d.ts +1016 -0
- package/dist/components/choose/Choose.js +402 -0
- package/dist/components/choose/Choose.js.map +1 -0
- package/dist/components/choose/config.d.ts +37 -0
- package/dist/components/choose/config.js +21 -0
- package/dist/components/choose/config.js.map +1 -0
- package/dist/components/choose/index.d.ts +3 -0
- package/dist/components/choose/injectionKey.d.ts +12 -0
- package/dist/components/choose/injectionKey.js +11 -0
- package/dist/components/choose/injectionKey.js.map +1 -0
- package/dist/components/choose/style/index.css +1 -0
- package/dist/components/choose2/Choose2.d.ts +1711 -0
- package/dist/components/choose2/Choose2.js +403 -0
- package/dist/components/choose2/Choose2.js.map +1 -0
- package/dist/components/choose2/config.d.ts +37 -0
- package/dist/components/choose2/config.js +20 -0
- package/dist/components/choose2/config.js.map +1 -0
- package/dist/components/choose2/index.d.ts +3 -0
- package/dist/components/choose2/style/index.css +1 -0
- package/dist/components/chooseItem/ChooseItem.d.ts +46 -0
- package/dist/components/chooseItem/ChooseItem.js +72 -0
- package/dist/components/chooseItem/ChooseItem.js.map +1 -0
- package/dist/components/chooseItem/config.d.ts +12 -0
- package/dist/components/chooseItem/config.js +9 -0
- package/dist/components/chooseItem/config.js.map +1 -0
- package/dist/components/chooseItem/index.d.ts +3 -0
- package/dist/components/chooseItem/style/index.css +1 -0
- package/dist/components/circleProgress/CircleProgress.d.ts +83 -0
- package/dist/components/circleProgress/CircleProgress.js +108 -0
- package/dist/components/circleProgress/CircleProgress.js.map +1 -0
- package/dist/components/circleProgress/index.d.ts +1 -0
- package/dist/components/circleProgress/style/index.css +1 -0
- package/dist/components/close/Close.d.ts +114 -0
- package/dist/components/close/Close.js +82 -0
- package/dist/components/close/Close.js.map +1 -0
- package/dist/components/close/index.d.ts +1 -0
- package/dist/components/close/style/index.css +1 -0
- package/dist/components/colorPicker/ColorPicker.d.ts +138 -0
- package/dist/components/colorPicker/ColorPicker.js +404 -0
- package/dist/components/colorPicker/ColorPicker.js.map +1 -0
- package/dist/components/colorPicker/config.d.ts +24 -0
- package/dist/components/colorPicker/config.js +14 -0
- package/dist/components/colorPicker/config.js.map +1 -0
- package/dist/components/colorPicker/index.d.ts +4 -0
- package/dist/components/colorPicker/style/index.css +1 -0
- package/dist/components/confirm/index.d.ts +73 -0
- package/dist/components/confirm/index.js +177 -0
- package/dist/components/confirm/index.js.map +1 -0
- package/dist/components/confirm/src/style/index.css +1 -0
- package/dist/components/copy/Copy.d.ts +28 -0
- package/dist/components/copy/Copy.js +110 -0
- package/dist/components/copy/Copy.js.map +1 -0
- package/dist/components/copy/config.d.ts +25 -0
- package/dist/components/copy/config.js +13 -0
- package/dist/components/copy/config.js.map +1 -0
- package/dist/components/copy/index.d.ts +5 -0
- package/dist/components/copy/spawnCopyToast.d.ts +13 -0
- package/dist/components/copy/spawnCopyToast.js +150 -0
- package/dist/components/copy/spawnCopyToast.js.map +1 -0
- package/dist/components/copy/style/index.css +1 -0
- package/dist/components/cornerEars/CornerEars.d.ts +24 -0
- package/dist/components/cornerEars/CornerEars.js +108 -0
- package/dist/components/cornerEars/CornerEars.js.map +1 -0
- package/dist/components/cornerEars/cornerGeometry.d.ts +8 -0
- package/dist/components/cornerEars/cornerGeometry.js +63 -0
- package/dist/components/cornerEars/cornerGeometry.js.map +1 -0
- package/dist/components/cornerEars/index.d.ts +2 -0
- package/dist/components/cornerEars/style/index.css +1 -0
- package/dist/components/date/DatePanel.js +398 -0
- package/dist/components/date/DatePanel.js.map +1 -0
- package/dist/components/date/DatePicker.d.ts +226 -0
- package/dist/components/date/DatePicker.js +349 -0
- package/dist/components/date/DatePicker.js.map +1 -0
- package/dist/components/date/Days.d.ts +44 -0
- package/dist/components/date/Days.js +93 -0
- package/dist/components/date/Days.js.map +1 -0
- package/dist/components/date/Months.d.ts +32 -0
- package/dist/components/date/Months.js +87 -0
- package/dist/components/date/Months.js.map +1 -0
- package/dist/components/date/QuickDate.d.ts +24 -0
- package/dist/components/date/QuickDate.js +48 -0
- package/dist/components/date/QuickDate.js.map +1 -0
- package/dist/components/date/Years.d.ts +38 -0
- package/dist/components/date/Years.js +85 -0
- package/dist/components/date/Years.js.map +1 -0
- package/dist/components/date/_use/quickDate.d.ts +4 -0
- package/dist/components/date/_use/quickDate.js +30 -0
- package/dist/components/date/_use/quickDate.js.map +1 -0
- package/dist/components/date/_use/useDateModules.d.ts +37 -0
- package/dist/components/date/_use/useDateModules.js +100 -0
- package/dist/components/date/_use/useDateModules.js.map +1 -0
- package/dist/components/date/config.d.ts +32 -0
- package/dist/components/date/config.js +18 -0
- package/dist/components/date/config.js.map +1 -0
- package/dist/components/date/index.d.ts +3 -0
- package/dist/components/date/style/index.css +1 -0
- package/dist/components/date/types.d.ts +32 -0
- package/dist/components/drawer/Drawer.d.ts +332 -0
- package/dist/components/drawer/Drawer.js +329 -0
- package/dist/components/drawer/Drawer.js.map +1 -0
- package/dist/components/drawer/config.d.ts +28 -0
- package/dist/components/drawer/config.js +16 -0
- package/dist/components/drawer/config.js.map +1 -0
- package/dist/components/drawer/index.d.ts +3 -0
- package/dist/components/drawer/src/style/drawer.css +1 -0
- package/dist/components/ellipsis/Ellipsis.d.ts +74 -0
- package/dist/components/ellipsis/Ellipsis.js +103 -0
- package/dist/components/ellipsis/Ellipsis.js.map +1 -0
- package/dist/components/ellipsis/index.d.ts +1 -0
- package/dist/components/ellipsis/style/index.css +1 -0
- package/dist/components/empty/Empty.d.ts +92 -0
- package/dist/components/empty/Empty.js +85 -0
- package/dist/components/empty/Empty.js.map +1 -0
- package/dist/components/empty/config.d.ts +23 -0
- package/dist/components/empty/config.js +14 -0
- package/dist/components/empty/config.js.map +1 -0
- package/dist/components/empty/index.d.ts +3 -0
- package/dist/components/empty/style/index.css +1 -0
- package/dist/components/empty/type.d.ts +9 -0
- package/dist/components/equalizer/Equalizer.d.ts +62 -0
- package/dist/components/equalizer/Equalizer.js +56 -0
- package/dist/components/equalizer/Equalizer.js.map +1 -0
- package/dist/components/equalizer/index.d.ts +1 -0
- package/dist/components/equalizer/style/index.css +1 -0
- package/dist/components/fallback/Fallback.d.ts +44 -0
- package/dist/components/fallback/Fallback.js +55 -0
- package/dist/components/fallback/Fallback.js.map +1 -0
- package/dist/components/fallback/index.d.ts +1 -0
- package/dist/components/fallback/style/index.css +1 -0
- package/dist/components/form/Form.d.ts +169 -0
- package/dist/components/form/Form.js +235 -0
- package/dist/components/form/Form.js.map +1 -0
- package/dist/components/form/_use/formRules.d.ts +18 -0
- package/dist/components/form/_use/formRules.js +80 -0
- package/dist/components/form/_use/formRules.js.map +1 -0
- package/dist/components/form/config.d.ts +35 -0
- package/dist/components/form/config.js +20 -0
- package/dist/components/form/config.js.map +1 -0
- package/dist/components/form/context.d.ts +34 -0
- package/dist/components/form/context.js +8 -0
- package/dist/components/form/context.js.map +1 -0
- package/dist/components/form/index.d.ts +3 -0
- package/dist/components/form/style/index.css +1 -0
- package/dist/components/formItem/FormItem.d.ts +144 -0
- package/dist/components/formItem/FormItem.js +218 -0
- package/dist/components/formItem/FormItem.js.map +1 -0
- package/dist/components/formItem/config.d.ts +21 -0
- package/dist/components/formItem/config.js +12 -0
- package/dist/components/formItem/config.js.map +1 -0
- package/dist/components/formItem/context.d.ts +22 -0
- package/dist/components/formItem/context.js +8 -0
- package/dist/components/formItem/context.js.map +1 -0
- package/dist/components/formItem/index.d.ts +3 -0
- package/dist/components/formItem/style/index.css +1 -0
- package/dist/components/icon/Icon.d.ts +117 -0
- package/dist/components/icon/Icon.js +116 -0
- package/dist/components/icon/Icon.js.map +1 -0
- package/dist/components/icon/config.d.ts +28 -0
- package/dist/components/icon/config.js +16 -0
- package/dist/components/icon/config.js.map +1 -0
- package/dist/components/icon/index.d.ts +4 -0
- package/dist/components/icon/style/index.css +1 -0
- package/dist/components/icon/type.d.ts +16 -0
- package/dist/components/image/Image.d.ts +21 -0
- package/dist/components/image/Image.js +68 -0
- package/dist/components/image/Image.js.map +1 -0
- package/dist/components/image/config.d.ts +21 -0
- package/dist/components/image/config.js +11 -0
- package/dist/components/image/config.js.map +1 -0
- package/dist/components/image/index.d.ts +4 -0
- package/dist/components/image/style/index.css +1 -0
- package/dist/components/index.d.ts +79 -0
- package/dist/components/index.js +124 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/layer/Layer.d.ts +410 -0
- package/dist/components/layer/Layer.js +557 -0
- package/dist/components/layer/Layer.js.map +1 -0
- package/dist/components/layer/index.d.ts +2 -0
- package/dist/components/layer/injectionKey.d.ts +5 -0
- package/dist/components/layer/injectionKey.js +6 -0
- package/dist/components/layer/injectionKey.js.map +1 -0
- package/dist/components/layer/style/index.css +1 -0
- package/dist/components/lcdFont/LcdFont.d.ts +126 -0
- package/dist/components/lcdFont/LcdFont.js +232 -0
- package/dist/components/lcdFont/LcdFont.js.map +1 -0
- package/dist/components/lcdFont/config.d.ts +43 -0
- package/dist/components/lcdFont/config.js +41 -0
- package/dist/components/lcdFont/config.js.map +1 -0
- package/dist/components/lcdFont/format.d.ts +8 -0
- package/dist/components/lcdFont/format.js +39 -0
- package/dist/components/lcdFont/format.js.map +1 -0
- package/dist/components/lcdFont/index.d.ts +5 -0
- package/dist/components/lcdFont/segments.d.ts +32 -0
- package/dist/components/lcdFont/segments.js +326 -0
- package/dist/components/lcdFont/segments.js.map +1 -0
- package/dist/components/lcdFont/style/index.css +1 -0
- package/dist/components/lcdFont/type.d.ts +26 -0
- package/dist/components/list/List.d.ts +480 -0
- package/dist/components/list/List.js +289 -0
- package/dist/components/list/List.js.map +1 -0
- package/dist/components/list/config.d.ts +3 -0
- package/dist/components/list/index.d.ts +3 -0
- package/dist/components/list/style/index.css +1 -0
- package/dist/components/loading/Loading.d.ts +97 -0
- package/dist/components/loading/Loading.js +124 -0
- package/dist/components/loading/Loading.js.map +1 -0
- package/dist/components/loading/config.d.ts +22 -0
- package/dist/components/loading/config.js +13 -0
- package/dist/components/loading/config.js.map +1 -0
- package/dist/components/loading/index.d.ts +3 -0
- package/dist/components/loading/style/index.css +1 -0
- package/dist/components/loading/type.d.ts +13 -0
- package/dist/components/mask/Mask.d.ts +79 -0
- package/dist/components/mask/Mask.js +82 -0
- package/dist/components/mask/Mask.js.map +1 -0
- package/dist/components/mask/config.d.ts +21 -0
- package/dist/components/mask/config.js +14 -0
- package/dist/components/mask/config.js.map +1 -0
- package/dist/components/mask/index.d.ts +3 -0
- package/dist/components/mask/style/mask.css +1 -0
- package/dist/components/match/Match copy.d.ts +1600 -0
- package/dist/components/match/Match.d.ts +1621 -0
- package/dist/components/match/Match.js +343 -0
- package/dist/components/match/Match.js.map +1 -0
- package/dist/components/match/config.d.ts +29 -0
- package/dist/components/match/config.js +17 -0
- package/dist/components/match/config.js.map +1 -0
- package/dist/components/match/index.d.ts +3 -0
- package/dist/components/match/style/index.css +1 -0
- package/dist/components/modal/Modal.d.ts +460 -0
- package/dist/components/modal/Modal.js +297 -0
- package/dist/components/modal/Modal.js.map +1 -0
- package/dist/components/modal/config.d.ts +33 -0
- package/dist/components/modal/config.js +19 -0
- package/dist/components/modal/config.js.map +1 -0
- package/dist/components/modal/index.d.ts +3 -0
- package/dist/components/modal/style/index.css +1 -0
- package/dist/components/notice/Notice.d.ts +137 -0
- package/dist/components/notice/Notice.js +192 -0
- package/dist/components/notice/Notice.js.map +1 -0
- package/dist/components/notice/index.d.ts +51 -0
- package/dist/components/notice/index.js +243 -0
- package/dist/components/notice/index.js.map +1 -0
- package/dist/components/notice/src/_util/index.d.ts +11 -0
- package/dist/components/notice/src/_util/index.js +50 -0
- package/dist/components/notice/src/_util/index.js.map +1 -0
- package/dist/components/notice/src/style/index.css +1 -0
- package/dist/components/notice/types.d.ts +98 -0
- package/dist/components/number/Number copy.d.ts +966 -0
- package/dist/components/number/Number.d.ts +1034 -0
- package/dist/components/number/Number.js +241 -0
- package/dist/components/number/Number.js.map +1 -0
- package/dist/components/number/config.d.ts +26 -0
- package/dist/components/number/config.js +15 -0
- package/dist/components/number/config.js.map +1 -0
- package/dist/components/number/index.d.ts +3 -0
- package/dist/components/number/style/index.css +1 -0
- package/dist/components/pagination/index.d.ts +3 -0
- package/dist/components/pagination/src/Pagination.d.ts +2830 -0
- package/dist/components/pagination/src/Pagination.js +288 -0
- package/dist/components/pagination/src/Pagination.js.map +1 -0
- package/dist/components/pagination/src/config.d.ts +25 -0
- package/dist/components/pagination/src/config.js +20 -0
- package/dist/components/pagination/src/config.js.map +1 -0
- package/dist/components/pagination/src/style/index.css +1 -0
- package/dist/components/picture/Picture.d.ts +18 -0
- package/dist/components/picture/Picture.js +254 -0
- package/dist/components/picture/Picture.js.map +1 -0
- package/dist/components/picture/PictureToolbar.d.ts +29 -0
- package/dist/components/picture/PictureToolbar.js +97 -0
- package/dist/components/picture/PictureToolbar.js.map +1 -0
- package/dist/components/picture/PictureViewport.d.ts +47 -0
- package/dist/components/picture/PictureViewport.js +203 -0
- package/dist/components/picture/PictureViewport.js.map +1 -0
- package/dist/components/picture/config.d.ts +16 -0
- package/dist/components/picture/config.js +16 -0
- package/dist/components/picture/config.js.map +1 -0
- package/dist/components/picture/index.d.ts +5 -0
- package/dist/components/picture/pictureFlip.d.ts +16 -0
- package/dist/components/picture/pictureFlip.js +103 -0
- package/dist/components/picture/pictureFlip.js.map +1 -0
- package/dist/components/picture/style/index.css +1 -0
- package/dist/components/progress/Progress.d.ts +94 -0
- package/dist/components/progress/Progress.js +112 -0
- package/dist/components/progress/Progress.js.map +1 -0
- package/dist/components/progress/index.d.ts +1 -0
- package/dist/components/progress/style/index.css +1 -0
- package/dist/components/radio/Radio.d.ts +112 -0
- package/dist/components/radio/Radio.js +130 -0
- package/dist/components/radio/Radio.js.map +1 -0
- package/dist/components/radio/config.d.ts +29 -0
- package/dist/components/radio/config.js +18 -0
- package/dist/components/radio/config.js.map +1 -0
- package/dist/components/radio/index.d.ts +3 -0
- package/dist/components/radio/style/index.css +1 -0
- package/dist/components/scrollbar/Scrollbar.d.ts +93 -0
- package/dist/components/scrollbar/Scrollbar.js +515 -0
- package/dist/components/scrollbar/Scrollbar.js.map +1 -0
- package/dist/components/scrollbar/index.d.ts +1 -0
- package/dist/components/scrollbar/style/index.css +1 -0
- package/dist/components/sheet/Sheet.d.ts +1448 -0
- package/dist/components/sheet/Sheet.js +592 -0
- package/dist/components/sheet/Sheet.js.map +1 -0
- package/dist/components/sheet/_cell.d.ts +181 -0
- package/dist/components/sheet/_cell.js +132 -0
- package/dist/components/sheet/_cell.js.map +1 -0
- package/dist/components/sheet/_props.d.ts +170 -0
- package/dist/components/sheet/_props.js +183 -0
- package/dist/components/sheet/_props.js.map +1 -0
- package/dist/components/sheet/_row.d.ts +2 -0
- package/dist/components/sheet/_row.js +14 -0
- package/dist/components/sheet/_row.js.map +1 -0
- package/dist/components/sheet/_tbody.d.ts +348 -0
- package/dist/components/sheet/_tbody.js +255 -0
- package/dist/components/sheet/_tbody.js.map +1 -0
- package/dist/components/sheet/_tfoot.d.ts +195 -0
- package/dist/components/sheet/_tfoot.js +78 -0
- package/dist/components/sheet/_tfoot.js.map +1 -0
- package/dist/components/sheet/_thead.d.ts +529 -0
- package/dist/components/sheet/_thead.js +148 -0
- package/dist/components/sheet/_thead.js.map +1 -0
- package/dist/components/sheet/_use.d.ts +38 -0
- package/dist/components/sheet/_use.js +493 -0
- package/dist/components/sheet/_use.js.map +1 -0
- package/dist/components/sheet/_util.d.ts +34 -0
- package/dist/components/sheet/_util.js +111 -0
- package/dist/components/sheet/_util.js.map +1 -0
- package/dist/components/sheet/index.d.ts +1 -0
- package/dist/components/sheet/style/index.css +1 -0
- package/dist/components/slideDown/SlideDown.d.ts +62 -0
- package/dist/components/slideDown/SlideDown.js +128 -0
- package/dist/components/slideDown/SlideDown.js.map +1 -0
- package/dist/components/slideDown/index.d.ts +1 -0
- package/dist/components/slider/Slider.d.ts +1726 -0
- package/dist/components/slider/Slider.js +471 -0
- package/dist/components/slider/Slider.js.map +1 -0
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/slider/style/index.css +1 -0
- package/dist/components/svgIcon/SvgIcon.d.ts +37 -0
- package/dist/components/svgIcon/SvgIcon.js +78 -0
- package/dist/components/svgIcon/SvgIcon.js.map +1 -0
- package/dist/components/svgIcon/index.d.ts +3 -0
- package/dist/components/svgIcon/style/index.css +1 -0
- package/dist/components/switch/Switch.d.ts +105 -0
- package/dist/components/switch/Switch.js +158 -0
- package/dist/components/switch/Switch.js.map +1 -0
- package/dist/components/switch/config.d.ts +16 -0
- package/dist/components/switch/config.js +11 -0
- package/dist/components/switch/config.js.map +1 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/switch/style/index.css +1 -0
- package/dist/components/tab/Tab.d.ts +113 -0
- package/dist/components/tab/Tab.js +485 -0
- package/dist/components/tab/Tab.js.map +1 -0
- package/dist/components/tab/index.d.ts +2 -0
- package/dist/components/tab/style/index.css +1 -0
- package/dist/components/textarea/Textarea.d.ts +37 -0
- package/dist/components/textarea/Textarea.js +193 -0
- package/dist/components/textarea/Textarea.js.map +1 -0
- package/dist/components/textarea/config.d.ts +30 -0
- package/dist/components/textarea/config.js +16 -0
- package/dist/components/textarea/config.js.map +1 -0
- package/dist/components/textarea/index.d.ts +4 -0
- package/dist/components/textarea/style/index.css +1 -0
- package/dist/components/time/Dial.js +7 -0
- package/dist/components/time/Dial.js.map +1 -0
- package/dist/components/time/Dial.vue_vue_type_script_setup_true_lang.js +178 -0
- package/dist/components/time/Dial.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/time/TimePicker.d.ts +1301 -0
- package/dist/components/time/TimePicker.js +162 -0
- package/dist/components/time/TimePicker.js.map +1 -0
- package/dist/components/time/_use/useTimeModules.d.ts +1 -0
- package/dist/components/time/index.d.ts +1 -0
- package/dist/components/time/style/dial.css +1 -0
- package/dist/components/time/style/index.css +1 -0
- package/dist/components/toggle/Toggle.d.ts +140 -0
- package/dist/components/toggle/Toggle.js +209 -0
- package/dist/components/toggle/Toggle.js.map +1 -0
- package/dist/components/toggle/index.d.ts +1 -0
- package/dist/components/toggle/style/index.css +1 -0
- package/dist/components/toggle/style/scale.css +1 -0
- package/dist/components/toggle/style/translate.css +1 -0
- package/dist/components/tooltip/Tooltip.d.ts +536 -0
- package/dist/components/tooltip/Tooltip.js +51 -0
- package/dist/components/tooltip/Tooltip.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/style/index.css +1 -0
- package/dist/components/tree/Tree.d.ts +187 -0
- package/dist/components/tree/Tree.js +229 -0
- package/dist/components/tree/Tree.js.map +1 -0
- package/dist/components/tree/TreeItem.d.ts +86 -0
- package/dist/components/tree/TreeItem.js +152 -0
- package/dist/components/tree/TreeItem.js.map +1 -0
- package/dist/components/tree/TreeList.d.ts +86 -0
- package/dist/components/tree/TreeList.js +52 -0
- package/dist/components/tree/TreeList.js.map +1 -0
- package/dist/components/tree/_use/treeState.d.ts +45 -0
- package/dist/components/tree/_use/treeState.js +417 -0
- package/dist/components/tree/_use/treeState.js.map +1 -0
- package/dist/components/tree/config.d.ts +27 -0
- package/dist/components/tree/config.js +16 -0
- package/dist/components/tree/config.js.map +1 -0
- package/dist/components/tree/index.d.ts +4 -0
- package/dist/components/tree/style/index.css +1 -0
- package/dist/components/tree-choose/TreeChoose.d.ts +833 -0
- package/dist/components/tree-choose/TreeChoose.js +320 -0
- package/dist/components/tree-choose/TreeChoose.js.map +1 -0
- package/dist/components/tree-choose/config.d.ts +41 -0
- package/dist/components/tree-choose/config.js +19 -0
- package/dist/components/tree-choose/config.js.map +1 -0
- package/dist/components/tree-choose/index.d.ts +4 -0
- package/dist/components/tree-choose/style/index.css +1 -0
- package/dist/components/trigger/Trigger.d.ts +921 -0
- package/dist/components/trigger/Trigger.js +105 -0
- package/dist/components/trigger/Trigger.js.map +1 -0
- package/dist/components/trigger/index.d.ts +1 -0
- package/dist/components/trigger/style/index.css +2 -0
- package/dist/components/upload/Upload.d.ts +249 -0
- package/dist/components/upload/Upload.js +342 -0
- package/dist/components/upload/Upload.js.map +1 -0
- package/dist/components/upload/config.d.ts +39 -0
- package/dist/components/upload/config.js +21 -0
- package/dist/components/upload/config.js.map +1 -0
- package/dist/components/upload/index.d.ts +4 -0
- package/dist/components/upload/style/index.css +1 -0
- package/dist/components/upload/types.d.ts +47 -0
- package/dist/components/virtual/Virtual.d.ts +57 -0
- package/dist/components/virtual/Virtual.js +62 -0
- package/dist/components/virtual/Virtual.js.map +1 -0
- package/dist/components/virtual/Virtual/345/216/237/347/211/210.d.ts +44 -0
- package/dist/components/virtual/index.d.ts +4 -0
- package/dist/components/virtual/style/index.css +1 -0
- package/dist/components/virtual/useVirtualList.d.ts +50 -0
- package/dist/components/virtual/useVirtualList.js +376 -0
- package/dist/components/virtual/useVirtualList.js.map +1 -0
- package/dist/components/write/Write.d.ts +532 -0
- package/dist/components/write/Write.js +228 -0
- package/dist/components/write/Write.js.map +1 -0
- package/dist/components/write/index.d.ts +1 -0
- package/dist/components/write/style/index.css +1 -0
- package/dist/config/dictionary.d.ts +21 -0
- package/dist/config/dictionary.js +28 -0
- package/dist/config/dictionary.js.map +1 -0
- package/dist/config/i18n.d.ts +22 -0
- package/dist/config/i18n.js +53 -0
- package/dist/config/i18n.js.map +1 -0
- package/dist/config/plugin.d.ts +88 -0
- package/dist/config/plugin.js +13 -0
- package/dist/config/plugin.js.map +1 -0
- package/dist/config/types.d.ts +56 -0
- package/dist/directives/clickOutside.d.ts +10 -0
- package/dist/directives/clickOutside.js +69 -0
- package/dist/directives/clickOutside.js.map +1 -0
- package/dist/directives/index.d.ts +3 -0
- package/dist/directives/index.js +13 -0
- package/dist/directives/index.js.map +1 -0
- package/dist/directives/loading.d.ts +19 -0
- package/dist/directives/loading.js +64 -0
- package/dist/directives/loading.js.map +1 -0
- package/dist/index.d.ts +127 -0
- package/dist/index.js +91 -0
- package/dist/locales/de-DE/index.d.ts +144 -0
- package/dist/locales/de-DE/index.js +140 -0
- package/dist/locales/de-DE/index.js.map +1 -0
- package/dist/locales/en-US/index.d.ts +144 -0
- package/dist/locales/en-US/index.js +140 -0
- package/dist/locales/en-US/index.js.map +1 -0
- package/dist/locales/index.d.ts +3 -0
- package/dist/locales/zh-CN/index.d.ts +144 -0
- package/dist/locales/zh-CN/index.js +140 -0
- package/dist/locales/zh-CN/index.js.map +1 -0
- package/dist/plugin.d.ts +6 -0
- package/dist/plugin.js +38 -0
- package/dist/plugin.js.map +1 -0
- package/dist/styles/index.css +49 -0
- package/dist/theme/_transition.css +169 -0
- package/dist/theme/index.css +5 -0
- package/dist/theme/tokens/_base.css +7 -0
- package/dist/theme/tokens/_common.css +37 -0
- package/dist/theme/tokens/_scrollbar.css +53 -0
- package/dist/theme/tokens/_size.css +18 -0
- package/dist/theme/tokens/_text.css +16 -0
- package/dist/theme/tokens/_var.css +1087 -0
- package/dist/theme/tokens/components/audioPlayer.css +542 -0
- package/dist/theme/tokens/components/btn.css +253 -0
- package/dist/theme/tokens/components/btnGroup.css +68 -0
- package/dist/theme/tokens/components/cascade.css +77 -0
- package/dist/theme/tokens/components/checkbox.css +100 -0
- package/dist/theme/tokens/components/choose.css +175 -0
- package/dist/theme/tokens/components/choose2.css +242 -0
- package/dist/theme/tokens/components/chooseItem.css +54 -0
- package/dist/theme/tokens/components/circleProgress.css +61 -0
- package/dist/theme/tokens/components/close.css +12 -0
- package/dist/theme/tokens/components/colorPicker.css +404 -0
- package/dist/theme/tokens/components/confirm.css +128 -0
- package/dist/theme/tokens/components/copy.css +80 -0
- package/dist/theme/tokens/components/cornerEars.css +102 -0
- package/dist/theme/tokens/components/date/days.css +79 -0
- package/dist/theme/tokens/components/date/index.css +249 -0
- package/dist/theme/tokens/components/date/months.css +68 -0
- package/dist/theme/tokens/components/drawer.css +189 -0
- package/dist/theme/tokens/components/ellipsis.css +46 -0
- package/dist/theme/tokens/components/empty.css +24 -0
- package/dist/theme/tokens/components/equalizer.css +51 -0
- package/dist/theme/tokens/components/fallback.css +4 -0
- package/dist/theme/tokens/components/form.css +50 -0
- package/dist/theme/tokens/components/formItem.css +194 -0
- package/dist/theme/tokens/components/icon.css +41 -0
- package/dist/theme/tokens/components/image.css +70 -0
- package/dist/theme/tokens/components/layer.css +190 -0
- package/dist/theme/tokens/components/lcdFont.css +121 -0
- package/dist/theme/tokens/components/list.css +97 -0
- package/dist/theme/tokens/components/loading.css +64 -0
- package/dist/theme/tokens/components/mask.css +26 -0
- package/dist/theme/tokens/components/match.css +119 -0
- package/dist/theme/tokens/components/modal.css +136 -0
- package/dist/theme/tokens/components/notice.css +264 -0
- package/dist/theme/tokens/components/number.css +150 -0
- package/dist/theme/tokens/components/pagination.css +215 -0
- package/dist/theme/tokens/components/picture.css +299 -0
- package/dist/theme/tokens/components/progress.css +101 -0
- package/dist/theme/tokens/components/radio.css +183 -0
- package/dist/theme/tokens/components/scrollbar.css +160 -0
- package/dist/theme/tokens/components/sheet.css +518 -0
- package/dist/theme/tokens/components/slider.css +171 -0
- package/dist/theme/tokens/components/svgIcon.css +6 -0
- package/dist/theme/tokens/components/switch.css +67 -0
- package/dist/theme/tokens/components/tab.css +215 -0
- package/dist/theme/tokens/components/textarea.css +109 -0
- package/dist/theme/tokens/components/time/dial.css +123 -0
- package/dist/theme/tokens/components/time/index.css +29 -0
- package/dist/theme/tokens/components/toggle/index.css +14 -0
- package/dist/theme/tokens/components/toggle/scale.css +34 -0
- package/dist/theme/tokens/components/toggle/translate.css +41 -0
- package/dist/theme/tokens/components/tooltip.css +77 -0
- package/dist/theme/tokens/components/tree-choose.css +154 -0
- package/dist/theme/tokens/components/tree.css +172 -0
- package/dist/theme/tokens/components/trigger.css +90 -0
- package/dist/theme/tokens/components/upload.css +302 -0
- package/dist/theme/tokens/components/virtual.css +6 -0
- package/dist/theme/tokens/components/write.css +155 -0
- package/dist/theme/tokens/iconfont/iconfont.css +103 -0
- package/dist/theme/tokens/iconfont/iconfont.ttf +0 -0
- package/dist/theme/tokens/iconfont/iconfont.woff +0 -0
- package/dist/theme/tokens/iconfont/iconfont.woff2 +0 -0
- package/dist/theme/tokens/index.css +19 -0
- package/dist/use/index.d.ts +34 -0
- package/dist/use/toggle/types.d.ts +27 -0
- package/dist/use/toggle/useToggle.d.ts +22 -0
- package/dist/use/toggle/useToggleArray.d.ts +14 -0
- package/dist/use/toggle/useToggleArray.js +36 -0
- package/dist/use/toggle/useToggleArray.js.map +1 -0
- package/dist/use/toggle/useToggleCycle.d.ts +11 -0
- package/dist/use/toggle/useToggleCycle.js +88 -0
- package/dist/use/toggle/useToggleCycle.js.map +1 -0
- package/dist/use/toggle/useToggleMap.d.ts +10 -0
- package/dist/use/toggle/useToggleObject.d.ts +13 -0
- package/dist/use/useAudioPlayer.d.ts +160 -0
- package/dist/use/useAudioPlayer.js +799 -0
- package/dist/use/useAudioPlayer.js.map +1 -0
- package/dist/use/useBoundingClientRect.d.ts +14 -0
- package/dist/use/useBoundingClientRect.js +54 -0
- package/dist/use/useBoundingClientRect.js.map +1 -0
- package/dist/use/useChildComponentsCollector.js +30 -0
- package/dist/use/useChildComponentsCollector.js.map +1 -0
- package/dist/use/useComponentClass.d.ts +1 -0
- package/dist/use/useComponentClass.js +6 -0
- package/dist/use/useComponentClass.js.map +1 -0
- package/dist/use/useComponentConfig.d.ts +10 -0
- package/dist/use/useComponentConfig.js +31 -0
- package/dist/use/useComponentConfig.js.map +1 -0
- package/dist/use/useCount.d.ts +13 -0
- package/dist/use/useCount.js +36 -0
- package/dist/use/useCount.js.map +1 -0
- package/dist/use/useDate.d.ts +53 -0
- package/dist/use/useDate.js +280 -0
- package/dist/use/useDate.js.map +1 -0
- package/dist/use/useDelay.d.ts +5 -0
- package/dist/use/useDelay.js +38 -0
- package/dist/use/useDelay.js.map +1 -0
- package/dist/use/useDrag.d.ts +17 -0
- package/dist/use/useElement.d.ts +15 -0
- package/dist/use/useElement.js +41 -0
- package/dist/use/useElement.js.map +1 -0
- package/dist/use/useEscStack.d.ts +14 -0
- package/dist/use/useEscStack.js +62 -0
- package/dist/use/useEscStack.js.map +1 -0
- package/dist/use/useEvent.d.ts +9 -0
- package/dist/use/useEvent.js +43 -0
- package/dist/use/useEvent.js.map +1 -0
- package/dist/use/useFormItem.d.ts +9 -0
- package/dist/use/useFormItem.js +20 -0
- package/dist/use/useFormItem.js.map +1 -0
- package/dist/use/useGlobalZIndex.d.ts +6 -0
- package/dist/use/useGlobalZIndex.js +28 -0
- package/dist/use/useGlobalZIndex.js.map +1 -0
- package/dist/use/useMouse.d.ts +15 -0
- package/dist/use/useMouse.js +36 -0
- package/dist/use/useMouse.js.map +1 -0
- package/dist/use/useMousePositionInElement.d.ts +6 -0
- package/dist/use/useMousePositionInElement.js +27 -0
- package/dist/use/useMousePositionInElement.js.map +1 -0
- package/dist/use/useParentNode.d.ts +3 -0
- package/dist/use/useParentNode.js +25 -0
- package/dist/use/useParentNode.js.map +1 -0
- package/dist/use/usePercentDrag.d.ts +20 -0
- package/dist/use/usePercentDrag.js +59 -0
- package/dist/use/usePercentDrag.js.map +1 -0
- package/dist/use/usePictureViewport.d.ts +57 -0
- package/dist/use/usePictureViewport.js +229 -0
- package/dist/use/usePictureViewport.js.map +1 -0
- package/dist/use/useRequest.d.ts +7 -0
- package/dist/use/useRequest.js +31 -0
- package/dist/use/useRequest.js.map +1 -0
- package/dist/use/useScaleFromPoint.d.ts +57 -0
- package/dist/use/useScaleFromPoint.js +325 -0
- package/dist/use/useScaleFromPoint.js.map +1 -0
- package/dist/use/useScroll.d.ts +9 -0
- package/dist/use/useScroll.js +60 -0
- package/dist/use/useScroll.js.map +1 -0
- package/dist/use/useSearch.d.ts +11 -0
- package/dist/use/useSearch.js +65 -0
- package/dist/use/useSearch.js.map +1 -0
- package/dist/use/useSlot.d.ts +10 -0
- package/dist/use/useSlot.js +57 -0
- package/dist/use/useSlot.js.map +1 -0
- package/dist/use/useTabIndex.d.ts +1 -0
- package/dist/use/useTabIndex.js +18 -0
- package/dist/use/useTabIndex.js.map +1 -0
- package/dist/use/useUII18n.js +26 -0
- package/dist/use/useUII18n.js.map +1 -0
- package/dist/use/useUpload.d.ts +49 -0
- package/dist/use/useUpload.js +396 -0
- package/dist/use/useUpload.js.map +1 -0
- package/dist/use/useVisibleResize.d.ts +6 -0
- package/dist/use/useVisibleResize.js +77 -0
- package/dist/use/useVisibleResize.js.map +1 -0
- package/dist/util/calc.d.ts +40 -0
- package/dist/util/calc.js +239 -0
- package/dist/util/calc.js.map +1 -0
- package/dist/util/colors.d.ts +78 -0
- package/dist/util/colors.js +320 -0
- package/dist/util/colors.js.map +1 -0
- package/dist/util/cssVars.d.ts +62 -0
- package/dist/util/cssVars.js +170 -0
- package/dist/util/cssVars.js.map +1 -0
- package/dist/util/dom.d.ts +65 -0
- package/dist/util/dom.js +212 -0
- package/dist/util/dom.js.map +1 -0
- package/dist/util/index.d.ts +5 -0
- package/dist/util/tools.d.ts +54 -0
- package/dist/util/tools.js +90 -0
- package/dist/util/tools.js.map +1 -0
- package/dist/util/vnode.d.ts +2 -0
- package/package.json +88 -0
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
import { effectiveSizeVar, propColorToCssVars, propSizeToCssVars, toCssVarsStyle } from "../../util/cssVars.js";
|
|
2
|
+
import useFormItem from "../../use/useFormItem.js";
|
|
3
|
+
import Tooltip_default from "../tooltip/Tooltip.js";
|
|
4
|
+
import { useUII18n } from "../../use/useUII18n.js";
|
|
5
|
+
import Number_default from "../number/Number.js";
|
|
6
|
+
import { computed, createVNode, defineComponent, mergeProps, onBeforeUnmount, reactive, ref, watch } from "vue";
|
|
7
|
+
//#region components/slider/Slider.tsx
|
|
8
|
+
var MULTIPLES = 1e4;
|
|
9
|
+
function toBig(n) {
|
|
10
|
+
return Math.round(n * MULTIPLES);
|
|
11
|
+
}
|
|
12
|
+
function stepMeta(min, max, step) {
|
|
13
|
+
const minB = toBig(min);
|
|
14
|
+
const maxB = toBig(max);
|
|
15
|
+
const lo = Math.min(minB, maxB);
|
|
16
|
+
const hi = Math.max(minB, maxB);
|
|
17
|
+
const stepB = step > 0 ? Math.max(1, toBig(step)) : Math.max(1, hi - lo);
|
|
18
|
+
const fullCount = Math.floor((hi - lo) / stepB) + 1;
|
|
19
|
+
const extraMax = lo + (fullCount - 1) * stepB !== hi;
|
|
20
|
+
return {
|
|
21
|
+
lo,
|
|
22
|
+
hi,
|
|
23
|
+
stepB,
|
|
24
|
+
fullCount,
|
|
25
|
+
extraMax,
|
|
26
|
+
total: extraMax ? fullCount + 1 : fullCount
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function indexToBig(i, m) {
|
|
30
|
+
const iClamped = Math.max(0, Math.min(m.total - 1, i));
|
|
31
|
+
if (m.extraMax && iClamped === m.total - 1) return m.hi;
|
|
32
|
+
return m.lo + iClamped * m.stepB;
|
|
33
|
+
}
|
|
34
|
+
function bigToIndex(vB, m) {
|
|
35
|
+
const lastFullI = m.fullCount - 1;
|
|
36
|
+
const i = Math.max(0, Math.min(lastFullI, Math.round((vB - m.lo) / m.stepB)));
|
|
37
|
+
const snappedB = m.lo + i * m.stepB;
|
|
38
|
+
if (m.extraMax && Math.abs(vB - m.hi) <= Math.abs(vB - snappedB)) return m.total - 1;
|
|
39
|
+
return i;
|
|
40
|
+
}
|
|
41
|
+
function percentToIndex(p, total) {
|
|
42
|
+
if (total <= 1) return 0;
|
|
43
|
+
return Math.round(Math.min(1, Math.max(0, p)) * (total - 1));
|
|
44
|
+
}
|
|
45
|
+
var Slider_default = /* @__PURE__ */ defineComponent({
|
|
46
|
+
name: "Slider",
|
|
47
|
+
components: {
|
|
48
|
+
Tooltip: Tooltip_default,
|
|
49
|
+
Num: Number_default
|
|
50
|
+
},
|
|
51
|
+
props: {
|
|
52
|
+
modelValue: {
|
|
53
|
+
type: Number,
|
|
54
|
+
default: 0
|
|
55
|
+
},
|
|
56
|
+
step: {
|
|
57
|
+
type: Number,
|
|
58
|
+
default: 2
|
|
59
|
+
},
|
|
60
|
+
min: {
|
|
61
|
+
type: Number,
|
|
62
|
+
default: 0
|
|
63
|
+
},
|
|
64
|
+
max: {
|
|
65
|
+
type: Number,
|
|
66
|
+
default: 30
|
|
67
|
+
},
|
|
68
|
+
showTooltip: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: true
|
|
71
|
+
},
|
|
72
|
+
tip: { type: Function },
|
|
73
|
+
direction: {
|
|
74
|
+
type: Object,
|
|
75
|
+
default: () => ({
|
|
76
|
+
x: true,
|
|
77
|
+
y: false
|
|
78
|
+
})
|
|
79
|
+
},
|
|
80
|
+
fill: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: true
|
|
83
|
+
},
|
|
84
|
+
hasInput: Boolean,
|
|
85
|
+
inputWidth: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: "3.5em"
|
|
88
|
+
},
|
|
89
|
+
invalidateTip: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: void 0
|
|
92
|
+
},
|
|
93
|
+
disabled: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: false
|
|
96
|
+
},
|
|
97
|
+
readonly: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: false
|
|
100
|
+
},
|
|
101
|
+
/** 实例尺度(px)→ --w-prop-slider-size;并桥接内部 Tooltip */
|
|
102
|
+
size: {
|
|
103
|
+
type: Number,
|
|
104
|
+
default: void 0
|
|
105
|
+
},
|
|
106
|
+
/** 品牌主色 → `--w-prop-slider-color` */
|
|
107
|
+
color: {
|
|
108
|
+
type: String,
|
|
109
|
+
default: void 0
|
|
110
|
+
},
|
|
111
|
+
/** 实例 CSS 变量 */
|
|
112
|
+
cssVars: {
|
|
113
|
+
type: Object,
|
|
114
|
+
default: void 0
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
emits: {
|
|
118
|
+
input: (value, percent) => {
|
|
119
|
+
return typeof value === "number" && (percent === void 0 || typeof percent === "number");
|
|
120
|
+
},
|
|
121
|
+
"update:modelValue": (v) => {
|
|
122
|
+
return typeof v === "number";
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
setup(props, { emit }) {
|
|
126
|
+
const { t } = useUII18n();
|
|
127
|
+
const { formItem, useDisabled } = useFormItem();
|
|
128
|
+
const disabled = useDisabled(computed(() => props.disabled));
|
|
129
|
+
const meta = computed(() => stepMeta(props.min, props.max, props.step));
|
|
130
|
+
const dragging = ref(false);
|
|
131
|
+
const focused = ref(false);
|
|
132
|
+
const hoverTip = ref(false);
|
|
133
|
+
const showInvalidTip = ref(false);
|
|
134
|
+
const pos = reactive({
|
|
135
|
+
left: 0,
|
|
136
|
+
top: 0
|
|
137
|
+
});
|
|
138
|
+
const currentXValue = ref(props.modelValue);
|
|
139
|
+
const currentYValue = ref(props.modelValue);
|
|
140
|
+
const rod = ref();
|
|
141
|
+
const root = ref();
|
|
142
|
+
let pointerId = null;
|
|
143
|
+
const inactive = computed(() => disabled.value || props.readonly);
|
|
144
|
+
const axis = computed(() => {
|
|
145
|
+
const { x, y } = props.direction;
|
|
146
|
+
return {
|
|
147
|
+
x: !!x,
|
|
148
|
+
y: !!y,
|
|
149
|
+
both: !!x && !!y,
|
|
150
|
+
one: !!(x && !y) || !!(!x && y)
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
const displayValue = computed(() => axis.value.y && !axis.value.x ? currentYValue.value : currentXValue.value);
|
|
154
|
+
let lastEmitted = props.modelValue;
|
|
155
|
+
const tipContent = computed(() => {
|
|
156
|
+
if (!props.showTooltip) return;
|
|
157
|
+
const { x, y } = axis.value;
|
|
158
|
+
if (props.tip) return props.tip({
|
|
159
|
+
x: currentXValue.value,
|
|
160
|
+
y: currentYValue.value
|
|
161
|
+
});
|
|
162
|
+
if (x && y) return `${currentXValue.value},${currentYValue.value}`;
|
|
163
|
+
if (x) return currentXValue.value;
|
|
164
|
+
if (y) return currentYValue.value;
|
|
165
|
+
});
|
|
166
|
+
const rootTokenStyle = computed(() => toCssVarsStyle({
|
|
167
|
+
...propSizeToCssVars("slider", props.size),
|
|
168
|
+
...propColorToCssVars("slider", props.color),
|
|
169
|
+
...props.cssVars
|
|
170
|
+
}));
|
|
171
|
+
const tooltipLayerStyle = computed(() => toCssVarsStyle({
|
|
172
|
+
...propSizeToCssVars("slider", props.size),
|
|
173
|
+
...propColorToCssVars("slider", props.color),
|
|
174
|
+
"--w-prop-tooltip-size": effectiveSizeVar("slider"),
|
|
175
|
+
...props.cssVars
|
|
176
|
+
}));
|
|
177
|
+
const sliderClass = computed(() => {
|
|
178
|
+
const { x, y } = axis.value;
|
|
179
|
+
return [
|
|
180
|
+
"w-slider",
|
|
181
|
+
x && y ? "w-slider-xy" : x ? "w-slider-x" : y ? "w-slider-y" : "",
|
|
182
|
+
{
|
|
183
|
+
"w-slider-disabled": disabled.value,
|
|
184
|
+
"w-slider-readonly": props.readonly,
|
|
185
|
+
"w-slider-dragging": dragging.value
|
|
186
|
+
}
|
|
187
|
+
];
|
|
188
|
+
});
|
|
189
|
+
const tooltipOptions = computed(() => {
|
|
190
|
+
const { x } = axis.value;
|
|
191
|
+
return {
|
|
192
|
+
placement: x ? "top" : "left",
|
|
193
|
+
adjustPosition: x ? "top" : "left",
|
|
194
|
+
manual: true,
|
|
195
|
+
realTime: true,
|
|
196
|
+
show: (dragging.value || hoverTip.value || focused.value) && props.showTooltip,
|
|
197
|
+
layerStyle: tooltipLayerStyle.value,
|
|
198
|
+
offset: {
|
|
199
|
+
x: x ? 0 : -2,
|
|
200
|
+
y: x ? -2 : 0
|
|
201
|
+
},
|
|
202
|
+
arrowOffset: {
|
|
203
|
+
x: x ? -3 : 0,
|
|
204
|
+
y: x ? 0 : -3
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
function emitIfOneAxis() {
|
|
209
|
+
if (!axis.value.one) return;
|
|
210
|
+
const v = displayValue.value;
|
|
211
|
+
if (v === lastEmitted) return;
|
|
212
|
+
lastEmitted = v;
|
|
213
|
+
const percent = axis.value.x ? pos.left : pos.top;
|
|
214
|
+
emit("update:modelValue", v);
|
|
215
|
+
emit("input", v, percent);
|
|
216
|
+
formItem?.validate("change");
|
|
217
|
+
}
|
|
218
|
+
function applyIndex(i, which, silent = false) {
|
|
219
|
+
const m = meta.value;
|
|
220
|
+
const next = indexToBig(i, m) / MULTIPLES;
|
|
221
|
+
const p = m.total <= 1 ? 0 : Math.max(0, Math.min(m.total - 1, i)) / (m.total - 1);
|
|
222
|
+
let changed = false;
|
|
223
|
+
if (which === "x" || which === "both") {
|
|
224
|
+
if (pos.left !== p) {
|
|
225
|
+
pos.left = p;
|
|
226
|
+
changed = true;
|
|
227
|
+
}
|
|
228
|
+
if (currentXValue.value !== next) {
|
|
229
|
+
currentXValue.value = next;
|
|
230
|
+
changed = true;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (which === "y" || which === "both") {
|
|
234
|
+
if (pos.top !== p) {
|
|
235
|
+
pos.top = p;
|
|
236
|
+
changed = true;
|
|
237
|
+
}
|
|
238
|
+
if (currentYValue.value !== next) {
|
|
239
|
+
currentYValue.value = next;
|
|
240
|
+
changed = true;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (!silent && changed) emitIfOneAxis();
|
|
244
|
+
}
|
|
245
|
+
function setByValue(v, silent = true) {
|
|
246
|
+
const i = bigToIndex(toBig(v), meta.value);
|
|
247
|
+
const { x, y } = axis.value;
|
|
248
|
+
applyIndex(i, y && !x ? "y" : "x", silent);
|
|
249
|
+
}
|
|
250
|
+
function pointerPercent(e) {
|
|
251
|
+
const el = root.value;
|
|
252
|
+
const knob = rod.value;
|
|
253
|
+
if (!el) return {
|
|
254
|
+
px: 0,
|
|
255
|
+
py: 0
|
|
256
|
+
};
|
|
257
|
+
const rect = el.getBoundingClientRect();
|
|
258
|
+
const rodW = knob?.offsetWidth ?? 0;
|
|
259
|
+
const rodH = knob?.offsetHeight ?? 0;
|
|
260
|
+
const ux = Math.max(1, rect.width - rodW);
|
|
261
|
+
const uy = Math.max(1, rect.height - rodH);
|
|
262
|
+
return {
|
|
263
|
+
px: (e.clientX - rect.left - rodW / 2) / ux,
|
|
264
|
+
py: (e.clientY - rect.top - rodH / 2) / uy
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function applyPointer(e) {
|
|
268
|
+
const { px, py } = pointerPercent(e);
|
|
269
|
+
const total = meta.value.total;
|
|
270
|
+
const { x, y } = axis.value;
|
|
271
|
+
if (x && y) {
|
|
272
|
+
const ix = percentToIndex(px, total);
|
|
273
|
+
const iy = percentToIndex(py, total);
|
|
274
|
+
const m = meta.value;
|
|
275
|
+
pos.left = total <= 1 ? 0 : ix / (total - 1);
|
|
276
|
+
pos.top = total <= 1 ? 0 : iy / (total - 1);
|
|
277
|
+
currentXValue.value = indexToBig(ix, m) / MULTIPLES;
|
|
278
|
+
currentYValue.value = indexToBig(iy, m) / MULTIPLES;
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
if (x) applyIndex(percentToIndex(px, total), "x");
|
|
282
|
+
else if (y) applyIndex(percentToIndex(py, total), "y");
|
|
283
|
+
}
|
|
284
|
+
function endDrag(e) {
|
|
285
|
+
if (!dragging.value) return;
|
|
286
|
+
dragging.value = false;
|
|
287
|
+
const el = root.value;
|
|
288
|
+
if (el && pointerId != null) try {
|
|
289
|
+
if (el.hasPointerCapture(pointerId)) el.releasePointerCapture(pointerId);
|
|
290
|
+
} catch {}
|
|
291
|
+
pointerId = null;
|
|
292
|
+
document.body.style.userSelect = "";
|
|
293
|
+
document.body.style.cursor = "";
|
|
294
|
+
if (e) e.preventDefault();
|
|
295
|
+
}
|
|
296
|
+
function handlePointerDown(e) {
|
|
297
|
+
if (inactive.value) return;
|
|
298
|
+
if (e.pointerType === "mouse" && e.button !== 0) return;
|
|
299
|
+
e.preventDefault();
|
|
300
|
+
const el = root.value;
|
|
301
|
+
if (!el) return;
|
|
302
|
+
pointerId = e.pointerId;
|
|
303
|
+
try {
|
|
304
|
+
el.setPointerCapture(e.pointerId);
|
|
305
|
+
} catch {}
|
|
306
|
+
dragging.value = true;
|
|
307
|
+
showInvalidTip.value = false;
|
|
308
|
+
document.body.style.userSelect = "none";
|
|
309
|
+
document.body.style.cursor = "grabbing";
|
|
310
|
+
applyPointer(e);
|
|
311
|
+
}
|
|
312
|
+
function handlePointerMove(e) {
|
|
313
|
+
if (!dragging.value || e.pointerId !== pointerId) return;
|
|
314
|
+
e.preventDefault();
|
|
315
|
+
applyPointer(e);
|
|
316
|
+
}
|
|
317
|
+
function handlePointerUp(e) {
|
|
318
|
+
if (e.pointerId !== pointerId) return;
|
|
319
|
+
endDrag(e);
|
|
320
|
+
}
|
|
321
|
+
function nudge(delta) {
|
|
322
|
+
if (inactive.value) return;
|
|
323
|
+
const m = meta.value;
|
|
324
|
+
const { x, y } = axis.value;
|
|
325
|
+
if (x && !y) applyIndex(bigToIndex(toBig(currentXValue.value), m) + delta, "x");
|
|
326
|
+
else if (y && !x) applyIndex(bigToIndex(toBig(currentYValue.value), m) + delta, "y");
|
|
327
|
+
}
|
|
328
|
+
function handleKeydown(e) {
|
|
329
|
+
if (inactive.value || axis.value.both) return;
|
|
330
|
+
const m = meta.value;
|
|
331
|
+
const page = Math.max(1, Math.round((m.total - 1) / 10));
|
|
332
|
+
switch (e.key) {
|
|
333
|
+
case "ArrowLeft":
|
|
334
|
+
case "ArrowDown":
|
|
335
|
+
e.preventDefault();
|
|
336
|
+
nudge(-1);
|
|
337
|
+
break;
|
|
338
|
+
case "ArrowRight":
|
|
339
|
+
case "ArrowUp":
|
|
340
|
+
e.preventDefault();
|
|
341
|
+
nudge(1);
|
|
342
|
+
break;
|
|
343
|
+
case "PageDown":
|
|
344
|
+
e.preventDefault();
|
|
345
|
+
nudge(-page);
|
|
346
|
+
break;
|
|
347
|
+
case "PageUp":
|
|
348
|
+
e.preventDefault();
|
|
349
|
+
nudge(page);
|
|
350
|
+
break;
|
|
351
|
+
case "Home":
|
|
352
|
+
e.preventDefault();
|
|
353
|
+
applyIndex(0, axis.value.x ? "x" : "y");
|
|
354
|
+
break;
|
|
355
|
+
case "End":
|
|
356
|
+
e.preventDefault();
|
|
357
|
+
applyIndex(m.total - 1, axis.value.x ? "x" : "y");
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function validateInputValue(v) {
|
|
361
|
+
const m = meta.value;
|
|
362
|
+
return indexToBig(bigToIndex(toBig(v), m), m) === toBig(v);
|
|
363
|
+
}
|
|
364
|
+
watch(() => props.modelValue, (v) => {
|
|
365
|
+
if (dragging.value || axis.value.both) return;
|
|
366
|
+
if (v === displayValue.value) return;
|
|
367
|
+
lastEmitted = v;
|
|
368
|
+
setByValue(v, true);
|
|
369
|
+
});
|
|
370
|
+
watch(() => [
|
|
371
|
+
props.min,
|
|
372
|
+
props.max,
|
|
373
|
+
props.step
|
|
374
|
+
], () => {
|
|
375
|
+
if (dragging.value) return;
|
|
376
|
+
const snapped = indexToBig(bigToIndex(toBig(props.modelValue), meta.value), meta.value) / MULTIPLES;
|
|
377
|
+
setByValue(props.modelValue, snapped === props.modelValue);
|
|
378
|
+
});
|
|
379
|
+
setByValue(props.modelValue);
|
|
380
|
+
onBeforeUnmount(() => endDrag());
|
|
381
|
+
return () => {
|
|
382
|
+
const { x, y } = axis.value;
|
|
383
|
+
const rodPosition = {};
|
|
384
|
+
const progressSize = {};
|
|
385
|
+
if (x) {
|
|
386
|
+
rodPosition["--__pos-x"] = String(pos.left);
|
|
387
|
+
progressSize.width = `${pos.left * 100}%`;
|
|
388
|
+
}
|
|
389
|
+
if (y) {
|
|
390
|
+
rodPosition["--__pos-y"] = String(pos.top);
|
|
391
|
+
progressSize.height = `${pos.top * 100}%`;
|
|
392
|
+
}
|
|
393
|
+
const sliderRod = createVNode("div", {
|
|
394
|
+
"class": "w-slider-rod",
|
|
395
|
+
"ref": rod,
|
|
396
|
+
"style": rodPosition
|
|
397
|
+
}, [createVNode(Tooltip_default, tooltipOptions.value, {
|
|
398
|
+
trigger: () => createVNode("div", {
|
|
399
|
+
"class": ["w-slider-for-tip", { "rod-in-dragging": dragging.value }],
|
|
400
|
+
"onDragstart": (e) => e.preventDefault(),
|
|
401
|
+
"onMouseenter": () => hoverTip.value = true,
|
|
402
|
+
"onMouseleave": () => hoverTip.value = false
|
|
403
|
+
}, null),
|
|
404
|
+
default: () => tipContent.value
|
|
405
|
+
})]);
|
|
406
|
+
const main = createVNode("div", mergeProps(mergeProps({
|
|
407
|
+
class: sliderClass.value,
|
|
408
|
+
style: rootTokenStyle.value
|
|
409
|
+
}, { ref: root }), {
|
|
410
|
+
"role": axis.value.both ? void 0 : "slider",
|
|
411
|
+
"tabindex": disabled.value ? -1 : 0,
|
|
412
|
+
"aria-valuemin": props.min,
|
|
413
|
+
"aria-valuemax": props.max,
|
|
414
|
+
"aria-valuenow": displayValue.value,
|
|
415
|
+
"aria-orientation": axis.value.both ? void 0 : x ? "horizontal" : "vertical",
|
|
416
|
+
"aria-disabled": disabled.value || void 0,
|
|
417
|
+
"aria-readonly": props.readonly || void 0,
|
|
418
|
+
"onPointerdown": handlePointerDown,
|
|
419
|
+
"onPointermove": handlePointerMove,
|
|
420
|
+
"onPointerup": handlePointerUp,
|
|
421
|
+
"onPointercancel": handlePointerUp,
|
|
422
|
+
"onKeydown": handleKeydown,
|
|
423
|
+
"onFocus": () => focused.value = true,
|
|
424
|
+
"onBlur": () => focused.value = false
|
|
425
|
+
}), [props.fill ? createVNode("div", {
|
|
426
|
+
"class": "w-slider-progress",
|
|
427
|
+
"style": progressSize
|
|
428
|
+
}, null) : null, sliderRod]);
|
|
429
|
+
if (props.hasInput && !axis.value.both) return createVNode("div", { "class": "w-slider-has-input" }, [main, createVNode(Tooltip_default, {
|
|
430
|
+
"real-time": true,
|
|
431
|
+
"manual": true,
|
|
432
|
+
"placement": "top",
|
|
433
|
+
"adjustPosition": "bottom",
|
|
434
|
+
"show": showInvalidTip.value,
|
|
435
|
+
"layerStyle": tooltipLayerStyle.value
|
|
436
|
+
}, {
|
|
437
|
+
trigger: () => createVNode(Number_default, mergeProps({
|
|
438
|
+
"hasBtn": false,
|
|
439
|
+
"width": props.inputWidth,
|
|
440
|
+
"min": Math.min(props.min, props.max),
|
|
441
|
+
"max": Math.max(props.min, props.max),
|
|
442
|
+
"step": props.step,
|
|
443
|
+
"modelValue": props.modelValue,
|
|
444
|
+
"disabled": disabled.value,
|
|
445
|
+
"readonly": props.readonly
|
|
446
|
+
}, {
|
|
447
|
+
onKeydown: (e) => {
|
|
448
|
+
if (inactive.value) return;
|
|
449
|
+
if (e.key === "Enter") e.target.blur();
|
|
450
|
+
},
|
|
451
|
+
onBlur: (e) => {
|
|
452
|
+
if (inactive.value) return;
|
|
453
|
+
const target = e.target;
|
|
454
|
+
const v = parseFloat(target.value);
|
|
455
|
+
if (isNaN(v)) return;
|
|
456
|
+
if (validateInputValue(v)) {
|
|
457
|
+
showInvalidTip.value = false;
|
|
458
|
+
setByValue(v, false);
|
|
459
|
+
} else showInvalidTip.value = true;
|
|
460
|
+
}
|
|
461
|
+
}), null),
|
|
462
|
+
default: () => props.invalidateTip || t("slider.invalid")
|
|
463
|
+
})]);
|
|
464
|
+
return main;
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
//#endregion
|
|
469
|
+
export { Slider_default as default };
|
|
470
|
+
|
|
471
|
+
//# sourceMappingURL=Slider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.js","names":["computed","mergeProps","ref","reactive","watch","onBeforeUnmount","defineComponent","createVNode","_createVNode","_mergeProps","Tooltip","Num","useUII18n","useFormItem","propSizeToCssVars","propColorToCssVars","effectiveSizeVar","toCssVarsStyle","MULTIPLES","toBig","n","Math","round","stepMeta","min","max","step","minB","maxB","lo","hi","stepB","fullCount","floor","lastFull","extraMax","total","indexToBig","i","m","iClamped","bigToIndex","vB","lastFullI","snappedB","abs","percentToIndex","p","name","components","props","modelValue","type","Number","default","showTooltip","Boolean","tip","Function","direction","Object","x","y","fill","hasInput","inputWidth","String","invalidateTip","undefined","disabled","readonly","size","color","cssVars","emits","input","value","percent","v","setup","emit","t","formItem","useDisabled","meta","dragging","focused","hoverTip","showInvalidTip","pos","left","top","currentXValue","currentYValue","rod","root","pointerId","inactive","axis","both","one","displayValue","lastEmitted","tipContent","rootTokenStyle","tooltipLayerStyle","sliderClass","tooltipOptions","placement","adjustPosition","manual","realTime","show","layerStyle","offset","arrowOffset","emitIfOneAxis","validate","applyIndex","which","silent","next","changed","setByValue","pointerPercent","e","el","knob","px","py","rect","getBoundingClientRect","rodW","offsetWidth","rodH","offsetHeight","ux","width","uy","height","clientX","clientY","applyPointer","ix","iy","endDrag","hasPointerCapture","releasePointerCapture","document","body","style","userSelect","cursor","preventDefault","handlePointerDown","pointerType","button","setPointerCapture","handlePointerMove","handlePointerUp","nudge","delta","handleKeydown","page","key","validateInputValue","snapped","rodPosition","progressSize","sliderRod","trigger","onMouseenter","onMouseleave","main","class","onFocus","onBlur","onKeydown","target","blur","parseFloat","isNaN"],"sources":["../../../components/slider/Slider.tsx"],"sourcesContent":["import {\r\n computed,\r\n mergeProps,\r\n ref,\r\n reactive,\r\n watch,\r\n onBeforeUnmount,\r\n defineComponent,\r\n} from 'vue'\r\nimport type { PropType } from 'vue'\r\nimport type {\r\n DragDirection,\r\n PlacementType,\r\n AdjustmentPosition,\r\n} from '../../config/types'\r\nimport Tooltip from '../tooltip/index'\r\nimport Num from '../number/index'\r\nimport { useUII18n } from '../../use/useUII18n'\r\nimport useFormItem from '../../use/useFormItem'\r\nimport {\r\n propSizeToCssVars,\r\n propColorToCssVars,\r\n effectiveSizeVar,\r\n toCssVarsStyle,\r\n type CssVars,\r\n} from '../../util'\r\n\r\nconst MULTIPLES = 10000\r\n\r\nfunction toBig(n: number) {\r\n return Math.round(n * MULTIPLES)\r\n}\r\n\r\nfunction stepMeta(min: number, max: number, step: number) {\r\n const minB = toBig(min)\r\n const maxB = toBig(max)\r\n const lo = Math.min(minB, maxB)\r\n const hi = Math.max(minB, maxB)\r\n const stepB = step > 0 ? Math.max(1, toBig(step)) : Math.max(1, hi - lo)\r\n const fullCount = Math.floor((hi - lo) / stepB) + 1\r\n const lastFull = lo + (fullCount - 1) * stepB\r\n const extraMax = lastFull !== hi\r\n return {\r\n lo,\r\n hi,\r\n stepB,\r\n fullCount,\r\n extraMax,\r\n total: extraMax ? fullCount + 1 : fullCount,\r\n }\r\n}\r\n\r\nfunction indexToBig(i: number, m: ReturnType<typeof stepMeta>) {\r\n const iClamped = Math.max(0, Math.min(m.total - 1, i))\r\n if (m.extraMax && iClamped === m.total - 1) return m.hi\r\n return m.lo + iClamped * m.stepB\r\n}\r\n\r\nfunction bigToIndex(vB: number, m: ReturnType<typeof stepMeta>) {\r\n const lastFullI = m.fullCount - 1\r\n const i = Math.max(0, Math.min(lastFullI, Math.round((vB - m.lo) / m.stepB)))\r\n const snappedB = m.lo + i * m.stepB\r\n if (m.extraMax && Math.abs(vB - m.hi) <= Math.abs(vB - snappedB)) {\r\n return m.total - 1\r\n }\r\n return i\r\n}\r\n\r\nfunction percentToIndex(p: number, total: number) {\r\n if (total <= 1) return 0\r\n return Math.round(Math.min(1, Math.max(0, p)) * (total - 1))\r\n}\r\n\r\nexport default defineComponent({\r\n name: 'Slider',\r\n components: {\r\n Tooltip,\r\n Num,\r\n },\r\n props: {\r\n modelValue: { type: Number, default: 0 },\r\n step: { type: Number, default: 2 },\r\n min: { type: Number, default: 0 },\r\n max: { type: Number, default: 30 },\r\n showTooltip: { type: Boolean, default: true },\r\n tip: { type: Function as PropType<(pos: { x: number; y: number }) => any> },\r\n direction: {\r\n type: Object as PropType<DragDirection>,\r\n default: () => ({\r\n x: true,\r\n y: false,\r\n }),\r\n },\r\n fill: { type: Boolean, default: true },\r\n hasInput: Boolean,\r\n inputWidth: {\r\n type: String,\r\n default: '3.5em',\r\n },\r\n invalidateTip: {\r\n type: String,\r\n default: undefined,\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n readonly: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n /** 实例尺度(px)→ --w-prop-slider-size;并桥接内部 Tooltip */\r\n size: { type: Number, default: undefined },\r\n /** 品牌主色 → `--w-prop-slider-color` */\r\n color: { type: String, default: undefined },\r\n /** 实例 CSS 变量 */\r\n cssVars: { type: Object as PropType<CssVars>, default: undefined },\r\n },\r\n emits: {\r\n input: (value: number, percent?: number) => {\r\n return (\r\n typeof value === 'number' &&\r\n (percent === undefined || typeof percent === 'number')\r\n )\r\n },\r\n 'update:modelValue': (v: number) => {\r\n return typeof v === 'number'\r\n },\r\n },\r\n setup(props, { emit }) {\r\n const { t } = useUII18n()\r\n const { formItem, useDisabled } = useFormItem()\r\n const disabled = useDisabled(computed(() => props.disabled))\r\n\r\n const meta = computed(() => stepMeta(props.min, props.max, props.step))\r\n\r\n const dragging = ref(false)\r\n const focused = ref(false)\r\n const hoverTip = ref(false)\r\n const showInvalidTip = ref(false)\r\n const pos = reactive({ left: 0, top: 0 })\r\n const currentXValue = ref(props.modelValue)\r\n const currentYValue = ref(props.modelValue)\r\n const rod = ref<HTMLElement>()\r\n const root = ref<HTMLElement>()\r\n let pointerId: number | null = null\r\n\r\n const inactive = computed(() => disabled.value || props.readonly)\r\n const axis = computed(() => {\r\n const { x, y } = props.direction\r\n return {\r\n x: !!x,\r\n y: !!y,\r\n both: !!x && !!y,\r\n one: !!(x && !y) || !!(!x && y),\r\n }\r\n })\r\n\r\n const displayValue = computed(() =>\r\n axis.value.y && !axis.value.x ? currentYValue.value : currentXValue.value,\r\n )\r\n let lastEmitted = props.modelValue\r\n\r\n const tipContent = computed(() => {\r\n if (!props.showTooltip) return\r\n const { x, y } = axis.value\r\n if (props.tip) {\r\n return props.tip({ x: currentXValue.value, y: currentYValue.value })\r\n }\r\n if (x && y) return `${currentXValue.value},${currentYValue.value}`\r\n if (x) return currentXValue.value\r\n if (y) return currentYValue.value\r\n })\r\n\r\n const rootTokenStyle = computed(() =>\r\n toCssVarsStyle({\r\n ...propSizeToCssVars('slider', props.size),\r\n ...propColorToCssVars('slider', props.color),\r\n ...props.cssVars,\r\n }),\r\n )\r\n\r\n const tooltipLayerStyle = computed(() =>\r\n toCssVarsStyle({\r\n ...propSizeToCssVars('slider', props.size),\r\n ...propColorToCssVars('slider', props.color),\r\n '--w-prop-tooltip-size': effectiveSizeVar('slider'),\r\n ...props.cssVars,\r\n }),\r\n )\r\n\r\n const sliderClass = computed(() => {\r\n const { x, y } = axis.value\r\n return [\r\n 'w-slider',\r\n x && y ? 'w-slider-xy' : x ? 'w-slider-x' : y ? 'w-slider-y' : '',\r\n {\r\n 'w-slider-disabled': disabled.value,\r\n 'w-slider-readonly': props.readonly,\r\n 'w-slider-dragging': dragging.value,\r\n },\r\n ]\r\n })\r\n\r\n const tooltipOptions = computed(() => {\r\n const { x } = axis.value\r\n return {\r\n placement: (x ? 'top' : 'left') as PlacementType,\r\n adjustPosition: (x ? 'top' : 'left') as AdjustmentPosition,\r\n manual: true,\r\n realTime: true,\r\n show:\r\n (dragging.value || hoverTip.value || focused.value) &&\r\n props.showTooltip,\r\n layerStyle: tooltipLayerStyle.value,\r\n\r\n offset: { x: x ? 0 : -2, y: x ? -2 : 0 },\r\n arrowOffset: { x: x ? -3 : 0, y: x ? 0 : -3 },\r\n }\r\n })\r\n\r\n function emitIfOneAxis() {\r\n if (!axis.value.one) return\r\n const v = displayValue.value\r\n if (v === lastEmitted) return\r\n lastEmitted = v\r\n const percent = axis.value.x ? pos.left : pos.top\r\n emit('update:modelValue', v)\r\n emit('input', v, percent)\r\n formItem?.validate('change')\r\n }\r\n\r\n function applyIndex(i: number, which: 'x' | 'y' | 'both', silent = false) {\r\n const m = meta.value\r\n const next = indexToBig(i, m) / MULTIPLES\r\n const p =\r\n m.total <= 1 ? 0 : Math.max(0, Math.min(m.total - 1, i)) / (m.total - 1)\r\n let changed = false\r\n if (which === 'x' || which === 'both') {\r\n if (pos.left !== p) {\r\n pos.left = p\r\n changed = true\r\n }\r\n if (currentXValue.value !== next) {\r\n currentXValue.value = next\r\n changed = true\r\n }\r\n }\r\n if (which === 'y' || which === 'both') {\r\n if (pos.top !== p) {\r\n pos.top = p\r\n changed = true\r\n }\r\n if (currentYValue.value !== next) {\r\n currentYValue.value = next\r\n changed = true\r\n }\r\n }\r\n if (!silent && changed) emitIfOneAxis()\r\n }\r\n\r\n function setByValue(v: number, silent = true) {\r\n const i = bigToIndex(toBig(v), meta.value)\r\n const { x, y } = axis.value\r\n applyIndex(i, y && !x ? 'y' : 'x', silent)\r\n }\r\n\r\n function pointerPercent(e: PointerEvent) {\r\n const el = root.value\r\n const knob = rod.value\r\n if (!el) return { px: 0, py: 0 }\r\n const rect = el.getBoundingClientRect()\r\n const rodW = knob?.offsetWidth ?? 0\r\n const rodH = knob?.offsetHeight ?? 0\r\n const ux = Math.max(1, rect.width - rodW)\r\n const uy = Math.max(1, rect.height - rodH)\r\n return {\r\n px: (e.clientX - rect.left - rodW / 2) / ux,\r\n py: (e.clientY - rect.top - rodH / 2) / uy,\r\n }\r\n }\r\n\r\n function applyPointer(e: PointerEvent) {\r\n const { px, py } = pointerPercent(e)\r\n const total = meta.value.total\r\n const { x, y } = axis.value\r\n if (x && y) {\r\n const ix = percentToIndex(px, total)\r\n const iy = percentToIndex(py, total)\r\n const m = meta.value\r\n pos.left = total <= 1 ? 0 : ix / (total - 1)\r\n pos.top = total <= 1 ? 0 : iy / (total - 1)\r\n currentXValue.value = indexToBig(ix, m) / MULTIPLES\r\n currentYValue.value = indexToBig(iy, m) / MULTIPLES\r\n return\r\n }\r\n if (x) applyIndex(percentToIndex(px, total), 'x')\r\n else if (y) applyIndex(percentToIndex(py, total), 'y')\r\n }\r\n\r\n function endDrag(e?: PointerEvent) {\r\n if (!dragging.value) return\r\n dragging.value = false\r\n const el = root.value\r\n if (el && pointerId != null) {\r\n try {\r\n if (el.hasPointerCapture(pointerId))\r\n el.releasePointerCapture(pointerId)\r\n } catch {\r\n /* ignore */\r\n }\r\n }\r\n pointerId = null\r\n document.body.style.userSelect = ''\r\n document.body.style.cursor = ''\r\n if (e) e.preventDefault()\r\n }\r\n\r\n function handlePointerDown(e: PointerEvent) {\r\n if (inactive.value) return\r\n if (e.pointerType === 'mouse' && e.button !== 0) return\r\n e.preventDefault()\r\n const el = root.value\r\n if (!el) return\r\n pointerId = e.pointerId\r\n try {\r\n el.setPointerCapture(e.pointerId)\r\n } catch {\r\n /* ignore */\r\n }\r\n dragging.value = true\r\n showInvalidTip.value = false\r\n document.body.style.userSelect = 'none'\r\n document.body.style.cursor = 'grabbing'\r\n applyPointer(e)\r\n }\r\n\r\n function handlePointerMove(e: PointerEvent) {\r\n if (!dragging.value || e.pointerId !== pointerId) return\r\n e.preventDefault()\r\n applyPointer(e)\r\n }\r\n\r\n function handlePointerUp(e: PointerEvent) {\r\n if (e.pointerId !== pointerId) return\r\n endDrag(e)\r\n }\r\n\r\n function nudge(delta: number) {\r\n if (inactive.value) return\r\n const m = meta.value\r\n const { x, y } = axis.value\r\n if (x && !y) {\r\n applyIndex(bigToIndex(toBig(currentXValue.value), m) + delta, 'x')\r\n } else if (y && !x) {\r\n applyIndex(bigToIndex(toBig(currentYValue.value), m) + delta, 'y')\r\n }\r\n }\r\n\r\n function handleKeydown(e: KeyboardEvent) {\r\n if (inactive.value || axis.value.both) return\r\n const m = meta.value\r\n const page = Math.max(1, Math.round((m.total - 1) / 10))\r\n switch (e.key) {\r\n case 'ArrowLeft':\r\n case 'ArrowDown':\r\n e.preventDefault()\r\n nudge(-1)\r\n break\r\n case 'ArrowRight':\r\n case 'ArrowUp':\r\n e.preventDefault()\r\n nudge(1)\r\n break\r\n case 'PageDown':\r\n e.preventDefault()\r\n nudge(-page)\r\n break\r\n case 'PageUp':\r\n e.preventDefault()\r\n nudge(page)\r\n break\r\n case 'Home':\r\n e.preventDefault()\r\n applyIndex(0, axis.value.x ? 'x' : 'y')\r\n break\r\n case 'End':\r\n e.preventDefault()\r\n applyIndex(m.total - 1, axis.value.x ? 'x' : 'y')\r\n break\r\n }\r\n }\r\n\r\n function validateInputValue(v: number): boolean {\r\n const m = meta.value\r\n return indexToBig(bigToIndex(toBig(v), m), m) === toBig(v)\r\n }\r\n\r\n watch(\r\n () => props.modelValue,\r\n (v) => {\r\n if (dragging.value || axis.value.both) return\r\n if (v === displayValue.value) return\r\n lastEmitted = v\r\n setByValue(v, true)\r\n },\r\n )\r\n\r\n watch(\r\n () => [props.min, props.max, props.step] as const,\r\n () => {\r\n if (dragging.value) return\r\n const snapped =\r\n indexToBig(\r\n bigToIndex(toBig(props.modelValue), meta.value),\r\n meta.value,\r\n ) / MULTIPLES\r\n setByValue(props.modelValue, snapped === props.modelValue)\r\n },\r\n )\r\n\r\n setByValue(props.modelValue)\r\n\r\n onBeforeUnmount(() => endDrag())\r\n\r\n return () => {\r\n const { x, y } = axis.value\r\n const rodPosition: Record<string, string> = {}\r\n const progressSize: { width?: string; height?: string } = {}\r\n if (x) {\r\n rodPosition['--__pos-x'] = String(pos.left)\r\n progressSize.width = `${pos.left * 100}%`\r\n }\r\n if (y) {\r\n rodPosition['--__pos-y'] = String(pos.top)\r\n progressSize.height = `${pos.top * 100}%`\r\n }\r\n\r\n const sliderRod = (\r\n <div class=\"w-slider-rod\" ref={rod} style={rodPosition}>\r\n <Tooltip {...tooltipOptions.value}>\r\n {{\r\n trigger: () => (\r\n <div\r\n class={[\r\n 'w-slider-for-tip',\r\n { 'rod-in-dragging': dragging.value },\r\n ]}\r\n onDragstart={(e: DragEvent) => e.preventDefault()}\r\n onMouseenter={() => (hoverTip.value = true)}\r\n onMouseleave={() => (hoverTip.value = false)}\r\n />\r\n ),\r\n default: () => tipContent.value,\r\n }}\r\n </Tooltip>\r\n </div>\r\n )\r\n\r\n const main = (\r\n <div\r\n {...mergeProps(\r\n {\r\n class: sliderClass.value,\r\n style: rootTokenStyle.value,\r\n },\r\n { ref: root },\r\n )}\r\n role={axis.value.both ? undefined : 'slider'}\r\n tabindex={disabled.value ? -1 : 0}\r\n aria-valuemin={props.min}\r\n aria-valuemax={props.max}\r\n aria-valuenow={displayValue.value}\r\n aria-orientation={\r\n axis.value.both ? undefined : x ? 'horizontal' : 'vertical'\r\n }\r\n aria-disabled={disabled.value || undefined}\r\n aria-readonly={props.readonly || undefined}\r\n onPointerdown={handlePointerDown}\r\n onPointermove={handlePointerMove}\r\n onPointerup={handlePointerUp}\r\n onPointercancel={handlePointerUp}\r\n onKeydown={handleKeydown}\r\n onFocus={() => (focused.value = true)}\r\n onBlur={() => (focused.value = false)}>\r\n {props.fill ? (\r\n <div class=\"w-slider-progress\" style={progressSize} />\r\n ) : null}\r\n {sliderRod}\r\n </div>\r\n )\r\n\r\n if (props.hasInput && !axis.value.both) {\r\n return (\r\n <div class=\"w-slider-has-input\">\r\n {main}\r\n <Tooltip\r\n real-time\r\n manual\r\n placement=\"top\"\r\n adjustPosition=\"bottom\"\r\n show={showInvalidTip.value}\r\n layerStyle={tooltipLayerStyle.value}>\r\n {{\r\n trigger: () => (\r\n <Num\r\n hasBtn={false}\r\n width={props.inputWidth}\r\n min={Math.min(props.min, props.max)}\r\n max={Math.max(props.min, props.max)}\r\n step={props.step}\r\n modelValue={props.modelValue}\r\n disabled={disabled.value}\r\n readonly={props.readonly}\r\n {...({\r\n onKeydown: (e: KeyboardEvent) => {\r\n if (inactive.value) return\r\n if (e.key === 'Enter') {\r\n ;(e.target as HTMLInputElement).blur()\r\n }\r\n },\r\n onBlur: (e: FocusEvent) => {\r\n if (inactive.value) return\r\n const target = e.target as HTMLInputElement\r\n const v = parseFloat(target.value)\r\n if (isNaN(v)) return\r\n if (validateInputValue(v)) {\r\n showInvalidTip.value = false\r\n setByValue(v, false)\r\n } else {\r\n showInvalidTip.value = true\r\n }\r\n },\r\n } as Record<string, unknown>)}\r\n />\r\n ),\r\n default: () => props.invalidateTip || t('slider.invalid'),\r\n }}\r\n </Tooltip>\r\n </div>\r\n )\r\n }\r\n\r\n return main\r\n }\r\n },\r\n})\r\n"],"mappings":";;;;;;;AA2BA,IAAMkB,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B;MACzB,IAAI5B,SAASrB,OAAO;MACpB,MAAMsG,SAASrD,EAAEqD;MACjB,MAAMpG,IAAIsG,WAAWF,OAAOtG,KAAK;MACjC,IAAIyG,MAAMvG,CAAC,GAAG;MACd,IAAIuF,mBAAmBvF,CAAC,GAAG;OACzBU,eAAeZ,QAAQ;OACvB+C,WAAW7C,GAAG,KAAK;MACrB,OACEU,eAAeZ,QAAQ;KAE3B;IAAC,CAAA,GAAA,IAAA;IAIPtB,eAAeJ,MAAMiB,iBAAiBc,EAAE,gBAAgB;GAAC,CAAA,CAAA,CAAA;GAOnE,OAAO4F;EACT;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Slider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../../../theme/tokens/components/slider.css';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
/** 内置矢量图标名称(媒体 / 通用) */
|
|
3
|
+
export type SvgIconName = 'play' | 'pause' | 'prev' | 'next' | 'volume' | 'volume-off' | 'playlist' | 'music' | 'chevron-down' | 'close' | 'mode-sequential' | 'mode-random' | 'mode-single-loop' | 'mode-list-loop' | 'rotate-left' | 'rotate-right' | 'flip-x' | 'flip-y' | 'zoom-in' | 'zoom-out' | 'fit' | 'reset';
|
|
4
|
+
declare const ICON_PATHS: Record<SvgIconName, string | string[]>;
|
|
5
|
+
export declare function resolvePlayModeIconName(mode: string): SvgIconName;
|
|
6
|
+
declare const SvgIcon: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
7
|
+
name: {
|
|
8
|
+
type: PropType<SvgIconName>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
size: {
|
|
12
|
+
type: PropType<number | string>;
|
|
13
|
+
default: number;
|
|
14
|
+
};
|
|
15
|
+
viewBox: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
name: {
|
|
21
|
+
type: PropType<SvgIconName>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
size: {
|
|
25
|
+
type: PropType<number | string>;
|
|
26
|
+
default: number;
|
|
27
|
+
};
|
|
28
|
+
viewBox: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
}>> & Readonly<{}>, {
|
|
33
|
+
size: string | number;
|
|
34
|
+
viewBox: string;
|
|
35
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
36
|
+
export default SvgIcon;
|
|
37
|
+
export { ICON_PATHS };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createVNode, defineComponent, mergeProps } from "vue";
|
|
2
|
+
//#region components/svgIcon/SvgIcon.tsx
|
|
3
|
+
/** 内置矢量图标名称(媒体 / 通用) */
|
|
4
|
+
var ICON_PATHS = {
|
|
5
|
+
play: "M8 5v14l11-7L8 5z",
|
|
6
|
+
pause: "M6 5h4v14H6V5zm8 0h4v14h-4V5z",
|
|
7
|
+
prev: "M6 6h2v12H6V6zm3.5 6l8.5 6V6l-8.5 6z",
|
|
8
|
+
next: "M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z",
|
|
9
|
+
volume: "M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z",
|
|
10
|
+
"volume-off": "M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51A8.796 8.796 0 0021 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06a8.99 8.99 0 003.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z",
|
|
11
|
+
playlist: "M15 6H3v2h12V6zm0 4H3v2h12v-2zM3 16h8v2H3v-2zM17 6v8.18c-.31-.11-.65-.18-1-.18-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3V8h3V6h-5z",
|
|
12
|
+
music: "M12 3v10.55A4 4 0 1014 17V7h4V3h-6z",
|
|
13
|
+
"chevron-down": "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z",
|
|
14
|
+
close: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",
|
|
15
|
+
"mode-sequential": "M3 6h18v2H3V6zm0 5h18v2H3v-2zm0 5h12v2H3v-2z",
|
|
16
|
+
"mode-random": "M10.59 9.17L5.41 4 4 5.41l5.17 5.17 1.42-1.41zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4h-5.5zm.33 9.41l-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04-3.13-3.13z",
|
|
17
|
+
"mode-single-loop": "M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4zm-4-2V9h-1l-2 1v1h1.5v4H13z",
|
|
18
|
+
"mode-list-loop": "M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z",
|
|
19
|
+
"rotate-left": "M7.11 8.53L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z",
|
|
20
|
+
"rotate-right": "M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z",
|
|
21
|
+
"flip-x": "M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z",
|
|
22
|
+
"flip-y": "M3 15v2h2v-2H3zm12 4v2h2v-2h-2zM5 3v14c0 1.1.9 2 2 2h14v-4h-2v2H7V3H5zm16 16h-2v2c1.1 0 2-.9 2-2zM3 9h2V7H3v2zm18 8v-2h2v2h-2zM3 19h2v-2H3v2zM21 1H9v2h12v12h2V3c0-1.1-.9-2-2-2zm-8 8h2V7h-2v2zm0 4h2v-2h-2v2zm-4-4h2V7H9v2zm0 4h2v-2H9v2z",
|
|
23
|
+
"zoom-in": "M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM10 9V7H9v2H7v1h2v2h1v-2h2V9h-2z",
|
|
24
|
+
"zoom-out": "M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7V9z",
|
|
25
|
+
fit: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",
|
|
26
|
+
reset: "M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"
|
|
27
|
+
};
|
|
28
|
+
var PLAY_MODE_ICON = {
|
|
29
|
+
sequential: "mode-sequential",
|
|
30
|
+
random: "mode-random",
|
|
31
|
+
"single-loop": "mode-single-loop",
|
|
32
|
+
"list-loop": "mode-list-loop"
|
|
33
|
+
};
|
|
34
|
+
function resolvePlayModeIconName(mode) {
|
|
35
|
+
return PLAY_MODE_ICON[mode] || "mode-sequential";
|
|
36
|
+
}
|
|
37
|
+
var SvgIcon = /* @__PURE__ */ defineComponent({
|
|
38
|
+
name: "SvgIcon",
|
|
39
|
+
inheritAttrs: false,
|
|
40
|
+
props: {
|
|
41
|
+
name: {
|
|
42
|
+
type: String,
|
|
43
|
+
required: true
|
|
44
|
+
},
|
|
45
|
+
size: {
|
|
46
|
+
type: [Number, String],
|
|
47
|
+
default: 18
|
|
48
|
+
},
|
|
49
|
+
viewBox: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "0 0 24 24"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
setup(props, { attrs, slots }) {
|
|
55
|
+
return () => {
|
|
56
|
+
const size = typeof props.size === "number" ? props.size : props.size;
|
|
57
|
+
const paths = ICON_PATHS[props.name];
|
|
58
|
+
const pathList = paths ? Array.isArray(paths) ? paths : [paths] : [];
|
|
59
|
+
const svgProps = mergeProps({
|
|
60
|
+
class: "w-svg-icon",
|
|
61
|
+
width: size,
|
|
62
|
+
height: size,
|
|
63
|
+
viewBox: props.viewBox,
|
|
64
|
+
fill: "currentColor",
|
|
65
|
+
"aria-hidden": "true",
|
|
66
|
+
focusable: "false"
|
|
67
|
+
}, attrs);
|
|
68
|
+
return createVNode("svg", svgProps, [slots.default ? slots.default() : pathList.map((d) => createVNode("path", {
|
|
69
|
+
"key": d,
|
|
70
|
+
"d": d
|
|
71
|
+
}, null))]);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
//#endregion
|
|
76
|
+
export { ICON_PATHS, SvgIcon as default, resolvePlayModeIconName };
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=SvgIcon.js.map
|