Skip to content

About

Repository for common Vue 3 components used by MAP components

Resources

Stars

0 stars

Watchers

4 watching

Forks

Repository files navigation

map-utilities

Repositories for common Vue 3 components used by MAP components

Recommended IDE Setup

VSCode + Volar (and disable Vetur).

Customize configuration

See Vite Configuration Reference.

Project Setup

npm install

Compile and Hot-Reload for Development

npm run serve

Compile and Minify for Production

npm run build-bundle

Help mode

HelpModeTour (a guided tour) and HelpModeHover (hover over a highlighted control to see its help) show the help of the controls marked with the v-help-mode directive.

Add or remove a control

Add v-help-mode to the control to add it to the help, remove the directive to remove it. Nothing else needs to change.

<map-svg-icon
  icon="zoomIn"
  v-help-mode="{
    id: 'scaffold-zoom-in',
    area: 'zoom',
    title: 'Zoom in',
    description: 'Zoom in to see more detail.',
    placement: 'left',
  }"
  @click="zoomIn()"
/>
import { helpModeDirective } from '@abi-software/map-utilities';

export default {
  directives: { helpMode: helpModeDirective },
};
Field Description
id required Unique id, also used for analytics. Prefix it with the component, e.g. flatmap-.
area One of HELP_MODE_AREAS: toolbar, panel-header, map-info, legends, plot-filter, zoom, map-settings, drawing, animation.
title, description The help text. Values are reactive, e.g. description: warningMessage. The description can use <b>, <strong>, <i>, <em>, <u>, <p>, <br>, <ul>, <ol>, <li>, <code>, <small>, <sub>, <sup> without attributes, any other tag is shown as text (sanitizeHelpDescription).
placement Where the help is shown, defaults to bottom.
order Order within the area, defaults to the order in the page.
onEnter, onLeave Prepare the UI before the help is shown, e.g. open a drawer, and revert it.
target A function returning the element to highlight, when it is not the element with the directive.
hover false to leave it out of the hover help.
hoverEnter false to call onEnter and onLeave only in the tour, e.g. for a list which would cover other controls during the hover help.
enterDelay, leaveDelay Milliseconds to wait after onEnter, or after onLeave before the next step, e.g. for an animation. Default 300.

Get the steps

collectHelpModeSteps(rootElement) returns the steps of the controls under the element, sorted by area, then order, then page order. Controls inside a hidden element with data-help-scope, e.g. a viewer which is not shown, are left out. Viewers expose it as getHelpModeSteps().

<HelpModeTour v-model="tourOpen" :steps="steps" />
<HelpModeHover v-model="hoverOpen" :steps="steps" :container="viewerElement" />

About

Repository for common Vue 3 components used by MAP components

Resources

Stars

0 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages