@aurelia/router-lite
Advanced tools
Comparing version 2.0.1-dev.202404041108 to 2.0.1-dev.202404170324
@@ -1,3 +0,4 @@ | ||
import { ICustomAttributeViewModel, ICustomAttributeController } from '@aurelia/runtime-html'; | ||
import { type ICustomAttributeViewModel, type ICustomAttributeController, type CustomAttributeStaticAuDefinition } from '@aurelia/runtime-html'; | ||
export declare class HrefCustomAttribute implements ICustomAttributeViewModel { | ||
static readonly $au: CustomAttributeStaticAuDefinition; | ||
value: unknown; | ||
@@ -4,0 +5,0 @@ readonly $controller: ICustomAttributeController<this>; |
@@ -36,3 +36,3 @@ import { Constructable, ResourceType } from '@aurelia/kernel'; | ||
export type RouteType<T extends Constructable = Constructable> = ResourceType<T, InstanceType<T>, IRouteConfig>; | ||
export type RouteDecorator = <T extends Constructable>(Type: T) => T; | ||
export type RouteDecorator = <T extends Constructable>(Type: T, context: ClassDecoratorContext<T>) => T; | ||
/** | ||
@@ -39,0 +39,0 @@ * Associate a static route configuration with this type. |
{ | ||
"name": "@aurelia/router-lite", | ||
"version": "2.0.1-dev.202404041108", | ||
"version": "2.0.1-dev.202404170324", | ||
"main": "dist/cjs/index.cjs", | ||
@@ -57,9 +57,9 @@ "module": "dist/esm/index.mjs", | ||
"dependencies": { | ||
"@aurelia/kernel": "2.0.1-dev.202404041108", | ||
"@aurelia/metadata": "2.0.1-dev.202404041108", | ||
"@aurelia/platform": "2.0.1-dev.202404041108", | ||
"@aurelia/platform-browser": "2.0.1-dev.202404041108", | ||
"@aurelia/route-recognizer": "2.0.1-dev.202404041108", | ||
"@aurelia/runtime": "2.0.1-dev.202404041108", | ||
"@aurelia/runtime-html": "2.0.1-dev.202404041108" | ||
"@aurelia/kernel": "2.0.1-dev.202404170324", | ||
"@aurelia/metadata": "2.0.1-dev.202404170324", | ||
"@aurelia/platform": "2.0.1-dev.202404170324", | ||
"@aurelia/platform-browser": "2.0.1-dev.202404170324", | ||
"@aurelia/route-recognizer": "2.0.1-dev.202404170324", | ||
"@aurelia/runtime": "2.0.1-dev.202404170324", | ||
"@aurelia/runtime-html": "2.0.1-dev.202404170324" | ||
}, | ||
@@ -66,0 +66,0 @@ "devDependencies": { |
import { | ||
customAttribute, | ||
bindable, | ||
ICustomAttributeViewModel, | ||
ICustomAttributeController, | ||
type ICustomAttributeViewModel, | ||
type ICustomAttributeController, | ||
INode, | ||
IWindow, | ||
getRef, CustomAttribute | ||
getRef, | ||
CustomAttribute, | ||
type CustomAttributeStaticAuDefinition | ||
} from '@aurelia/runtime-html'; | ||
@@ -30,4 +30,11 @@ | ||
@customAttribute({ name: 'href', noMultiBindings: true }) | ||
export class HrefCustomAttribute implements ICustomAttributeViewModel { | ||
public static readonly $au: CustomAttributeStaticAuDefinition = { | ||
type: 'custom-attribute', | ||
name: 'href', | ||
noMultiBindings: true, | ||
bindables: { | ||
value: { mode: bmToView } | ||
} | ||
}; | ||
@@ -38,3 +45,2 @@ /** @internal */private readonly _el: INode<HTMLElement> = resolve<INode<HTMLElement>>(INode as unknown as INode<HTMLElement>); | ||
@bindable({ mode: bmToView }) | ||
public value: unknown; | ||
@@ -41,0 +47,0 @@ |
import { IDisposable, IIndexable, resolve } from '@aurelia/kernel'; | ||
import { | ||
customAttribute, | ||
bindable, | ||
ICustomAttributeViewModel, | ||
INode, | ||
CustomElement, | ||
CustomAttribute, | ||
} from '@aurelia/runtime-html'; | ||
@@ -17,3 +16,2 @@ | ||
@customAttribute('load') | ||
export class LoadCustomAttribute implements ICustomAttributeViewModel { | ||
@@ -27,12 +25,5 @@ | ||
@bindable({ mode: bmToView, primary: true, callback: 'valueChanged' }) | ||
public route: unknown; | ||
@bindable({ mode: bmToView, callback: 'valueChanged' }) | ||
public params?: Params; | ||
@bindable({ mode: bmToView }) | ||
public attribute: string = 'href'; | ||
@bindable({ mode: bmFromView }) | ||
public active: boolean = false; | ||
@@ -43,3 +34,2 @@ | ||
*/ | ||
@bindable({ mode: bmToView, callback: 'valueChanged' }) | ||
public context?: IRouteContext; | ||
@@ -142,1 +132,11 @@ | ||
} | ||
CustomAttribute.define({ | ||
name: 'load', | ||
bindables: { | ||
route: { mode: bmToView, primary: true, callback: 'valueChanged' }, | ||
params: { mode: bmToView, callback: 'valueChanged' }, | ||
attribute: { mode: bmToView }, | ||
active: { mode: bmFromView }, | ||
context: { mode: bmToView, callback: 'valueChanged' } | ||
} | ||
}, LoadCustomAttribute); |
import { Constructable, ILogger, resolve } from '@aurelia/kernel'; | ||
import { | ||
bindable, | ||
customElement, | ||
CustomElement, | ||
@@ -28,8 +26,7 @@ ICompiledCustomElementController, | ||
@customElement({ name: 'au-viewport' }) | ||
export class ViewportCustomElement implements ICustomElementViewModel, IViewport { | ||
@bindable public name: string = defaultViewportName; | ||
@bindable public usedBy: string = ''; | ||
@bindable public default: string = ''; | ||
@bindable public fallback: Routeable | FallbackFunction = ''; | ||
public name: string = defaultViewportName; | ||
public usedBy: string = ''; | ||
public default: string = ''; | ||
public fallback: Routeable | FallbackFunction = ''; | ||
@@ -101,2 +98,6 @@ /** @internal */ private _agent: ViewportAgent = (void 0)!; | ||
} | ||
CustomElement.define({ | ||
name: 'au-viewport', | ||
bindables: ['name', 'usedBy', 'default', 'fallback'], | ||
}, ViewportCustomElement); | ||
@@ -103,0 +104,0 @@ const props = [ |
@@ -213,3 +213,3 @@ import { Metadata } from '@aurelia/metadata'; | ||
isConfigured(Type: RouteType): boolean { | ||
return Metadata.hasOwn(Route.name, Type); | ||
return Metadata.has(Route.name, Type); | ||
}, | ||
@@ -224,3 +224,3 @@ /** | ||
const config = RouteConfig._create(configOrPath, Type); | ||
Metadata.define(Route.name, config, Type); | ||
Metadata.define(config, Type, Route.name); | ||
@@ -239,3 +239,3 @@ return Type; | ||
return Metadata.getOwn(Route.name, Type) as RouteConfig; | ||
return Metadata.get(Route.name, Type)!; | ||
}, | ||
@@ -245,3 +245,3 @@ }; | ||
export type RouteType<T extends Constructable = Constructable> = ResourceType<T, InstanceType<T>, IRouteConfig>; | ||
export type RouteDecorator = <T extends Constructable>(Type: T) => T; | ||
export type RouteDecorator = <T extends Constructable>(Type: T, context: ClassDecoratorContext<T>) => T; | ||
@@ -271,4 +271,7 @@ /** | ||
export function route(configOrPath: IRouteConfig | string | string[]): RouteDecorator { | ||
return function (target) { | ||
return Route.configure(configOrPath, target); | ||
return function (target, context) { | ||
context.addInitializer(function (this) { | ||
Route.configure(configOrPath, this); | ||
}); | ||
return target; | ||
}; | ||
@@ -279,3 +282,3 @@ } | ||
export function resolveRouteConfiguration(routeable: Routeable, isChild: boolean, parent: RouteConfig | null, routeNode: RouteNode | null, context: IRouteContext | null): RouteConfig | Promise<RouteConfig> { | ||
if (isPartialRedirectRouteConfig(routeable)) return RouteConfig._create(routeable, null/* , false */); | ||
if (isPartialRedirectRouteConfig(routeable)) return RouteConfig._create(routeable, null); | ||
@@ -282,0 +285,0 @@ const [instruction, ceDef] = resolveCustomElementDefinition(routeable, context); |
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
2034645
34586
+ Added@aurelia/expression-parser@2.0.1-dev.202404170324(transitive)
+ Added@aurelia/kernel@2.0.1-dev.202404170324(transitive)
+ Added@aurelia/metadata@2.0.1-dev.202404170324(transitive)
+ Added@aurelia/platform@2.0.1-dev.202404170324(transitive)
+ Added@aurelia/platform-browser@2.0.1-dev.202404170324(transitive)
+ Added@aurelia/route-recognizer@2.0.1-dev.202404170324(transitive)
+ Added@aurelia/runtime@2.0.1-dev.202404170324(transitive)
+ Added@aurelia/runtime-html@2.0.1-dev.202404170324(transitive)
- Removed@aurelia/kernel@2.0.1-dev.202404041108(transitive)
- Removed@aurelia/metadata@2.0.1-dev.202404041108(transitive)
- Removed@aurelia/platform@2.0.1-dev.202404041108(transitive)
- Removed@aurelia/platform-browser@2.0.1-dev.202404041108(transitive)
- Removed@aurelia/route-recognizer@2.0.1-dev.202404041108(transitive)
- Removed@aurelia/runtime@2.0.1-dev.202404041108(transitive)
- Removed@aurelia/runtime-html@2.0.1-dev.202404041108(transitive)