yuang-framework-ui-pc 1.0.19 → 1.2.1
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/README.md +17 -41
- package/es/ele-admin-layout/components/layout-skeleton.d.ts +10 -0
- package/es/ele-admin-layout/components/layout-skeleton.js +47 -0
- package/es/ele-admin-layout/components/layout-tabs.d.ts +64 -0
- package/es/ele-admin-layout/components/layout-tabs.js +132 -0
- package/es/ele-admin-layout/components/layout-tool.d.ts +2 -0
- package/es/ele-admin-layout/components/layout-tool.js +21 -0
- package/es/ele-admin-layout/index.d.ts +293 -0
- package/es/ele-admin-layout/index.js +693 -0
- package/es/ele-admin-layout/props.d.ts +182 -0
- package/es/ele-admin-layout/props.js +169 -0
- package/es/ele-admin-layout/style/css-var.scss +14 -0
- package/es/ele-admin-layout/style/header.scss +192 -0
- package/es/ele-admin-layout/style/index.d.ts +1 -0
- package/es/ele-admin-layout/style/index.js +9 -0
- package/es/ele-admin-layout/style/index.scss +313 -0
- package/es/ele-admin-layout/style/sidebar.scss +187 -0
- package/es/ele-admin-layout/style/tabs.scss +59 -0
- package/es/ele-admin-layout/types.d.ts +54 -0
- package/es/ele-app/components/message-body.d.ts +46 -0
- package/es/ele-app/components/message-body.js +98 -0
- package/es/ele-app/components/message-box-icon.d.ts +31 -0
- package/es/ele-app/components/message-box-icon.js +63 -0
- package/es/ele-app/el.d.ts +304 -0
- package/es/ele-app/index.d.ts +4 -0
- package/es/ele-app/index.js +13 -0
- package/es/ele-app/plus.d.ts +181 -0
- package/es/ele-app/style/common/index.d.ts +1 -0
- package/es/ele-app/style/common/index.js +1 -0
- package/es/ele-app/style/common/index.scss +55 -0
- package/es/ele-app/style/css-var.scss +11 -0
- package/es/ele-app/style/index.d.ts +1 -0
- package/es/ele-app/style/index.js +4 -0
- package/es/ele-app/style/index.scss +4 -0
- package/es/ele-app/style/message/css-var.scss +8 -0
- package/es/ele-app/style/message/index.d.ts +1 -0
- package/es/ele-app/style/message/index.js +2 -0
- package/es/ele-app/style/message/index.scss +261 -0
- package/es/ele-app/style/overwrite/autocomplete/css-var.scss +8 -0
- package/es/ele-app/style/overwrite/autocomplete/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/autocomplete/index.js +1 -0
- package/es/ele-app/style/overwrite/autocomplete/index.scss +33 -0
- package/es/ele-app/style/overwrite/backtop/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/backtop/index.js +1 -0
- package/es/ele-app/style/overwrite/backtop/index.scss +8 -0
- package/es/ele-app/style/overwrite/cascader/css-var.scss +8 -0
- package/es/ele-app/style/overwrite/cascader/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/cascader/index.js +1 -0
- package/es/ele-app/style/overwrite/cascader/index.scss +166 -0
- package/es/ele-app/style/overwrite/checkbox/css-var.scss +8 -0
- package/es/ele-app/style/overwrite/checkbox/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/checkbox/index.js +1 -0
- package/es/ele-app/style/overwrite/checkbox/index.scss +161 -0
- package/es/ele-app/style/overwrite/color-picker/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/color-picker/index.js +1 -0
- package/es/ele-app/style/overwrite/color-picker/index.scss +42 -0
- package/es/ele-app/style/overwrite/css-var.scss +33 -0
- package/es/ele-app/style/overwrite/date-picker/css-var.scss +16 -0
- package/es/ele-app/style/overwrite/date-picker/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/date-picker/index.js +1 -0
- package/es/ele-app/style/overwrite/date-picker/index.scss +895 -0
- package/es/ele-app/style/overwrite/descriptions/css-var.scss +8 -0
- package/es/ele-app/style/overwrite/descriptions/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/descriptions/index.js +1 -0
- package/es/ele-app/style/overwrite/descriptions/index.scss +52 -0
- package/es/ele-app/style/overwrite/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/index.js +16 -0
- package/es/ele-app/style/overwrite/index.scss +16 -0
- package/es/ele-app/style/overwrite/input/css-var.scss +34 -0
- package/es/ele-app/style/overwrite/input/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/input/index.js +1 -0
- package/es/ele-app/style/overwrite/input/index.scss +540 -0
- package/es/ele-app/style/overwrite/message-box/css-var.scss +8 -0
- package/es/ele-app/style/overwrite/message-box/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/message-box/index.js +2 -0
- package/es/ele-app/style/overwrite/message-box/index.scss +148 -0
- package/es/ele-app/style/overwrite/notification/css-var.scss +8 -0
- package/es/ele-app/style/overwrite/notification/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/notification/index.js +2 -0
- package/es/ele-app/style/overwrite/notification/index.scss +65 -0
- package/es/ele-app/style/overwrite/popper/css-var.scss +14 -0
- package/es/ele-app/style/overwrite/popper/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/popper/index.js +1 -0
- package/es/ele-app/style/overwrite/popper/index.scss +9 -0
- package/es/ele-app/style/overwrite/radio/css-var.scss +8 -0
- package/es/ele-app/style/overwrite/radio/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/radio/index.js +1 -0
- package/es/ele-app/style/overwrite/radio/index.scss +128 -0
- package/es/ele-app/style/overwrite/select/css-var.scss +8 -0
- package/es/ele-app/style/overwrite/select/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/select/index.js +1 -0
- package/es/ele-app/style/overwrite/select/index.scss +203 -0
- package/es/ele-app/style/overwrite/tag/css-var.scss +8 -0
- package/es/ele-app/style/overwrite/tag/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/tag/index.js +1 -0
- package/es/ele-app/style/overwrite/tag/index.scss +346 -0
- package/es/ele-app/style/overwrite/tree/css-var.scss +8 -0
- package/es/ele-app/style/overwrite/tree/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/tree/index.js +1 -0
- package/es/ele-app/style/overwrite/tree/index.scss +106 -0
- package/es/ele-app/style/overwrite/tree-select/css-var.scss +8 -0
- package/es/ele-app/style/overwrite/tree-select/index.d.ts +1 -0
- package/es/ele-app/style/overwrite/tree-select/index.js +1 -0
- package/es/ele-app/style/overwrite/tree-select/index.scss +108 -0
- package/es/ele-app/style/scrollbar/css-var.scss +71 -0
- package/es/ele-app/style/scrollbar/index.d.ts +1 -0
- package/es/ele-app/style/scrollbar/index.js +1 -0
- package/es/ele-app/style/scrollbar/index.scss +9 -0
- package/es/ele-app/types.d.ts +48 -0
- package/es/ele-pro-layout/components/pro-iframe.vue +120 -0
- package/es/ele-pro-layout/index.vue +1277 -0
- package/es/ele-pro-layout/props.ts +255 -0
- package/es/ele-pro-layout/style/index.scss +41 -0
- package/es/ele-pro-layout/style/index.ts +2 -0
- package/es/ele-pro-layout/types.ts +212 -0
- package/es/ele-pro-layout/util.ts +277 -0
- package/es/ele-tabs/index.d.ts +149 -0
- package/es/ele-tabs/index.js +480 -0
- package/es/ele-tabs/props.d.ts +82 -0
- package/es/ele-tabs/props.js +46 -0
- package/es/ele-tabs/style/css-var.scss +8 -0
- package/es/ele-tabs/style/index.d.ts +1 -0
- package/es/ele-tabs/style/index.js +5 -0
- package/es/ele-tabs/style/index.scss +1074 -0
- package/es/ele-tabs/types.d.ts +70 -0
- package/es/icons/AnalysisOutlined.d.ts +2 -0
- package/es/icons/AnalysisOutlined.js +35 -0
- package/es/icons/ApplicationOutlined.d.ts +2 -0
- package/es/icons/ApplicationOutlined.js +26 -0
- package/es/icons/AppstoreAddOutlined.d.ts +2 -0
- package/es/icons/AppstoreAddOutlined.js +35 -0
- package/es/icons/AppstoreOutlined.d.ts +2 -0
- package/es/icons/AppstoreOutlined.js +35 -0
- package/es/icons/ArrowDown.d.ts +2 -0
- package/es/icons/ArrowDown.js +31 -0
- package/es/icons/ArrowDownOutlined.d.ts +2 -0
- package/es/icons/ArrowDownOutlined.js +30 -0
- package/es/icons/ArrowLeft.d.ts +2 -0
- package/es/icons/ArrowLeft.js +31 -0
- package/es/icons/ArrowLeftOutlined.d.ts +2 -0
- package/es/icons/ArrowLeftOutlined.js +30 -0
- package/es/icons/ArrowRight.d.ts +2 -0
- package/es/icons/ArrowRight.js +31 -0
- package/es/icons/ArrowRightOutlined.d.ts +2 -0
- package/es/icons/ArrowRightOutlined.js +30 -0
- package/es/icons/ArrowUp.d.ts +2 -0
- package/es/icons/ArrowUp.js +31 -0
- package/es/icons/ArrowUpOutlined.d.ts +2 -0
- package/es/icons/ArrowUpOutlined.js +30 -0
- package/es/icons/BellOutlined.d.ts +2 -0
- package/es/icons/BellOutlined.js +29 -0
- package/es/icons/BookOutlined.d.ts +2 -0
- package/es/icons/BookOutlined.js +29 -0
- package/es/icons/CalendarOutlined.d.ts +2 -0
- package/es/icons/CalendarOutlined.js +29 -0
- package/es/icons/CaretDownFilled.d.ts +2 -0
- package/es/icons/CaretDownFilled.js +26 -0
- package/es/icons/CaretUpFilled.d.ts +2 -0
- package/es/icons/CaretUpFilled.js +26 -0
- package/es/icons/CheckCircleFilled.d.ts +2 -0
- package/es/icons/CheckCircleFilled.js +26 -0
- package/es/icons/CheckCircleOutlined.d.ts +2 -0
- package/es/icons/CheckCircleOutlined.js +32 -0
- package/es/icons/CheckOutlined.d.ts +2 -0
- package/es/icons/CheckOutlined.js +30 -0
- package/es/icons/CityOutlined.d.ts +2 -0
- package/es/icons/CityOutlined.js +35 -0
- package/es/icons/ClockCircleOutlined.d.ts +2 -0
- package/es/icons/ClockCircleOutlined.js +32 -0
- package/es/icons/CloseCircleFilled.d.ts +2 -0
- package/es/icons/CloseCircleFilled.js +26 -0
- package/es/icons/CloseCircleOutlined.d.ts +2 -0
- package/es/icons/CloseCircleOutlined.js +31 -0
- package/es/icons/CloseOutlined.d.ts +2 -0
- package/es/icons/CloseOutlined.js +30 -0
- package/es/icons/CloudUploadOutlined.d.ts +2 -0
- package/es/icons/CloudUploadOutlined.js +32 -0
- package/es/icons/ClusterOutlined.d.ts +2 -0
- package/es/icons/ClusterOutlined.js +29 -0
- package/es/icons/CodeOutlined.d.ts +2 -0
- package/es/icons/CodeOutlined.js +34 -0
- package/es/icons/ColumnHeightOutlined.d.ts +2 -0
- package/es/icons/ColumnHeightOutlined.js +35 -0
- package/es/icons/CompassOutlined.d.ts +2 -0
- package/es/icons/CompassOutlined.js +34 -0
- package/es/icons/CompressOutlined.d.ts +2 -0
- package/es/icons/CompressOutlined.js +36 -0
- package/es/icons/ConnectionOutlined.d.ts +2 -0
- package/es/icons/ConnectionOutlined.js +31 -0
- package/es/icons/ControlOutlined.d.ts +2 -0
- package/es/icons/ControlOutlined.js +33 -0
- package/es/icons/CopyOutlined.d.ts +2 -0
- package/es/icons/CopyOutlined.js +35 -0
- package/es/icons/CornerLeftFilled.d.ts +2 -0
- package/es/icons/CornerLeftFilled.js +26 -0
- package/es/icons/CornerRightFilled.d.ts +2 -0
- package/es/icons/CornerRightFilled.js +26 -0
- package/es/icons/CpuOutlined.d.ts +2 -0
- package/es/icons/CpuOutlined.js +30 -0
- package/es/icons/DashboardOutlined.d.ts +2 -0
- package/es/icons/DashboardOutlined.js +37 -0
- package/es/icons/DatabaseOutlined.d.ts +2 -0
- package/es/icons/DatabaseOutlined.js +35 -0
- package/es/icons/DeleteOutlined.d.ts +2 -0
- package/es/icons/DeleteOutlined.js +34 -0
- package/es/icons/DesktopOutlined.d.ts +2 -0
- package/es/icons/DesktopOutlined.js +29 -0
- package/es/icons/DownloadOutlined.d.ts +2 -0
- package/es/icons/DownloadOutlined.js +32 -0
- package/es/icons/DragOutlined.d.ts +2 -0
- package/es/icons/DragOutlined.js +30 -0
- package/es/icons/EditOutlined.d.ts +2 -0
- package/es/icons/EditOutlined.js +32 -0
- package/es/icons/EllipsisOutlined.d.ts +2 -0
- package/es/icons/EllipsisOutlined.js +42 -0
- package/es/icons/EnvironmentOutlined.d.ts +2 -0
- package/es/icons/EnvironmentOutlined.js +31 -0
- package/es/icons/ExclamationCircleFilled.d.ts +2 -0
- package/es/icons/ExclamationCircleFilled.js +26 -0
- package/es/icons/ExpandOutlined.d.ts +2 -0
- package/es/icons/ExpandOutlined.js +36 -0
- package/es/icons/EyeOutlined.d.ts +2 -0
- package/es/icons/EyeOutlined.js +30 -0
- package/es/icons/FileOutlined.d.ts +2 -0
- package/es/icons/FileOutlined.js +35 -0
- package/es/icons/FilterFilled.d.ts +2 -0
- package/es/icons/FilterFilled.js +26 -0
- package/es/icons/FolderAddOutlined.d.ts +2 -0
- package/es/icons/FolderAddOutlined.js +31 -0
- package/es/icons/FolderOutlined.d.ts +2 -0
- package/es/icons/FolderOutlined.js +29 -0
- package/es/icons/FormOutlined.d.ts +2 -0
- package/es/icons/FormOutlined.js +31 -0
- package/es/icons/FullscreenExitOutlined.d.ts +2 -0
- package/es/icons/FullscreenExitOutlined.js +34 -0
- package/es/icons/FullscreenOutlined.d.ts +2 -0
- package/es/icons/FullscreenOutlined.js +34 -0
- package/es/icons/FundOutlined.d.ts +2 -0
- package/es/icons/FundOutlined.js +31 -0
- package/es/icons/GlobalOutlined.d.ts +2 -0
- package/es/icons/GlobalOutlined.js +28 -0
- package/es/icons/HolderOutlined.d.ts +2 -0
- package/es/icons/HolderOutlined.js +26 -0
- package/es/icons/HomeOutlined.d.ts +2 -0
- package/es/icons/HomeOutlined.js +29 -0
- package/es/icons/IdcardOutlined.d.ts +2 -0
- package/es/icons/IdcardOutlined.js +38 -0
- package/es/icons/InfoCircleFilled.d.ts +2 -0
- package/es/icons/InfoCircleFilled.js +26 -0
- package/es/icons/LinkOutlined.d.ts +2 -0
- package/es/icons/LinkOutlined.js +32 -0
- package/es/icons/LoadingDotOutlined.d.ts +2 -0
- package/es/icons/LoadingDotOutlined.js +29 -0
- package/es/icons/LoadingOutlined.d.ts +2 -0
- package/es/icons/LoadingOutlined.js +29 -0
- package/es/icons/LockOutlined.d.ts +2 -0
- package/es/icons/LockOutlined.js +32 -0
- package/es/icons/LogOutlined.d.ts +2 -0
- package/es/icons/LogOutlined.js +35 -0
- package/es/icons/LogoutOutlined.d.ts +2 -0
- package/es/icons/LogoutOutlined.js +31 -0
- package/es/icons/MailOutlined.d.ts +2 -0
- package/es/icons/MailOutlined.js +29 -0
- package/es/icons/MenuFoldOutlined.d.ts +2 -0
- package/es/icons/MenuFoldOutlined.js +28 -0
- package/es/icons/MenuOutlined.d.ts +2 -0
- package/es/icons/MenuOutlined.js +32 -0
- package/es/icons/MenuUnfoldOutlined.d.ts +2 -0
- package/es/icons/MenuUnfoldOutlined.js +28 -0
- package/es/icons/MessageOutlined.d.ts +2 -0
- package/es/icons/MessageOutlined.js +50 -0
- package/es/icons/MinusCircleOutlined.d.ts +2 -0
- package/es/icons/MinusCircleOutlined.js +31 -0
- package/es/icons/MobileOutlined.d.ts +2 -0
- package/es/icons/MobileOutlined.js +37 -0
- package/es/icons/MoonOutlined.d.ts +2 -0
- package/es/icons/MoonOutlined.js +29 -0
- package/es/icons/MoreOutlined.d.ts +2 -0
- package/es/icons/MoreOutlined.js +42 -0
- package/es/icons/PauseFilled.d.ts +2 -0
- package/es/icons/PauseFilled.js +30 -0
- package/es/icons/PieChartOutlined.d.ts +2 -0
- package/es/icons/PieChartOutlined.js +31 -0
- package/es/icons/PlayFilled.d.ts +2 -0
- package/es/icons/PlayFilled.js +26 -0
- package/es/icons/PlusCircleOutlined.d.ts +2 -0
- package/es/icons/PlusCircleOutlined.js +31 -0
- package/es/icons/PlusOutlined.d.ts +2 -0
- package/es/icons/PlusOutlined.js +29 -0
- package/es/icons/PrinterOutlined.d.ts +2 -0
- package/es/icons/PrinterOutlined.js +29 -0
- package/es/icons/ProtectOutlined.d.ts +2 -0
- package/es/icons/ProtectOutlined.js +32 -0
- package/es/icons/QuestionCircleFilled.d.ts +2 -0
- package/es/icons/QuestionCircleFilled.js +26 -0
- package/es/icons/QuestionCircleOutlined.d.ts +2 -0
- package/es/icons/QuestionCircleOutlined.js +39 -0
- package/es/icons/ReloadOutlined.d.ts +2 -0
- package/es/icons/ReloadOutlined.js +30 -0
- package/es/icons/ResizeOutlined.d.ts +2 -0
- package/es/icons/ResizeOutlined.js +30 -0
- package/es/icons/SearchOutlined.d.ts +2 -0
- package/es/icons/SearchOutlined.js +29 -0
- package/es/icons/SettingOutlined.d.ts +2 -0
- package/es/icons/SettingOutlined.js +31 -0
- package/es/icons/ShoppingOutlined.d.ts +2 -0
- package/es/icons/ShoppingOutlined.js +29 -0
- package/es/icons/SizeCompactOutlined.d.ts +2 -0
- package/es/icons/SizeCompactOutlined.js +34 -0
- package/es/icons/SizeMiddleOutlined.d.ts +2 -0
- package/es/icons/SizeMiddleOutlined.js +34 -0
- package/es/icons/SizeSlackOutlined.d.ts +2 -0
- package/es/icons/SizeSlackOutlined.js +34 -0
- package/es/icons/SortOutlined.d.ts +2 -0
- package/es/icons/SortOutlined.js +32 -0
- package/es/icons/StarFilled.d.ts +2 -0
- package/es/icons/StarFilled.js +26 -0
- package/es/icons/StepBackwardFilled.d.ts +2 -0
- package/es/icons/StepBackwardFilled.js +33 -0
- package/es/icons/StepForwardFilled.d.ts +2 -0
- package/es/icons/StepForwardFilled.js +33 -0
- package/es/icons/SuitcaseOutlined.d.ts +2 -0
- package/es/icons/SuitcaseOutlined.js +29 -0
- package/es/icons/SunOutlined.d.ts +2 -0
- package/es/icons/SunOutlined.js +29 -0
- package/es/icons/SwapOutlined.d.ts +2 -0
- package/es/icons/SwapOutlined.js +32 -0
- package/es/icons/SyncOutlined.d.ts +2 -0
- package/es/icons/SyncOutlined.js +32 -0
- package/es/icons/TableOutlined.d.ts +2 -0
- package/es/icons/TableOutlined.js +29 -0
- package/es/icons/TagOutlined.d.ts +2 -0
- package/es/icons/TagOutlined.js +31 -0
- package/es/icons/TimerOutlined.d.ts +2 -0
- package/es/icons/TimerOutlined.js +31 -0
- package/es/icons/UndoOutlined.d.ts +2 -0
- package/es/icons/UndoOutlined.js +30 -0
- package/es/icons/UnlockOutlined.d.ts +2 -0
- package/es/icons/UnlockOutlined.js +32 -0
- package/es/icons/UploadOutlined.d.ts +2 -0
- package/es/icons/UploadOutlined.js +32 -0
- package/es/icons/UserOutlined.d.ts +2 -0
- package/es/icons/UserOutlined.js +29 -0
- package/es/icons/VerticalAlignMiddleOutlined.d.ts +2 -0
- package/es/icons/VerticalAlignMiddleOutlined.js +32 -0
- package/es/icons/VerticalLeftOutlined.d.ts +2 -0
- package/es/icons/VerticalLeftOutlined.js +28 -0
- package/es/icons/VerticalRightOutlined.d.ts +2 -0
- package/es/icons/VerticalRightOutlined.js +28 -0
- package/es/icons/WarningOutlined.d.ts +2 -0
- package/es/icons/WarningOutlined.js +42 -0
- package/es/icons/ZoomInOutlined.d.ts +2 -0
- package/es/icons/ZoomInOutlined.js +31 -0
- package/es/icons/ZoomOutOutlined.d.ts +2 -0
- package/es/icons/ZoomOutOutlined.js +31 -0
- package/es/icons/index.d.ts +115 -0
- package/es/icons/index.js +232 -0
- package/es/utils/chart-theme-dark.d.ts +373 -0
- package/es/utils/chart-theme-dark.js +397 -0
- package/es/utils/chart-theme.d.ts +368 -0
- package/es/utils/chart-theme.js +392 -0
- package/es/utils/core.d.ts +168 -0
- package/es/utils/core.js +318 -0
- package/es/utils/hook.d.ts +113 -0
- package/es/utils/hook.js +264 -0
- package/es/utils/menu-util.d.ts +14 -0
- package/es/utils/menu-util.js +78 -0
- package/es/utils/message-box.d.ts +25 -0
- package/es/utils/message-box.js +98 -0
- package/es/utils/message.d.ts +66 -0
- package/es/utils/message.js +267 -0
- package/es/utils/resolvers.d.ts +18 -0
- package/es/utils/resolvers.js +50 -0
- package/es/utils/theme-util.d.ts +6 -0
- package/es/utils/theme-util.js +42 -0
- package/es/utils/validate.d.ts +182 -0
- package/es/utils/validate.js +197 -0
- package/package.json +184 -44
- package/typings/global.d.ts +64 -0
- package/dist/favicon.ico +0 -0
- package/dist/style.css +0 -1
- package/dist/yuang-framework-ui-pc.es.js +0 -78
- package/dist/yuang-framework-ui-pc.umd.js +0 -1
- package/src/App.vue +0 -31
- package/src/components/YuButton/index.vue +0 -35
- package/src/components/YuRow/index.vue +0 -16
- package/src/components/index.ts +0 -14
- package/src/main.ts +0 -42
- package/src/router/index.ts +0 -26
- package/src/shims-vue.d.ts +0 -10
- package/src/utils/vueRouterUtils.ts +0 -30
- package/src/views/components/yu-button/index.vue +0 -15
- package/src/views/exception/403/components/icon-svg.vue +0 -276
- package/src/views/exception/403/index.vue +0 -25
- package/src/views/exception/404/components/icon-svg.vue +0 -288
- package/src/views/exception/404/index.vue +0 -25
- package/src/views/exception/500/components/icon-svg.vue +0 -331
- package/src/views/exception/500/index.vue +0 -25
package/es/utils/core.js
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
function toTree(option) {
|
|
2
|
+
const data = option.data;
|
|
3
|
+
const idField = option.idField || "id";
|
|
4
|
+
const parentIdField = option.parentIdField || "parentId";
|
|
5
|
+
const childrenField = option.childrenField || "children";
|
|
6
|
+
const parentIdIsNull = option.parentId == null;
|
|
7
|
+
const parentId = parentIdIsNull ? [] : option.parentId;
|
|
8
|
+
const parentIdIsArray = Array.isArray(parentId);
|
|
9
|
+
const addParentIds = option.addParentIds;
|
|
10
|
+
const parentIdsField = option.parentIdsField || "parentIds";
|
|
11
|
+
const parentIds = option.parentIds ?? [];
|
|
12
|
+
if (data == null) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
if (parentIdIsNull) {
|
|
16
|
+
data.forEach((d) => {
|
|
17
|
+
if (!data.some((t) => d[parentIdField] == t[idField]) && !parentId.includes(d[parentIdField])) {
|
|
18
|
+
parentId.push(d[parentIdField]);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const result = [];
|
|
23
|
+
data.forEach((d) => {
|
|
24
|
+
if (d[idField] == d[parentIdField]) {
|
|
25
|
+
const error = {
|
|
26
|
+
[idField]: d[idField],
|
|
27
|
+
[parentIdField]: d[parentIdField],
|
|
28
|
+
data: d
|
|
29
|
+
};
|
|
30
|
+
console.error("data error:", error);
|
|
31
|
+
throw new Error("data error");
|
|
32
|
+
}
|
|
33
|
+
if (parentIdIsArray ? parentId.includes(d[parentIdField]) : d[parentIdField] == parentId) {
|
|
34
|
+
const t = { ...d };
|
|
35
|
+
const children = toTree({
|
|
36
|
+
data,
|
|
37
|
+
idField,
|
|
38
|
+
parentIdField,
|
|
39
|
+
childrenField,
|
|
40
|
+
parentId: d[idField],
|
|
41
|
+
addParentIds,
|
|
42
|
+
parentIdsField,
|
|
43
|
+
parentIds: [...parentIds, d[idField]]
|
|
44
|
+
});
|
|
45
|
+
if (children.length > 0) {
|
|
46
|
+
t[childrenField] = children;
|
|
47
|
+
}
|
|
48
|
+
if (addParentIds) {
|
|
49
|
+
t[parentIdsField] = parentIds;
|
|
50
|
+
}
|
|
51
|
+
result.push(t);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
function eachTree(data, callback, childrenField = "children", parent) {
|
|
57
|
+
if (data) {
|
|
58
|
+
data.forEach((d, i) => {
|
|
59
|
+
var _a;
|
|
60
|
+
if (callback && callback(d, i, parent) !== false && ((_a = d[childrenField]) == null ? void 0 : _a.length)) {
|
|
61
|
+
eachTree(d[childrenField], callback, childrenField, d);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function mapTree(data, formatter, childrenField = "children", resultChildrenField = "children", parent) {
|
|
67
|
+
const result = [];
|
|
68
|
+
if (data && data.length) {
|
|
69
|
+
data.forEach((d, i) => {
|
|
70
|
+
const item = formatter(d, i, parent);
|
|
71
|
+
if (item) {
|
|
72
|
+
if (d[childrenField] != null) {
|
|
73
|
+
item[resultChildrenField] = mapTree(
|
|
74
|
+
d[childrenField],
|
|
75
|
+
formatter,
|
|
76
|
+
childrenField,
|
|
77
|
+
resultChildrenField,
|
|
78
|
+
item
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
result.push(item);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
function findTree(data, predicate, childrenField) {
|
|
88
|
+
let temp;
|
|
89
|
+
eachTree(
|
|
90
|
+
data,
|
|
91
|
+
(d, i) => {
|
|
92
|
+
if (predicate(d, i)) {
|
|
93
|
+
temp = d;
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
childrenField
|
|
98
|
+
);
|
|
99
|
+
return temp;
|
|
100
|
+
}
|
|
101
|
+
function random(m, n) {
|
|
102
|
+
return Math.floor(Math.random() * (m - n) + n);
|
|
103
|
+
}
|
|
104
|
+
function uuid(length = 32, radix) {
|
|
105
|
+
const str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
106
|
+
let result = "";
|
|
107
|
+
for (let i = 0; i < length; i++) {
|
|
108
|
+
result += str.charAt(Math.floor(Math.random() * (radix || str.length)));
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
function formatNumber(num) {
|
|
113
|
+
return String(num ?? "").replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g, "$1,");
|
|
114
|
+
}
|
|
115
|
+
function assignObject(target, source, excludes) {
|
|
116
|
+
Object.keys(target).forEach((key) => {
|
|
117
|
+
var _a;
|
|
118
|
+
if (!((_a = excludes == null ? void 0 : excludes.includes) == null ? void 0 : _a.call(excludes, key))) {
|
|
119
|
+
target[key] = source[key];
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
return target;
|
|
123
|
+
}
|
|
124
|
+
function isExternalLink(url) {
|
|
125
|
+
return !!(url && (url.startsWith("http://") || url.startsWith("https://") || url.startsWith("//")));
|
|
126
|
+
}
|
|
127
|
+
function queryChild(parentEl, className, attr) {
|
|
128
|
+
return Array.from((parentEl == null ? void 0 : parentEl.children) ?? []).find((el) => {
|
|
129
|
+
if (className && !el.classList.contains(className)) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
if (attr != null && attr[0] != null) {
|
|
133
|
+
if (el.getAttribute(attr[0]) != attr[1]) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return true;
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function getCurrentStyle(el) {
|
|
141
|
+
return el["currentStyle"] || window.getComputedStyle(el, null) || {};
|
|
142
|
+
}
|
|
143
|
+
function contentIsEllipsis(el, direction) {
|
|
144
|
+
if (!el || !el.childNodes.length) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
const range = document.createRange();
|
|
148
|
+
range.setStart(el, 0);
|
|
149
|
+
range.setEnd(el, el.childNodes.length);
|
|
150
|
+
const { width, height } = range.getBoundingClientRect();
|
|
151
|
+
const floorW = Math.floor(width);
|
|
152
|
+
const rangeWidth = width - floorW < 8e-3 ? floorW : width;
|
|
153
|
+
const floorH = Math.floor(height);
|
|
154
|
+
const rangeHeight = height - floorH < 8e-3 ? floorH : height;
|
|
155
|
+
const style = getCurrentStyle(el);
|
|
156
|
+
const top = Number.parseInt(style.paddingTop) || 0;
|
|
157
|
+
const left = Number.parseInt(style.paddingLeft) || 0;
|
|
158
|
+
const right = Number.parseInt(style.paddingRight) || 0;
|
|
159
|
+
const bottom = Number.parseInt(style.paddingBottom) || 0;
|
|
160
|
+
const horizontalPadding = left + right;
|
|
161
|
+
const verticalPadding = top + bottom;
|
|
162
|
+
if (direction === "horizontal") {
|
|
163
|
+
return rangeWidth + horizontalPadding > el.offsetWidth || el.scrollWidth > el.offsetWidth;
|
|
164
|
+
}
|
|
165
|
+
if (direction === "vertical") {
|
|
166
|
+
return rangeHeight + verticalPadding > el.offsetHeight || el.scrollHeight > el.offsetHeight;
|
|
167
|
+
}
|
|
168
|
+
return rangeWidth + horizontalPadding > el.offsetWidth || rangeHeight + verticalPadding > el.offsetHeight || el.scrollWidth > el.offsetWidth;
|
|
169
|
+
}
|
|
170
|
+
function checkFullscreen() {
|
|
171
|
+
return !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement);
|
|
172
|
+
}
|
|
173
|
+
function exitFullscreen() {
|
|
174
|
+
const func = document.exitFullscreen || document.exitFullScreen || document.webkitCancelFullScreen || document.mozCancelFullScreen || document.msExitFullscreen;
|
|
175
|
+
func && func.call(document);
|
|
176
|
+
}
|
|
177
|
+
function requestFullscreen(el) {
|
|
178
|
+
if (el == null) {
|
|
179
|
+
el = document.documentElement;
|
|
180
|
+
}
|
|
181
|
+
const func = el.requestFullscreen || el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen;
|
|
182
|
+
if (!func) {
|
|
183
|
+
throw new Error("您的浏览器不支持全屏模式");
|
|
184
|
+
}
|
|
185
|
+
func.call(el);
|
|
186
|
+
}
|
|
187
|
+
function bd09ToGcj02(point) {
|
|
188
|
+
const x_pi = 3.141592653589793 * 3e3 / 180;
|
|
189
|
+
const x = point.lng - 65e-4;
|
|
190
|
+
const y = point.lat - 6e-3;
|
|
191
|
+
const z = Math.sqrt(x * x + y * y) - 2e-5 * Math.sin(y * x_pi);
|
|
192
|
+
const theta = Math.atan2(y, x) - 3e-6 * Math.cos(x * x_pi);
|
|
193
|
+
return {
|
|
194
|
+
lng: z * Math.cos(theta),
|
|
195
|
+
lat: z * Math.sin(theta)
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function gcj02ToBd09(point) {
|
|
199
|
+
const x_pi = 3.141592653589793 * 3e3 / 180;
|
|
200
|
+
const x = point.lng;
|
|
201
|
+
const y = point.lat;
|
|
202
|
+
const z = Math.sqrt(x * x + y * y) + 2e-5 * Math.sin(y * x_pi);
|
|
203
|
+
const theta = Math.atan2(y, x) + 3e-6 * Math.cos(x * x_pi);
|
|
204
|
+
return {
|
|
205
|
+
lng: z * Math.cos(theta) + 65e-4,
|
|
206
|
+
lat: z * Math.sin(theta) + 6e-3
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
async function copyText(text) {
|
|
210
|
+
var _a;
|
|
211
|
+
if (typeof ((_a = navigator == null ? void 0 : navigator.clipboard) == null ? void 0 : _a.writeText) === "function") {
|
|
212
|
+
await navigator.clipboard.writeText(text);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
const el = document.createElement("textarea");
|
|
216
|
+
el.value = text;
|
|
217
|
+
el.style.position = "fixed";
|
|
218
|
+
el.style.top = "-200px";
|
|
219
|
+
el.style.left = "-200px";
|
|
220
|
+
el.style.width = "100px";
|
|
221
|
+
el.style.height = "100px";
|
|
222
|
+
document.body.appendChild(el);
|
|
223
|
+
el.focus();
|
|
224
|
+
el.select();
|
|
225
|
+
if (!document.execCommand("copy")) {
|
|
226
|
+
el.remove();
|
|
227
|
+
return Promise.reject(new Error("浏览器不支持复制"));
|
|
228
|
+
}
|
|
229
|
+
el.remove();
|
|
230
|
+
}
|
|
231
|
+
function getValue(data, path, defaultValue) {
|
|
232
|
+
if (data == null) {
|
|
233
|
+
return defaultValue;
|
|
234
|
+
}
|
|
235
|
+
const pathType = typeof path;
|
|
236
|
+
if (pathType === "function") {
|
|
237
|
+
return path(data);
|
|
238
|
+
}
|
|
239
|
+
const fields = (pathType === "string" ? path.match(/[^\[\].]+/g) : path) ?? [];
|
|
240
|
+
let result = data;
|
|
241
|
+
for (const key of fields) {
|
|
242
|
+
result = result[key.trim()];
|
|
243
|
+
}
|
|
244
|
+
return typeof result === "undefined" ? defaultValue : result;
|
|
245
|
+
}
|
|
246
|
+
function debounce(func, wait) {
|
|
247
|
+
let timer = void 0;
|
|
248
|
+
const debounced = function(...args) {
|
|
249
|
+
if (timer) {
|
|
250
|
+
clearTimeout(timer);
|
|
251
|
+
}
|
|
252
|
+
timer = setTimeout(() => {
|
|
253
|
+
func.apply(this, args);
|
|
254
|
+
timer = void 0;
|
|
255
|
+
}, wait);
|
|
256
|
+
};
|
|
257
|
+
return debounced;
|
|
258
|
+
}
|
|
259
|
+
function throttle(func, wait, trailing) {
|
|
260
|
+
let timer = void 0;
|
|
261
|
+
const debounced = function(...args) {
|
|
262
|
+
if (!timer) {
|
|
263
|
+
if (!trailing) {
|
|
264
|
+
func.apply(this, args);
|
|
265
|
+
}
|
|
266
|
+
timer = setTimeout(() => {
|
|
267
|
+
if (trailing) {
|
|
268
|
+
func.apply(this, args);
|
|
269
|
+
}
|
|
270
|
+
timer = void 0;
|
|
271
|
+
}, wait);
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
return debounced;
|
|
275
|
+
}
|
|
276
|
+
function omit(obj, fields) {
|
|
277
|
+
const result = Object.assign({}, obj);
|
|
278
|
+
if (obj) {
|
|
279
|
+
for (const key of fields) {
|
|
280
|
+
delete result[key];
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return result;
|
|
284
|
+
}
|
|
285
|
+
function pick(obj, fields) {
|
|
286
|
+
const result = {};
|
|
287
|
+
if (obj) {
|
|
288
|
+
for (const key of fields) {
|
|
289
|
+
result[key] = obj[key];
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return result;
|
|
293
|
+
}
|
|
294
|
+
export {
|
|
295
|
+
assignObject,
|
|
296
|
+
bd09ToGcj02,
|
|
297
|
+
checkFullscreen,
|
|
298
|
+
contentIsEllipsis,
|
|
299
|
+
copyText,
|
|
300
|
+
debounce,
|
|
301
|
+
eachTree,
|
|
302
|
+
exitFullscreen,
|
|
303
|
+
findTree,
|
|
304
|
+
formatNumber,
|
|
305
|
+
gcj02ToBd09,
|
|
306
|
+
getCurrentStyle,
|
|
307
|
+
getValue,
|
|
308
|
+
isExternalLink,
|
|
309
|
+
mapTree,
|
|
310
|
+
omit,
|
|
311
|
+
pick,
|
|
312
|
+
queryChild,
|
|
313
|
+
random,
|
|
314
|
+
requestFullscreen,
|
|
315
|
+
throttle,
|
|
316
|
+
toTree,
|
|
317
|
+
uuid
|
|
318
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* useTimer 返回结果
|
|
5
|
+
*/
|
|
6
|
+
export type UseTimerResult = [
|
|
7
|
+
(callback?: () => void, timeout?: number) => void,
|
|
8
|
+
() => void,
|
|
9
|
+
Ref<boolean>
|
|
10
|
+
];
|
|
11
|
+
/**
|
|
12
|
+
* 定时器
|
|
13
|
+
* @param ms 等待时间
|
|
14
|
+
* @param cb 执行方法
|
|
15
|
+
*/
|
|
16
|
+
export declare function useTimer(ms?: number | (() => number), cb?: () => void): UseTimerResult;
|
|
17
|
+
/**
|
|
18
|
+
* useMediaQuery 返回结果
|
|
19
|
+
*/
|
|
20
|
+
export type UseMediaQueryResult = [MediaQueryList, () => void, () => void];
|
|
21
|
+
/**
|
|
22
|
+
* 媒体查询
|
|
23
|
+
* @param query 媒体查询字符串
|
|
24
|
+
* @param onChange 改变回调
|
|
25
|
+
*/
|
|
26
|
+
export declare function useMediaQuery(query: string, onChange?: () => void): UseMediaQueryResult;
|
|
27
|
+
/**
|
|
28
|
+
* 窗口事件监听
|
|
29
|
+
* @param event 事件
|
|
30
|
+
* @param listener 回调
|
|
31
|
+
*/
|
|
32
|
+
export declare function useWindowListener(event: string | EventListenerOrEventListenerObject, listener?: EventListenerOrEventListenerObject): void;
|
|
33
|
+
/**
|
|
34
|
+
* 折叠展开动画
|
|
35
|
+
*/
|
|
36
|
+
export declare function useCollapseAnim(): {
|
|
37
|
+
handleBeforeEnter: (el: HTMLElement) => void;
|
|
38
|
+
handleEnter: (el: HTMLElement) => void;
|
|
39
|
+
handleAfterEnter: (el: HTMLElement) => void;
|
|
40
|
+
handleBeforeLeave: (el: HTMLElement) => void;
|
|
41
|
+
handleLeave: (el: HTMLElement) => void;
|
|
42
|
+
handleAfterLeave: (el: HTMLElement) => void;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* 鼠标滚轮事件回调方法参数
|
|
46
|
+
*/
|
|
47
|
+
export interface UseMousewheelCallbackParam {
|
|
48
|
+
/** 事件对象 */
|
|
49
|
+
e: MouseEvent;
|
|
50
|
+
/** 方向 */
|
|
51
|
+
direction: 'up' | 'down';
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 鼠标滚轮事件
|
|
55
|
+
* @param cb 回调
|
|
56
|
+
*/
|
|
57
|
+
export declare function useMousewheel(cb?: (p: UseMousewheelCallbackParam) => void): {
|
|
58
|
+
handleMousewheel: (e: MouseEvent) => void;
|
|
59
|
+
handleFirefoxMousewheel: (e: MouseEvent) => void;
|
|
60
|
+
bindMousewheel: (el: HTMLElement) => void;
|
|
61
|
+
unbindMousewheel: (el: HTMLElement) => void;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* 触摸事件回调参数
|
|
65
|
+
*/
|
|
66
|
+
export interface UseTouchEventCallbackParam<T> {
|
|
67
|
+
/** 事件对象 */
|
|
68
|
+
e: T;
|
|
69
|
+
/** 开始横向位置 */
|
|
70
|
+
startX: number | null;
|
|
71
|
+
/** 开始纵向位置 */
|
|
72
|
+
startY: number | null;
|
|
73
|
+
/** 横向移动距离 */
|
|
74
|
+
distanceX?: number | null;
|
|
75
|
+
/** 纵向移动距离 */
|
|
76
|
+
distanceY?: number | null;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* 触摸事件参数
|
|
80
|
+
*/
|
|
81
|
+
export interface UseTouchEventOption<T> {
|
|
82
|
+
/** 触摸开始的回调 */
|
|
83
|
+
start?: (param: UseTouchEventCallbackParam<T>) => void;
|
|
84
|
+
/** 触摸移动的回调 */
|
|
85
|
+
move?: (param: UseTouchEventCallbackParam<T>) => void;
|
|
86
|
+
/** 触摸结束的回调 */
|
|
87
|
+
end?: (param: UseTouchEventCallbackParam<T>) => void;
|
|
88
|
+
/** touchmove 事件参数 */
|
|
89
|
+
touchmoveOptions?: any;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* 触摸事件
|
|
93
|
+
* @param option 参数
|
|
94
|
+
*/
|
|
95
|
+
export declare function useTouchEvent(option?: UseTouchEventOption<TouchEvent>): {
|
|
96
|
+
handleTouchStart: (e: TouchEvent) => void;
|
|
97
|
+
handleTouchMove: (e: TouchEvent) => void;
|
|
98
|
+
handleTouchEnd: (e: TouchEvent) => void;
|
|
99
|
+
bindTouchEvent: (el: HTMLElement) => void;
|
|
100
|
+
unbindTouchEvent: (el: HTMLElement) => void;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* 移动事件对象
|
|
104
|
+
*/
|
|
105
|
+
export type MoveEvent = MouseEvent | TouchEvent;
|
|
106
|
+
/**
|
|
107
|
+
* 鼠标移动事件或触摸移动事件
|
|
108
|
+
* @param option 参数
|
|
109
|
+
*/
|
|
110
|
+
export declare function useMoveEvent(option?: UseTouchEventOption<MoveEvent>): {
|
|
111
|
+
handleMousedown: (e: MouseEvent) => void;
|
|
112
|
+
handleTouchstart: (e: TouchEvent) => void;
|
|
113
|
+
};
|
package/es/utils/hook.js
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { ref, onBeforeUnmount } from "vue";
|
|
2
|
+
function useTimer(ms, cb) {
|
|
3
|
+
let timer = null;
|
|
4
|
+
const waiting = ref(false);
|
|
5
|
+
const stopTimer = () => {
|
|
6
|
+
if (timer != null) {
|
|
7
|
+
clearTimeout(timer);
|
|
8
|
+
timer = null;
|
|
9
|
+
}
|
|
10
|
+
waiting.value = false;
|
|
11
|
+
};
|
|
12
|
+
const startTimer = (callback, timeout) => {
|
|
13
|
+
stopTimer();
|
|
14
|
+
waiting.value = true;
|
|
15
|
+
const to = timeout ?? (typeof ms === "function" ? ms() : ms);
|
|
16
|
+
timer = setTimeout(() => {
|
|
17
|
+
const func = callback ?? cb;
|
|
18
|
+
func && func();
|
|
19
|
+
waiting.value = false;
|
|
20
|
+
}, to);
|
|
21
|
+
};
|
|
22
|
+
onBeforeUnmount(() => {
|
|
23
|
+
stopTimer();
|
|
24
|
+
});
|
|
25
|
+
return [startTimer, stopTimer, waiting];
|
|
26
|
+
}
|
|
27
|
+
function useMediaQuery(query, onChange) {
|
|
28
|
+
const mediaQuery = window.matchMedia(query);
|
|
29
|
+
const handleChange = () => {
|
|
30
|
+
onChange && onChange();
|
|
31
|
+
};
|
|
32
|
+
const startWatch = () => {
|
|
33
|
+
stopWatch();
|
|
34
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
35
|
+
};
|
|
36
|
+
const stopWatch = () => {
|
|
37
|
+
mediaQuery.removeEventListener("change", handleChange);
|
|
38
|
+
handleChange();
|
|
39
|
+
};
|
|
40
|
+
onBeforeUnmount(() => {
|
|
41
|
+
stopWatch();
|
|
42
|
+
});
|
|
43
|
+
return [mediaQuery, startWatch, stopWatch];
|
|
44
|
+
}
|
|
45
|
+
function useWindowListener(event, listener) {
|
|
46
|
+
const eventName = typeof event === "string" ? event : "resize";
|
|
47
|
+
const callback = typeof event === "function" ? event : listener;
|
|
48
|
+
if (callback != null) {
|
|
49
|
+
window.addEventListener(eventName, callback);
|
|
50
|
+
}
|
|
51
|
+
onBeforeUnmount(() => {
|
|
52
|
+
if (callback != null) {
|
|
53
|
+
window.removeEventListener(eventName, callback);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function useCollapseAnim() {
|
|
58
|
+
let enterHeight = 0;
|
|
59
|
+
const getHeight = (el, isEnter) => {
|
|
60
|
+
if (!isEnter) {
|
|
61
|
+
return Math.max(el.offsetHeight, el.scrollHeight);
|
|
62
|
+
}
|
|
63
|
+
return Math.max(el.offsetHeight, el.scrollHeight, enterHeight);
|
|
64
|
+
};
|
|
65
|
+
const handleBeforeEnter = (el) => {
|
|
66
|
+
el.dataset.oldPaddingTop = el.style.paddingTop;
|
|
67
|
+
el.dataset.oldPaddingBottom = el.style.paddingBottom;
|
|
68
|
+
el.style.maxHeight = "0px";
|
|
69
|
+
el.style.paddingTop = "0px";
|
|
70
|
+
el.style.paddingBottom = "0px";
|
|
71
|
+
};
|
|
72
|
+
const handleEnter = (el) => {
|
|
73
|
+
el.dataset.oldOverflow = el.style.overflow;
|
|
74
|
+
el.style.maxHeight = `${getHeight(el, true)}px`;
|
|
75
|
+
el.style.paddingTop = el.dataset.oldPaddingTop ?? "";
|
|
76
|
+
el.style.paddingBottom = el.dataset.oldPaddingBottom ?? "";
|
|
77
|
+
el.style.overflow = "hidden";
|
|
78
|
+
};
|
|
79
|
+
const handleAfterEnter = (el) => {
|
|
80
|
+
el.style.maxHeight = "";
|
|
81
|
+
el.style.overflow = el.dataset.oldOverflow ?? "";
|
|
82
|
+
};
|
|
83
|
+
const handleBeforeLeave = (el) => {
|
|
84
|
+
el.dataset.oldPaddingTop = el.style.paddingTop;
|
|
85
|
+
el.dataset.oldPaddingBottom = el.style.paddingBottom;
|
|
86
|
+
el.dataset.oldOverflow = el.style.overflow;
|
|
87
|
+
enterHeight = getHeight(el);
|
|
88
|
+
el.style.maxHeight = `${enterHeight}px`;
|
|
89
|
+
el.style.overflow = "hidden";
|
|
90
|
+
};
|
|
91
|
+
const handleLeave = (el) => {
|
|
92
|
+
el.style.maxHeight = "0px";
|
|
93
|
+
el.style.paddingTop = "0px";
|
|
94
|
+
el.style.paddingBottom = "0px";
|
|
95
|
+
};
|
|
96
|
+
const handleAfterLeave = (el) => {
|
|
97
|
+
el.style.maxHeight = "";
|
|
98
|
+
el.style.overflow = el.dataset.oldOverflow ?? "";
|
|
99
|
+
el.style.paddingTop = el.dataset.oldPaddingTop ?? "";
|
|
100
|
+
el.style.paddingBottom = el.dataset.oldPaddingBottom ?? "";
|
|
101
|
+
};
|
|
102
|
+
return {
|
|
103
|
+
handleBeforeEnter,
|
|
104
|
+
handleEnter,
|
|
105
|
+
handleAfterEnter,
|
|
106
|
+
handleBeforeLeave,
|
|
107
|
+
handleLeave,
|
|
108
|
+
handleAfterLeave
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function useMousewheel(cb) {
|
|
112
|
+
const handleMousewheel = (e) => {
|
|
113
|
+
const delta = e.wheelDelta || e.detail;
|
|
114
|
+
cb && cb({ e, direction: delta > 0 ? "up" : "down" });
|
|
115
|
+
};
|
|
116
|
+
const handleFirefoxMousewheel = (e) => {
|
|
117
|
+
const delta = e.wheelDelta || e.detail;
|
|
118
|
+
cb && cb({ e, direction: delta < 0 ? "up" : "down" });
|
|
119
|
+
};
|
|
120
|
+
const bindMousewheel = (el) => {
|
|
121
|
+
el.addEventListener("mousewheel", handleMousewheel, { passive: false });
|
|
122
|
+
el.addEventListener("DOMMouseScroll", handleFirefoxMousewheel);
|
|
123
|
+
};
|
|
124
|
+
const unbindMousewheel = (el) => {
|
|
125
|
+
el.removeEventListener("mousewheel", handleMousewheel);
|
|
126
|
+
el.removeEventListener("DOMMouseScroll", handleFirefoxMousewheel);
|
|
127
|
+
};
|
|
128
|
+
return {
|
|
129
|
+
handleMousewheel,
|
|
130
|
+
handleFirefoxMousewheel,
|
|
131
|
+
bindMousewheel,
|
|
132
|
+
unbindMousewheel
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function useTouchEvent(option) {
|
|
136
|
+
let startX = null;
|
|
137
|
+
let startY = null;
|
|
138
|
+
let distanceX = null;
|
|
139
|
+
let distanceY = null;
|
|
140
|
+
const handleTouchStart = (e) => {
|
|
141
|
+
startX = e.touches[0].clientX;
|
|
142
|
+
startY = e.touches[0].clientY;
|
|
143
|
+
if (option && option.start) {
|
|
144
|
+
option.start({ e, startX, startY });
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const handleTouchMove = (e) => {
|
|
148
|
+
if (startX != null && startY != null) {
|
|
149
|
+
const currentX = e.touches[0].clientX;
|
|
150
|
+
const currentY = e.touches[0].clientY;
|
|
151
|
+
distanceX = currentX - startX;
|
|
152
|
+
distanceY = currentY - startY;
|
|
153
|
+
if (option && option.move) {
|
|
154
|
+
option.move({ e, startX, startY, distanceX, distanceY });
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const handleTouchEnd = (e) => {
|
|
159
|
+
if (option && option.end) {
|
|
160
|
+
option.end({ e, startX, startY, distanceX, distanceY });
|
|
161
|
+
}
|
|
162
|
+
startX = null;
|
|
163
|
+
startY = null;
|
|
164
|
+
distanceX = null;
|
|
165
|
+
distanceY = null;
|
|
166
|
+
};
|
|
167
|
+
const bindTouchEvent = (el) => {
|
|
168
|
+
el.addEventListener("touchstart", handleTouchStart);
|
|
169
|
+
el.addEventListener("touchmove", handleTouchMove);
|
|
170
|
+
el.addEventListener("touchend", handleTouchEnd);
|
|
171
|
+
};
|
|
172
|
+
const unbindTouchEvent = (el) => {
|
|
173
|
+
el.removeEventListener("touchstart", handleTouchStart);
|
|
174
|
+
el.removeEventListener("touchmove", handleTouchMove);
|
|
175
|
+
el.removeEventListener("touchend", handleTouchEnd);
|
|
176
|
+
};
|
|
177
|
+
return {
|
|
178
|
+
handleTouchStart,
|
|
179
|
+
handleTouchMove,
|
|
180
|
+
handleTouchEnd,
|
|
181
|
+
bindTouchEvent,
|
|
182
|
+
unbindTouchEvent
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function useMoveEvent(option) {
|
|
186
|
+
let startX = null;
|
|
187
|
+
let startY = null;
|
|
188
|
+
let distanceX = null;
|
|
189
|
+
let distanceY = null;
|
|
190
|
+
const unbindEvent = () => {
|
|
191
|
+
document.removeEventListener("mousemove", mousemoveFn);
|
|
192
|
+
document.removeEventListener("mouseup", mouseupFn);
|
|
193
|
+
document.removeEventListener("touchmove", touchmoveFn);
|
|
194
|
+
document.removeEventListener("touchend", touchendFn);
|
|
195
|
+
};
|
|
196
|
+
const emitStart = (clientX, clientY, e) => {
|
|
197
|
+
startX = clientX;
|
|
198
|
+
startY = clientY;
|
|
199
|
+
if (option && option.start) {
|
|
200
|
+
option.start({ e, startX, startY });
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
const emitMove = (currentX, currentY, e) => {
|
|
204
|
+
if (startX != null && startY != null) {
|
|
205
|
+
distanceX = currentX - startX;
|
|
206
|
+
distanceY = currentY - startY;
|
|
207
|
+
if (option && option.move) {
|
|
208
|
+
option.move({ e, startX, startY, distanceX, distanceY });
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const emitEnd = (e) => {
|
|
213
|
+
unbindEvent();
|
|
214
|
+
if (option && option.end) {
|
|
215
|
+
option.end({ e, startX, startY, distanceX, distanceY });
|
|
216
|
+
}
|
|
217
|
+
startX = null;
|
|
218
|
+
startY = null;
|
|
219
|
+
distanceX = null;
|
|
220
|
+
distanceY = null;
|
|
221
|
+
};
|
|
222
|
+
const mousemoveFn = function(e) {
|
|
223
|
+
emitMove(e.clientX, e.clientY, e);
|
|
224
|
+
};
|
|
225
|
+
const touchmoveFn = function(e) {
|
|
226
|
+
emitMove(e.touches[0].clientX, e.touches[0].clientY, e);
|
|
227
|
+
};
|
|
228
|
+
const mouseupFn = (e) => {
|
|
229
|
+
emitEnd(e);
|
|
230
|
+
};
|
|
231
|
+
const touchendFn = (e) => {
|
|
232
|
+
emitEnd(e);
|
|
233
|
+
};
|
|
234
|
+
const handleMousedown = (e) => {
|
|
235
|
+
emitStart(e.clientX, e.clientY, e);
|
|
236
|
+
document.addEventListener("mousemove", mousemoveFn);
|
|
237
|
+
document.addEventListener("mouseup", mouseupFn);
|
|
238
|
+
};
|
|
239
|
+
const handleTouchstart = (e) => {
|
|
240
|
+
emitStart(e.touches[0].clientX, e.touches[0].clientY, e);
|
|
241
|
+
document.addEventListener(
|
|
242
|
+
"touchmove",
|
|
243
|
+
touchmoveFn,
|
|
244
|
+
option == null ? void 0 : option.touchmoveOptions
|
|
245
|
+
);
|
|
246
|
+
document.addEventListener("touchend", touchendFn);
|
|
247
|
+
};
|
|
248
|
+
onBeforeUnmount(() => {
|
|
249
|
+
unbindEvent();
|
|
250
|
+
});
|
|
251
|
+
return {
|
|
252
|
+
handleMousedown,
|
|
253
|
+
handleTouchstart
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
export {
|
|
257
|
+
useCollapseAnim,
|
|
258
|
+
useMediaQuery,
|
|
259
|
+
useMousewheel,
|
|
260
|
+
useMoveEvent,
|
|
261
|
+
useTimer,
|
|
262
|
+
useTouchEvent,
|
|
263
|
+
useWindowListener
|
|
264
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RouteRecordRaw, _RouteRecordBase, RouteComponent } from 'vue-router';
|
|
2
|
+
import { MenuItem } from '../ele-pro-layout/types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 获取路由组件方法
|
|
6
|
+
*/
|
|
7
|
+
export type GetComponent = (component?: string, menu?: MenuItem, name?: string) => (() => Promise<RouteComponent>) | RouteComponent | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* 菜单数据转为路由数据
|
|
10
|
+
* @param menus 菜单数据
|
|
11
|
+
* @param getComponent 加载组件的方法
|
|
12
|
+
* @param added 已添加的路由
|
|
13
|
+
*/
|
|
14
|
+
export declare function menuToRoutes(menus: MenuItem[] | undefined, getComponent: GetComponent, added?: _RouteRecordBase[]): RouteRecordRaw[] | undefined;
|