@a11d/lit-application 0.0.38 → 0.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/Application.d.ts +22 -22
  2. package/dist/Application.js +113 -112
  3. package/dist/Dialog/Dialog.d.ts +21 -21
  4. package/dist/Dialog/Dialog.js +1 -1
  5. package/dist/Dialog/DialogCancelledError.d.ts +4 -4
  6. package/dist/Dialog/DialogCancelledError.js +5 -5
  7. package/dist/Dialog/DialogComponent.d.ts +44 -44
  8. package/dist/Dialog/DialogComponent.js +164 -163
  9. package/dist/Dialog/DialogHost.d.ts +10 -10
  10. package/dist/Dialog/DialogHost.js +13 -13
  11. package/dist/Dialog/PageDialog.d.ts +12 -12
  12. package/dist/Dialog/PageDialog.js +23 -23
  13. package/dist/Dialog/index.d.ts +5 -5
  14. package/dist/Dialog/index.js +5 -5
  15. package/dist/Notification/NotificationComponent.d.ts +5 -5
  16. package/dist/Notification/NotificationComponent.js +1 -1
  17. package/dist/Notification/NotificationHost.d.ts +43 -43
  18. package/dist/Notification/NotificationHost.js +93 -93
  19. package/dist/Notification/index.d.ts +2 -2
  20. package/dist/Notification/index.js +2 -2
  21. package/dist/Page/Page.d.ts +5 -5
  22. package/dist/Page/Page.js +1 -1
  23. package/dist/Page/PageComponent.d.ts +21 -21
  24. package/dist/Page/PageComponent.js +40 -39
  25. package/dist/Page/PageError.d.ts +17 -17
  26. package/dist/Page/PageError.js +69 -69
  27. package/dist/Page/PageHost.d.ts +10 -10
  28. package/dist/Page/PageHost.js +19 -19
  29. package/dist/Page/index.d.ts +4 -4
  30. package/dist/Page/index.js +4 -4
  31. package/dist/PwaHelper/Manifest.d.ts +17 -17
  32. package/dist/PwaHelper/Manifest.js +1 -1
  33. package/dist/PwaHelper/ManifestProvider.d.ts +4 -4
  34. package/dist/PwaHelper/ManifestProvider.js +17 -17
  35. package/dist/PwaHelper/PwaHelper.d.ts +15 -15
  36. package/dist/PwaHelper/PwaHelper.js +40 -40
  37. package/dist/PwaHelper/index.d.ts +3 -3
  38. package/dist/PwaHelper/index.js +3 -3
  39. package/dist/Router/Router.d.ts +16 -16
  40. package/dist/Router/Router.js +39 -38
  41. package/dist/Router/RouterController.d.ts +9 -9
  42. package/dist/Router/RouterController.js +27 -27
  43. package/dist/Router/RoutesContainer.d.ts +18 -18
  44. package/dist/Router/RoutesContainer.js +9 -9
  45. package/dist/Router/index.d.ts +5 -5
  46. package/dist/Router/index.js +5 -5
  47. package/dist/Router/route.d.ts +5 -5
  48. package/dist/Router/route.js +20 -20
  49. package/dist/Router/routerLink.d.ts +26 -26
  50. package/dist/Router/routerLink.js +109 -109
  51. package/dist/index.d.ts +7 -7
  52. package/dist/index.js +7 -7
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/dist/utilities/HookSet.d.ts +4 -4
  55. package/dist/utilities/HookSet.js +5 -5
  56. package/dist/utilities/HttpError.d.ts +6 -6
  57. package/dist/utilities/HttpError.js +47 -46
  58. package/dist/utilities/HttpErrorCode.d.ts +40 -40
  59. package/dist/utilities/HttpErrorCode.js +1 -1
  60. package/dist/utilities/RootCssInjectorController.d.ts +11 -11
  61. package/dist/utilities/RootCssInjectorController.js +20 -20
  62. package/dist/utilities/WindowHelper.d.ts +9 -9
  63. package/dist/utilities/WindowHelper.js +22 -21
  64. package/dist/utilities/index.d.ts +9 -9
  65. package/dist/utilities/index.js +9 -9
  66. package/dist/utilities/nonInertable.d.ts +2 -2
  67. package/dist/utilities/nonInertable.js +11 -11
  68. package/dist/utilities/queryInstanceElement.d.ts +2 -2
  69. package/dist/utilities/queryInstanceElement.js +9 -9
  70. package/dist/utilities/querySymbolizedElement.d.ts +2 -2
  71. package/dist/utilities/querySymbolizedElement.js +14 -14
  72. package/package.json +40 -40
  73. package/dist/utilities/LocalStorageEntry.d.ts +0 -13
  74. package/dist/utilities/LocalStorageEntry.d.ts.map +0 -1
  75. package/dist/utilities/LocalStorageEntry.js +0 -29
