diff --git a/.env.development b/.env.development index 63d52e78..4f492fed 100755 --- a/.env.development +++ b/.env.development @@ -1,7 +1,7 @@ -VITE_APP_ID="17" +VITE_APP_ID="13" VITE_APP_URL="https://localhost" VITE_MONGODB_HOST="https://localhost:3000" -VITE_LOGO_REG="piuchebuono-logo-full.png" +VITE_LOGO_REG='riso-logo-full.png' VITE_PUBLICKEY_PUSH='BDncvMiUZmjaCG2Kr1V9N0_33hOG-AuNSbHSvL24y2dzBiUjAxKm02emx5SeJvz2IGmtRf6YqCgopeQwCwUmZw8' VITE_DEBUG="1" VITE_VUE_APP_ISTEST=0 diff --git a/.env.production b/.env.production index a651dc30..e834adfe 100644 --- a/.env.production +++ b/.env.production @@ -1,11 +1,11 @@ -VITE_APP_ID="17" -VITE_APP_URL="https://test.piuchebuono.app" -VITE_MONGODB_HOST="https://testapi.piuchebuono.app" -VITE_LOGO_REG="piuchebuono-logo-full.png" -VITE_PUBLICKEY_PUSH="BJgo8XR_upbnbMLWgCAUELo6DK7dRXffYAnFOxbaMMz5favBgcQBKT-eISqouO-jRad4Sw8l5nd2wCF6KorGiTc" +VITE_APP_ID="13" +VITE_APP_URL="https://test.riso.app" +VITE_MONGODB_HOST="https://testapi.riso.app" +VITE_LOGO_REG="riso-logo-full.png" +VITE_PUBLICKEY_PUSH="BGXRf1TgcqocqD6J7qnRgCG7AvM2lxAoW7peb7UEzB4SxBb6DxGRdJ0UvD9ewnrB9KrSrh0-aDCODXBm7sZ1DDs" VITE_DEBUG="1" VITE_VUE_APP_ISTEST="1" DIRECTORY_LOCAL="myprojplanet_vite" -DIRECTORY_SERVER="/var/www/nodejs_test.piuchebuono_server" -SERVERDIR_WEBSITE="/var/www/test.piuchebuono.app" +DIRECTORY_SERVER="/var/www/nodejs_test.riso_server" +SERVERDIR_WEBSITE="/var/www/test.riso.app" SERVERPW_WEBSITE="pwdadmin@1AOK" \ No newline at end of file diff --git a/package.json b/package.json index c6da5237..7e3c1785 100755 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { - "name": "piuchebuono", + "name": "riso", "version": "1.2.71", - "description": "PiuCheBuono", - "productName": "PiuCheBuono", + "productName": "Riso 💚 - Rete Italiana Scambi Orizzontali", + "description": "Progetto RISO (Rete Italiana Scambi Orizzontali) promuove una rete di comunità locali che favoriscono scambi di beni, servizi e ospitalità. Con l'App RISO, sviluppata per facilitare il baratto, il dono e l'uso di monete alternative come i RIS, il progetto crea legami autentici basati sulla fiducia e sostenibilità. Partecipa agli scambi e costruisci una comunità più consapevole e autosufficiente.", "author": "Surya", "private": true, "keywords": [], "license": "MIT", "type": "module", "scripts": { - "dev": "PORT=8085 APP_VERSION='1.2.71' quasar dev", + "dev": "APP_VERSION='1.2.71' PORT=8084 quasar dev", "dev_noCheck": "SKIP_TSC=true quasar dev", "build": "quasar build", "buildpwa": "NODE_ENV=production APP_VERSION='1.2.71' quasar build -m pwa", @@ -21,117 +21,117 @@ "lintfile": "eslint --ext .js,.ts,.vue --ignore-path .gitignore ./ > file.out.txt", "lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt", "fix": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\" --ignore-pattern .gitignore ./ --fix > file.out.txt", - "pwa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.71' quasar dev -m pwa", - "spa": "NODE_ENV=development PORT=8085 APP_VERSION='1.2.71' quasar dev", + "pwa": "NODE_ENV=development PORT=8094 APP_VERSION='1.2.71' quasar dev -m pwa", + "spa": "NODE_ENV=development PORT=8084 APP_VERSION='1.2.71' quasar dev", "debug": "quasar dev --mode debug", "test": "echo \"No test specified\" && exit 0", "generate-sw": "workbox generateSW workbox-config.js", "postinstall": "quasar prepare" }, "dependencies": { - "@cubejs-client/core": "^1.2.26", - "@quasar/extras": "^1.16.17", + "@cubejs-client/core": "^1.3.21", + "@quasar/extras": "^1.17.0", "@quasar/quasar-ui-qcalendar": "^4.1.2", "@types/jsbarcode": "^3.11.4", - "@types/leaflet": "^1.9.17", - "@vue/compat": "^3.5.13", - "@vue/compiler-sfc": "^3.5.13", + "@types/leaflet": "^1.9.18", + "@vue/compat": "^3.5.16", + "@vue/compiler-sfc": "^3.5.16", "@vuelidate/core": "^2.0.3", "@vuelidate/validators": "^2.0.4", - "acorn": "^8.14.1", + "acorn": "^8.15.0", "animate.css": "^4.1.1", + "apexcharts": "^4.7.0", "autoprefixer": "^10.4.21", - "axios": "^1.8.4", + "axios": "^1.9.0", "bcryptjs": "^3.0.2", - "chart.js": "^4.4.8", - "core-js": "^3.41.0", + "chart.js": "^4.4.9", + "core-js": "^3.43.0", "crypto-browserify": "^3.12.1", "date-fns": "^4.1.0", "echarts": "5.6.0", - "eslint-plugin-n": "^17.16.2", + "eslint-plugin-n": "^17.19.0", "eslint-plugin-quasar": "^1.1.0", - "graphql": "^16.10.0", - "graphql-tag": "^2.12.6", - "gsap": "^3.12.7", + "gsap": "^3.13.0", "html2pdf.js": "^0.10.3", "jquery": "^3.7.1", "js-cookie": "^3.0.5", - "jsbarcode": "^3.11.6", + "jsbarcode": "^3.12.1", "leaflet": "^1.9.4", "leaflet-routing-machine": "^3.2.12", "leaflet.markercluster": "^1.5.3", "localforage": "^1.10.0", "lodash": "^4.17.21", + "mongoose-paginate-v2": "^1.9.1", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", - "pinia": "^3.0.1", - "qrcode-vue3": "^1.7.1", + "pinia": "^3.0.3", "quasar": "^2.18.1", "quasar-extras": "^2.0.9", "register-service-worker": "^1.7.2", "scrollreveal": "^4.0.9", - "typescript-eslint": "^8.27.0", - "vee-validate": "^4.15.0", - "vue": "^3.5.13", + "typescript-eslint": "^8.34.0", + "vee-validate": "^4.15.1", + "vue": "^3.5.16", "vue-class-component": "^8.0.0-rc.1", "vue-country-code": "^1.1.3", "vue-echarts": "^7.0.3", - "vue-i18n": "^11.1.2", + "vue-i18n": "^11.1.5", "vue-idb": "^0.2.0", - "vue-image-zoomer": "^2.4.4", "vue-property-decorator": "^10.0.0-rc.3", - "vue-router": "^4.5.0", + "vue-router": "^4.5.1", "vue-scroll-reveal": "^2.1.0", "vue-social-sharing": "^4.0.0-alpha4", "vue-svgicon": "^4.0.0-alpha.3", "vue-timeago3": "^2.3.2", "vue2-dragula": "^2.5.5", - "vue3-pdf-app": "^1.0.3", + "vue3-apexcharts": "^1.8.0", "vue3-qr-reader": "^1.0.0", + "vuedraggable": "^4.1.0", "vuex": "^4.1.0", "vuex-router-sync": "^6.0.0-rc.1", "workbox-core": "^7.3.0", "workbox-precaching": "^7.3.0", "workbox-routing": "^7.3.0", "workbox-strategies": "^7.3.0", - "workbox-window": "^7.3.0" + "workbox-window": "^7.3.0", + "xlsx": "^0.18.5" }, "devDependencies": { - "@eslint/js": "^9.23.0", - "@intlify/unplugin-vue-i18n": "^6.0.5", - "@quasar/app-vite": "^2.1.4", + "@eslint/js": "^9.28.0", + "@intlify/unplugin-vue-i18n": "^6.0.8", + "@quasar/app-vite": "^2.2.1", "@types/google.maps": "^3.58.1", "@types/jest": "^29.5.14", "@types/js-cookie": "^3.0.6", - "@types/node": "^22.13.11", + "@types/node": "^24.0.1", "@types/nprogress": "^0.2.3", "@types/vue-tel-input": "^2.1.7", "@types/vuelidate": "^0.7.22", - "@vue/devtools": "^7.7.2", + "@vue/devtools": "^7.7.6", "@vue/eslint-config-prettier": "^10.2.0", "@vue/eslint-config-typescript": "^14.5.0", "autoprefixer": "^10.4.21", "eslint": "9", "eslint-plugin-import": "^2.31.0", - "eslint-plugin-vue": "^10.0.0", + "eslint-plugin-vue": "^10.2.0", "file-loader": "^6.2.0", - "globals": "^16.0.0", - "http-proxy-middleware": "^3.0.3", - "jest": "^29.7.0", + "globals": "^16.2.0", + "http-proxy-middleware": "^3.0.5", + "jest": "^30.0.0", "json-loader": "^0.5.7", - "nodemon": "^3.1.9", - "npm-check-updates": "^17.1.16", - "parcel": "^2.14.1", - "postcss": "^8.5.3", + "nodemon": "^3.1.10", + "npm-check-updates": "^18.0.1", + "parcel": "^2.15.2", + "postcss": "^8.5.5", "postcss-loader": "^8.1.1", "prettier": "3", "strip-ansi": "=7.1.0", - "ts-jest": "^29.2.6", - "typescript": "5.7.3", - "vite-plugin-checker": "^0.9.1", + "ts-jest": "^29.4.0", + "typescript": "5.8.3", + "vite-plugin-checker": "^0.9.3", "vue-cli-plugin-element-ui": "^1.1.4", - "vue-eslint-parser": "^10.1.1", - "vue-tsc": "^2.2.8", + "vue-eslint-parser": "^10.1.3", + "vue-tsc": "^2.2.10", "vueify": "^9.4.1", "workbox-build": "^7.3.0" }, diff --git a/public/favicon.ico b/public/favicon.ico index 765302c2..d283c964 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/images/freeplanet-logo-full.odg b/public/images/freeplanet-logo-full.odg deleted file mode 100755 index 854da650..00000000 Binary files a/public/images/freeplanet-logo-full.odg and /dev/null differ diff --git a/public/images/freeplanet-logo-full.svg b/public/images/freeplanet-logo-full.svg deleted file mode 100755 index b9c10df3..00000000 --- a/public/images/freeplanet-logo-full.svg +++ /dev/null @@ -1,1186 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/images/logo.png b/public/images/logo.png new file mode 100644 index 00000000..51a29654 Binary files /dev/null and b/public/images/logo.png differ diff --git a/public/images/pcb-android-icon-144x144.png b/public/images/pcb-android-icon-144x144.png deleted file mode 100644 index fdea5eb1..00000000 Binary files a/public/images/pcb-android-icon-144x144.png and /dev/null differ diff --git a/public/images/pcb-android-icon-192x192.png b/public/images/pcb-android-icon-192x192.png deleted file mode 100644 index 93bb5fb7..00000000 Binary files a/public/images/pcb-android-icon-192x192.png and /dev/null differ diff --git a/public/images/pcb-android-icon-36x36.png b/public/images/pcb-android-icon-36x36.png deleted file mode 100644 index f700c0d2..00000000 Binary files a/public/images/pcb-android-icon-36x36.png and /dev/null differ diff --git a/public/images/pcb-android-icon-48x48.png b/public/images/pcb-android-icon-48x48.png deleted file mode 100644 index 4018b080..00000000 Binary files a/public/images/pcb-android-icon-48x48.png and /dev/null differ diff --git a/public/images/pcb-android-icon-72x72.png b/public/images/pcb-android-icon-72x72.png deleted file mode 100644 index fdaff445..00000000 Binary files a/public/images/pcb-android-icon-72x72.png and /dev/null differ diff --git a/public/images/pcb-android-icon-96x96.png b/public/images/pcb-android-icon-96x96.png deleted file mode 100644 index 74ae0a32..00000000 Binary files a/public/images/pcb-android-icon-96x96.png and /dev/null differ diff --git a/public/images/pcb-apple-icon-114x114.png b/public/images/pcb-apple-icon-114x114.png deleted file mode 100644 index de67dfff..00000000 Binary files a/public/images/pcb-apple-icon-114x114.png and /dev/null differ diff --git a/public/images/pcb-apple-icon-120x120.png b/public/images/pcb-apple-icon-120x120.png deleted file mode 100644 index 5864c9c8..00000000 Binary files a/public/images/pcb-apple-icon-120x120.png and /dev/null differ diff --git a/public/images/pcb-apple-icon-144x144.png b/public/images/pcb-apple-icon-144x144.png deleted file mode 100644 index fdea5eb1..00000000 Binary files a/public/images/pcb-apple-icon-144x144.png and /dev/null differ diff --git a/public/images/pcb-apple-icon-152x152.png b/public/images/pcb-apple-icon-152x152.png deleted file mode 100644 index 6e92509a..00000000 Binary files a/public/images/pcb-apple-icon-152x152.png and /dev/null differ diff --git a/public/images/pcb-apple-icon-180x180.png b/public/images/pcb-apple-icon-180x180.png deleted file mode 100644 index 4d59cedc..00000000 Binary files a/public/images/pcb-apple-icon-180x180.png and /dev/null differ diff --git a/public/images/pcb-apple-icon-57x57.png b/public/images/pcb-apple-icon-57x57.png deleted file mode 100644 index fb201a9d..00000000 Binary files a/public/images/pcb-apple-icon-57x57.png and /dev/null differ diff --git a/public/images/pcb-apple-icon-60x60.png b/public/images/pcb-apple-icon-60x60.png deleted file mode 100644 index 3b5f1c33..00000000 Binary files a/public/images/pcb-apple-icon-60x60.png and /dev/null differ diff --git a/public/images/pcb-apple-icon-72x72.png b/public/images/pcb-apple-icon-72x72.png deleted file mode 100644 index fdaff445..00000000 Binary files a/public/images/pcb-apple-icon-72x72.png and /dev/null differ diff --git a/public/images/pcb-apple-icon-76x76.png b/public/images/pcb-apple-icon-76x76.png deleted file mode 100644 index 2882992b..00000000 Binary files a/public/images/pcb-apple-icon-76x76.png and /dev/null differ diff --git a/public/images/pcb-apple-icon.png b/public/images/pcb-apple-icon.png deleted file mode 100644 index 422a8dca..00000000 Binary files a/public/images/pcb-apple-icon.png and /dev/null differ diff --git a/public/images/piuchebuono-logo-full.png b/public/images/piuchebuono-logo-full.png deleted file mode 100644 index 5465d80c..00000000 Binary files a/public/images/piuchebuono-logo-full.png and /dev/null differ diff --git a/public/images/riso-android-icon-144x144.png b/public/images/riso-android-icon-144x144.png new file mode 100644 index 00000000..37dcd661 Binary files /dev/null and b/public/images/riso-android-icon-144x144.png differ diff --git a/public/images/riso-android-icon-192x192.png b/public/images/riso-android-icon-192x192.png new file mode 100644 index 00000000..95b960e9 Binary files /dev/null and b/public/images/riso-android-icon-192x192.png differ diff --git a/public/images/riso-android-icon-384x384.png b/public/images/riso-android-icon-384x384.png new file mode 100644 index 00000000..ce1ffc47 Binary files /dev/null and b/public/images/riso-android-icon-384x384.png differ diff --git a/public/images/riso-android-icon-48x48.png b/public/images/riso-android-icon-48x48.png new file mode 100644 index 00000000..499e8674 Binary files /dev/null and b/public/images/riso-android-icon-48x48.png differ diff --git a/public/images/riso-android-icon-512x512.png b/public/images/riso-android-icon-512x512.png new file mode 100644 index 00000000..e1c31acd Binary files /dev/null and b/public/images/riso-android-icon-512x512.png differ diff --git a/public/images/riso-android-icon-96x96.png b/public/images/riso-android-icon-96x96.png new file mode 100644 index 00000000..98dbf9d9 Binary files /dev/null and b/public/images/riso-android-icon-96x96.png differ diff --git a/public/images/riso-apple-icon-114x114.png b/public/images/riso-apple-icon-114x114.png new file mode 100644 index 00000000..882dd21c Binary files /dev/null and b/public/images/riso-apple-icon-114x114.png differ diff --git a/public/images/riso-apple-icon-120x120.png b/public/images/riso-apple-icon-120x120.png new file mode 100644 index 00000000..734b0503 Binary files /dev/null and b/public/images/riso-apple-icon-120x120.png differ diff --git a/public/images/riso-apple-icon-144x144.png b/public/images/riso-apple-icon-144x144.png new file mode 100644 index 00000000..923da7be Binary files /dev/null and b/public/images/riso-apple-icon-144x144.png differ diff --git a/public/images/riso-apple-icon-152x152.png b/public/images/riso-apple-icon-152x152.png new file mode 100644 index 00000000..84fd455d Binary files /dev/null and b/public/images/riso-apple-icon-152x152.png differ diff --git a/public/images/riso-apple-icon-180x180.png b/public/images/riso-apple-icon-180x180.png new file mode 100644 index 00000000..e457d906 Binary files /dev/null and b/public/images/riso-apple-icon-180x180.png differ diff --git a/public/images/riso-apple-icon-57x57.png b/public/images/riso-apple-icon-57x57.png new file mode 100644 index 00000000..f5f538db Binary files /dev/null and b/public/images/riso-apple-icon-57x57.png differ diff --git a/public/images/riso-apple-icon-60x60.png b/public/images/riso-apple-icon-60x60.png new file mode 100644 index 00000000..4121f834 Binary files /dev/null and b/public/images/riso-apple-icon-60x60.png differ diff --git a/public/images/riso-apple-icon-72x72.png b/public/images/riso-apple-icon-72x72.png new file mode 100644 index 00000000..5efd872d Binary files /dev/null and b/public/images/riso-apple-icon-72x72.png differ diff --git a/public/images/riso-apple-icon-76x76.png b/public/images/riso-apple-icon-76x76.png new file mode 100644 index 00000000..6db4b76f Binary files /dev/null and b/public/images/riso-apple-icon-76x76.png differ diff --git a/public/images/riso-apple-icon.png b/public/images/riso-apple-icon.png new file mode 100644 index 00000000..cfaeb3c0 Binary files /dev/null and b/public/images/riso-apple-icon.png differ diff --git a/public/images/riso-logo-full.png b/public/images/riso-logo-full.png new file mode 100644 index 00000000..51a29654 Binary files /dev/null and b/public/images/riso-logo-full.png differ diff --git a/public/myicons/favicon-16x16.png b/public/myicons/favicon-16x16.png index d5a67f48..c28cef9f 100644 Binary files a/public/myicons/favicon-16x16.png and b/public/myicons/favicon-16x16.png differ diff --git a/public/myicons/favicon-32x32.png b/public/myicons/favicon-32x32.png index f2149cac..a02e38b0 100644 Binary files a/public/myicons/favicon-32x32.png and b/public/myicons/favicon-32x32.png differ diff --git a/public/myicons/favicon-96x96.png b/public/myicons/favicon-96x96.png new file mode 100644 index 00000000..f741b210 Binary files /dev/null and b/public/myicons/favicon-96x96.png differ diff --git a/scripts/_ALL_SITES/gruppomacro.app/package.json b/scripts/_ALL_SITES/gruppomacro.app/package.json index 14190125..bf36a99b 100755 --- a/scripts/_ALL_SITES/gruppomacro.app/package.json +++ b/scripts/_ALL_SITES/gruppomacro.app/package.json @@ -61,6 +61,7 @@ "leaflet.markercluster": "^1.5.3", "localforage": "^1.10.0", "lodash": "^4.17.21", + "mongoose-paginate-v2": "^1.9.1", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", "pinia": "^3.0.3", diff --git a/src-pwa/manifest.json b/src-pwa/manifest.json index 91e46ac9..c4032e4f 100644 --- a/src-pwa/manifest.json +++ b/src-pwa/manifest.json @@ -1,7 +1,7 @@ { - "name": "PiuCheBuono", - "short_name": "PiuCheBuono", - "description": "PiuCheBuono è un GAS e Bottega", + "name": "Riso", + "short_name": "Riso", + "description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.", "display": "standalone", "orientation": "portrait", "background_color": "#fff", @@ -11,47 +11,47 @@ "start_url": "/?homescreen=1", "icons": [ { - "src:": "/images/pcb-android-icon-512x512.png", + "src:": "/images/riso-android-icon-512x512.png", "sizes": "512x512", "type": "image/png" }, { - "src:": "/images/pcb-android-icon-384x384.png", + "src:": "/images/riso-android-icon-384x384.png", "sizes": "384x384", "type": "image/png" }, { - "src:": "/images/pcb-android-icon-192x192.png", + "src:": "/images/riso-android-icon-192x192.png", "sizes": "192x192", "type": "image/png" }, { - "src:": "/images/pcb-android-icon-144x144.png", + "src:": "/images/riso-android-icon-144x144.png", "sizes": "144x144", "type": "image/png" }, { - "src:": "/images/pcb-android-icon-96x96.png", + "src:": "/images/riso-android-icon-96x96.png", "sizes": "96x96", "type": "image/png" }, { - "src:": "/images/pcb-apple-icon-120x120.png", + "src:": "/images/riso-apple-icon-120x120.png", "sizes": "120x120", "type": "image/png" }, { - "src:": "/images/pcb-apple-icon-144x144.png", + "src:": "/images/riso-apple-icon-144x144.png", "sizes": "144x144", "type": "image/png" }, { - "src:": "/images/pcb-apple-icon-152x152.png", + "src:": "/images/riso-apple-icon-152x152.png", "sizes": "152x152", "type": "image/png" }, { - "src:": "/images/pcb-apple-icon-180x180.png", + "src:": "/images/riso-apple-icon-180x180.png", "sizes": "180x180", "type": "image/png" } diff --git a/src/OLD_index.template-OLD.html. b/src/OLD_index.template-OLD.html. deleted file mode 100755 index 2aca89c9..00000000 --- a/src/OLD_index.template-OLD.html. +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - <%= productName %> - - - - - - - - - - - - - - - - - - - - - -
- - - \ No newline at end of file diff --git a/src/components/CDateTime/CDateTime.scss b/src/components/CDateTime/CDateTime.scss index 830259d1..6d2ec2cf 100755 --- a/src/components/CDateTime/CDateTime.scss +++ b/src/components/CDateTime/CDateTime.scss @@ -1,10 +1,87 @@ -.calendar_comp{ - max-width: 170px; - @media (max-width: 400px) { - max-width: 400px; +/* ====== Config ====== */ +:root { + --picker-actions-h: 56px; /* altezza footer azioni */ +} + +/* Per device piccolissimi riduciamo l'altezza */ +@media (max-width: 360px) { + :root { --picker-actions-h: 48px; } +} + +/* ====== Campo visualizzazione valore (nel q-field) ====== */ +.cdt-display { + min-height: 1.5rem; + line-height: 1.5rem; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +/* ====== Contenitori popup/dialog del picker ====== */ +.picker-popup, +.picker-sheet { + display: flex; + flex-direction: column; + overflow: hidden; + + .picker-toolbar { + position: sticky; + top: 0; + z-index: 2; + background: var(--q-color-white); + border-bottom: 1px solid rgba(0, 0, 0, 0.08); + } + + .picker-body { + flex: 1 1 auto; + overflow: auto; + padding: 0.5rem; + /* spazio per non coprire il contenuto col footer */ + padding-bottom: calc(var(--picker-actions-h) + 0.5rem); + } + + .picker-actions { + position: sticky; + bottom: 0; + z-index: 2; + background: var(--q-color-white); + border-top: 1px solid rgba(0, 0, 0, 0.08); + box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06); + display: flex; + justify-content: flex-end; + align-items: center; + gap: 0.5rem; + min-height: var(--picker-actions-h); + padding: 0.5rem; + + .row { + flex-wrap: wrap; + } + + .q-btn { + min-width: 0; /* evita overflow su schermi stretti */ + } } } -.calendar_comp { - vertical-align: center; +/* ====== Stile responsive del contenitore input ====== */ +.calendar_comp { + width: 100%; + max-width: 320px; /* dimensione confortevole su desktop stretti */ + display: flex; + align-items: center; /* allinea testo/icone verticalmente */ + vertical-align: middle; /* per elementi inline-block eventualmente ereditati */ + + @media (max-width: 400px) { + max-width: 100%; /* su mobile usa tutta la larghezza disponibile */ + } +} + + +/* ====== Micro-tweak tipografici per bottoni, se serve compattezza ====== */ +@media (max-width: 360px) { + .picker-actions .q-btn { + padding: 0 0.5rem; + font-size: 0.85rem; + } } diff --git a/src/components/CDateTime/CDateTime.ts b/src/components/CDateTime/CDateTime.ts index 44aa849e..82011310 100755 --- a/src/components/CDateTime/CDateTime.ts +++ b/src/components/CDateTime/CDateTime.ts @@ -1,190 +1,173 @@ -import { defineComponent, ref, toRef, watch } from 'vue' -import { tools } from '@src/store/Modules/tools' - -import { useQuasar } from 'quasar' -import { useCalendarStore } from '@store/CalendarStore' -import { useI18n } from 'vue-i18n' -import { toolsext } from '@store/Modules/toolsext' +import { defineComponent, ref, watch, computed } from 'vue'; +import { useQuasar } from 'quasar'; +import { useI18n } from 'vue-i18n'; +import { tools } from '@src/store/Modules/tools'; +import { toolsext } from '@store/Modules/toolsext'; export default defineComponent({ name: 'CDate', + emits: ['update:value', 'savetoclose', 'show', 'clear'], props: { - value: { - type: String, - required: false, - default: '', - }, - valueDate: { - type: String, - required: false, - default: '', - }, - data_class: { - type: String, - required: false, - default: '', - }, - canEdit: { - type: Boolean, - required: false, - default: true, - }, - label: { - type: String, - required: true, - default: 'Val:', - }, - disable: { - type: Boolean, - required: false, - default: false, - }, - bgcolor: { - type: String, - required: false, - default: '', - }, - dense: { - type: Boolean, - required: false, - default: false, - }, - view: { - type: String, - required: false, - default: 'date-time', - }, - addstrrequired: { - type: String, - required: false, - default: '', - }, + value: { type: [String, null] as unknown as () => string | null, default: null }, + valueDate: { type: String, default: '' }, + data_class: { type: String, default: '' }, + canEdit: { type: Boolean, default: true }, + label: { type: String, required: true, default: 'Val:' }, + disable: { type: Boolean, default: false }, + bgcolor: { type: String, default: '' }, + dense: { type: Boolean, default: false }, + view: { type: String as () => 'date-time' | 'date' | 'time', default: 'date-time' }, + addstrrequired: { type: String, default: '' }, + nullable: { type: Boolean, default: true }, + nullText: { type: String, default: '—' }, + clearIcon: { type: String, default: 'fas fa-ban' }, + calendarIcon: { type: String, default: 'fas fa-calendar-day' }, + clockIcon: { type: String, default: 'fas fa-clock' }, }, - components: {}, setup(props, { emit }) { - const $q = useQuasar() + const $q = useQuasar(); const { t } = useI18n(); - const showDateTimeScroller = ref(false) - const saveit = ref(false) - const myvalue = ref('') - const mydate = ref(false) - const mytime = ref(false) - const valueprec = ref('') - // const myvalueDate = toRef(props, 'valueDate') + const isMobile = computed(() => $q.screen.lt.sm); + const isDesktop = computed(() => $q.screen.gt.sm) + + // LABEL RESPONSIVE per il bottone di conferma + const confirmLabelDate = computed(() => + isMobile.value + ? t('common.set') || 'Imposta' + : `Imposta a ${tools.getstrDateLong(myvalue.value)}` + ); + const confirmLabelTime = computed(() => + isMobile.value + ? t('common.set') || 'Imposta' + : `Imposta a ${tools.getstrTime(myvalue.value)}` + ); + + const showDateTimeScroller = ref(false); // desktop popup v-model + const saveit = ref(false); + const myvalue = ref(null); + const mydate = ref(false); + const mytime = ref(false); + const valueprec = ref(null); + + // mobile dialog state + const dateDialog = ref(false); + const timeDialog = ref(false); + + const dateDesktopDialog = ref(false) + const timeDesktopDialog = ref(false) + + const hasValue = computed(() => !!myvalue.value); function getclass() { - return 'calendar_comp ' + props.data_class + return 'calendar_comp ' + props.data_class; } function Opening() { - console.log('Opening', 'myvalue', myvalue.value) - saveit.value = false - valueprec.value = myvalue.value - if (myvalue.value === '') { - // myvalueDate.value = tools.getstrYYMMDDDateTime(new Date()) - myvalue.value = tools.getstrYYMMDDDateTime(new Date()) - } - // console.log('Opening', myvalueDate, myvalue) - emit('show') + saveit.value = false; + valueprec.value = myvalue.value; + if (!myvalue.value) myvalue.value = tools.getstrYYMMDDDateTime(new Date()); + emit('show'); } function Closing() { - mydate.value = false - mytime.value = false - // console.log('Closing') - if (!saveit.value) { - if (myvalue.value !== valueprec.value) { - myvalue.value = valueprec.value - tools.showNeutralNotif($q, t('db.reccanceled')) - } + mydate.value = false; + mytime.value = false; + if (!saveit.value && myvalue.value !== valueprec.value) { + myvalue.value = valueprec.value; + tools.showNeutralNotif($q, t('db.reccanceled')); } } - watch(() => props.value, (value, oldval) => { - if (value) { - myvalue.value = tools.getstrYYMMDDDateTime(value) - // myvalueDate.value = myvalue.value - console.log('myvalue Date = ', myvalue.value) - } - - }) + watch( + () => props.value, + (val) => { + if (val === null || val === '') myvalue.value = null; + else myvalue.value = tools.getstrYYMMDDDateTime(val); + }, + { immediate: true } + ); function savetoclose() { - // console.log('Close') saveit.value = true showDateTimeScroller.value = false + + // chiudi mobile + dateDialog.value = false + timeDialog.value = false + + // chiudi desktop + dateDesktopDialog.value = false + timeDesktopDialog.value = false + emit('savetoclose', myvalue.value, valueprec.value) } function scrollerPopupStyle280() { - if ($q.screen.lt.sm) { - return { - width: '100vw', - height: '100vh', - } - } else { - return { - maxHeight: '400px', - height: '400px', - width: '280px', - } - } + return { maxHeight: '420px', height: '420px', width: '320px' }; } - function created() { - if (props.value !== null) { - myvalue.value = tools.getstrYYMMDDDateTime(props.value) - } - - // console.log('created myvalue', myvalue) + function changeval(newval: string | Date) { + const out = + typeof newval === 'string' ? newval : tools.getstrYYMMDDDateTime(newval); + myvalue.value = out; + emit('update:value', out); + saveit.value = true; + emit('savetoclose', out, valueprec.value); } - function changeval(newval: Date) { - // console.log('changeval', newval, 'value=', value, 'myvalue=', myvalue) - emit('update:value', newval) - saveit.value = true - emit('savetoclose', myvalue.value, valueprec.value) - } - - function replacevalue() { - // console.log('changeval', newval, 'value=', value, 'myvalue=', myvalue) - if (valueprec.value) { - emit('update:value', valueprec.value) - saveit.value = true - showDateTimeScroller.value = false - emit('savetoclose', valueprec.value, valueprec.value) - } - } - - function mystyle() { - if (props.label !== '') - return '' - else - return '' - } - - function getstrDate(mydate: Date | string) { - if (props.view === 'date-time') { - return tools.getstrDateTime(mydate) - } else { - return tools.getstrDate(mydate) - } - } - - function azzera() { + function replacevalue() { + emit('update:value', valueprec.value as unknown as string) saveit.value = true showDateTimeScroller.value = false - emit('savetoclose', null, valueprec.value) + + // chiudi mobile + dateDialog.value = false + timeDialog.value = false + + // chiudi desktop + dateDesktopDialog.value = false + timeDesktopDialog.value = false + + emit('savetoclose', valueprec.value, valueprec.value) + } + + function clearDate() { + saveit.value = true + showDateTimeScroller.value = false + dateDialog.value = false + timeDialog.value = false + dateDesktopDialog.value = false + timeDesktopDialog.value = false + myvalue.value = null + emit('update:value', null as unknown as string) + emit('savetoclose', null, valueprec.value) + emit('clear') + tools.showNeutralNotif($q, t('common.cleared') || 'Valore rimosso') + } + + function openDate() { + if (isMobile.value) { Opening(); dateDialog.value = true } + else { Opening(); dateDesktopDialog.value = true } + } + function openTime() { + if (isMobile.value) { Opening(); timeDialog.value = true } + else { Opening(); timeDesktopDialog.value = true } + } + + + function getstrDate(myd: string | Date | null) { + if (!myd) return props.nullText; + if (props.view === 'date-time') return tools.getstrDateTime(myd); + if (props.view === 'date') return tools.getstrDate(myd); + return tools.getstrTime(myd); } - created() return { toolsext, changeval, scrollerPopupStyle280, - mystyle, getstrDate, savetoclose, Closing, @@ -196,7 +179,20 @@ export default defineComponent({ mydate, mytime, tools, - azzera, - } + clearDate, + hasValue, + // responsive + isMobile, + dateDialog, + timeDialog, + openDate, + openTime, + valueprec, + confirmLabelDate, + confirmLabelTime, + isDesktop, + dateDesktopDialog, + timeDesktopDialog, + }; }, -}) +}); diff --git a/src/components/CDateTime/CDateTime.vue b/src/components/CDateTime/CDateTime.vue index 2372e2f8..4deb551e 100755 --- a/src/components/CDateTime/CDateTime.vue +++ b/src/components/CDateTime/CDateTime.vue @@ -1,5 +1,6 @@