@spectrum-web-components/dialog 0.0.0-20241209155954

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 (53) hide show
  1. package/README.md +154 -0
  2. package/package.json +96 -0
  3. package/sp-dialog-base.d.ts +6 -0
  4. package/sp-dialog-base.dev.js +5 -0
  5. package/sp-dialog-base.dev.js.map +7 -0
  6. package/sp-dialog-base.js +2 -0
  7. package/sp-dialog-base.js.map +7 -0
  8. package/sp-dialog-wrapper.d.ts +6 -0
  9. package/sp-dialog-wrapper.dev.js +5 -0
  10. package/sp-dialog-wrapper.dev.js.map +7 -0
  11. package/sp-dialog-wrapper.js +2 -0
  12. package/sp-dialog-wrapper.js.map +7 -0
  13. package/sp-dialog.d.ts +6 -0
  14. package/sp-dialog.dev.js +5 -0
  15. package/sp-dialog.dev.js.map +7 -0
  16. package/sp-dialog.js +2 -0
  17. package/sp-dialog.js.map +7 -0
  18. package/src/Dialog.d.ts +47 -0
  19. package/src/Dialog.dev.js +161 -0
  20. package/src/Dialog.dev.js.map +7 -0
  21. package/src/Dialog.js +34 -0
  22. package/src/Dialog.js.map +7 -0
  23. package/src/DialogBase.d.ts +51 -0
  24. package/src/DialogBase.dev.js +213 -0
  25. package/src/DialogBase.dev.js.map +7 -0
  26. package/src/DialogBase.js +23 -0
  27. package/src/DialogBase.js.map +7 -0
  28. package/src/DialogWrapper.d.ts +38 -0
  29. package/src/DialogWrapper.dev.js +179 -0
  30. package/src/DialogWrapper.dev.js.map +7 -0
  31. package/src/DialogWrapper.js +61 -0
  32. package/src/DialogWrapper.js.map +7 -0
  33. package/src/dialog-overrides.css.d.ts +2 -0
  34. package/src/dialog-overrides.css.dev.js +7 -0
  35. package/src/dialog-overrides.css.dev.js.map +7 -0
  36. package/src/dialog-overrides.css.js +4 -0
  37. package/src/dialog-overrides.css.js.map +7 -0
  38. package/src/dialog.css.d.ts +2 -0
  39. package/src/dialog.css.dev.js +7 -0
  40. package/src/dialog.css.dev.js.map +7 -0
  41. package/src/dialog.css.js +4 -0
  42. package/src/dialog.css.js.map +7 -0
  43. package/src/index.d.ts +3 -0
  44. package/src/index.dev.js +5 -0
  45. package/src/index.dev.js.map +7 -0
  46. package/src/index.js +2 -0
  47. package/src/index.js.map +7 -0
  48. package/src/spectrum-config.js +111 -0
  49. package/src/spectrum-dialog.css.d.ts +2 -0
  50. package/src/spectrum-dialog.css.dev.js +7 -0
  51. package/src/spectrum-dialog.css.dev.js.map +7 -0
  52. package/src/spectrum-dialog.css.js +4 -0
  53. package/src/spectrum-dialog.css.js.map +7 -0
