From d24459b0c834593fd04087e3e613da9410bb05b6 Mon Sep 17 00:00:00 2001 From: JB AUBREE Date: Mon, 28 Oct 2024 08:50:20 +0100 Subject: [PATCH] feat: add isLoading boolean and complete playground --- README.md | 5 +- playground/package.json | 3 + playground/src/App.vue | 65 +++- playground/src/main.ts | 9 +- playground/uno.config.ts | 19 ++ playground/vite.config.ts | 6 +- pnpm-lock.yaml | 613 ++++++++++++++++++++++++++++++++++++++ src/types.ts | 3 +- src/useFormValidation.ts | 7 +- 9 files changed, 716 insertions(+), 14 deletions(-) create mode 100644 playground/uno.config.ts diff --git a/README.md b/README.md index 3276772..4a4cd13 100644 --- a/README.md +++ b/README.md @@ -136,15 +136,16 @@ Returns an object containing the following properties: - `validate`: Function to validate the form. - `errors`: Reactive reference to the current validation errors. - `isValid`: Reactive reference indicating whether the form is valid. +- `isLoading`: Reactive reference indicating if the form validation is in progress. - `errorCount`: Reactive reference to the number of errors. - `clearErrors`: Function to clear validation errors. - `getErrorMessage`: Function to get the error message for a specific field. - `focusFirstErroredInput`: Function to focus the first input with an error. - `focusInput`: Function to focus a specific input. -## Example Tests +## Example -Refer to the `useFormValidation.test.ts` file for comprehensive test cases that demonstrate the functionality and usage of the composable. +Refer to the `playground` folder for comprehensive use cases that demonstrate the functionality and usage of the composable. ## License diff --git a/playground/package.json b/playground/package.json index 46b0b48..038242e 100644 --- a/playground/package.json +++ b/playground/package.json @@ -14,10 +14,13 @@ "vue": "^3.5.12" }, "devDependencies": { + "@iconify-json/ph": "^1.1.11", "@types/node": "^20.16.11", "@vitejs/plugin-vue": "^5.1.4", "@vue/tsconfig": "^0.5.1", "typescript": "~5.5.4", + "unocss": "^0.63.6", + "unuse-ui": "^0.1.24", "vite": "^5.4.8", "vue-tsc": "^2.1.6", "vue-use-form-validation": "workspace:*", diff --git a/playground/src/App.vue b/playground/src/App.vue index e2c49b3..056dc29 100644 --- a/playground/src/App.vue +++ b/playground/src/App.vue @@ -1,23 +1,74 @@ diff --git a/playground/src/main.ts b/playground/src/main.ts index 912d54f..799a2fa 100644 --- a/playground/src/main.ts +++ b/playground/src/main.ts @@ -1,5 +1,12 @@ +// @unocss-include +import { UnuseUI } from 'unuse-ui' import { createApp } from 'vue' import App from './App.vue' -createApp(App).mount('#app') +import 'unuse-ui/dist/style.css' +import 'uno.css' + +createApp(App) + .use(UnuseUI) + .mount('#app') diff --git a/playground/uno.config.ts b/playground/uno.config.ts new file mode 100644 index 0000000..8e831df --- /dev/null +++ b/playground/uno.config.ts @@ -0,0 +1,19 @@ +import { defineConfig, presetIcons, presetUno } from 'unocss' +import { presetUnuse } from 'unuse-ui' + +export default defineConfig({ + presets: [ + presetIcons({ + prefix: 'icon-', + scale: 1, + warn: true, + }), + presetUno(), + presetUnuse(), + ], + content: { + pipeline: { + include: [/.*\/unuse-ui\.js(.*)$/, './**/*.vue'], + }, + }, +}) diff --git a/playground/vite.config.ts b/playground/vite.config.ts index e97bd5e..aadf343 100644 --- a/playground/vite.config.ts +++ b/playground/vite.config.ts @@ -1,8 +1,10 @@ -import vue from '@vitejs/plugin-vue' +import Vue from '@vitejs/plugin-vue' +import Unocss from 'unocss/vite' import { defineConfig } from 'vite' export default defineConfig({ plugins: [ - vue(), + Vue(), + Unocss(), ], }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index af53a5f..48eccbb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -82,6 +82,9 @@ importers: specifier: ^3.5.12 version: 3.5.12(typescript@5.5.4) devDependencies: + '@iconify-json/ph': + specifier: ^1.1.11 + version: 1.2.1 '@types/node': specifier: ^20.16.11 version: 20.16.13 @@ -94,6 +97,12 @@ importers: typescript: specifier: ~5.5.4 version: 5.5.4 + unocss: + specifier: ^0.63.6 + version: 0.63.6(postcss@8.4.47)(rollup@4.21.2)(typescript@5.5.4)(vite@5.4.9(@types/node@20.16.13)) + unuse-ui: + specifier: ^0.1.24 + version: 0.1.24(typescript@5.5.4) vite: specifier: ^5.4.8 version: 5.4.9(@types/node@20.16.13) @@ -893,6 +902,12 @@ packages: '@hapi/topo@5.1.0': resolution: {integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==} + '@headlessui/vue@1.7.23': + resolution: {integrity: sha512-JzdCNqurrtuu0YW6QaDtR2PIYCKPUWq28csDyMvN4zmGccmE7lz40Is6hc3LA4HFeCI7sekZ/PQMTNmn9I/4Wg==} + engines: {node: '>=10'} + peerDependencies: + vue: ^3.2.0 + '@humanfs/core@0.19.0': resolution: {integrity: sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==} engines: {node: '>=18.18.0'} @@ -909,6 +924,15 @@ packages: resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} engines: {node: '>=18.18'} + '@iconify-json/ph@1.2.1': + resolution: {integrity: sha512-x0DNfwWrS18dbsBYOq3XGiZnGz4CgRyC+YSl/TZvMQiKhIUl1woWqUbMYqqfMNUBzjyk7ulvaRovpRsIlqIf8g==} + + '@iconify/types@2.0.0': + resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} + + '@iconify/utils@2.1.33': + resolution: {integrity: sha512-jP9h6v/g0BIZx0p7XGJJVtkVnydtbgTgt9mVNcGDYwaa7UhdHdI9dvoq+gKj9sijMSJKxUPEG2JyjsgXjxL7Kw==} + '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -962,6 +986,12 @@ packages: resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + '@polka/url@1.0.0-next.28': + resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==} + + '@popperjs/core@2.11.8': + resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} + '@rollup/plugin-alias@5.1.1': resolution: {integrity: sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==} engines: {node: '>=14.0.0'} @@ -1111,6 +1141,14 @@ packages: peerDependencies: eslint: '>=8.40.0' + '@tanstack/virtual-core@3.10.8': + resolution: {integrity: sha512-PBu00mtt95jbKFi6Llk9aik8bnR3tR/oQP1o3TSi+iG//+Q2RTIzCEgKkHG8BB86kxMNW6O8wku+Lmi+QFR6jA==} + + '@tanstack/vue-virtual@3.10.8': + resolution: {integrity: sha512-DB5QA8c/LfqOqIUCpSs3RdOTVroRRdqeHMqBkYrcashSZtOzIv8xbiqHgg7RYxDfkH5F3Y+e0MkuuyGNDVB0BQ==} + peerDependencies: + vue: ^2.7.0 || ^3.0.0 + '@trysound/sax@0.2.0': resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==} engines: {node: '>=10.13.0'} @@ -1148,6 +1186,9 @@ packages: '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} + '@types/web-bluetooth@0.0.20': + resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} + '@typescript-eslint/eslint-plugin@8.9.0': resolution: {integrity: sha512-Y1n621OCy4m7/vTXNlCbMVp87zSd7NH0L9cXD8aIpOaNlzeWxIK4+Q19A68gSmTNRZn92UjocVUWDthGxtqHFg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1232,6 +1273,103 @@ packages: resolution: {integrity: sha512-Ht4y38ubk4L5/U8xKUBfKNYGmvKvA1CANoxiTRMM+tOLk3lbF3DvzZCxJCRSE+2GdCMSh6zq9VZJc3asc1XuAA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@unhead/dom@1.11.10': + resolution: {integrity: sha512-nL1mdRzYVATZIYauK15zOI2YyM3YxCLfhbTqljEjDFJeiJUzTTi+a//5FHiUk84ewSucFnrwHNey/pEXFlyY1A==} + + '@unhead/schema@1.11.10': + resolution: {integrity: sha512-lXh7cm5XtFaw3gc+ZVXTSfIHXiBpAywbjtEiOsz5TR4GxOjj2rtfOAl4C3Difk1yupP6L2otYmOZdn/i8EXSJg==} + + '@unhead/shared@1.11.10': + resolution: {integrity: sha512-YQgZcOyo1id7drUeDPGn0R83pirvIcV+Car3/m7ZfCLL1Syab6uXmRckVRd69yVbUL4eirIm9IzzmvzM/OuGuw==} + + '@unhead/ssr@1.11.10': + resolution: {integrity: sha512-tj5zeJtCbSktNNqsdL+6h6OIY7dYO+2HSiC1VbofGYsoG7nDNXMypkrW/cTMqZVr5/gWhKaUgFQALjm28CflYg==} + + '@unhead/vue@1.11.10': + resolution: {integrity: sha512-v6ddp4YEQCNILhYrx37Yt0GKRIFeTrb3VSmTbjh+URT+ua1mwgmNFTfl2ZldtTtri3tEkwSG1/5wLRq20ma70g==} + peerDependencies: + vue: '>=2.7 || >=3' + + '@unocss/astro@0.63.6': + resolution: {integrity: sha512-5Fjlv6dpQo6o2PUAcEv8p24G8rn8Op79xLFofq2V+iA/Q32G9/UsxTLOpj+yc+q0YdJrFfDCT2X/3pvVY8Db5g==} + peerDependencies: + vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 + peerDependenciesMeta: + vite: + optional: true + + '@unocss/cli@0.63.6': + resolution: {integrity: sha512-OZb8hO0x4nCJjFd3Gq3km78YnyMAdq282D+BLiDE6IhQ5WHCVL7fyhfgIVL6xwxISDVxiyITwNb72ky0MEutPg==} + engines: {node: '>=14'} + hasBin: true + + '@unocss/config@0.63.6': + resolution: {integrity: sha512-+4Lt5uTwRgu1z7vhOUzDf+mL+BQYdaa/Z8NMT2Fiqb37tcjEKvmwaUHdfE22Vif1luDgC6xqFsn6qqFtOxhoWQ==} + engines: {node: '>=14'} + + '@unocss/core@0.63.6': + resolution: {integrity: sha512-Q4QPgJ271Up89+vIqqOKgtdCKkFpHqvHN8W1LUlKPqtYnOvVYaOIVNAZowaIdEhPuc83yLc6Tg2+7riK18QKEw==} + + '@unocss/extractor-arbitrary-variants@0.63.6': + resolution: {integrity: sha512-HJX0oAa9uzwKYoU8CoJdP1gxjuqFmOLxyZmITjStAmZNZpIxlz2wz4VrHmqml2dkvx/mifGGGc/GxZpQ36D12Q==} + + '@unocss/inspector@0.63.6': + resolution: {integrity: sha512-DQDJnhtzdHIQXD2vCdj5ytFnHfQCWJGPmrHJHXxzkTYn8nIovV1roVl1ITLxkDIIYK9bdYneg2imQN5JCZhHmQ==} + + '@unocss/postcss@0.63.6': + resolution: {integrity: sha512-XI6U1jMwbQoSHVWpZZu3Cxp3t1PVj5VOj+IYtz7xmcWP9GVK+eyETo/xyB0l4muD4emXfSrhNDrFYzSyIyF5cg==} + engines: {node: '>=14'} + peerDependencies: + postcss: ^8.4.21 + + '@unocss/preset-attributify@0.63.6': + resolution: {integrity: sha512-sHH17mfl/THHLxCLAHqPdUniCNMFjAxBHFDZYgGi83azuarF2evI5Mtc3Qsj3nzoSQwTPmK2VY3XYUUrpPDGWQ==} + + '@unocss/preset-icons@0.63.6': + resolution: {integrity: sha512-fRU44wXABnMPT/9zhKBNSUeDJlOxJhUJP9W3FSRnc+ktjAifJIj0xpUKtEqxL46QMq825Bsj2yDSquzP+XYGnQ==} + + '@unocss/preset-mini@0.63.6': + resolution: {integrity: sha512-pZDZbSuxabHSwPIy3zCgQ4MNdVCSHvOvZecreH+v96R1oOhquiwU8WiSbkxvZiKiLQJd7JUVW87E1pAzr5ZGGQ==} + + '@unocss/preset-tagify@0.63.6': + resolution: {integrity: sha512-3lKhk4MW3RqJBwIvBXHj0H0/kHkFlKtCIBQFiBcCJh8TXOID8IZ0iVjuGwdlk63VTizI/wnsNDOVpj6YcjRRlw==} + + '@unocss/preset-typography@0.63.6': + resolution: {integrity: sha512-AXmBVnbV54gUIv5kbywjZek9ZlKRwJfBDVMtWOcLOjN3AHirGx1W2oq2UzNkfYZ2leof/Y2BocxeTwGCCRhqDQ==} + + '@unocss/preset-uno@0.63.6': + resolution: {integrity: sha512-67PbHyVgAe9Rz0Rhyl3zBibFuGmqQMRPMkRjNYrwmmtNydpQYsXbfnDs0p8mZFp6uO2o3Jkh7urqEtixHHvq0Q==} + + '@unocss/preset-web-fonts@0.63.6': + resolution: {integrity: sha512-ko1aHDax0u5CQi1BXggv6uW5Vq/LQRWwzOxqBFTh1JlGHPZTw4CdVJkYnlpt3WEW+FPUzZYjhKmMmQY7KtOTng==} + + '@unocss/preset-wind@0.63.6': + resolution: {integrity: sha512-W3oZ2TXSqStNE+X++kcspRTF2Szu2ej6NW5Kiyy6WQn/+ZD77AF4VtvzHtzFVZ2QKpEIovGBpU5tywooHbB7hw==} + + '@unocss/reset@0.63.6': + resolution: {integrity: sha512-gq73RSZj54MOloqrivkoMPXCqNG2WpIyBT1AYlF76uKxEEbUD41E8uBUhLSKs7gFgF01yQJLRaIuyN1yw09pbQ==} + + '@unocss/rule-utils@0.63.6': + resolution: {integrity: sha512-moeDEq5d9mB8gSYeoqHMkXWWekaFFdhg7QCuwwCbxCc+NPMOgGkmfAoafz+y2tdvK7pEuT191RWOiHQ0MkA5oQ==} + engines: {node: '>=14'} + + '@unocss/transformer-attributify-jsx@0.63.6': + resolution: {integrity: sha512-/RU09MF+hJK7cFbLJ+8vloCGyhn6Oys8R6gey0auB0+nw/ucUXoLQKWgUqo9taQlLuYOiehdkYjQSdWn5lyA/Q==} + + '@unocss/transformer-compile-class@0.63.6': + resolution: {integrity: sha512-zzAqs8adnTUOLA88RgcToadcrz9gjxrZk6IrcmMqMmWqk0MOWNQHIN0RzKa/yaw4QhO2xuGyIz4/WHyXuCXMQg==} + + '@unocss/transformer-directives@0.63.6': + resolution: {integrity: sha512-XcNOwLRbfrJSU6YXyLgiMzAigSzjIdvHwS3lLCZ2n6DWuLmTuXBfvVtRxeJ+aflNkhpQNKONCClC4s6I2r53uw==} + + '@unocss/transformer-variant-group@0.63.6': + resolution: {integrity: sha512-ebYSjZnZrtcJYjmAEDwGVwPuaQ9EVWKNDDJFFSusP8k/6PjJoHDh0qkj+hdPPDhYn81yzJQalU1eSUSlfC30VA==} + + '@unocss/vite@0.63.6': + resolution: {integrity: sha512-gxK3gtvYQH5S/qtuvsY4M0S+KJPZnYrOQI/Gopufx+b2qgmwZ/TSAe66gWeKYfe3DfQsmA3PPh/GXpkK+/FnHg==} + peerDependencies: + vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 + '@vitejs/plugin-vue@5.1.4': resolution: {integrity: sha512-N2XSI2n3sQqp5w7Y/AN/L2XDjBIRGqXko+eDp42sydYSBeJuSm5a1sLf8zakmo8u7tA8NmBgoDLA1HeOESjp9A==} engines: {node: ^18.0.0 || >=20.0.0} @@ -1343,6 +1481,20 @@ packages: '@vue/tsconfig@0.5.1': resolution: {integrity: sha512-VcZK7MvpjuTPx2w6blwnwZAu5/LgBUtejFOi3pPGQFXQN5Ela03FUtd2Qtg4yWGGissVL0dr6Ro1LfOFh+PCuQ==} + '@vueuse/core@10.11.1': + resolution: {integrity: sha512-guoy26JQktXPcz+0n3GukWIy/JDNKti9v6VEMu6kV2sYBsWuGiTU8OWdg+ADfUbHg3/3DlqySDe7JmdHrktiww==} + + '@vueuse/head@2.0.0': + resolution: {integrity: sha512-ykdOxTGs95xjD4WXE4na/umxZea2Itl0GWBILas+O4oqS7eXIods38INvk3XkJKjqMdWPcpCyLX/DioLQxU1KA==} + peerDependencies: + vue: '>=2.7 || >=3' + + '@vueuse/metadata@10.11.1': + resolution: {integrity: sha512-IGa5FXd003Ug1qAZmyE8wF3sJ81xGLSqTqtQ6jaVfkeZ4i5kS2mwQF61yhVqojRnenVew5PldLyRgvdl4YYuSw==} + + '@vueuse/shared@10.11.1': + resolution: {integrity: sha512-LHpC8711VFZlDaYUXEBbFBCQ7GS3dVU9mjOhhMhXP6txTV4EhYQg/KGnQuvt/sPAtoUKq7VVUnL6mVtFoL42sA==} + acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -1436,6 +1588,12 @@ packages: engines: {node: '>=10'} hasBin: true + bundle-require@5.0.0: + resolution: {integrity: sha512-GuziW3fSSmopcx4KRymQEJVbZUfqlCqcq7dvs6TYwKRZiegK/2buMxQTPs6MGlNv50wms1699qYO54R8XfRX4w==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + peerDependencies: + esbuild: '>=0.18' + c12@1.11.2: resolution: {integrity: sha512-oBs8a4uvSDO9dm8b7OCFW7+dgtVrwmwnrVXYzLm43ta7ep2jCn/0MhoUFygIWtxhyy6+/MG7/agvpY0U1Iemew==} peerDependencies: @@ -1598,6 +1756,10 @@ packages: resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} + css-tree@3.0.0: + resolution: {integrity: sha512-o88DVQ6GzsABn1+6+zo2ct801dBO5OASVyxbbvA2W20ue2puSh/VOuqUj90eUeMSX/xqGqBmOKiRQN7tJOuBXw==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} + css-what@6.1.0: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} @@ -1704,6 +1866,9 @@ packages: resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} engines: {node: '>=12'} + duplexer@0.1.2: + resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} + eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -2120,6 +2285,10 @@ packages: graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + gzip-size@6.0.0: + resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==} + engines: {node: '>=10'} + happy-dom@15.7.4: resolution: {integrity: sha512-r1vadDYGMtsHAAsqhDuk4IpPvr6N8MGKy5ntBo7tSdim+pWDxus2PNqOcOt8LuDZ4t3KJHE+gCuzupcx/GKnyQ==} engines: {node: '>=18.0.0'} @@ -2161,6 +2330,9 @@ packages: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} + importx@0.4.4: + resolution: {integrity: sha512-Lo1pukzAREqrBnnHC+tj+lreMTAvyxtkKsMxLY8H15M/bvLl54p3YuoTI70Tz7Il0AsgSlD7Lrk/FaApRcBL7w==} + imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} @@ -2250,6 +2422,10 @@ packages: resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} hasBin: true + jiti@2.0.0-beta.3: + resolution: {integrity: sha512-pmfRbVRs/7khFrSAYnSiJ8C0D5GvzkE4Ey2pAvUcJsw1ly/p+7ut27jbJrjY79BpAJQJ4gXYFtK6d1Aub+9baQ==} + hasBin: true + jiti@2.3.3: resolution: {integrity: sha512-EX4oNDwcXSivPrw2qKH2LB5PoFxEvgtv2JgwW0bU858HoLQ+kutSvjLMUqBd0PeJYEinLWhoI9Ol0eYMqj/wNQ==} hasBin: true @@ -2308,6 +2484,9 @@ packages: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} + kolorist@1.8.0: + resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==} + levn@0.4.1: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} @@ -2328,6 +2507,10 @@ packages: resolution: {integrity: sha512-opevsywziHd3zHCVQGAj8zu+Z3yHNkkoYhWIGnq54RrCVwLz0MozotJEDnKsIBLvkfLGN6BLOyAeRrYI0pKA4g==} engines: {node: '>=18.0.0'} + load-tsconfig@0.2.5: + resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + local-pkg@0.5.0: resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} engines: {node: '>=14'} @@ -2340,6 +2523,9 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} + lodash-es@4.17.21: + resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} + lodash.memoize@4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} @@ -2420,6 +2606,9 @@ packages: mdn-data@2.0.30: resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} + mdn-data@2.10.0: + resolution: {integrity: sha512-qq7C3EtK3yJXMwz1zAab65pjl+UhohqMOctTgcqjLOWABqmwj+me02LSsCuEUxnst9X1lCBpoE0WArGKgdGDzw==} + merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -2584,6 +2773,10 @@ packages: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} + mrmime@2.0.0: + resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==} + engines: {node: '>=10'} + ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} @@ -2633,6 +2826,9 @@ packages: engines: {node: ^14.16.0 || >=16.10.0} hasBin: true + ofetch@1.4.1: + resolution: {integrity: sha512-QZj2DfGplQAr2oj9KzceK9Hwz6Whxazmn85yYeVuS3u9XTMOGMRx0kO95MQ+vLsj/S/NwBDMMLU5hpxvI6Tklw==} + ohash@1.1.3: resolution: {integrity: sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==} @@ -3077,6 +3273,10 @@ packages: resolution: {integrity: sha512-tgqwPUMDcNDhuf1Xf6KTUsyeqGdgKMhzaH4PAZZuzguOgTl5uuyeYe/8mWgAr6IBxB5V06uqEf6Dy37gIWDtDg==} hasBin: true + sirv@2.0.4: + resolution: {integrity: sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==} + engines: {node: '>= 10'} + sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -3249,6 +3449,10 @@ packages: toposort@2.0.2: resolution: {integrity: sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==} + totalist@3.0.1: + resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} + engines: {node: '>=6'} + ts-api-utils@1.3.0: resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} engines: {node: '>=16'} @@ -3312,9 +3516,15 @@ packages: typescript: optional: true + unconfig@0.5.5: + resolution: {integrity: sha512-VQZ5PT9HDX+qag0XdgQi8tJepPhXiR/yVOkn707gJDKo31lGjRilPREiQJ9Z6zd/Ugpv6ZvO5VxVIcatldYcNQ==} + undici-types@6.19.8: resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + unhead@1.11.10: + resolution: {integrity: sha512-hypXrAI47wE3wIhkze0RMPGAWcoo45Q1+XzdqLD/OnTCzjFXQrpuE4zBy8JRexyrqp+Ud2+nFTUNf/mjfFSymw==} + unist-util-is@6.0.0: resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} @@ -3327,10 +3537,25 @@ packages: unist-util-visit@5.0.0: resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==} + unocss@0.63.6: + resolution: {integrity: sha512-OKJJKEFWVz+Lsf3JdOgRiRtL+QOUQRBov89taUcCPFPZtrhP6pPVFCZHD9qMvY4IChMX7dzalQax3ZXJ3hbtkQ==} + engines: {node: '>=14'} + peerDependencies: + '@unocss/webpack': 0.63.6 + vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 + peerDependenciesMeta: + '@unocss/webpack': + optional: true + vite: + optional: true + untyped@1.5.1: resolution: {integrity: sha512-reBOnkJBFfBZ8pCKaeHgfZLcehXtM6UTxc+vqs1JvCps0c4amLNp3fhdGBZwYp+VLyoY9n3X5KOP7lCyWBUX9A==} hasBin: true + unuse-ui@0.1.24: + resolution: {integrity: sha512-k9xBM9HdmGQuNH9HE18pdL0dKCDA+vo1e8obh5jOYV3vJO17SHrpAvARt2+KsP6M3gWMRsVb4LyPn08/tlVdtA==} + update-browserslist-db@1.1.1: resolution: {integrity: sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==} hasBin: true @@ -3418,12 +3643,26 @@ packages: vscode-uri@3.0.8: resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==} + vue-demi@0.14.10: + resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==} + engines: {node: '>=12'} + hasBin: true + peerDependencies: + '@vue/composition-api': ^1.0.0-rc.1 + vue: ^3.0.0-0 || ^2.6.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + vue-eslint-parser@9.4.3: resolution: {integrity: sha512-2rYRLWlIpaiN8xbPiDyXZXRgLGOtWxERV7ND5fFAv5qo1D2N9Fu9MNajBNc6o13lZ+24DAWCkQCvj4klgmcITg==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0' + vue-flow-layout@0.0.5: + resolution: {integrity: sha512-lZlqQ/Se1trGMtBMneZDWaiQiQBuxU8ivZ+KpJMem5zKROFpzuPq9KqyWABbSYbxq0qhqZs1I4DBwrY041rtOA==} + vue-tsc@2.1.6: resolution: {integrity: sha512-f98dyZp5FOukcYmbFpuSCJ4Z0vHSOSmxGttZJCsFeX0M4w/Rsq0s4uKXjcSRsZqsRgQa6z7SfuO+y0HVICE57Q==} hasBin: true @@ -3513,6 +3752,9 @@ packages: yup@1.4.0: resolution: {integrity: sha512-wPbgkJRCqIf+OHyiTBQoJiP5PFuAXaWiJK6AmYkzQAh5/c2K9hzSApBZG5wV9KoKSePF7sAxmNSvh/13YHkFDg==} + zhead@2.2.4: + resolution: {integrity: sha512-8F0OI5dpWIA5IGG5NHUg9staDwz/ZPxZtvGVf01j7vHqSyZ0raHY+78atOVxRqb73AotX22uV1pXt3gYSstGag==} + zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} @@ -4081,6 +4323,11 @@ snapshots: dependencies: '@hapi/hoek': 9.3.0 + '@headlessui/vue@1.7.23(vue@3.5.12(typescript@5.5.4))': + dependencies: + '@tanstack/vue-virtual': 3.10.8(vue@3.5.12(typescript@5.5.4)) + vue: 3.5.12(typescript@5.5.4) + '@humanfs/core@0.19.0': {} '@humanfs/node@0.16.5': @@ -4092,6 +4339,24 @@ snapshots: '@humanwhocodes/retry@0.3.1': {} + '@iconify-json/ph@1.2.1': + dependencies: + '@iconify/types': 2.0.0 + + '@iconify/types@2.0.0': {} + + '@iconify/utils@2.1.33': + dependencies: + '@antfu/install-pkg': 0.4.1 + '@antfu/utils': 0.7.10 + '@iconify/types': 2.0.0 + debug: 4.3.6 + kolorist: 1.8.0 + local-pkg: 0.5.0 + mlly: 1.7.2 + transitivePeerDependencies: + - supports-color + '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 @@ -4146,6 +4411,10 @@ snapshots: '@pkgr/core@0.1.1': {} + '@polka/url@1.0.0-next.28': {} + + '@popperjs/core@2.11.8': {} + '@rollup/plugin-alias@5.1.1(rollup@3.29.5)': optionalDependencies: rollup: 3.29.5 @@ -4192,6 +4461,14 @@ snapshots: optionalDependencies: rollup: 3.29.5 + '@rollup/pluginutils@5.1.2(rollup@4.21.2)': + dependencies: + '@types/estree': 1.0.5 + estree-walker: 2.0.2 + picomatch: 2.3.1 + optionalDependencies: + rollup: 4.21.2 + '@rollup/rollup-android-arm-eabi@4.21.2': optional: true @@ -4260,6 +4537,13 @@ snapshots: - supports-color - typescript + '@tanstack/virtual-core@3.10.8': {} + + '@tanstack/vue-virtual@3.10.8(vue@3.5.12(typescript@5.5.4))': + dependencies: + '@tanstack/virtual-core': 3.10.8 + vue: 3.5.12(typescript@5.5.4) + '@trysound/sax@0.2.0': {} '@types/debug@4.1.12': @@ -4292,6 +4576,8 @@ snapshots: '@types/unist@3.0.3': {} + '@types/web-bluetooth@0.0.20': {} + '@typescript-eslint/eslint-plugin@8.9.0(@typescript-eslint/parser@8.9.0(eslint@9.12.0(jiti@2.3.3))(typescript@5.6.3))(eslint@9.12.0(jiti@2.3.3))(typescript@5.6.3)': dependencies: '@eslint-community/regexpp': 4.11.0 @@ -4411,6 +4697,185 @@ snapshots: '@typescript-eslint/types': 8.9.0 eslint-visitor-keys: 3.4.3 + '@unhead/dom@1.11.10': + dependencies: + '@unhead/schema': 1.11.10 + '@unhead/shared': 1.11.10 + + '@unhead/schema@1.11.10': + dependencies: + hookable: 5.5.3 + zhead: 2.2.4 + + '@unhead/shared@1.11.10': + dependencies: + '@unhead/schema': 1.11.10 + + '@unhead/ssr@1.11.10': + dependencies: + '@unhead/schema': 1.11.10 + '@unhead/shared': 1.11.10 + + '@unhead/vue@1.11.10(vue@3.5.12(typescript@5.5.4))': + dependencies: + '@unhead/schema': 1.11.10 + '@unhead/shared': 1.11.10 + defu: 6.1.4 + hookable: 5.5.3 + unhead: 1.11.10 + vue: 3.5.12(typescript@5.5.4) + + '@unocss/astro@0.63.6(rollup@4.21.2)(typescript@5.5.4)(vite@5.4.9(@types/node@20.16.13))': + dependencies: + '@unocss/core': 0.63.6 + '@unocss/reset': 0.63.6 + '@unocss/vite': 0.63.6(rollup@4.21.2)(typescript@5.5.4)(vite@5.4.9(@types/node@20.16.13)) + optionalDependencies: + vite: 5.4.9(@types/node@20.16.13) + transitivePeerDependencies: + - rollup + - supports-color + - typescript + + '@unocss/cli@0.63.6(rollup@4.21.2)': + dependencies: + '@ampproject/remapping': 2.3.0 + '@rollup/pluginutils': 5.1.2(rollup@4.21.2) + '@unocss/config': 0.63.6 + '@unocss/core': 0.63.6 + '@unocss/preset-uno': 0.63.6 + cac: 6.7.14 + chokidar: 3.6.0 + colorette: 2.0.20 + consola: 3.2.3 + magic-string: 0.30.12 + pathe: 1.1.2 + perfect-debounce: 1.0.0 + tinyglobby: 0.2.9 + transitivePeerDependencies: + - rollup + - supports-color + + '@unocss/config@0.63.6': + dependencies: + '@unocss/core': 0.63.6 + unconfig: 0.5.5 + transitivePeerDependencies: + - supports-color + + '@unocss/core@0.63.6': {} + + '@unocss/extractor-arbitrary-variants@0.63.6': + dependencies: + '@unocss/core': 0.63.6 + + '@unocss/inspector@0.63.6(typescript@5.5.4)': + dependencies: + '@unocss/core': 0.63.6 + '@unocss/rule-utils': 0.63.6 + gzip-size: 6.0.0 + sirv: 2.0.4 + vue-flow-layout: 0.0.5(typescript@5.5.4) + transitivePeerDependencies: + - typescript + + '@unocss/postcss@0.63.6(postcss@8.4.47)': + dependencies: + '@unocss/config': 0.63.6 + '@unocss/core': 0.63.6 + '@unocss/rule-utils': 0.63.6 + css-tree: 3.0.0 + postcss: 8.4.47 + tinyglobby: 0.2.9 + transitivePeerDependencies: + - supports-color + + '@unocss/preset-attributify@0.63.6': + dependencies: + '@unocss/core': 0.63.6 + + '@unocss/preset-icons@0.63.6': + dependencies: + '@iconify/utils': 2.1.33 + '@unocss/core': 0.63.6 + ofetch: 1.4.1 + transitivePeerDependencies: + - supports-color + + '@unocss/preset-mini@0.63.6': + dependencies: + '@unocss/core': 0.63.6 + '@unocss/extractor-arbitrary-variants': 0.63.6 + '@unocss/rule-utils': 0.63.6 + + '@unocss/preset-tagify@0.63.6': + dependencies: + '@unocss/core': 0.63.6 + + '@unocss/preset-typography@0.63.6': + dependencies: + '@unocss/core': 0.63.6 + '@unocss/preset-mini': 0.63.6 + + '@unocss/preset-uno@0.63.6': + dependencies: + '@unocss/core': 0.63.6 + '@unocss/preset-mini': 0.63.6 + '@unocss/preset-wind': 0.63.6 + '@unocss/rule-utils': 0.63.6 + + '@unocss/preset-web-fonts@0.63.6': + dependencies: + '@unocss/core': 0.63.6 + ofetch: 1.4.1 + + '@unocss/preset-wind@0.63.6': + dependencies: + '@unocss/core': 0.63.6 + '@unocss/preset-mini': 0.63.6 + '@unocss/rule-utils': 0.63.6 + + '@unocss/reset@0.63.6': {} + + '@unocss/rule-utils@0.63.6': + dependencies: + '@unocss/core': 0.63.6 + magic-string: 0.30.12 + + '@unocss/transformer-attributify-jsx@0.63.6': + dependencies: + '@unocss/core': 0.63.6 + + '@unocss/transformer-compile-class@0.63.6': + dependencies: + '@unocss/core': 0.63.6 + + '@unocss/transformer-directives@0.63.6': + dependencies: + '@unocss/core': 0.63.6 + '@unocss/rule-utils': 0.63.6 + css-tree: 3.0.0 + + '@unocss/transformer-variant-group@0.63.6': + dependencies: + '@unocss/core': 0.63.6 + + '@unocss/vite@0.63.6(rollup@4.21.2)(typescript@5.5.4)(vite@5.4.9(@types/node@20.16.13))': + dependencies: + '@ampproject/remapping': 2.3.0 + '@rollup/pluginutils': 5.1.2(rollup@4.21.2) + '@unocss/config': 0.63.6 + '@unocss/core': 0.63.6 + '@unocss/inspector': 0.63.6(typescript@5.5.4) + chokidar: 3.6.0 + magic-string: 0.30.12 + tinyglobby: 0.2.9 + vite: 5.4.9(@types/node@20.16.13) + transitivePeerDependencies: + - rollup + - supports-color + - typescript + '@vitejs/plugin-vue@5.1.4(vite@5.4.9(@types/node@20.16.13))(vue@3.5.12(typescript@5.5.4))': dependencies: vite: 5.4.9(@types/node@20.16.13) @@ -4588,6 +5053,33 @@ snapshots: '@vue/tsconfig@0.5.1': {} + '@vueuse/core@10.11.1(vue@3.5.12(typescript@5.5.4))': + dependencies: + '@types/web-bluetooth': 0.0.20 + '@vueuse/metadata': 10.11.1 + '@vueuse/shared': 10.11.1(vue@3.5.12(typescript@5.5.4)) + vue-demi: 0.14.10(vue@3.5.12(typescript@5.5.4)) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + + '@vueuse/head@2.0.0(vue@3.5.12(typescript@5.5.4))': + dependencies: + '@unhead/dom': 1.11.10 + '@unhead/schema': 1.11.10 + '@unhead/ssr': 1.11.10 + '@unhead/vue': 1.11.10(vue@3.5.12(typescript@5.5.4)) + vue: 3.5.12(typescript@5.5.4) + + '@vueuse/metadata@10.11.1': {} + + '@vueuse/shared@10.11.1(vue@3.5.12(typescript@5.5.4))': + dependencies: + vue-demi: 0.14.10(vue@3.5.12(typescript@5.5.4)) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + acorn-jsx@5.3.2(acorn@8.12.1): dependencies: acorn: 8.12.1 @@ -4682,6 +5174,11 @@ snapshots: transitivePeerDependencies: - magicast + bundle-require@5.0.0(esbuild@0.23.1): + dependencies: + esbuild: 0.23.1 + load-tsconfig: 0.2.5 + c12@1.11.2(magicast@0.3.5): dependencies: chokidar: 3.6.0 @@ -4850,6 +5347,11 @@ snapshots: mdn-data: 2.0.30 source-map-js: 1.2.1 + css-tree@3.0.0: + dependencies: + mdn-data: 2.10.0 + source-map-js: 1.2.1 + css-what@6.1.0: {} cssesc@3.0.0: {} @@ -4962,6 +5464,8 @@ snapshots: dotenv@16.4.5: {} + duplexer@0.1.2: {} + eastasianwidth@0.2.0: {} electron-to-chromium@1.5.39: {} @@ -5545,6 +6049,10 @@ snapshots: graphemer@1.4.0: {} + gzip-size@6.0.0: + dependencies: + duplexer: 0.1.2 + happy-dom@15.7.4: dependencies: entities: 4.5.0 @@ -5576,6 +6084,18 @@ snapshots: parent-module: 1.0.1 resolve-from: 4.0.0 + importx@0.4.4: + dependencies: + bundle-require: 5.0.0(esbuild@0.23.1) + debug: 4.3.6 + esbuild: 0.23.1 + jiti: 2.0.0-beta.3 + jiti-v1: jiti@1.21.6 + pathe: 1.1.2 + tsx: 4.19.1 + transitivePeerDependencies: + - supports-color + imurmurhash@0.1.4: {} indent-string@4.0.0: {} @@ -5656,6 +6176,8 @@ snapshots: jiti@1.21.6: {} + jiti@2.0.0-beta.3: {} + jiti@2.3.3: {} joi@17.13.3: @@ -5703,6 +6225,8 @@ snapshots: kleur@3.0.3: {} + kolorist@1.8.0: {} + levn@0.4.1: dependencies: prelude-ls: 1.2.1 @@ -5736,6 +6260,8 @@ snapshots: rfdc: 1.4.1 wrap-ansi: 9.0.0 + load-tsconfig@0.2.5: {} + local-pkg@0.5.0: dependencies: mlly: 1.7.2 @@ -5749,6 +6275,8 @@ snapshots: dependencies: p-locate: 5.0.0 + lodash-es@4.17.21: {} + lodash.memoize@4.1.2: {} lodash.merge@4.6.2: {} @@ -5898,6 +6426,8 @@ snapshots: mdn-data@2.0.30: {} + mdn-data@2.10.0: {} + merge-stream@2.0.0: {} merge2@1.4.1: {} @@ -6166,6 +6696,8 @@ snapshots: mri@1.2.0: {} + mrmime@2.0.0: {} + ms@2.1.2: {} ms@2.1.3: {} @@ -6209,6 +6741,12 @@ snapshots: pathe: 1.1.2 ufo: 1.5.4 + ofetch@1.4.1: + dependencies: + destr: 2.0.3 + node-fetch-native: 1.6.4 + ufo: 1.5.4 + ohash@1.1.3: {} once@1.4.0: @@ -6623,6 +7161,12 @@ snapshots: simple-git-hooks@2.11.1: {} + sirv@2.0.4: + dependencies: + '@polka/url': 1.0.0-next.28 + mrmime: 2.0.0 + totalist: 3.0.1 + sisteransi@1.0.5: {} slash@4.0.0: {} @@ -6787,6 +7331,8 @@ snapshots: toposort@2.0.2: {} + totalist@3.0.1: {} + ts-api-utils@1.3.0(typescript@5.6.3): dependencies: typescript: 5.6.3 @@ -6855,8 +7401,23 @@ snapshots: - supports-color - vue-tsc + unconfig@0.5.5: + dependencies: + '@antfu/utils': 0.7.10 + defu: 6.1.4 + importx: 0.4.4 + transitivePeerDependencies: + - supports-color + undici-types@6.19.8: {} + unhead@1.11.10: + dependencies: + '@unhead/dom': 1.11.10 + '@unhead/schema': 1.11.10 + '@unhead/shared': 1.11.10 + hookable: 5.5.3 + unist-util-is@6.0.0: dependencies: '@types/unist': 3.0.3 @@ -6876,6 +7437,33 @@ snapshots: unist-util-is: 6.0.0 unist-util-visit-parents: 6.0.1 + unocss@0.63.6(postcss@8.4.47)(rollup@4.21.2)(typescript@5.5.4)(vite@5.4.9(@types/node@20.16.13)): + dependencies: + '@unocss/astro': 0.63.6(rollup@4.21.2)(typescript@5.5.4)(vite@5.4.9(@types/node@20.16.13)) + '@unocss/cli': 0.63.6(rollup@4.21.2) + '@unocss/core': 0.63.6 + '@unocss/postcss': 0.63.6(postcss@8.4.47) + '@unocss/preset-attributify': 0.63.6 + '@unocss/preset-icons': 0.63.6 + '@unocss/preset-mini': 0.63.6 + '@unocss/preset-tagify': 0.63.6 + '@unocss/preset-typography': 0.63.6 + '@unocss/preset-uno': 0.63.6 + '@unocss/preset-web-fonts': 0.63.6 + '@unocss/preset-wind': 0.63.6 + '@unocss/transformer-attributify-jsx': 0.63.6 + '@unocss/transformer-compile-class': 0.63.6 + '@unocss/transformer-directives': 0.63.6 + '@unocss/transformer-variant-group': 0.63.6 + '@unocss/vite': 0.63.6(rollup@4.21.2)(typescript@5.5.4)(vite@5.4.9(@types/node@20.16.13)) + optionalDependencies: + vite: 5.4.9(@types/node@20.16.13) + transitivePeerDependencies: + - postcss + - rollup + - supports-color + - typescript + untyped@1.5.1: dependencies: '@babel/core': 7.25.8 @@ -6888,6 +7476,19 @@ snapshots: transitivePeerDependencies: - supports-color + unuse-ui@0.1.24(typescript@5.5.4): + dependencies: + '@headlessui/vue': 1.7.23(vue@3.5.12(typescript@5.5.4)) + '@iconify-json/ph': 1.2.1 + '@popperjs/core': 2.11.8 + '@vueuse/core': 10.11.1(vue@3.5.12(typescript@5.5.4)) + '@vueuse/head': 2.0.0(vue@3.5.12(typescript@5.5.4)) + lodash-es: 4.17.21 + vue: 3.5.12(typescript@5.5.4) + transitivePeerDependencies: + - '@vue/composition-api' + - typescript + update-browserslist-db@1.1.1(browserslist@4.24.0): dependencies: browserslist: 4.24.0 @@ -6981,6 +7582,10 @@ snapshots: vscode-uri@3.0.8: {} + vue-demi@0.14.10(vue@3.5.12(typescript@5.5.4)): + dependencies: + vue: 3.5.12(typescript@5.5.4) + vue-eslint-parser@9.4.3(eslint@9.12.0(jiti@2.3.3)): dependencies: debug: 4.3.6 @@ -6994,6 +7599,12 @@ snapshots: transitivePeerDependencies: - supports-color + vue-flow-layout@0.0.5(typescript@5.5.4): + dependencies: + vue: 3.5.12(typescript@5.5.4) + transitivePeerDependencies: + - typescript + vue-tsc@2.1.6(typescript@5.5.4): dependencies: '@volar/typescript': 2.4.6 @@ -7101,6 +7712,8 @@ snapshots: toposort: 2.0.2 type-fest: 2.19.0 + zhead@2.2.4: {} + zod@3.23.8: {} zwitch@2.0.4: {} diff --git a/src/types.ts b/src/types.ts index d9c1ed9..ed5fd9d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -22,7 +22,8 @@ export interface ReturnType { validate: () => Promise> errors: Ref> errorCount: ComputedRef - isValid: Ref + isLoading: Ref + isValid: ComputedRef hasError: ComputedRef clearErrors: () => void getErrorMessage: (path: keyof F) => string | undefined diff --git a/src/useFormValidation.ts b/src/useFormValidation.ts index f60d908..675b420 100644 --- a/src/useFormValidation.ts +++ b/src/useFormValidation.ts @@ -1,5 +1,5 @@ import type { FieldErrors, Form, GetErrorsFn, ReturnType, Schema } from './types' -import { computed, type MaybeRefOrGetter, shallowRef, toValue, watch } from 'vue' +import { computed, type MaybeRefOrGetter, ref, shallowRef, toValue, watch } from 'vue' import { getErrors } from './errors' import { polyfillGroupBy } from './polyfill' @@ -23,6 +23,8 @@ export function useFormValidation, F extends Form>( const errors = shallowRef>({}) + const isLoading = ref(false) + const errorCount = computed(() => Object.keys(errors.value).length) const isValid = computed(() => !errorCount.value) const hasError = computed(() => !!errorCount.value) @@ -47,6 +49,7 @@ export function useFormValidation, F extends Form>( } const validate = async (): Promise> => { + isLoading.value = true clearErrors() errors.value = opts.transformFn ? await getErrors(toValue(schema), toValue(form), opts.transformFn) @@ -54,6 +57,7 @@ export function useFormValidation, F extends Form>( if (hasError.value) { validationWatch() } + isLoading.value = false return errors.value } @@ -78,6 +82,7 @@ export function useFormValidation, F extends Form>( validate, errors, errorCount, + isLoading, isValid, hasError, clearErrors,