npm updates

This commit is contained in:
Eric van der Vlist 2023-08-07 17:59:56 +02:00
parent 2d73315a9a
commit 70b431a1c5
4 changed files with 68 additions and 16 deletions

26
package-lock.json generated
View File

@ -21,7 +21,7 @@
"@capacitor/ios": "^5.2.2",
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
"@solid-primitives/i18n": "^1.4.0",
"@solid-primitives/i18n": "^1.4.1",
"@solidjs/router": "^0.8.2",
"@suid/icons-material": "^0.6.9",
"@suid/material": "^0.14.2",
@ -60,7 +60,7 @@
"license-report": "^6.4.0",
"shelljs": "^0.8.5",
"typescript": "^5.1.6",
"vite": ">=4.4.8",
"vite": ">=4.4.9",
"vite-plugin-solid": "^2.7.0",
"vitest": "^0.34.1"
}
@ -1496,9 +1496,9 @@
}
},
"node_modules/@solid-primitives/i18n": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@solid-primitives/i18n/-/i18n-1.4.0.tgz",
"integrity": "sha512-jKNa9cl9JFnJdYMh8cQUDb8n89Qc6UTJS9Q0DBjx04du86cv9OOCqnbc+xIKJy+QHV7MfBf7KFDdg3sSGwLstA==",
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/@solid-primitives/i18n/-/i18n-1.4.1.tgz",
"integrity": "sha512-lUUb/hmI77O9oMH8Jj4pPta/pAV21gRgN52UJ7cCXVdv1QkiyzX586gDDU+Tj8NsK/U6OrmMk2tClPwqHAk/xA==",
"dependencies": {
"@solid-primitives/context": "^0.2.1"
},
@ -7714,9 +7714,9 @@
}
},
"node_modules/rollup": {
"version": "3.26.2",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.26.2.tgz",
"integrity": "sha512-6umBIGVz93er97pMgQO08LuH3m6PUb3jlDUUGFsNJB6VgTCUaDFpupf5JfU30529m/UKOgmiX+uY6Sx8cOYpLA==",
"version": "3.27.2",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.27.2.tgz",
"integrity": "sha512-YGwmHf7h2oUHkVBT248x0yt6vZkYQ3/rvE5iQuVBh3WO8GcJ6BNeOkpoX1yMHIiBm18EMLjBPIoUDkhgnyxGOQ==",
"bin": {
"rollup": "dist/bin/rollup"
},
@ -8881,13 +8881,13 @@
"dev": true
},
"node_modules/vite": {
"version": "4.4.8",
"resolved": "https://registry.npmjs.org/vite/-/vite-4.4.8.tgz",
"integrity": "sha512-LONawOUUjxQridNWGQlNizfKH89qPigK36XhMI7COMGztz8KNY0JHim7/xDd71CZwGT4HtSRgI7Hy+RlhG0Gvg==",
"version": "4.4.9",
"resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz",
"integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==",
"dependencies": {
"esbuild": "^0.18.10",
"postcss": "^8.4.26",
"rollup": "^3.25.2"
"postcss": "^8.4.27",
"rollup": "^3.27.1"
},
"bin": {
"vite": "bin/vite.js"

View File

@ -28,7 +28,7 @@
"license-report": "^6.4.0",
"shelljs": "^0.8.5",
"typescript": "^5.1.6",
"vite": ">=4.4.8",
"vite": ">=4.4.9",
"vite-plugin-solid": "^2.7.0",
"vitest": "^0.34.1"
},
@ -44,7 +44,7 @@
"@capacitor/ios": "^5.2.2",
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
"@solid-primitives/i18n": "^1.4.0",
"@solid-primitives/i18n": "^1.4.1",
"@solidjs/router": "^0.8.2",
"@suid/icons-material": "^0.6.9",
"@suid/material": "^0.14.2",

View File

@ -1,5 +1,14 @@
import { useI18n } from '@solid-primitives/i18n';
import { Box, Button, IconButton, SvgIcon, TextField } from '@suid/material';
import {
Box,
Button,
FormControlLabel,
IconButton,
Radio,
RadioGroup,
SvgIcon,
TextField,
} from '@suid/material';
import { cloneDeep, isPlainObject } from 'lodash';
import { Component, createSignal, Show } from 'solid-js';
import { newEmptyGpx } from '../../db/gpx';
@ -10,6 +19,7 @@ import GpxChooser from '../gpx-chooser';
import GpxIcon from '../gpx/GpxIcon';
//import GpxesIcon from '../../icons/adventure-journey-location-svgrepo-com.svg';
import style from './GpxDialog.module.css';
import { getTagValue, getTagsFromObj } from '../../lib/tags/tags';
export const [currentGpxId, setCurrentGpxId] = createSignal<string>('new');
@ -189,6 +199,23 @@ const GpxDialog: Component<{}> = (props) => {
onChange={gpxDescChangeHandler}
InputProps={{ inputComponent: 'textarea' }}
/>
<div>Locomotion</div>
<RadioGroup
value={
getTagValue(getTagsFromObj(gpx()), 'locomotion') || 'hiking'
}
>
<FormControlLabel
value='hiking'
control={<Radio />}
label='Hiking'
></FormControlLabel>
<FormControlLabel
value='cycling'
control={<Radio />}
label='Cycling'
></FormControlLabel>
</RadioGroup>
<TextField
label={t('gpxTo')}
multiline={true}

View File

@ -13,3 +13,28 @@ export const getTagsFromObj = (obj: any) => {
return obj.extensions.tags;
};
export const setTagsIntoObj = (obj: any, tags: any) => {
if (!obj) {
obj = {};
}
if (!obj.extensions) {
obj.extensions = {};
}
obj.extensions.tags = tags;
return obj;
};
export const getTagValue = (tags: any, tagName: keyof any) => {
if (Object.hasOwn(tags, tagName)) {
return tags[tagName];
}
return false;
};
export const setTagValue = (tags: any, tagName: keyof any, tagValue: any) => {
tags[tagName] = tagValue;
};