@@ -1,163 +1,164 @@
1
- import { __decorate } from "tslib";
2
- import { Component, eventListener, literal } from '@a11d/lit';
3
- import { LocalStorage } from '@a11d/local-storage';
4
- import { Application, HookSet, querySymbolizedElement, WindowHelper, Key } from '../index.js';
5
- import { PageDialog, DialogCancelledError, DialogHost } from './index.js';
6
- export class DialogComponent extends Component {
7
- static dialogElement() {
8
- return (constructor) => {
9
- constructor[DialogComponent.dialogElementConstructorSymbol] = true;
10
- };
11
- }
12
- static getHost() {
13
- return Promise.resolve(DialogHost.instance ?? Application.instance ?? document.body);
14
- }
15
- get primaryActionElement() { return this.dialogElement.primaryActionElement; }
16
- get secondaryActionElement() { return this.dialogElement.secondaryActionElement; }
17
- get cancellationActionElement() { return this.dialogElement.cancellationActionElement; }
18
- constructor(parameters) {
19
- super();
20
- this.parameters = parameters;
21
- this.handleAction = async (actionKey) => {
22
- const actionByKey = new Map([
23
- ["primary" /* DialogActionKey.Primary */, this.primaryAction],
24
- ["secondary" /* DialogActionKey.Secondary */, this.secondaryAction],
25
- ["cancellation" /* DialogActionKey.Cancellation */, this.cancellationAction],
26
- ]);
27
- // eslint-disable-next-line no-restricted-syntax
28
- const action = actionByKey.get(actionKey)?.bind(this);
29
- if (!action) {
30
- throw new Error(`No action for key ${actionKey}`);
31
- }
32
- try {
33
- this.dialogElement.executingAction = actionKey;
34
- const result = await action();
35
- if (!this.dialogElement.manualClose || actionKey === "cancellation" /* DialogActionKey.Cancellation */) {
36
- this.close(result);
37
- }
38
- }
39
- catch (e) {
40
- notificationHost.notifyError(e.message);
41
- throw e;
42
- }
43
- finally {
44
- this.dialogElement.executingAction = undefined;
45
- }
46
- };
47
- }
48
- async handleBeforeUnload() {
49
- if (this.dialogElement.boundToWindow) {
50
- await this.handleAction("cancellation" /* DialogActionKey.Cancellation */);
51
- }
52
- }
53
- async handleKeyDown(e) {
54
- const host = await DialogComponent.getHost();
55
- if ([...host.children].filter(e => e instanceof DialogComponent).reverse()[0] !== this) {
56
- return;
57
- }
58
- if (this.dialogElement.primaryOnEnter === true && e.key === Key.Enter) {
59
- await this.handleAction("primary" /* DialogActionKey.Primary */);
60
- }
61
- if (!this.dialogElement.preventCancellationOnEscape && e.key === Key.Escape) {
62
- await this.handleAction("cancellation" /* DialogActionKey.Cancellation */);
63
- }
64
- }
65
- async connectedCallback() {
66
- await DialogComponent.connectingHooks.execute(this);
67
- super.connectedCallback();
68
- }
69
- confirm(strategy = 0 /* DialogConfirmationStrategy.Dialog */) {
70
- return strategy === 0 /* DialogConfirmationStrategy.Dialog */
71
- ? this.confirmAsDialog()
72
- : this.confirmAsPopup(strategy);
73
- }
74
- async confirmAsDialog() {
75
- const host = await DialogComponent.getHost();
76
- host.appendChild(this);
77
- return new Promise((resolve, reject) => {
78
- this._confirmationPromiseExecutor = [resolve, reject];
79
- });
80
- }
81
- async confirmAsPopup(strategy) {
82
- this._popupWindow = await WindowHelper.open(PageDialog.route, strategy === 2 /* DialogConfirmationStrategy.Window */ ? 1 /* WindowOpenMode.Window */ : 0 /* WindowOpenMode.Tab */);
83
- const DialogConstructor = this._popupWindow.customElements.get(this.tagName.toLowerCase());
84
- const dialogComponent = new DialogConstructor(this.parameters);
85
- const Constructor = this.constructor;
86
- const propertiesToCopy = [...Constructor.elementProperties.keys()];
87
- // @ts-expect-error property is a key of the elementProperties map
88
- propertiesToCopy.forEach(property => dialogComponent[property] = this[property]);
89
- const app = this._popupWindow.document.querySelector('[application]');
90
- await app.updateComplete;
91
- const page = this._popupWindow.document.querySelector('lit-page-dialog');
92
- const confirmPromise = dialogComponent.confirm();
93
- await dialogComponent.updateComplete;
94
- dialogComponent.dialogElement.dialogHeadingChange.subscribe(heading => page.heading = heading);
95
- dialogComponent.dialogElement.boundToWindow = true;
96
- page.heading = dialogComponent.dialogElement.heading;
97
- return confirmPromise;
98
- }
99
- async pop(strategy = 1 /* DialogConfirmationStrategy.Tab */) {
100
- this.open = false;
101
- try {
102
- const value = await this.confirm(strategy);
103
- this._confirmationPromiseExecutor?.[0](value);
104
- }
105
- catch (error) {
106
- this._confirmationPromiseExecutor?.[1](error);
107
- }
108
- finally {
109
- this._popupWindow?.close();
110
- this.remove();
111
- }
112
- }
113
- close(result) {
114
- this.open = false;
115
- if (result instanceof Error) {
116
- this._confirmationPromiseExecutor?.[1](result);
117
- }
118
- else {
119
- this._confirmationPromiseExecutor?.[0](result);
120
- }
121
- this.remove();
122
- }
123
- get open() { return this.dialogElement.open ?? false; }
124
- set open(value) {
125
- if (this.dialogElement) {
126
- this.dialogElement.open = value;
127
- }
128
- }
129
- firstUpdated(props) {
130
- this.dialogElement.handleAction = this.handleAction;
131
- this.dialogElement.requestPopup?.subscribe(() => this.pop());
132
- if (this.dialogElement.poppable &&
133
- window.location.pathname !== PageDialog.route &&
134
- DialogComponent.poppableConfirmationStrategy.value !== 0 /* DialogConfirmationStrategy.Dialog */) {
135
- this.pop(DialogComponent.poppableConfirmationStrategy.value);
136
- return;
137
- }
138
- this.open = true;
139
- super.firstUpdated(props);
140
- }
141
- primaryAction() {
142
- throw new Error('Not implemented.');
143
- }
144
- secondaryAction() {
145
- return this.cancellationAction();
146
- }
147
- cancellationAction() {
148
- return new DialogCancelledError(this);
149
- }
150
- }
151
- DialogComponent.connectingHooks = new HookSet();
152
- DialogComponent.dialogElementConstructorSymbol = Symbol('DialogComponent.DialogElementConstructor');
153
- DialogComponent.defaultDialogElementTag = literal `lit-dialog`;
154
- DialogComponent.poppableConfirmationStrategy = new LocalStorage('DialogComponent.PoppableConfirmationStrategy', 0 /* DialogConfirmationStrategy.Dialog */);
155
- __decorate([
156
- querySymbolizedElement(DialogComponent.dialogElementConstructorSymbol)
157
- ], DialogComponent.prototype, "dialogElement", void 0);
158
- __decorate([
159
- eventListener({ target: window, type: 'beforeunload' })
160
- ], DialogComponent.prototype, "handleBeforeUnload", null);
161
- __decorate([
162
- eventListener({ target: window, type: 'keydown' })
163
- ], DialogComponent.prototype, "handleKeyDown", null);
1
+ import { __decorate } from "tslib";
2
+ import { Component, eventListener, literal } from '@a11d/lit';
3
+ import { LocalStorage } from '@a11d/local-storage';
4
+ import { Application, HookSet, querySymbolizedElement, WindowHelper, Key } from '../index.js';
5
+ import { PageDialog, DialogCancelledError, DialogHost } from './index.js';
6
+ class DialogComponent extends Component {
7
+ static dialogElement() {
8
+ return (constructor) => {
9
+ constructor[DialogComponent.dialogElementConstructorSymbol] = true;
10
+ };
11
+ }
12
+ static getHost() {
13
+ return Promise.resolve(DialogHost.instance ?? Application.instance ?? document.body);
14
+ }
15
+ get primaryActionElement() { return this.dialogElement.primaryActionElement; }
16
+ get secondaryActionElement() { return this.dialogElement.secondaryActionElement; }
17
+ get cancellationActionElement() { return this.dialogElement.cancellationActionElement; }
18
+ constructor(parameters) {
19
+ super();
20
+ this.parameters = parameters;
21
+ this.handleAction = async (actionKey) => {
22
+ const actionByKey = new Map([
23
+ ["primary" /* DialogActionKey.Primary */, this.primaryAction],
24
+ ["secondary" /* DialogActionKey.Secondary */, this.secondaryAction],
25
+ ["cancellation" /* DialogActionKey.Cancellation */, this.cancellationAction],
26
+ ]);
27
+ // eslint-disable-next-line no-restricted-syntax
28
+ const action = actionByKey.get(actionKey)?.bind(this);
29
+ if (!action) {
30
+ throw new Error(`No action for key ${actionKey}`);
31
+ }
32
+ try {
33
+ this.dialogElement.executingAction = actionKey;
34
+ const result = await action();
35
+ if (!this.dialogElement.manualClose || actionKey === "cancellation" /* DialogActionKey.Cancellation */) {
36
+ this.close(result);
37
+ }
38
+ }
39
+ catch (e) {
40
+ notificationHost.notifyError(e.message);
41
+ throw e;
42
+ }
43
+ finally {
44
+ this.dialogElement.executingAction = undefined;
45
+ }
46
+ };
47
+ }
48
+ async handleBeforeUnload() {
49
+ if (this.dialogElement.boundToWindow) {
50
+ await this.handleAction("cancellation" /* DialogActionKey.Cancellation */);
51
+ }
52
+ }
53
+ async handleKeyDown(e) {
54
+ const host = await DialogComponent.getHost();
55
+ if ([...host.children].filter(e => e instanceof DialogComponent).reverse()[0] !== this) {
56
+ return;
57
+ }
58
+ if (this.dialogElement.primaryOnEnter === true && e.key === Key.Enter) {
59
+ await this.handleAction("primary" /* DialogActionKey.Primary */);
60
+ }
61
+ if (!this.dialogElement.preventCancellationOnEscape && e.key === Key.Escape) {
62
+ await this.handleAction("cancellation" /* DialogActionKey.Cancellation */);
63
+ }
64
+ }
65
+ async connectedCallback() {
66
+ await DialogComponent.connectingHooks.execute(this);
67
+ super.connectedCallback();
68
+ }
69
+ confirm(strategy = 0 /* DialogConfirmationStrategy.Dialog */) {
70
+ return strategy === 0 /* DialogConfirmationStrategy.Dialog */
71
+ ? this.confirmAsDialog()
72
+ : this.confirmAsPopup(strategy);
73
+ }
74
+ async confirmAsDialog() {
75
+ const host = await DialogComponent.getHost();
76
+ host.appendChild(this);
77
+ return new Promise((resolve, reject) => {
78
+ this._confirmationPromiseExecutor = [resolve, reject];
79
+ });
80
+ }
81
+ async confirmAsPopup(strategy) {
82
+ this._popupWindow = await WindowHelper.open(PageDialog.route, strategy === 2 /* DialogConfirmationStrategy.Window */ ? 1 /* WindowOpenMode.Window */ : 0 /* WindowOpenMode.Tab */);
83
+ const DialogConstructor = this._popupWindow.customElements.get(this.tagName.toLowerCase());
84
+ const dialogComponent = new DialogConstructor(this.parameters);
85
+ const Constructor = this.constructor;
86
+ const propertiesToCopy = [...Constructor.elementProperties.keys()];
87
+ // @ts-expect-error property is a key of the elementProperties map
88
+ propertiesToCopy.forEach(property => dialogComponent[property] = this[property]);
89
+ const app = this._popupWindow.document.querySelector('[application]');
90
+ await app.updateComplete;
91
+ const page = this._popupWindow.document.querySelector('lit-page-dialog');
92
+ const confirmPromise = dialogComponent.confirm();
93
+ await dialogComponent.updateComplete;
94
+ dialogComponent.dialogElement.dialogHeadingChange.subscribe(heading => page.heading = heading);
95
+ dialogComponent.dialogElement.boundToWindow = true;
96
+ page.heading = dialogComponent.dialogElement.heading;
97
+ return confirmPromise;
98
+ }
99
+ async pop(strategy = 1 /* DialogConfirmationStrategy.Tab */) {
100
+ this.open = false;
101
+ try {
102
+ const value = await this.confirm(strategy);
103
+ this._confirmationPromiseExecutor?.[0](value);
104
+ }
105
+ catch (error) {
106
+ this._confirmationPromiseExecutor?.[1](error);
107
+ }
108
+ finally {
109
+ this._popupWindow?.close();
110
+ this.remove();
111
+ }
112
+ }
113
+ close(result) {
114
+ this.open = false;
115
+ if (result instanceof Error) {
116
+ this._confirmationPromiseExecutor?.[1](result);
117
+ }
118
+ else {
119
+ this._confirmationPromiseExecutor?.[0](result);
120
+ }
121
+ this.remove();
122
+ }
123
+ get open() { return this.dialogElement.open ?? false; }
124
+ set open(value) {
125
+ if (this.dialogElement) {
126
+ this.dialogElement.open = value;
127
+ }
128
+ }
129
+ firstUpdated(props) {
130
+ this.dialogElement.handleAction = this.handleAction;
131
+ this.dialogElement.requestPopup?.subscribe(() => this.pop());
132
+ if (this.dialogElement.poppable &&
133
+ window.location.pathname !== PageDialog.route &&
134
+ DialogComponent.poppableConfirmationStrategy.value !== 0 /* DialogConfirmationStrategy.Dialog */) {
135
+ this.pop(DialogComponent.poppableConfirmationStrategy.value);
136
+ return;
137
+ }
138
+ this.open = true;
139
+ super.firstUpdated(props);
140
+ }
141
+ primaryAction() {
142
+ throw new Error('Not implemented.');
143
+ }
144
+ secondaryAction() {
145
+ return this.cancellationAction();
146
+ }
147
+ cancellationAction() {
148
+ return new DialogCancelledError(this);
149
+ }
150
+ }
151
+ DialogComponent.connectingHooks = new HookSet();
152
+ DialogComponent.dialogElementConstructorSymbol = Symbol('DialogComponent.DialogElementConstructor');
153
+ DialogComponent.defaultDialogElementTag = literal `lit-dialog`;
154
+ DialogComponent.poppableConfirmationStrategy = new LocalStorage('DialogComponent.PoppableConfirmationStrategy', 0 /* DialogConfirmationStrategy.Dialog */);
155
+ __decorate([
156
+ querySymbolizedElement(DialogComponent.dialogElementConstructorSymbol)
157
+ ], DialogComponent.prototype, "dialogElement", void 0);
158
+ __decorate([
159
+ eventListener({ target: window, type: 'beforeunload' })
160
+ ], DialogComponent.prototype, "handleBeforeUnload", null);
161
+ __decorate([
162
+ eventListener({ target: window, type: 'keydown' })
163
+ ], DialogComponent.prototype, "handleKeyDown", null);
164
+ export { DialogComponent };
@@ -1,11 +1,11 @@
1
- import { Component } from '@a11d/lit';
2
- export declare class DialogHost extends Component {
3
- static readonly instance: DialogHost | undefined;
4
- protected createRenderRoot(): this;
5
- }
6
- declare global {
7
- interface HTMLElementTagNameMap {
8
- 'lit-dialog-host': DialogHost;
9
- }
10
- }
1
+ import { Component } from '@a11d/lit';
2
+ export declare class DialogHost extends Component {
3
+ static readonly instance: DialogHost | undefined;
4
+ protected createRenderRoot(): this;
5
+ }
6
+ declare global {
7
+ interface HTMLElementTagNameMap {
8
+ 'lit-dialog-host': DialogHost;
9
+ }
10
+ }
11
11
  //# sourceMappingURL=DialogHost.d.ts.map
