Last commit july 5th

This commit is contained in:
2024-07-05 13:46:23 +02:00
parent dad0d86e8c
commit b0e4dfbb76
24982 changed files with 2621219 additions and 413 deletions

4
spa/node_modules/preact-router/match/src/cjs.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import { Match, Link } from './index';
Match.Link = Link;
export default Match;

32
spa/node_modules/preact-router/match/src/index.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
import { h } from 'preact';
import { Link as StaticLink, exec, useRouter } from 'preact-router';
export function Match(props) {
const router = useRouter()[0];
return props.children({
url: router.url,
path: router.path,
matches: exec(router.path || router.url, props.path, {}) !== false
});
}
export function Link({
className,
activeClass,
activeClassName,
path,
...props
}) {
const router = useRouter()[0];
const matches =
(path && router.path && exec(router.path, path, {})) ||
exec(router.url, props.href, {});
let inactive = props.class || className || '';
let active = (matches && (activeClass || activeClassName)) || '';
props.class = inactive + (inactive && active && ' ') + active;
return <StaticLink {...props} />;
}
export default Match;