yuang-framework-ui-pc 1.0.20 → 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 -45
- 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/lib/utils/vueRouterUtils.ts +0 -30
- 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/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
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, h } from "vue";
|
|
2
|
+
import { useRoute } from "vue-router";
|
|
3
|
+
import { useProLayoutState, getIframeSrc } from "../ele-pro-layout/util";
|
|
4
|
+
import { isExternalLink, findTree } from "./core";
|
|
5
|
+
function camelCase(str) {
|
|
6
|
+
const val = str.replace(/[-|/](\w)/g, (_, c) => c ? c.toUpperCase() : "");
|
|
7
|
+
return val.charAt(0).toUpperCase() + val.slice(1);
|
|
8
|
+
}
|
|
9
|
+
function pathIsAdd(path, data) {
|
|
10
|
+
return findTree(data, (d) => path === d.path) != null;
|
|
11
|
+
}
|
|
12
|
+
function getRoutePath(path) {
|
|
13
|
+
if (!path || !path.includes("?")) {
|
|
14
|
+
return path;
|
|
15
|
+
}
|
|
16
|
+
return path.substring(0, path.indexOf("?"));
|
|
17
|
+
}
|
|
18
|
+
function getRouteComponent(menu, name, func) {
|
|
19
|
+
if (!menu.component || !isExternalLink(menu.component)) {
|
|
20
|
+
return { component: func(menu.component, menu, name) };
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
component: defineComponent({
|
|
24
|
+
name,
|
|
25
|
+
setup() {
|
|
26
|
+
var _a;
|
|
27
|
+
const proLayoutState = useProLayoutState();
|
|
28
|
+
const route = useRoute();
|
|
29
|
+
const { fullPath } = route;
|
|
30
|
+
const iframeSrc = ref(getIframeSrc(fullPath, menu.component));
|
|
31
|
+
const isAlive = ((_a = menu.meta) == null ? void 0 : _a.keepAlive) !== false;
|
|
32
|
+
const keepAlive = computed(() => !!proLayoutState.keepAlive);
|
|
33
|
+
return () => {
|
|
34
|
+
if (!isAlive || !keepAlive.value) {
|
|
35
|
+
return h("iframe", {
|
|
36
|
+
src: iframeSrc.value,
|
|
37
|
+
class: "ele-admin-iframe"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return h("div", { class: "ele-none", style: { display: "none" } });
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
|
+
link: true
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function menuToRoutes(menus, getComponent, added) {
|
|
48
|
+
if (!(menus == null ? void 0 : menus.length)) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const routes = [];
|
|
52
|
+
const addedRoutes = added ? [...added] : [];
|
|
53
|
+
menus.forEach((item) => {
|
|
54
|
+
const meta = { ...item.meta };
|
|
55
|
+
const path = getRoutePath(meta.routePath || item.path);
|
|
56
|
+
if (path && !isExternalLink(path) && !pathIsAdd(path, addedRoutes)) {
|
|
57
|
+
const name = item.name || camelCase(path);
|
|
58
|
+
const { component, link } = getRouteComponent(item, name, getComponent);
|
|
59
|
+
if (link) {
|
|
60
|
+
meta.iframe = item.component;
|
|
61
|
+
meta.hideFooter = true;
|
|
62
|
+
}
|
|
63
|
+
addedRoutes.push({ path });
|
|
64
|
+
routes.push({
|
|
65
|
+
name,
|
|
66
|
+
path,
|
|
67
|
+
component,
|
|
68
|
+
redirect: item.redirect,
|
|
69
|
+
meta,
|
|
70
|
+
children: menuToRoutes(item.children, getComponent, addedRoutes)
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return routes;
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
menuToRoutes
|
|
78
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AppContext } from 'vue';
|
|
2
|
+
import { ElMessageBoxOptions, MessageBoxData as ElMessageBoxData } from 'element-plus';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 消息弹窗配置
|
|
6
|
+
*/
|
|
7
|
+
export interface MessageBoxOptions extends ElMessageBoxOptions {
|
|
8
|
+
/** 是否限制在主体内部 */
|
|
9
|
+
inner?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 消息弹窗方法
|
|
13
|
+
*/
|
|
14
|
+
export type MessageBoxMethod = (message: ElMessageBoxOptions['message'], title: ElMessageBoxOptions['title'], options?: MessageBoxOptions, context?: AppContext | null) => Promise<ElMessageBoxData>;
|
|
15
|
+
/**
|
|
16
|
+
* 消息弹窗
|
|
17
|
+
*/
|
|
18
|
+
export interface MessageBox {
|
|
19
|
+
(options?: MessageBoxOptions, context?: AppContext | null): Promise<ElMessageBoxData>;
|
|
20
|
+
alert: MessageBoxMethod;
|
|
21
|
+
confirm: MessageBoxMethod;
|
|
22
|
+
prompt: MessageBoxMethod;
|
|
23
|
+
close: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function useMessageBox(globalOpt?: MessageBoxOptions): MessageBox;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { getCurrentInstance, onActivated, onDeactivated, onBeforeUnmount, unref, h } from "vue";
|
|
2
|
+
import { ElMessageBox } from "element-plus";
|
|
3
|
+
import { useGlobalProps } from "../ele-config-provider/receiver";
|
|
4
|
+
import { useLayoutState } from "../ele-pro-layout/util";
|
|
5
|
+
import MessageBoxIcon from "../ele-app/components/message-box-icon";
|
|
6
|
+
import { omit } from "./core";
|
|
7
|
+
function getWrapEl(bodyEl) {
|
|
8
|
+
const parent = bodyEl || document.body;
|
|
9
|
+
const className = "ele-message-box-wrapper";
|
|
10
|
+
const elem = document.createElement("div");
|
|
11
|
+
elem.classList.add(className);
|
|
12
|
+
parent.appendChild(elem);
|
|
13
|
+
return elem;
|
|
14
|
+
}
|
|
15
|
+
function useMessageBox(globalOpt) {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
const layoutState = useLayoutState();
|
|
18
|
+
const globalProps = useGlobalProps("messageBox");
|
|
19
|
+
const appContext = (_b = (_a = getCurrentInstance) == null ? void 0 : _a()) == null ? void 0 : _b.appContext;
|
|
20
|
+
const state = { wrapEl: null, isActivated: true, id: 0 };
|
|
21
|
+
const instances = /* @__PURE__ */ new Map();
|
|
22
|
+
const hideClass = "is-hide";
|
|
23
|
+
onActivated(() => {
|
|
24
|
+
state.isActivated = true;
|
|
25
|
+
state.wrapEl && state.wrapEl.classList.remove(hideClass);
|
|
26
|
+
});
|
|
27
|
+
onDeactivated(() => {
|
|
28
|
+
state.isActivated = false;
|
|
29
|
+
state.wrapEl && state.wrapEl.classList.add(hideClass);
|
|
30
|
+
});
|
|
31
|
+
onBeforeUnmount(() => {
|
|
32
|
+
for (const [_key, insDoClose] of instances) {
|
|
33
|
+
insDoClose && insDoClose();
|
|
34
|
+
}
|
|
35
|
+
instances.clear();
|
|
36
|
+
});
|
|
37
|
+
const getOption = (options) => {
|
|
38
|
+
state.id++;
|
|
39
|
+
const msgId = `m_${state.id}`;
|
|
40
|
+
const opt = {
|
|
41
|
+
...globalProps.value || {},
|
|
42
|
+
...globalOpt || {},
|
|
43
|
+
...options || {}
|
|
44
|
+
};
|
|
45
|
+
if (opt.inner) {
|
|
46
|
+
if (opt.appendTo == null && layoutState.modalsEl != null) {
|
|
47
|
+
if (state.wrapEl == null) {
|
|
48
|
+
state.wrapEl = getWrapEl(layoutState.modalsEl);
|
|
49
|
+
}
|
|
50
|
+
opt.appendTo = state.wrapEl;
|
|
51
|
+
} else if (opt.appendTo != null) {
|
|
52
|
+
opt.appendTo = unref(opt.appendTo);
|
|
53
|
+
}
|
|
54
|
+
opt.lockScroll = false;
|
|
55
|
+
} else if (opt.appendTo != null) {
|
|
56
|
+
opt.appendTo = unref(opt.appendTo);
|
|
57
|
+
}
|
|
58
|
+
const classes = ["ele-message-box"];
|
|
59
|
+
if (opt.customClass) {
|
|
60
|
+
classes.push(opt.customClass);
|
|
61
|
+
}
|
|
62
|
+
opt.customClass = classes.join(" ");
|
|
63
|
+
opt.icon = h(MessageBoxIcon, {
|
|
64
|
+
type: opt.type,
|
|
65
|
+
icon: opt.icon,
|
|
66
|
+
boxId: msgId,
|
|
67
|
+
onBoxDestroy: (boxId) => {
|
|
68
|
+
boxId && instances.delete(boxId);
|
|
69
|
+
},
|
|
70
|
+
onBoxMounted: ({ boxId, doClose }) => {
|
|
71
|
+
boxId && instances.set(boxId, doClose);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return omit(opt, ["inner"]);
|
|
75
|
+
};
|
|
76
|
+
const messageBox = function(options) {
|
|
77
|
+
return ElMessageBox(getOption(options), appContext);
|
|
78
|
+
};
|
|
79
|
+
messageBox.alert = function(message, title, options, context) {
|
|
80
|
+
const ctx = context ?? appContext;
|
|
81
|
+
return ElMessageBox.alert(message, title, getOption(options), ctx);
|
|
82
|
+
};
|
|
83
|
+
messageBox.confirm = function(message, title, options, context) {
|
|
84
|
+
const ctx = context ?? appContext;
|
|
85
|
+
return ElMessageBox.confirm(message, title, getOption(options), ctx);
|
|
86
|
+
};
|
|
87
|
+
messageBox.prompt = function(message, title, options, context) {
|
|
88
|
+
const ctx = context ?? appContext;
|
|
89
|
+
return ElMessageBox.prompt(message, title, getOption(options), ctx);
|
|
90
|
+
};
|
|
91
|
+
messageBox.close = function() {
|
|
92
|
+
return ElMessageBox.close();
|
|
93
|
+
};
|
|
94
|
+
return messageBox;
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
useMessageBox
|
|
98
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { AppContext, InjectionKey } from 'vue';
|
|
2
|
+
import { MessageHandler as ElMessageHandler, MessageOptions as ElMessageOptions, MessageFn as ElMessageFn } from 'element-plus/es/components/message';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 消息提示配置
|
|
6
|
+
*/
|
|
7
|
+
export interface MessageOptions extends ElMessageOptions {
|
|
8
|
+
/** 是否为原始风格 */
|
|
9
|
+
original?: boolean | 'plain';
|
|
10
|
+
/** 是否显示遮罩层 */
|
|
11
|
+
mask?: boolean;
|
|
12
|
+
/** 是否居中显示 */
|
|
13
|
+
centered?: boolean;
|
|
14
|
+
/** 是否限制在主体内部 */
|
|
15
|
+
inner?: boolean;
|
|
16
|
+
/** 限制在主体内部的分组标识 */
|
|
17
|
+
groupKey?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 消息提示方法参数
|
|
21
|
+
*/
|
|
22
|
+
export type MessageParams = MessageOptions | ElMessageOptions['message'];
|
|
23
|
+
/**
|
|
24
|
+
* 消息提示方法
|
|
25
|
+
*/
|
|
26
|
+
export type MessageFn = (options?: MessageParams, context?: null | AppContext) => ElMessageHandler;
|
|
27
|
+
/**
|
|
28
|
+
* 消息提示
|
|
29
|
+
*/
|
|
30
|
+
export interface Message extends MessageFn {
|
|
31
|
+
closeAll: ElMessageFn['closeAll'];
|
|
32
|
+
success: MessageFn;
|
|
33
|
+
warning: MessageFn;
|
|
34
|
+
error: MessageFn;
|
|
35
|
+
info: MessageFn;
|
|
36
|
+
loading: MessageFn;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 消息提示依赖注入
|
|
40
|
+
*/
|
|
41
|
+
interface MessageProvide {
|
|
42
|
+
/** 限制在主体内部的分组标识 */
|
|
43
|
+
groupKey: string;
|
|
44
|
+
/** 获取限制在主体内部的容器 */
|
|
45
|
+
getInnerWrap: () => HTMLElement;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 消息提示依赖注入key
|
|
49
|
+
*/
|
|
50
|
+
type MessageKey = InjectionKey<MessageProvide>;
|
|
51
|
+
/**
|
|
52
|
+
* 提供各种调用方法
|
|
53
|
+
* @param options 参数
|
|
54
|
+
* @param context 上下文
|
|
55
|
+
*/
|
|
56
|
+
declare const EleMessage: Message;
|
|
57
|
+
export { EleMessage };
|
|
58
|
+
/**
|
|
59
|
+
* 消息提示依赖注入key
|
|
60
|
+
*/
|
|
61
|
+
export declare const MESSAGE_KEY: MessageKey;
|
|
62
|
+
/**
|
|
63
|
+
* 带当前上下文的消息提示
|
|
64
|
+
* @param options 参数
|
|
65
|
+
*/
|
|
66
|
+
export declare function useMessage(globalOpt?: MessageOptions): Message;
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { getCurrentInstance, provide, inject, onActivated, onDeactivated, onBeforeUnmount, unref, isVNode, h, mergeProps } from "vue";
|
|
2
|
+
import { ElMessage } from "element-plus";
|
|
3
|
+
import { useGlobalProps } from "../ele-config-provider/receiver";
|
|
4
|
+
import { useLayoutState } from "../ele-pro-layout/util";
|
|
5
|
+
import MessageBody from "../ele-app/components/message-body";
|
|
6
|
+
import { queryChild, omit } from "./core";
|
|
7
|
+
function blurCurrentFocus() {
|
|
8
|
+
var _a;
|
|
9
|
+
if (typeof ((_a = document == null ? void 0 : document.body) == null ? void 0 : _a.querySelector) === "function") {
|
|
10
|
+
const el = document.body.querySelector(":focus");
|
|
11
|
+
typeof (el == null ? void 0 : el.blur) === "function" && el.blur();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function getWrapEl(bodyEl, force, groupKey) {
|
|
15
|
+
const parent = bodyEl || document.body;
|
|
16
|
+
const className = "ele-message-wrapper";
|
|
17
|
+
const attr = "data-group";
|
|
18
|
+
const attrSelector = groupKey == null ? void 0 : [attr, groupKey];
|
|
19
|
+
const el = force ? void 0 : queryChild(parent, className, attrSelector);
|
|
20
|
+
if (el != null) {
|
|
21
|
+
return el;
|
|
22
|
+
}
|
|
23
|
+
const elem = document.createElement("div");
|
|
24
|
+
elem.classList.add(className);
|
|
25
|
+
if (groupKey) {
|
|
26
|
+
elem.setAttribute(attr, groupKey);
|
|
27
|
+
}
|
|
28
|
+
parent.appendChild(elem);
|
|
29
|
+
return elem;
|
|
30
|
+
}
|
|
31
|
+
function getDefaultGroupKey() {
|
|
32
|
+
const url = location == null ? void 0 : location.href;
|
|
33
|
+
const pi = url.indexOf("?");
|
|
34
|
+
return url.substring(0, pi < 0 ? void 0 : pi);
|
|
35
|
+
}
|
|
36
|
+
function getOffsetStyle(offset, userStyle) {
|
|
37
|
+
const mt = typeof offset === "number" ? `${offset}px` : offset;
|
|
38
|
+
return mergeProps({ style: { marginTop: mt } }, { style: userStyle }).style;
|
|
39
|
+
}
|
|
40
|
+
function isObjOpt(params) {
|
|
41
|
+
return params != null && typeof params === "object" && !isVNode(params);
|
|
42
|
+
}
|
|
43
|
+
function normalizeOption(params, globalOpt, onClose, type, loading, getWrapEl2, groupKey, messageId, onMessageDestroy) {
|
|
44
|
+
const opt = { ...globalOpt || {} };
|
|
45
|
+
if (isObjOpt(params)) {
|
|
46
|
+
Object.assign(opt, params);
|
|
47
|
+
} else {
|
|
48
|
+
opt.message = params;
|
|
49
|
+
}
|
|
50
|
+
opt.type = type ?? opt.type;
|
|
51
|
+
opt.appendTo = (opt.appendTo == null ? void 0 : unref(opt.appendTo)) ?? (getWrapEl2 == null ? void 0 : getWrapEl2(opt.inner));
|
|
52
|
+
const classes = ["ele-message"];
|
|
53
|
+
if (opt.original === "plain") {
|
|
54
|
+
classes.push("is-plain-alert");
|
|
55
|
+
} else if (opt.original) {
|
|
56
|
+
classes.push("is-alert");
|
|
57
|
+
} else if (opt.plain) {
|
|
58
|
+
classes.push("is-plain");
|
|
59
|
+
}
|
|
60
|
+
if (loading) {
|
|
61
|
+
classes.push("is-loading");
|
|
62
|
+
opt.duration = opt.duration ?? 0;
|
|
63
|
+
if (opt.mask) {
|
|
64
|
+
classes.push("is-show-mask");
|
|
65
|
+
}
|
|
66
|
+
if (opt.centered) {
|
|
67
|
+
classes.push("is-centered");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (opt.inner) {
|
|
71
|
+
classes.push("is-inner");
|
|
72
|
+
}
|
|
73
|
+
if (opt.customClass) {
|
|
74
|
+
classes.push(opt.customClass);
|
|
75
|
+
}
|
|
76
|
+
opt.customClass = classes.join(" ");
|
|
77
|
+
if (opt.offset != null && opt.offset !== "") {
|
|
78
|
+
opt.style = getOffsetStyle(opt.offset, opt.style);
|
|
79
|
+
}
|
|
80
|
+
const content = opt.message;
|
|
81
|
+
const isFn = typeof content === "function";
|
|
82
|
+
const isStr = !(isFn || isVNode(content));
|
|
83
|
+
opt.icon = h(
|
|
84
|
+
MessageBody,
|
|
85
|
+
{
|
|
86
|
+
message: isStr && content != null ? String(content) : void 0,
|
|
87
|
+
type: opt.type,
|
|
88
|
+
icon: opt.icon,
|
|
89
|
+
showClose: opt.showClose,
|
|
90
|
+
dangerouslyUseHTMLString: opt.dangerouslyUseHTMLString,
|
|
91
|
+
loading,
|
|
92
|
+
messageId,
|
|
93
|
+
onClose,
|
|
94
|
+
onMessageDestroy
|
|
95
|
+
},
|
|
96
|
+
{ default: isFn ? content : isStr ? void 0 : () => content }
|
|
97
|
+
);
|
|
98
|
+
const key = (opt.inner ? groupKey : void 0) ?? "";
|
|
99
|
+
opt.message = isStr ? `${key}_${content ?? ""}` : void 0;
|
|
100
|
+
opt.grouping = isStr ? opt.grouping : false;
|
|
101
|
+
return omit(opt, [
|
|
102
|
+
"showClose",
|
|
103
|
+
"dangerouslyUseHTMLString",
|
|
104
|
+
"offset",
|
|
105
|
+
"original",
|
|
106
|
+
"plain",
|
|
107
|
+
"mask",
|
|
108
|
+
"centered",
|
|
109
|
+
"inner",
|
|
110
|
+
"groupKey"
|
|
111
|
+
]);
|
|
112
|
+
}
|
|
113
|
+
const EleMessage = function(params, context) {
|
|
114
|
+
const onClose = () => ins.close();
|
|
115
|
+
const getWrap = () => getWrapEl();
|
|
116
|
+
const opt = normalizeOption(params, null, onClose, null, null, getWrap);
|
|
117
|
+
const ins = ElMessage(opt, context);
|
|
118
|
+
return ins;
|
|
119
|
+
};
|
|
120
|
+
EleMessage.success = function(params, context) {
|
|
121
|
+
const onClose = () => ins.close();
|
|
122
|
+
const getWrap = () => getWrapEl();
|
|
123
|
+
const opt = normalizeOption(params, null, onClose, "success", null, getWrap);
|
|
124
|
+
const ins = ElMessage(opt, context);
|
|
125
|
+
return ins;
|
|
126
|
+
};
|
|
127
|
+
EleMessage.warning = function(params, context) {
|
|
128
|
+
const onClose = () => ins.close();
|
|
129
|
+
const getWrap = () => getWrapEl();
|
|
130
|
+
const opt = normalizeOption(params, null, onClose, "warning", null, getWrap);
|
|
131
|
+
const ins = ElMessage(opt, context);
|
|
132
|
+
return ins;
|
|
133
|
+
};
|
|
134
|
+
EleMessage.error = function(params, context) {
|
|
135
|
+
const onClose = () => ins.close();
|
|
136
|
+
const getWrap = () => getWrapEl();
|
|
137
|
+
const opt = normalizeOption(params, null, onClose, "error", null, getWrap);
|
|
138
|
+
const ins = ElMessage(opt, context);
|
|
139
|
+
return ins;
|
|
140
|
+
};
|
|
141
|
+
EleMessage.info = function(params, context) {
|
|
142
|
+
const onClose = () => ins.close();
|
|
143
|
+
const getWrap = () => getWrapEl();
|
|
144
|
+
const opt = normalizeOption(params, null, onClose, null, null, getWrap);
|
|
145
|
+
const ins = ElMessage(opt, context);
|
|
146
|
+
return ins;
|
|
147
|
+
};
|
|
148
|
+
EleMessage.loading = function(params, context) {
|
|
149
|
+
blurCurrentFocus();
|
|
150
|
+
const onClose = () => ins.close();
|
|
151
|
+
const getWrap = () => getWrapEl();
|
|
152
|
+
const opt = normalizeOption(params, null, onClose, null, true, getWrap);
|
|
153
|
+
const ins = ElMessage(opt, context);
|
|
154
|
+
return ins;
|
|
155
|
+
};
|
|
156
|
+
EleMessage.closeAll = function(type) {
|
|
157
|
+
return ElMessage.closeAll(type);
|
|
158
|
+
};
|
|
159
|
+
const MESSAGE_KEY = Symbol("message");
|
|
160
|
+
function useMessage(globalOpt) {
|
|
161
|
+
var _a, _b;
|
|
162
|
+
const layoutState = useLayoutState();
|
|
163
|
+
const globalProps = useGlobalProps("message");
|
|
164
|
+
const appContext = (_b = (_a = getCurrentInstance) == null ? void 0 : _a()) == null ? void 0 : _b.appContext;
|
|
165
|
+
const groupKey = (globalOpt == null ? void 0 : globalOpt.groupKey) || getDefaultGroupKey();
|
|
166
|
+
const state = { wrapEl: null, isActivated: true, id: 0 };
|
|
167
|
+
const instances = /* @__PURE__ */ new Map();
|
|
168
|
+
const hideClass = "is-hide";
|
|
169
|
+
provide(MESSAGE_KEY, { groupKey, getInnerWrap: () => getWrap(true) });
|
|
170
|
+
const parentMsg = inject(MESSAGE_KEY, null);
|
|
171
|
+
onActivated(() => {
|
|
172
|
+
state.isActivated = true;
|
|
173
|
+
state.wrapEl && state.wrapEl.classList.remove(hideClass);
|
|
174
|
+
});
|
|
175
|
+
onDeactivated(() => {
|
|
176
|
+
state.isActivated = false;
|
|
177
|
+
state.wrapEl && state.wrapEl.classList.add(hideClass);
|
|
178
|
+
});
|
|
179
|
+
onBeforeUnmount(() => {
|
|
180
|
+
for (const [_key, ins] of instances) {
|
|
181
|
+
ins && ins.close && ins.close();
|
|
182
|
+
}
|
|
183
|
+
instances.clear();
|
|
184
|
+
});
|
|
185
|
+
const getWrap = (inner) => {
|
|
186
|
+
if (inner) {
|
|
187
|
+
if (parentMsg != null && parentMsg.groupKey === groupKey) {
|
|
188
|
+
return parentMsg.getInnerWrap();
|
|
189
|
+
}
|
|
190
|
+
if (state.wrapEl == null && layoutState.modalsEl != null) {
|
|
191
|
+
state.wrapEl = getWrapEl(layoutState.modalsEl, false, groupKey);
|
|
192
|
+
if (!state.isActivated) {
|
|
193
|
+
state.wrapEl.classList.add(hideClass);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (state.wrapEl != null) {
|
|
197
|
+
return state.wrapEl;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return getWrapEl();
|
|
201
|
+
};
|
|
202
|
+
const getOpt = function(params, onClose, type, loading) {
|
|
203
|
+
state.id++;
|
|
204
|
+
const msgId = `m_${state.id}`;
|
|
205
|
+
const opt = normalizeOption(
|
|
206
|
+
params,
|
|
207
|
+
{ ...globalProps.value || {}, ...globalOpt || {} },
|
|
208
|
+
onClose,
|
|
209
|
+
type,
|
|
210
|
+
loading,
|
|
211
|
+
getWrap,
|
|
212
|
+
groupKey,
|
|
213
|
+
msgId,
|
|
214
|
+
(messageId) => {
|
|
215
|
+
messageId && instances.delete(messageId);
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
return { opt, msgId };
|
|
219
|
+
};
|
|
220
|
+
const message = function(params) {
|
|
221
|
+
const { opt, msgId } = getOpt(params, () => ins.close());
|
|
222
|
+
const ins = ElMessage(opt, appContext);
|
|
223
|
+
instances.set(msgId, ins);
|
|
224
|
+
return ins;
|
|
225
|
+
};
|
|
226
|
+
message.success = function(params) {
|
|
227
|
+
const { opt, msgId } = getOpt(params, () => ins.close(), "success", false);
|
|
228
|
+
const ins = ElMessage(opt, appContext);
|
|
229
|
+
instances.set(msgId, ins);
|
|
230
|
+
return ins;
|
|
231
|
+
};
|
|
232
|
+
message.warning = function(params) {
|
|
233
|
+
const { opt, msgId } = getOpt(params, () => ins.close(), "warning", false);
|
|
234
|
+
const ins = ElMessage(opt, appContext);
|
|
235
|
+
instances.set(msgId, ins);
|
|
236
|
+
return ins;
|
|
237
|
+
};
|
|
238
|
+
message.error = function(params) {
|
|
239
|
+
const { opt, msgId } = getOpt(params, () => ins.close(), "error", false);
|
|
240
|
+
const ins = ElMessage(opt, appContext);
|
|
241
|
+
instances.set(msgId, ins);
|
|
242
|
+
return ins;
|
|
243
|
+
};
|
|
244
|
+
message.info = function(params) {
|
|
245
|
+
const { opt, msgId } = getOpt(params, () => ins.close());
|
|
246
|
+
const ins = ElMessage(opt, appContext);
|
|
247
|
+
instances.set(msgId, ins);
|
|
248
|
+
return ins;
|
|
249
|
+
};
|
|
250
|
+
message.loading = function(params) {
|
|
251
|
+
blurCurrentFocus();
|
|
252
|
+
const { opt, msgId } = getOpt(params, () => ins.close(), void 0, true);
|
|
253
|
+
const ins = ElMessage(opt, appContext);
|
|
254
|
+
instances.set(msgId, ins);
|
|
255
|
+
return ins;
|
|
256
|
+
};
|
|
257
|
+
message.closeAll = function(type) {
|
|
258
|
+
instances.clear();
|
|
259
|
+
return ElMessage.closeAll(type);
|
|
260
|
+
};
|
|
261
|
+
return message;
|
|
262
|
+
}
|
|
263
|
+
export {
|
|
264
|
+
EleMessage,
|
|
265
|
+
MESSAGE_KEY,
|
|
266
|
+
useMessage
|
|
267
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentResolver } from 'unplugin-vue-components/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 参数类型
|
|
5
|
+
*/
|
|
6
|
+
export interface EleAdminResolverOptions {
|
|
7
|
+
/** 包路径 */
|
|
8
|
+
path?: string | '' | '/es' | '/lib' | '/es/core' | '/lib/core';
|
|
9
|
+
/** 排除的组件名称 */
|
|
10
|
+
exclude?: string[];
|
|
11
|
+
/** 是否导入样式 */
|
|
12
|
+
importStyle?: boolean | 'css' | 'sass';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 按需加载插件
|
|
16
|
+
* @param options 参数
|
|
17
|
+
*/
|
|
18
|
+
export declare function EleAdminResolver(options?: EleAdminResolverOptions): ComponentResolver;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
function getSideEffects(path, options) {
|
|
2
|
+
const importStyle = options == null ? void 0 : options.importStyle;
|
|
3
|
+
if (!importStyle) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
if (importStyle === "css") {
|
|
7
|
+
return `${path}/style/css`;
|
|
8
|
+
}
|
|
9
|
+
return `${path}/style/index`;
|
|
10
|
+
}
|
|
11
|
+
function getStylePath(namePath, packageName, path) {
|
|
12
|
+
if (!path) {
|
|
13
|
+
return `${packageName}/es/${namePath}`;
|
|
14
|
+
}
|
|
15
|
+
if (path === "/es/core") {
|
|
16
|
+
return `${packageName}/es/${namePath}`;
|
|
17
|
+
}
|
|
18
|
+
if (path === "/lib/core") {
|
|
19
|
+
return `${packageName}/lib/${namePath}`;
|
|
20
|
+
}
|
|
21
|
+
return `${packageName}${path}/${namePath}`;
|
|
22
|
+
}
|
|
23
|
+
function EleAdminResolver(options) {
|
|
24
|
+
return {
|
|
25
|
+
type: "component",
|
|
26
|
+
resolve: (name) => {
|
|
27
|
+
var _a;
|
|
28
|
+
const { path, exclude } = options || {};
|
|
29
|
+
if (name.match(/^Ele[A-Z]/) && !((_a = exclude == null ? void 0 : exclude.includes) == null ? void 0 : _a.call(exclude, name))) {
|
|
30
|
+
const packageName = "ele-admin-plus";
|
|
31
|
+
const namePath = name.replace(/([A-Z])/g, " $1").trim().split(" ").join("-").toLowerCase();
|
|
32
|
+
const stylePath = getStylePath(namePath, packageName, path);
|
|
33
|
+
if (!path || path === "/es/core" || path === "/lib/core") {
|
|
34
|
+
return {
|
|
35
|
+
name,
|
|
36
|
+
from: `${packageName}${path ?? "/es"}`,
|
|
37
|
+
sideEffects: getSideEffects(stylePath, options)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
from: `${packageName}${path}/${namePath}/index`,
|
|
42
|
+
sideEffects: getSideEffects(stylePath, options)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
EleAdminResolver
|
|
50
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { generate } from "@ant-design/colors";
|
|
2
|
+
function changeColor(color, dark) {
|
|
3
|
+
const $html = document.documentElement;
|
|
4
|
+
if (!$html) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
const id = "ele-theme-var";
|
|
8
|
+
const elem = document.getElementById(id);
|
|
9
|
+
if (elem == null ? void 0 : elem.parentNode) {
|
|
10
|
+
elem.parentNode.removeChild(elem);
|
|
11
|
+
}
|
|
12
|
+
if (color) {
|
|
13
|
+
const colors = generate(color, dark ? { theme: "dark" } : {});
|
|
14
|
+
const selector = dark ? "html.dark" : ":root";
|
|
15
|
+
const elem2 = document.createElement("style");
|
|
16
|
+
elem2.id = id;
|
|
17
|
+
elem2.setAttribute("type", "text/css");
|
|
18
|
+
elem2.innerHTML = [
|
|
19
|
+
`${selector}{`,
|
|
20
|
+
`--el-color-primary:${color};`,
|
|
21
|
+
`--el-color-primary-light-3:${colors[4]};`,
|
|
22
|
+
`--el-color-primary-light-5:${colors[3]};`,
|
|
23
|
+
`--el-color-primary-light-7:${colors[2]};`,
|
|
24
|
+
`--el-color-primary-light-8:${colors[1]};`,
|
|
25
|
+
`--el-color-primary-light-9:${colors[0]};`,
|
|
26
|
+
`--el-color-primary-dark-2:${colors[6]};`,
|
|
27
|
+
"}"
|
|
28
|
+
].join("");
|
|
29
|
+
document.head.appendChild(elem2);
|
|
30
|
+
$html.dataset.color = color;
|
|
31
|
+
} else {
|
|
32
|
+
$html.removeAttribute("data-color");
|
|
33
|
+
}
|
|
34
|
+
if (dark) {
|
|
35
|
+
$html.classList.add("dark");
|
|
36
|
+
} else {
|
|
37
|
+
$html.classList.remove("dark");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
changeColor
|
|
42
|
+
};
|