@@ -1,13 +1,13 @@
1
- import { __decorate } from "tslib";
2
- import { Component, component } from '@a11d/lit';
3
- import { queryInstanceElement } from '../index.js';
4
- let DialogHost = class DialogHost extends Component {
5
- createRenderRoot() { return this; }
6
- };
7
- __decorate([
8
- queryInstanceElement()
9
- ], DialogHost, "instance", void 0);
10
- DialogHost = __decorate([
11
- component('lit-dialog-host')
12
- ], DialogHost);
13
- export { DialogHost };
1
+ import { __decorate } from "tslib";
2
+ import { Component, component } from '@a11d/lit';
3
+ import { queryInstanceElement } from '../index.js';
4
+ let DialogHost = class DialogHost extends Component {
5
+ createRenderRoot() { return this; }
6
+ };
7
+ __decorate([
8
+ queryInstanceElement()
9
+ ], DialogHost, "instance", void 0);
10
+ DialogHost = __decorate([
11
+ component('lit-dialog-host')
12
+ ], DialogHost);
13
+ export { DialogHost };
@@ -1,13 +1,13 @@
1
- import { HTMLTemplateResult } from '@a11d/lit';
2
- import { PageComponent } from '../Page/PageComponent.js';
3
- export declare class PageDialog extends PageComponent {
4
- static readonly route = "/dialog";
5
- heading: string;
6
- protected get template(): HTMLTemplateResult;
7
- }
8
- declare global {
9
- interface HTMLElementTagNameMap {
10
- 'lit-page-dialog': PageDialog;
11
- }
12
- }
1
+ import { HTMLTemplateResult } from '@a11d/lit';
2
+ import { PageComponent } from '../Page/PageComponent.js';
3
+ export declare class PageDialog extends PageComponent {
4
+ static readonly route = "/dialog";
5
+ heading: string;
6
+ protected get template(): HTMLTemplateResult;
7
+ }
8
+ declare global {
9
+ interface HTMLElementTagNameMap {
10
+ 'lit-page-dialog': PageDialog;
11
+ }
12
+ }
13
13
  //# sourceMappingURL=PageDialog.d.ts.map
