diff --git a/docs/.vitepress/vitepress/components/globals/icons-categories.json b/docs/.vitepress/vitepress/components/globals/icons-categories.json new file mode 100644 index 0000000000..1485bf6311 --- /dev/null +++ b/docs/.vitepress/vitepress/components/globals/icons-categories.json @@ -0,0 +1,332 @@ +{ + "categories": [ + { + "name": "System", + "items": [ + "Plus", + "Minus", + "CirclePlus", + "Search", + "Female", + "Male", + "Aim", + "House", + "FullScreen", + "Loading", + "Link", + "Service", + "Pointer", + "Star", + "Notification", + "Connection", + "ChatDotRound", + "Setting", + "Clock", + "Position", + "Discount", + "Odometer", + "ChatSquare", + "ChatRound", + "ChatLineRound", + "ChatLineSquare", + "ChatDotSquare", + "View", + "Hide", + "Unlock", + "Lock", + "RefreshRight", + "RefreshLeft", + "Refresh", + "Bell", + "MuteNotification", + "User", + "Check", + "CircleCheck", + "Warning", + "CircleClose", + "Close", + "PieChart", + "More", + "Compass", + "Filter", + "Switch", + "Select", + "SemiSelect", + "CloseBold", + "EditPen", + "Edit", + "Message", + "MessageBox", + "TurnOff", + "Finished", + "Delete", + "Crop", + "SwitchButton", + "Operation", + "Open", + "Remove", + "ZoomOut", + "ZoomIn", + "InfoFilled", + "CircleCheckFilled", + "SuccessFilled", + "WarningFilled", + "CircleCloseFilled", + "QuestionFilled", + "WarnTriangleFilled", + "UserFilled", + "MoreFilled", + "Tools", + "HomeFilled", + "Menu", + "UploadFilled", + "Avatar", + "HelpFilled", + "Share", + "StarFilled", + "Comment", + "Histogram", + "Grid", + "Promotion", + "DeleteFilled", + "RemoveFilled", + "CirclePlusFilled" + ] + }, + { + "name": "Arrow", + "items": [ + "ArrowLeft", + "ArrowUp", + "ArrowRight", + "ArrowDown", + "ArrowLeftBold", + "ArrowUpBold", + "ArrowRightBold", + "ArrowDownBold", + "DArrowRight", + "DArrowLeft", + "Download", + "Upload", + "Top", + "Bottom", + "Back", + "Right", + "TopRight", + "TopLeft", + "BottomRight", + "BottomLeft", + "Sort", + "SortUp", + "SortDown", + "Rank", + "CaretLeft", + "CaretTop", + "CaretRight", + "CaretBottom", + "DCaret", + "Expand", + "Fold" + ] + }, + { + "name": "Document", + "items": [ + "DocumentAdd", + "Document", + "Notebook", + "Tickets", + "Memo", + "Collection", + "Postcard", + "ScaleToOriginal", + "SetUp", + "DocumentDelete", + "DocumentChecked", + "DataBoard", + "DataAnalysis", + "CopyDocument", + "FolderChecked", + "Files", + "Folder", + "FolderDelete", + "FolderRemove", + "FolderOpened", + "DocumentCopy", + "DocumentRemove", + "FolderAdd", + "FirstAidKit", + "Reading", + "DataLine", + "Management", + "Checked", + "Ticket", + "Failed", + "TrendCharts", + "List" + ] + }, + { + "name": "Media", + "items": [ + "Microphone", + "Mute", + "Mic", + "VideoPause", + "VideoCamera", + "VideoPlay", + "Headset", + "Monitor", + "Film", + "Camera", + "Picture", + "PictureRounded", + "Iphone", + "Cellphone", + "VideoCameraFilled", + "PictureFilled", + "Platform", + "CameraFilled", + "BellFilled" + ] + }, + { + "name": "Traffic", + "items": [ + "Location", + "LocationInformation", + "DeleteLocation", + "Coordinate", + "Bicycle", + "OfficeBuilding", + "School", + "Guide", + "AddLocation", + "MapLocation", + "Place", + "LocationFilled", + "Van" + ] + }, + { + "name": "Food", + "items": [ + "Watermelon", + "Pear", + "NoSmoking", + "Smoking", + "Mug", + "GobletSquareFull", + "GobletFull", + "KnifeFork", + "Sugar", + "Bowl", + "MilkTea", + "Lollipop", + "Coffee", + "Chicken", + "Dish", + "IceTea", + "ColdDrink", + "CoffeeCup", + "DishDot", + "IceDrink", + "IceCream", + "Dessert", + "IceCreamSquare", + "ForkSpoon", + "IceCreamRound", + "Food", + "HotWater", + "Grape", + "Fries", + "Apple", + "Burger", + "Goblet", + "GobletSquare", + "Orange", + "Cherry" + ] + }, + { + "name": "Items", + "items": [ + "Printer", + "Calendar", + "CreditCard", + "Box", + "Money", + "Refrigerator", + "Cpu", + "Football", + "Brush", + "Suitcase", + "SuitcaseLine", + "Umbrella", + "AlarmClock", + "Medal", + "GoldMedal", + "Present", + "Mouse", + "Watch", + "QuartzWatch", + "Magnet", + "Help", + "Soccer", + "ToiletPaper", + "ReadingLamp", + "Paperclip", + "MagicStick", + "Basketball", + "Baseball", + "Coin", + "Goods", + "Sell", + "SoldOut", + "Key", + "ShoppingCart", + "ShoppingCartFull", + "ShoppingTrolley", + "Phone", + "Scissor", + "Handbag", + "ShoppingBag", + "Trophy", + "TrophyBase", + "Stopwatch", + "Timer", + "CollectionTag", + "Discount", + "TakeawayBox", + "PriceTag", + "Wallet", + "Opportunity", + "PhoneFilled", + "WalletFilled", + "GoodsFilled", + "Flag", + "BrushFilled", + "Briefcase", + "Stamp" + ] + }, + { + "name": "Weather", + "items": [ + "Sunrise", + "Sunny", + "Ship", + "MostlyCloudy", + "PartlyCloudy", + "Sunset", + "Sunrise", + "Drizzling", + "Pouring", + "Cloudy", + "Moon", + "MoonNight", + "Lightning" + ] + } + ] +} diff --git a/docs/.vitepress/vitepress/components/globals/icons.vue b/docs/.vitepress/vitepress/components/globals/icons.vue index 9c291b7a7b..ec23ce9057 100644 --- a/docs/.vitepress/vitepress/components/globals/icons.vue +++ b/docs/.vitepress/vitepress/components/globals/icons.vue @@ -5,6 +5,13 @@ import { ElMessage } from 'element-plus' import * as Icons from '@element-plus/icons-vue' import { useLang } from '../../composables/lang' import localeData from '../../../i18n/component/icons.json' +import IconCategories from './icons-categories.json' +import type { DefineComponent } from 'vue' + +type CategoriesItem = { + name: string + icons: DefineComponent[] +} const lang = useLang() const locale = computed(() => localeData[lang.value]) @@ -36,6 +43,26 @@ const copySvgIcon = async (name, refs) => { await copyContent(content) } } + +const categories = ref([]) +const iconMap = new Map(Object.entries(Icons)) + +IconCategories.categories.forEach((o) => { + const result: CategoriesItem = { + name: o.name, + icons: [], + } + o.items.forEach((i) => { + const icon = iconMap.get(i) + if (icon) { + result.icons.push(icon) + iconMap.delete(i) + } + }) + categories.value.push(result) +}) + +categories.value.push({ name: 'Other', icons: Array.from(iconMap.values()) })