@a11d/lit-application
Advanced tools
Comparing version 0.0.21 to 0.0.22
import { Component, PropertyValues } from '@a11d/lit'; | ||
import { HookSet, LocalStorageEntry } from '../index.js'; | ||
import { Dialog } from './index.js'; | ||
export declare type DialogParameters = void | Record<string, any>; | ||
export declare type DialogResult<TResult> = TResult | Error; | ||
export declare type DialogAction<TResult> = DialogResult<TResult> | PromiseLike<DialogResult<TResult>>; | ||
export type DialogParameters = void | Record<string, any>; | ||
export type DialogResult<TResult> = TResult | Error; | ||
export type DialogAction<TResult> = DialogResult<TResult> | PromiseLike<DialogResult<TResult>>; | ||
export declare const enum DialogConfirmationStrategy { | ||
@@ -12,3 +12,3 @@ Dialog = 0, | ||
} | ||
export declare type PopupConfirmationStrategy = Exclude<DialogConfirmationStrategy, DialogConfirmationStrategy.Dialog>; | ||
export type PopupConfirmationStrategy = Exclude<DialogConfirmationStrategy, DialogConfirmationStrategy.Dialog>; | ||
export declare abstract class DialogComponent<T extends DialogParameters = void, TResult = void> extends Component { | ||
@@ -15,0 +15,0 @@ readonly parameters: T; |
import { __decorate } from "tslib"; | ||
import { Component, eventListener, literal } from '@a11d/lit'; | ||
import { Application, HookSet, LocalStorageEntry, querySymbolizedElement, WindowHelper, Key, PageHost } from '../index.js'; | ||
import { Application, HookSet, LocalStorageEntry, querySymbolizedElement, WindowHelper, Key } from '../index.js'; | ||
import { PageDialog, DialogCancelledError, DialogHost } from './index.js'; | ||
export class DialogComponent extends Component { | ||
static dialogElement() { | ||
return (constructor) => { | ||
constructor[DialogComponent.dialogElementConstructorSymbol] = true; | ||
}; | ||
} | ||
static getHost() { | ||
return Promise.resolve(DialogHost.instance ?? Application.instance ?? document.body); | ||
} | ||
get primaryActionElement() { return this.dialogElement.primaryActionElement; } | ||
get secondaryActionElement() { return this.dialogElement.secondaryActionElement; } | ||
get cancellationActionElement() { return this.dialogElement.cancellationActionElement; } | ||
constructor(parameters) { | ||
@@ -36,13 +47,2 @@ super(); | ||
} | ||
static dialogElement() { | ||
return (constructor) => { | ||
constructor[DialogComponent.dialogElementConstructorSymbol] = true; | ||
}; | ||
} | ||
static getHost() { | ||
return Promise.resolve(DialogHost.instance ?? Application.instance ?? document.body); | ||
} | ||
get primaryActionElement() { return this.dialogElement.primaryActionElement; } | ||
get secondaryActionElement() { return this.dialogElement.secondaryActionElement; } | ||
get cancellationActionElement() { return this.dialogElement.cancellationActionElement; } | ||
async handleBeforeUnload() { | ||
@@ -90,3 +90,5 @@ if (this.dialogElement.boundToWindow) { | ||
propertiesToCopy.forEach(property => dialogComponent[property] = this[property]); | ||
const page = PageHost.instance?.querySelector('lit-page-dialog'); | ||
const app = this._popupWindow.document.querySelector('[application]'); | ||
await app.updateComplete; | ||
const page = this._popupWindow.document.querySelector('lit-page-dialog'); | ||
const confirmPromise = dialogComponent.confirm(); | ||
@@ -93,0 +95,0 @@ await dialogComponent.updateComplete; |
@@ -9,3 +9,3 @@ import { Component } from '@a11d/lit'; | ||
} | ||
export declare type Notification = { | ||
export type Notification = { | ||
type?: NotificationType; | ||
@@ -15,9 +15,9 @@ message: string; | ||
}; | ||
declare type NotificationAction = { | ||
type NotificationAction = { | ||
title: string; | ||
handleClick: () => void | PromiseLike<void>; | ||
}; | ||
declare type NonTypedNotification = Omit<Notification, 'type'>; | ||
declare type NonTypedNotificationParameters = [notification: NonTypedNotification] | [message: string, ...actions: Array<NotificationAction>]; | ||
declare type NonTypedNotificationWithErrorParameters = [notification: Partial<NonTypedNotification>] | [message?: string, ...actions: Array<NotificationAction>]; | ||
type NonTypedNotification = Omit<Notification, 'type'>; | ||
type NonTypedNotificationParameters = [notification: NonTypedNotification] | [message: string, ...actions: Array<NotificationAction>]; | ||
type NonTypedNotificationWithErrorParameters = [notification: Partial<NonTypedNotification>] | [message?: string, ...actions: Array<NotificationAction>]; | ||
export declare class NotificationHost extends Component { | ||
@@ -24,0 +24,0 @@ static readonly shownNotifications: Set<Notification>; |
import { Component } from '@a11d/lit'; | ||
import { HookSet } from '../index.js'; | ||
import { Page } from './index.js'; | ||
export declare type PageParameters = void | Record<string, string | number | undefined>; | ||
export type PageParameters = void | Record<string, string | number | undefined>; | ||
export declare const enum PageNavigationStrategy { | ||
@@ -6,0 +6,0 @@ Page = 0, |
@@ -5,6 +5,2 @@ import { __decorate } from "tslib"; | ||
export class PageComponent extends Component { | ||
constructor(parameters) { | ||
super(); | ||
this.parameters = parameters; | ||
} | ||
static pageElement() { | ||
@@ -27,2 +23,6 @@ return (constructor) => { | ||
} | ||
constructor(parameters) { | ||
super(); | ||
this.parameters = parameters; | ||
} | ||
async connectedCallback() { | ||
@@ -29,0 +29,0 @@ await PageComponent.connectingHooks.execute(this); |
@@ -1,2 +0,2 @@ | ||
export declare type Manifest = { | ||
export type Manifest = { | ||
readonly name: string; | ||
@@ -13,3 +13,3 @@ readonly short_name: string; | ||
}; | ||
export declare type ManifestIcon = { | ||
export type ManifestIcon = { | ||
readonly src: string; | ||
@@ -16,0 +16,0 @@ readonly sizes: string; |
import { Component } from '@a11d/lit'; | ||
import type { PageComponent } from '../Page/index.js'; | ||
declare type RouteParameters = [...routes: Array<string>] | [RouterHost: Constructor<Component>, ...routes: Array<string>]; | ||
type RouteParameters = [...routes: Array<string>] | [RouterHost: Constructor<Component>, ...routes: Array<string>]; | ||
export declare const route: (...parameters: RouteParameters) => (pageConstructor: Constructor<PageComponent<any>>) => void; | ||
export {}; | ||
//# sourceMappingURL=route.d.ts.map |
import type { Component } from '@a11d/lit'; | ||
import type { PageComponent } from '../Page/index.js'; | ||
declare type Page = PageComponent<any>; | ||
declare type PageConstructor = Constructor<Page>; | ||
declare type RouterHost = Component; | ||
declare type RouterHostConstructor = Constructor<RouterHost>; | ||
type Page = PageComponent<any>; | ||
type PageConstructor = Constructor<Page>; | ||
type RouterHost = Component; | ||
type RouterHostConstructor = Constructor<RouterHost>; | ||
export declare const enum RouteMatchMode { | ||
@@ -8,0 +8,0 @@ All = "all", |
import { Router as RouterControllerBase } from '@lit-labs/router'; | ||
import { Router } from './Router.js'; | ||
export class RouterController extends RouterControllerBase { | ||
hostConnected() { | ||
this.importDecoratorRoutesIfAvailable(); | ||
super.hostConnected(); | ||
} | ||
constructor(...args) { | ||
@@ -8,6 +12,2 @@ super(...args); | ||
} | ||
hostConnected() { | ||
this.importDecoratorRoutesIfAvailable(); | ||
super.hostConnected(); | ||
} | ||
importDecoratorRoutesIfAvailable() { | ||
@@ -14,0 +14,0 @@ const decoratorRoutes = [...Router.container] |
@@ -5,3 +5,3 @@ import { PartInfo } from '@a11d/lit'; | ||
import { DialogComponent } from '../Dialog/index.js'; | ||
declare type Parameters = { | ||
type Parameters = { | ||
component: PageComponent<any> | DialogComponent<any, any>; | ||
@@ -11,3 +11,3 @@ matchMode?: RouteMatchMode; | ||
}; | ||
declare type ShorthandParametersOrParameters = [component: PageComponent<any> | DialogComponent<any, any>] | [parameters: Parameters]; | ||
type ShorthandParametersOrParameters = [component: PageComponent<any> | DialogComponent<any, any>] | [parameters: Parameters]; | ||
export declare const routerLink: (...values: ShorthandParametersOrParameters) => import("lit-html/directive.js").DirectiveResult<{ | ||
@@ -14,0 +14,0 @@ new (partInfo: PartInfo): { |
{ | ||
"name": "@a11d/lit-application", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"description": "Lit-based application shell.", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
1345
130489