diff --git a/geopf-extensions-openlayers-1.0.0-beta.0-293.tgz b/geopf-extensions-openlayers-1.0.0-beta.0-293.tgz new file mode 100644 index 0000000..20c2805 Binary files /dev/null and b/geopf-extensions-openlayers-1.0.0-beta.0-293.tgz differ diff --git a/package.json b/package.json index 199cf42..013df64 100644 --- a/package.json +++ b/package.json @@ -42,9 +42,8 @@ "@gouvminint/vue-dsfr": "^5.14.2", "@vueuse/components": "^10.9.0", "@vueuse/core": "^10.9.0", - "html2canvas": "^1.4.1", - "jspdf": "^2.5.2", "geopf-extensions-openlayers": "./geopf-extensions-openlayers-1.0.0-beta.1-296.tgz", + "jspdf": "^2.5.2", "ol": "8.2.0", "vue": "^3.4.21", "vue-router": "^4.3.0" diff --git a/src/components.d.ts b/src/components.d.ts index 9d23849..0709a6f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -57,6 +57,7 @@ declare module 'vue' { MenuControl: typeof import('./components/menu/MenuControl.vue')['default'] MenuLateralNavButton: typeof import('./components/menu/MenuLateralNavButton.vue')['default'] MenuLateralWrapper: typeof import('./components/menu/MenuLateralWrapper.vue')['default'] + MenuTierce: typeof import('./components/menu/MenuTierce.vue')['default'] ModalConsent: typeof import('./components/modals/ModalConsent.vue')['default'] ModalInformation: typeof import('./components/modals/ModalInformation.vue')['default'] ModalTheme: typeof import('./components/modals/ModalTheme.vue')['default'] @@ -64,6 +65,7 @@ declare module 'vue' { OverviewMap: typeof import('./components/carte/control/OverviewMap.vue')['default'] Patience: typeof import('./components/utils/Patience.vue')['default'] Print: typeof import('./components/carte/control/Print.vue')['default'] + PrintModal: typeof import('./components/carte/control/PrintModal.vue')['default'] ReverseGeocode: typeof import('./components/carte/control/ReverseGeocode.vue')['default'] RightMenuTool: typeof import('./components/menu/RightMenuTool.vue')['default'] Route: typeof import('./components/carte/control/Route.vue')['default'] @@ -72,6 +74,7 @@ declare module 'vue' { ScaleLine: typeof import('./components/carte/control/ScaleLine.vue')['default'] SearchEngine: typeof import('./components/carte/control/SearchEngine.vue')['default'] Share: typeof import('./components/carte/control/Share.vue')['default'] + ShareModal: typeof import('./components/carte/control/ShareModal.vue')['default'] StoreData: typeof import('./components/StoreData.vue')['default'] Territories: typeof import('./components/carte/control/Territories.vue')['default'] VIcon: typeof import('oh-vue-icons')['OhVueIcon'] diff --git a/src/components/CartoAndTools.vue b/src/components/CartoAndTools.vue index 8e84527..ae3890c 100644 --- a/src/components/CartoAndTools.vue +++ b/src/components/CartoAndTools.vue @@ -2,16 +2,29 @@ import Carto from '@/components/carte/Carto.vue' import LeftMenuTool from '@/components/menu/LeftMenuTool.vue' import RightMenuTool from '@/components/menu/RightMenuTool.vue' -import MenuCatalogue from '@/components/menu/catalogue/MenuCatalogue.vue' -import MenuControl from '@/components/menu/MenuControl.vue'; +import ModalTheme from '@/components/modals/ModalTheme.vue' +import ShareModal from '@/components/carte/control/ShareModal.vue' +import PrintModal from "@/components/carte/control/PrintModal.vue"; -import { useControls } from '@/composables/controls' import { useDataStore } from "@/stores/dataStore" import { useMapStore } from "@/stores/mapStore" const mapStore = useMapStore(); const dataStore = useDataStore(); + +const refModalTheme = ref(null) +const modalShareRef = ref(null) +const refPrintModal = ref(null) +const onModalShareOpen = () => { + modalShareRef.value.onModalShareOpen() +} +const onModalThemeOpen = () => { + refModalTheme.value.openModalTheme() +} +const onModalPrintOpen = () => { + refPrintModal.value.onModalPrintOpen() +} // INFO // Les listes sont initialisées via le mapStore, et @@ -45,44 +58,40 @@ const selectedControls = computed(() => { return controls; }); -provide("selectedLayers", selectedLayers); +const cartoRef = ref(null) +provide("selectedLayers", selectedLayers); - - - - + - - - - - + + + + + + diff --git a/src/components/carte/Controls.vue b/src/components/carte/Controls.vue index 5fb2f29..2ffcb7e 100644 --- a/src/components/carte/Controls.vue +++ b/src/components/carte/Controls.vue @@ -11,6 +11,8 @@ @@ -304,94 +46,8 @@ const scaleLineOptions = { no-outline @click="onModalPrintOpen" /> - - - - - - - Mise en Page - - - - - - - - - - - {{ printTitle }} - - - - - - - - - + - - \ No newline at end of file diff --git a/src/components/carte/control/PrintModal.vue b/src/components/carte/control/PrintModal.vue new file mode 100644 index 0000000..bdf48de --- /dev/null +++ b/src/components/carte/control/PrintModal.vue @@ -0,0 +1,490 @@ + + + + + + + + + + + + Mise en Page + + + + + + + + + + + {{ printTitle }} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/carte/control/Share.vue b/src/components/carte/control/Share.vue index 4ce733c..5bc3231 100644 --- a/src/components/carte/control/Share.vue +++ b/src/components/carte/control/Share.vue @@ -15,6 +15,7 @@ import { useDataStore } from '@/stores/dataStore'; import { useMapStore } from '@/stores/mapStore'; import { useEulerian } from '@/plugins/Eulerian.js'; import { useClipboard } from '@vueuse/core' +import ShareModal from '@/components/carte/control/ShareModal.vue' const eulerian = useEulerian(); const dataStore = useDataStore(); @@ -26,91 +27,13 @@ const props = defineProps({ shareOptions: Object }); +const modalShareRef = ref(null) + // paramètres du composant bouton const btnTitle = "Ouvrir le panneau de partage de carte"; const btnIcon = "fr-icon-link"; // FIXME icone de partage dsfr !? const btnLabel = ""; -// paramètres du composant de la modale -const title = "Partager une carte"; -const size = "lg"; - -const shareModalOpened = ref(false); - -const onModalShareOpen = () => { - shareModalOpened.value = true; - eulerian.pause(); -}; -const onModalShareClose = () => { - shareModalOpened.value = false; - eulerian.resume(); -}; - -// les paramètres du composant de partage -const contacts = dataStore.getContacts(); -const permalinkEncoded = computed(() => { - return encodeURI(mapStore.permalink).replaceAll("&", "%26") -}) -const mail = computed(() => { - return { - address : contacts.mail, - subject : "Cartes à consulter sur cartes.gouv.fr", - body : "Bonjour,%0AJe vous invite à consulter cette carte sur Cartes.gouv.fr :%0A" + `${permalinkEncoded.value}` - } -}); - -const shareMail = computed(() => { - return { - "to" : `mailto:${mail.value.address}?subject=${mail.value.subject}&body=${mail.value.body}`, - "label" : "Envoyer un mail" - }; -}) -const shareNetworks = computed(() => { - return [ - { - "name": "facebook", - "label": "Partager sur Facebook", - "url": contacts.networks.facebook + "?display=popup&u=" + mapStore.permalink - }, - { - "name": "twitter-x", - "label": "Partager sur X (anciennement Twitter)", - "url": contacts.networks.twitter + "?url=" + permalinkEncoded.value + "&text=Ma carte IGN&via=&hashtags=IGNFrance" - }, - { - "name": "linkedin", - "label": "Partager sur LinkedIn", - "url": contacts.networks.linkedin + "?url=" + mapStore.permalink + "&title=Ma%20carte%20IGN" - }, - { - "name": "instagram", - "label": "Partager sur Instagram", - "url": contacts.networks.instagram - } - ] -}); - -// creation de l'iframe de partage -const iframe = computed(() => { - return ` - `; -}); -const clipboardSource = ref('') -const { text, copy, copied, isSupported } = useClipboard({ clipboardSource }) - -const target = ref(null); - -const icon = "co-copy" -const defaultScale = ref(0.8325); -const iconProps = computed(() => typeof icon === 'string' - ? { scale: defaultScale.value, name: icon } - : { scale: defaultScale.value, ...icon }, -); - onMounted(() => { nextTick(function () { //code here @@ -122,6 +45,10 @@ onBeforeMount(() => { //code here }) }); + +const onModalShareOpen = () => { + modalShareRef.value.onModalShareOpen() +} @@ -137,68 +64,7 @@ onBeforeMount(() => { no-outline @click="onModalShareOpen" /> - - - - - - - - - - - - Lien permanent vers la carte - - - - - - - - - - Copiez le code HTML pour intégrer la carte dans un site - - - - - - - - + @@ -249,10 +115,6 @@ onBeforeMount(() => { width: 40px; height: 40px; } - .share-iframe-input { - height: 200px; - } - /* positionnement absolu à adapter en fonction du positionnement des autres boutons car n'est pas dans la grille */ @media (max-width: 576px){ diff --git a/src/components/carte/control/ShareModal.vue b/src/components/carte/control/ShareModal.vue new file mode 100644 index 0000000..36c8dee --- /dev/null +++ b/src/components/carte/control/ShareModal.vue @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + Lien permanent vers la carte + + + + + + + + + + Copiez le code HTML pour intégrer la carte dans un site + + + + + + + + + + + + + diff --git a/src/components/menu/LeftMenuTool.vue b/src/components/menu/LeftMenuTool.vue index 7300fad..3d025ef 100644 --- a/src/components/menu/LeftMenuTool.vue +++ b/src/components/menu/LeftMenuTool.vue @@ -1,6 +1,8 @@ - - + + + + + + @@ -59,9 +113,13 @@ const tabClicked = () => { background-color: var(--background-default-grey); } +.invisibleNavButton { + display: none; +} + .navButton[aria-label]:hover::before { content: attr(aria-label); - position: absolute; + position: relative; top: 0; color: var(--text-default-grey); font-size: .75rem; diff --git a/src/components/menu/MenuLateralWrapper.vue b/src/components/menu/MenuLateralWrapper.vue index db6579d..877bd6b 100644 --- a/src/components/menu/MenuLateralWrapper.vue +++ b/src/components/menu/MenuLateralWrapper.vue @@ -4,6 +4,8 @@ * * @property { String } side position sur la carte du menu : valeur possible 'left' ou 'right' * @property { Boolean } visibility boolean assurant l'activation du menu + * @property { Number } width largeur du menu déplié, défaut 550 + * @property { Number } padding padding à gauche et à droite, défaut 30 * */ export default { @@ -17,9 +19,10 @@ import { OhVueIcon as VIcon } from 'oh-vue-icons' const props = defineProps({ side: String, visibility: Boolean, - id: String + id: String, + width: Number, + padding: Number }) - const icon = "io-close" const defaultScale = 0.8325; const iconProps = computed(() => typeof icon === 'string' @@ -27,12 +30,21 @@ const iconProps = computed(() => typeof icon === 'string' : { scale: defaultScale.value, ...icon }, ); +const widthValue = props.width || 550 +const paddingValue = props.padding || 30 const is_expanded = defineModel(false) -const width = ref() -width.value = 30 -const cssWidth = computed(() => { - return width.value + "vw"; +const widthMenu = ref(widthValue) +const padding = ref(paddingValue) +const cssWidthMenu = computed(() => { + return widthMenu.value + "px"; +}) +const cssPadding = computed(() => { + return padding.value + "px"; +}) +const cssWidthMenuContent = computed(() => { + return widthMenu.value - padding.value + "px"; }) + const menuTabs = ref() function closeMenu() { @@ -95,6 +107,10 @@ defineExpose({ background-position: calc(100% - 0.125rem) 50%, 100% 50%, calc(100% - 0.375rem) 0, calc(100% - 0.375rem) 0; background-image: conic-gradient(from 236.31deg at 100% 50%, transparent 0deg, var(--background-overlap-grey) 0deg, var(--background-overlap-grey) 67.38deg, transparent 67.38deg), conic-gradient(from 236.31deg at 100% 50%, transparent 0deg, var(--border-default-grey) 0deg, var(--border-default-grey) 67.38deg, transparent 67.38deg), linear-gradient(90deg, var(--border-default-grey), var(--border-default-grey)), linear-gradient(90deg, var(--background-overlap-grey), var(--background-overlap-grey)); } + + .navButton[aria-label]:hover .ov-icon { + position: absolute; + } diff --git a/src/components/menu/RightMenuTool.vue b/src/components/menu/RightMenuTool.vue index bbb50a5..c57b036 100644 --- a/src/components/menu/RightMenuTool.vue +++ b/src/components/menu/RightMenuTool.vue @@ -1,17 +1,30 @@
- -
- - - Lien permanent vers la carte - - - - - -
- - - Copiez le code HTML pour intégrer la carte dans un site - - - - - -
+ +
+ + + Lien permanent vers la carte + + + + + +
+ + + Copiez le code HTML pour intégrer la carte dans un site + + + + + +