From bd446449c08d1b6573999b4e17e1fda822fc4c3f Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 12 Apr 2022 14:23:14 +0800 Subject: [PATCH] feat: add menu component (#534) --- .eslintrc.cjs | 1 + package.json | 20 +- pnpm-lock.yaml | 545 ++++++++++-------- src/App.vue | 69 ++- src/components/base/menu/Menu.story.vue | 20 + src/components/base/menu/Menu.vue | 21 + src/components/base/menu/MenuItem.vue | 121 ++++ src/components/base/menu/MenuLabel.vue | 14 + .../{.gitkeep => base/menu/RoutesMenu.vue} | 0 .../base/menu/__tests__/Menu.spec.tsx | 100 ++++ .../__snapshots__/Menu.spec.tsx.snap | 105 ++++ src/components/base/menu/index.ts | 3 + src/core/icons.ts | 6 + src/router/index.ts | 16 +- src/router/menus.config.ts | 107 ++++ src/router/routes.config.ts | 18 + vite.config.ts | 3 +- 17 files changed, 920 insertions(+), 249 deletions(-) create mode 100644 src/components/base/menu/Menu.story.vue create mode 100644 src/components/base/menu/Menu.vue create mode 100644 src/components/base/menu/MenuItem.vue create mode 100644 src/components/base/menu/MenuLabel.vue rename src/components/{.gitkeep => base/menu/RoutesMenu.vue} (100%) create mode 100644 src/components/base/menu/__tests__/Menu.spec.tsx create mode 100644 src/components/base/menu/__tests__/__snapshots__/Menu.spec.tsx.snap create mode 100644 src/components/base/menu/index.ts create mode 100644 src/core/icons.ts create mode 100644 src/router/menus.config.ts create mode 100644 src/router/routes.config.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs index fd1d6ebf..24ffd5bd 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -15,6 +15,7 @@ module.exports = { }, rules: { "vue/multi-word-component-names": 0, + "@typescript-eslint/ban-ts-comment": 0, }, overrides: [ { diff --git a/package.json b/package.json index 292d8a34..bd91cc00 100644 --- a/package.json +++ b/package.json @@ -17,37 +17,39 @@ "story:build": "histoire build" }, "dependencies": { - "pinia": "^2.0.12", + "pinia": "^2.0.13", "vue": "^3.2.31", "vue-router": "^4.0.14" }, "devDependencies": { + "@iconify-json/ri": "^1.1.1", "@rushstack/eslint-patch": "^1.1.1", "@types/jsdom": "^16.2.14", "@types/node": "^16.11.26", - "@vitejs/plugin-vue": "^2.2.4", - "@vitejs/plugin-vue-jsx": "^1.3.8", + "@vitejs/plugin-vue": "^2.3.1", + "@vitejs/plugin-vue-jsx": "^1.3.9", "@vue/eslint-config-prettier": "^7.0.0", "@vue/eslint-config-typescript": "^10.0.0", "@vue/test-utils": "^2.0.0-rc.18", "@vue/tsconfig": "^0.1.3", "autoprefixer": "^10.4.4", "c8": "^7.11.0", - "cypress": "^9.5.2", - "eslint": "^8.11.0", + "cypress": "^9.5.3", + "eslint": "^8.12.0", "eslint-plugin-cypress": "^2.12.1", "eslint-plugin-vue": "^8.5.0", - "histoire": "^0.2.0", + "histoire": "^0.2.1", "husky": "^7.0.4", "jsdom": "^19.0.0", "postcss": "^8.4.12", - "prettier": "^2.6.0", - "sass": "^1.49.9", + "prettier": "^2.6.1", + "sass": "^1.49.10", "start-server-and-test": "^1.14.0", "tailwindcss": "^3.0.23", "tailwindcss-themeable": "^1.3.0", "typescript": "~4.5.5", - "vite": "^2.8.6", + "unplugin-icons": "^0.14.1", + "vite": "^2.9.1", "vitest": "^0.5.9", "vue-tsc": "^0.31.4" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 239056ba..3ed41c91 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,71 +1,75 @@ lockfileVersion: 5.3 specifiers: + '@iconify-json/ri': ^1.1.1 '@rushstack/eslint-patch': ^1.1.1 '@types/jsdom': ^16.2.14 '@types/node': ^16.11.26 - '@vitejs/plugin-vue': ^2.2.4 - '@vitejs/plugin-vue-jsx': ^1.3.8 + '@vitejs/plugin-vue': ^2.3.1 + '@vitejs/plugin-vue-jsx': ^1.3.9 '@vue/eslint-config-prettier': ^7.0.0 '@vue/eslint-config-typescript': ^10.0.0 '@vue/test-utils': ^2.0.0-rc.18 '@vue/tsconfig': ^0.1.3 autoprefixer: ^10.4.4 c8: ^7.11.0 - cypress: ^9.5.2 - eslint: ^8.11.0 + cypress: ^9.5.3 + eslint: ^8.12.0 eslint-plugin-cypress: ^2.12.1 eslint-plugin-vue: ^8.5.0 - histoire: ^0.2.0 + histoire: ^0.2.1 husky: ^7.0.4 jsdom: ^19.0.0 - pinia: ^2.0.12 + pinia: ^2.0.13 postcss: ^8.4.12 - prettier: ^2.6.0 - sass: ^1.49.9 + prettier: ^2.6.1 + sass: ^1.49.10 start-server-and-test: ^1.14.0 tailwindcss: ^3.0.23 tailwindcss-themeable: ^1.3.0 typescript: ~4.5.5 - vite: ^2.8.6 + unplugin-icons: ^0.14.1 + vite: ^2.9.1 vitest: ^0.5.9 vue: ^3.2.31 vue-router: ^4.0.14 vue-tsc: ^0.31.4 dependencies: - pinia: 2.0.12_typescript@4.5.5+vue@3.2.31 + pinia: 2.0.13_typescript@4.5.5+vue@3.2.31 vue: 3.2.31 vue-router: 4.0.14_vue@3.2.31 devDependencies: + '@iconify-json/ri': 1.1.1 '@rushstack/eslint-patch': 1.1.1 '@types/jsdom': 16.2.14 '@types/node': 16.11.26 - '@vitejs/plugin-vue': 2.2.4_vite@2.8.6+vue@3.2.31 - '@vitejs/plugin-vue-jsx': 1.3.8 - '@vue/eslint-config-prettier': 7.0.0_eslint@8.11.0+prettier@2.6.0 - '@vue/eslint-config-typescript': 10.0.0_63e6d4a814f7d8ae31e8c8538e82e3a4 + '@vitejs/plugin-vue': 2.3.1_vite@2.9.1+vue@3.2.31 + '@vitejs/plugin-vue-jsx': 1.3.9 + '@vue/eslint-config-prettier': 7.0.0_eslint@8.12.0+prettier@2.6.1 + '@vue/eslint-config-typescript': 10.0.0_12acf70a972713d732433d1dac9f7809 '@vue/test-utils': 2.0.0-rc.18_vue@3.2.31 '@vue/tsconfig': 0.1.3_@types+node@16.11.26 autoprefixer: 10.4.4_postcss@8.4.12 c8: 7.11.0 - cypress: 9.5.2 - eslint: 8.11.0 - eslint-plugin-cypress: 2.12.1_eslint@8.11.0 - eslint-plugin-vue: 8.5.0_eslint@8.11.0 - histoire: 0.2.0_cd0dd645aa5dde4c3c337175f134c2cd + cypress: 9.5.3 + eslint: 8.12.0 + eslint-plugin-cypress: 2.12.1_eslint@8.12.0 + eslint-plugin-vue: 8.5.0_eslint@8.12.0 + histoire: 0.2.1_095f2bcd7e5ef9151eeb916a391a390e husky: 7.0.4 jsdom: 19.0.0 postcss: 8.4.12 - prettier: 2.6.0 - sass: 1.49.9 + prettier: 2.6.1 + sass: 1.49.10 start-server-and-test: 1.14.0 tailwindcss: 3.0.23_autoprefixer@10.4.4 tailwindcss-themeable: 1.3.0 typescript: 4.5.5 - vite: 2.8.6_sass@1.49.9 - vitest: 0.5.9_d9d2d37e110baf3b78cf157ce5497ceb + unplugin-icons: 0.14.1_vite@2.9.1 + vite: 2.9.1_sass@1.49.10 + vitest: 0.5.9_4807d2e4359e51ec3e91e3dc341f010f vue-tsc: 0.31.4_typescript@4.5.5 packages: @@ -77,6 +81,17 @@ packages: '@jridgewell/trace-mapping': 0.3.4 dev: true + /@antfu/install-pkg/0.1.0: + resolution: {integrity: sha512-VaIJd3d1o7irZfK1U0nvBsHMyjkuyMP3HKYVV53z8DKyulkHKmjhhtccXO51WSPeeSHIeoJEoNOKavYpS7jkZw==} + dependencies: + execa: 5.1.1 + find-up: 5.0.0 + dev: true + + /@antfu/utils/0.5.0: + resolution: {integrity: sha512-MrAQ/MrPSxbh1bBrmwJjORfJymw4IqSHFBXqvxaga3ZdDM+/zokYF8DjyJpSjY2QmpmgQrajDUBJOWrYeARfzA==} + dev: true + /@babel/code-frame/7.16.7: resolution: {integrity: sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==} engines: {node: '>=6.9.0'} @@ -89,17 +104,17 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/core/7.17.7: - resolution: {integrity: sha512-djHlEfFHnSnTAcPb7dATbiM5HxGOP98+3JLBZtjRb5I7RXrw7kFRoG2dXM8cm3H+o11A8IFH/uprmJpwFynRNQ==} + /@babel/core/7.17.8: + resolution: {integrity: sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.1.2 '@babel/code-frame': 7.16.7 '@babel/generator': 7.17.7 - '@babel/helper-compilation-targets': 7.17.7_@babel+core@7.17.7 + '@babel/helper-compilation-targets': 7.17.7_@babel+core@7.17.8 '@babel/helper-module-transforms': 7.17.7 - '@babel/helpers': 7.17.7 - '@babel/parser': 7.17.7 + '@babel/helpers': 7.17.8 + '@babel/parser': 7.17.8 '@babel/template': 7.16.7 '@babel/traverse': 7.17.3 '@babel/types': 7.17.0 @@ -112,15 +127,6 @@ packages: - supports-color dev: true - /@babel/generator/7.17.3: - resolution: {integrity: sha512-+R6Dctil/MgUsZsZAkYgK+ADNSZzJRRy0TvY65T71z/CR854xHQ1EweBYXdfT+HNeN7w0cSJJEzgxZMv40pxsg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.17.0 - jsesc: 2.5.2 - source-map: 0.5.7 - dev: true - /@babel/generator/7.17.7: resolution: {integrity: sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==} engines: {node: '>=6.9.0'} @@ -137,26 +143,26 @@ packages: '@babel/types': 7.17.0 dev: true - /@babel/helper-compilation-targets/7.17.7_@babel+core@7.17.7: + /@babel/helper-compilation-targets/7.17.7_@babel+core@7.17.8: resolution: {integrity: sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: '@babel/compat-data': 7.17.7 - '@babel/core': 7.17.7 + '@babel/core': 7.17.8 '@babel/helper-validator-option': 7.16.7 - browserslist: 4.19.3 + browserslist: 4.20.2 semver: 6.3.0 dev: true - /@babel/helper-create-class-features-plugin/7.17.6_@babel+core@7.17.7: + /@babel/helper-create-class-features-plugin/7.17.6_@babel+core@7.17.8: resolution: {integrity: sha512-SogLLSxXm2OkBbSsHZMM4tUi8fUzjs63AT/d0YQIzr6GSd8Hxsbk2KYDX0k0DweAzGMj/YWeiCsorIdtdcW8Eg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.17.7 + '@babel/core': 7.17.8 '@babel/helper-annotate-as-pure': 7.16.7 '@babel/helper-environment-visitor': 7.16.7 '@babel/helper-function-name': 7.16.7 @@ -277,8 +283,8 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helpers/7.17.7: - resolution: {integrity: sha512-TKsj9NkjJfTBxM7Phfy7kv6yYc4ZcOo+AaWGqQOKTPDOmcGkIFb5xNA746eKisQkm4yavUYh4InYM9S+VnO01w==} + /@babel/helpers/7.17.8: + resolution: {integrity: sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.16.7 @@ -308,45 +314,51 @@ packages: hasBin: true dev: true - /@babel/plugin-syntax-import-meta/7.10.4_@babel+core@7.17.7: + /@babel/parser/7.17.8: + resolution: {integrity: sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ==} + engines: {node: '>=6.0.0'} + hasBin: true + dev: true + + /@babel/plugin-syntax-import-meta/7.10.4_@babel+core@7.17.8: resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.17.7 + '@babel/core': 7.17.8 '@babel/helper-plugin-utils': 7.16.7 dev: true - /@babel/plugin-syntax-jsx/7.16.7_@babel+core@7.17.7: + /@babel/plugin-syntax-jsx/7.16.7_@babel+core@7.17.8: resolution: {integrity: sha512-Esxmk7YjA8QysKeT3VhTXvF6y77f/a91SIs4pWb4H2eWGQkCKFgQaG6hdoEVZtGsrAcb2K5BW66XsOErD4WU3Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.17.7 + '@babel/core': 7.17.8 '@babel/helper-plugin-utils': 7.16.7 dev: true - /@babel/plugin-syntax-typescript/7.16.7_@babel+core@7.17.7: + /@babel/plugin-syntax-typescript/7.16.7_@babel+core@7.17.8: resolution: {integrity: sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.17.7 + '@babel/core': 7.17.8 '@babel/helper-plugin-utils': 7.16.7 dev: true - /@babel/plugin-transform-typescript/7.16.8_@babel+core@7.17.7: + /@babel/plugin-transform-typescript/7.16.8_@babel+core@7.17.8: resolution: {integrity: sha512-bHdQ9k7YpBDO2d0NVfkj51DpQcvwIzIusJ7mEUaMlbZq3Kt/U47j24inXZHQ5MDiYpCs+oZiwnXyKedE8+q7AQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.17.7 - '@babel/helper-create-class-features-plugin': 7.17.6_@babel+core@7.17.7 + '@babel/core': 7.17.8 + '@babel/helper-create-class-features-plugin': 7.17.6_@babel+core@7.17.8 '@babel/helper-plugin-utils': 7.16.7 - '@babel/plugin-syntax-typescript': 7.16.7_@babel+core@7.17.7 + '@babel/plugin-syntax-typescript': 7.16.7_@babel+core@7.17.8 transitivePeerDependencies: - supports-color dev: true @@ -356,7 +368,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.16.7 - '@babel/parser': 7.17.3 + '@babel/parser': 7.17.7 '@babel/types': 7.17.0 dev: true @@ -365,12 +377,12 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.16.7 - '@babel/generator': 7.17.3 + '@babel/generator': 7.17.7 '@babel/helper-environment-visitor': 7.16.7 '@babel/helper-function-name': 7.16.7 '@babel/helper-hoist-variables': 7.16.7 '@babel/helper-split-export-declaration': 7.16.7 - '@babel/parser': 7.17.3 + '@babel/parser': 7.17.7 '@babel/types': 7.17.0 debug: 4.3.3 globals: 11.12.0 @@ -474,8 +486,8 @@ packages: '@hapi/hoek': 9.2.1 dev: true - /@histoire/controls/0.2.0: - resolution: {integrity: sha512-konKWawyyBJ7PUtygu8KmO4kQUp8KL7vwiMQZLNGRaO7hNNmfK9oOxmRJOHBx1XJV1YEzNjZyy6oqxJh4rn+lQ==} + /@histoire/controls/0.2.1: + resolution: {integrity: sha512-To5FmkmIBg8fgF4ZBJn0W4XV5V66Ox+Rjwm2cxrdao8jEEzgp4OgMeP7CnlkZIUBRHYdnHzUPPhUMuFoEL1Bfg==} dev: true /@humanwhocodes/config-array/0.9.5: @@ -493,6 +505,29 @@ packages: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true + /@iconify-json/ri/1.1.1: + resolution: {integrity: sha512-H2Bvtew65rCw275lZaLk5sxTmmxa9kpd2i2FOVncDLa/Wpn9L6AnTZhR1NzzPb6iqK2D8HE4Y/wcVr6o0KjMlw==} + dependencies: + '@iconify/types': 1.1.0 + dev: true + + /@iconify/types/1.1.0: + resolution: {integrity: sha512-Jh0llaK2LRXQoYsorIH8maClebsnzTcve+7U3rQUSnC11X4jtPnFuyatqFLvMxZ8MLG8dB4zfHsbPfuvxluONw==} + dev: true + + /@iconify/utils/1.0.32: + resolution: {integrity: sha512-m+rnw7qKHq/XF7DAi4BcFoEAcXBfqqMgQJh8brGEHeqE/RUvgDMjmxsHgWnVpFsG+VmjGyAiI7nwXdliCwEU0Q==} + dependencies: + '@antfu/install-pkg': 0.1.0 + '@antfu/utils': 0.5.0 + '@iconify/types': 1.1.0 + debug: 4.3.4 + kolorist: 1.5.1 + local-pkg: 0.4.1 + transitivePeerDependencies: + - supports-color + dev: true + /@iconify/vue/3.1.4_vue@3.2.31: resolution: {integrity: sha512-oJm0VPl1fhlsbBX9tBeAbtmZ5iHCxCkVQdCi81lxdA3cqc9yqBlCloqObX93/YWNM5N8j/j0Efk6iSwsihOoNA==} peerDependencies: @@ -547,8 +582,8 @@ packages: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} dev: true - /@rollup/pluginutils/4.1.2: - resolution: {integrity: sha512-ROn4qvkxP9SyPeHaf7uQC/GPFY6L/OWy9+bd9AwcjOAWQwxRscoEyAUD8qCY5o5iL4jqQwoLk2kaTKJPb/HwzQ==} + /@rollup/pluginutils/4.2.0: + resolution: {integrity: sha512-2WUyJNRkyH5p487pGnn4tWAsxhEFKN/pT8CMgHshd5H+IXkOnKvKZwsz5ZWz+YCXkleZRAU5kwbfgF8CPfDRqA==} engines: {node: '>= 8.0.0'} dependencies: estree-walker: 2.0.2 @@ -664,7 +699,7 @@ packages: dev: true optional: true - /@typescript-eslint/eslint-plugin/5.13.0_0b4c3c3c657ed902ebed4a02b41c358c: + /@typescript-eslint/eslint-plugin/5.13.0_f0c916b49e2a4313d39e430155342595: resolution: {integrity: sha512-vLktb2Uec81fxm/cfz2Hd6QaWOs8qdmVAZXLdOBX6JFJDhf6oDZpMzZ4/LZ6SFM/5DgDcxIMIvy3F+O9yZBuiQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -675,12 +710,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.13.0_eslint@8.11.0+typescript@4.5.5 + '@typescript-eslint/parser': 5.13.0_eslint@8.12.0+typescript@4.5.5 '@typescript-eslint/scope-manager': 5.13.0 - '@typescript-eslint/type-utils': 5.13.0_eslint@8.11.0+typescript@4.5.5 - '@typescript-eslint/utils': 5.13.0_eslint@8.11.0+typescript@4.5.5 + '@typescript-eslint/type-utils': 5.13.0_eslint@8.12.0+typescript@4.5.5 + '@typescript-eslint/utils': 5.13.0_eslint@8.12.0+typescript@4.5.5 debug: 4.3.3 - eslint: 8.11.0 + eslint: 8.12.0 functional-red-black-tree: 1.0.1 ignore: 5.2.0 regexpp: 3.2.0 @@ -691,7 +726,7 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.13.0_eslint@8.11.0+typescript@4.5.5: + /@typescript-eslint/parser/5.13.0_eslint@8.12.0+typescript@4.5.5: resolution: {integrity: sha512-GdrU4GvBE29tm2RqWOM0P5QfCtgCyN4hXICj/X9ibKED16136l9ZpoJvCL5pSKtmJzA+NRDzQ312wWMejCVVfg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -705,7 +740,7 @@ packages: '@typescript-eslint/types': 5.13.0 '@typescript-eslint/typescript-estree': 5.13.0_typescript@4.5.5 debug: 4.3.3 - eslint: 8.11.0 + eslint: 8.12.0 typescript: 4.5.5 transitivePeerDependencies: - supports-color @@ -719,7 +754,7 @@ packages: '@typescript-eslint/visitor-keys': 5.13.0 dev: true - /@typescript-eslint/type-utils/5.13.0_eslint@8.11.0+typescript@4.5.5: + /@typescript-eslint/type-utils/5.13.0_eslint@8.12.0+typescript@4.5.5: resolution: {integrity: sha512-/nz7qFizaBM1SuqAKb7GLkcNn2buRdDgZraXlkhz+vUGiN1NZ9LzkA595tHHeduAiS2MsHqMNhE2zNzGdw43Yg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -729,9 +764,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/utils': 5.13.0_eslint@8.11.0+typescript@4.5.5 + '@typescript-eslint/utils': 5.13.0_eslint@8.12.0+typescript@4.5.5 debug: 4.3.3 - eslint: 8.11.0 + eslint: 8.12.0 tsutils: 3.21.0_typescript@4.5.5 typescript: 4.5.5 transitivePeerDependencies: @@ -764,7 +799,7 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.13.0_eslint@8.11.0+typescript@4.5.5: + /@typescript-eslint/utils/5.13.0_eslint@8.12.0+typescript@4.5.5: resolution: {integrity: sha512-+9oHlPWYNl6AwwoEt5TQryEHwiKRVjz7Vk6kaBeD3/kwHE5YqTGHtm/JZY8Bo9ITOeKutFaXnBlMgSATMJALUQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -774,9 +809,9 @@ packages: '@typescript-eslint/scope-manager': 5.13.0 '@typescript-eslint/types': 5.13.0 '@typescript-eslint/typescript-estree': 5.13.0_typescript@4.5.5 - eslint: 8.11.0 + eslint: 8.12.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.11.0 + eslint-utils: 3.0.0_eslint@8.12.0 transitivePeerDependencies: - supports-color - typescript @@ -790,28 +825,28 @@ packages: eslint-visitor-keys: 3.3.0 dev: true - /@vitejs/plugin-vue-jsx/1.3.8: - resolution: {integrity: sha512-gPtie8IM7G5OI2O2/Xwk/oYjnw2gKBzayVuEOM5Jx65KmpVcW444F+H7IsIMduvAgwLQPEYMGiO1V8dBgk7qog==} + /@vitejs/plugin-vue-jsx/1.3.9: + resolution: {integrity: sha512-aJpmBpAXM9jbVWaf7UR22/c0v/wfNPqOj0nBibuOndnrM8YmPAj4NnHEasguXxf0wVH00DinWqyzgZV8CZqEOQ==} engines: {node: '>=12.0.0'} dependencies: - '@babel/core': 7.17.7 - '@babel/plugin-syntax-import-meta': 7.10.4_@babel+core@7.17.7 - '@babel/plugin-transform-typescript': 7.16.8_@babel+core@7.17.7 - '@rollup/pluginutils': 4.1.2 - '@vue/babel-plugin-jsx': 1.1.1_@babel+core@7.17.7 + '@babel/core': 7.17.8 + '@babel/plugin-syntax-import-meta': 7.10.4_@babel+core@7.17.8 + '@babel/plugin-transform-typescript': 7.16.8_@babel+core@7.17.8 + '@rollup/pluginutils': 4.2.0 + '@vue/babel-plugin-jsx': 1.1.1_@babel+core@7.17.8 hash-sum: 2.0.0 transitivePeerDependencies: - supports-color dev: true - /@vitejs/plugin-vue/2.2.4_vite@2.8.6+vue@3.2.31: - resolution: {integrity: sha512-ev9AOlp0ljCaDkFZF3JwC/pD2N4Hh+r5srl5JHM6BKg5+99jiiK0rE/XaRs3pVm1wzyKkjUy/StBSoXX5fFzcw==} + /@vitejs/plugin-vue/2.3.1_vite@2.9.1+vue@3.2.31: + resolution: {integrity: sha512-YNzBt8+jt6bSwpt7LP890U1UcTOIZZxfpE5WOJ638PNxSEKOqAi0+FSKS0nVeukfdZ0Ai/H7AFd6k3hayfGZqQ==} engines: {node: '>=12.0.0'} peerDependencies: vite: ^2.5.10 vue: ^3.2.25 dependencies: - vite: 2.8.6_sass@1.49.9 + vite: 2.9.1_sass@1.49.10 vue: 3.2.31 dev: true @@ -881,11 +916,11 @@ packages: resolution: {integrity: sha512-hz4R8tS5jMn8lDq6iD+yWL6XNB699pGIVLk7WSJnn1dbpjaazsjZQkieJoRX6gW5zpYSCFqQ7jUquPNY65tQYA==} dev: true - /@vue/babel-plugin-jsx/1.1.1_@babel+core@7.17.7: + /@vue/babel-plugin-jsx/1.1.1_@babel+core@7.17.8: resolution: {integrity: sha512-j2uVfZjnB5+zkcbc/zsOc0fSNGCMMjaEXP52wdwdIfn0qjFfEYpYZBFKFg+HHnQeJCVrjOeO0YxgaL7DMrym9w==} dependencies: '@babel/helper-module-imports': 7.16.7 - '@babel/plugin-syntax-jsx': 7.16.7_@babel+core@7.17.7 + '@babel/plugin-syntax-jsx': 7.16.7_@babel+core@7.17.8 '@babel/template': 7.16.7 '@babel/traverse': 7.17.3 '@babel/types': 7.17.0 @@ -937,33 +972,33 @@ packages: /@vue/devtools-api/6.0.12: resolution: {integrity: sha512-iO/4FIezHKXhiDBdKySCvJVh8/mZPxHpiQrTy+PXVqJZgpTPTdHy4q8GXulaY+UKEagdkBb0onxNQZ0LNiqVhw==} - /@vue/devtools-api/6.1.3: - resolution: {integrity: sha512-79InfO2xHv+WHIrH1bHXQUiQD/wMls9qBk6WVwGCbdwP7/3zINtvqPNMtmSHXsIKjvUAHc8L0ouOj6ZQQRmcXg==} + /@vue/devtools-api/6.1.4: + resolution: {integrity: sha512-IiA0SvDrJEgXvVxjNkHPFfDx6SXw0b/TUkqMcDZWNg9fnCAHbTpoo59YfJ9QLFkwa3raau5vSlRVzMSLDnfdtQ==} - /@vue/eslint-config-prettier/7.0.0_eslint@8.11.0+prettier@2.6.0: + /@vue/eslint-config-prettier/7.0.0_eslint@8.12.0+prettier@2.6.1: resolution: {integrity: sha512-/CTc6ML3Wta1tCe1gUeO0EYnVXfo3nJXsIhZ8WJr3sov+cGASr6yuiibJTL6lmIBm7GobopToOuB3B6AWyV0Iw==} peerDependencies: eslint: '>= 7.28.0' prettier: '>= 2.0.0' dependencies: - eslint: 8.11.0 - eslint-config-prettier: 8.5.0_eslint@8.11.0 - eslint-plugin-prettier: 4.0.0_68edcf5670f37721baf5d2cac6124e4d - prettier: 2.6.0 + eslint: 8.12.0 + eslint-config-prettier: 8.5.0_eslint@8.12.0 + eslint-plugin-prettier: 4.0.0_b253a92c95b42c3296c682f11cccb3bd + prettier: 2.6.1 dev: true - /@vue/eslint-config-typescript/10.0.0_63e6d4a814f7d8ae31e8c8538e82e3a4: + /@vue/eslint-config-typescript/10.0.0_12acf70a972713d732433d1dac9f7809: resolution: {integrity: sha512-F94cL8ug3FaYXlCfU5/wiGjk1qeadmoBpRGAOBq+qre3Smdupa59dd6ZJrsfRODpsMPyTG7330juMDsUvpZ3Rw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 eslint-plugin-vue: ^8.0.1 dependencies: - '@typescript-eslint/eslint-plugin': 5.13.0_0b4c3c3c657ed902ebed4a02b41c358c - '@typescript-eslint/parser': 5.13.0_eslint@8.11.0+typescript@4.5.5 - eslint: 8.11.0 - eslint-plugin-vue: 8.5.0_eslint@8.11.0 - vue-eslint-parser: 8.3.0_eslint@8.11.0 + '@typescript-eslint/eslint-plugin': 5.13.0_f0c916b49e2a4313d39e430155342595 + '@typescript-eslint/parser': 5.13.0_eslint@8.12.0+typescript@4.5.5 + eslint: 8.12.0 + eslint-plugin-vue: 8.5.0_eslint@8.12.0 + vue-eslint-parser: 8.3.0_eslint@8.12.0 transitivePeerDependencies: - supports-color - typescript @@ -1322,18 +1357,6 @@ packages: resolution: {integrity: sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==} dev: true - /browserslist/4.19.3: - resolution: {integrity: sha512-XK3X4xtKJ+Txj8G5c30B4gsm71s69lqXlkYui4s6EkKxuv49qjYlY6oVd+IFJ73d4YymtM3+djvvt/R/iJwwDg==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - dependencies: - caniuse-lite: 1.0.30001312 - electron-to-chromium: 1.4.75 - escalade: 3.1.1 - node-releases: 2.0.2 - picocolors: 1.0.0 - dev: true - /browserslist/4.20.2: resolution: {integrity: sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -1407,10 +1430,6 @@ packages: engines: {node: '>=10'} dev: true - /caniuse-lite/1.0.30001312: - resolution: {integrity: sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ==} - dev: true - /caniuse-lite/1.0.30001319: resolution: {integrity: sha512-xjlIAFHucBRSMUo1kb5D4LYgcN1M45qdKP++lhqowDpwJwGkpIRTt5qQqnhxjj1vHcI7nrJxWhCC1ATrCEBTcw==} dev: true @@ -1668,8 +1687,8 @@ packages: resolution: {integrity: sha512-ZVxXaNy28/k3kJg0Fou5MiYpp88j7H9hLZp8PDC3jV0WFjfH5E9xHb56L0W59cPbKbcHXeP4qyT8PrHp8t6LcQ==} dev: false - /cypress/9.5.2: - resolution: {integrity: sha512-gYiQYvJozMzDOriUV1rCt6CeRM/pRK4nhwGJj3nJQyX2BoUdTCVwp30xDMKc771HiNVhBtgj5o5/iBdVDVXQUg==} + /cypress/9.5.3: + resolution: {integrity: sha512-ItelIVmqMTnKYbo1JrErhsGgQGjWOxCpHT1TfMvwnIXKXN/OSlPjEK7rbCLYDZhejQL99PmUqul7XORI24Ik0A==} engines: {node: '>=12.0.0'} hasBin: true requiresBuild: true @@ -1706,7 +1725,7 @@ packages: listr2: 3.14.0_enquirer@2.3.6 lodash: 4.17.21 log-symbols: 4.1.0 - minimist: 1.2.5 + minimist: 1.2.6 ospath: 1.2.2 pretty-bytes: 5.6.0 proxy-from-env: 1.0.0 @@ -1787,6 +1806,18 @@ packages: supports-color: 8.1.1 dev: true + /debug/4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + /decimal.js/10.3.1: resolution: {integrity: sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==} dev: true @@ -1904,10 +1935,6 @@ packages: resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=} dev: true - /electron-to-chromium/1.4.75: - resolution: {integrity: sha512-LxgUNeu3BVU7sXaKjUDD9xivocQLxFtq6wgERrutdY/yIOps3ODOZExK1jg8DTEg4U8TUCb5MLGeWFOYuxjF3Q==} - dev: true - /electron-to-chromium/1.4.88: resolution: {integrity: sha512-oA7mzccefkvTNi9u7DXmT0LqvhnOiN2BhSrKerta7HeUC1cLoIwtbf2wL+Ah2ozh5KQd3/1njrGrwDBXx6d14Q==} dev: true @@ -1960,8 +1987,8 @@ packages: is-arrayish: 0.2.1 dev: true - /esbuild-android-64/0.14.24: - resolution: {integrity: sha512-mbhO8NepmUZ84cP/axGR8IzH1Trth+uknEJzz36cZl8FfMA3ooaiBsMyzJ35s70QEAreiEt1XzltZ4pcfOsVUA==} + /esbuild-android-64/0.14.29: + resolution: {integrity: sha512-tJuaN33SVZyiHxRaVTo1pwW+rn3qetJX/SRuc/83rrKYtyZG0XfsQ1ao1nEudIt9w37ZSNXR236xEfm2C43sbw==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -1969,8 +1996,8 @@ packages: dev: true optional: true - /esbuild-android-arm64/0.14.24: - resolution: {integrity: sha512-wM3iuLZjaA9BhlMOH6mWvTGXwPJsLOuAbMkGiczSY+NLeG2WF1ouCcuhFz2jZCbnw9lnI30QWgzebNBQi9K8SA==} + /esbuild-android-arm64/0.14.29: + resolution: {integrity: sha512-D74dCv6yYnMTlofVy1JKiLM5JdVSQd60/rQfJSDP9qvRAI0laPXIG/IXY1RG6jobmFMUfL38PbFnCqyI/6fPXg==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -1978,8 +2005,8 @@ packages: dev: true optional: true - /esbuild-darwin-64/0.14.24: - resolution: {integrity: sha512-GDaCV5e9mdrJkrGT91W8WCqQ/+fvB/nsULIu4l7Ik7dlQd5uB4qeKRcFFl5Vz5ODK/C/UWZmKmMQWokZsLNWLQ==} + /esbuild-darwin-64/0.14.29: + resolution: {integrity: sha512-+CJaRvfTkzs9t+CjGa0Oa28WoXa7EeLutQhxus+fFcu0MHhsBhlmeWHac3Cc/Sf/xPi1b2ccDFfzGYJCfV0RrA==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -1987,8 +2014,8 @@ packages: dev: true optional: true - /esbuild-darwin-arm64/0.14.24: - resolution: {integrity: sha512-reU7/vEdXsg+zZWxKL/gaHsJkGMCC49Y4pqbsaBmx0YAF00K0+V7w5BHBF+iY5jvtJ1ZCYRHTN/iAbYVOnoV0w==} + /esbuild-darwin-arm64/0.14.29: + resolution: {integrity: sha512-5Wgz/+zK+8X2ZW7vIbwoZ613Vfr4A8HmIs1XdzRmdC1kG0n5EG5fvKk/jUxhNlrYPx1gSY7XadQ3l4xAManPSw==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -1996,8 +2023,8 @@ packages: dev: true optional: true - /esbuild-freebsd-64/0.14.24: - resolution: {integrity: sha512-Mp35Rz/XoixG7Uka6l54hU/XUxAEwQozgKoHPusJzX+Fu1vANil0Ypos0RJkidu7skSkd0xisNIT+gtD36BxpA==} + /esbuild-freebsd-64/0.14.29: + resolution: {integrity: sha512-VTfS7Bm9QA12JK1YXF8+WyYOfvD7WMpbArtDj6bGJ5Sy5xp01c/q70Arkn596aGcGj0TvQRplaaCIrfBG1Wdtg==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -2005,8 +2032,8 @@ packages: dev: true optional: true - /esbuild-freebsd-arm64/0.14.24: - resolution: {integrity: sha512-+tf4a4zYaHP1XXPt286mxOc2bmj13K57GZYjqYz/G3c3sgNXa0JBkcPlUATIj96WfXhWM115n3nHe9wF88+ZGQ==} + /esbuild-freebsd-arm64/0.14.29: + resolution: {integrity: sha512-WP5L4ejwLWWvd3Fo2J5mlXvG3zQHaw5N1KxFGnUc4+2ZFZknP0ST63i0IQhpJLgEJwnQpXv2uZlU1iWZjFqEIg==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -2014,8 +2041,8 @@ packages: dev: true optional: true - /esbuild-linux-32/0.14.24: - resolution: {integrity: sha512-8jMZErn5aLnlSQqzK365yoWRr67ZkGNcoTmk1CK5Bk1EB9g7uwCfdZsmWcclLWPGkIhMbdk4OvzQ+Wp0popwWA==} + /esbuild-linux-32/0.14.29: + resolution: {integrity: sha512-4myeOvFmQBWdI2U1dEBe2DCSpaZyjdQtmjUY11Zu2eQg4ynqLb8Y5mNjNU9UN063aVsCYYfbs8jbken/PjyidA==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -2023,8 +2050,8 @@ packages: dev: true optional: true - /esbuild-linux-64/0.14.24: - resolution: {integrity: sha512-D/JCsk9OY2IZj+fkU74pKD4rD2pjeiYUbze1cS5D6+U0pz8j71GjZY5UkfwHhBBbNyPe6DPCyex97txQUlHwWw==} + /esbuild-linux-64/0.14.29: + resolution: {integrity: sha512-iaEuLhssReAKE7HMwxwFJFn7D/EXEs43fFy5CJeA4DGmU6JHh0qVJD2p/UP46DvUXLRKXsXw0i+kv5TdJ1w5pg==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -2032,8 +2059,8 @@ packages: dev: true optional: true - /esbuild-linux-arm/0.14.24: - resolution: {integrity: sha512-N+vvGpJAUWv3j+YZGOMEtrHwrrSG582TuAThBwoRE7d2N4zFE2WQBCiSYaAVckMQhvMOPqnCdqeTDUse5nlKTw==} + /esbuild-linux-arm/0.14.29: + resolution: {integrity: sha512-OXa9D9QL1hwrAnYYAHt/cXAuSCmoSqYfTW/0CEY0LgJNyTxJKtqc5mlwjAZAvgyjmha0auS/sQ0bXfGf2wAokQ==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -2041,8 +2068,8 @@ packages: dev: true optional: true - /esbuild-linux-arm64/0.14.24: - resolution: {integrity: sha512-DypWEDQLE+PoHGMa4FLcmKvS+yQLsYlsN03R496rTpDOiVQGrRdo0LbYtf+uHpDxa1KRrHZsQim6n8m3VBHP6g==} + /esbuild-linux-arm64/0.14.29: + resolution: {integrity: sha512-KYf7s8wDfUy+kjKymW3twyGT14OABjGHRkm9gPJ0z4BuvqljfOOUbq9qT3JYFnZJHOgkr29atT//hcdD0Pi7Mw==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -2050,8 +2077,8 @@ packages: dev: true optional: true - /esbuild-linux-mips64le/0.14.24: - resolution: {integrity: sha512-eMk9pEHba1yd5bOuPZUJfFucigvysdcE2d/wV4M0eUdb/VjyH9fcGqz8byvSjmYSOt3WCn/V4jLVI+pwDSHWYw==} + /esbuild-linux-mips64le/0.14.29: + resolution: {integrity: sha512-05jPtWQMsZ1aMGfHOvnR5KrTvigPbU35BtuItSSWLI2sJu5VrM8Pr9Owym4wPvA4153DFcOJ1EPN/2ujcDt54g==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -2059,8 +2086,8 @@ packages: dev: true optional: true - /esbuild-linux-ppc64le/0.14.24: - resolution: {integrity: sha512-4vQ/Y6EV5Z2BjO7RdpEyTCv702WmOPc95d2CbUcFvg78FpGQAmrbIrHXu/yX4+rdUU6vMNBn3M+7M7/lxmxjjg==} + /esbuild-linux-ppc64le/0.14.29: + resolution: {integrity: sha512-FYhBqn4Ir9xG+f6B5VIQVbRuM4S6qwy29dDNYFPoxLRnwTEKToIYIUESN1qHyUmIbfO0YB4phG2JDV2JDN9Kgw==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -2068,8 +2095,8 @@ packages: dev: true optional: true - /esbuild-linux-riscv64/0.14.24: - resolution: {integrity: sha512-pAN9/+NZ487Wo9PmlOM6Ra95SrhG8JQw7fCgi3z7dUufwTApTNTPGs5UOMD4Bmorju+DeGb0f0GddLaeabvqDg==} + /esbuild-linux-riscv64/0.14.29: + resolution: {integrity: sha512-eqZMqPehkb4nZcffnuOpXJQdGURGd6GXQ4ZsDHSWyIUaA+V4FpMBe+5zMPtXRD2N4BtyzVvnBko6K8IWWr36ew==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -2077,8 +2104,8 @@ packages: dev: true optional: true - /esbuild-linux-s390x/0.14.24: - resolution: {integrity: sha512-ZR+VMHP2WS3022x2sK/85cBfKGgPalIZzpquDWjra9nUb+WdEzuK9i9bRsstLmjIPs3uIkGfe6xXUh/7PNLllw==} + /esbuild-linux-s390x/0.14.29: + resolution: {integrity: sha512-o7EYajF1rC/4ho7kpSG3gENVx0o2SsHm7cJ5fvewWB/TEczWU7teDgusGSujxCYcMottE3zqa423VTglNTYhjg==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -2086,8 +2113,8 @@ packages: dev: true optional: true - /esbuild-netbsd-64/0.14.24: - resolution: {integrity: sha512-1PzXU++e0PEaSuGpkhrVb+fDUw9mSp4laY9KRsjJkAuXPDj0rHz7KxK7CAbzY/ucufeIR9Ca8/oMpdVyWdaOGw==} + /esbuild-netbsd-64/0.14.29: + resolution: {integrity: sha512-/esN6tb6OBSot6+JxgeOZeBk6P8V/WdR3GKBFeFpSqhgw4wx7xWUqPrdx4XNpBVO7X4Ipw9SAqgBrWHlXfddww==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -2095,8 +2122,8 @@ packages: dev: true optional: true - /esbuild-openbsd-64/0.14.24: - resolution: {integrity: sha512-PvXh7JJAFM1kR87XDWbRrUkaOGVMS6Dq/IRXE2E02maio21JELk/jNRijTe81ztr8v+8K9osB3rG9zKqIdTxhQ==} + /esbuild-openbsd-64/0.14.29: + resolution: {integrity: sha512-jUTdDzhEKrD0pLpjmk0UxwlfNJNg/D50vdwhrVcW/D26Vg0hVbthMfb19PJMatzclbK7cmgk1Nu0eNS+abzoHw==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -2104,8 +2131,8 @@ packages: dev: true optional: true - /esbuild-sunos-64/0.14.24: - resolution: {integrity: sha512-5iYi76kGQdyCqvSUknqjTZ0T19KvQD6hiklPAY6kVoQ1YoDUGCGILRI9eM/3zLNLG1bUFgcdJ2ktaBxwyXuHyA==} + /esbuild-sunos-64/0.14.29: + resolution: {integrity: sha512-EfhQN/XO+TBHTbkxwsxwA7EfiTHFe+MNDfxcf0nj97moCppD9JHPq48MLtOaDcuvrTYOcrMdJVeqmmeQ7doTcg==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -2113,8 +2140,8 @@ packages: dev: true optional: true - /esbuild-windows-32/0.14.24: - resolution: {integrity: sha512-oDxcNu4P1FWTk2ompKB0uKHfxYw1QuubH189+PlfrrWT9tVu+mxT9dSwJu2erfUDz5dnr6h8rgkg95NGboeJxg==} + /esbuild-windows-32/0.14.29: + resolution: {integrity: sha512-uoyb0YAJ6uWH4PYuYjfGNjvgLlb5t6b3zIaGmpWPOjgpr1Nb3SJtQiK4YCPGhONgfg2v6DcJgSbOteuKXhwqAw==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -2122,8 +2149,8 @@ packages: dev: true optional: true - /esbuild-windows-64/0.14.24: - resolution: {integrity: sha512-0uxXF1yLcGEM2es0OMDgQYQGZXQEEIdq8cG3IWhY2GGfFRLXpMgic1iUE+SKCh+b82t1ftUVoyG0zIFRn5NOIA==} + /esbuild-windows-64/0.14.29: + resolution: {integrity: sha512-X9cW/Wl95QjsH8WUyr3NqbmfdU72jCp71cH3pwPvI4CgBM2IeOUDdbt6oIGljPu2bf5eGDIo8K3Y3vvXCCTd8A==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -2131,8 +2158,8 @@ packages: dev: true optional: true - /esbuild-windows-arm64/0.14.24: - resolution: {integrity: sha512-unwaYRaIK/4OaZm0jnM3pLKMPEjaQqmT5teTciSZ86VYaiYZF27Ki7BW7R5ngk27gIw0ovIfUcn9DhJgp7qAlw==} + /esbuild-windows-arm64/0.14.29: + resolution: {integrity: sha512-+O/PI+68fbUZPpl3eXhqGHTGK7DjLcexNnyJqtLZXOFwoAjaXlS5UBCvVcR3o2va+AqZTj8o6URaz8D2K+yfQQ==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -2140,32 +2167,32 @@ packages: dev: true optional: true - /esbuild/0.14.24: - resolution: {integrity: sha512-NjfmycVQqY0+iKXoHXsvMAKx4XF/bD/dDm8pK6C/3aJO/i/uby+7AR4z8vu0qkiihkB5Y43+9BjdY2MGnswC/A==} + /esbuild/0.14.29: + resolution: {integrity: sha512-SQS8cO8xFEqevYlrHt6exIhK853Me4nZ4aMW6ieysInLa0FMAL+AKs87HYNRtR2YWRcEIqoXAHh+Ytt5/66qpg==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - esbuild-android-64: 0.14.24 - esbuild-android-arm64: 0.14.24 - esbuild-darwin-64: 0.14.24 - esbuild-darwin-arm64: 0.14.24 - esbuild-freebsd-64: 0.14.24 - esbuild-freebsd-arm64: 0.14.24 - esbuild-linux-32: 0.14.24 - esbuild-linux-64: 0.14.24 - esbuild-linux-arm: 0.14.24 - esbuild-linux-arm64: 0.14.24 - esbuild-linux-mips64le: 0.14.24 - esbuild-linux-ppc64le: 0.14.24 - esbuild-linux-riscv64: 0.14.24 - esbuild-linux-s390x: 0.14.24 - esbuild-netbsd-64: 0.14.24 - esbuild-openbsd-64: 0.14.24 - esbuild-sunos-64: 0.14.24 - esbuild-windows-32: 0.14.24 - esbuild-windows-64: 0.14.24 - esbuild-windows-arm64: 0.14.24 + esbuild-android-64: 0.14.29 + esbuild-android-arm64: 0.14.29 + esbuild-darwin-64: 0.14.29 + esbuild-darwin-arm64: 0.14.29 + esbuild-freebsd-64: 0.14.29 + esbuild-freebsd-arm64: 0.14.29 + esbuild-linux-32: 0.14.29 + esbuild-linux-64: 0.14.29 + esbuild-linux-arm: 0.14.29 + esbuild-linux-arm64: 0.14.29 + esbuild-linux-mips64le: 0.14.29 + esbuild-linux-ppc64le: 0.14.29 + esbuild-linux-riscv64: 0.14.29 + esbuild-linux-s390x: 0.14.29 + esbuild-netbsd-64: 0.14.29 + esbuild-openbsd-64: 0.14.29 + esbuild-sunos-64: 0.14.29 + esbuild-windows-32: 0.14.29 + esbuild-windows-64: 0.14.29 + esbuild-windows-arm64: 0.14.29 dev: true /escalade/3.1.1: @@ -2200,25 +2227,25 @@ packages: source-map: 0.6.1 dev: true - /eslint-config-prettier/8.5.0_eslint@8.11.0: + /eslint-config-prettier/8.5.0_eslint@8.12.0: resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.11.0 + eslint: 8.12.0 dev: true - /eslint-plugin-cypress/2.12.1_eslint@8.11.0: + /eslint-plugin-cypress/2.12.1_eslint@8.12.0: resolution: {integrity: sha512-c2W/uPADl5kospNDihgiLc7n87t5XhUbFDoTl6CfVkmG+kDAb5Ux10V9PoLPu9N+r7znpc+iQlcmAqT1A/89HA==} peerDependencies: eslint: '>= 3.2.1' dependencies: - eslint: 8.11.0 + eslint: 8.12.0 globals: 11.12.0 dev: true - /eslint-plugin-prettier/4.0.0_68edcf5670f37721baf5d2cac6124e4d: + /eslint-plugin-prettier/4.0.0_b253a92c95b42c3296c682f11cccb3bd: resolution: {integrity: sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==} engines: {node: '>=6.0.0'} peerDependencies: @@ -2229,23 +2256,23 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.11.0 - eslint-config-prettier: 8.5.0_eslint@8.11.0 - prettier: 2.6.0 + eslint: 8.12.0 + eslint-config-prettier: 8.5.0_eslint@8.12.0 + prettier: 2.6.1 prettier-linter-helpers: 1.0.0 dev: true - /eslint-plugin-vue/8.5.0_eslint@8.11.0: + /eslint-plugin-vue/8.5.0_eslint@8.12.0: resolution: {integrity: sha512-i1uHCTAKOoEj12RDvdtONWrGzjFm/djkzqfhmQ0d6M/W8KM81mhswd/z+iTZ0jCpdUedW3YRgcVfQ37/J4zoYQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 dependencies: - eslint: 8.11.0 - eslint-utils: 3.0.0_eslint@8.11.0 + eslint: 8.12.0 + eslint-utils: 3.0.0_eslint@8.12.0 natural-compare: 1.4.0 semver: 7.3.5 - vue-eslint-parser: 8.3.0_eslint@8.11.0 + vue-eslint-parser: 8.3.0_eslint@8.12.0 transitivePeerDependencies: - supports-color dev: true @@ -2266,13 +2293,13 @@ packages: estraverse: 5.3.0 dev: true - /eslint-utils/3.0.0_eslint@8.11.0: + /eslint-utils/3.0.0_eslint@8.12.0: resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} peerDependencies: eslint: '>=5' dependencies: - eslint: 8.11.0 + eslint: 8.12.0 eslint-visitor-keys: 2.1.0 dev: true @@ -2286,8 +2313,8 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint/8.11.0: - resolution: {integrity: sha512-/KRpd9mIRg2raGxHRGwW9ZywYNAClZrHjdueHcrVDuO3a6bj83eoTirCCk0M0yPwOjWYKHwRVRid+xK4F/GHgA==} + /eslint/8.12.0: + resolution: {integrity: sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: @@ -2300,7 +2327,7 @@ packages: doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.1.1 - eslint-utils: 3.0.0_eslint@8.11.0 + eslint-utils: 3.0.0_eslint@8.12.0 eslint-visitor-keys: 3.3.0 espree: 9.3.1 esquery: 1.4.0 @@ -2819,16 +2846,16 @@ packages: hasBin: true dev: true - /histoire/0.2.0_cd0dd645aa5dde4c3c337175f134c2cd: - resolution: {integrity: sha512-gZjzqf2ioADS7gOcToFVjL5YRKtx/I4IXtzi+lCbmIsXzXmDWdaipobVFU+WZPsQVNpGlzNa9LaKLS5wrwVmaQ==} + /histoire/0.2.1_095f2bcd7e5ef9151eeb916a391a390e: + resolution: {integrity: sha512-/mOIJfhl7FWoI5QmHfPTgwnB4j5LQR0xqhjW6QWMOTaWmEv8QiKgxwCW+oSoj+24c3XKPODF4HBI6tpXliknvg==} hasBin: true peerDependencies: vite: ^2.8.3 vue: ^3.2.31 dependencies: - '@histoire/controls': 0.2.0 + '@histoire/controls': 0.2.1 '@iconify/vue': 3.1.4_vue@3.2.31 - '@vitejs/plugin-vue': 2.2.4_vite@2.8.6+vue@3.2.31 + '@vitejs/plugin-vue': 2.3.1_vite@2.9.1+vue@3.2.31 '@vueuse/core': 8.1.1_vue@3.2.31 birpc: 0.1.0 case: 1.6.3 @@ -2847,14 +2874,14 @@ packages: mrmime: 1.0.0 pathe: 0.2.0 picocolors: 1.0.0 - pinia: 2.0.12_typescript@4.5.5+vue@3.2.31 + pinia: 2.0.13_typescript@4.5.5+vue@3.2.31 sade: 1.8.1 scroll-into-view-if-needed: 2.2.29 shiki: 0.10.1 sirv: 2.0.2 tinypool: 0.1.2 - vite: 2.8.6_sass@1.49.9 - vite-node: 0.7.6_sass@1.49.9 + vite: 2.9.1_sass@1.49.10 + vite-node: 0.7.6_sass@1.49.10 vue: 3.2.31 vue-router: 4.0.14_vue@3.2.31 transitivePeerDependencies: @@ -3496,6 +3523,10 @@ packages: resolution: {integrity: sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==} dev: true + /minimist/1.2.6: + resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==} + dev: true + /mlly/0.4.3: resolution: {integrity: sha512-xezyv7hnfFPuiDS3AiJuWs0OxlvooS++3L2lURvmh/1n7UG4O2Ehz9UkwWgg3wyLEPKGVfJLlr2DjjTCl9UJTg==} dev: true @@ -3736,8 +3767,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /pinia/2.0.12_typescript@4.5.5+vue@3.2.31: - resolution: {integrity: sha512-tUeuYGFrLU5irmGyRAIxp35q1OTcZ8sKpGT4XkPeVcG35W4R6cfXDbCGexzmVqH5lTQJJTXXbNGutIu9yS5yew==} + /pinia/2.0.13_typescript@4.5.5+vue@3.2.31: + resolution: {integrity: sha512-B7rSqm1xNpwcPMnqns8/gVBfbbi7lWTByzS6aPZ4JOXSJD4Y531rZHDCoYWBwLyHY/8hWnXljgiXp6rRyrofcw==} peerDependencies: '@vue/composition-api': ^1.4.0 typescript: '>=4.4.4' @@ -3748,7 +3779,7 @@ packages: typescript: optional: true dependencies: - '@vue/devtools-api': 6.1.3 + '@vue/devtools-api': 6.1.4 typescript: 4.5.5 vue: 3.2.31 vue-demi: 0.12.1_vue@3.2.31 @@ -3823,8 +3854,8 @@ packages: fast-diff: 1.2.0 dev: true - /prettier/2.6.0: - resolution: {integrity: sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==} + /prettier/2.6.1: + resolution: {integrity: sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A==} engines: {node: '>=10.13.0'} hasBin: true dev: true @@ -4095,8 +4126,8 @@ packages: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: true - /sass/1.49.9: - resolution: {integrity: sha512-YlYWkkHP9fbwaFRZQRXgDi3mXZShslVmmo+FVK3kHLUELHHEYrCmL1x6IUjC7wLS6VuJSAFXRQS/DxdsC4xL1A==} + /sass/1.49.10: + resolution: {integrity: sha512-w37zfWJwKu4I78U4z63u1mmgoncq+v3iOB4yzQMPyAPVHHawaQSnu9C9ysGQnZEhW609jkcLioJcMCqm75JMdg==} engines: {node: '>=12.0.0'} hasBin: true dependencies: @@ -4571,6 +4602,61 @@ packages: engines: {node: '>= 0.8'} dev: true + /unplugin-icons/0.14.1_vite@2.9.1: + resolution: {integrity: sha512-drZFbMctvT3ZJPfdCgBv5+LKO8hGbZApRCoBRAUhQFRJQVNGUhGThrOKs+CvWq3XDBPptGNBmst8WyObbr4xiQ==} + peerDependencies: + '@svgr/core': '>=5.5.0' + '@vue/compiler-sfc': ^3.0.2 + vue-template-compiler: ^2.6.12 + vue-template-es2015-compiler: ^1.9.0 + peerDependenciesMeta: + '@svgr/core': + optional: true + '@vue/compiler-sfc': + optional: true + vue-template-compiler: + optional: true + vue-template-es2015-compiler: + optional: true + dependencies: + '@antfu/install-pkg': 0.1.0 + '@antfu/utils': 0.5.0 + '@iconify/utils': 1.0.32 + debug: 4.3.4 + kolorist: 1.5.1 + local-pkg: 0.4.1 + unplugin: 0.5.2_vite@2.9.1 + transitivePeerDependencies: + - esbuild + - rollup + - supports-color + - vite + - webpack + dev: true + + /unplugin/0.5.2_vite@2.9.1: + resolution: {integrity: sha512-3SPYtus/56cxyD4jfjrnqCvb6jPxvdqJNaRXnEaG2BhNEMaoygu/39AG+LwKmiIUzj4XHyitcfZ7scGlWfEigA==} + peerDependencies: + esbuild: '>=0.13' + rollup: ^2.50.0 + vite: ^2.3.0 + webpack: 4 || 5 + peerDependenciesMeta: + esbuild: + optional: true + rollup: + optional: true + vite: + optional: true + webpack: + optional: true + dependencies: + chokidar: 3.5.3 + vite: 2.9.1_sass@1.49.10 + webpack-sources: 3.2.3 + webpack-virtual-modules: 0.4.3 + dev: true + /untildify/4.0.0: resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} engines: {node: '>=8'} @@ -4623,7 +4709,7 @@ packages: extsprintf: 1.3.0 dev: true - /vite-node/0.7.6_sass@1.49.9: + /vite-node/0.7.6_sass@1.49.10: resolution: {integrity: sha512-WeBR3JOHX3MD4SzJDwIjrJHd+lpaPHpcQf1sbDDgm7k98JqdTGiz9X+C/17EwHUwCd1lgPf5Nu4L3asIGPuXYw==} engines: {node: '>=14.14.0'} hasBin: true @@ -4632,15 +4718,15 @@ packages: minimist: 1.2.5 mlly: 0.4.3 pathe: 0.2.0 - vite: 2.8.6_sass@1.49.9 + vite: 2.9.1_sass@1.49.10 transitivePeerDependencies: - less - sass - stylus dev: true - /vite/2.8.6_sass@1.49.9: - resolution: {integrity: sha512-e4H0QpludOVKkmOsRyqQ7LTcMUDF3mcgyNU4lmi0B5JUbe0ZxeBBl8VoZ8Y6Rfn9eFKYtdXNPcYK97ZwH+K2ug==} + /vite/2.9.1_sass@1.49.10: + resolution: {integrity: sha512-vSlsSdOYGcYEJfkQ/NeLXgnRv5zZfpAsdztkIrs7AZHV8RCMZQkwjo4DS5BnrYTqoWqLoUe1Cah4aVO4oNNqCQ==} engines: {node: '>=12.2.0'} hasBin: true peerDependencies: @@ -4655,16 +4741,16 @@ packages: stylus: optional: true dependencies: - esbuild: 0.14.24 + esbuild: 0.14.29 postcss: 8.4.12 resolve: 1.22.0 rollup: 2.69.0 - sass: 1.49.9 + sass: 1.49.10 optionalDependencies: fsevents: 2.3.2 dev: true - /vitest/0.5.9_d9d2d37e110baf3b78cf157ce5497ceb: + /vitest/0.5.9_4807d2e4359e51ec3e91e3dc341f010f: resolution: {integrity: sha512-R8lRP9Q1yIbwr8pDf2gvw4PFe8H5YMyHhBcdyfnUh6toLfCR10jrdI/WkNxdo5I4H/9XrMX9t+SAavdJExNdKg==} engines: {node: '>=14.14.0'} hasBin: true @@ -4691,7 +4777,7 @@ packages: local-pkg: 0.4.1 tinypool: 0.1.2 tinyspy: 0.3.0 - vite: 2.8.6_sass@1.49.9 + vite: 2.9.1_sass@1.49.10 transitivePeerDependencies: - less - sass @@ -4835,14 +4921,14 @@ packages: dependencies: vue: 3.2.31 - /vue-eslint-parser/8.3.0_eslint@8.11.0: + /vue-eslint-parser/8.3.0_eslint@8.12.0: resolution: {integrity: sha512-dzHGG3+sYwSf6zFBa0Gi9ZDshD7+ad14DGOdTLjruRVgZXe2J+DcZ9iUhyR48z5g1PqRa20yt3Njna/veLJL/g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0' dependencies: debug: 4.3.3 - eslint: 8.11.0 + eslint: 8.12.0 eslint-scope: 7.1.1 eslint-visitor-keys: 3.3.0 espree: 9.3.1 @@ -4926,6 +5012,15 @@ packages: engines: {node: '>=12'} dev: true + /webpack-sources/3.2.3: + resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} + engines: {node: '>=10.13.0'} + dev: true + + /webpack-virtual-modules/0.4.3: + resolution: {integrity: sha512-5NUqC2JquIL2pBAAo/VfBP6KuGkHIZQXW/lNKupLPfhViwh8wNsu0BObtl09yuKZszeEUfbXz8xhrHvSG16Nqw==} + dev: true + /whatwg-encoding/1.0.5: resolution: {integrity: sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==} dependencies: diff --git a/src/App.vue b/src/App.vue index af9c7ac5..d7d4ad7f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,74 @@ + + diff --git a/src/components/base/menu/Menu.story.vue b/src/components/base/menu/Menu.story.vue new file mode 100644 index 00000000..51d15544 --- /dev/null +++ b/src/components/base/menu/Menu.story.vue @@ -0,0 +1,20 @@ + + diff --git a/src/components/base/menu/Menu.vue b/src/components/base/menu/Menu.vue new file mode 100644 index 00000000..1bbee0bb --- /dev/null +++ b/src/components/base/menu/Menu.vue @@ -0,0 +1,21 @@ + + + diff --git a/src/components/base/menu/MenuItem.vue b/src/components/base/menu/MenuItem.vue new file mode 100644 index 00000000..44bba69d --- /dev/null +++ b/src/components/base/menu/MenuItem.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/src/components/base/menu/MenuLabel.vue b/src/components/base/menu/MenuLabel.vue new file mode 100644 index 00000000..5d183ab7 --- /dev/null +++ b/src/components/base/menu/MenuLabel.vue @@ -0,0 +1,14 @@ + + diff --git a/src/components/.gitkeep b/src/components/base/menu/RoutesMenu.vue similarity index 100% rename from src/components/.gitkeep rename to src/components/base/menu/RoutesMenu.vue diff --git a/src/components/base/menu/__tests__/Menu.spec.tsx b/src/components/base/menu/__tests__/Menu.spec.tsx new file mode 100644 index 00000000..0679cfcc --- /dev/null +++ b/src/components/base/menu/__tests__/Menu.spec.tsx @@ -0,0 +1,100 @@ +import { describe, expect, it } from "vitest"; +import { mount } from "@vue/test-utils"; +import { VMenu, VMenuItem } from "../index"; + +describe("Menu", () => { + it("should render", () => { + expect(VMenu).toBeDefined(); + expect(VMenuItem).toBeDefined(); + expect(mount(VMenu).html()).toMatchSnapshot(); + expect(mount(VMenuItem).html()).toMatchSnapshot(); + }); + + it("should work with sub menus", async () => { + const wrapper = await mount({ + setup() { + return () => ( + + + + + + + + ); + }, + }); + expect(wrapper.html()).toMatchSnapshot(); + + // toggling sub menu + expect( + wrapper.find(".has-submenus .sub-menu-items").attributes().style + ).toBeUndefined(); // visible + + await wrapper.find(".has-submenus").trigger("click"); + expect( + wrapper.find(".has-submenus .sub-menu-items").attributes().style + ).toBe("display: none;"); + + await wrapper.find(".has-submenus").trigger("click"); + expect( + wrapper.find(".has-submenus .sub-menu-items").attributes().style + ).toBeUndefined(); // visible + }); + + it("should work with openIds prop", function () { + const wrapper = mount({ + setup() { + return () => ( + + + + + + + + ); + }, + }); + + expect(wrapper.html()).toMatchSnapshot(); + + expect(wrapper.find(".sub-menu-items .menu-title").text()).contain( + "Menu Item 4" + ); + }); + + it("should work with select emit", async () => { + const wrapper = mount({ + setup() { + return () => ( + + + + + + + + ); + }, + }); + + wrapper.findAllComponents(VMenuItem).forEach((item) => { + // has not sub menu + if (item.props().id === "1") { + item.trigger("click"); + expect(item.emitted().select[0]).toEqual(["1"]); + } + // has sub menu + if (item.props().id === "3") { + item.trigger("click"); + expect(item.emitted().select).toBeUndefined(); + + expect(item.vm.open).toBe(false); + + item.trigger("click"); + expect(item.vm.open).toBe(true); + } + }); + }); +}); diff --git a/src/components/base/menu/__tests__/__snapshots__/Menu.spec.tsx.snap b/src/components/base/menu/__tests__/__snapshots__/Menu.spec.tsx.snap new file mode 100644 index 00000000..2e59718d --- /dev/null +++ b/src/components/base/menu/__tests__/__snapshots__/Menu.spec.tsx.snap @@ -0,0 +1,105 @@ +// Vitest Snapshot v1 + +exports[`Menu > should render 1`] = ` +"
+ +
" +`; + +exports[`Menu > should render 2`] = ` +"
  • +
    + + +
    + +
      +
      +
    • " +`; + +exports[`Menu > should work with openIds prop 1`] = ` +"
      + +
      " +`; + +exports[`Menu > should work with sub menus 1`] = ` +"
      + +
      " +`; diff --git a/src/components/base/menu/index.ts b/src/components/base/menu/index.ts new file mode 100644 index 00000000..91bb174e --- /dev/null +++ b/src/components/base/menu/index.ts @@ -0,0 +1,3 @@ +export { default as VMenu } from "./Menu.vue"; +export { default as VMenuItem } from "./MenuItem.vue"; +export { default as VMenuLabel } from "./MenuLabel.vue"; diff --git a/src/core/icons.ts b/src/core/icons.ts new file mode 100644 index 00000000..42d968de --- /dev/null +++ b/src/core/icons.ts @@ -0,0 +1,6 @@ +// @ts-ignore +import IconDashboard from "~icons/ri/dashboard-3-line"; +// @ts-ignore +import IconArrowRight from "~icons/ri/arrow-right-s-line"; + +export { IconDashboard, IconArrowRight }; diff --git a/src/router/index.ts b/src/router/index.ts index f46fec2e..0eb87707 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,20 +1,10 @@ import { createRouter, createWebHistory } from "vue-router"; -import HomeView from "../views/HomeView.vue"; +import routesConfig from "@/router/routes.config"; const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), - routes: [ - { - path: "/", - name: "home", - component: HomeView, - }, - { - path: "/about", - name: "about", - component: () => import("../views/AboutView.vue"), - }, - ], + routes: routesConfig, + scrollBehavior: () => ({ left: 0, top: 0 }), }); export default router; diff --git a/src/router/menus.config.ts b/src/router/menus.config.ts new file mode 100644 index 00000000..d4d853ce --- /dev/null +++ b/src/router/menus.config.ts @@ -0,0 +1,107 @@ +import { IconDashboard } from "@/core/icons"; + +declare interface MenuGroupType { + name?: string; + items: MenuItemType[]; +} + +declare interface MenuItemType { + name: string; + path: string; + icon?: string; + meta?: Record; + children?: MenuItemType[]; +} + +export const menus: MenuGroupType[] = [ + { + items: [ + { + name: "仪表盘", + path: "/dashboard", + icon: IconDashboard, + }, + ], + }, + { + name: "内容", + items: [ + { + name: "文章", + path: "/posts", + icon: IconDashboard, + children: [ + { + name: "分类", + path: "/categories", + icon: IconDashboard, + }, + { + name: "标签", + path: "/tags", + icon: IconDashboard, + }, + ], + }, + { + name: "页面", + path: "/sheets", + icon: IconDashboard, + }, + { + name: "评论", + path: "/comment", + icon: IconDashboard, + }, + { + name: "附件", + path: "/attachment", + icon: IconDashboard, + }, + ], + }, + { + name: "外观", + items: [ + { + name: "主题", + path: "/themes", + icon: IconDashboard, + }, + { + name: "菜单", + path: "/menus", + icon: IconDashboard, + }, + { + name: "可视化", + path: "/visual", + icon: IconDashboard, + }, + ], + }, + { + name: "系统", + items: [ + { + name: "插件", + path: "/plugins", + icon: IconDashboard, + }, + { + name: "用户", + path: "/users", + icon: IconDashboard, + }, + { + name: "设置", + path: "/settings", + icon: IconDashboard, + }, + ], + }, +]; + +export type { MenuItemType, MenuGroupType }; + +export default menus; diff --git a/src/router/routes.config.ts b/src/router/routes.config.ts new file mode 100644 index 00000000..f7c16fa0 --- /dev/null +++ b/src/router/routes.config.ts @@ -0,0 +1,18 @@ +import type { RouteRecordRaw } from "vue-router"; + +export const routes: Array = [ + { + path: "/", + name: "home", + component: () => import("../views/HomeView.vue"), + children: [ + { + path: "/about", + name: "about", + component: () => import("../views/AboutView.vue"), + }, + ], + }, +]; + +export default routes; diff --git a/vite.config.ts b/vite.config.ts index f828a4c4..a2f014b6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,10 +3,11 @@ import { fileURLToPath, URL } from "url"; import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; import vueJsx from "@vitejs/plugin-vue-jsx"; +import icons from "unplugin-icons/vite"; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue(), vueJsx()], + plugins: [vue(), vueJsx(), icons()], resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)),