diff --git a/package.json b/package.json index 23daaf637..bf5503d90 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ }, "scripts": { "preinstall": "npx only-allow pnpm", - "postinstall": "node ./scripts/postinstall.js || pnpm build:pkg", + "postinstall": "node ./scripts/postinstall.js || pnpm nx:build", "bootstrap": "pnpm install", "serve": "npm run dev", "dev": "vite dev", @@ -21,6 +21,7 @@ "build:watch": "rimraf dist && cross-env NODE_ENV=production vite build --watch", "build:pkg": "pnpm -r --paralle --filter='./packages/*' run build", "nx:build": "nx run-many -t build --exclude @admin-pkg/components", + "nx:build:watch": "nx watch --all -- nx run \\$NX_PROJECT_NAME:build", "preview": "npm run build --watch && vite preview", "preview:dist": "vite preview", "openapi": "npx tsx openapi.config.ts", @@ -75,7 +76,7 @@ "@faker-js/faker": "^8.4.1", "@iconify-json/ant-design": "^1.1.15", "@iconify-json/ep": "^1.1.15", - "@iconify/json": "^2.2.194", + "@iconify/json": "^2.2.195", "@types/crypto-js": "^4.2.2", "@types/lodash-es": "~4.17.12", "@types/node": "~20.11.16", @@ -108,7 +109,7 @@ "prettier": "~3.2.5", "pretty-quick": "~4.0.0", "rimraf": "~5.0.5", - "stylelint": "~16.2.1", + "stylelint": "~16.3.0", "stylelint-config-property-sort-order-smacss": "^10.0.0", "stylelint-config-recommended": "~14.0.0", "stylelint-config-recommended-vue": "~1.5.0", @@ -118,7 +119,7 @@ "typescript": "~5.4.3", "unocss": "^0.58.6", "unplugin-vue-components": "~0.26.0", - "vite": "~5.2.4", + "vite": "~5.2.6", "vite-plugin-checker": "~0.6.4", "vite-plugin-inspect": "^0.8.3", "vite-plugin-mkcert": "^1.17.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e21857b0d..6fac6debd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -95,7 +95,7 @@ importers: version: file:packages/vite-plugin-msw(msw@2.2.10) '@admin-pkg/vite-plugin-tinymce-resource': specifier: workspace:* - version: file:packages/vite-plugin-tinymce-resource(vite@5.2.4) + version: file:packages/vite-plugin-tinymce-resource(vite@5.2.6) '@commitlint/cli': specifier: ~19.2.1 version: 19.2.1(@types/node@20.11.30)(typescript@5.4.3) @@ -112,8 +112,8 @@ importers: specifier: ^1.1.15 version: 1.1.15 '@iconify/json': - specifier: ^2.2.194 - version: 2.2.194 + specifier: ^2.2.195 + version: 2.2.195 '@types/crypto-js': specifier: ^4.2.2 version: 4.2.2 @@ -137,10 +137,10 @@ importers: version: 1.11.1 '@vitejs/plugin-vue': specifier: ~5.0.4 - version: 5.0.4(vite@5.2.4)(vue@3.4.21) + version: 5.0.4(vite@5.2.6)(vue@3.4.21) '@vitejs/plugin-vue-jsx': specifier: ~3.1.0 - version: 3.1.0(vite@5.2.4)(vue@3.4.21) + version: 3.1.0(vite@5.2.6)(vue@3.4.21) '@vue/tsconfig': specifier: ^0.5.1 version: 0.5.1 @@ -211,50 +211,50 @@ importers: specifier: ~5.0.5 version: 5.0.5 stylelint: - specifier: ~16.2.1 - version: 16.2.1(typescript@5.4.3) + specifier: ~16.3.0 + version: 16.3.0(typescript@5.4.3) stylelint-config-property-sort-order-smacss: specifier: ^10.0.0 - version: 10.0.0(stylelint@16.2.1) + version: 10.0.0(stylelint@16.3.0) stylelint-config-recommended: specifier: ~14.0.0 - version: 14.0.0(stylelint@16.2.1) + version: 14.0.0(stylelint@16.3.0) stylelint-config-recommended-vue: specifier: ~1.5.0 - version: 1.5.0(postcss-html@1.6.0)(stylelint@16.2.1) + version: 1.5.0(postcss-html@1.6.0)(stylelint@16.3.0) stylelint-config-standard: specifier: ~36.0.0 - version: 36.0.0(stylelint@16.2.1) + version: 36.0.0(stylelint@16.3.0) stylelint-order: specifier: ~6.0.4 - version: 6.0.4(stylelint@16.2.1) + version: 6.0.4(stylelint@16.3.0) stylelint-prettier: specifier: ^5.0.0 - version: 5.0.0(prettier@3.2.5)(stylelint@16.2.1) + version: 5.0.0(prettier@3.2.5)(stylelint@16.3.0) typescript: specifier: ~5.4.3 version: 5.4.3 unocss: specifier: ^0.58.6 - version: 0.58.6(postcss@8.4.38)(vite@5.2.4) + version: 0.58.6(postcss@8.4.38)(vite@5.2.6) unplugin-vue-components: specifier: ~0.26.0 version: 0.26.0(vue@3.4.21) vite: - specifier: ~5.2.4 - version: 5.2.4(@types/node@20.11.30)(less@4.2.0) + specifier: ~5.2.6 + version: 5.2.6(@types/node@20.11.30)(less@4.2.0) vite-plugin-checker: specifier: ~0.6.4 - version: 0.6.4(eslint@8.57.0)(stylelint@16.2.1)(typescript@5.4.3)(vite@5.2.4)(vue-tsc@1.8.27) + version: 0.6.4(eslint@8.57.0)(stylelint@16.3.0)(typescript@5.4.3)(vite@5.2.6)(vue-tsc@1.8.27) vite-plugin-inspect: specifier: ^0.8.3 - version: 0.8.3(vite@5.2.4) + version: 0.8.3(vite@5.2.6) vite-plugin-mkcert: specifier: ^1.17.5 - version: 1.17.5(vite@5.2.4) + version: 1.17.5(vite@5.2.6) vite-plugin-svg-icons: specifier: ~2.0.1 - version: 2.0.1(vite@5.2.4) + version: 2.0.1(vite@5.2.6) vue-eslint-parser: specifier: ~9.4.2 version: 9.4.2(eslint@8.57.0) @@ -1899,6 +1899,10 @@ packages: engines: {node: '>=10'} dev: false + /@dual-bundle/import-meta-resolve@4.0.0: + resolution: {integrity: sha512-ZKXyJeFAzcpKM2kk8ipoGIPUqx9BX52omTGnfwjJvxOCaZTM2wtDK7zN0aIgPRbT9XYAlha0HtmZ+XKteuh0Gw==} + dev: true + /@emotion/hash@0.9.1: resolution: {integrity: sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==} dev: false @@ -2423,8 +2427,8 @@ packages: '@iconify/types': 2.0.0 dev: true - /@iconify/json@2.2.194: - resolution: {integrity: sha512-kt6oB8uvCfUAenD7BUN1Sf+coZvkLbXlT2wPcdurqVQrbL0SLNgiknxaV6RXVXXN7uE/BV239vRGfoHub4dBvA==} + /@iconify/json@2.2.195: + resolution: {integrity: sha512-oDO79OGefkm/F4xeRDWSiigxsf7yMJAHRzyOoqmkrerUDJ/5JxRSsezUJhYlVarbRFdaBLGh7joJwtLO5mAmXw==} dependencies: '@iconify/types': 2.0.0 pathe: 1.1.2 @@ -3510,7 +3514,7 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@unocss/astro@0.58.6(vite@5.2.4): + /@unocss/astro@0.58.6(vite@5.2.6): resolution: {integrity: sha512-0BvbhEp5Ln6wFNnhISusB2hcfycWkdgnjlFMcLT69efvj4G39MzB6JYT/1qiidLfpj35HcqkpBz7TfZ4bUmOAw==} peerDependencies: vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 @@ -3520,8 +3524,8 @@ packages: dependencies: '@unocss/core': 0.58.6 '@unocss/reset': 0.58.6 - '@unocss/vite': 0.58.6(vite@5.2.4) - vite: 5.2.4(@types/node@20.11.30)(less@4.2.0) + '@unocss/vite': 0.58.6(vite@5.2.6) + vite: 5.2.6(@types/node@20.11.30)(less@4.2.0) transitivePeerDependencies: - rollup dev: true @@ -3704,7 +3708,7 @@ packages: '@unocss/core': 0.58.6 dev: true - /@unocss/vite@0.58.6(vite@5.2.4): + /@unocss/vite@0.58.6(vite@5.2.6): resolution: {integrity: sha512-DPXCoYU/Ozqc/Jeptd41XvtW8MSgVxmtTyhpMAsm/hJuBfwIV7Fy3TZquf4V9BpaTb4ao1LVXzgXmVUmj2HXpA==} peerDependencies: vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 @@ -3719,12 +3723,12 @@ packages: chokidar: 3.6.0 fast-glob: 3.3.2 magic-string: 0.30.8 - vite: 5.2.4(@types/node@20.11.30)(less@4.2.0) + vite: 5.2.6(@types/node@20.11.30)(less@4.2.0) transitivePeerDependencies: - rollup dev: true - /@vitejs/plugin-vue-jsx@3.1.0(vite@5.2.4)(vue@3.4.21): + /@vitejs/plugin-vue-jsx@3.1.0(vite@5.2.6)(vue@3.4.21): resolution: {integrity: sha512-w9M6F3LSEU5kszVb9An2/MmXNxocAnUb3WhRr8bHlimhDrXNt6n6D2nJQR3UXpGlZHh/EsgouOHCsM8V3Ln+WA==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -3734,20 +3738,20 @@ packages: '@babel/core': 7.24.3 '@babel/plugin-transform-typescript': 7.24.1(@babel/core@7.24.3) '@vue/babel-plugin-jsx': 1.2.2(@babel/core@7.24.3) - vite: 5.2.4(@types/node@20.11.30)(less@4.2.0) + vite: 5.2.6(@types/node@20.11.30)(less@4.2.0) vue: 3.4.21(typescript@5.4.3) transitivePeerDependencies: - supports-color dev: true - /@vitejs/plugin-vue@5.0.4(vite@5.2.4)(vue@3.4.21): + /@vitejs/plugin-vue@5.0.4(vite@5.2.6)(vue@3.4.21): resolution: {integrity: sha512-WS3hevEszI6CEVEx28F8RjTX97k3KsrcY6kvTg7+Whm5y3oYvcqzVeGCU3hxSAn4uY2CLCkeokkGKpoctccilQ==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: vite: ^5.0.0 vue: ^3.2.25 dependencies: - vite: 5.2.4(@types/node@20.11.30)(less@4.2.0) + vite: 5.2.6(@types/node@20.11.30)(less@4.2.0) vue: 3.4.21(typescript@5.4.3) dev: true @@ -7927,8 +7931,8 @@ packages: resolution: {integrity: sha512-sZLUnTqimCkvkgRS+kbPlYW5o8q5w1cu+uIisKpEWkj31I8mx8kNG162DwRav8Zirkva6N5uoFsm9kzK4mUXjw==} dev: true - /known-css-properties@0.29.0: - resolution: {integrity: sha512-Ne7wqW7/9Cz54PDt4I3tcV+hAyat8ypyOGzYRJQfdxnnjeWsTxt1cy8pjvvKeI5kfXuyvULyeeAvwvvtAX3ayQ==} + /known-css-properties@0.30.0: + resolution: {integrity: sha512-VSWXYUnsPu9+WYKkfmJyLKtIvaRJi1kXUqVmBACORXZQxT5oZDsoZ2vQP+bQFDnWtpI/4eq3MLoRMjI2fnLzTQ==} dev: true /kolorist@1.8.0: @@ -10590,7 +10594,7 @@ packages: stylelint: 13.13.1 dev: true - /stylelint-config-html@1.1.0(postcss-html@1.6.0)(stylelint@16.2.1): + /stylelint-config-html@1.1.0(postcss-html@1.6.0)(stylelint@16.3.0): resolution: {integrity: sha512-IZv4IVESjKLumUGi+HWeb7skgO6/g4VMuAYrJdlqQFndgbj6WJAXPhaysvBiXefX79upBdQVumgYcdd17gCpjQ==} engines: {node: ^12 || >=14} peerDependencies: @@ -10598,7 +10602,7 @@ packages: stylelint: '>=14.0.0' dependencies: postcss-html: 1.6.0 - stylelint: 16.2.1(typescript@5.4.3) + stylelint: 16.3.0(typescript@5.4.3) dev: true /stylelint-config-prettier@8.0.2(stylelint@13.13.1): @@ -10611,18 +10615,18 @@ packages: stylelint: 13.13.1 dev: true - /stylelint-config-property-sort-order-smacss@10.0.0(stylelint@16.2.1): + /stylelint-config-property-sort-order-smacss@10.0.0(stylelint@16.3.0): resolution: {integrity: sha512-NuiTgyqD8UdYY1IpTBIodBbrWKwaib5r8sq5kGHQ52UrmT8O7Fa8ZWYGipSZw6k9tGoljl9Hng2jtH+wBTMa1Q==} engines: {node: '>=18.12.0'} peerDependencies: stylelint: ^14.0.0 || ^15.0.0 || ^16.0.0 dependencies: css-property-sort-order-smacss: 2.2.0 - stylelint: 16.2.1(typescript@5.4.3) - stylelint-order: 6.0.4(stylelint@16.2.1) + stylelint: 16.3.0(typescript@5.4.3) + stylelint-order: 6.0.4(stylelint@16.3.0) dev: true - /stylelint-config-recommended-vue@1.5.0(postcss-html@1.6.0)(stylelint@16.2.1): + /stylelint-config-recommended-vue@1.5.0(postcss-html@1.6.0)(stylelint@16.3.0): resolution: {integrity: sha512-65TAK/clUqkNtkZLcuytoxU0URQYlml+30Nhop7sRkCZ/mtWdXt7T+spPSB3KMKlb+82aEVJ4OrcstyDBdbosg==} engines: {node: ^12 || >=14} peerDependencies: @@ -10631,18 +10635,18 @@ packages: dependencies: postcss-html: 1.6.0 semver: 7.6.0 - stylelint: 16.2.1(typescript@5.4.3) - stylelint-config-html: 1.1.0(postcss-html@1.6.0)(stylelint@16.2.1) - stylelint-config-recommended: 14.0.0(stylelint@16.2.1) + stylelint: 16.3.0(typescript@5.4.3) + stylelint-config-html: 1.1.0(postcss-html@1.6.0)(stylelint@16.3.0) + stylelint-config-recommended: 14.0.0(stylelint@16.3.0) dev: true - /stylelint-config-recommended@14.0.0(stylelint@16.2.1): + /stylelint-config-recommended@14.0.0(stylelint@16.3.0): resolution: {integrity: sha512-jSkx290CglS8StmrLp2TxAppIajzIBZKYm3IxT89Kg6fGlxbPiTiyH9PS5YUuVAFwaJLl1ikiXX0QWjI0jmgZQ==} engines: {node: '>=18.12.0'} peerDependencies: stylelint: ^16.0.0 dependencies: - stylelint: 16.2.1(typescript@5.4.3) + stylelint: 16.3.0(typescript@5.4.3) dev: true /stylelint-config-recommended@3.0.0(stylelint@13.13.1): @@ -10662,14 +10666,14 @@ packages: stylelint-config-recommended: 3.0.0(stylelint@13.13.1) dev: true - /stylelint-config-standard@36.0.0(stylelint@16.2.1): + /stylelint-config-standard@36.0.0(stylelint@16.3.0): resolution: {integrity: sha512-3Kjyq4d62bYFp/Aq8PMKDwlgUyPU4nacXsjDLWJdNPRUgpuxALu1KnlAHIj36cdtxViVhXexZij65yM0uNIHug==} engines: {node: '>=18.12.0'} peerDependencies: stylelint: ^16.1.0 dependencies: - stylelint: 16.2.1(typescript@5.4.3) - stylelint-config-recommended: 14.0.0(stylelint@16.2.1) + stylelint: 16.3.0(typescript@5.4.3) + stylelint-config-recommended: 14.0.0(stylelint@16.3.0) dev: true /stylelint-declaration-block-no-ignored-properties@2.8.0(stylelint@13.13.1): @@ -10681,17 +10685,17 @@ packages: stylelint: 13.13.1 dev: true - /stylelint-order@6.0.4(stylelint@16.2.1): + /stylelint-order@6.0.4(stylelint@16.3.0): resolution: {integrity: sha512-0UuKo4+s1hgQ/uAxlYU4h0o0HS4NiQDud0NAUNI0aa8FJdmYHA5ZZTFHiV5FpmE3071e9pZx5j0QpVJW5zOCUA==} peerDependencies: stylelint: ^14.0.0 || ^15.0.0 || ^16.0.1 dependencies: postcss: 8.4.38 postcss-sorting: 8.0.2(postcss@8.4.38) - stylelint: 16.2.1(typescript@5.4.3) + stylelint: 16.3.0(typescript@5.4.3) dev: true - /stylelint-prettier@5.0.0(prettier@3.2.5)(stylelint@16.2.1): + /stylelint-prettier@5.0.0(prettier@3.2.5)(stylelint@16.3.0): resolution: {integrity: sha512-RHfSlRJIsaVg5Br94gZVdWlz/rBTyQzZflNE6dXvSxt/GthWMY3gEHsWZEBaVGg7GM+XrtVSp4RznFlB7i0oyw==} engines: {node: '>=18.12.0'} peerDependencies: @@ -10700,7 +10704,7 @@ packages: dependencies: prettier: 3.2.5 prettier-linter-helpers: 1.0.0 - stylelint: 16.2.1(typescript@5.4.3) + stylelint: 16.3.0(typescript@5.4.3) dev: true /stylelint@13.13.1: @@ -10762,8 +10766,8 @@ packages: - supports-color dev: true - /stylelint@16.2.1(typescript@5.4.3): - resolution: {integrity: sha512-SfIMGFK+4n7XVAyv50CpVfcGYWG4v41y6xG7PqOgQSY8M/PgdK0SQbjWFblxjJZlN9jNq879mB4BCZHJRIJ1hA==} + /stylelint@16.3.0(typescript@5.4.3): + resolution: {integrity: sha512-hqC6xNTbQ5HRGQXfIW4HwXcx09raIFz4W4XFbraeqWqYRVVY/ibYvI0dsu0ORMQY8re2bpDdCAeIa2cm+QJ4Sw==} engines: {node: '>=18.12.0'} hasBin: true dependencies: @@ -10771,6 +10775,7 @@ packages: '@csstools/css-tokenizer': 2.2.4 '@csstools/media-query-list-parser': 2.1.9(@csstools/css-parser-algorithms@2.6.1)(@csstools/css-tokenizer@2.2.4) '@csstools/selector-specificity': 3.0.2(postcss-selector-parser@6.0.16) + '@dual-bundle/import-meta-resolve': 4.0.0 balanced-match: 2.0.0 colord: 2.9.3 cosmiconfig: 9.0.0(typescript@5.4.3) @@ -10787,7 +10792,7 @@ packages: ignore: 5.3.1 imurmurhash: 0.1.4 is-plain-object: 5.0.0 - known-css-properties: 0.29.0 + known-css-properties: 0.30.0 mathml-tag-names: 2.1.3 meow: 13.2.0 micromatch: 4.0.5 @@ -11421,7 +11426,7 @@ packages: engines: {node: '>= 10.0.0'} dev: true - /unocss@0.58.6(postcss@8.4.38)(vite@5.2.4): + /unocss@0.58.6(postcss@8.4.38)(vite@5.2.6): resolution: {integrity: sha512-HBstDtC6KKD5yCYh5hHpPdHGZai0B/iLlDwkOIK+xfQYrvl8tNBvKfRz3xgiaI5MJ+fLmEOxbfXQIjleU1A0iA==} engines: {node: '>=14'} peerDependencies: @@ -11433,7 +11438,7 @@ packages: vite: optional: true dependencies: - '@unocss/astro': 0.58.6(vite@5.2.4) + '@unocss/astro': 0.58.6(vite@5.2.6) '@unocss/cli': 0.58.6 '@unocss/core': 0.58.6 '@unocss/extractor-arbitrary-variants': 0.58.6 @@ -11452,8 +11457,8 @@ packages: '@unocss/transformer-compile-class': 0.58.6 '@unocss/transformer-directives': 0.58.6 '@unocss/transformer-variant-group': 0.58.6 - '@unocss/vite': 0.58.6(vite@5.2.4) - vite: 5.2.4(@types/node@20.11.30)(less@4.2.0) + '@unocss/vite': 0.58.6(vite@5.2.6) + vite: 5.2.6(@types/node@20.11.30)(less@4.2.0) transitivePeerDependencies: - postcss - rollup @@ -11570,7 +11575,7 @@ packages: vfile-message: 2.0.4 dev: true - /vite-plugin-checker@0.6.4(eslint@8.57.0)(stylelint@16.2.1)(typescript@5.4.3)(vite@5.2.4)(vue-tsc@1.8.27): + /vite-plugin-checker@0.6.4(eslint@8.57.0)(stylelint@16.3.0)(typescript@5.4.3)(vite@5.2.6)(vue-tsc@1.8.27): resolution: {integrity: sha512-2zKHH5oxr+ye43nReRbC2fny1nyARwhxdm0uNYp/ERy4YvU9iZpNOsueoi/luXw5gnpqRSvjcEPxXbS153O2wA==} engines: {node: '>=14.16'} peerDependencies: @@ -11612,10 +11617,10 @@ packages: npm-run-path: 4.0.1 semver: 7.6.0 strip-ansi: 6.0.1 - stylelint: 16.2.1(typescript@5.4.3) + stylelint: 16.3.0(typescript@5.4.3) tiny-invariant: 1.3.3 typescript: 5.4.3 - vite: 5.2.4(@types/node@20.11.30)(less@4.2.0) + vite: 5.2.6(@types/node@20.11.30)(less@4.2.0) vscode-languageclient: 7.0.0 vscode-languageserver: 7.0.0 vscode-languageserver-textdocument: 1.0.11 @@ -11623,7 +11628,7 @@ packages: vue-tsc: 1.8.27(typescript@5.4.3) dev: true - /vite-plugin-inspect@0.8.3(vite@5.2.4): + /vite-plugin-inspect@0.8.3(vite@5.2.6): resolution: {integrity: sha512-SBVzOIdP/kwe6hjkt7LSW4D0+REqqe58AumcnCfRNw4Kt3mbS9pEBkch+nupu2PBxv2tQi69EQHQ1ZA1vgB/Og==} engines: {node: '>=14'} peerDependencies: @@ -11642,13 +11647,13 @@ packages: perfect-debounce: 1.0.0 picocolors: 1.0.0 sirv: 2.0.4 - vite: 5.2.4(@types/node@20.11.30)(less@4.2.0) + vite: 5.2.6(@types/node@20.11.30)(less@4.2.0) transitivePeerDependencies: - rollup - supports-color dev: true - /vite-plugin-mkcert@1.17.5(vite@5.2.4): + /vite-plugin-mkcert@1.17.5(vite@5.2.6): resolution: {integrity: sha512-KKGY3iHx/9zb7ow8JJ+nLN2HiNIBuPBwj34fJ+jAJT89/8qfk7msO7G7qipR8VDEm9xMCys0xT11QOJbZcg3/Q==} engines: {node: '>=v16.7.0'} peerDependencies: @@ -11658,12 +11663,12 @@ packages: axios: 1.6.8(debug@4.3.4) debug: 4.3.4 picocolors: 1.0.0 - vite: 5.2.4(@types/node@20.11.30)(less@4.2.0) + vite: 5.2.6(@types/node@20.11.30)(less@4.2.0) transitivePeerDependencies: - supports-color dev: true - /vite-plugin-svg-icons@2.0.1(vite@5.2.4): + /vite-plugin-svg-icons@2.0.1(vite@5.2.6): resolution: {integrity: sha512-6ktD+DhV6Rz3VtedYvBKKVA2eXF+sAQVaKkKLDSqGUfnhqXl3bj5PPkVTl3VexfTuZy66PmINi8Q6eFnVfRUmA==} peerDependencies: vite: '>=2.0.0' @@ -11676,7 +11681,7 @@ packages: pathe: 0.2.0 svg-baker: 1.7.0 svgo: 2.8.0 - vite: 5.2.4(@types/node@20.11.30)(less@4.2.0) + vite: 5.2.6(@types/node@20.11.30)(less@4.2.0) transitivePeerDependencies: - supports-color dev: true @@ -11717,8 +11722,8 @@ packages: optionalDependencies: fsevents: 2.3.3 - /vite@5.2.4(@types/node@20.11.30)(less@4.2.0): - resolution: {integrity: sha512-vjFghvHWidBTinu5TCymJk/lRHlR5ljqB83yugr0HA1xspUPdOZHqbqDLnZ8f9/jINrtFHTCYYyIUi+o+Q5iyg==} + /vite@5.2.6(@types/node@20.11.30)(less@4.2.0): + resolution: {integrity: sha512-FPtnxFlSIKYjZ2eosBQamz4CbyrTizbZ3hnGJlh/wMtCrlp1Hah6AzBLjGI5I2urTfNnpovpHdrL6YRuBOPnCA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -12265,12 +12270,12 @@ packages: strict-event-emitter: 0.5.1 dev: true - file:packages/vite-plugin-tinymce-resource(vite@5.2.4): + file:packages/vite-plugin-tinymce-resource(vite@5.2.6): resolution: {directory: packages/vite-plugin-tinymce-resource, type: directory} id: file:packages/vite-plugin-tinymce-resource name: '@admin-pkg/vite-plugin-tinymce-resource' peerDependencies: vite: ^5.0.0 dependencies: - vite: 5.2.4(@types/node@20.11.30)(less@4.2.0) + vite: 5.2.6(@types/node@20.11.30)(less@4.2.0) dev: true diff --git a/src/components/core/dynamic-table/src/components/table-settings/fullscreen.vue b/src/components/core/dynamic-table/src/components/table-settings/fullscreen.vue new file mode 100644 index 000000000..59ae9dbb9 --- /dev/null +++ b/src/components/core/dynamic-table/src/components/table-settings/fullscreen.vue @@ -0,0 +1,37 @@ + + + + + + {{ isFullscreen ? '取消全屏' : '全屏' }} + + + + diff --git a/src/components/core/dynamic-table/src/components/table-settings/index.vue b/src/components/core/dynamic-table/src/components/table-settings/index.vue index 529f1df5a..add24a189 100644 --- a/src/components/core/dynamic-table/src/components/table-settings/index.vue +++ b/src/components/core/dynamic-table/src/components/table-settings/index.vue @@ -2,6 +2,7 @@ + @@ -13,4 +14,5 @@ import RefreshSetting from './refresh-setting.vue'; import ColumnSetting from './column-setting.vue'; import SearchSetting from './search-setting.vue'; + import Fullscreen from './fullscreen.vue'; diff --git a/src/components/core/dynamic-table/src/dynamic-table.vue b/src/components/core/dynamic-table/src/dynamic-table.vue index 8dfa5f4cb..85a975fec 100644 --- a/src/components/core/dynamic-table/src/dynamic-table.vue +++ b/src/components/core/dynamic-table/src/dynamic-table.vue @@ -1,55 +1,59 @@ - $emit('toggle-advanced', e)" - @submit="handleSubmit" - > - - - - - - - - - - - - + + $emit('toggle-advanced', e)" + @submit="handleSubmit" > - - + + - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -84,6 +88,8 @@ const { tableRef, tableData, + isFullscreen, + containerElRef, queryFormRef, editTableFormRef, getProps, @@ -96,7 +102,6 @@ tableMethods; // 控制编辑行 const editableHooks = useEditable({ props, state: tableState }); - /** 表格scroll */ const tableAction: TableActionType = { setProps, @@ -146,7 +151,7 @@ defineExpose(instance); - const tableProps = computed(() => { + const tableProps = computed(() => { const { getExpandOption } = tableMethods; return { ...getBindValues.value, diff --git a/src/components/core/dynamic-table/src/hooks/useColumns.ts b/src/components/core/dynamic-table/src/hooks/useColumns.ts index 9b4cf42d9..250a22405 100644 --- a/src/components/core/dynamic-table/src/hooks/useColumns.ts +++ b/src/components/core/dynamic-table/src/hooks/useColumns.ts @@ -38,6 +38,7 @@ export const useColumns = ({ state, methods, props, tableAction }: UseTableColum // 是否添加序号列 if (innerProps?.showIndex) { + // @ts-ignore columns.unshift({ dataIndex: ColumnKeyFlag.INDEX, title: '序号', diff --git a/src/components/core/dynamic-table/src/hooks/useScroll.ts b/src/components/core/dynamic-table/src/hooks/useScroll.ts index 576c876df..4065e92e1 100644 --- a/src/components/core/dynamic-table/src/hooks/useScroll.ts +++ b/src/components/core/dynamic-table/src/hooks/useScroll.ts @@ -1,9 +1,11 @@ -import { computed, getCurrentInstance, ref, onBeforeUnmount } from 'vue'; +import { computed, ref, type Ref } from 'vue'; import { debounce } from 'lodash-es'; +import { useMutationObserver, useResizeObserver } from '@vueuse/core'; import type { DynamicTableProps } from '../dynamic-table'; type UseScrollParams = { props: DynamicTableProps; + containerElRef: Ref; }; export type UseScrollType = ReturnType; @@ -19,8 +21,7 @@ export const getPositionTop = (node: HTMLElement) => { return top; // 所有的父元素top和 }; -export const useScroll = ({ props }: UseScrollParams) => { - const currIns = getCurrentInstance(); +export const useScroll = ({ props, containerElRef }: UseScrollParams) => { const scrollY = ref(); const scroll = computed(() => { @@ -31,25 +32,34 @@ export const useScroll = ({ props }: UseScrollParams) => { }); const getScrollY = debounce(() => { - if (!props.autoHeight) return; - const compRootEl = currIns?.proxy?.$el as HTMLDivElement; - const el = - compRootEl?.querySelector('.ant-table-body') || compRootEl?.querySelector('.ant-table-tbody'); - if (el) { - const y = document.documentElement.offsetHeight - getPositionTop(el as HTMLDivElement); - // 简单粗糙的实现 - scrollY.value = y - 30; + if (!props.autoHeight || !containerElRef.value) return; + let paginationHeight = 0; + const paginationEl = containerElRef.value.querySelector('.ant-pagination'); + if (paginationEl) { + const { offsetHeight } = paginationEl; + const { marginTop, marginBottom } = getComputedStyle(paginationEl); + paginationHeight = offsetHeight + parseInt(marginTop) + parseInt(marginBottom); } - // console.log('innerScroll.value', el, scrollY.value); - }); - - setTimeout(getScrollY); - window.addEventListener('resize', getScrollY); + const bodyEl = + containerElRef.value.querySelector('.ant-table-body') || + containerElRef.value.querySelector('.ant-table-tbody'); + if (bodyEl) { + const rootElHeight = document.documentElement.offsetHeight; + const posTopHeight = getPositionTop(bodyEl as HTMLDivElement); + const scrollbarHeight = bodyEl.offsetHeight - bodyEl.clientHeight; + const y = rootElHeight - posTopHeight - scrollbarHeight - paginationHeight - 8; + scrollY.value = y; + // console.log('innerScroll.value', rootElHeight, posTopHeight, paginationHeight, y); + } + }, 20); - onBeforeUnmount(() => { - window.removeEventListener('resize', getScrollY); + useMutationObserver(containerElRef, getScrollY, { + childList: true, + subtree: true, }); + useResizeObserver(document.documentElement, getScrollY); + return { scroll, }; diff --git a/src/components/core/dynamic-table/src/hooks/useTableForm.ts b/src/components/core/dynamic-table/src/hooks/useTableForm.ts index a9629200e..13ad34540 100644 --- a/src/components/core/dynamic-table/src/hooks/useTableForm.ts +++ b/src/components/core/dynamic-table/src/hooks/useTableForm.ts @@ -20,6 +20,7 @@ export function useTableForm({ tableState, slots, tableMethods }: UseTableFormCo const getFormProps = computed((): SchemaFormProps => { const { formProps } = unref(getProps); const { submitButtonOptions } = formProps || {}; + // @ts-ignore return { showAdvancedButton: true, layout: 'horizontal', diff --git a/src/components/core/dynamic-table/src/hooks/useTableMethods.ts b/src/components/core/dynamic-table/src/hooks/useTableMethods.ts index dd7888408..6d837c41e 100644 --- a/src/components/core/dynamic-table/src/hooks/useTableMethods.ts +++ b/src/components/core/dynamic-table/src/hooks/useTableMethods.ts @@ -52,7 +52,7 @@ export const useTableMethods = ({ state, props, emit }: UseTableMethodsContext) ); const setProps = (props: Partial) => { - innerPropsRef.value = { ...unref(innerPropsRef), ...props }; + Object.assign(innerPropsRef.value, props); }; /** diff --git a/src/components/core/dynamic-table/src/hooks/useTableState.ts b/src/components/core/dynamic-table/src/hooks/useTableState.ts index 4dd122c7d..70aab4b82 100644 --- a/src/components/core/dynamic-table/src/hooks/useTableState.ts +++ b/src/components/core/dynamic-table/src/hooks/useTableState.ts @@ -24,7 +24,6 @@ interface SearchState { export const useTableState = ({ props, slots }: UseTableStateParams) => { const { t } = useI18n(); - const { scroll } = useScroll({ props }); /** 表格实例 */ const tableRef = ref>(); /** 查询表单实例 */ @@ -34,11 +33,15 @@ export const useTableState = ({ props, slots }: UseTableStateParams) => { /** 表格数据 */ const tableData = ref([]); /** 内部属性 */ - const innerPropsRef = ref>(); + const innerPropsRef = ref>({}); /** 分页配置参数 */ const paginationRef = ref>(false); /** 表格加载 */ const loadingRef = ref(!!props.loading); + /** 表格是否全屏 */ + const isFullscreen = ref(false); + /** 动态表格 div 容器 */ + const containerElRef = ref(null); /** 编辑表单model */ const editFormModel = ref({}); /** 所有验证不通过的表单项 */ @@ -53,6 +56,8 @@ export const useTableState = ({ props, slots }: UseTableStateParams) => { filterInfo: {}, }); + const { scroll } = useScroll({ props, containerElRef }); + if (!Object.is(props.pagination, false)) { paginationRef.value = { current: 1, @@ -69,7 +74,7 @@ export const useTableState = ({ props, slots }: UseTableStateParams) => { } const getProps = computed(() => { - return { ...props, ...unref(innerPropsRef) }; + return Object.assign({}, props, unref(innerPropsRef)); }); const getBindValues = computed(() => { @@ -77,11 +82,11 @@ export const useTableState = ({ props, slots }: UseTableStateParams) => { let propsData: Recordable = { ...props, + scroll: { ...unref(scroll), ...props.scroll }, + pagination: props.pagination ?? unref(paginationRef), rowKey: props.rowKey ?? 'id', loading: props.loading ?? unref(loadingRef), - pagination: unref(paginationRef), tableLayout: props.tableLayout ?? 'fixed', - scroll: unref(scroll), }; if (slots.expandedRowRender) { propsData = omit(propsData, 'scroll'); @@ -109,10 +114,7 @@ export const useTableState = ({ props, slots }: UseTableStateParams) => { () => props.columns, (val) => { if (val) { - innerPropsRef.value = { - ...innerPropsRef.value, - columns: val, - }; + Object.assign(innerPropsRef.value, { columns: val }); } }, { @@ -125,6 +127,8 @@ export const useTableState = ({ props, slots }: UseTableStateParams) => { tableRef, editTableFormRef, loadingRef, + isFullscreen, + containerElRef, tableData, queryFormRef, innerPropsRef, diff --git a/src/enums/cacheEnum.ts b/src/enums/cacheEnum.ts index 77712f87a..9e6c59f2c 100644 --- a/src/enums/cacheEnum.ts +++ b/src/enums/cacheEnum.ts @@ -9,12 +9,3 @@ export const THEME_KEY = 'THEME__'; /** 用户信息 */ export const USER_INFO_KEY = 'USER__INFO__'; - -// role info key -export const ROLES_KEY = 'ROLES__KEY__'; -/** 是否锁屏 */ -export const IS_LOCKSCREEN = 'IS_LOCKSCREEN'; -/** 标签页 */ -export const TABS_ROUTES = 'TABS_ROUTES'; -/** 锁屏密码 */ -export const LOCKSCREEN_PWD = 'LOCKSCREEN_PWD'; diff --git a/src/layout/header/index.vue b/src/layout/header/index.vue index 7dc696cd7..69be42657 100644 --- a/src/layout/header/index.vue +++ b/src/layout/header/index.vue @@ -28,9 +28,6 @@ {{ userInfo.username }} - - {{ $t('routes.account.about') }} - {{ $t('routes.account.settings') }} diff --git a/src/layout/tabs/tabs-operator.vue b/src/layout/tabs/tabs-operator.vue index ea71ddabc..1ffb34c8f 100644 --- a/src/layout/tabs/tabs-operator.vue +++ b/src/layout/tabs/tabs-operator.vue @@ -9,7 +9,7 @@ ColumnWidthOutlined, MinusOutlined, } from '@ant-design/icons-vue'; - import { useRoute, type RouteLocationNormalized, useRouter } from 'vue-router'; + import { useRoute, useRouter, type RouteLocationNormalizedLoaded } from 'vue-router'; import { isFunction } from 'lodash-es'; import { message } from 'ant-design-vue'; import { REDIRECT_NAME } from '@/router/constant'; @@ -23,7 +23,7 @@ const props = defineProps({ tabItem: { - type: Object as PropType, + type: Object as PropType, required: true, }, isExtra: Boolean, @@ -85,8 +85,6 @@ /** 关闭全部 */ const closeAll = () => { - localStorage.removeItem('routes'); - // tabsViewMutations.closeAllTabs() tabsViewStore.closeAllTabs(); router.replace('/'); }; diff --git a/src/layout/tabs/tabs-view.vue b/src/layout/tabs/tabs-view.vue index 517233632..9c468e26f 100644 --- a/src/layout/tabs/tabs-view.vue +++ b/src/layout/tabs/tabs-view.vue @@ -8,7 +8,7 @@ @change="changePage" @edit="editTabItem" > - +