From 266e7194c08bb80d0871177efe6715c0c0900a11 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Fri, 27 Jan 2023 18:27:14 +0200 Subject: [PATCH] include datepicker and autocomplete --- package-lock.json | 56 +++++ package.json | 1 + src/components/Modal.vue | 2 +- src/components/form/FormField.vue | 19 +- src/components/form/base/Autocomplete.vue | 209 ++++++++++++++++++ src/components/form/base/Select.vue | 29 +-- .../form/fields/FormAutocompleteField.vue | 53 +++++ src/components/form/fields/FormDateField.vue | 43 ++++ .../form/fields/FormSelectField.vue | 9 +- src/components/form/form.types.ts | 24 ++ src/components/item/NewStorageModal.vue | 3 +- src/style.scss | 10 + src/utils/extract-component-props.ts | 5 + src/views/Dashboard.vue | 56 +++++ 14 files changed, 490 insertions(+), 29 deletions(-) create mode 100644 src/components/form/base/Autocomplete.vue create mode 100644 src/components/form/fields/FormAutocompleteField.vue create mode 100644 src/components/form/fields/FormDateField.vue create mode 100644 src/utils/extract-component-props.ts diff --git a/package-lock.json b/package-lock.json index d7c55c7..ff3a68a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@headlessui/vue": "^1.7.7", "@heroicons/vue": "^2.0.13", + "@vuepic/vue-datepicker": "^3.6.5", "@vueuse/core": "^9.10.0", "jwt-decode": "^3.1.2", "lodash.get": "^4.4.2", @@ -698,6 +699,21 @@ "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.45.tgz", "integrity": "sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg==" }, + "node_modules/@vuepic/vue-datepicker": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/@vuepic/vue-datepicker/-/vue-datepicker-3.6.5.tgz", + "integrity": "sha512-axf9st9UIjxbLUL/WjbYPSzkNKfedfDqV3wQIBeCAekN2/w45RNmWfIUXIxpbfZKiRo2ie+U23IW20I33oGauw==", + "dependencies": { + "date-fns": "^2.29.3", + "date-fns-tz": "^1.3.7" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "vue": ">=3.2.0" + } + }, "node_modules/@vueuse/core": { "version": "9.10.0", "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-9.10.0.tgz", @@ -1000,6 +1016,26 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.21.tgz", "integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==" }, + "node_modules/date-fns": { + "version": "2.29.3", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.29.3.tgz", + "integrity": "sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==", + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, + "node_modules/date-fns-tz": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/date-fns-tz/-/date-fns-tz-1.3.7.tgz", + "integrity": "sha512-1t1b8zyJo+UI8aR+g3iqr5fkUHWpd58VBx8J/ZSQ+w7YrGlw80Ag4sA86qkfCXRBLmMc4I2US+aPMd4uKvwj5g==", + "peerDependencies": { + "date-fns": ">=2.0.0" + } + }, "node_modules/de-indent": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", @@ -2456,6 +2492,15 @@ "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.45.tgz", "integrity": "sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg==" }, + "@vuepic/vue-datepicker": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/@vuepic/vue-datepicker/-/vue-datepicker-3.6.5.tgz", + "integrity": "sha512-axf9st9UIjxbLUL/WjbYPSzkNKfedfDqV3wQIBeCAekN2/w45RNmWfIUXIxpbfZKiRo2ie+U23IW20I33oGauw==", + "requires": { + "date-fns": "^2.29.3", + "date-fns-tz": "^1.3.7" + } + }, "@vueuse/core": { "version": "9.10.0", "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-9.10.0.tgz", @@ -2632,6 +2677,17 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.21.tgz", "integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==" }, + "date-fns": { + "version": "2.29.3", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.29.3.tgz", + "integrity": "sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==" + }, + "date-fns-tz": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/date-fns-tz/-/date-fns-tz-1.3.7.tgz", + "integrity": "sha512-1t1b8zyJo+UI8aR+g3iqr5fkUHWpd58VBx8J/ZSQ+w7YrGlw80Ag4sA86qkfCXRBLmMc4I2US+aPMd4uKvwj5g==", + "requires": {} + }, "de-indent": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", diff --git a/package.json b/package.json index 4253085..b874a06 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "@headlessui/vue": "^1.7.7", "@heroicons/vue": "^2.0.13", + "@vuepic/vue-datepicker": "^3.6.5", "@vueuse/core": "^9.10.0", "jwt-decode": "^3.1.2", "lodash.get": "^4.4.2", diff --git a/src/components/Modal.vue b/src/components/Modal.vue index be7185a..02ab5cc 100644 --- a/src/components/Modal.vue +++ b/src/components/Modal.vue @@ -33,7 +33,7 @@ as="h3" class="text-lg font-bold leading-6 text-gray-900" > -
+