@spectrum-web-components/dialog 1.1.0 → 1.2.0-beta.0
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.
- package/package.json +11 -11
- package/sp-dialog-base.d.ts +6 -0
- package/sp-dialog-base.dev.js +5 -0
- package/sp-dialog-base.dev.js.map +7 -0
- package/sp-dialog-base.js +2 -0
- package/sp-dialog-base.js.map +7 -0
- package/sp-dialog-wrapper.d.ts +6 -0
- package/sp-dialog-wrapper.dev.js +5 -0
- package/sp-dialog-wrapper.dev.js.map +7 -0
- package/sp-dialog-wrapper.js +2 -0
- package/sp-dialog-wrapper.js.map +7 -0
- package/sp-dialog.d.ts +6 -0
- package/sp-dialog.dev.js +5 -0
- package/sp-dialog.dev.js.map +7 -0
- package/sp-dialog.js +2 -0
- package/sp-dialog.js.map +7 -0
- package/src/Dialog.d.ts +47 -0
- package/src/Dialog.dev.js +161 -0
- package/src/Dialog.dev.js.map +7 -0
- package/src/Dialog.js +34 -0
- package/src/Dialog.js.map +7 -0
- package/src/DialogBase.d.ts +51 -0
- package/src/DialogBase.dev.js +213 -0
- package/src/DialogBase.dev.js.map +7 -0
- package/src/DialogBase.js +23 -0
- package/src/DialogBase.js.map +7 -0
- package/src/DialogWrapper.d.ts +38 -0
- package/src/DialogWrapper.dev.js +179 -0
- package/src/DialogWrapper.dev.js.map +7 -0
- package/src/DialogWrapper.js +61 -0
- package/src/DialogWrapper.js.map +7 -0
- package/src/dialog-overrides.css.d.ts +2 -0
- package/src/dialog-overrides.css.dev.js +7 -0
- package/src/dialog-overrides.css.dev.js.map +7 -0
- package/src/dialog-overrides.css.js +4 -0
- package/src/dialog-overrides.css.js.map +7 -0
- package/src/dialog.css.d.ts +2 -0
- package/src/dialog.css.dev.js +7 -0
- package/src/dialog.css.dev.js.map +7 -0
- package/src/dialog.css.js +4 -0
- package/src/dialog.css.js.map +7 -0
- package/src/index.d.ts +3 -0
- package/src/index.dev.js +5 -0
- package/src/index.dev.js.map +7 -0
- package/src/index.js +2 -0
- package/src/index.js.map +7 -0
- package/src/spectrum-dialog.css.d.ts +2 -0
- package/src/spectrum-dialog.css.dev.js +7 -0
- package/src/spectrum-dialog.css.dev.js.map +7 -0
- package/src/spectrum-dialog.css.js +4 -0
- package/src/spectrum-dialog.css.js.map +7 -0
- package/stories/dialog-base.stories.js +230 -0
- package/stories/dialog-base.stories.js.map +7 -0
- package/stories/dialog-wrapper.stories.js +582 -0
- package/stories/dialog-wrapper.stories.js.map +7 -0
- package/stories/dialog.stories.js +510 -0
- package/stories/dialog.stories.js.map +7 -0
- package/stories/images.js +4 -0
- package/stories/images.js.map +7 -0
- package/stories/index.js +41 -0
- package/stories/index.js.map +7 -0
- package/test/benchmark/basic-test.js +20 -0
- package/test/benchmark/basic-test.js.map +7 -0
- package/test/dialog-base.test-vrt.js +5 -0
- package/test/dialog-base.test-vrt.js.map +7 -0
- package/test/dialog-base.test.js +106 -0
- package/test/dialog-base.test.js.map +7 -0
- package/test/dialog-memory.test.js +5 -0
- package/test/dialog-memory.test.js.map +7 -0
- package/test/dialog-wrapper.test-vrt.js +5 -0
- package/test/dialog-wrapper.test-vrt.js.map +7 -0
- package/test/dialog-wrapper.test.js +320 -0
- package/test/dialog-wrapper.test.js.map +7 -0
- package/test/dialog.test-vrt.js +5 -0
- package/test/dialog.test-vrt.js.map +7 -0
- package/test/dialog.test.js +221 -0
- package/test/dialog.test.js.map +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/dialog",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-beta.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -74,15 +74,15 @@
|
|
|
74
74
|
"lit-html"
|
|
75
75
|
],
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@spectrum-web-components/alert-dialog": "^1.
|
|
78
|
-
"@spectrum-web-components/base": "^1.
|
|
79
|
-
"@spectrum-web-components/button": "^1.
|
|
80
|
-
"@spectrum-web-components/button-group": "^1.
|
|
81
|
-
"@spectrum-web-components/divider": "^1.
|
|
82
|
-
"@spectrum-web-components/icons-workflow": "^1.
|
|
83
|
-
"@spectrum-web-components/modal": "^1.
|
|
84
|
-
"@spectrum-web-components/shared": "^1.
|
|
85
|
-
"@spectrum-web-components/underlay": "^1.
|
|
77
|
+
"@spectrum-web-components/alert-dialog": "^1.2.0-beta.0",
|
|
78
|
+
"@spectrum-web-components/base": "^1.2.0-beta.0",
|
|
79
|
+
"@spectrum-web-components/button": "^1.2.0-beta.0",
|
|
80
|
+
"@spectrum-web-components/button-group": "^1.2.0-beta.0",
|
|
81
|
+
"@spectrum-web-components/divider": "^1.2.0-beta.0",
|
|
82
|
+
"@spectrum-web-components/icons-workflow": "^1.2.0-beta.0",
|
|
83
|
+
"@spectrum-web-components/modal": "^1.2.0-beta.0",
|
|
84
|
+
"@spectrum-web-components/shared": "^1.2.0-beta.0",
|
|
85
|
+
"@spectrum-web-components/underlay": "^1.2.0-beta.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@spectrum-css/dialog": "11.0.0-s2-foundations.15"
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"./sp-*.js",
|
|
94
94
|
"./**/*.dev.js"
|
|
95
95
|
],
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "809bd734313fe289067108bf1dea2a48cc103a9f"
|
|
97
97
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-dialog-base.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { DialogBase } from './src/DialogBase.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-dialog-base', DialogBase);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-dialog-base': DialogBase;\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAE9B,cAAc,kBAAkB,UAAU;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-dialog-base.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { DialogBase } from './src/DialogBase.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-dialog-base', DialogBase);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-dialog-base': DialogBase;\n }\n}\n"],
|
|
5
|
+
"mappings": "aAWA,OAAS,cAAAA,MAAkB,sBAC3B,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,iBAAkBD,CAAU",
|
|
6
|
+
"names": ["DialogBase", "defineElement"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-dialog-wrapper.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { DialogWrapper } from './src/DialogWrapper.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-dialog-wrapper', DialogWrapper);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-dialog-wrapper': DialogWrapper;\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAE9B,cAAc,qBAAqB,aAAa;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-dialog-wrapper.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { DialogWrapper } from './src/DialogWrapper.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-dialog-wrapper', DialogWrapper);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-dialog-wrapper': DialogWrapper;\n }\n}\n"],
|
|
5
|
+
"mappings": "aAWA,OAAS,iBAAAA,MAAqB,yBAC9B,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,oBAAqBD,CAAa",
|
|
6
|
+
"names": ["DialogWrapper", "defineElement"]
|
|
7
|
+
}
|
package/sp-dialog.d.ts
ADDED
package/sp-dialog.dev.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-dialog.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { Dialog } from './src/Dialog.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-dialog', Dialog);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-dialog': Dialog;\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAE9B,cAAc,aAAa,MAAM;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/sp-dialog.js
ADDED
package/sp-dialog.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-dialog.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { Dialog } from './src/Dialog.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-dialog', Dialog);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-dialog': Dialog;\n }\n}\n"],
|
|
5
|
+
"mappings": "aAWA,OAAS,UAAAA,MAAc,kBACvB,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,YAAaD,CAAM",
|
|
6
|
+
"names": ["Dialog", "defineElement"]
|
|
7
|
+
}
|
package/src/Dialog.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CSSResultArray, PropertyValues, TemplateResult } from '@spectrum-web-components/base';
|
|
2
|
+
import '@spectrum-web-components/divider/sp-divider.js';
|
|
3
|
+
import '@spectrum-web-components/button/sp-close-button.js';
|
|
4
|
+
import '@spectrum-web-components/button-group/sp-button-group.js';
|
|
5
|
+
import '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js';
|
|
6
|
+
import type { CloseButton } from '@spectrum-web-components/button';
|
|
7
|
+
import { AlertDialog } from '@spectrum-web-components/alert-dialog/src/AlertDialog.js';
|
|
8
|
+
declare const Dialog_base: typeof AlertDialog & {
|
|
9
|
+
new (...args: any[]): import("@spectrum-web-components/shared").SlotPresenceObservingInterface;
|
|
10
|
+
prototype: import("@spectrum-web-components/shared").SlotPresenceObservingInterface;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @element sp-dialog
|
|
14
|
+
*
|
|
15
|
+
* @slot hero - Accepts a hero image to display at the top of the dialog
|
|
16
|
+
* @slot heading - Acts as the heading of the dialog. This should be an actual heading tag `<h1-6 />`
|
|
17
|
+
* @slot - Content not addressed to a specific slot will be interpreted as the main content of the dialog
|
|
18
|
+
* @slot footer - Content addressed to the `footer` will be placed below the main content and to the side of any `[slot='button']` content
|
|
19
|
+
* @slot button - Button elements addressed to this slot may be placed below the content when not delivered in a fullscreen mode
|
|
20
|
+
* @fires close - Announces that the dialog has been closed.
|
|
21
|
+
*/
|
|
22
|
+
export declare class Dialog extends Dialog_base {
|
|
23
|
+
static get styles(): CSSResultArray;
|
|
24
|
+
closeButton?: CloseButton;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use the Alert Dialog component with `variant="error"` instead.
|
|
27
|
+
*/
|
|
28
|
+
error: boolean;
|
|
29
|
+
dismissable: boolean;
|
|
30
|
+
dismissLabel: string;
|
|
31
|
+
protected get hasFooter(): boolean;
|
|
32
|
+
protected get hasButtons(): boolean;
|
|
33
|
+
protected get hasHero(): boolean;
|
|
34
|
+
noDivider: boolean;
|
|
35
|
+
mode?: 'fullscreen' | 'fullscreenTakeover';
|
|
36
|
+
size?: 's' | 'm' | 'l';
|
|
37
|
+
close(): void;
|
|
38
|
+
protected renderHero(): TemplateResult;
|
|
39
|
+
protected renderFooter(): TemplateResult;
|
|
40
|
+
protected renderButtons(): TemplateResult;
|
|
41
|
+
protected renderDismiss(): TemplateResult;
|
|
42
|
+
protected render(): TemplateResult;
|
|
43
|
+
protected shouldUpdate(changes: PropertyValues): boolean;
|
|
44
|
+
protected firstUpdated(changes: PropertyValues): void;
|
|
45
|
+
protected updated(changes: PropertyValues): void;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
5
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
6
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7
|
+
if (decorator = decorators[i])
|
|
8
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9
|
+
if (kind && result) __defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import {
|
|
13
|
+
html,
|
|
14
|
+
nothing
|
|
15
|
+
} from "@spectrum-web-components/base";
|
|
16
|
+
import {
|
|
17
|
+
property,
|
|
18
|
+
query
|
|
19
|
+
} from "@spectrum-web-components/base/src/decorators.js";
|
|
20
|
+
import "@spectrum-web-components/divider/sp-divider.js";
|
|
21
|
+
import "@spectrum-web-components/button/sp-close-button.js";
|
|
22
|
+
import "@spectrum-web-components/button-group/sp-button-group.js";
|
|
23
|
+
import "@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js";
|
|
24
|
+
import { ObserveSlotPresence } from "@spectrum-web-components/shared";
|
|
25
|
+
import styles from "./dialog.css.js";
|
|
26
|
+
import { AlertDialog } from "@spectrum-web-components/alert-dialog/src/AlertDialog.js";
|
|
27
|
+
import { classMap } from "@spectrum-web-components/base/src/directives.js";
|
|
28
|
+
export class Dialog extends ObserveSlotPresence(AlertDialog, [
|
|
29
|
+
'[slot="hero"]',
|
|
30
|
+
'[slot="footer"]',
|
|
31
|
+
'[slot="button"]'
|
|
32
|
+
]) {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.error = false;
|
|
36
|
+
this.dismissable = false;
|
|
37
|
+
this.dismissLabel = "Close";
|
|
38
|
+
this.noDivider = false;
|
|
39
|
+
}
|
|
40
|
+
static get styles() {
|
|
41
|
+
return [styles];
|
|
42
|
+
}
|
|
43
|
+
get hasFooter() {
|
|
44
|
+
return this.getSlotContentPresence('[slot="footer"]');
|
|
45
|
+
}
|
|
46
|
+
get hasButtons() {
|
|
47
|
+
return this.getSlotContentPresence('[slot="button"]');
|
|
48
|
+
}
|
|
49
|
+
/* c8 ignore next 3 */
|
|
50
|
+
get hasHero() {
|
|
51
|
+
return this.getSlotContentPresence('[slot="hero"]');
|
|
52
|
+
}
|
|
53
|
+
close() {
|
|
54
|
+
this.dispatchEvent(
|
|
55
|
+
new Event("close", {
|
|
56
|
+
bubbles: true,
|
|
57
|
+
composed: true,
|
|
58
|
+
cancelable: true
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
renderHero() {
|
|
63
|
+
return html`
|
|
64
|
+
<slot name="hero"></slot>
|
|
65
|
+
`;
|
|
66
|
+
}
|
|
67
|
+
renderFooter() {
|
|
68
|
+
return html`
|
|
69
|
+
<div class="footer">
|
|
70
|
+
<slot name="footer"></slot>
|
|
71
|
+
</div>
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
renderButtons() {
|
|
75
|
+
const classes = {
|
|
76
|
+
"button-group": true,
|
|
77
|
+
"button-group--noFooter": !this.hasFooter
|
|
78
|
+
};
|
|
79
|
+
return html`
|
|
80
|
+
<sp-button-group class=${classMap(classes)}>
|
|
81
|
+
<slot name="button"></slot>
|
|
82
|
+
</sp-button-group>
|
|
83
|
+
`;
|
|
84
|
+
}
|
|
85
|
+
renderDismiss() {
|
|
86
|
+
return html`
|
|
87
|
+
<sp-close-button
|
|
88
|
+
class="close-button"
|
|
89
|
+
label=${this.dismissLabel}
|
|
90
|
+
quiet
|
|
91
|
+
size="m"
|
|
92
|
+
@click=${this.close}
|
|
93
|
+
></sp-close-button>
|
|
94
|
+
`;
|
|
95
|
+
}
|
|
96
|
+
render() {
|
|
97
|
+
return html`
|
|
98
|
+
<div class="grid">
|
|
99
|
+
${this.renderHero()} ${this.renderHeading()}
|
|
100
|
+
${this.error ? html`
|
|
101
|
+
<sp-icon-alert class="type-icon"></sp-icon-alert>
|
|
102
|
+
` : nothing}
|
|
103
|
+
${this.noDivider ? nothing : html`
|
|
104
|
+
<sp-divider size="m" class="divider"></sp-divider>
|
|
105
|
+
`}
|
|
106
|
+
${this.renderContent()}
|
|
107
|
+
${this.hasFooter ? this.renderFooter() : nothing}
|
|
108
|
+
${this.hasButtons ? this.renderButtons() : nothing}
|
|
109
|
+
${this.dismissable ? this.renderDismiss() : nothing}
|
|
110
|
+
</div>
|
|
111
|
+
`;
|
|
112
|
+
}
|
|
113
|
+
shouldUpdate(changes) {
|
|
114
|
+
if (changes.has("mode") && !!this.mode) {
|
|
115
|
+
this.dismissable = false;
|
|
116
|
+
}
|
|
117
|
+
if (changes.has("dismissable") && this.dismissable) {
|
|
118
|
+
this.dismissable = !this.mode;
|
|
119
|
+
}
|
|
120
|
+
return super.shouldUpdate(changes);
|
|
121
|
+
}
|
|
122
|
+
firstUpdated(changes) {
|
|
123
|
+
super.firstUpdated(changes);
|
|
124
|
+
this.setAttribute("role", "dialog");
|
|
125
|
+
}
|
|
126
|
+
updated(changes) {
|
|
127
|
+
super.updated(changes);
|
|
128
|
+
if (changes.has("error") && this.error) {
|
|
129
|
+
if (true) {
|
|
130
|
+
window.__swc.warn(
|
|
131
|
+
this,
|
|
132
|
+
`The "error" attribute of <${this.localName}> has been deprecated. Use the Alert Dialog component with the "variant='error'" instead. "error" will be removed in a future release.`,
|
|
133
|
+
"https://opensource.adobe.com/spectrum-web-components/components/alert-dialog/#error",
|
|
134
|
+
{ level: "deprecation" }
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
__decorateClass([
|
|
141
|
+
query(".close-button")
|
|
142
|
+
], Dialog.prototype, "closeButton", 2);
|
|
143
|
+
__decorateClass([
|
|
144
|
+
property({ type: Boolean, reflect: true })
|
|
145
|
+
], Dialog.prototype, "error", 2);
|
|
146
|
+
__decorateClass([
|
|
147
|
+
property({ type: Boolean, reflect: true })
|
|
148
|
+
], Dialog.prototype, "dismissable", 2);
|
|
149
|
+
__decorateClass([
|
|
150
|
+
property({ type: String, reflect: true, attribute: "dismiss-label" })
|
|
151
|
+
], Dialog.prototype, "dismissLabel", 2);
|
|
152
|
+
__decorateClass([
|
|
153
|
+
property({ type: Boolean, reflect: true, attribute: "no-divider" })
|
|
154
|
+
], Dialog.prototype, "noDivider", 2);
|
|
155
|
+
__decorateClass([
|
|
156
|
+
property({ type: String, reflect: true })
|
|
157
|
+
], Dialog.prototype, "mode", 2);
|
|
158
|
+
__decorateClass([
|
|
159
|
+
property({ type: String, reflect: true })
|
|
160
|
+
], Dialog.prototype, "size", 2);
|
|
161
|
+
//# sourceMappingURL=Dialog.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["Dialog.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n nothing,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport '@spectrum-web-components/divider/sp-divider.js';\nimport '@spectrum-web-components/button/sp-close-button.js';\nimport '@spectrum-web-components/button-group/sp-button-group.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js';\nimport { ObserveSlotPresence } from '@spectrum-web-components/shared';\n\nimport styles from './dialog.css.js';\nimport type { CloseButton } from '@spectrum-web-components/button';\nimport { AlertDialog } from '@spectrum-web-components/alert-dialog/src/AlertDialog.js';\nimport { classMap } from '@spectrum-web-components/base/src/directives.js';\n\n/**\n * @element sp-dialog\n *\n * @slot hero - Accepts a hero image to display at the top of the dialog\n * @slot heading - Acts as the heading of the dialog. This should be an actual heading tag `<h1-6 />`\n * @slot - Content not addressed to a specific slot will be interpreted as the main content of the dialog\n * @slot footer - Content addressed to the `footer` will be placed below the main content and to the side of any `[slot='button']` content\n * @slot button - Button elements addressed to this slot may be placed below the content when not delivered in a fullscreen mode\n * @fires close - Announces that the dialog has been closed.\n */\nexport class Dialog extends ObserveSlotPresence(AlertDialog, [\n '[slot=\"hero\"]',\n '[slot=\"footer\"]',\n '[slot=\"button\"]',\n]) {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @query('.close-button')\n closeButton?: CloseButton;\n\n /**\n * @deprecated Use the Alert Dialog component with `variant=\"error\"` instead.\n */\n @property({ type: Boolean, reflect: true })\n public error = false;\n\n @property({ type: Boolean, reflect: true })\n public dismissable = false;\n\n @property({ type: String, reflect: true, attribute: 'dismiss-label' })\n public dismissLabel = 'Close';\n\n protected get hasFooter(): boolean {\n return this.getSlotContentPresence('[slot=\"footer\"]');\n }\n\n protected get hasButtons(): boolean {\n return this.getSlotContentPresence('[slot=\"button\"]');\n }\n\n /* c8 ignore next 3 */\n protected get hasHero(): boolean {\n return this.getSlotContentPresence('[slot=\"hero\"]');\n }\n\n @property({ type: Boolean, reflect: true, attribute: 'no-divider' })\n public noDivider = false;\n\n @property({ type: String, reflect: true })\n public mode?: 'fullscreen' | 'fullscreenTakeover';\n\n @property({ type: String, reflect: true })\n public size?: 's' | 'm' | 'l';\n\n public close(): void {\n this.dispatchEvent(\n new Event('close', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n }\n\n protected renderHero(): TemplateResult {\n return html`\n <slot name=\"hero\"></slot>\n `;\n }\n\n protected renderFooter(): TemplateResult {\n return html`\n <div class=\"footer\">\n <slot name=\"footer\"></slot>\n </div>\n `;\n }\n\n protected override renderButtons(): TemplateResult {\n const classes = {\n 'button-group': true,\n 'button-group--noFooter': !this.hasFooter,\n };\n return html`\n <sp-button-group class=${classMap(classes)}>\n <slot name=\"button\"></slot>\n </sp-button-group>\n `;\n }\n\n protected renderDismiss(): TemplateResult {\n return html`\n <sp-close-button\n class=\"close-button\"\n label=${this.dismissLabel}\n quiet\n size=\"m\"\n @click=${this.close}\n ></sp-close-button>\n `;\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"grid\">\n ${this.renderHero()} ${this.renderHeading()}\n ${this.error\n ? html`\n <sp-icon-alert class=\"type-icon\"></sp-icon-alert>\n `\n : nothing}\n ${this.noDivider\n ? nothing\n : html`\n <sp-divider size=\"m\" class=\"divider\"></sp-divider>\n `}\n ${this.renderContent()}\n ${this.hasFooter ? this.renderFooter() : nothing}\n ${this.hasButtons ? this.renderButtons() : nothing}\n ${this.dismissable ? this.renderDismiss() : nothing}\n </div>\n `;\n }\n\n protected override shouldUpdate(changes: PropertyValues): boolean {\n if (changes.has('mode') && !!this.mode) {\n this.dismissable = false;\n }\n if (changes.has('dismissable') && this.dismissable) {\n this.dismissable = !this.mode;\n }\n return super.shouldUpdate(changes);\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.setAttribute('role', 'dialog');\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('error') && this.error) {\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"error\" attribute of <${this.localName}> has been deprecated. Use the Alert Dialog component with the \"variant='error'\" instead. \"error\" will be removed in a future release.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/alert-dialog/#error',\n { level: 'deprecation' }\n );\n }\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EACA;AAAA,OAGG;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,SAAS,2BAA2B;AAEpC,OAAO,YAAY;AAEnB,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AAYlB,aAAM,eAAe,oBAAoB,aAAa;AAAA,EACzD;AAAA,EACA;AAAA,EACA;AACJ,CAAC,EAAE;AAAA,EAJI;AAAA;AAgBH,SAAO,QAAQ;AAGf,SAAO,cAAc;AAGrB,SAAO,eAAe;AAgBtB,SAAO,YAAY;AAAA;AAAA,EAjCnB,WAA2B,SAAyB;AAChD,WAAO,CAAC,MAAM;AAA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 +1,34 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var t=(d,i,e,n)=>{for(var r=n>1?void 0:n?c(i,e):i,p=d.length-1,u;p>=0;p--)(u=d[p])&&(r=(n?u(i,e,r):u(r))||r);return n&&r&&a(i,e,r),r};import{html as o,nothing as l}from"@spectrum-web-components/base";import{property as s,query as m}from"@spectrum-web-components/base/src/decorators.js";import"@spectrum-web-components/divider/sp-divider.js";import"@spectrum-web-components/button/sp-close-button.js";import"@spectrum-web-components/button-group/sp-button-group.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js";import{ObserveSlotPresence as b}from"@spectrum-web-components/shared";import h from"./dialog.css.js";import{AlertDialog as f}from"@spectrum-web-components/alert-dialog/src/AlertDialog.js";import{classMap as v}from"@spectrum-web-components/base/src/directives.js";export class Dialog extends b(f,['[slot="hero"]','[slot="footer"]','[slot="button"]']){constructor(){super(...arguments);this.error=!1;this.dismissable=!1;this.dismissLabel="Close";this.noDivider=!1}static get styles(){return[h]}get hasFooter(){return this.getSlotContentPresence('[slot="footer"]')}get hasButtons(){return this.getSlotContentPresence('[slot="button"]')}get hasHero(){return this.getSlotContentPresence('[slot="hero"]')}close(){this.dispatchEvent(new Event("close",{bubbles:!0,composed:!0,cancelable:!0}))}renderHero(){return o`
|
|
2
|
+
<slot name="hero"></slot>
|
|
3
|
+
`}renderFooter(){return o`
|
|
4
|
+
<div class="footer">
|
|
5
|
+
<slot name="footer"></slot>
|
|
6
|
+
</div>
|
|
7
|
+
`}renderButtons(){const e={"button-group":!0,"button-group--noFooter":!this.hasFooter};return o`
|
|
8
|
+
<sp-button-group class=${v(e)}>
|
|
9
|
+
<slot name="button"></slot>
|
|
10
|
+
</sp-button-group>
|
|
11
|
+
`}renderDismiss(){return o`
|
|
12
|
+
<sp-close-button
|
|
13
|
+
class="close-button"
|
|
14
|
+
label=${this.dismissLabel}
|
|
15
|
+
quiet
|
|
16
|
+
size="m"
|
|
17
|
+
@click=${this.close}
|
|
18
|
+
></sp-close-button>
|
|
19
|
+
`}render(){return o`
|
|
20
|
+
<div class="grid">
|
|
21
|
+
${this.renderHero()} ${this.renderHeading()}
|
|
22
|
+
${this.error?o`
|
|
23
|
+
<sp-icon-alert class="type-icon"></sp-icon-alert>
|
|
24
|
+
`:l}
|
|
25
|
+
${this.noDivider?l:o`
|
|
26
|
+
<sp-divider size="m" class="divider"></sp-divider>
|
|
27
|
+
`}
|
|
28
|
+
${this.renderContent()}
|
|
29
|
+
${this.hasFooter?this.renderFooter():l}
|
|
30
|
+
${this.hasButtons?this.renderButtons():l}
|
|
31
|
+
${this.dismissable?this.renderDismiss():l}
|
|
32
|
+
</div>
|
|
33
|
+
`}shouldUpdate(e){return e.has("mode")&&this.mode&&(this.dismissable=!1),e.has("dismissable")&&this.dismissable&&(this.dismissable=!this.mode),super.shouldUpdate(e)}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","dialog")}updated(e){super.updated(e),e.has("error")&&this.error}}t([m(".close-button")],Dialog.prototype,"closeButton",2),t([s({type:Boolean,reflect:!0})],Dialog.prototype,"error",2),t([s({type:Boolean,reflect:!0})],Dialog.prototype,"dismissable",2),t([s({type:String,reflect:!0,attribute:"dismiss-label"})],Dialog.prototype,"dismissLabel",2),t([s({type:Boolean,reflect:!0,attribute:"no-divider"})],Dialog.prototype,"noDivider",2),t([s({type:String,reflect:!0})],Dialog.prototype,"mode",2),t([s({type:String,reflect:!0})],Dialog.prototype,"size",2);
|
|
34
|
+
//# sourceMappingURL=Dialog.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["Dialog.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n nothing,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport '@spectrum-web-components/divider/sp-divider.js';\nimport '@spectrum-web-components/button/sp-close-button.js';\nimport '@spectrum-web-components/button-group/sp-button-group.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js';\nimport { ObserveSlotPresence } from '@spectrum-web-components/shared';\n\nimport styles from './dialog.css.js';\nimport type { CloseButton } from '@spectrum-web-components/button';\nimport { AlertDialog } from '@spectrum-web-components/alert-dialog/src/AlertDialog.js';\nimport { classMap } from '@spectrum-web-components/base/src/directives.js';\n\n/**\n * @element sp-dialog\n *\n * @slot hero - Accepts a hero image to display at the top of the dialog\n * @slot heading - Acts as the heading of the dialog. This should be an actual heading tag `<h1-6 />`\n * @slot - Content not addressed to a specific slot will be interpreted as the main content of the dialog\n * @slot footer - Content addressed to the `footer` will be placed below the main content and to the side of any `[slot='button']` content\n * @slot button - Button elements addressed to this slot may be placed below the content when not delivered in a fullscreen mode\n * @fires close - Announces that the dialog has been closed.\n */\nexport class Dialog extends ObserveSlotPresence(AlertDialog, [\n '[slot=\"hero\"]',\n '[slot=\"footer\"]',\n '[slot=\"button\"]',\n]) {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @query('.close-button')\n closeButton?: CloseButton;\n\n /**\n * @deprecated Use the Alert Dialog component with `variant=\"error\"` instead.\n */\n @property({ type: Boolean, reflect: true })\n public error = false;\n\n @property({ type: Boolean, reflect: true })\n public dismissable = false;\n\n @property({ type: String, reflect: true, attribute: 'dismiss-label' })\n public dismissLabel = 'Close';\n\n protected get hasFooter(): boolean {\n return this.getSlotContentPresence('[slot=\"footer\"]');\n }\n\n protected get hasButtons(): boolean {\n return this.getSlotContentPresence('[slot=\"button\"]');\n }\n\n /* c8 ignore next 3 */\n protected get hasHero(): boolean {\n return this.getSlotContentPresence('[slot=\"hero\"]');\n }\n\n @property({ type: Boolean, reflect: true, attribute: 'no-divider' })\n public noDivider = false;\n\n @property({ type: String, reflect: true })\n public mode?: 'fullscreen' | 'fullscreenTakeover';\n\n @property({ type: String, reflect: true })\n public size?: 's' | 'm' | 'l';\n\n public close(): void {\n this.dispatchEvent(\n new Event('close', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n }\n\n protected renderHero(): TemplateResult {\n return html`\n <slot name=\"hero\"></slot>\n `;\n }\n\n protected renderFooter(): TemplateResult {\n return html`\n <div class=\"footer\">\n <slot name=\"footer\"></slot>\n </div>\n `;\n }\n\n protected override renderButtons(): TemplateResult {\n const classes = {\n 'button-group': true,\n 'button-group--noFooter': !this.hasFooter,\n };\n return html`\n <sp-button-group class=${classMap(classes)}>\n <slot name=\"button\"></slot>\n </sp-button-group>\n `;\n }\n\n protected renderDismiss(): TemplateResult {\n return html`\n <sp-close-button\n class=\"close-button\"\n label=${this.dismissLabel}\n quiet\n size=\"m\"\n @click=${this.close}\n ></sp-close-button>\n `;\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"grid\">\n ${this.renderHero()} ${this.renderHeading()}\n ${this.error\n ? html`\n <sp-icon-alert class=\"type-icon\"></sp-icon-alert>\n `\n : nothing}\n ${this.noDivider\n ? nothing\n : html`\n <sp-divider size=\"m\" class=\"divider\"></sp-divider>\n `}\n ${this.renderContent()}\n ${this.hasFooter ? this.renderFooter() : nothing}\n ${this.hasButtons ? this.renderButtons() : nothing}\n ${this.dismissable ? this.renderDismiss() : nothing}\n </div>\n `;\n }\n\n protected override shouldUpdate(changes: PropertyValues): boolean {\n if (changes.has('mode') && !!this.mode) {\n this.dismissable = false;\n }\n if (changes.has('dismissable') && this.dismissable) {\n this.dismissable = !this.mode;\n }\n return super.shouldUpdate(changes);\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.setAttribute('role', 'dialog');\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('error') && this.error) {\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"error\" attribute of <${this.localName}> has been deprecated. Use the Alert Dialog component with the \"variant='error'\" instead. \"error\" will be removed in a future release.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/alert-dialog/#error',\n { level: 'deprecation' }\n );\n }\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "qNAYA,OAEI,QAAAA,EACA,WAAAC,MAGG,gCACP,OACI,YAAAC,EACA,SAAAC,MACG,kDAEP,MAAO,iDACP,MAAO,qDACP,MAAO,2DACP,MAAO,iEACP,OAAS,uBAAAC,MAA2B,kCAEpC,OAAOC,MAAY,kBAEnB,OAAS,eAAAC,MAAmB,2DAC5B,OAAS,YAAAC,MAAgB,kDAYlB,aAAM,eAAeH,EAAoBE,EAAa,CACzD,gBACA,kBACA,iBACJ,CAAC,CAAE,CAJI,kCAgBH,KAAO,MAAQ,GAGf,KAAO,YAAc,GAGrB,KAAO,aAAe,QAgBtB,KAAO,UAAY,GAjCnB,WAA2B,QAAyB,CAChD,MAAO,CAACD,CAAM,CAClB,CAiBA,IAAc,WAAqB,CAC/B,OAAO,KAAK,uBAAuB,iBAAiB,CACxD,CAEA,IAAc,YAAsB,CAChC,OAAO,KAAK,uBAAuB,iBAAiB,CACxD,CAGA,IAAc,SAAmB,CAC7B,OAAO,KAAK,uBAAuB,eAAe,CACtD,CAWO,OAAc,CACjB,KAAK,cACD,IAAI,MAAM,QAAS,CACf,QAAS,GACT,SAAU,GACV,WAAY,EAChB,CAAC,CACL,CACJ,CAEU,YAA6B,CACnC,OAAOL;AAAA;AAAA,SAGX,CAEU,cAA+B,CACrC,OAAOA;AAAA;AAAA;AAAA;AAAA,SAKX,CAEmB,eAAgC,CAC/C,MAAMQ,EAAU,CAC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AAE,KAAM,OAAQ,QAAS,GAAM,UAAW,eAAgB,CAAC,GArB5D,OAsBF,4BAgBAQ,EAAA,CADNR,EAAS,CAAE,KAAM,QAAS,QAAS,GAAM,UAAW,YAAa,CAAC,GArC1D,OAsCF,yBAGAQ,EAAA,CADNR,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAxChC,OAyCF,oBAGAQ,EAAA,CADNR,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GA3ChC,OA4CF",
|
|
6
|
+
"names": ["html", "nothing", "property", "query", "ObserveSlotPresence", "styles", "AlertDialog", "classMap", "classes", "changes", "__decorateClass"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
|
|
2
|
+
import '@spectrum-web-components/underlay/sp-underlay.js';
|
|
3
|
+
import '@spectrum-web-components/button/sp-button.js';
|
|
4
|
+
import '@spectrum-web-components/dialog/sp-dialog.js';
|
|
5
|
+
import { Dialog } from './Dialog.js';
|
|
6
|
+
declare const DialogBase_base: typeof SpectrumElement;
|
|
7
|
+
/**
|
|
8
|
+
* @element sp-dialog-base
|
|
9
|
+
*
|
|
10
|
+
* @slot - A Dialog element to display.
|
|
11
|
+
* @fires close - Announces that the dialog has been closed.
|
|
12
|
+
*/
|
|
13
|
+
export declare class DialogBase extends DialogBase_base {
|
|
14
|
+
static get styles(): CSSResultArray;
|
|
15
|
+
dismissable: boolean;
|
|
16
|
+
open: boolean;
|
|
17
|
+
mode?: 'fullscreen' | 'fullscreenTakeover';
|
|
18
|
+
/**
|
|
19
|
+
* When set to true, fills screens smaller than 350px high and 400px wide with the full dialog.
|
|
20
|
+
*/
|
|
21
|
+
responsive: boolean;
|
|
22
|
+
private transitionPromise;
|
|
23
|
+
private resolveTransitionPromise;
|
|
24
|
+
underlay: boolean;
|
|
25
|
+
protected get dialog(): Dialog;
|
|
26
|
+
focus(): Promise<void>;
|
|
27
|
+
private animating;
|
|
28
|
+
overlayWillCloseCallback(): boolean;
|
|
29
|
+
private dismiss;
|
|
30
|
+
protected handleClose(event: Event): void;
|
|
31
|
+
close(): void;
|
|
32
|
+
private dispatchClosed;
|
|
33
|
+
private handleTransitionEvent;
|
|
34
|
+
protected handleUnderlayTransitionend(event: TransitionEvent): void;
|
|
35
|
+
protected handleModalTransitionend(event: TransitionEvent): void;
|
|
36
|
+
private get hasTransitionDuration();
|
|
37
|
+
protected update(changes: PropertyValues<this>): void;
|
|
38
|
+
protected renderDialog(): TemplateResult;
|
|
39
|
+
protected render(): TemplateResult;
|
|
40
|
+
protected updated(changes: PropertyValues<this>): void;
|
|
41
|
+
/**
|
|
42
|
+
* Bind the open/close transition into the update complete lifecycle so
|
|
43
|
+
* that the overlay system can wait for it to be "visibly ready" before
|
|
44
|
+
* attempting to throw focus into the content contained herein. Not
|
|
45
|
+
* waiting for this can cause small amounts of page scroll to happen
|
|
46
|
+
* while opening the Tray when focusable content is included: e.g. Menu
|
|
47
|
+
* elements whose selected Menu Item is not the first Menu Item.
|
|
48
|
+
*/
|
|
49
|
+
protected getUpdateComplete(): Promise<boolean>;
|
|
50
|
+
}
|
|
51
|
+
export {};
|