From 2c8fd27de8e4b404c18fbd5371b1da223bd3074d Mon Sep 17 00:00:00 2001 From: Matthew Kalinin Date: Mon, 11 Mar 2024 14:03:57 +0300 Subject: [PATCH] add vuefy options --- package-lock.json | 295 +++++++++++++++++- package.json | 5 +- src/controls/MMapRotateControl/index.ts | 2 + src/controls/MMapRotateControl/vue/index.ts | 11 + src/controls/MMapRotateTiltControl/index.ts | 2 + .../MMapRotateTiltControl/vue/index.ts | 11 + src/controls/MMapTiltControl/index.ts | 8 +- src/controls/MMapTiltControl/vue/index.ts | 11 + 8 files changed, 332 insertions(+), 13 deletions(-) create mode 100644 src/controls/MMapRotateControl/vue/index.ts create mode 100644 src/controls/MMapRotateTiltControl/vue/index.ts create mode 100644 src/controls/MMapTiltControl/vue/index.ts diff --git a/package-lock.json b/package-lock.json index 7ab9ae1..b77c836 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2", "devDependencies": { "@mappable-world/mappable-cli": "^0.0.28", - "@mappable-world/mappable-types": "^0.0.4", + "@mappable-world/mappable-types": "^0.0.15", "@types/got": "9.6.12", "@types/jest": "29.5.3", "@types/jsdom": "21.1.1", @@ -35,6 +35,7 @@ "ts-jest": "29.1.1", "ts-loader": "9.4.4", "typescript": "5.1.6", + "vue": "^3.4.21", "webpack": "5.88.1", "webpack-cli": "5.1.4", "webpack-dev-server": "4.15.1" @@ -1274,10 +1275,26 @@ } }, "node_modules/@mappable-world/mappable-types": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@mappable-world/mappable-types/-/mappable-types-0.0.4.tgz", - "integrity": "sha512-rAVeM7+MIzNz+JAFJA58AQJn/XWidxlNNgLqR3vXlUn5iNR5Vm/0iY3dGf95yhV85jmE8E/egAUGrEwvkzlJtw==", - "dev": true + "version": "0.0.15", + "resolved": "https://registry.npmjs.org/@mappable-world/mappable-types/-/mappable-types-0.0.15.tgz", + "integrity": "sha512-mcFDPGUdmzABEpnsnTmgSoU0YCLgAyqf4l/TvgZk1yXGOh14ESpwA9iHfzrRECl8eIK3i0jsuXsxY2+idkIepA==", + "dev": true, + "peerDependencies": { + "@types/react": "16-18", + "@types/react-dom": "16-18", + "@vue/runtime-core": "3" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + }, + "@vue/runtime-core": { + "optional": true + } + } }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", @@ -1975,6 +1992,105 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@vue/compiler-core": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.21.tgz", + "integrity": "sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.23.9", + "@vue/shared": "3.4.21", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.0.2" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.21.tgz", + "integrity": "sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==", + "dev": true, + "dependencies": { + "@vue/compiler-core": "3.4.21", + "@vue/shared": "3.4.21" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.21.tgz", + "integrity": "sha512-me7epoTxYlY+2CUM7hy9PCDdpMPfIwrOvAXud2Upk10g4YLv9UBW7kL798TvMeDhPthkZ0CONNrK2GoeI1ODiQ==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.23.9", + "@vue/compiler-core": "3.4.21", + "@vue/compiler-dom": "3.4.21", + "@vue/compiler-ssr": "3.4.21", + "@vue/shared": "3.4.21", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.7", + "postcss": "^8.4.35", + "source-map-js": "^1.0.2" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.21.tgz", + "integrity": "sha512-M5+9nI2lPpAsgXOGQobnIueVqc9sisBFexh5yMIMRAPYLa7+5wEJs8iqOZc1WAa9WQbx9GR2twgznU8LTIiZ4Q==", + "dev": true, + "dependencies": { + "@vue/compiler-dom": "3.4.21", + "@vue/shared": "3.4.21" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.21.tgz", + "integrity": "sha512-UhenImdc0L0/4ahGCyEzc/pZNwVgcglGy9HVzJ1Bq2Mm9qXOpP8RyNTjookw/gOCUlXSEtuZ2fUg5nrHcoqJcw==", + "dev": true, + "dependencies": { + "@vue/shared": "3.4.21" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.21.tgz", + "integrity": "sha512-pQthsuYzE1XcGZznTKn73G0s14eCJcjaLvp3/DKeYWoFacD9glJoqlNBxt3W2c5S40t6CCcpPf+jG01N3ULyrA==", + "dev": true, + "dependencies": { + "@vue/reactivity": "3.4.21", + "@vue/shared": "3.4.21" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.21.tgz", + "integrity": "sha512-gvf+C9cFpevsQxbkRBS1NpU8CqxKw0ebqMvLwcGQrNpx6gqRDodqKqA+A2VZZpQ9RpK2f9yfg8VbW/EpdFUOJw==", + "dev": true, + "dependencies": { + "@vue/runtime-core": "3.4.21", + "@vue/shared": "3.4.21", + "csstype": "^3.1.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.21.tgz", + "integrity": "sha512-aV1gXyKSN6Rz+6kZ6kr5+Ll14YzmIbeuWe7ryJl5muJ4uwSwY/aStXTixx76TwkZFJLm1aAlA/HSWEJ4EyiMkg==", + "dev": true, + "dependencies": { + "@vue/compiler-ssr": "3.4.21", + "@vue/shared": "3.4.21" + }, + "peerDependencies": { + "vue": "3.4.21" + } + }, + "node_modules/@vue/shared": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.21.tgz", + "integrity": "sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==", + "dev": true + }, "node_modules/@webassemblyjs/ast": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", @@ -3941,6 +4057,12 @@ "node": ">=4.0" } }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -6093,6 +6215,18 @@ "yallist": "^3.0.2" } }, + "node_modules/magic-string": { + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -8451,6 +8585,27 @@ "node": ">= 0.8" } }, + "node_modules/vue": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.21.tgz", + "integrity": "sha512-5hjyV/jLEIKD/jYl4cavMcnzKwjMKohureP8ejn3hhEjwhWIhWeuzL2kJAjzl/WyVsgPY56Sy4Z40C3lVshxXA==", + "dev": true, + "dependencies": { + "@vue/compiler-dom": "3.4.21", + "@vue/compiler-sfc": "3.4.21", + "@vue/runtime-dom": "3.4.21", + "@vue/server-renderer": "3.4.21", + "@vue/shared": "3.4.21" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", @@ -9979,9 +10134,9 @@ } }, "@mappable-world/mappable-types": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@mappable-world/mappable-types/-/mappable-types-0.0.4.tgz", - "integrity": "sha512-rAVeM7+MIzNz+JAFJA58AQJn/XWidxlNNgLqR3vXlUn5iNR5Vm/0iY3dGf95yhV85jmE8E/egAUGrEwvkzlJtw==", + "version": "0.0.15", + "resolved": "https://registry.npmjs.org/@mappable-world/mappable-types/-/mappable-types-0.0.15.tgz", + "integrity": "sha512-mcFDPGUdmzABEpnsnTmgSoU0YCLgAyqf4l/TvgZk1yXGOh14ESpwA9iHfzrRECl8eIK3i0jsuXsxY2+idkIepA==", "dev": true }, "@nodelib/fs.scandir": { @@ -10570,6 +10725,102 @@ "eslint-visitor-keys": "^3.4.1" } }, + "@vue/compiler-core": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.21.tgz", + "integrity": "sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==", + "dev": true, + "requires": { + "@babel/parser": "^7.23.9", + "@vue/shared": "3.4.21", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.0.2" + } + }, + "@vue/compiler-dom": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.21.tgz", + "integrity": "sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==", + "dev": true, + "requires": { + "@vue/compiler-core": "3.4.21", + "@vue/shared": "3.4.21" + } + }, + "@vue/compiler-sfc": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.21.tgz", + "integrity": "sha512-me7epoTxYlY+2CUM7hy9PCDdpMPfIwrOvAXud2Upk10g4YLv9UBW7kL798TvMeDhPthkZ0CONNrK2GoeI1ODiQ==", + "dev": true, + "requires": { + "@babel/parser": "^7.23.9", + "@vue/compiler-core": "3.4.21", + "@vue/compiler-dom": "3.4.21", + "@vue/compiler-ssr": "3.4.21", + "@vue/shared": "3.4.21", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.7", + "postcss": "^8.4.35", + "source-map-js": "^1.0.2" + } + }, + "@vue/compiler-ssr": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.21.tgz", + "integrity": "sha512-M5+9nI2lPpAsgXOGQobnIueVqc9sisBFexh5yMIMRAPYLa7+5wEJs8iqOZc1WAa9WQbx9GR2twgznU8LTIiZ4Q==", + "dev": true, + "requires": { + "@vue/compiler-dom": "3.4.21", + "@vue/shared": "3.4.21" + } + }, + "@vue/reactivity": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.21.tgz", + "integrity": "sha512-UhenImdc0L0/4ahGCyEzc/pZNwVgcglGy9HVzJ1Bq2Mm9qXOpP8RyNTjookw/gOCUlXSEtuZ2fUg5nrHcoqJcw==", + "dev": true, + "requires": { + "@vue/shared": "3.4.21" + } + }, + "@vue/runtime-core": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.21.tgz", + "integrity": "sha512-pQthsuYzE1XcGZznTKn73G0s14eCJcjaLvp3/DKeYWoFacD9glJoqlNBxt3W2c5S40t6CCcpPf+jG01N3ULyrA==", + "dev": true, + "requires": { + "@vue/reactivity": "3.4.21", + "@vue/shared": "3.4.21" + } + }, + "@vue/runtime-dom": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.21.tgz", + "integrity": "sha512-gvf+C9cFpevsQxbkRBS1NpU8CqxKw0ebqMvLwcGQrNpx6gqRDodqKqA+A2VZZpQ9RpK2f9yfg8VbW/EpdFUOJw==", + "dev": true, + "requires": { + "@vue/runtime-core": "3.4.21", + "@vue/shared": "3.4.21", + "csstype": "^3.1.3" + } + }, + "@vue/server-renderer": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.21.tgz", + "integrity": "sha512-aV1gXyKSN6Rz+6kZ6kr5+Ll14YzmIbeuWe7ryJl5muJ4uwSwY/aStXTixx76TwkZFJLm1aAlA/HSWEJ4EyiMkg==", + "dev": true, + "requires": { + "@vue/compiler-ssr": "3.4.21", + "@vue/shared": "3.4.21" + } + }, + "@vue/shared": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.21.tgz", + "integrity": "sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==", + "dev": true + }, "@webassemblyjs/ast": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", @@ -12034,6 +12285,12 @@ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -13661,6 +13918,15 @@ "yallist": "^3.0.2" } }, + "magic-string": { + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", + "dev": true, + "requires": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, "make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -15367,6 +15633,19 @@ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "dev": true }, + "vue": { + "version": "3.4.21", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.21.tgz", + "integrity": "sha512-5hjyV/jLEIKD/jYl4cavMcnzKwjMKohureP8ejn3hhEjwhWIhWeuzL2kJAjzl/WyVsgPY56Sy4Z40C3lVshxXA==", + "dev": true, + "requires": { + "@vue/compiler-dom": "3.4.21", + "@vue/compiler-sfc": "3.4.21", + "@vue/runtime-dom": "3.4.21", + "@vue/server-renderer": "3.4.21", + "@vue/shared": "3.4.21" + } + }, "w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", diff --git a/package.json b/package.json index 6e29cc3..ed3551e 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,8 @@ "bump:git": "git add --all && git commit -m \"New version $npm_package_version\" && git tag $npm_package_version && git push --tags origin HEAD:main" }, "devDependencies": { - "html-webpack-plugin": "^5.5.3", "@mappable-world/mappable-cli": "^0.0.28", - "@mappable-world/mappable-types": "^0.0.4", + "@mappable-world/mappable-types": "^0.0.15", "@types/got": "9.6.12", "@types/jest": "29.5.3", "@types/jsdom": "21.1.1", @@ -35,6 +34,7 @@ "eslint-config-prettier": "8.8.0", "eslint-plugin-prettier": "4.2.1", "got": "11.8.6", + "html-webpack-plugin": "^5.5.3", "identity-obj-proxy": "3.0.0", "jest": "29.6.1", "jsdom": "22.1.0", @@ -44,6 +44,7 @@ "ts-jest": "29.1.1", "ts-loader": "9.4.4", "typescript": "5.1.6", + "vue": "^3.4.21", "webpack": "5.88.1", "webpack-cli": "5.1.4", "webpack-dev-server": "4.15.1" diff --git a/src/controls/MMapRotateControl/index.ts b/src/controls/MMapRotateControl/index.ts index ddf2522..5f52b58 100644 --- a/src/controls/MMapRotateControl/index.ts +++ b/src/controls/MMapRotateControl/index.ts @@ -1,6 +1,7 @@ import type {EasingFunctionDescription, MMapControl, MMapListener} from '@mappable-world/mappable-types'; import {MMapCameraRequest} from '@mappable-world/mappable-types/imperative/MMap'; import {Position, getDeltaAzimuth, toggleRotate} from '../utils/angle-utils'; +import {MMapRotateControlVuefyOptions} from './vue'; import './index.css'; @@ -30,6 +31,7 @@ type DefaultProps = typeof defaultProps; */ export class MMapRotateControl extends mappable.MMapComplexEntity { static defaultProps = defaultProps; + static [mappable.optionsKeyVuefy] = MMapRotateControlVuefyOptions; private _control!: MMapControl; private _rotateControl!: InternalRotateControl; diff --git a/src/controls/MMapRotateControl/vue/index.ts b/src/controls/MMapRotateControl/vue/index.ts new file mode 100644 index 0000000..0827ee3 --- /dev/null +++ b/src/controls/MMapRotateControl/vue/index.ts @@ -0,0 +1,11 @@ +import {EasingFunctionDescription} from '@mappable-world/mappable-types'; +import type {CustomVuefyOptions} from '@mappable-world/mappable-types/modules/vuefy'; +import type TVue from '@vue/runtime-core'; +import {MMapRotateControl} from '..'; + +export const MMapRotateControlVuefyOptions: CustomVuefyOptions = { + props: { + easing: [Function, String, Object] as TVue.PropType, + duration: Number + } +}; diff --git a/src/controls/MMapRotateTiltControl/index.ts b/src/controls/MMapRotateTiltControl/index.ts index 4787e75..4d98dee 100644 --- a/src/controls/MMapRotateTiltControl/index.ts +++ b/src/controls/MMapRotateTiltControl/index.ts @@ -1,6 +1,7 @@ import type {EasingFunctionDescription, MMapControl} from '@mappable-world/mappable-types'; import {MMapRotateControl} from './MMapRotateControl'; import {MMapTiltControl} from './MMapTiltControl'; +import {MMapRotateTiltControlVuefyOptions} from './vue'; /** * MMapRotateTiltControl props @@ -28,6 +29,7 @@ type DefaultProps = typeof defaultProps; */ export class MMapRotateTiltControl extends mappable.MMapComplexEntity { static defaultProps = defaultProps; + static [mappable.optionsKeyVuefy] = MMapRotateTiltControlVuefyOptions; private _rotateControl!: MMapRotateControl; private _tiltControl!: MMapTiltControl; diff --git a/src/controls/MMapRotateTiltControl/vue/index.ts b/src/controls/MMapRotateTiltControl/vue/index.ts new file mode 100644 index 0000000..7f298df --- /dev/null +++ b/src/controls/MMapRotateTiltControl/vue/index.ts @@ -0,0 +1,11 @@ +import {EasingFunctionDescription} from '@mappable-world/mappable-types'; +import type {CustomVuefyOptions} from '@mappable-world/mappable-types/modules/vuefy'; +import type TVue from '@vue/runtime-core'; +import {MMapRotateTiltControl} from '..'; + +export const MMapRotateTiltControlVuefyOptions: CustomVuefyOptions = { + props: { + easing: [Function, String, Object] as TVue.PropType, + duration: Number + } +}; diff --git a/src/controls/MMapTiltControl/index.ts b/src/controls/MMapTiltControl/index.ts index f3dcee7..761c8b3 100644 --- a/src/controls/MMapTiltControl/index.ts +++ b/src/controls/MMapTiltControl/index.ts @@ -1,16 +1,17 @@ import type {EasingFunctionDescription, MMapControl, MMapListener} from '@mappable-world/mappable-types'; +import {MMapCameraRequest} from '@mappable-world/mappable-types/imperative/MMap'; import { CLICK_TOLERANCE_PX, MAX_TILT_DEG, MIN_TILT_DEG, - toggleTilt, + Position, degToRad, radToDeg, - Position + toggleTilt } from '../utils/angle-utils'; +import {MMapTiltControlVuefyOptions} from './vue'; import './index.css'; -import {MMapCameraRequest} from '@mappable-world/mappable-types/imperative/MMap'; /** * MMapTiltControl props @@ -38,6 +39,7 @@ type DefaultProps = typeof defaultProps; */ export class MMapTiltControl extends mappable.MMapComplexEntity { static defaultProps = defaultProps; + static [mappable.optionsKeyVuefy] = MMapTiltControlVuefyOptions; private _control!: MMapControl; private _tiltControl!: InternalTiltControl; diff --git a/src/controls/MMapTiltControl/vue/index.ts b/src/controls/MMapTiltControl/vue/index.ts new file mode 100644 index 0000000..1f2095c --- /dev/null +++ b/src/controls/MMapTiltControl/vue/index.ts @@ -0,0 +1,11 @@ +import {EasingFunctionDescription} from '@mappable-world/mappable-types'; +import type {CustomVuefyOptions} from '@mappable-world/mappable-types/modules/vuefy'; +import type TVue from '@vue/runtime-core'; +import {MMapTiltControl} from '..'; + +export const MMapTiltControlVuefyOptions: CustomVuefyOptions = { + props: { + easing: [Function, String, Object] as TVue.PropType, + duration: Number + } +};