WIP easter egg feature for geodata

This commit is contained in:
flisowna
2022-12-19 14:27:04 +03:00
parent 49eeedd582
commit c2d41d6a10
5 changed files with 39 additions and 87 deletions

View File

@@ -29,91 +29,6 @@ let isExpanded = $ref(false)
let isLoading = $ref(false)
// const localValue = computed<string | Record<string, any> | undefined>({
// get: () => localValueState.value,
// set: (val: undefined | string | Record<string, any>) => {
// localValueState.value = typeof val === 'object' ? JSON.stringify(val, null, 2) : val
// /** if form and not expanded then sync directly */
// if (isForm.value && !isExpanded) {
// vModel.value = val
// }
// },
// })
// const isPopupOpen = ref(false)
// const showPopup = () => (isPopupOpen.value = true)
// const latitudeInput = ref(String(vModel?.value?.latitude) || '')
// const longitudeInput = ref(String(vModel?.value?.latitude) || '')
// const onSubmit = () => {
// if (latitudeInput == null || longitudeInput == null) {
// console.error("Tried to submit a GeoLocation where latitude or longitude value wasn't provicde")
// return
// }
// emits('update:modelValue', {
// latitude: Number.parseFloat(latitudeInput.value),
// longitude: Number.parseFloat(longitudeInput.value),
// })
// }
// const onAbort = () => alert('ABORT!')
// const isOpen = ref(false)
// const visible = ref<boolean>(false)
// const readOnly = inject(ReadonlyInj)!
// const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus()
// function onKeyDown(evt: KeyboardEvent) {
// return evt.key === '.' && evt.preventDefault()
// }
// const visibleMenu = ref(false)
// const toggleVisbility = () => {
// visible.value = !visible.value
// }
// const latitude = computed(() => {
// })
// const onSave = () => {
// isExpanded = false
// editEnabled.value = false
// // localValue.value = localValue ? formatJson(localValue.value as string) : localValue
// // vModel.value = localValue.value
// }
// watch(
// vModel,
// (val) => {
// localValue.value = val
// },
// { immediate: true },
// )
// watch(localValue, (val) => {
// try {
// JSON.parse(val as string)
// error = undefined
// } catch (e: any) {
// error = e
// }
// })
// watch(editEnabled, () => {
// isExpanded = false
// localValue.value = vModel.valuec
// })
const [latitude, longitude] = (vModel.value || '').split(';')
const latLongStr = computed(() => {