@@ -1,23 +1,23 @@
1
- var PageDialog_1;
2
- import { __decorate } from "tslib";
3
- import { component, state, staticHtml } from '@a11d/lit';
4
- import { PageComponent } from '../Page/PageComponent.js';
5
- import { route } from '../Router/route.js';
6
- let PageDialog = PageDialog_1 = class PageDialog extends PageComponent {
7
- constructor() {
8
- super(...arguments);
9
- this.heading = '';
10
- }
11
- get template() {
12
- return staticHtml `<${PageComponent.defaultPageElementTag} heading=${this.heading}></${PageComponent.defaultPageElementTag}>`;
13
- }
14
- };
15
- PageDialog.route = '/dialog';
16
- __decorate([
17
- state()
18
- ], PageDialog.prototype, "heading", void 0);
19
- PageDialog = PageDialog_1 = __decorate([
20
- route(PageDialog_1.route),
21
- component('lit-page-dialog')
22
- ], PageDialog);
23
- export { PageDialog };
1
+ var PageDialog_1;
2
+ import { __decorate } from "tslib";
3
+ import { component, state, staticHtml } from '@a11d/lit';
4
+ import { PageComponent } from '../Page/PageComponent.js';
5
+ import { route } from '../Router/route.js';
6
+ let PageDialog = PageDialog_1 = class PageDialog extends PageComponent {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.heading = '';
10
+ }
11
+ get template() {
12
+ return staticHtml `<${PageComponent.defaultPageElementTag} heading=${this.heading}></${PageComponent.defaultPageElementTag}>`;
13
+ }
14
+ };
15
+ PageDialog.route = '/dialog';
16
+ __decorate([
17
+ state()
18
+ ], PageDialog.prototype, "heading", void 0);
19
+ PageDialog = PageDialog_1 = __decorate([
20
+ route(PageDialog_1.route),
21
+ component('lit-page-dialog')
22
+ ], PageDialog);
23
+ export { PageDialog };
@@ -1,6 +1,6 @@
1
- export * from './DialogCancelledError.js';
2
- export * from './DialogHost.js';
3
- export * from './DialogComponent.js';
4
- export * from './Dialog.js';
5
- export * from './PageDialog.js';
1
+ export * from './DialogCancelledError.js';
2
+ export * from './DialogHost.js';
3
+ export * from './DialogComponent.js';
4
+ export * from './Dialog.js';
5
+ export * from './PageDialog.js';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,5 @@
1
- export * from './DialogCancelledError.js';
2
- export * from './DialogHost.js';
3
- export * from './DialogComponent.js';
4
- export * from './Dialog.js';
5
- export * from './PageDialog.js';
1
+ export * from './DialogCancelledError.js';
2
+ export * from './DialogHost.js';
3
+ export * from './DialogComponent.js';
4
+ export * from './Dialog.js';
5
+ export * from './PageDialog.js';
@@ -1,6 +1,6 @@
1
- import { Notification } from './NotificationHost.js';
2
- export interface NotificationComponent {
3
- notification: Notification;
4
- show(): Promise<void>;
5
- }
1
+ import { Notification } from './NotificationHost.js';
2
+ export interface NotificationComponent {
3
+ notification: Notification;
4
+ show(): Promise<void>;
5
+ }
6
6
  //# sourceMappingURL=NotificationComponent.d.ts.map
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,44 +1,44 @@
1
- import { Component } from '@a11d/lit';
2
- import { NotificationComponent } from './NotificationComponent.js';
3
- export declare const enum NotificationType {
4
- Info = "info",
5
- Success = "success",
6
- Warning = "warning",
7
- Error = "error"
8
- }
9
- export type Notification = {
10
- type?: NotificationType;
11
- message: string;
12
- actions?: Array<NotificationAction>;
13
- };
14
- type NotificationAction = {
15
- title: string;
16
- handleClick: () => void | PromiseLike<void>;
17
- };
18
- type NonTypedNotification = Omit<Notification, 'type'>;
19
- type NonTypedNotificationParameters = [notification: NonTypedNotification] | [message: string, ...actions: Array<NotificationAction>];
20
- type NonTypedNotificationWithErrorParameters = [notification: Partial<NonTypedNotification>] | [message?: string, ...actions: Array<NotificationAction>];
21
- export declare class NotificationHost extends Component {
22
- static readonly shownNotifications: Set<Notification>;
23
- static readonly instance: NotificationHost | undefined;
24
- static notificationComponent: () => <T extends NotificationComponent>(Constructor: Constructor<T>) => void;
25
- private static NotificationComponentConstructor;
26
- notifyInfo(...notification: NonTypedNotificationParameters): Promise<void>;
27
- notifySuccess(...notification: NonTypedNotificationParameters): Promise<void>;
28
- notifyWarning(...notification: NonTypedNotificationParameters): Promise<void>;
29
- notifyError(...notification: NonTypedNotificationParameters): Promise<void>;
30
- notifyAndThrowError<TError extends Error>(error: TError, ...notification: NonTypedNotificationWithErrorParameters): void;
31
- notify(notification: Notification): Promise<void>;
32
- createRenderRoot(): this;
33
- static get styles(): import("@a11d/lit").CSSResult;
34
- private readonly notifications;
35
- protected get template(): import("lit-html").TemplateResult<1>;
36
- }
37
- declare global {
38
- const notificationHost: NotificationHost;
39
- interface HTMLElementTagNameMap {
40
- 'lit-notification-host': NotificationHost;
41
- }
42
- }
43
- export {};
1
+ import { Component } from '@a11d/lit';
2
+ import { NotificationComponent } from './NotificationComponent.js';
3
+ export declare const enum NotificationType {
4
+ Info = "info",
5
+ Success = "success",
6
+ Warning = "warning",
7
+ Error = "error"
8
+ }
9
+ export type Notification = {
10
+ type?: NotificationType;
11
+ message: string;
12
+ actions?: Array<NotificationAction>;
13
+ };
14
+ type NotificationAction = {
15
+ title: string;
16
+ handleClick: () => void | PromiseLike<void>;
17
+ };
18
+ type NonTypedNotification = Omit<Notification, 'type'>;
19
+ type NonTypedNotificationParameters = [notification: NonTypedNotification] | [message: string, ...actions: Array<NotificationAction>];
20
+ type NonTypedNotificationWithErrorParameters = [notification: Partial<NonTypedNotification>] | [message?: string, ...actions: Array<NotificationAction>];
21
+ export declare class NotificationHost extends Component {
22
+ static readonly shownNotifications: Set<Notification>;
23
+ static readonly instance: NotificationHost | undefined;
24
+ static notificationComponent: () => <T extends NotificationComponent>(Constructor: Constructor<T>) => void;
25
+ private static NotificationComponentConstructor;
26
+ notifyInfo(...notification: NonTypedNotificationParameters): Promise<void>;
27
+ notifySuccess(...notification: NonTypedNotificationParameters): Promise<void>;
28
+ notifyWarning(...notification: NonTypedNotificationParameters): Promise<void>;
29
+ notifyError(...notification: NonTypedNotificationParameters): Promise<void>;
30
+ notifyAndThrowError<TError extends Error>(error: TError, ...notification: NonTypedNotificationWithErrorParameters): void;
31
+ notify(notification: Notification): Promise<void>;
32
+ createRenderRoot(): this;
33
+ static get styles(): import("@a11d/lit").CSSResult;
34
+ private readonly notifications;
35
+ protected get template(): import("lit-html").TemplateResult<1>;
36
+ }
37
+ declare global {
38
+ const notificationHost: NotificationHost;
39
+ interface HTMLElementTagNameMap {
40
+ 'lit-notification-host': NotificationHost;
41
+ }
42
+ }
43
+ export {};
44
44
  //# sourceMappingURL=NotificationHost.d.ts.map