@@ -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,EAA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mB,aAAaQ,EAAkC,CAC9D,OAAIA,EAAQ,IAAI,MAAM,GAAO,KAAK,OAC9B,KAAK,YAAc,IAEnBA,EAAQ,IAAI,aAAa,GAAK,KAAK,cACnC,KAAK,YAAc,CAAC,KAAK,MAEtB,MAAM,aAAaA,CAAO,CACrC,CAEmB,aAAaA,EAA+B,CAC3D,MAAM,aAAaA,CAAO,EAC1B,KAAK,aAAa,OAAQ,QAAQ,CACtC,CAEmB,QAAQA,EAA+B,CACtD,MAAM,QAAQA,CAAO,EACjBA,EAAQ,IAAI,OAAO,GAAK,KAAK,KAUrC,CACJ,CAtIIC,EAAA,CADCP,EAAM,eAAe,GATb,OAUT,2BAMOO,EAAA,CADNR,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAfjC,OAgBF,qBAGAQ,EAAA,CADNR,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAlBjC,OAmBF,2BAGAQ,EAAA,CADNR,EAAS,CAAE,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 {};
@@ -0,0 +1,213 @@
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
+ SpectrumElement
16
+ } from "@spectrum-web-components/base";
17
+ import { property } from "@spectrum-web-components/base/src/decorators.js";
18
+ import "@spectrum-web-components/underlay/sp-underlay.js";
19
+ import "@spectrum-web-components/button/sp-button.js";
20
+ import "@spectrum-web-components/dialog/sp-dialog.js";
21
+ import modalWrapperStyles from "@spectrum-web-components/modal/src/modal-wrapper.css.js";
22
+ import modalStyles from "@spectrum-web-components/modal/src/modal.css.js";
23
+ import { FocusVisiblePolyfillMixin } from "@spectrum-web-components/shared";
24
+ import { firstFocusableIn } from "@spectrum-web-components/shared/src/first-focusable-in.js";
25
+ export class DialogBase extends FocusVisiblePolyfillMixin(SpectrumElement) {
26
+ constructor() {
27
+ super(...arguments);
28
+ this.dismissable = false;
29
+ this.open = false;
30
+ this.responsive = false;
31
+ this.transitionPromise = Promise.resolve();
32
+ this.resolveTransitionPromise = () => {
33
+ return;
34
+ };
35
+ this.underlay = false;
36
+ this.animating = false;
37
+ }
38
+ static get styles() {
39
+ return [modalWrapperStyles, modalStyles];
40
+ }
41
+ get dialog() {
42
+ const dialog = this.shadowRoot.querySelector("slot").assignedElements()[0];
43
+ if (true) {
44
+ if (!dialog) {
45
+ window.__swc.warn(
46
+ this,
47
+ `<${this.localName}> expects to be provided dialog content via its default slot.`,
48
+ "https://opensource.adobe.com/spectrum-web-components/components/dialog-base/#dialog"
49
+ );
50
+ }
51
+ }
52
+ return dialog || this;
53
+ }
54
+ async focus() {
55
+ if (this.shadowRoot) {
56
+ const firstFocusable = firstFocusableIn(this.dialog);
57
+ if (firstFocusable) {
58
+ if (firstFocusable.updateComplete) {
59
+ await firstFocusable.updateComplete;
60
+ }
61
+ firstFocusable.focus();
62
+ } else {
63
+ this.dialog.focus();
64
+ }
65
+ } else {
66
+ super.focus();
67
+ }
68
+ }
69
+ overlayWillCloseCallback() {
70
+ if (!this.open) return this.animating;
71
+ this.close();
72
+ return true;
73
+ }
74
+ dismiss() {
75
+ if (!this.dismissable) {
76
+ return;
77
+ }
78
+ this.close();
79
+ }
80
+ handleClose(event) {
81
+ event.stopPropagation();
82
+ this.close();
83
+ }
84
+ close() {
85
+ this.open = false;
86
+ }
87
+ dispatchClosed() {
88
+ this.dispatchEvent(
89
+ new Event("close", {
90
+ bubbles: true
91
+ })
92
+ );
93
+ }
94
+ handleTransitionEvent(event) {
95
+ this.dispatchEvent(
96
+ new TransitionEvent(event.type, {
97
+ bubbles: true,
98
+ composed: true,
99
+ propertyName: event.propertyName
100
+ })
101
+ );
102
+ }
103
+ handleUnderlayTransitionend(event) {
104
+ if (!this.open && event.propertyName === "visibility") {
105
+ this.resolveTransitionPromise();
106
+ }
107
+ this.handleTransitionEvent(event);
108
+ }
109
+ handleModalTransitionend(event) {
110
+ if (this.open || !this.underlay) {
111
+ this.resolveTransitionPromise();
112
+ }
113
+ this.handleTransitionEvent(event);
114
+ }
115
+ get hasTransitionDuration() {
116
+ const modal = this.shadowRoot.querySelector(".modal");
117
+ const modalTransitionDurations = window.getComputedStyle(modal).transitionDuration;
118
+ for (const duration of modalTransitionDurations.split(","))
119
+ if (parseFloat(duration) > 0) return true;
120
+ const underlay = this.shadowRoot.querySelector(
121
+ "sp-underlay"
122
+ );
123
+ if (underlay) {
124
+ const underlayTransitionDurations = window.getComputedStyle(underlay).transitionDuration;
125
+ for (const duration of underlayTransitionDurations.split(","))
126
+ if (parseFloat(duration) > 0) return true;
127
+ }
128
+ return false;
129
+ }
130
+ update(changes) {
131
+ if (changes.has("open") && changes.get("open") !== void 0) {
132
+ const hasTransitionDuration = this.hasTransitionDuration;
133
+ this.animating = true;
134
+ this.transitionPromise = new Promise((res) => {
135
+ this.resolveTransitionPromise = () => {
136
+ this.animating = false;
137
+ if (!this.open && hasTransitionDuration)
138
+ this.dispatchClosed();
139
+ res();
140
+ };
141
+ });
142
+ if (!this.open && !hasTransitionDuration) this.dispatchClosed();
143
+ }
144
+ super.update(changes);
145
+ }
146
+ renderDialog() {
147
+ return html`
148
+ <slot></slot>
149
+ `;
150
+ }
151
+ render() {
152
+ return html`
153
+ ${this.underlay ? html`
154
+ <sp-underlay
155
+ ?open=${this.open}
156
+ @close=${this.dismiss}
157
+ @transitionrun=${this.handleTransitionEvent}
158
+ @transitionend=${this.handleUnderlayTransitionend}
159
+ @transitioncancel=${this.handleTransitionEvent}
160
+ ></sp-underlay>
161
+ ` : nothing}
162
+ <div
163
+ class="modal ${this.mode}"
164
+ @transitionrun=${this.handleTransitionEvent}
165
+ @transitionend=${this.handleModalTransitionend}
166
+ @transitioncancel=${this.handleTransitionEvent}
167
+ @close=${this.handleClose}
168
+ >
169
+ ${this.renderDialog()}
170
+ </div>
171
+ `;
172
+ }
173
+ updated(changes) {
174
+ if (changes.has("open")) {
175
+ if (this.open) {
176
+ if ("updateComplete" in this.dialog && "shouldManageTabOrderForScrolling" in this.dialog) {
177
+ this.dialog.updateComplete.then(() => {
178
+ this.dialog.shouldManageTabOrderForScrolling();
179
+ });
180
+ }
181
+ }
182
+ }
183
+ }
184
+ /**
185
+ * Bind the open/close transition into the update complete lifecycle so
186
+ * that the overlay system can wait for it to be "visibly ready" before
187
+ * attempting to throw focus into the content contained herein. Not
188
+ * waiting for this can cause small amounts of page scroll to happen
189
+ * while opening the Tray when focusable content is included: e.g. Menu
190
+ * elements whose selected Menu Item is not the first Menu Item.
191
+ */
192
+ async getUpdateComplete() {
193
+ const complete = await super.getUpdateComplete();
194
+ await this.transitionPromise;
195
+ return complete;
196
+ }
197
+ }
198
+ __decorateClass([
199
+ property({ type: Boolean, reflect: true })
200
+ ], DialogBase.prototype, "dismissable", 2);
201
+ __decorateClass([
202
+ property({ type: Boolean, reflect: true })
203
+ ], DialogBase.prototype, "open", 2);
204
+ __decorateClass([
205
+ property({ type: String, reflect: true })
206
+ ], DialogBase.prototype, "mode", 2);
207
+ __decorateClass([
208
+ property({ type: Boolean })
209
+ ], DialogBase.prototype, "responsive", 2);
210
+ __decorateClass([
211
+ property({ type: Boolean })
212
+ ], DialogBase.prototype, "underlay", 2);
213
+ //# sourceMappingURL=DialogBase.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["DialogBase.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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport '@spectrum-web-components/underlay/sp-underlay.js';\nimport '@spectrum-web-components/button/sp-button.js';\n\n// Leveraged in build systems that use aliasing to prevent multiple registrations: https://github.com/adobe/spectrum-web-components/pull/3225\nimport '@spectrum-web-components/dialog/sp-dialog.js';\nimport modalWrapperStyles from '@spectrum-web-components/modal/src/modal-wrapper.css.js';\nimport modalStyles from '@spectrum-web-components/modal/src/modal.css.js';\nimport { Dialog } from './Dialog.dev.js'\nimport { FocusVisiblePolyfillMixin } from '@spectrum-web-components/shared';\nimport { firstFocusableIn } from '@spectrum-web-components/shared/src/first-focusable-in.js';\n\n/**\n * @element sp-dialog-base\n *\n * @slot - A Dialog element to display.\n * @fires close - Announces that the dialog has been closed.\n */\nexport class DialogBase extends FocusVisiblePolyfillMixin(SpectrumElement) {\n public static override get styles(): CSSResultArray {\n return [modalWrapperStyles, modalStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public dismissable = false;\n\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n @property({ type: String, reflect: true })\n public mode?: 'fullscreen' | 'fullscreenTakeover';\n\n /**\n * When set to true, fills screens smaller than 350px high and 400px wide with the full dialog.\n */\n @property({ type: Boolean })\n public responsive = false;\n\n private transitionPromise = Promise.resolve();\n\n private resolveTransitionPromise = (): void => {\n return;\n };\n\n @property({ type: Boolean })\n public underlay = false;\n\n protected get dialog(): Dialog {\n const dialog = (\n this.shadowRoot.querySelector('slot') as HTMLSlotElement\n ).assignedElements()[0] as Dialog;\n if (window.__swc.DEBUG) {\n if (!dialog) {\n window.__swc.warn(\n this,\n `<${this.localName}> expects to be provided dialog content via its default slot.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/dialog-base/#dialog'\n );\n }\n }\n return dialog || this;\n }\n\n public override async focus(): Promise<void> {\n if (this.shadowRoot) {\n const firstFocusable = firstFocusableIn(this.dialog);\n if (firstFocusable) {\n if ((firstFocusable as SpectrumElement).updateComplete) {\n await firstFocusable.updateComplete;\n }\n firstFocusable.focus();\n } else {\n this.dialog.focus();\n }\n /* c8 ignore next 3 */\n } else {\n super.focus();\n }\n }\n\n private animating = false;\n\n public overlayWillCloseCallback(): boolean {\n if (!this.open) return this.animating;\n this.close();\n return true;\n }\n\n private dismiss(): void {\n if (!this.dismissable) {\n return;\n }\n this.close();\n }\n\n protected handleClose(event: Event): void {\n event.stopPropagation();\n this.close();\n }\n\n public close(): void {\n this.open = false;\n }\n\n private dispatchClosed(): void {\n this.dispatchEvent(\n new Event('close', {\n bubbles: true,\n })\n );\n }\n\n private handleTransitionEvent(event: TransitionEvent): void {\n this.dispatchEvent(\n new TransitionEvent(event.type, {\n bubbles: true,\n composed: true,\n propertyName: event.propertyName,\n })\n );\n }\n\n protected handleUnderlayTransitionend(event: TransitionEvent): void {\n if (!this.open && event.propertyName === 'visibility') {\n this.resolveTransitionPromise();\n }\n this.handleTransitionEvent(event);\n }\n\n protected handleModalTransitionend(event: TransitionEvent): void {\n if (this.open || !this.underlay) {\n this.resolveTransitionPromise();\n }\n this.handleTransitionEvent(event);\n }\n\n private get hasTransitionDuration(): boolean {\n const modal = this.shadowRoot.querySelector('.modal') as HTMLElement;\n\n const modalTransitionDurations =\n window.getComputedStyle(modal).transitionDuration;\n for (const duration of modalTransitionDurations.split(','))\n if (parseFloat(duration) > 0) return true;\n\n const underlay = this.shadowRoot.querySelector(\n 'sp-underlay'\n ) as HTMLElement;\n\n if (underlay) {\n const underlayTransitionDurations =\n window.getComputedStyle(underlay).transitionDuration;\n for (const duration of underlayTransitionDurations.split(','))\n if (parseFloat(duration) > 0) return true;\n }\n\n return false;\n }\n\n protected override update(changes: PropertyValues<this>): void {\n if (changes.has('open') && changes.get('open') !== undefined) {\n const hasTransitionDuration = this.hasTransitionDuration;\n this.animating = true;\n this.transitionPromise = new Promise((res) => {\n this.resolveTransitionPromise = () => {\n this.animating = false;\n if (!this.open && hasTransitionDuration)\n this.dispatchClosed();\n res();\n };\n });\n if (!this.open && !hasTransitionDuration) this.dispatchClosed();\n }\n super.update(changes);\n }\n\n protected renderDialog(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n\n protected override render(): TemplateResult {\n return html`\n ${this.underlay\n ? html`\n <sp-underlay\n ?open=${this.open}\n @close=${this.dismiss}\n @transitionrun=${this.handleTransitionEvent}\n @transitionend=${this.handleUnderlayTransitionend}\n @transitioncancel=${this.handleTransitionEvent}\n ></sp-underlay>\n `\n : nothing}\n <div\n class=\"modal ${this.mode}\"\n @transitionrun=${this.handleTransitionEvent}\n @transitionend=${this.handleModalTransitionend}\n @transitioncancel=${this.handleTransitionEvent}\n @close=${this.handleClose}\n >\n ${this.renderDialog()}\n </div>\n `;\n }\n\n protected override updated(changes: PropertyValues<this>): void {\n if (changes.has('open')) {\n if (this.open) {\n if (\n 'updateComplete' in this.dialog &&\n 'shouldManageTabOrderForScrolling' in this.dialog\n ) {\n this.dialog.updateComplete.then(() => {\n this.dialog.shouldManageTabOrderForScrolling();\n });\n }\n }\n }\n }\n\n /**\n * Bind the open/close transition into the update complete lifecycle so\n * that the overlay system can wait for it to be \"visibly ready\" before\n * attempting to throw focus into the content contained herein. Not\n * waiting for this can cause small amounts of page scroll to happen\n * while opening the Tray when focusable content is included: e.g. Menu\n * elements whose selected Menu Item is not the first Menu Item.\n */\n protected override async getUpdateComplete(): Promise<boolean> {\n const complete = (await super.getUpdateComplete()) as boolean;\n await this.transitionPromise;\n return complete;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EACA;AAAA,EAEA;AAAA,OAEG;AACP,SAAS,gBAAgB;AAEzB,OAAO;AACP,OAAO;AAGP,OAAO;AACP,OAAO,wBAAwB;AAC/B,OAAO,iBAAiB;AAExB,SAAS,iCAAiC;AAC1C,SAAS,wBAAwB;AAQ1B,aAAM,mBAAmB,0BAA0B,eAAe,EAAE;AAAA,EAApE;AAAA;AAMH,SAAO,cAAc;AAGrB,SAAO,OAAO;AASd,SAAO,aAAa;AAEpB,SAAQ,oBAAoB,QAAQ,QAAQ;AAE5C,SAAQ,2BAA2B,MAAY;AAC3C;AAAA,IACJ;AAGA,SAAO,WAAW;AAmClB,SAAQ,YAAY;AAAA;AAAA,EA7DpB,WAA2B,SAAyB;AAChD,WAAO,CAAC,oBAAoB,WAAW;AAAA,EAC3C;AAAA,EA0BA,IAAc,SAAiB;AAC3B,UAAM,SACF,KAAK,WAAW,cAAc,MAAM,EACtC,iBAAiB,EAAE,CAAC;AACtB,QAAI,MAAoB;AACpB,UAAI,CAAC,QAAQ;AACT,eAAO,MAAM;AAAA,UACT;AAAA,UACA,IAAI,KAAK,SAAS;AAAA,UAClB;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AACA,WAAO,UAAU;AAAA,EACrB;AAAA,EAEA,MAAsB,QAAuB;AACzC,QAAI,KAAK,YAAY;AACjB,YAAM,iBAAiB,iBAAiB,KAAK,MAAM;AACnD,UAAI,gBAAgB;AAChB,YAAK,eAAmC,gBAAgB;AACpD,gBAAM,eAAe;AAAA,QACzB;AACA,uBAAe,M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AAM;AACX,YACI,oBAAoB,KAAK,UACzB,sCAAsC,KAAK,QAC7C;AACE,eAAK,OAAO,eAAe,KAAK,MAAM;AAClC,iBAAK,OAAO,iCAAiC;AAAA,UACjD,CAAC;AAAA,QACL;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAyB,oBAAsC;AAC3D,UAAM,WAAY,MAAM,MAAM,kBAAkB;AAChD,UAAM,KAAK;AACX,WAAO;AAAA,EACX;AACJ;AAlNW;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GALjC,WAMF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GARjC,WASF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAXhC,WAYF;AAMA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,GAjBlB,WAkBF;AASA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,GA1BlB,WA2BF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";var p=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var s=(l,n,e,i)=>{for(var t=i>1?void 0:i?u(n,e):n,o=l.length-1,r;o>=0;o--)(r=l[o])&&(t=(i?r(n,e,t):r(t))||t);return i&&t&&p(n,e,t),t};import{html as d,nothing as h,SpectrumElement as c}from"@spectrum-web-components/base";import{property as a}from"@spectrum-web-components/base/src/decorators.js";import"@spectrum-web-components/underlay/sp-underlay.js";import"@spectrum-web-components/button/sp-button.js";import"@spectrum-web-components/dialog/sp-dialog.js";import m from"@spectrum-web-components/modal/src/modal-wrapper.css.js";import f from"@spectrum-web-components/modal/src/modal.css.js";import{FocusVisiblePolyfillMixin as v}from"@spectrum-web-components/shared";import{firstFocusableIn as y}from"@spectrum-web-components/shared/src/first-focusable-in.js";export class DialogBase extends v(c){constructor(){super(...arguments);this.dismissable=!1;this.open=!1;this.responsive=!1;this.transitionPromise=Promise.resolve();this.resolveTransitionPromise=()=>{};this.underlay=!1;this.animating=!1}static get styles(){return[m,f]}get dialog(){return this.shadowRoot.querySelector("slot").assignedElements()[0]||this}async focus(){if(this.shadowRoot){const e=y(this.dialog);e?(e.updateComplete&&await e.updateComplete,e.focus()):this.dialog.focus()}else super.focus()}overlayWillCloseCallback(){return this.open?(this.close(),!0):this.animating}dismiss(){this.dismissable&&this.close()}handleClose(e){e.stopPropagation(),this.close()}close(){this.open=!1}dispatchClosed(){this.dispatchEvent(new Event("close",{bubbles:!0}))}handleTransitionEvent(e){this.dispatchEvent(new TransitionEvent(e.type,{bubbles:!0,composed:!0,propertyName:e.propertyName}))}handleUnderlayTransitionend(e){!this.open&&e.propertyName==="visibility"&&this.resolveTransitionPromise(),this.handleTransitionEvent(e)}handleModalTransitionend(e){(this.open||!this.underlay)&&this.resolveTransitionPromise(),this.handleTransitionEvent(e)}get hasTransitionDuration(){const e=this.shadowRoot.querySelector(".modal"),i=window.getComputedStyle(e).transitionDuration;for(const o of i.split(","))if(parseFloat(o)>0)return!0;const t=this.shadowRoot.querySelector("sp-underlay");if(t){const o=window.getComputedStyle(t).transitionDuration;for(const r of o.split(","))if(parseFloat(r)>0)return!0}return!1}update(e){if(e.has("open")&&e.get("open")!==void 0){const i=this.hasTransitionDuration;this.animating=!0,this.transitionPromise=new Promise(t=>{this.resolveTransitionPromise=()=>{this.animating=!1,!this.open&&i&&this.dispatchClosed(),t()}}),!this.open&&!i&&this.dispatchClosed()}super.update(e)}renderDialog(){return d`
2
+ <slot></slot>
3
+ `}render(){return d`
4
+ ${this.underlay?d`
5
+ <sp-underlay
6
+ ?open=${this.open}
7
+ @close=${this.dismiss}
8
+ @transitionrun=${this.handleTransitionEvent}
9
+ @transitionend=${this.handleUnderlayTransitionend}
10
+ @transitioncancel=${this.handleTransitionEvent}
11
+ ></sp-underlay>
12
+ `:h}
13
+ <div
14
+ class="modal ${this.mode}"
15
+ @transitionrun=${this.handleTransitionEvent}
16
+ @transitionend=${this.handleModalTransitionend}
17
+ @transitioncancel=${this.handleTransitionEvent}
18
+ @close=${this.handleClose}
19
+ >
20
+ ${this.renderDialog()}
21
+ </div>
22
+ `}updated(e){e.has("open")&&this.open&&"updateComplete"in this.dialog&&"shouldManageTabOrderForScrolling"in this.dialog&&this.dialog.updateComplete.then(()=>{this.dialog.shouldManageTabOrderForScrolling()})}async getUpdateComplete(){const e=await super.getUpdateComplete();return await this.transitionPromise,e}}s([a({type:Boolean,reflect:!0})],DialogBase.prototype,"dismissable",2),s([a({type:Boolean,reflect:!0})],DialogBase.prototype,"open",2),s([a({type:String,reflect:!0})],DialogBase.prototype,"mode",2),s([a({type:Boolean})],DialogBase.prototype,"responsive",2),s([a({type:Boolean})],DialogBase.prototype,"underlay",2);
23
+ //# sourceMappingURL=DialogBase.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["DialogBase.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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport '@spectrum-web-components/underlay/sp-underlay.js';\nimport '@spectrum-web-components/button/sp-button.js';\n\n// Leveraged in build systems that use aliasing to prevent multiple registrations: https://github.com/adobe/spectrum-web-components/pull/3225\nimport '@spectrum-web-components/dialog/sp-dialog.js';\nimport modalWrapperStyles from '@spectrum-web-components/modal/src/modal-wrapper.css.js';\nimport modalStyles from '@spectrum-web-components/modal/src/modal.css.js';\nimport { Dialog } from './Dialog.js';\nimport { FocusVisiblePolyfillMixin } from '@spectrum-web-components/shared';\nimport { firstFocusableIn } from '@spectrum-web-components/shared/src/first-focusable-in.js';\n\n/**\n * @element sp-dialog-base\n *\n * @slot - A Dialog element to display.\n * @fires close - Announces that the dialog has been closed.\n */\nexport class DialogBase extends FocusVisiblePolyfillMixin(SpectrumElement) {\n public static override get styles(): CSSResultArray {\n return [modalWrapperStyles, modalStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public dismissable = false;\n\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n @property({ type: String, reflect: true })\n public mode?: 'fullscreen' | 'fullscreenTakeover';\n\n /**\n * When set to true, fills screens smaller than 350px high and 400px wide with the full dialog.\n */\n @property({ type: Boolean })\n public responsive = false;\n\n private transitionPromise = Promise.resolve();\n\n private resolveTransitionPromise = (): void => {\n return;\n };\n\n @property({ type: Boolean })\n public underlay = false;\n\n protected get dialog(): Dialog {\n const dialog = (\n this.shadowRoot.querySelector('slot') as HTMLSlotElement\n ).assignedElements()[0] as Dialog;\n if (window.__swc.DEBUG) {\n if (!dialog) {\n window.__swc.warn(\n this,\n `<${this.localName}> expects to be provided dialog content via its default slot.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/dialog-base/#dialog'\n );\n }\n }\n return dialog || this;\n }\n\n public override async focus(): Promise<void> {\n if (this.shadowRoot) {\n const firstFocusable = firstFocusableIn(this.dialog);\n if (firstFocusable) {\n if ((firstFocusable as SpectrumElement).updateComplete) {\n await firstFocusable.updateComplete;\n }\n firstFocusable.focus();\n } else {\n this.dialog.focus();\n }\n /* c8 ignore next 3 */\n } else {\n super.focus();\n }\n }\n\n private animating = false;\n\n public overlayWillCloseCallback(): boolean {\n if (!this.open) return this.animating;\n this.close();\n return true;\n }\n\n private dismiss(): void {\n if (!this.dismissable) {\n return;\n }\n this.close();\n }\n\n protected handleClose(event: Event): void {\n event.stopPropagation();\n this.close();\n }\n\n public close(): void {\n this.open = false;\n }\n\n private dispatchClosed(): void {\n this.dispatchEvent(\n new Event('close', {\n bubbles: true,\n })\n );\n }\n\n private handleTransitionEvent(event: TransitionEvent): void {\n this.dispatchEvent(\n new TransitionEvent(event.type, {\n bubbles: true,\n composed: true,\n propertyName: event.propertyName,\n })\n );\n }\n\n protected handleUnderlayTransitionend(event: TransitionEvent): void {\n if (!this.open && event.propertyName === 'visibility') {\n this.resolveTransitionPromise();\n }\n this.handleTransitionEvent(event);\n }\n\n protected handleModalTransitionend(event: TransitionEvent): void {\n if (this.open || !this.underlay) {\n this.resolveTransitionPromise();\n }\n this.handleTransitionEvent(event);\n }\n\n private get hasTransitionDuration(): boolean {\n const modal = this.shadowRoot.querySelector('.modal') as HTMLElement;\n\n const modalTransitionDurations =\n window.getComputedStyle(modal).transitionDuration;\n for (const duration of modalTransitionDurations.split(','))\n if (parseFloat(duration) > 0) return true;\n\n const underlay = this.shadowRoot.querySelector(\n 'sp-underlay'\n ) as HTMLElement;\n\n if (underlay) {\n const underlayTransitionDurations =\n window.getComputedStyle(underlay).transitionDuration;\n for (const duration of underlayTransitionDurations.split(','))\n if (parseFloat(duration) > 0) return true;\n }\n\n return false;\n }\n\n protected override update(changes: PropertyValues<this>): void {\n if (changes.has('open') && changes.get('open') !== undefined) {\n const hasTransitionDuration = this.hasTransitionDuration;\n this.animating = true;\n this.transitionPromise = new Promise((res) => {\n this.resolveTransitionPromise = () => {\n this.animating = false;\n if (!this.open && hasTransitionDuration)\n this.dispatchClosed();\n res();\n };\n });\n if (!this.open && !hasTransitionDuration) this.dispatchClosed();\n }\n super.update(changes);\n }\n\n protected renderDialog(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n\n protected override render(): TemplateResult {\n return html`\n ${this.underlay\n ? html`\n <sp-underlay\n ?open=${this.open}\n @close=${this.dismiss}\n @transitionrun=${this.handleTransitionEvent}\n @transitionend=${this.handleUnderlayTransitionend}\n @transitioncancel=${this.handleTransitionEvent}\n ></sp-underlay>\n `\n : nothing}\n <div\n class=\"modal ${this.mode}\"\n @transitionrun=${this.handleTransitionEvent}\n @transitionend=${this.handleModalTransitionend}\n @transitioncancel=${this.handleTransitionEvent}\n @close=${this.handleClose}\n >\n ${this.renderDialog()}\n </div>\n `;\n }\n\n protected override updated(changes: PropertyValues<this>): void {\n if (changes.has('open')) {\n if (this.open) {\n if (\n 'updateComplete' in this.dialog &&\n 'shouldManageTabOrderForScrolling' in this.dialog\n ) {\n this.dialog.updateComplete.then(() => {\n this.dialog.shouldManageTabOrderForScrolling();\n });\n }\n }\n }\n }\n\n /**\n * Bind the open/close transition into the update complete lifecycle so\n * that the overlay system can wait for it to be \"visibly ready\" before\n * attempting to throw focus into the content contained herein. Not\n * waiting for this can cause small amounts of page scroll to happen\n * while opening the Tray when focusable content is included: e.g. Menu\n * elements whose selected Menu Item is not the first Menu Item.\n */\n protected override async getUpdateComplete(): Promise<boolean> {\n const complete = (await super.getUpdateComplete()) as boolean;\n await this.transitionPromise;\n return complete;\n }\n}\n"],
5
+ "mappings": "qNAYA,OAEI,QAAAA,EACA,WAAAC,EAEA,mBAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDAEzB,MAAO,mDACP,MAAO,+CAGP,MAAO,+CACP,OAAOC,MAAwB,0DAC/B,OAAOC,MAAiB,kDAExB,OAAS,6BAAAC,MAAiC,kCAC1C,OAAS,oBAAAC,MAAwB,4DAQ1B,aAAM,mBAAmBD,EAA0BJ,CAAe,CAAE,CAApE,kCAMH,KAAO,YAAc,GAGrB,KAAO,KAAO,GASd,KAAO,WAAa,GAEpB,KAAQ,kBAAoB,QAAQ,QAAQ,EAE5C,KAAQ,yBAA2B,IAAY,CAE/C,EAGA,KAAO,SAAW,GAmClB,KAAQ,UAAY,GA7DpB,WAA2B,QAAyB,CAChD,MAAO,CAACE,EAAoBC,CAAW,CAC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,kBAAkB,EAChD,aAAM,KAAK,kBACJA,CACX,CACJ,CAlNWC,EAAA,CADNhB,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GALjC,WAMF,2BAGAgB,EAAA,CADNhB,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GARjC,WASF,oBAGAgB,EAAA,CADNhB,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAXhC,WAYF,oBAMAgB,EAAA,CADNhB,EAAS,CAAE,KAAM,OAAQ,CAAC,GAjBlB,WAkBF,0BASAgB,EAAA,CADNhB,EAAS,CAAE,KAAM,OAAQ,CAAC,GA1BlB,WA2BF",
6
+ "names": ["html", "nothing", "SpectrumElement", "property", "modalWrapperStyles", "modalStyles", "FocusVisiblePolyfillMixin", "firstFocusableIn", "firstFocusable", "event", "modal", "modalTransitionDurations", "duration", "underlay", "underlayTransitionDurations", "changes", "hasTransitionDuration", "res", "complete", "__decorateClass"]
7
+ }
@@ -0,0 +1,38 @@
1
+ import { CSSResultArray, 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 { DialogBase } from './DialogBase.js';
6
+ import { Dialog } from './Dialog.js';
7
+ /**
8
+ * @element sp-dialog-wrapper
9
+ *
10
+ * @slot - content for the dialog
11
+ * @fires secondary - Announces that the "secondary" button has been clicked.
12
+ * @fires cancel - Announces that the "cancel" button has been clicked.
13
+ * @fires confirm - Announces that the "confirm" button has been clicked.
14
+ * @fires close - Announces that the dialog has been closed.
15
+ */
16
+ export declare class DialogWrapper extends DialogBase {
17
+ static get styles(): CSSResultArray;
18
+ /**
19
+ * @deprecated Use the Alert Dialog component with `variant="error"` instead.
20
+ */
21
+ error: boolean;
22
+ cancelLabel: string;
23
+ confirmLabel: string;
24
+ dismissLabel: string;
25
+ footer: string;
26
+ hero: string;
27
+ heroLabel: string;
28
+ noDivider: boolean;
29
+ size?: 's' | 'm' | 'l';
30
+ secondaryLabel: string;
31
+ headline: string;
32
+ headlineVisibility: 'none' | undefined;
33
+ protected get dialog(): Dialog;
34
+ private clickSecondary;
35
+ private clickCancel;
36
+ private clickConfirm;
37
+ protected renderDialog(): TemplateResult;
38
+ }
@@ -0,0 +1,179 @@
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 { property } from "@spectrum-web-components/base/src/decorators.js";
17
+ import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
18
+ import "@spectrum-web-components/underlay/sp-underlay.js";
19
+ import "@spectrum-web-components/button/sp-button.js";
20
+ import "@spectrum-web-components/dialog/sp-dialog.js";
21
+ import { DialogBase } from "./DialogBase.dev.js";
22
+ export class DialogWrapper extends DialogBase {
23
+ constructor() {
24
+ super(...arguments);
25
+ this.error = false;
26
+ this.cancelLabel = "";
27
+ this.confirmLabel = "";
28
+ this.dismissLabel = "Close";
29
+ this.footer = "";
30
+ this.hero = "";
31
+ this.heroLabel = "";
32
+ this.noDivider = false;
33
+ this.secondaryLabel = "";
34
+ this.headline = "";
35
+ }
36
+ static get styles() {
37
+ return [...super.styles];
38
+ }
39
+ get dialog() {
40
+ return this.shadowRoot.querySelector("sp-dialog");
41
+ }
42
+ clickSecondary() {
43
+ this.dispatchEvent(
44
+ new Event("secondary", {
45
+ bubbles: true
46
+ })
47
+ );
48
+ }
49
+ clickCancel() {
50
+ this.dispatchEvent(
51
+ new Event("cancel", {
52
+ bubbles: true
53
+ })
54
+ );
55
+ }
56
+ clickConfirm() {
57
+ this.dispatchEvent(
58
+ new Event("confirm", {
59
+ bubbles: true
60
+ })
61
+ );
62
+ }
63
+ renderDialog() {
64
+ const hideDivider = this.noDivider || !this.headline || this.headlineVisibility === "none";
65
+ if (true) {
66
+ if (!this.headline) {
67
+ window.__swc.warn(
68
+ this,
69
+ `<${this.localName}> elements will not be accessible to screen readers without a "headline" attribute or property.`,
70
+ "https://opensource.adobe.com/spectrum-web-components/components/dialog-wrapper/#accessibility",
71
+ {
72
+ type: "accessibility"
73
+ }
74
+ );
75
+ }
76
+ }
77
+ return html`
78
+ <sp-dialog
79
+ ?dismissable=${this.dismissable}
80
+ dismiss-label=${this.dismissLabel}
81
+ ?no-divider=${hideDivider}
82
+ ?error=${this.error}
83
+ mode=${ifDefined(this.mode)}
84
+ size=${ifDefined(this.size)}
85
+ >
86
+ ${this.hero ? html`
87
+ <img
88
+ src="${this.hero}"
89
+ slot="hero"
90
+ aria-hidden=${ifDefined(
91
+ this.heroLabel ? void 0 : "true"
92
+ )}
93
+ alt=${ifDefined(
94
+ this.heroLabel ? this.heroLabel : void 0
95
+ )}
96
+ />
97
+ ` : nothing}
98
+ ${this.headline ? html`
99
+ <h2
100
+ slot="heading"
101
+ ?hidden=${this.headlineVisibility === "none"}
102
+ >
103
+ ${this.headline}
104
+ </h2>
105
+ ` : nothing}
106
+ <slot></slot>
107
+ ${this.footer ? html`
108
+ <div slot="footer">${this.footer}</div>
109
+ ` : nothing}
110
+ ${this.cancelLabel ? html`
111
+ <sp-button
112
+ variant="secondary"
113
+ treatment="outline"
114
+ slot="button"
115
+ @click=${this.clickCancel}
116
+ >
117
+ ${this.cancelLabel}
118
+ </sp-button>
119
+ ` : nothing}
120
+ ${this.secondaryLabel ? html`
121
+ <sp-button
122
+ variant="primary"
123
+ treatment="outline"
124
+ slot="button"
125
+ @click=${this.clickSecondary}
126
+ >
127
+ ${this.secondaryLabel}
128
+ </sp-button>
129
+ ` : nothing}
130
+ ${this.confirmLabel ? html`
131
+ <sp-button
132
+ variant="accent"
133
+ slot="button"
134
+ @click=${this.clickConfirm}
135
+ >
136
+ ${this.confirmLabel}
137
+ </sp-button>
138
+ ` : nothing}
139
+ </sp-dialog>
140
+ `;
141
+ }
142
+ }
143
+ __decorateClass([
144
+ property({ type: Boolean, reflect: true })
145
+ ], DialogWrapper.prototype, "error", 2);
146
+ __decorateClass([
147
+ property({ attribute: "cancel-label" })
148
+ ], DialogWrapper.prototype, "cancelLabel", 2);
149
+ __decorateClass([
150
+ property({ attribute: "confirm-label" })
151
+ ], DialogWrapper.prototype, "confirmLabel", 2);
152
+ __decorateClass([
153
+ property({ attribute: "dismiss-label" })
154
+ ], DialogWrapper.prototype, "dismissLabel", 2);
155
+ __decorateClass([
156
+ property()
157
+ ], DialogWrapper.prototype, "footer", 2);
158
+ __decorateClass([
159
+ property()
160
+ ], DialogWrapper.prototype, "hero", 2);
161
+ __decorateClass([
162
+ property({ attribute: "hero-label" })
163
+ ], DialogWrapper.prototype, "heroLabel", 2);
164
+ __decorateClass([
165
+ property({ type: Boolean, reflect: true, attribute: "no-divider" })
166
+ ], DialogWrapper.prototype, "noDivider", 2);
167
+ __decorateClass([
168
+ property({ type: String, reflect: true })
169
+ ], DialogWrapper.prototype, "size", 2);
170
+ __decorateClass([
171
+ property({ attribute: "secondary-label" })
172
+ ], DialogWrapper.prototype, "secondaryLabel", 2);
173
+ __decorateClass([
174
+ property()
175
+ ], DialogWrapper.prototype, "headline", 2);
176
+ __decorateClass([
177
+ property({ type: String, attribute: "headline-visibility" })
178
+ ], DialogWrapper.prototype, "headlineVisibility", 2);
179
+ //# sourceMappingURL=DialogWrapper.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["DialogWrapper.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 TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport '@spectrum-web-components/underlay/sp-underlay.js';\nimport '@spectrum-web-components/button/sp-button.js';\n\n// Leveraged in build systems that use aliasing to prevent multiple registrations: https://github.com/adobe/spectrum-web-components/pull/3225\nimport '@spectrum-web-components/dialog/sp-dialog.js';\nimport { DialogBase } from './DialogBase.dev.js'\nimport { Dialog } from './Dialog.dev.js'\n\n/**\n * @element sp-dialog-wrapper\n *\n * @slot - content for the dialog\n * @fires secondary - Announces that the \"secondary\" button has been clicked.\n * @fires cancel - Announces that the \"cancel\" button has been clicked.\n * @fires confirm - Announces that the \"confirm\" button has been clicked.\n * @fires close - Announces that the dialog has been closed.\n */\nexport class DialogWrapper extends DialogBase {\n public static override get styles(): CSSResultArray {\n return [...super.styles];\n }\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({ attribute: 'cancel-label' })\n public cancelLabel = '';\n\n @property({ attribute: 'confirm-label' })\n public confirmLabel = '';\n\n @property({ attribute: 'dismiss-label' })\n public dismissLabel = 'Close';\n\n @property()\n public footer = '';\n\n @property()\n public hero = '';\n\n @property({ attribute: 'hero-label' })\n public heroLabel = '';\n\n @property({ type: Boolean, reflect: true, attribute: 'no-divider' })\n public noDivider = false;\n\n @property({ type: String, reflect: true })\n public size?: 's' | 'm' | 'l';\n\n @property({ attribute: 'secondary-label' })\n public secondaryLabel = '';\n\n @property()\n public headline = '';\n\n @property({ type: String, attribute: 'headline-visibility' })\n public headlineVisibility: 'none' | undefined;\n\n protected override get dialog(): Dialog {\n return this.shadowRoot.querySelector('sp-dialog') as Dialog;\n }\n\n private clickSecondary(): void {\n this.dispatchEvent(\n new Event('secondary', {\n bubbles: true,\n })\n );\n }\n\n private clickCancel(): void {\n this.dispatchEvent(\n new Event('cancel', {\n bubbles: true,\n })\n );\n }\n\n private clickConfirm(): void {\n this.dispatchEvent(\n new Event('confirm', {\n bubbles: true,\n })\n );\n }\n\n protected override renderDialog(): TemplateResult {\n const hideDivider =\n this.noDivider ||\n !this.headline ||\n this.headlineVisibility === 'none';\n\n if (window.__swc.DEBUG) {\n if (!this.headline) {\n window.__swc.warn(\n this,\n `<${this.localName}> elements will not be accessible to screen readers without a \"headline\" attribute or property.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/dialog-wrapper/#accessibility',\n {\n type: 'accessibility',\n }\n );\n }\n }\n\n return html`\n <sp-dialog\n ?dismissable=${this.dismissable}\n dismiss-label=${this.dismissLabel}\n ?no-divider=${hideDivider}\n ?error=${this.error}\n mode=${ifDefined(this.mode)}\n size=${ifDefined(this.size)}\n >\n ${this.hero\n ? html`\n <img\n src=\"${this.hero}\"\n slot=\"hero\"\n aria-hidden=${ifDefined(\n this.heroLabel ? undefined : 'true'\n )}\n alt=${ifDefined(\n this.heroLabel ? this.heroLabel : undefined\n )}\n />\n `\n : nothing}\n ${this.headline\n ? html`\n <h2\n slot=\"heading\"\n ?hidden=${this.headlineVisibility === 'none'}\n >\n ${this.headline}\n </h2>\n `\n : nothing}\n <slot></slot>\n ${this.footer\n ? html`\n <div slot=\"footer\">${this.footer}</div>\n `\n : nothing}\n ${this.cancelLabel\n ? html`\n <sp-button\n variant=\"secondary\"\n treatment=\"outline\"\n slot=\"button\"\n @click=${this.clickCancel}\n >\n ${this.cancelLabel}\n </sp-button>\n `\n : nothing}\n ${this.secondaryLabel\n ? html`\n <sp-button\n variant=\"primary\"\n treatment=\"outline\"\n slot=\"button\"\n @click=${this.clickSecondary}\n >\n ${this.secondaryLabel}\n </sp-button>\n `\n : nothing}\n ${this.confirmLabel\n ? html`\n <sp-button\n variant=\"accent\"\n slot=\"button\"\n @click=${this.clickConfirm}\n >\n ${this.confirmLabel}\n </sp-button>\n `\n : nothing}\n </sp-dialog>\n `;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAE1B,OAAO;AACP,OAAO;AAGP,OAAO;AACP,SAAS,kBAAkB;AAYpB,aAAM,sBAAsB,WAAW;AAAA,EAAvC;AAAA;AASH,SAAO,QAAQ;AAGf,SAAO,cAAc;AAGrB,SAAO,eAAe;AAGtB,SAAO,eAAe;AAGtB,SAAO,SAAS;AAGhB,SAAO,OAAO;AAGd,SAAO,YAAY;AAGnB,SAAO,YAAY;AAMnB,SAAO,iBAAiB;AAGxB,SAAO,WAAW;AAAA;AAAA,EAtClB,WAA2B,SAAyB;AAChD,WAAO,CAAC,GAAG,MAAM,MAAM;AAAA,EAC3B;AAAA,EAyCA,IAAuB,SAAiB;AACpC,WAAO,KAAK,WAAW,cAAc,WAAW;AAAA,EACpD;AAAA,EAEQ,iBAAuB;AAC3B,SAAK;AAAA,MACD,IAAI,MAAM,aAAa;AAAA,QACnB,SAAS;AAAA,MACb,CAAC;AAAA,IACL;AAAA,EACJ;AAAA,EAEQ,cAAoB;AACxB,SAAK;AAAA,MACD,IAAI,MAAM,UAAU;AAAA,QAChB,SAAS;AAAA,MACb,CAAC;AAAA,IACL;AAAA,EACJ;AAAA,EAEQ,eAAqB;AACzB,SAAK;AAAA,MACD,IAAI,MAAM,WAAW;AAAA,QACjB,SAAS;AAAA,MACb,CAAC;AAAA,IACL;AAAA,EACJ;AAAA,EAEmB,eAA+B;AAC9C,UAAM,cACF,KAAK,aACL,CAAC,KAAK,YACN,KAAK,uBAAuB;AAE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