@aurelia/router-lite
Advanced tools
Comparing version 2.0.0-beta.9 to 2.0.0-beta.10
@@ -8,3 +8,3 @@ export { type IViewport, } from './resources/viewport'; | ||
export { IRouteContext, RouteContext, type INavigationModel, type INavigationRoute, } from './route-context'; | ||
export { AST, RouteExpression, CompositeSegmentExpression, ScopedSegmentExpression, SegmentGroupExpression, SegmentExpression, ComponentExpression, ViewportExpression, ParameterListExpression, ParameterExpression, ExpressionKind, } from './route-expression'; | ||
export { AST, RouteExpression, CompositeSegmentExpression, ScopedSegmentExpression, SegmentGroupExpression, SegmentExpression, ComponentExpression, ViewportExpression, ParameterListExpression, ParameterExpression, type ExpressionKind, } from './route-expression'; | ||
export { RouteNode, RouteTree, } from './route-tree'; | ||
@@ -11,0 +11,0 @@ export { isManagedState, toManagedState, IRouter, Router, Transition, } from './router'; |
import { ViewportInstructionTree } from './instructions'; | ||
import { type NavigationOptions } from './options'; | ||
import { ParsedUrl } from './url-parser'; | ||
export declare const enum ExpressionKind { | ||
Route = 0, | ||
CompositeSegment = 1, | ||
ScopedSegment = 2, | ||
SegmentGroup = 3, | ||
Segment = 4, | ||
Component = 5, | ||
Action = 6, | ||
Viewport = 7, | ||
ParameterList = 8, | ||
Parameter = 9 | ||
} | ||
export type ExpressionKind = 'Route' | 'CompositeSegment' | 'ScopedSegment' | 'SegmentGroup' | 'Segment' | 'Component' | 'Action' | 'Viewport' | 'ParameterList' | 'Parameter'; | ||
export type RouteExpressionOrHigher = CompositeSegmentExpressionOrHigher | RouteExpression; | ||
@@ -22,3 +11,3 @@ export declare class RouteExpression { | ||
readonly fragment: string | null; | ||
get kind(): ExpressionKind.Route; | ||
get kind(): 'Route'; | ||
constructor(isAbsolute: boolean, root: CompositeSegmentExpressionOrHigher, queryParams: Readonly<URLSearchParams>, fragment: string | null); | ||
@@ -53,3 +42,3 @@ static parse(value: ParsedUrl): RouteExpression; | ||
readonly siblings: readonly ScopedSegmentExpressionOrHigher[]; | ||
get kind(): ExpressionKind.CompositeSegment; | ||
get kind(): 'CompositeSegment'; | ||
constructor(siblings: readonly ScopedSegmentExpressionOrHigher[]); | ||
@@ -75,3 +64,3 @@ } | ||
readonly right: ScopedSegmentExpressionOrHigher; | ||
get kind(): ExpressionKind.ScopedSegment; | ||
get kind(): 'ScopedSegment'; | ||
constructor(left: SegmentGroupExpressionOrHigher, right: ScopedSegmentExpressionOrHigher); | ||
@@ -112,3 +101,3 @@ } | ||
readonly expression: CompositeSegmentExpressionOrHigher; | ||
get kind(): ExpressionKind.SegmentGroup; | ||
get kind(): 'SegmentGroup'; | ||
constructor(expression: CompositeSegmentExpressionOrHigher); | ||
@@ -123,3 +112,3 @@ } | ||
readonly scoped: boolean; | ||
get kind(): ExpressionKind.Segment; | ||
get kind(): 'Segment'; | ||
static get Empty(): SegmentExpression; | ||
@@ -131,3 +120,3 @@ constructor(component: ComponentExpression, viewport: ViewportExpression, scoped: boolean); | ||
readonly parameterList: ParameterListExpression; | ||
get kind(): ExpressionKind.Component; | ||
get kind(): 'Component'; | ||
static get Empty(): ComponentExpression; | ||
@@ -154,3 +143,3 @@ /** | ||
readonly name: string | null; | ||
get kind(): ExpressionKind.Viewport; | ||
get kind(): 'Viewport'; | ||
static get Empty(): ViewportExpression; | ||
@@ -161,3 +150,3 @@ constructor(name: string | null); | ||
readonly expressions: readonly ParameterExpression[]; | ||
get kind(): ExpressionKind.ParameterList; | ||
get kind(): 'ParameterList'; | ||
static get Empty(): ParameterListExpression; | ||
@@ -169,3 +158,3 @@ constructor(expressions: readonly ParameterExpression[]); | ||
readonly value: string; | ||
get kind(): ExpressionKind.Parameter; | ||
get kind(): 'Parameter'; | ||
static get Empty(): ParameterExpression; | ||
@@ -172,0 +161,0 @@ constructor(key: string, value: string); |
{ | ||
"name": "@aurelia/router-lite", | ||
"version": "2.0.0-beta.9", | ||
"version": "2.0.0-beta.10", | ||
"main": "dist/cjs/index.cjs", | ||
"module": "dist/esm/index.mjs", | ||
"exports": { | ||
"types": "./dist/types/index.d.ts", | ||
"require": "./dist/cjs/index.cjs", | ||
"import": "./dist/esm/index.mjs", | ||
"development": "./dist/esm/index.dev.mjs" | ||
".": { | ||
"types": "./dist/types/index.d.ts", | ||
"require": "./dist/cjs/index.cjs", | ||
"import": "./dist/esm/index.mjs", | ||
"development": "./dist/esm/index.dev.mjs" | ||
}, | ||
"./development": { | ||
"types": "./dist/types/index.d.ts", | ||
"require": "./dist/cjs/index.dev.cjs", | ||
"import": "./dist/esm/index.dev.mjs" | ||
} | ||
}, | ||
@@ -49,9 +56,9 @@ "types": "dist/types/index.d.ts", | ||
"dependencies": { | ||
"@aurelia/kernel": "2.0.0-beta.9", | ||
"@aurelia/metadata": "2.0.0-beta.9", | ||
"@aurelia/platform": "2.0.0-beta.9", | ||
"@aurelia/platform-browser": "2.0.0-beta.9", | ||
"@aurelia/route-recognizer": "2.0.0-beta.9", | ||
"@aurelia/runtime": "2.0.0-beta.9", | ||
"@aurelia/runtime-html": "2.0.0-beta.9" | ||
"@aurelia/kernel": "2.0.0-beta.10", | ||
"@aurelia/metadata": "2.0.0-beta.10", | ||
"@aurelia/platform": "2.0.0-beta.10", | ||
"@aurelia/platform-browser": "2.0.0-beta.10", | ||
"@aurelia/route-recognizer": "2.0.0-beta.10", | ||
"@aurelia/runtime": "2.0.0-beta.10", | ||
"@aurelia/runtime-html": "2.0.0-beta.10" | ||
}, | ||
@@ -58,0 +65,0 @@ "devDependencies": { |
@@ -70,2 +70,3 @@ import { isObject } from '@aurelia/metadata'; | ||
Registration.instance(RouterOptions, routerOptions), | ||
AppTask.creating(IRouter, _ => { /* ensure a router instance before the app root is instantiated and there by ensuring all the necessary aliases. */ }), | ||
AppTask.hydrated(IContainer, RouteContext.setRoot), | ||
@@ -72,0 +73,0 @@ AppTask.activated(IRouter, router => router.start(true)), |
@@ -66,3 +66,3 @@ export { | ||
ParameterExpression, | ||
ExpressionKind, | ||
type ExpressionKind, | ||
} from './route-expression'; | ||
@@ -69,0 +69,0 @@ |
import { | ||
BindingMode, | ||
customAttribute, | ||
@@ -16,2 +15,3 @@ bindable, | ||
import { resolve } from '@aurelia/kernel'; | ||
import { bmToView } from '../util'; | ||
@@ -38,3 +38,3 @@ /* | ||
@bindable({ mode: BindingMode.toView }) | ||
@bindable({ mode: bmToView }) | ||
public value: unknown; | ||
@@ -41,0 +41,0 @@ |
import { IDisposable, IIndexable, resolve } from '@aurelia/kernel'; | ||
import { | ||
BindingMode, | ||
customAttribute, | ||
@@ -16,2 +15,3 @@ bindable, | ||
import { ILocationManager } from '../location-manager'; | ||
import { bmFromView, bmToView } from '../util'; | ||
@@ -27,12 +27,12 @@ @customAttribute('load') | ||
@bindable({ mode: BindingMode.toView, primary: true, callback: 'valueChanged' }) | ||
@bindable({ mode: bmToView, primary: true, callback: 'valueChanged' }) | ||
public route: unknown; | ||
@bindable({ mode: BindingMode.toView, callback: 'valueChanged' }) | ||
@bindable({ mode: bmToView, callback: 'valueChanged' }) | ||
public params?: Params; | ||
@bindable({ mode: BindingMode.toView }) | ||
@bindable({ mode: bmToView }) | ||
public attribute: string = 'href'; | ||
@bindable({ mode: BindingMode.fromView }) | ||
@bindable({ mode: bmFromView }) | ||
public active: boolean = false; | ||
@@ -43,3 +43,3 @@ | ||
*/ | ||
@bindable({ mode: BindingMode.toView, callback: 'valueChanged' }) | ||
@bindable({ mode: bmToView, callback: 'valueChanged' }) | ||
public context?: IRouteContext; | ||
@@ -46,0 +46,0 @@ |
@@ -629,2 +629,6 @@ import { | ||
} else { | ||
if (!param.satisfiesPattern(value)) { | ||
errors.push(`The value '${value}' for the parameter '${key}' does not satisfy the pattern '${param.pattern}'.`); | ||
return null; | ||
} | ||
consumed[key] = value; | ||
@@ -631,0 +635,0 @@ } |
@@ -101,14 +101,3 @@ // The commented-out terminal symbols below are for reference / potential future need (should there be use cases to loosen up the syntax) | ||
export const enum ExpressionKind { | ||
Route, | ||
CompositeSegment, | ||
ScopedSegment, | ||
SegmentGroup, | ||
Segment, | ||
Component, | ||
Action, | ||
Viewport, | ||
ParameterList, | ||
Parameter, | ||
} | ||
export type ExpressionKind = 'Route' | 'CompositeSegment' | 'ScopedSegment' | 'SegmentGroup' | 'Segment' | 'Component' | 'Action' | 'Viewport' | 'ParameterList' | 'Parameter'; | ||
@@ -119,3 +108,3 @@ const cache = new Map<string, RouteExpression>(); | ||
export class RouteExpression { | ||
public get kind(): ExpressionKind.Route { return ExpressionKind.Route; } | ||
public get kind(): 'Route' { return 'Route'; } | ||
@@ -209,3 +198,3 @@ public constructor( | ||
export class CompositeSegmentExpression { | ||
public get kind(): ExpressionKind.CompositeSegment { return ExpressionKind.CompositeSegment; } | ||
public get kind(): 'CompositeSegment' { return 'CompositeSegment'; } | ||
@@ -277,3 +266,3 @@ public constructor( | ||
export class ScopedSegmentExpression { | ||
public get kind(): ExpressionKind.ScopedSegment { return ExpressionKind.ScopedSegment; } | ||
public get kind(): 'ScopedSegment' { return 'ScopedSegment'; } | ||
@@ -347,3 +336,3 @@ public constructor( | ||
export class SegmentGroupExpression { | ||
public get kind(): ExpressionKind.SegmentGroup { return ExpressionKind.SegmentGroup; } | ||
public get kind(): 'SegmentGroup' { return 'SegmentGroup'; } | ||
@@ -380,3 +369,3 @@ public constructor( | ||
export class SegmentExpression { | ||
public get kind(): ExpressionKind.Segment { return ExpressionKind.Segment; } | ||
public get kind(): 'Segment' { return 'Segment'; } | ||
@@ -418,3 +407,3 @@ public static get Empty(): SegmentExpression { return new SegmentExpression(ComponentExpression.Empty, ViewportExpression.Empty, true); } | ||
export class ComponentExpression { | ||
public get kind(): ExpressionKind.Component { return ExpressionKind.Component; } | ||
public get kind(): 'Component' { return 'Component'; } | ||
@@ -495,3 +484,3 @@ public static get Empty(): ComponentExpression { return new ComponentExpression('', ParameterListExpression.Empty); } | ||
export class ViewportExpression { | ||
public get kind(): ExpressionKind.Viewport { return ExpressionKind.Viewport; } | ||
public get kind(): 'Viewport' { return 'Viewport'; } | ||
@@ -527,3 +516,3 @@ public static get Empty(): ViewportExpression { return new ViewportExpression(''); } | ||
export class ParameterListExpression { | ||
public get kind(): ExpressionKind.ParameterList { return ExpressionKind.ParameterList; } | ||
public get kind(): 'ParameterList' { return 'ParameterList'; } | ||
@@ -565,3 +554,3 @@ public static get Empty(): ParameterListExpression { return new ParameterListExpression([]); } | ||
export class ParameterExpression { | ||
public get kind(): ExpressionKind.Parameter { return ExpressionKind.Parameter; } | ||
public get kind(): 'Parameter' { return 'Parameter'; } | ||
@@ -568,0 +557,0 @@ public static get Empty(): ParameterExpression { return new ParameterExpression('', ''); } |
@@ -32,3 +32,2 @@ import { | ||
import { | ||
ExpressionKind, | ||
RouteExpression, | ||
@@ -591,4 +590,4 @@ type ScopedSegmentExpression, | ||
switch (origPath.root.kind) { | ||
case ExpressionKind.ScopedSegment: | ||
case ExpressionKind.Segment: | ||
case 'ScopedSegment': | ||
case 'Segment': | ||
origCur = origPath.root; | ||
@@ -600,4 +599,4 @@ break; | ||
switch (redirPath.root.kind) { | ||
case ExpressionKind.ScopedSegment: | ||
case ExpressionKind.Segment: | ||
case 'ScopedSegment': | ||
case 'Segment': | ||
redirCur = redirPath.root; | ||
@@ -616,10 +615,10 @@ break; | ||
origSeg = null; | ||
} else if (origCur.kind === ExpressionKind.Segment) { | ||
} else if (origCur.kind === 'Segment') { | ||
origSeg = origCur; | ||
origDone = true; | ||
} else if (origCur.left.kind === ExpressionKind.Segment) { | ||
} else if (origCur.left.kind === 'Segment') { | ||
origSeg = origCur.left; | ||
switch (origCur.right.kind) { | ||
case ExpressionKind.ScopedSegment: | ||
case ExpressionKind.Segment: | ||
case 'ScopedSegment': | ||
case 'Segment': | ||
origCur = origCur.right; | ||
@@ -635,10 +634,10 @@ break; | ||
redirSeg = null; | ||
} else if (redirCur.kind === ExpressionKind.Segment) { | ||
} else if (redirCur.kind === 'Segment') { | ||
redirSeg = redirCur; | ||
redirDone = true; | ||
} else if (redirCur.left.kind === ExpressionKind.Segment) { | ||
} else if (redirCur.left.kind === 'Segment') { | ||
redirSeg = redirCur.left; | ||
switch (redirCur.right.kind) { | ||
case ExpressionKind.ScopedSegment: | ||
case ExpressionKind.Segment: | ||
case 'ScopedSegment': | ||
case 'Segment': | ||
redirCur = redirCur.right; | ||
@@ -645,0 +644,0 @@ break; |
import { Params } from './instructions'; | ||
import type { RouteNode } from './route-tree'; | ||
import { BindingMode } from '@aurelia/runtime-html'; | ||
@@ -106,5 +107,9 @@ export type UnwrapPromise<T> = T extends Promise<infer R> ? R : T; | ||
for(const [key, value] of Object.entries(other)) { | ||
query.append(key, value!); | ||
if (value == null) continue; | ||
query.append(key, value); | ||
} | ||
return query; | ||
} | ||
/** @internal */ export const bmToView = BindingMode.toView; | ||
/** @internal */ export const bmFromView = BindingMode.fromView; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2115057
34729
+ Added@aurelia/kernel@2.0.0-beta.10(transitive)
+ Added@aurelia/metadata@2.0.0-beta.10(transitive)
+ Added@aurelia/platform@2.0.0-beta.10(transitive)
+ Added@aurelia/platform-browser@2.0.0-beta.10(transitive)
+ Added@aurelia/route-recognizer@2.0.0-beta.10(transitive)
+ Added@aurelia/runtime@2.0.0-beta.10(transitive)
+ Added@aurelia/runtime-html@2.0.0-beta.10(transitive)
- Removed@aurelia/kernel@2.0.0-beta.9(transitive)
- Removed@aurelia/metadata@2.0.0-beta.9(transitive)
- Removed@aurelia/platform@2.0.0-beta.9(transitive)
- Removed@aurelia/platform-browser@2.0.0-beta.9(transitive)
- Removed@aurelia/route-recognizer@2.0.0-beta.9(transitive)
- Removed@aurelia/runtime@2.0.0-beta.9(transitive)
- Removed@aurelia/runtime-html@2.0.0-beta.9(transitive)