diff --git a/src/markers/MMapDefaultMarker/vue/index.ts b/src/markers/MMapDefaultMarker/vue/index.ts index 2043b77..6d6c9fa 100644 --- a/src/markers/MMapDefaultMarker/vue/index.ts +++ b/src/markers/MMapDefaultMarker/vue/index.ts @@ -14,7 +14,7 @@ export const MMapDefaultMarkerVuefyOptions: CustomVuefyOptions< props: { coordinates: {type: Object, required: true}, source: String, - zIndex: {type: Number, default: 0}, + zIndex: {type: Number, default: undefined}, properties: Object, id: String, disableRoundCoordinates: {type: Boolean, default: undefined}, diff --git a/src/markers/MMapPopupMarker/index.ts b/src/markers/MMapPopupMarker/index.ts index 8b76c53..d4defe1 100644 --- a/src/markers/MMapPopupMarker/index.ts +++ b/src/markers/MMapPopupMarker/index.ts @@ -1,4 +1,5 @@ import {LngLat, MMapMarker, MMapMarkerProps} from '@mappable-world/mappable-types'; +import {DefaultProps, defaultProps} from './props'; import {MMapPopupMarkerReactifyOverride} from './react'; import {MMapPopupMarkerVuefyOptions, MMapPopupMarkerVuefyOverride} from './vue'; @@ -30,9 +31,6 @@ export type MMapPopupMarkerProps = MMapMarkerProps & { onOpen?: () => void; }; -const defaultProps = Object.freeze({position: 'top', offset: 0, show: true}); -type DefaultProps = typeof defaultProps; - /** * `MMapPopupMarker` is a popup with customized content. * @example diff --git a/src/markers/MMapPopupMarker/props.ts b/src/markers/MMapPopupMarker/props.ts new file mode 100644 index 0000000..7a61ad4 --- /dev/null +++ b/src/markers/MMapPopupMarker/props.ts @@ -0,0 +1,2 @@ +export const defaultProps = Object.freeze({position: 'top', offset: 0, show: true}); +export type DefaultProps = typeof defaultProps; diff --git a/src/markers/MMapPopupMarker/vue/index.ts b/src/markers/MMapPopupMarker/vue/index.ts index 2d26804..c8c31d6 100644 --- a/src/markers/MMapPopupMarker/vue/index.ts +++ b/src/markers/MMapPopupMarker/vue/index.ts @@ -2,17 +2,18 @@ import {MMapFeatureProps, MMapMarkerEventHandler} from '@mappable-world/mappable import {CustomVuefyFn, CustomVuefyOptions} from '@mappable-world/mappable-types/modules/vuefy'; import type TVue from '@vue/runtime-core'; import {MMapPopupContentProps, MMapPopupMarker, MMapPopupMarkerProps, MMapPopupPositionProps} from '../'; +import {defaultProps} from '../props'; export const MMapPopupMarkerVuefyOptions: CustomVuefyOptions = { props: { coordinates: {type: Object, required: true}, source: String, - zIndex: {type: Number, default: 0}, + zIndex: {type: Number, default: undefined}, properties: Object, id: String, disableRoundCoordinates: {type: Boolean, default: undefined}, - hideOutsideViewport: {type: [Object, Boolean], default: false}, - draggable: {type: Boolean, default: false}, + hideOutsideViewport: {type: [Object, Boolean], default: undefined}, + draggable: {type: Boolean, default: undefined}, mapFollowsOnDrag: {type: [Boolean, Object]}, onDragStart: Function as TVue.PropType, onDragEnd: Function as TVue.PropType, @@ -23,9 +24,9 @@ export const MMapPopupMarkerVuefyOptions: CustomVuefyOptions = onClick: Function as TVue.PropType, onFastClick: Function as TVue.PropType, content: {type: [Function, String] as TVue.PropType, required: true}, - position: {type: String as TVue.PropType}, - offset: {type: Number, default: 0}, - show: {type: Boolean, default: true}, + position: {type: String as TVue.PropType, default: defaultProps.position}, + offset: {type: Number, default: defaultProps.offset}, + show: {type: Boolean, default: defaultProps.show}, onClose: {type: Function as TVue.PropType}, onOpen: {type: Function as TVue.PropType} }