@spectrum-web-components/dialog 0.31.1-react.3 → 0.32.1-overlay.33
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/custom-elements.json +110 -8
- package/package.json +11 -11
- package/src/Dialog.dev.js +0 -1
- package/src/Dialog.dev.js.map +2 -2
- package/src/Dialog.js +2 -2
- package/src/Dialog.js.map +2 -2
- package/src/DialogBase.d.ts +3 -2
- package/src/DialogBase.dev.js +18 -9
- package/src/DialogBase.dev.js.map +2 -2
- package/src/DialogBase.js +7 -5
- package/src/DialogBase.js.map +2 -2
- package/src/DialogWrapper.d.ts +1 -1
- package/src/DialogWrapper.dev.js +1 -1
- package/src/DialogWrapper.dev.js.map +2 -2
- package/src/DialogWrapper.js +1 -1
- package/src/DialogWrapper.js.map +2 -2
- package/stories/dialog-base.stories.js +31 -25
- package/stories/dialog-base.stories.js.map +2 -2
- package/stories/dialog-wrapper.stories.js +9 -2
- package/stories/dialog-wrapper.stories.js.map +2 -2
- package/stories/index.js +2 -1
- package/stories/index.js.map +2 -2
- package/test/dialog-base.test.js +9 -22
- package/test/dialog-base.test.js.map +2 -2
- package/test/dialog-wrapper.test.js +30 -42
- package/test/dialog-wrapper.test.js.map +2 -2
package/custom-elements.json
CHANGED
|
@@ -6,19 +6,46 @@
|
|
|
6
6
|
"kind": "javascript-module",
|
|
7
7
|
"path": "sp-dialog-base.ts",
|
|
8
8
|
"declarations": [],
|
|
9
|
-
"exports": [
|
|
9
|
+
"exports": [
|
|
10
|
+
{
|
|
11
|
+
"kind": "custom-element-definition",
|
|
12
|
+
"name": "sp-dialog-base",
|
|
13
|
+
"declaration": {
|
|
14
|
+
"name": "DialogBase",
|
|
15
|
+
"module": "/src/DialogBase.js"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
10
19
|
},
|
|
11
20
|
{
|
|
12
21
|
"kind": "javascript-module",
|
|
13
22
|
"path": "sp-dialog-wrapper.ts",
|
|
14
23
|
"declarations": [],
|
|
15
|
-
"exports": [
|
|
24
|
+
"exports": [
|
|
25
|
+
{
|
|
26
|
+
"kind": "custom-element-definition",
|
|
27
|
+
"name": "sp-dialog-wrapper",
|
|
28
|
+
"declaration": {
|
|
29
|
+
"name": "DialogWrapper",
|
|
30
|
+
"module": "/src/DialogWrapper.js"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
]
|
|
16
34
|
},
|
|
17
35
|
{
|
|
18
36
|
"kind": "javascript-module",
|
|
19
37
|
"path": "sp-dialog.ts",
|
|
20
38
|
"declarations": [],
|
|
21
|
-
"exports": [
|
|
39
|
+
"exports": [
|
|
40
|
+
{
|
|
41
|
+
"kind": "custom-element-definition",
|
|
42
|
+
"name": "sp-dialog",
|
|
43
|
+
"declaration": {
|
|
44
|
+
"name": "Dialog",
|
|
45
|
+
"module": "/src/Dialog.js"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
22
49
|
},
|
|
23
50
|
{
|
|
24
51
|
"kind": "javascript-module",
|
|
@@ -94,7 +121,8 @@
|
|
|
94
121
|
"type": {
|
|
95
122
|
"text": "boolean"
|
|
96
123
|
},
|
|
97
|
-
"privacy": "protected"
|
|
124
|
+
"privacy": "protected",
|
|
125
|
+
"readonly": true
|
|
98
126
|
},
|
|
99
127
|
{
|
|
100
128
|
"kind": "field",
|
|
@@ -102,7 +130,8 @@
|
|
|
102
130
|
"type": {
|
|
103
131
|
"text": "boolean"
|
|
104
132
|
},
|
|
105
|
-
"privacy": "protected"
|
|
133
|
+
"privacy": "protected",
|
|
134
|
+
"readonly": true
|
|
106
135
|
},
|
|
107
136
|
{
|
|
108
137
|
"kind": "field",
|
|
@@ -110,7 +139,8 @@
|
|
|
110
139
|
"type": {
|
|
111
140
|
"text": "boolean"
|
|
112
141
|
},
|
|
113
|
-
"privacy": "protected"
|
|
142
|
+
"privacy": "protected",
|
|
143
|
+
"readonly": true
|
|
114
144
|
},
|
|
115
145
|
{
|
|
116
146
|
"kind": "field",
|
|
@@ -454,7 +484,8 @@
|
|
|
454
484
|
"type": {
|
|
455
485
|
"text": "Dialog"
|
|
456
486
|
},
|
|
457
|
-
"privacy": "protected"
|
|
487
|
+
"privacy": "protected",
|
|
488
|
+
"readonly": true
|
|
458
489
|
},
|
|
459
490
|
{
|
|
460
491
|
"kind": "method",
|
|
@@ -533,6 +564,24 @@
|
|
|
533
564
|
}
|
|
534
565
|
}
|
|
535
566
|
},
|
|
567
|
+
{
|
|
568
|
+
"kind": "method",
|
|
569
|
+
"name": "handleTransitionEvent",
|
|
570
|
+
"privacy": "private",
|
|
571
|
+
"return": {
|
|
572
|
+
"type": {
|
|
573
|
+
"text": "void"
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
"parameters": [
|
|
577
|
+
{
|
|
578
|
+
"name": "event",
|
|
579
|
+
"type": {
|
|
580
|
+
"text": "TransitionEvent"
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
]
|
|
584
|
+
},
|
|
536
585
|
{
|
|
537
586
|
"kind": "method",
|
|
538
587
|
"name": "handleUnderlayTransitionend",
|
|
@@ -559,7 +608,15 @@
|
|
|
559
608
|
"type": {
|
|
560
609
|
"text": "void"
|
|
561
610
|
}
|
|
562
|
-
}
|
|
611
|
+
},
|
|
612
|
+
"parameters": [
|
|
613
|
+
{
|
|
614
|
+
"name": "event",
|
|
615
|
+
"type": {
|
|
616
|
+
"text": "TransitionEvent"
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
]
|
|
563
620
|
},
|
|
564
621
|
{
|
|
565
622
|
"kind": "method",
|
|
@@ -590,6 +647,11 @@
|
|
|
590
647
|
"text": "Event"
|
|
591
648
|
},
|
|
592
649
|
"description": "Announces that the dialog has been closed."
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
"type": {
|
|
653
|
+
"text": "TransitionEvent"
|
|
654
|
+
}
|
|
593
655
|
}
|
|
594
656
|
],
|
|
595
657
|
"attributes": [
|
|
@@ -792,6 +854,7 @@
|
|
|
792
854
|
"text": "Dialog"
|
|
793
855
|
},
|
|
794
856
|
"privacy": "protected",
|
|
857
|
+
"readonly": true,
|
|
795
858
|
"inheritedFrom": {
|
|
796
859
|
"name": "DialogBase",
|
|
797
860
|
"module": "src/DialogBase.ts"
|
|
@@ -1037,6 +1100,28 @@
|
|
|
1037
1100
|
"module": "src/DialogBase.ts"
|
|
1038
1101
|
}
|
|
1039
1102
|
},
|
|
1103
|
+
{
|
|
1104
|
+
"kind": "method",
|
|
1105
|
+
"name": "handleTransitionEvent",
|
|
1106
|
+
"privacy": "private",
|
|
1107
|
+
"return": {
|
|
1108
|
+
"type": {
|
|
1109
|
+
"text": "void"
|
|
1110
|
+
}
|
|
1111
|
+
},
|
|
1112
|
+
"parameters": [
|
|
1113
|
+
{
|
|
1114
|
+
"name": "event",
|
|
1115
|
+
"type": {
|
|
1116
|
+
"text": "TransitionEvent"
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
],
|
|
1120
|
+
"inheritedFrom": {
|
|
1121
|
+
"name": "DialogBase",
|
|
1122
|
+
"module": "src/DialogBase.ts"
|
|
1123
|
+
}
|
|
1124
|
+
},
|
|
1040
1125
|
{
|
|
1041
1126
|
"kind": "method",
|
|
1042
1127
|
"name": "handleUnderlayTransitionend",
|
|
@@ -1068,6 +1153,14 @@
|
|
|
1068
1153
|
"text": "void"
|
|
1069
1154
|
}
|
|
1070
1155
|
},
|
|
1156
|
+
"parameters": [
|
|
1157
|
+
{
|
|
1158
|
+
"name": "event",
|
|
1159
|
+
"type": {
|
|
1160
|
+
"text": "TransitionEvent"
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
],
|
|
1071
1164
|
"inheritedFrom": {
|
|
1072
1165
|
"name": "DialogBase",
|
|
1073
1166
|
"module": "src/DialogBase.ts"
|
|
@@ -1121,6 +1214,15 @@
|
|
|
1121
1214
|
"name": "DialogBase",
|
|
1122
1215
|
"module": "src/DialogBase.ts"
|
|
1123
1216
|
}
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
"type": {
|
|
1220
|
+
"text": "TransitionEvent"
|
|
1221
|
+
},
|
|
1222
|
+
"inheritedFrom": {
|
|
1223
|
+
"name": "DialogBase",
|
|
1224
|
+
"module": "src/DialogBase.ts"
|
|
1225
|
+
}
|
|
1124
1226
|
}
|
|
1125
1227
|
],
|
|
1126
1228
|
"attributes": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/dialog",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.1-overlay.33+8b9227d00",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -73,17 +73,17 @@
|
|
|
73
73
|
"lit-html"
|
|
74
74
|
],
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@spectrum-web-components/base": "^0.
|
|
77
|
-
"@spectrum-web-components/button": "^0.
|
|
78
|
-
"@spectrum-web-components/button-group": "^0.
|
|
79
|
-
"@spectrum-web-components/divider": "^0.
|
|
80
|
-
"@spectrum-web-components/icons-workflow": "^0.
|
|
81
|
-
"@spectrum-web-components/modal": "^0.
|
|
82
|
-
"@spectrum-web-components/shared": "^0.
|
|
83
|
-
"@spectrum-web-components/underlay": "^0.
|
|
76
|
+
"@spectrum-web-components/base": "^0.32.1-overlay.33+8b9227d00",
|
|
77
|
+
"@spectrum-web-components/button": "^0.32.1-overlay.33+8b9227d00",
|
|
78
|
+
"@spectrum-web-components/button-group": "^0.32.1-overlay.33+8b9227d00",
|
|
79
|
+
"@spectrum-web-components/divider": "^0.32.1-overlay.33+8b9227d00",
|
|
80
|
+
"@spectrum-web-components/icons-workflow": "^0.32.1-overlay.33+8b9227d00",
|
|
81
|
+
"@spectrum-web-components/modal": "^0.32.1-overlay.33+8b9227d00",
|
|
82
|
+
"@spectrum-web-components/shared": "^0.32.1-overlay.33+8b9227d00",
|
|
83
|
+
"@spectrum-web-components/underlay": "^0.32.1-overlay.33+8b9227d00"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@spectrum-css/dialog": "^6.0.
|
|
86
|
+
"@spectrum-css/dialog": "^6.0.48"
|
|
87
87
|
},
|
|
88
88
|
"types": "./src/index.d.ts",
|
|
89
89
|
"customElements": "custom-elements.json",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"./sp-*.js",
|
|
92
92
|
"./**/*.dev.js"
|
|
93
93
|
],
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "8b9227d00900eacee1c6d194064f10062f27ab3e"
|
|
95
95
|
}
|
package/src/Dialog.dev.js
CHANGED
package/src/Dialog.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { classMap } from '@spectrum-web-components/base/src/directives.js';\nimport { conditionAttributeWithId } from '@spectrum-web-components/base/src/condition-attribute-with-id.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 {\n FocusVisiblePolyfillMixin,\n ObserveSlotPresence,\n} from '@spectrum-web-components/shared';\n\nimport styles from './dialog.css.js';\nimport type { CloseButton } from '@spectrum-web-components/button';\n\nlet appliedIds = 0;\n\nfunction gatherAppliedIdsFromSlottedChildren(\n slot: HTMLSlotElement,\n idBase: string\n): string[] {\n const assignedElements = slot.assignedElements();\n const ids: string[] = [];\n assignedElements.forEach((el) => {\n if (el.id) {\n ids.push(el.id);\n } else {\n const id = idBase + `-${appliedIds++}`;\n el.id = id;\n ids.push(id);\n }\n });\n return ids;\n}\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 FocusVisiblePolyfillMixin(\n ObserveSlotPresence(SpectrumElement, [\n '[slot=\"hero\"]',\n '[slot=\"footer\"]',\n '[slot=\"button\"]',\n ])\n) {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @query('.close-button')\n closeButton?: CloseButton;\n\n @query('.content')\n private contentElement!: HTMLDivElement;\n\n @property({ type: Boolean, reflect: true })\n public error = false;\n\n @property({ type: Boolean, reflect: true })\n public dismissable = false;\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 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 renderHeading(): TemplateResult {\n return html`\n <slot name=\"heading\" @slotchange=${this.onHeadingSlotchange}></slot>\n `;\n }\n\n protected renderContent(): TemplateResult {\n return html`\n <div class=\"content\">\n <slot @slotchange=${this.onContentSlotChange}></slot>\n </div>\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 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=\"Close\"\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 public shouldManageTabOrderForScrolling = (): void => {\n const { offsetHeight, scrollHeight } = this.contentElement;\n if (offsetHeight < scrollHeight) {\n this.contentElement.tabIndex = 0;\n } else {\n this.contentElement.removeAttribute('tabindex');\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 static instanceCount = 0;\n private labelledbyId = `sp-dialog-label-${Dialog.instanceCount++}`;\n private conditionLabelledby?: () => void;\n private conditionDescribedby?: () => void;\n\n private onHeadingSlotchange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n if (this.conditionLabelledby) {\n this.conditionLabelledby();\n delete this.conditionLabelledby;\n }\n const ids = gatherAppliedIdsFromSlottedChildren(\n target,\n this.labelledbyId\n );\n if (ids.length) {\n this.conditionLabelledby = conditionAttributeWithId(\n this,\n 'aria-labelledby',\n ids\n );\n }\n }\n\n private describedbyId = `sp-dialog-description-${Dialog.instanceCount++}`;\n\n protected onContentSlotChange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n if (this.conditionDescribedby) {\n this.conditionDescribedby();\n delete this.conditionDescribedby;\n }\n const ids = gatherAppliedIdsFromSlottedChildren(\n target,\n this.describedbyId\n );\n if (ids.length && ids.length < 4) {\n this.conditionDescribedby = conditionAttributeWithId(\n this,\n 'aria-describedby',\n ids\n );\n } else if (!ids.length) {\n const idProvided = !!this.id;\n if (!idProvided) this.id = this.describedbyId;\n const conditionDescribedby = conditionAttributeWithId(\n this,\n 'aria-describedby',\n this.id\n );\n this.conditionDescribedby = () => {\n conditionDescribedby();\n if (!idProvided) {\n this.removeAttribute('id');\n }\n };\n }\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EACA;AAAA,EAEA;AAAA,OAEG;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP,SAAS,gBAAgB;AACzB,SAAS,gCAAgC;AAEzC,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP,OAAO,Y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QAAQ;AAAA,EACtC;AAAA,EAOQ,oBAAoB;AAAA,IACxB;AAAA,EACJ,GAA8C;AAC1C,QAAI,KAAK,qBAAqB;AAC1B,WAAK,oBAAoB;AACzB,aAAO,KAAK;AAAA,IAChB;AACA,UAAM,MAAM;AAAA,MACR;AAAA,MACA,KAAK;AAAA,IACT;AACA,QAAI,IAAI,QAAQ;AACZ,WAAK,sBAAsB;AAAA,QACvB;AAAA,QACA;AAAA,QACA;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAAA,EAIU,oBAAoB;AAAA,IAC1B;AAAA,EACJ,GAA8C;AAC1C,QAAI,KAAK,sBAAsB;AAC3B,WAAK,qBAAqB;AAC1B,aAAO,KAAK;AAAA,IAChB;AACA,UAAM,MAAM;AAAA,MACR;AAAA,MACA,KAAK;AAAA,IACT;AACA,QAAI,IAAI,UAAU,IAAI,SAAS,GAAG;AAC9B,WAAK,uBAAuB;AAAA,QACxB;AAAA,QACA;AAAA,QACA;AAAA,MACJ;AAAA,IACJ,WAAW,CAAC,IAAI,QAAQ;AACpB,YAAM,aAAa,CAAC,CAAC,KAAK;AAC1B,UAAI,CAAC;AAAY,aAAK,KAAK,KAAK;AAChC,YAAM,uBAAuB;AAAA,QACzB;AAAA,QACA;AAAA,QACA,KAAK;AAAA,MACT;AACA,WAAK,uBAAuB,MAAM;AAC9B,6BAAqB;AACrB,YAAI,CAAC,YAAY;AACb,eAAK,gBAAgB,IAAI;AAAA,QAC7B;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAAA,EAEgB,oBAA0B;AACtC,UAAM,kBAAkB;AACxB,
|
|
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 {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { classMap } from '@spectrum-web-components/base/src/directives.js';\nimport { conditionAttributeWithId } from '@spectrum-web-components/base/src/condition-attribute-with-id.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 {\n FocusVisiblePolyfillMixin,\n ObserveSlotPresence,\n} from '@spectrum-web-components/shared';\n\nimport styles from './dialog.css.js';\nimport type { CloseButton } from '@spectrum-web-components/button';\n\nlet appliedIds = 0;\n\nfunction gatherAppliedIdsFromSlottedChildren(\n slot: HTMLSlotElement,\n idBase: string\n): string[] {\n const assignedElements = slot.assignedElements();\n const ids: string[] = [];\n assignedElements.forEach((el) => {\n if (el.id) {\n ids.push(el.id);\n } else {\n const id = idBase + `-${appliedIds++}`;\n el.id = id;\n ids.push(id);\n }\n });\n return ids;\n}\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 FocusVisiblePolyfillMixin(\n ObserveSlotPresence(SpectrumElement, [\n '[slot=\"hero\"]',\n '[slot=\"footer\"]',\n '[slot=\"button\"]',\n ])\n) {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @query('.close-button')\n closeButton?: CloseButton;\n\n @query('.content')\n private contentElement!: HTMLDivElement;\n\n @property({ type: Boolean, reflect: true })\n public error = false;\n\n @property({ type: Boolean, reflect: true })\n public dismissable = false;\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 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 renderHeading(): TemplateResult {\n return html`\n <slot name=\"heading\" @slotchange=${this.onHeadingSlotchange}></slot>\n `;\n }\n\n protected renderContent(): TemplateResult {\n return html`\n <div class=\"content\">\n <slot @slotchange=${this.onContentSlotChange}></slot>\n </div>\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 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=\"Close\"\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 public shouldManageTabOrderForScrolling = (): void => {\n const { offsetHeight, scrollHeight } = this.contentElement;\n if (offsetHeight < scrollHeight) {\n this.contentElement.tabIndex = 0;\n } else {\n this.contentElement.removeAttribute('tabindex');\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 static instanceCount = 0;\n private labelledbyId = `sp-dialog-label-${Dialog.instanceCount++}`;\n private conditionLabelledby?: () => void;\n private conditionDescribedby?: () => void;\n\n private onHeadingSlotchange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n if (this.conditionLabelledby) {\n this.conditionLabelledby();\n delete this.conditionLabelledby;\n }\n const ids = gatherAppliedIdsFromSlottedChildren(\n target,\n this.labelledbyId\n );\n if (ids.length) {\n this.conditionLabelledby = conditionAttributeWithId(\n this,\n 'aria-labelledby',\n ids\n );\n }\n }\n\n private describedbyId = `sp-dialog-description-${Dialog.instanceCount++}`;\n\n protected onContentSlotChange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n if (this.conditionDescribedby) {\n this.conditionDescribedby();\n delete this.conditionDescribedby;\n }\n const ids = gatherAppliedIdsFromSlottedChildren(\n target,\n this.describedbyId\n );\n if (ids.length && ids.length < 4) {\n this.conditionDescribedby = conditionAttributeWithId(\n this,\n 'aria-describedby',\n ids\n );\n } else if (!ids.length) {\n const idProvided = !!this.id;\n if (!idProvided) this.id = this.describedbyId;\n const conditionDescribedby = conditionAttributeWithId(\n this,\n 'aria-describedby',\n this.id\n );\n this.conditionDescribedby = () => {\n conditionDescribedby();\n if (!idProvided) {\n this.removeAttribute('id');\n }\n };\n }\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n window.addEventListener(\n 'resize',\n this.shouldManageTabOrderForScrolling\n );\n }\n\n public override disconnectedCallback(): void {\n window.removeEventListener(\n 'resize',\n this.shouldManageTabOrderForScrolling\n );\n super.disconnectedCallback();\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EACA;AAAA,EAEA;AAAA,OAEG;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP,SAAS,gBAAgB;AACzB,SAAS,gCAAgC;AAEzC,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP,OAAO,YAAY;AAGnB,IAAI,aAAa;AAEjB,SAAS,oCACL,MACA,QACQ;AACR,QAAM,mBAAmB,KAAK,iBAAiB;AAC/C,QAAM,MAAgB,CAAC;AACvB,mBAAiB,QAAQ,CAAC,OAAO;AAC7B,QAAI,GAAG,IAAI;AACP,UAAI,KAAK,GAAG,EAAE;AAAA,IAClB,OAAO;AACH,YAAM,KAAK,SAAS,IAAI;AACxB,SAAG,KAAK;AACR,UAAI,KAAK,EAAE;AAAA,IACf;AAAA,EACJ,CAAC;AACD,SAAO;AACX;AAYO,MAAM,UAAN,cAAqB;AAAA,EACxB,oBAAoB,iBAAiB;AAAA,IACjC;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAC;AACL,EAAE;AAAA,EANK;AAAA;AAkBH,SAAO,QAAQ;AAGf,SAAO,cAAc;AAerB,SAAO,YAAY;AA4FnB,SAAO,mCAAmC,MAAY;AAClD,YAAM,EAAE,cAAc,aAAa,IAAI,KAAK;AAC5C,UAAI,eAAe,cAAc;AAC7B,aAAK,eAAe,WAAW;AAAA,MACnC,OAAO;AACH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.length-1,
|
|
1
|
+
"use strict";var m=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var r=(c,n,e,t)=>{for(var o=t>1?void 0:t?v(n,e):n,i=c.length-1,p;i>=0;i--)(p=c[i])&&(o=(t?p(n,e,o):p(o))||o);return t&&o&&m(n,e,o),o};import{html as s,nothing as l,SpectrumElement as f}from"@spectrum-web-components/base";import{property as d,query as b}from"@spectrum-web-components/base/src/decorators.js";import{classMap as g}from"@spectrum-web-components/base/src/directives.js";import{conditionAttributeWithId as u}from"@spectrum-web-components/base/src/condition-attribute-with-id.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{FocusVisiblePolyfillMixin as y,ObserveSlotPresence as C}from"@spectrum-web-components/shared";import S from"./dialog.css.js";let E=0;function h(c,n){const e=c.assignedElements(),t=[];return e.forEach(o=>{if(o.id)t.push(o.id);else{const i=n+`-${E++}`;o.id=i,t.push(i)}}),t}const a=class extends y(C(f,['[slot="hero"]','[slot="footer"]','[slot="button"]'])){constructor(){super(...arguments);this.error=!1;this.dismissable=!1;this.noDivider=!1;this.shouldManageTabOrderForScrolling=()=>{const{offsetHeight:e,scrollHeight:t}=this.contentElement;e<t?this.contentElement.tabIndex=0:this.contentElement.removeAttribute("tabindex")};this.labelledbyId=`sp-dialog-label-${a.instanceCount++}`;this.describedbyId=`sp-dialog-description-${a.instanceCount++}`}static get styles(){return[S]}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 s`
|
|
2
2
|
<slot name="hero"></slot>
|
|
3
3
|
`}renderHeading(){return s`
|
|
4
4
|
<slot name="heading" @slotchange=${this.onHeadingSlotchange}></slot>
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
${this.hasButtons?this.renderButtons():l}
|
|
37
37
|
${this.dismissable?this.renderDismiss():l}
|
|
38
38
|
</div>
|
|
39
|
-
`}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")}onHeadingSlotchange({target:e}){this.conditionLabelledby&&(this.conditionLabelledby(),delete this.conditionLabelledby);const t=h(e,this.labelledbyId);t.length&&(this.conditionLabelledby=
|
|
39
|
+
`}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")}onHeadingSlotchange({target:e}){this.conditionLabelledby&&(this.conditionLabelledby(),delete this.conditionLabelledby);const t=h(e,this.labelledbyId);t.length&&(this.conditionLabelledby=u(this,"aria-labelledby",t))}onContentSlotChange({target:e}){this.conditionDescribedby&&(this.conditionDescribedby(),delete this.conditionDescribedby);const t=h(e,this.describedbyId);if(t.length&&t.length<4)this.conditionDescribedby=u(this,"aria-describedby",t);else if(!t.length){const o=!!this.id;o||(this.id=this.describedbyId);const i=u(this,"aria-describedby",this.id);this.conditionDescribedby=()=>{i(),o||this.removeAttribute("id")}}}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.shouldManageTabOrderForScrolling)}disconnectedCallback(){window.removeEventListener("resize",this.shouldManageTabOrderForScrolling),super.disconnectedCallback()}};export let Dialog=a;Dialog.instanceCount=0,r([b(".close-button")],Dialog.prototype,"closeButton",2),r([b(".content")],Dialog.prototype,"contentElement",2),r([d({type:Boolean,reflect:!0})],Dialog.prototype,"error",2),r([d({type:Boolean,reflect:!0})],Dialog.prototype,"dismissable",2),r([d({type:Boolean,reflect:!0,attribute:"no-divider"})],Dialog.prototype,"noDivider",2),r([d({type:String,reflect:!0})],Dialog.prototype,"mode",2),r([d({type:String,reflect:!0})],Dialog.prototype,"size",2);
|
|
40
40
|
//# sourceMappingURL=Dialog.js.map
|
package/src/Dialog.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { classMap } from '@spectrum-web-components/base/src/directives.js';\nimport { conditionAttributeWithId } from '@spectrum-web-components/base/src/condition-attribute-with-id.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 {\n FocusVisiblePolyfillMixin,\n ObserveSlotPresence,\n} from '@spectrum-web-components/shared';\n\nimport styles from './dialog.css.js';\nimport type { CloseButton } from '@spectrum-web-components/button';\n\nlet appliedIds = 0;\n\nfunction gatherAppliedIdsFromSlottedChildren(\n slot: HTMLSlotElement,\n idBase: string\n): string[] {\n const assignedElements = slot.assignedElements();\n const ids: string[] = [];\n assignedElements.forEach((el) => {\n if (el.id) {\n ids.push(el.id);\n } else {\n const id = idBase + `-${appliedIds++}`;\n el.id = id;\n ids.push(id);\n }\n });\n return ids;\n}\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 FocusVisiblePolyfillMixin(\n ObserveSlotPresence(SpectrumElement, [\n '[slot=\"hero\"]',\n '[slot=\"footer\"]',\n '[slot=\"button\"]',\n ])\n) {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @query('.close-button')\n closeButton?: CloseButton;\n\n @query('.content')\n private contentElement!: HTMLDivElement;\n\n @property({ type: Boolean, reflect: true })\n public error = false;\n\n @property({ type: Boolean, reflect: true })\n public dismissable = false;\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 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 renderHeading(): TemplateResult {\n return html`\n <slot name=\"heading\" @slotchange=${this.onHeadingSlotchange}></slot>\n `;\n }\n\n protected renderContent(): TemplateResult {\n return html`\n <div class=\"content\">\n <slot @slotchange=${this.onContentSlotChange}></slot>\n </div>\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 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=\"Close\"\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 public shouldManageTabOrderForScrolling = (): void => {\n const { offsetHeight, scrollHeight } = this.contentElement;\n if (offsetHeight < scrollHeight) {\n this.contentElement.tabIndex = 0;\n } else {\n this.contentElement.removeAttribute('tabindex');\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 static instanceCount = 0;\n private labelledbyId = `sp-dialog-label-${Dialog.instanceCount++}`;\n private conditionLabelledby?: () => void;\n private conditionDescribedby?: () => void;\n\n private onHeadingSlotchange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n if (this.conditionLabelledby) {\n this.conditionLabelledby();\n delete this.conditionLabelledby;\n }\n const ids = gatherAppliedIdsFromSlottedChildren(\n target,\n this.labelledbyId\n );\n if (ids.length) {\n this.conditionLabelledby = conditionAttributeWithId(\n this,\n 'aria-labelledby',\n ids\n );\n }\n }\n\n private describedbyId = `sp-dialog-description-${Dialog.instanceCount++}`;\n\n protected onContentSlotChange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n if (this.conditionDescribedby) {\n this.conditionDescribedby();\n delete this.conditionDescribedby;\n }\n const ids = gatherAppliedIdsFromSlottedChildren(\n target,\n this.describedbyId\n );\n if (ids.length && ids.length < 4) {\n this.conditionDescribedby = conditionAttributeWithId(\n this,\n 'aria-describedby',\n ids\n );\n } else if (!ids.length) {\n const idProvided = !!this.id;\n if (!idProvided) this.id = this.describedbyId;\n const conditionDescribedby = conditionAttributeWithId(\n this,\n 'aria-describedby',\n this.id\n );\n this.conditionDescribedby = () => {\n conditionDescribedby();\n if (!idProvided) {\n this.removeAttribute('id');\n }\n };\n }\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n
|
|
5
|
-
"mappings": "qNAYA,OAEI,QAAAA,EACA,WAAAC,EAEA,mBAAAC,MAEG,gCACP,OACI,YAAAC,EACA,SAAAC,MACG,kDACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,4BAAAC,MAAgC,mEAEzC,MAAO,iDACP,MAAO,qDACP,MAAO,2DACP,MAAO,iEACP,OACI,6BAAAC,EACA,uBAAAC,MACG,kCAEP,OAAOC,MAAY,kBAGnB,IAAIC,EAAa,EAEjB,SAASC,EACLC,EACAC,EACQ,CACR,MAAMC,EAAmBF,EAAK,iBAAiB,EACzCG,EAAgB,CAAC,EACvB,OAAAD,EAAiB,QAASE,GAAO,CAC7B,GAAIA,EAAG,GACHD,EAAI,KAAKC,EAAG,EAAE,MACX,CACH,MAAMC,EAAKJ,EAAS,IAAIH,MACxBM,EAAG,GAAKC,EACRF,EAAI,KAAKE,CAAE,EAEnB,CAAC,EACMF,CACX,CAYO,MAAMG,EAAN,cAAqBX,EACxBC,E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,CACtC,MAAM,kBAAkB,EACxB,
|
|
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 {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { classMap } from '@spectrum-web-components/base/src/directives.js';\nimport { conditionAttributeWithId } from '@spectrum-web-components/base/src/condition-attribute-with-id.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 {\n FocusVisiblePolyfillMixin,\n ObserveSlotPresence,\n} from '@spectrum-web-components/shared';\n\nimport styles from './dialog.css.js';\nimport type { CloseButton } from '@spectrum-web-components/button';\n\nlet appliedIds = 0;\n\nfunction gatherAppliedIdsFromSlottedChildren(\n slot: HTMLSlotElement,\n idBase: string\n): string[] {\n const assignedElements = slot.assignedElements();\n const ids: string[] = [];\n assignedElements.forEach((el) => {\n if (el.id) {\n ids.push(el.id);\n } else {\n const id = idBase + `-${appliedIds++}`;\n el.id = id;\n ids.push(id);\n }\n });\n return ids;\n}\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 FocusVisiblePolyfillMixin(\n ObserveSlotPresence(SpectrumElement, [\n '[slot=\"hero\"]',\n '[slot=\"footer\"]',\n '[slot=\"button\"]',\n ])\n) {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @query('.close-button')\n closeButton?: CloseButton;\n\n @query('.content')\n private contentElement!: HTMLDivElement;\n\n @property({ type: Boolean, reflect: true })\n public error = false;\n\n @property({ type: Boolean, reflect: true })\n public dismissable = false;\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 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 renderHeading(): TemplateResult {\n return html`\n <slot name=\"heading\" @slotchange=${this.onHeadingSlotchange}></slot>\n `;\n }\n\n protected renderContent(): TemplateResult {\n return html`\n <div class=\"content\">\n <slot @slotchange=${this.onContentSlotChange}></slot>\n </div>\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 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=\"Close\"\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 public shouldManageTabOrderForScrolling = (): void => {\n const { offsetHeight, scrollHeight } = this.contentElement;\n if (offsetHeight < scrollHeight) {\n this.contentElement.tabIndex = 0;\n } else {\n this.contentElement.removeAttribute('tabindex');\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 static instanceCount = 0;\n private labelledbyId = `sp-dialog-label-${Dialog.instanceCount++}`;\n private conditionLabelledby?: () => void;\n private conditionDescribedby?: () => void;\n\n private onHeadingSlotchange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n if (this.conditionLabelledby) {\n this.conditionLabelledby();\n delete this.conditionLabelledby;\n }\n const ids = gatherAppliedIdsFromSlottedChildren(\n target,\n this.labelledbyId\n );\n if (ids.length) {\n this.conditionLabelledby = conditionAttributeWithId(\n this,\n 'aria-labelledby',\n ids\n );\n }\n }\n\n private describedbyId = `sp-dialog-description-${Dialog.instanceCount++}`;\n\n protected onContentSlotChange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n if (this.conditionDescribedby) {\n this.conditionDescribedby();\n delete this.conditionDescribedby;\n }\n const ids = gatherAppliedIdsFromSlottedChildren(\n target,\n this.describedbyId\n );\n if (ids.length && ids.length < 4) {\n this.conditionDescribedby = conditionAttributeWithId(\n this,\n 'aria-describedby',\n ids\n );\n } else if (!ids.length) {\n const idProvided = !!this.id;\n if (!idProvided) this.id = this.describedbyId;\n const conditionDescribedby = conditionAttributeWithId(\n this,\n 'aria-describedby',\n this.id\n );\n this.conditionDescribedby = () => {\n conditionDescribedby();\n if (!idProvided) {\n this.removeAttribute('id');\n }\n };\n }\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n window.addEventListener(\n 'resize',\n this.shouldManageTabOrderForScrolling\n );\n }\n\n public override disconnectedCallback(): void {\n window.removeEventListener(\n 'resize',\n this.shouldManageTabOrderForScrolling\n );\n super.disconnectedCallback();\n }\n}\n"],
|
|
5
|
+
"mappings": "qNAYA,OAEI,QAAAA,EACA,WAAAC,EAEA,mBAAAC,MAEG,gCACP,OACI,YAAAC,EACA,SAAAC,MACG,kDACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,4BAAAC,MAAgC,mEAEzC,MAAO,iDACP,MAAO,qDACP,MAAO,2DACP,MAAO,iEACP,OACI,6BAAAC,EACA,uBAAAC,MACG,kCAEP,OAAOC,MAAY,kBAGnB,IAAIC,EAAa,EAEjB,SAASC,EACLC,EACAC,EACQ,CACR,MAAMC,EAAmBF,EAAK,iBAAiB,EACzCG,EAAgB,CAAC,EACvB,OAAAD,EAAiB,QAASE,GAAO,CAC7B,GAAIA,EAAG,GACHD,EAAI,KAAKC,EAAG,EAAE,MACX,CACH,MAAMC,EAAKJ,EAAS,IAAIH,MACxBM,EAAG,GAAKC,EACRF,EAAI,KAAKE,CAAE,EAEnB,CAAC,EACMF,CACX,CAYO,MAAMG,EAAN,cAAqBX,EACxBC,EAAoBN,EAAiB,CACjC,gBACA,kBACA,iBACJ,CAAC,CACL,CAA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T,CACJ,CAEgB,sBAA6B,CACzC,OAAO,oBACH,SACA,KAAK,gCACT,EACA,MAAM,qBAAqB,CAC/B,CACJ,EApOO,WAAM,OAANN,EAAM,OAwJF,cAAgB,EA5IvBQ,EAAA,CADCtB,EAAM,eAAe,GAXb,OAYT,2BAGQsB,EAAA,CADPtB,EAAM,UAAU,GAdR,OAeD,8BAGDsB,EAAA,CADNvB,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAjBjC,OAkBF,qBAGAuB,EAAA,CADNvB,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GApBjC,OAqBF,2BAeAuB,EAAA,CADNvB,EAAS,CAAE,KAAM,QAAS,QAAS,GAAM,UAAW,YAAa,CAAC,GAnC1D,OAoCF,yBAGAuB,EAAA,CADNvB,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAtChC,OAuCF,oBAGAuB,EAAA,CADNvB,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAzChC,OA0CF",
|
|
6
6
|
"names": ["html", "nothing", "SpectrumElement", "property", "query", "classMap", "conditionAttributeWithId", "FocusVisiblePolyfillMixin", "ObserveSlotPresence", "styles", "appliedIds", "gatherAppliedIdsFromSlottedChildren", "slot", "idBase", "assignedElements", "ids", "el", "id", "_Dialog", "offsetHeight", "scrollHeight", "classes", "changes", "target", "idProvided", "conditionDescribedby", "__decorateClass"]
|
|
7
7
|
}
|
package/src/DialogBase.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
|
|
2
2
|
import '@spectrum-web-components/underlay/sp-underlay.js';
|
|
3
3
|
import '@spectrum-web-components/button/sp-button.js';
|
|
4
|
-
import '
|
|
4
|
+
import '@spectrum-web-components/dialog/sp-dialog.js';
|
|
5
5
|
import { Dialog } from './Dialog.js';
|
|
6
6
|
declare const DialogBase_base: typeof SpectrumElement;
|
|
7
7
|
/**
|
|
@@ -30,8 +30,9 @@ export declare class DialogBase extends DialogBase_base {
|
|
|
30
30
|
protected handleClose(event: Event): void;
|
|
31
31
|
close(): void;
|
|
32
32
|
private dispatchClosed;
|
|
33
|
+
private handleTransitionEvent;
|
|
33
34
|
protected handleUnderlayTransitionend(event: TransitionEvent): void;
|
|
34
|
-
protected handleModalTransitionend(): void;
|
|
35
|
+
protected handleModalTransitionend(event: TransitionEvent): void;
|
|
35
36
|
protected update(changes: PropertyValues<this>): void;
|
|
36
37
|
protected renderDialog(): TemplateResult;
|
|
37
38
|
protected render(): TemplateResult;
|
package/src/DialogBase.dev.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
18
18
|
import "@spectrum-web-components/underlay/sp-underlay.js";
|
|
19
19
|
import "@spectrum-web-components/button/sp-button.js";
|
|
20
|
-
import "
|
|
20
|
+
import "@spectrum-web-components/dialog/sp-dialog.js";
|
|
21
21
|
import modalWrapperStyles from "@spectrum-web-components/modal/src/modal-wrapper.css.js";
|
|
22
22
|
import modalStyles from "@spectrum-web-components/modal/src/modal.css.js";
|
|
23
23
|
import { FocusVisiblePolyfillMixin } from "@spectrum-web-components/shared";
|
|
@@ -59,7 +59,6 @@ export class DialogBase extends FocusVisiblePolyfillMixin(SpectrumElement) {
|
|
|
59
59
|
await firstFocusable.updateComplete;
|
|
60
60
|
}
|
|
61
61
|
firstFocusable.focus();
|
|
62
|
-
this.removeAttribute("tabindex");
|
|
63
62
|
} else {
|
|
64
63
|
this.dialog.focus();
|
|
65
64
|
}
|
|
@@ -93,18 +92,25 @@ export class DialogBase extends FocusVisiblePolyfillMixin(SpectrumElement) {
|
|
|
93
92
|
})
|
|
94
93
|
);
|
|
95
94
|
}
|
|
95
|
+
handleTransitionEvent(event) {
|
|
96
|
+
this.dispatchEvent(
|
|
97
|
+
new TransitionEvent(event.type, {
|
|
98
|
+
bubbles: true,
|
|
99
|
+
composed: true,
|
|
100
|
+
propertyName: event.propertyName
|
|
101
|
+
})
|
|
102
|
+
);
|
|
103
|
+
}
|
|
96
104
|
handleUnderlayTransitionend(event) {
|
|
97
105
|
if (!this.open && event.propertyName === "visibility") {
|
|
98
106
|
this.resolveTransitionPromise();
|
|
99
|
-
this.dispatchClosed();
|
|
100
107
|
}
|
|
108
|
+
this.handleTransitionEvent(event);
|
|
101
109
|
}
|
|
102
|
-
handleModalTransitionend() {
|
|
110
|
+
handleModalTransitionend(event) {
|
|
103
111
|
if (this.open || !this.underlay) {
|
|
104
112
|
this.resolveTransitionPromise();
|
|
105
|
-
|
|
106
|
-
this.dispatchClosed();
|
|
107
|
-
}
|
|
113
|
+
this.handleTransitionEvent(event);
|
|
108
114
|
}
|
|
109
115
|
}
|
|
110
116
|
update(changes) {
|
|
@@ -116,6 +122,9 @@ export class DialogBase extends FocusVisiblePolyfillMixin(SpectrumElement) {
|
|
|
116
122
|
res();
|
|
117
123
|
};
|
|
118
124
|
});
|
|
125
|
+
if (!this.open) {
|
|
126
|
+
this.dispatchClosed();
|
|
127
|
+
}
|
|
119
128
|
}
|
|
120
129
|
super.update(changes);
|
|
121
130
|
}
|
|
@@ -130,11 +139,13 @@ export class DialogBase extends FocusVisiblePolyfillMixin(SpectrumElement) {
|
|
|
130
139
|
<sp-underlay
|
|
131
140
|
?open=${this.open}
|
|
132
141
|
@click=${this.dismiss}
|
|
142
|
+
@transitionrun=${this.handleTransitionEvent}
|
|
133
143
|
@transitionend=${this.handleUnderlayTransitionend}
|
|
134
144
|
></sp-underlay>
|
|
135
145
|
` : html``}
|
|
136
146
|
<div
|
|
137
147
|
class="modal ${this.mode}"
|
|
148
|
+
@transitionrun=${this.handleTransitionEvent}
|
|
138
149
|
@transitionend=${this.handleModalTransitionend}
|
|
139
150
|
@close=${this.handleClose}
|
|
140
151
|
>
|
|
@@ -150,8 +161,6 @@ export class DialogBase extends FocusVisiblePolyfillMixin(SpectrumElement) {
|
|
|
150
161
|
this.dialog.shouldManageTabOrderForScrolling();
|
|
151
162
|
});
|
|
152
163
|
}
|
|
153
|
-
} else {
|
|
154
|
-
this.tabIndex = 0;
|
|
155
164
|
}
|
|
156
165
|
}
|
|
157
166
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 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\nimport '
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EAEA;AAAA,OAEG;AACP,SAAS,gBAAgB;AAEzB,OAAO;AACP,OAAO;
|
|
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 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 this.handleTransitionEvent(event);\n }\n }\n\n protected override update(changes: PropertyValues<this>): void {\n if (changes.has('open') && changes.get('open') !== undefined) {\n this.animating = true;\n this.transitionPromise = new Promise((res) => {\n this.resolveTransitionPromise = () => {\n this.animating = false;\n res();\n };\n });\n if (!this.open) {\n this.dispatchClosed();\n }\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 @click=${this.dismiss}\n @transitionrun=${this.handleTransitionEvent}\n @transitionend=${this.handleUnderlayTransitionend}\n ></sp-underlay>\n `\n : html``}\n <div\n class=\"modal ${this.mode}\"\n @transitionrun=${this.handleTransitionEvent}\n @transitionend=${this.handleModalTransitionend}\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,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;AAAA,UACT;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AACA,WAAO,UAAU;AAAA,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