@spectrum-web-components/dialog 0.31.1-overlay.29 → 0.31.1-react.2
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 +1294 -0
- package/package.json +10 -10
- package/src/Dialog.dev.js +1 -0
- 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 +1 -2
- package/src/DialogBase.dev.js +8 -17
- package/src/DialogBase.dev.js.map +2 -2
- package/src/DialogBase.js +5 -7
- package/src/DialogBase.js.map +2 -2
- package/stories/dialog-base.stories.js +25 -31
- package/stories/dialog-base.stories.js.map +2 -2
- package/stories/dialog-wrapper.stories.js +2 -2
- package/stories/dialog-wrapper.stories.js.map +2 -2
- package/test/dialog-base.test.js +22 -9
- package/test/dialog-base.test.js.map +2 -2
- package/test/dialog-wrapper.test.js +42 -30
- package/test/dialog-wrapper.test.js.map +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["dialog-base.stories.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\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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/dialog/sp-dialog-base.js';\nimport '@spectrum-web-components/dialog/sp-dialog.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/overlay/
|
|
5
|
-
"mappings": ";
|
|
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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/dialog/sp-dialog-base.js';\nimport '@spectrum-web-components/dialog/sp-dialog.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport '@spectrum-web-components/checkbox/sp-checkbox.js';\nimport { alertDestructive } from './dialog.stories.js';\nimport { portrait } from './images.js';\nimport { overlayTriggerDecorator } from './index.js';\n\nexport default {\n title: 'Dialog Base',\n component: 'sp-dialog-base',\n decorators: [\n (story: () => TemplateResult): TemplateResult => html`\n <overlay-trigger type=\"modal\" open=\"click\" placement=\"none\">\n <sp-button slot=\"trigger\" variant=\"primary\">\n Toggle Dialog\n </sp-button>\n ${story()}\n </overlay-trigger>\n `,\n overlayTriggerDecorator,\n ],\n};\n\nexport const Slotted = (): TemplateResult => html`\n <sp-dialog-base\n underlay\n slot=\"click-content\"\n @click=${(event: Event) => {\n if ((event.target as HTMLElement).localName === 'sp-button') {\n (event.target as HTMLElement).dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n }\n }}\n >\n ${alertDestructive()}\n </sp-dialog-base>\n`;\n\nexport const disabledButton = (): TemplateResult => {\n return html`\n <sp-dialog-base\n underlay\n slot=\"click-content\"\n @click=${(event: Event) => {\n if ((event.target as HTMLElement).localName === 'sp-button') {\n (event.target as HTMLElement).dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n }\n }}\n .overlayOpenCallback=${() => {\n setTimeout(() => {\n (\n document.querySelector(\n '#changing-header'\n ) as HTMLElement\n ).textContent = 'The button in this dialog is now enabled';\n (\n document.querySelector(\n '#changing-button'\n ) as HTMLButtonElement\n ).disabled = false;\n }, 5000);\n }}\n .overlayCloseCallback=${() => {\n (\n document.querySelector('#changing-header') as HTMLElement\n ).textContent = 'The button in this dialog is disabled';\n (\n document.querySelector(\n '#changing-button'\n ) as HTMLButtonElement\n ).disabled = true;\n }}\n >\n <sp-dialog size=\"s\">\n <h2 slot=\"heading\" id=\"changing-header\">\n The button in this dialog is disabled\n </h2>\n <p>After about 5 seconds the button with be enabled.</p>\n <sp-button disabled slot=\"button\" id=\"changing-button\">\n Ok\n </sp-button>\n </sp-dialog>\n </sp-dialog-base>\n `;\n};\n\nexport const notAgain = (): TemplateResult => html`\n <sp-dialog-base\n underlay\n slot=\"click-content\"\n @click=${(event: Event) => {\n if ((event.target as HTMLElement).localName === 'sp-button') {\n (event.target as HTMLElement).dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n }\n }}\n >\n <sp-dialog size=\"s\">\n <h2 slot=\"heading\">A thing is about to happen</h2>\n <p>Something that might happen a lot is about to happen.</p>\n <p>\n The click events for the \"OK\" button are bound to the story not\n to the components in specific.\n </p>\n <sp-button variant=\"secondary\" treatment=\"fill\" slot=\"button\">\n Ok\n </sp-button>\n <sp-checkbox slot=\"footer\">Don't show me this again</sp-checkbox>\n </sp-dialog>\n </sp-dialog-base>\n`;\n\nexport const moreCustom = (): TemplateResult => html`\n <sp-dialog-base\n underlay\n slot=\"click-content\"\n @click=${(event: Event) => {\n if ((event.target as HTMLElement).localName === 'sp-button') {\n (event.target as HTMLElement).dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n }\n }}\n >\n <div style=\"display: flex;\">\n <div\n style=\"\n display: grid;\n place-content: center;\n grid-template-columns: calc(100% - 40px);\n grid-template-rows: calc(100% - 40px);\n \"\n >\n <img\n src=${portrait}\n alt=\"\"\n style=\"\n width: 100%;\n height: 100%;\n object-fit: contain;\n object-placement: center;\n \"\n />\n </div>\n <sp-dialog size=\"s\">\n <h2 slot=\"heading\">Look at that image</h2>\n <p>\n Its position has been customized beyond the language of\n Spectrum. Be careful with all this power. There's no\n \"mobile\" default for delivering content like this.\n </p>\n <sp-button variant=\"accent\" treatment=\"outline\" slot=\"button\">\n Ok\n </sp-button>\n </sp-dialog>\n </div>\n </sp-dialog-base>\n`;\n\nexport const fullyCustom = (): TemplateResult => html`\n <sp-dialog-base\n underlay\n slot=\"click-content\"\n @click=${(event: Event) => {\n if ((event.target as HTMLElement).localName === 'button') {\n (event.target as HTMLElement).dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n }\n }}\n >\n <div id=\"fully-custom-dialog\">\n <style>\n #fully-custom-dialog {\n margin: 1em;\n }\n </style>\n <h2>Custom headline</h2>\n <p>\n The click events for the \"Done\" button are bound to the story\n not to the components in specific.\n </p>\n <p>\n This is a demonstration of what is possible with\n <sp-dialog-base>, only, and should not be seen as an\n endorsement for fully custom dialog UIs.\n </p>\n <p>Fully open content area, for whatever DOM you would like.</p>\n <button>Done</button>\n </div>\n </sp-dialog-base>\n`;\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,YAA4B;AACrC,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AACzB,SAAS,+BAA+B;AAExC,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA,IACR,CAAC,UAAgD;AAAA;AAAA;AAAA;AAAA;AAAA,kBAKvC,MAAM;AAAA;AAAA;AAAA,IAGhB;AAAA,EACJ;AACJ;AAEO,aAAM,UAAU,MAAsB;AAAA;AAAA;AAAA;AAAA,iBAI5B,CAAC,UAAiB;AACvB,MAAK,MAAM,OAAuB,cAAc,aAAa;AACzD,IAAC,MAAM,OAAuB;AAAA,MAC1B,IAAI,MAAM,SAAS,EAAE,SAAS,MAAM,UAAU,KAAK,CAAC;AAAA,IACxD;AAAA,EACJ;AACJ;A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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAYkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBnB,aAAM,cAAc,MAAsB;AAAA;AAAA;AAAA;AAAA,iBAIhC,CAAC,UAAiB;AACvB,MAAK,MAAM,OAAuB,cAAc,UAAU;AACtD,IAAC,MAAM,OAAuB;AAAA,MAC1B,IAAI,MAAM,SAAS,EAAE,SAAS,MAAM,UAAU,KAAK,CAAC;AAAA,IACxD;AAAA,EACJ;AACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -68,12 +68,11 @@ export const wrapperDismissable = (args = {}, context = {}) => {
|
|
|
68
68
|
return html`
|
|
69
69
|
<sp-dialog-wrapper
|
|
70
70
|
?open=${open}
|
|
71
|
-
|
|
71
|
+
hero=${landscape}
|
|
72
72
|
dismissable
|
|
73
73
|
headline="Wrapped Dialog w/ Hero Image"
|
|
74
74
|
@close=${handleClose(args)}
|
|
75
75
|
size="s"
|
|
76
|
-
tabindex="0"
|
|
77
76
|
>
|
|
78
77
|
Content of the dialog
|
|
79
78
|
</sp-dialog-wrapper>
|
|
@@ -204,6 +203,7 @@ export const longContent = (args = {}, context = {}) => {
|
|
|
204
203
|
return html`
|
|
205
204
|
<overlay-trigger
|
|
206
205
|
type="modal"
|
|
206
|
+
placement="none"
|
|
207
207
|
@close=${handleClose(args)}
|
|
208
208
|
open=${ifDefined(open)}
|
|
209
209
|
>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["dialog-wrapper.stories.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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/field-label/sp-field-label.js';\nimport '@spectrum-web-components/help-text/sp-help-text.js';\nimport '@spectrum-web-components/textfield/sp-textfield.js';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\n\nimport '@spectrum-web-components/dialog/sp-dialog-wrapper.js';\nimport { landscape } from './images.js';\nimport { overlayTriggerDecorator } from './index.js';\n\nexport default {\n title: 'Dialog Wrapped',\n component: 'sp-dialog-wrapper',\n argTypes: {\n onClose: { action: 'close' },\n onConfirm: { action: 'confirm' },\n onSecondary: { action: 'secondary' },\n onCancel: { action: 'cancel' },\n },\n};\n\ntype StoryArgs = {\n onClose?: (event: Event) => void;\n onConfirm?: (event: Event) => void;\n onSecondary?: (event: Event) => void;\n onCancel?: (event: Event) => void;\n};\n\nconst handleClose =\n ({ onClose }: StoryArgs) =>\n (event: Event) => {\n if (onClose) onClose(event);\n };\n\nconst handleConfirm =\n ({ onConfirm }: StoryArgs) =>\n (event: Event) => {\n if (onConfirm) onConfirm(event);\n };\n\nconst handleSecondary =\n ({ onSecondary }: StoryArgs) =>\n (event: Event) => {\n if (onSecondary) onSecondary(event);\n };\n\nconst handleCancel =\n ({ onCancel }: StoryArgs) =>\n (event: Event) => {\n if (onCancel) onCancel(event);\n };\n\nexport const wrapperLabeledHero = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n hero=${landscape}\n hero-label=\"Hero Image Alt Text\"\n dismissable\n headline=\"Wrapped Dialog w/ Hero Image\"\n @close=${handleClose(args)}\n size=\"s\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n `;\n};\n\nexport const wrapperDismissable = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n .hero=${landscape}\n dismissable\n headline=\"Wrapped Dialog w/ Hero Image\"\n @close=${handleClose(args)}\n size=\"s\"\n tabindex=\"0\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n `;\n};\n\nexport const wrapperDismissableUnderlay = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n hero=${landscape}\n dismissable\n headline=\"Wrapped Dialog w/ Hero Image\"\n underlay\n @close=${handleClose(args)}\n size=\"s\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n `;\n};\n\nexport const form = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? undefined : 'click';\n return html`\n <overlay-trigger\n type=\"modal\"\n placement=\"none\"\n @close=${handleClose(args)}\n open=${ifDefined(open)}\n >\n <sp-button slot=\"trigger\" variant=\"primary\">\n Toggle Dialog\n </sp-button>\n <sp-dialog-wrapper\n id=\"form-fields\"\n slot=\"click-content\"\n headline=\"Add Delivery Address\"\n underlay\n size=\"m\"\n confirm-label=\"Verify Address\"\n secondary-label=\"Add\"\n cancel-label=\"Cancel\"\n @close=${handleClose(args)}\n @confirm=${({ target }: Event & { target: HTMLElement }) => {\n target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n handleConfirm(args);\n }}\n @secondary=${({ target }: Event & { target: HTMLElement }) => {\n target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n handleSecondary(args);\n }}\n @cancel=${({ target }: Event & { target: HTMLElement }) => {\n target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n handleCancel(args);\n }}\n >\n <style>\n #form-fields div {\n display: grid;\n row-gap: var(--spectrum-global-dimension-size-150);\n grid-template-columns: auto auto;\n\n --spectrum-fieldlabel-m-side-padding-right: 0;\n }\n </style>\n <div>\n <sp-field-label side-aligned=\"end\" for=\"street\">\n Street:\n </sp-field-label>\n <sp-textfield id=\"street\" autofocus></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"city\">\n City:\n </sp-field-label>\n <sp-textfield id=\"city\"></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"state\">\n State:\n </sp-field-label>\n <sp-textfield id=\"state\"></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"zip\">\n Zip:\n </sp-field-label>\n <sp-textfield id=\"zip\"></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"instructions\">\n Special instructions:\n </sp-field-label>\n <sp-textfield id=\"instructions\" multiline>\n <sp-help-text slot=\"help-text\">\n For example, gate code or other information to help\n the driver find you\n </sp-help-text>\n </sp-textfield>\n </div>\n </sp-dialog-wrapper>\n </overlay-trigger>\n `;\n};\n\nform.decorators = [overlayTriggerDecorator];\n\nexport const longContent = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? undefined : 'click';\n return html`\n <overlay-trigger\n type=\"modal\"\n @close=${handleClose(args)}\n open=${ifDefined(open)}\n >\n <sp-button slot=\"trigger\" variant=\"primary\">\n Toggle Dialog\n </sp-button>\n <sp-dialog-wrapper\n slot=\"click-content\"\n headline=\"Dialog title\"\n dismissable\n underlay\n size=\"s\"\n >\n <p>\n Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\n Sed ac dolor sit amet purus malesuada congue. Donec quis\n nibh at felis congue commodo. Ut enim ad minima veniam, quis\n nostrum exercitationem ullam corporis suscipit laboriosam,\n nisi ut aliquid ex ea commodi consequatur? Sed ac dolor sit\n amet purus malesuada congue. Nam libero tempore, cum soluta\n nobis est eligendi optio cumque nihil impedit quo minus id\n quod maxime placeat facere possimus, omnis voluptas\n assumenda est, omnis dolor repellendus. Nullam sit amet\n magna in magna gravida vehicula. Itaque earum rerum hic\n tenetur a sapiente delectus, ut aut reiciendis voluptatibus\n maiores alias consequatur aut perferendis doloribus\n asperiores repellat. Neque porro quisquam est, qui dolorem\n ipsum quia dolor sit amet, consectetur, adipisci velit, sed\n quia non numquam eius modi tempora incidunt ut labore et\n dolore magnam aliquam quaerat voluptatem. Phasellus faucibus\n molestie nisl. Vestibulum fermentum tortor id mi. Integer\n rutrum, orci vestibulum ullamcorper ultricies, lacus quam\n ultricies odio, vitae placerat pede sem sit amet enim.\n Maecenas sollicitudin. Nullam rhoncus aliquam metus.\n </p>\n <p>\n Curabitur ligula sapien, pulvinar a vestibulum quis,\n facilisis vel sapien. Fusce nibh. Proin pede metus,\n vulputate nec, fermentum fringilla, vehicula vitae, justo.\n Aenean placerat. Aliquam erat volutpat. Et harum quidem\n rerum facilis est et expedita distinctio. Fusce nibh.\n Temporibus autem quibusdam et aut officiis debitis aut rerum\n necessitatibus saepe eveniet ut et voluptates repudiandae\n sint et molestiae non recusandae. Vestibulum erat nulla,\n ullamcorper nec, rutrum non, nonummy ac, erat. Etiam posuere\n lacus quis dolor. Mauris elementum mauris vitae tortor.\n Nulla turpis magna, cursus sit amet, suscipit a, interdum\n id, felis. Nam libero tempore, cum soluta nobis est eligendi\n optio cumque nihil impedit quo minus id quod maxime placeat\n facere possimus, omnis voluptas assumenda est, omnis dolor\n repellendus. Nulla accumsan, elit sit amet varius semper,\n nulla mauris mollis quam, tempor suscipit diam nulla vel\n leo. Pellentesque sapien.\n </p>\n <p>\n Curabitur vitae diam non enim vestibulum interdum. Sed elit\n dui, pellentesque a, faucibus vel, interdum nec, diam.\n Praesent vitae arcu tempor neque lacinia pretium. Ut tempus\n purus at lorem. Phasellus rhoncus. Temporibus autem\n quibusdam et aut officiis debitis aut rerum necessitatibus\n saepe eveniet ut et voluptates repudiandae sint et molestiae\n non recusandae. Duis ante orci, molestie vitae vehicula\n venenatis, tincidunt ac pede. Integer vulputate sem a nibh\n rutrum consequat. Aenean placerat. Cum sociis natoque\n penatibus et magnis dis parturient montes, nascetur\n ridiculus mus. Sed vel lectus. Donec odio tempus molestie,\n porttitor ut, iaculis quis, sem. Class aptent taciti\n sociosqu ad litora torquent per conubia nostra, per inceptos\n hymenaeos. Integer in sapien. Nullam dapibus fermentum\n ipsum.\n </p>\n <p>\n Integer vulputate sem a nibh rutrum consequat. Class aptent\n taciti sociosqu ad litora torquent per conubia nostra, per\n inceptos hymenaeos. Duis bibendum, lectus ut viverra\n rhoncus, dolor nunc faucibus libero, eget facilisis enim\n ipsum id lacus. Aliquam erat volutpat. Aenean id metus id\n velit ullamcorper pulvinar. Morbi scelerisque luctus velit.\n Aliquam erat volutpat. Temporibus autem quibusdam et aut\n officiis debitis aut rerum necessitatibus saepe eveniet ut\n et voluptates repudiandae sint et molestiae non recusandae.\n Fusce dui leo, imperdiet in, aliquam sit amet, feugiat eu,\n orci. Suspendisse sagittis ultrices augue. Nullam justo\n enim, consectetuer nec, ullamcorper ac, vestibulum in, elit.\n Praesent vitae arcu tempor neque lacinia pretium. Nullam\n faucibus mi quis velit. Maecenas aliquet accumsan leo. Morbi\n scelerisque luctus velit. Aliquam ornare wisi eu metus.\n </p>\n <p>\n Sed elit dui, pellentesque a, faucibus vel, interdum nec,\n diam. Praesent vitae arcu tempor neque lacinia pretium.\n Etiam dictum tincidunt diam. Et harum quidem rerum facilis\n est et expedita distinctio. Duis ante orci, molestie vitae\n vehicula venenatis, tincidunt ac pede. Integer lacinia.\n Excepteur sint occaecat cupidatat non proident, sunt in\n culpa qui officia deserunt mollit anim id est laborum.\n Mauris tincidunt sem sed arcu. Praesent in mauris eu tortor\n porttitor accumsan. Aenean id metus id velit ullamcorper\n pulvinar. Donec iaculis gravida nulla. Duis bibendum, lectus\n ut viverra rhoncus, dolor nunc faucibus libero, eget\n facilisis enim ipsum id lacus. Nulla quis diam. Quisque\n porta. Integer rutrum, orci vestibulum ullamcorper\n ultricies, lacus quam ultricies odio, vitae placerat pede\n sem sit amet enim. Nam sed tellus id magna elementum\n tincidunt. In enim a arcu imperdiet malesuada.\n </p>\n </sp-dialog-wrapper>\n </overlay-trigger>\n `;\n};\n\nlongContent.decorators = [overlayTriggerDecorator];\n\nexport const wrapperDismissableUnderlayError = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <div>\n <sp-dialog-wrapper\n ?open=${open}\n hero=${landscape}\n dismissable\n error\n headline=\"Wrapped Dialog w/ Hero Image\"\n underlay\n @close=${handleClose(args)}\n size=\"s\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n </div>\n `;\n};\n\nexport const wrapperButtons = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n size=\"l\"\n headline=\"Wrapped Dialog w/ Buttons\"\n confirm-label=\"Keep Both\"\n secondary-label=\"Replace\"\n cancel-label=\"Cancel\"\n footer=\"Content for footer\"\n @close=${handleClose(args)}\n @confirm=${handleConfirm(args)}\n @secondary=${handleSecondary(args)}\n @cancel=${handleCancel(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperButtonsUnderlay = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n underlay\n size=\"l\"\n headline=\"Wrapped Dialog w/ Buttons\"\n confirm-label=\"Keep Both\"\n secondary-label=\"Replace\"\n cancel-label=\"Cancel\"\n footer=\"Content for footer\"\n @close=${handleClose(args)}\n @confirm=${handleConfirm(args)}\n @secondary=${handleSecondary(args)}\n @cancel=${handleCancel(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperFullscreen = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n headline=\"Wrapped Dialog - Fullscreen\"\n mode=\"fullscreen\"\n confirm-label=\"Keep Both\"\n secondary-label=\"Replace\"\n cancel-label=\"Cancel\"\n @close=${handleClose(args)}\n @confirm=${handleConfirm(args)}\n @secondary=${handleSecondary(args)}\n @cancel=${handleCancel(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperWithHeadline = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n headline=\"Headline for dialog\"\n @close=${handleClose(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperWithHeadlineNoDivider = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n headline=\"Headline for dialog\"\n no-divider=${true}\n @close=${handleClose(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperHeadlineVisibilityNone = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n headline=\"Accessible headline\"\n .headlineVisibility=${'none'}\n ?open=${open}\n @close=${handleClose(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const tooltips = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? undefined : 'click';\n return html`\n <overlay-trigger\n type=\"modal\"\n placement=\"none\"\n @close=${handleClose(args)}\n open=${ifDefined(open)}\n >\n <sp-button slot=\"trigger\" variant=\"primary\">\n Toggle Dialog\n </sp-button>\n <sp-dialog-wrapper\n slot=\"click-content\"\n headline=\"Dialog title\"\n dismissable\n underlay\n size=\"s\"\n >\n ${[1, 2, 3, 4].map(\n (index) => html`\n <overlay-trigger>\n <sp-button slot=\"trigger\">\n Button with Tooltip ${index}\n </sp-button>\n <sp-tooltip slot=\"hover-content\">\n Tooltip ${index}\n </sp-tooltip>\n </overlay-trigger>\n `\n )}\n </sp-dialog-wrapper>\n </overlay-trigger>\n `;\n};\n\ntooltips.decorators = [overlayTriggerDecorator];\n"],
|
|
5
|
-
"mappings": ";AAYA,SAAS,YAA4B;AACrC,SAAS,iBAAiB;AAE1B,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AACP,SAAS,iBAAiB;AAC1B,SAAS,+BAA+B;AAExC,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,IACN,SAAS,EAAE,QAAQ,QAAQ;AAAA,IAC3B,WAAW,EAAE,QAAQ,UAAU;AAAA,IAC/B,aAAa,EAAE,QAAQ,YAAY;AAAA,IACnC,UAAU,EAAE,QAAQ,SAAS;AAAA,EACjC;AACJ;AASA,MAAM,cACF,CAAC,EAAE,QAAQ,MACX,CAAC,UAAiB;AACd,MAAI;AAAS,YAAQ,KAAK;AAC9B;AAEJ,MAAM,gBACF,CAAC,EAAE,UAAU,MACb,CAAC,UAAiB;AACd,MAAI;AAAW,cAAU,KAAK;AAClC;AAEJ,MAAM,kBACF,CAAC,EAAE,YAAY,MACf,CAAC,UAAiB;AACd,MAAI;AAAa,gBAAY,KAAK;AACtC;AAEJ,MAAM,eACF,CAAC,EAAE,SAAS,MACZ,CAAC,UAAiB;AACd,MAAI;AAAU,aAAS,KAAK;AAChC;AAEG,aAAM,qBAAqB,CAC9B,OAAkB,CAAC,GACnB,UAAiC,CAAC,MACjB;AACjB,QAAM,OAAO,QAAQ,aAAa,SAAS,QAAQ;AACnD,SAAO;AAAA;AAAA,oBAES;AAAA,mBACD;AAAA;AAAA;AAAA;AAAA,qBAIE,YAAY,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBrC;AAEO,aAAM,qBAAqB,CAC9B,OAAkB,CAAC,GACnB,UAAiC,CAAC,MACjB;AACjB,QAAM,OAAO,QAAQ,aAAa,SAAS,QAAQ;AACnD,SAAO;AAAA;AAAA,oBAES;AAAA,
|
|
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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/field-label/sp-field-label.js';\nimport '@spectrum-web-components/help-text/sp-help-text.js';\nimport '@spectrum-web-components/textfield/sp-textfield.js';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\n\nimport '@spectrum-web-components/dialog/sp-dialog-wrapper.js';\nimport { landscape } from './images.js';\nimport { overlayTriggerDecorator } from './index.js';\n\nexport default {\n title: 'Dialog Wrapped',\n component: 'sp-dialog-wrapper',\n argTypes: {\n onClose: { action: 'close' },\n onConfirm: { action: 'confirm' },\n onSecondary: { action: 'secondary' },\n onCancel: { action: 'cancel' },\n },\n};\n\ntype StoryArgs = {\n onClose?: (event: Event) => void;\n onConfirm?: (event: Event) => void;\n onSecondary?: (event: Event) => void;\n onCancel?: (event: Event) => void;\n};\n\nconst handleClose =\n ({ onClose }: StoryArgs) =>\n (event: Event) => {\n if (onClose) onClose(event);\n };\n\nconst handleConfirm =\n ({ onConfirm }: StoryArgs) =>\n (event: Event) => {\n if (onConfirm) onConfirm(event);\n };\n\nconst handleSecondary =\n ({ onSecondary }: StoryArgs) =>\n (event: Event) => {\n if (onSecondary) onSecondary(event);\n };\n\nconst handleCancel =\n ({ onCancel }: StoryArgs) =>\n (event: Event) => {\n if (onCancel) onCancel(event);\n };\n\nexport const wrapperLabeledHero = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n hero=${landscape}\n hero-label=\"Hero Image Alt Text\"\n dismissable\n headline=\"Wrapped Dialog w/ Hero Image\"\n @close=${handleClose(args)}\n size=\"s\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n `;\n};\n\nexport const wrapperDismissable = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n hero=${landscape}\n dismissable\n headline=\"Wrapped Dialog w/ Hero Image\"\n @close=${handleClose(args)}\n size=\"s\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n `;\n};\n\nexport const wrapperDismissableUnderlay = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n hero=${landscape}\n dismissable\n headline=\"Wrapped Dialog w/ Hero Image\"\n underlay\n @close=${handleClose(args)}\n size=\"s\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n `;\n};\n\nexport const form = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? undefined : 'click';\n return html`\n <overlay-trigger\n type=\"modal\"\n placement=\"none\"\n @close=${handleClose(args)}\n open=${ifDefined(open)}\n >\n <sp-button slot=\"trigger\" variant=\"primary\">\n Toggle Dialog\n </sp-button>\n <sp-dialog-wrapper\n id=\"form-fields\"\n slot=\"click-content\"\n headline=\"Add Delivery Address\"\n underlay\n size=\"m\"\n confirm-label=\"Verify Address\"\n secondary-label=\"Add\"\n cancel-label=\"Cancel\"\n @close=${handleClose(args)}\n @confirm=${({ target }: Event & { target: HTMLElement }) => {\n target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n handleConfirm(args);\n }}\n @secondary=${({ target }: Event & { target: HTMLElement }) => {\n target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n handleSecondary(args);\n }}\n @cancel=${({ target }: Event & { target: HTMLElement }) => {\n target.dispatchEvent(\n new Event('close', { bubbles: true, composed: true })\n );\n handleCancel(args);\n }}\n >\n <style>\n #form-fields div {\n display: grid;\n row-gap: var(--spectrum-global-dimension-size-150);\n grid-template-columns: auto auto;\n\n --spectrum-fieldlabel-m-side-padding-right: 0;\n }\n </style>\n <div>\n <sp-field-label side-aligned=\"end\" for=\"street\">\n Street:\n </sp-field-label>\n <sp-textfield id=\"street\" autofocus></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"city\">\n City:\n </sp-field-label>\n <sp-textfield id=\"city\"></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"state\">\n State:\n </sp-field-label>\n <sp-textfield id=\"state\"></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"zip\">\n Zip:\n </sp-field-label>\n <sp-textfield id=\"zip\"></sp-textfield>\n <sp-field-label side-aligned=\"end\" for=\"instructions\">\n Special instructions:\n </sp-field-label>\n <sp-textfield id=\"instructions\" multiline>\n <sp-help-text slot=\"help-text\">\n For example, gate code or other information to help\n the driver find you\n </sp-help-text>\n </sp-textfield>\n </div>\n </sp-dialog-wrapper>\n </overlay-trigger>\n `;\n};\n\nform.decorators = [overlayTriggerDecorator];\n\nexport const longContent = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? undefined : 'click';\n return html`\n <overlay-trigger\n type=\"modal\"\n placement=\"none\"\n @close=${handleClose(args)}\n open=${ifDefined(open)}\n >\n <sp-button slot=\"trigger\" variant=\"primary\">\n Toggle Dialog\n </sp-button>\n <sp-dialog-wrapper\n slot=\"click-content\"\n headline=\"Dialog title\"\n dismissable\n underlay\n size=\"s\"\n >\n <p>\n Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\n Sed ac dolor sit amet purus malesuada congue. Donec quis\n nibh at felis congue commodo. Ut enim ad minima veniam, quis\n nostrum exercitationem ullam corporis suscipit laboriosam,\n nisi ut aliquid ex ea commodi consequatur? Sed ac dolor sit\n amet purus malesuada congue. Nam libero tempore, cum soluta\n nobis est eligendi optio cumque nihil impedit quo minus id\n quod maxime placeat facere possimus, omnis voluptas\n assumenda est, omnis dolor repellendus. Nullam sit amet\n magna in magna gravida vehicula. Itaque earum rerum hic\n tenetur a sapiente delectus, ut aut reiciendis voluptatibus\n maiores alias consequatur aut perferendis doloribus\n asperiores repellat. Neque porro quisquam est, qui dolorem\n ipsum quia dolor sit amet, consectetur, adipisci velit, sed\n quia non numquam eius modi tempora incidunt ut labore et\n dolore magnam aliquam quaerat voluptatem. Phasellus faucibus\n molestie nisl. Vestibulum fermentum tortor id mi. Integer\n rutrum, orci vestibulum ullamcorper ultricies, lacus quam\n ultricies odio, vitae placerat pede sem sit amet enim.\n Maecenas sollicitudin. Nullam rhoncus aliquam metus.\n </p>\n <p>\n Curabitur ligula sapien, pulvinar a vestibulum quis,\n facilisis vel sapien. Fusce nibh. Proin pede metus,\n vulputate nec, fermentum fringilla, vehicula vitae, justo.\n Aenean placerat. Aliquam erat volutpat. Et harum quidem\n rerum facilis est et expedita distinctio. Fusce nibh.\n Temporibus autem quibusdam et aut officiis debitis aut rerum\n necessitatibus saepe eveniet ut et voluptates repudiandae\n sint et molestiae non recusandae. Vestibulum erat nulla,\n ullamcorper nec, rutrum non, nonummy ac, erat. Etiam posuere\n lacus quis dolor. Mauris elementum mauris vitae tortor.\n Nulla turpis magna, cursus sit amet, suscipit a, interdum\n id, felis. Nam libero tempore, cum soluta nobis est eligendi\n optio cumque nihil impedit quo minus id quod maxime placeat\n facere possimus, omnis voluptas assumenda est, omnis dolor\n repellendus. Nulla accumsan, elit sit amet varius semper,\n nulla mauris mollis quam, tempor suscipit diam nulla vel\n leo. Pellentesque sapien.\n </p>\n <p>\n Curabitur vitae diam non enim vestibulum interdum. Sed elit\n dui, pellentesque a, faucibus vel, interdum nec, diam.\n Praesent vitae arcu tempor neque lacinia pretium. Ut tempus\n purus at lorem. Phasellus rhoncus. Temporibus autem\n quibusdam et aut officiis debitis aut rerum necessitatibus\n saepe eveniet ut et voluptates repudiandae sint et molestiae\n non recusandae. Duis ante orci, molestie vitae vehicula\n venenatis, tincidunt ac pede. Integer vulputate sem a nibh\n rutrum consequat. Aenean placerat. Cum sociis natoque\n penatibus et magnis dis parturient montes, nascetur\n ridiculus mus. Sed vel lectus. Donec odio tempus molestie,\n porttitor ut, iaculis quis, sem. Class aptent taciti\n sociosqu ad litora torquent per conubia nostra, per inceptos\n hymenaeos. Integer in sapien. Nullam dapibus fermentum\n ipsum.\n </p>\n <p>\n Integer vulputate sem a nibh rutrum consequat. Class aptent\n taciti sociosqu ad litora torquent per conubia nostra, per\n inceptos hymenaeos. Duis bibendum, lectus ut viverra\n rhoncus, dolor nunc faucibus libero, eget facilisis enim\n ipsum id lacus. Aliquam erat volutpat. Aenean id metus id\n velit ullamcorper pulvinar. Morbi scelerisque luctus velit.\n Aliquam erat volutpat. Temporibus autem quibusdam et aut\n officiis debitis aut rerum necessitatibus saepe eveniet ut\n et voluptates repudiandae sint et molestiae non recusandae.\n Fusce dui leo, imperdiet in, aliquam sit amet, feugiat eu,\n orci. Suspendisse sagittis ultrices augue. Nullam justo\n enim, consectetuer nec, ullamcorper ac, vestibulum in, elit.\n Praesent vitae arcu tempor neque lacinia pretium. Nullam\n faucibus mi quis velit. Maecenas aliquet accumsan leo. Morbi\n scelerisque luctus velit. Aliquam ornare wisi eu metus.\n </p>\n <p>\n Sed elit dui, pellentesque a, faucibus vel, interdum nec,\n diam. Praesent vitae arcu tempor neque lacinia pretium.\n Etiam dictum tincidunt diam. Et harum quidem rerum facilis\n est et expedita distinctio. Duis ante orci, molestie vitae\n vehicula venenatis, tincidunt ac pede. Integer lacinia.\n Excepteur sint occaecat cupidatat non proident, sunt in\n culpa qui officia deserunt mollit anim id est laborum.\n Mauris tincidunt sem sed arcu. Praesent in mauris eu tortor\n porttitor accumsan. Aenean id metus id velit ullamcorper\n pulvinar. Donec iaculis gravida nulla. Duis bibendum, lectus\n ut viverra rhoncus, dolor nunc faucibus libero, eget\n facilisis enim ipsum id lacus. Nulla quis diam. Quisque\n porta. Integer rutrum, orci vestibulum ullamcorper\n ultricies, lacus quam ultricies odio, vitae placerat pede\n sem sit amet enim. Nam sed tellus id magna elementum\n tincidunt. In enim a arcu imperdiet malesuada.\n </p>\n </sp-dialog-wrapper>\n </overlay-trigger>\n `;\n};\n\nlongContent.decorators = [overlayTriggerDecorator];\n\nexport const wrapperDismissableUnderlayError = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <div>\n <sp-dialog-wrapper\n ?open=${open}\n hero=${landscape}\n dismissable\n error\n headline=\"Wrapped Dialog w/ Hero Image\"\n underlay\n @close=${handleClose(args)}\n size=\"s\"\n >\n Content of the dialog\n </sp-dialog-wrapper>\n <sp-button\n onClick=\"\n this.previousElementSibling.open = !this.previousElementSibling.open;\n if (this.previousElementSibling.open) {\n this.previousElementSibling.focus();\n }\n \"\n variant=\"primary\"\n >\n Toggle Dialog\n </sp-button>\n </div>\n `;\n};\n\nexport const wrapperButtons = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n size=\"l\"\n headline=\"Wrapped Dialog w/ Buttons\"\n confirm-label=\"Keep Both\"\n secondary-label=\"Replace\"\n cancel-label=\"Cancel\"\n footer=\"Content for footer\"\n @close=${handleClose(args)}\n @confirm=${handleConfirm(args)}\n @secondary=${handleSecondary(args)}\n @cancel=${handleCancel(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperButtonsUnderlay = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n underlay\n size=\"l\"\n headline=\"Wrapped Dialog w/ Buttons\"\n confirm-label=\"Keep Both\"\n secondary-label=\"Replace\"\n cancel-label=\"Cancel\"\n footer=\"Content for footer\"\n @close=${handleClose(args)}\n @confirm=${handleConfirm(args)}\n @secondary=${handleSecondary(args)}\n @cancel=${handleCancel(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperFullscreen = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n headline=\"Wrapped Dialog - Fullscreen\"\n mode=\"fullscreen\"\n confirm-label=\"Keep Both\"\n secondary-label=\"Replace\"\n cancel-label=\"Cancel\"\n @close=${handleClose(args)}\n @confirm=${handleConfirm(args)}\n @secondary=${handleSecondary(args)}\n @cancel=${handleCancel(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperWithHeadline = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n headline=\"Headline for dialog\"\n @close=${handleClose(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperWithHeadlineNoDivider = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n ?open=${open}\n headline=\"Headline for dialog\"\n no-divider=${true}\n @close=${handleClose(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const wrapperHeadlineVisibilityNone = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? false : true;\n return html`\n <sp-dialog-wrapper\n headline=\"Accessible headline\"\n .headlineVisibility=${'none'}\n ?open=${open}\n @close=${handleClose(args)}\n >\n Content of the dialog\n </sp-dialog-wrapper>\n `;\n};\n\nexport const tooltips = (\n args: StoryArgs = {},\n context: { viewMode?: string } = {}\n): TemplateResult => {\n const open = context.viewMode === 'docs' ? undefined : 'click';\n return html`\n <overlay-trigger\n type=\"modal\"\n placement=\"none\"\n @close=${handleClose(args)}\n open=${ifDefined(open)}\n >\n <sp-button slot=\"trigger\" variant=\"primary\">\n Toggle Dialog\n </sp-button>\n <sp-dialog-wrapper\n slot=\"click-content\"\n headline=\"Dialog title\"\n dismissable\n underlay\n size=\"s\"\n >\n ${[1, 2, 3, 4].map(\n (index) => html`\n <overlay-trigger>\n <sp-button slot=\"trigger\">\n Button with Tooltip ${index}\n </sp-button>\n <sp-tooltip slot=\"hover-content\">\n Tooltip ${index}\n </sp-tooltip>\n </overlay-trigger>\n `\n )}\n </sp-dialog-wrapper>\n </overlay-trigger>\n `;\n};\n\ntooltips.decorators = [overlayTriggerDecorator];\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,YAA4B;AACrC,SAAS,iBAAiB;AAE1B,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AACP,SAAS,iBAAiB;AAC1B,SAAS,+BAA+B;AAExC,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,IACN,SAAS,EAAE,QAAQ,QAAQ;AAAA,IAC3B,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;AAAA;AAAA;AAAA;AAAA;AAKrC;AAEO,aAAM,gCAAgC,CACzC,OAAkB,CAAC,GACnB,UAAiC,CAAC,MACjB;AACjB,QAAM,OAAO,QAAQ,aAAa,SAAS,QAAQ;AACnD,SAAO;AAAA;AAAA;AAAA,kCAGuB;AAAA,oBACd;AAAA,qBACC,YAAY,IAAI;AAAA;AAAA;AAAA;AAAA;AAKrC;AAEO,aAAM,WAAW,CACpB,OAAkB,CAAC,GACnB,UAAiC,CAAC,MACjB;AACjB,QAAM,OAAO,QAAQ,aAAa,SAAS,SAAY;AACvD,SAAO;AAAA;AAAA;AAAA;AAAA,qBAIU,YAAY,IAAI;AAAA,mBAClB,UAAU,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAYf,CAAC,GAAG,GAAG,GAAG,CAAC,EAAE;AAAA,IACX,CAAC,UAAU;AAAA;AAAA;AAAA,sDAGuB;AAAA;AAAA;AAAA,0CAGZ;AAAA;AAAA;AAAA;AAAA,EAI1B;AAAA;AAAA;AAAA;AAIhB;AAEA,SAAS,aAAa,CAAC,uBAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/test/dialog-base.test.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import {
|
|
3
|
-
aTimeout,
|
|
4
3
|
elementUpdated,
|
|
5
4
|
expect,
|
|
6
5
|
fixture,
|
|
7
6
|
html,
|
|
7
|
+
nextFrame,
|
|
8
8
|
oneEvent
|
|
9
9
|
} from "@open-wc/testing";
|
|
10
10
|
import "@spectrum-web-components/theme/sp-theme.js";
|
|
@@ -21,13 +21,14 @@ async function styledFixture(story) {
|
|
|
21
21
|
return test.children[0];
|
|
22
22
|
}
|
|
23
23
|
const overlayTrigger = (story) => html`
|
|
24
|
-
<overlay-trigger type="modal">
|
|
24
|
+
<overlay-trigger type="modal" placement="none">
|
|
25
25
|
<sp-button slot="trigger" variant="primary">Toggle Dialog</sp-button>
|
|
26
26
|
${story()}
|
|
27
27
|
</overlay-trigger>
|
|
28
28
|
`;
|
|
29
29
|
describe("dialog base", () => {
|
|
30
|
-
it("does not close by default
|
|
30
|
+
it("does not close by default with interacting with buttons", async () => {
|
|
31
|
+
var _a, _b, _c, _d, _e;
|
|
31
32
|
const el = await styledFixture(
|
|
32
33
|
overlayTrigger(
|
|
33
34
|
() => html`
|
|
@@ -48,23 +49,31 @@ describe("dialog base", () => {
|
|
|
48
49
|
);
|
|
49
50
|
expect(el.open).to.be.undefined;
|
|
50
51
|
expect(dialog.open).to.be.false;
|
|
52
|
+
expect((_a = dialog.parentElement) == null ? void 0 : _a.localName).to.equal("overlay-trigger");
|
|
53
|
+
await nextFrame();
|
|
51
54
|
const opened = oneEvent(el, "sp-opened");
|
|
52
55
|
el.open = "click";
|
|
53
56
|
await opened;
|
|
57
|
+
await nextFrame();
|
|
54
58
|
expect(dialog.open).to.be.true;
|
|
55
59
|
expect(el.open).to.be.equal("click");
|
|
60
|
+
expect((_b = dialog.parentElement) == null ? void 0 : _b.localName).to.equal("active-overlay");
|
|
56
61
|
secondaryButton.click();
|
|
57
|
-
await aTimeout(100);
|
|
58
62
|
expect(el.open).to.be.equal("click");
|
|
63
|
+
expect((_c = dialog.parentElement) == null ? void 0 : _c.localName).to.equal("active-overlay");
|
|
59
64
|
negativeButton.click();
|
|
60
|
-
await aTimeout(100);
|
|
61
65
|
expect(el.open).to.be.equal("click");
|
|
66
|
+
expect((_d = dialog.parentElement) == null ? void 0 : _d.localName).to.equal("active-overlay");
|
|
62
67
|
const closed = oneEvent(el, "sp-closed");
|
|
63
|
-
|
|
68
|
+
el.open = void 0;
|
|
64
69
|
await closed;
|
|
70
|
+
await elementUpdated(el);
|
|
65
71
|
expect(dialog.open).to.be.false;
|
|
72
|
+
expect(el.open).to.be.undefined;
|
|
73
|
+
expect((_e = dialog.parentElement) == null ? void 0 : _e.localName).to.equal("overlay-trigger");
|
|
66
74
|
});
|
|
67
|
-
it("does not close by default
|
|
75
|
+
it("does not close by default with interacting with buttons when recycled", async () => {
|
|
76
|
+
var _a, _b, _c, _d;
|
|
68
77
|
const el = await styledFixture(
|
|
69
78
|
overlayTrigger(
|
|
70
79
|
() => html`
|
|
@@ -85,17 +94,21 @@ describe("dialog base", () => {
|
|
|
85
94
|
);
|
|
86
95
|
expect(el.open).to.be.undefined;
|
|
87
96
|
expect(dialog.open).to.be.false;
|
|
97
|
+
expect((_a = dialog.parentElement) == null ? void 0 : _a.localName).to.equal("overlay-trigger");
|
|
98
|
+
await nextFrame();
|
|
88
99
|
const opened = oneEvent(el, "sp-opened");
|
|
89
100
|
el.open = "click";
|
|
90
101
|
await opened;
|
|
102
|
+
await nextFrame();
|
|
91
103
|
expect(dialog.open).to.be.true;
|
|
92
104
|
expect(el.open).to.be.equal("click");
|
|
105
|
+
expect((_b = dialog.parentElement) == null ? void 0 : _b.localName).to.equal("active-overlay");
|
|
93
106
|
secondaryButton.click();
|
|
94
|
-
await aTimeout(100);
|
|
95
107
|
expect(el.open).to.be.equal("click");
|
|
108
|
+
expect((_c = dialog.parentElement) == null ? void 0 : _c.localName).to.equal("active-overlay");
|
|
96
109
|
negativeButton.click();
|
|
97
|
-
await aTimeout(100);
|
|
98
110
|
expect(el.open).to.be.equal("click");
|
|
111
|
+
expect((_d = dialog.parentElement) == null ? void 0 : _d.localName).to.equal("active-overlay");
|
|
99
112
|
const closed = oneEvent(el, "sp-closed");
|
|
100
113
|
dialog.open = false;
|
|
101
114
|
await closed;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["dialog-base.test.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2022 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
|
|
5
|
-
"mappings": ";AAYA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAGP,OAAO;AACP,OAAO;AACP,OAAO;AAGP,OAAO;AACP,SAAS,wBAAwB;AAIjC,eAAe,cACX,OACU;AACV,QAAM,OAAO,MAAM,QAAe;AAAA;AAAA,cAExB;AAAA;AAAA,KAET;AACD,SAAO,KAAK,SAAS,CAAC;AAC1B;AAEA,MAAM,iBAAiB,CAAC,UAAgD;AAAA;AAAA;AAAA,UAG9D,MAAM;AAAA;AAAA;AAIhB,SAAS,eAAe,MAAM;AAC1B,KAAG,2DAA2D,YAAY;
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2022 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 elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport '@spectrum-web-components/dialog/sp-dialog-base.js';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { OverlayTrigger } from '@spectrum-web-components/overlay';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport { alertDestructive } from '../stories/dialog.stories.js';\nimport { Button } from '@spectrum-web-components/button/src/Button.js';\nimport { DialogBase } from '@spectrum-web-components/dialog';\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme theme=\"spectrum\" scale=\"medium\" color=\"dark\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\nconst overlayTrigger = (story: () => TemplateResult): TemplateResult => html`\n <overlay-trigger type=\"modal\" placement=\"none\">\n <sp-button slot=\"trigger\" variant=\"primary\">Toggle Dialog</sp-button>\n ${story()}\n </overlay-trigger>\n`;\n\ndescribe('dialog base', () => {\n it('does not close by default with interacting with buttons', async () => {\n const el = await styledFixture<OverlayTrigger>(\n overlayTrigger(\n () => html`\n <sp-dialog-base underlay slot=\"click-content\">\n ${alertDestructive()}\n </sp-dialog-base>\n `\n )\n );\n await elementUpdated(el);\n\n const dialog = el.querySelector('sp-dialog-base') as DialogBase;\n await elementUpdated(dialog);\n const secondaryButton = el.querySelector(\n '[variant=\"secondary\"]'\n ) as Button;\n const negativeButton = el.querySelector(\n '[variant=\"negative\"]'\n ) as Button;\n\n expect(el.open).to.be.undefined;\n expect(dialog.open).to.be.false;\n expect(dialog.parentElement?.localName).to.equal('overlay-trigger');\n await nextFrame();\n const opened = oneEvent(el, 'sp-opened');\n el.open = 'click';\n await opened;\n await nextFrame();\n\n expect(dialog.open).to.be.true;\n expect(el.open).to.be.equal('click');\n expect(dialog.parentElement?.localName).to.equal('active-overlay');\n\n secondaryButton.click();\n\n expect(el.open).to.be.equal('click');\n expect(dialog.parentElement?.localName).to.equal('active-overlay');\n\n negativeButton.click();\n\n expect(el.open).to.be.equal('click');\n expect(dialog.parentElement?.localName).to.equal('active-overlay');\n const closed = oneEvent(el, 'sp-closed');\n el.open = undefined;\n await closed;\n await elementUpdated(el);\n\n expect(dialog.open).to.be.false;\n expect(el.open).to.be.undefined;\n expect(dialog.parentElement?.localName).to.equal('overlay-trigger');\n });\n it('does not close by default with interacting with buttons when recycled', async () => {\n const el = await styledFixture<OverlayTrigger>(\n overlayTrigger(\n () => html`\n <sp-dialog-base underlay slot=\"click-content\">\n ${alertDestructive()}\n </sp-dialog-base>\n `\n )\n );\n await elementUpdated(el);\n\n const dialog = el.querySelector('sp-dialog-base') as DialogBase;\n await elementUpdated(dialog);\n const secondaryButton = el.querySelector(\n '[variant=\"secondary\"]'\n ) as Button;\n const negativeButton = el.querySelector(\n '[variant=\"negative\"]'\n ) as Button;\n\n expect(el.open).to.be.undefined;\n expect(dialog.open).to.be.false;\n expect(dialog.parentElement?.localName).to.equal('overlay-trigger');\n await nextFrame();\n const opened = oneEvent(el, 'sp-opened');\n el.open = 'click';\n await opened;\n await nextFrame();\n\n expect(dialog.open).to.be.true;\n expect(el.open).to.be.equal('click');\n expect(dialog.parentElement?.localName).to.equal('active-overlay');\n\n secondaryButton.click();\n\n expect(el.open).to.be.equal('click');\n expect(dialog.parentElement?.localName).to.equal('active-overlay');\n\n negativeButton.click();\n\n expect(el.open).to.be.equal('click');\n expect(dialog.parentElement?.localName).to.equal('active-overlay');\n const closed = oneEvent(el, 'sp-closed');\n dialog.open = false;\n await closed;\n await elementUpdated(el);\n\n expect(dialog.open).to.be.false;\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAYA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAGP,OAAO;AACP,OAAO;AACP,OAAO;AAGP,OAAO;AACP,SAAS,wBAAwB;AAIjC,eAAe,cACX,OACU;AACV,QAAM,OAAO,MAAM,QAAe;AAAA;AAAA,cAExB;AAAA;AAAA,KAET;AACD,SAAO,KAAK,SAAS,CAAC;AAC1B;AAEA,MAAM,iBAAiB,CAAC,UAAgD;AAAA;AAAA;AAAA,UAG9D,MAAM;AAAA;AAAA;AAIhB,SAAS,eAAe,MAAM;AAC1B,KAAG,2DAA2D,YAAY;AAnD9E;AAoDQ,UAAM,KAAK,MAAM;AAAA,MACb;AAAA,QACI,MAAM;AAAA;AAAA,0BAEI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
3
3
|
elementUpdated,
|
|
4
4
|
expect,
|
|
5
5
|
fixture,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
nextFrame,
|
|
7
|
+
oneEvent
|
|
8
8
|
} from "@open-wc/testing";
|
|
9
9
|
import { spy, stub } from "sinon";
|
|
10
10
|
import "@spectrum-web-components/theme/sp-theme.js";
|
|
@@ -60,47 +60,35 @@ describe("Dialog Wrapper", () => {
|
|
|
60
60
|
});
|
|
61
61
|
it("opens and closes", async () => {
|
|
62
62
|
const closeSpy = spy();
|
|
63
|
-
const
|
|
64
|
-
const test = await styledFixture(html`
|
|
65
|
-
<div @sp-opened=${() => openedSpy()}>${longContent()}</div>
|
|
66
|
-
`);
|
|
67
|
-
const overlayTrigger = test.querySelector(
|
|
68
|
-
"overlay-trigger"
|
|
69
|
-
);
|
|
63
|
+
const test = await styledFixture(longContent());
|
|
70
64
|
const el = test.querySelector("sp-dialog-wrapper");
|
|
71
65
|
el.addEventListener("close", () => closeSpy());
|
|
72
|
-
await
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
);
|
|
66
|
+
await elementUpdated(el);
|
|
67
|
+
const opened = oneEvent(test, "sp-opened");
|
|
68
|
+
test.open = "click";
|
|
69
|
+
await opened;
|
|
77
70
|
expect(el.open).to.be.true;
|
|
78
|
-
const closed = oneEvent(
|
|
79
|
-
|
|
71
|
+
const closed = oneEvent(test, "sp-closed");
|
|
72
|
+
test.open = void 0;
|
|
80
73
|
await closed;
|
|
74
|
+
await nextFrame();
|
|
81
75
|
expect(el.open).to.be.false;
|
|
82
76
|
expect(closeSpy.callCount).to.equal(1);
|
|
83
77
|
});
|
|
84
78
|
it("opens and closes when element is recycled", async () => {
|
|
85
79
|
const closeSpy = spy();
|
|
86
|
-
const
|
|
87
|
-
const test = await styledFixture(html`
|
|
88
|
-
<div @sp-opened=${() => openedSpy()}>${longContent()}</div>
|
|
89
|
-
`);
|
|
90
|
-
const overlayTrigger = test.querySelector(
|
|
91
|
-
"overlay-trigger"
|
|
92
|
-
);
|
|
80
|
+
const test = await styledFixture(longContent());
|
|
93
81
|
const el = test.querySelector("sp-dialog-wrapper");
|
|
94
82
|
el.addEventListener("close", () => closeSpy());
|
|
95
|
-
await
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
);
|
|
83
|
+
await elementUpdated(el);
|
|
84
|
+
const opened = oneEvent(test, "sp-opened");
|
|
85
|
+
test.open = "click";
|
|
86
|
+
await opened;
|
|
100
87
|
expect(el.open).to.be.true;
|
|
101
|
-
const closed = oneEvent(
|
|
102
|
-
|
|
88
|
+
const closed = oneEvent(test, "sp-closed");
|
|
89
|
+
test.open = void 0;
|
|
103
90
|
await closed;
|
|
91
|
+
await nextFrame();
|
|
104
92
|
expect(el.open).to.be.false;
|
|
105
93
|
expect(closeSpy.callCount).to.equal(1);
|
|
106
94
|
});
|
|
@@ -175,6 +163,30 @@ describe("Dialog Wrapper", () => {
|
|
|
175
163
|
await elementUpdated(el);
|
|
176
164
|
expect(el.open).to.be.false;
|
|
177
165
|
});
|
|
166
|
+
it("manages entry focus - dismissable", async () => {
|
|
167
|
+
const el = await styledFixture(wrapperDismissable());
|
|
168
|
+
await elementUpdated(el);
|
|
169
|
+
expect(el.open).to.be.true;
|
|
170
|
+
expect(document.activeElement !== el, "no focused").to.be.true;
|
|
171
|
+
const dialog = el.shadowRoot.querySelector("sp-dialog");
|
|
172
|
+
const dialogRoot = dialog.shadowRoot ? dialog.shadowRoot : dialog;
|
|
173
|
+
const dismissButton = dialogRoot.querySelector(
|
|
174
|
+
".close-button"
|
|
175
|
+
);
|
|
176
|
+
el.focus();
|
|
177
|
+
await elementUpdated(el);
|
|
178
|
+
expect(
|
|
179
|
+
document.activeElement === el,
|
|
180
|
+
`focused generally, ${document.activeElement}`
|
|
181
|
+
).to.be.true;
|
|
182
|
+
expect(
|
|
183
|
+
dismissButton.getRootNode().activeElement !== dismissButton,
|
|
184
|
+
`does not focus specifically, ${dismissButton.getRootNode().activeElement}`
|
|
185
|
+
).to.be.true;
|
|
186
|
+
dismissButton.click();
|
|
187
|
+
await elementUpdated(el);
|
|
188
|
+
expect(el.open).to.be.false;
|
|
189
|
+
});
|
|
178
190
|
it("manages entry focus - buttons", async () => {
|
|
179
191
|
var _a;
|
|
180
192
|
const el = await styledFixture(wrapperButtons());
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["dialog-wrapper.test.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 elementUpdated,\n expect,\n fixture,\n oneEvent,\n waitUntil,\n} from '@open-wc/testing';\nimport { spy, stub } from 'sinon';\n\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport '@spectrum-web-components/dialog/sp-dialog-wrapper.js';\nimport { Dialog, DialogWrapper } from '@spectrum-web-components/dialog';\nimport { Button } from '@spectrum-web-components/button';\nimport { Underlay } from '@spectrum-web-components/underlay';\nimport {\n longContent,\n wrapperButtons,\n wrapperButtonsUnderlay,\n wrapperDismissable,\n wrapperDismissableUnderlayError,\n wrapperFullscreen,\n wrapperHeadlineVisibilityNone,\n wrapperLabeledHero,\n wrapperWithHeadline,\n wrapperWithHeadlineNoDivider,\n} from '../stories/dialog-wrapper.stories.js';\nimport { OverlayTrigger } from '@spectrum-web-components/overlay';\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\nimport { Divider } from '@spectrum-web-components/divider/src/Divider.js';\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme theme=\"classic\" scale=\"medium\" color=\"dark\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('Dialog Wrapper', () => {\n testForLitDevWarnings(\n async () => await styledFixture<DialogWrapper>(wrapperDismissable())\n );\n it('loads wrapped dialog accessibly', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperDismissable());\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('loads labeled hero dialog accessibly', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperLabeledHero());\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('loads fullscreen wrapped dialog accessibly', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperFullscreen());\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n xit('loads with underlay and no headline accessibly', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperButtonsUnderlay());\n await elementUpdated(el);\n el.headline = '';\n await elementUpdated(el);\n await expect(el).to.be.accessible();\n });\n it('opens and closes', async () => {\n const closeSpy = spy();\n const openedSpy = spy();\n const test = await styledFixture<OverlayTrigger>(html`\n <div @sp-opened=${() => openedSpy()}>${longContent()}</div>\n `);\n const overlayTrigger = test.querySelector(\n 'overlay-trigger'\n ) as OverlayTrigger;\n const el = test.querySelector('sp-dialog-wrapper') as DialogWrapper;\n el.addEventListener('close', () => closeSpy());\n await waitUntil(\n () => openedSpy.calledOnce,\n 'click content projected to overlay',\n { timeout: 2000 }\n );\n\n expect(el.open).to.be.true;\n const closed = oneEvent(overlayTrigger, 'sp-closed');\n overlayTrigger.open = undefined;\n await closed;\n\n expect(el.open).to.be.false;\n expect(closeSpy.callCount).to.equal(1);\n });\n it('opens and closes when element is recycled', async () => {\n const closeSpy = spy();\n const openedSpy = spy();\n const test = await styledFixture<OverlayTrigger>(html`\n <div @sp-opened=${() => openedSpy()}>${longContent()}</div>\n `);\n const overlayTrigger = test.querySelector(\n 'overlay-trigger'\n ) as OverlayTrigger;\n const el = test.querySelector('sp-dialog-wrapper') as DialogWrapper;\n el.addEventListener('close', () => closeSpy());\n\n await waitUntil(\n () => openedSpy.calledOnce,\n 'click content projected to overlay',\n { timeout: 2000 }\n );\n\n expect(el.open).to.be.true;\n const closed = oneEvent(overlayTrigger, 'sp-closed');\n overlayTrigger.open = undefined;\n await closed;\n\n expect(el.open).to.be.false;\n expect(closeSpy.callCount).to.equal(1);\n });\n it(\"shows header divider when there's a header\", async () => {\n const wrapper = await styledFixture<DialogWrapper>(\n wrapperWithHeadline()\n );\n await elementUpdated(wrapper);\n\n const dialog = wrapper.shadowRoot.querySelector('sp-dialog') as Dialog;\n const divider = dialog.shadowRoot.querySelector(\n 'sp-divider.divider'\n ) as Divider;\n\n expect(divider).to.be.not.null;\n });\n it('hides header divider when there\\'s a header but \"no-divider\"', async () => {\n const wrapper = await styledFixture<DialogWrapper>(\n wrapperWithHeadlineNoDivider()\n );\n await elementUpdated(wrapper);\n\n await expect(wrapper).to.be.accessible();\n\n const dialog = wrapper.shadowRoot.querySelector('sp-dialog') as Dialog;\n const divider = dialog.shadowRoot.querySelector(\n 'sp-divider.divider'\n ) as Divider;\n\n expect(divider).to.be.null;\n });\n it(\"hides header divider when there's no header\", async () => {\n const wrapper = await styledFixture<DialogWrapper>(\n wrapperHeadlineVisibilityNone()\n );\n await elementUpdated(wrapper);\n\n await expect(wrapper).to.be.accessible();\n\n const dialog = wrapper.shadowRoot.querySelector('sp-dialog') as Dialog;\n const divider = dialog.shadowRoot.querySelector(\n 'sp-divider.divider'\n ) as Divider;\n\n expect(divider).to.be.null;\n });\n it('dismisses via clicking the underlay when [dismissable]', async () => {\n const test = await styledFixture<DialogWrapper>(\n wrapperDismissableUnderlayError()\n );\n const el = test.querySelector('sp-dialog-wrapper') as DialogWrapper;\n await elementUpdated(el);\n expect(el.open).to.be.true;\n el.dismissable = true;\n const underlay = el.shadowRoot.querySelector('sp-underlay') as Underlay;\n underlay.click();\n await elementUpdated(el);\n expect(el.open).to.be.false;\n });\n it('does not dismiss via clicking the underlay :not([dismissable])', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperButtonsUnderlay());\n await elementUpdated(el);\n expect(el.open).to.be.true;\n const underlay = el.shadowRoot.querySelector('sp-underlay') as Underlay;\n underlay.click();\n await elementUpdated(el);\n expect(el.open).to.be.true;\n });\n it('dismisses', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperDismissable());\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n\n const root = el.shadowRoot ? el.shadowRoot : el;\n const dialog = root.querySelector('sp-dialog') as Dialog;\n const dialogRoot = dialog.shadowRoot ? dialog.shadowRoot : dialog;\n const dismissButton = dialogRoot.querySelector(\n '.close-button'\n ) as HTMLButtonElement;\n dismissButton.click();\n\n await elementUpdated(el);\n expect(el.open).to.be.false;\n });\n it('manages entry focus - buttons', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperButtons());\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n expect(document.activeElement !== el, 'no focused').to.be.true;\n\n const button = el.shadowRoot.querySelector('sp-button') as Button;\n\n el.focus();\n await elementUpdated(el);\n expect(\n document.activeElement === el,\n `focused generally, ${document.activeElement}`\n ).to.be.true;\n expect(\n (button.getRootNode() as Document).activeElement === button,\n `focused specifically, ${\n (button.getRootNode() as Document).activeElement?.outerHTML\n }`\n ).to.be.true;\n });\n it('dispatches `confirm`, `cancel` and `secondary`', async () => {\n const confirmSpy = spy();\n const cancelSpy = spy();\n const secondarySpy = spy();\n const handleConfirm = (): void => confirmSpy();\n const handleCancel = (): void => cancelSpy();\n const handleSecondary = (): void => secondarySpy();\n const el = await styledFixture<DialogWrapper>(wrapperButtons());\n el.addEventListener('confirm', handleConfirm);\n el.addEventListener('cancel', handleCancel);\n el.addEventListener('secondary', handleSecondary);\n\n await elementUpdated(el);\n expect(confirmSpy.called).to.be.false;\n expect(cancelSpy.called).to.be.false;\n expect(secondarySpy.called).to.be.false;\n\n const accentButton = el.shadowRoot.querySelector(\n '[variant=\"accent\"]'\n ) as Button;\n const primaryButton = el.shadowRoot.querySelector(\n '[variant=\"primary\"]'\n ) as Button;\n const secondaryButton = el.shadowRoot.querySelector(\n '[variant=\"secondary\"]'\n ) as Button;\n\n accentButton.click();\n\n await elementUpdated(el);\n expect(confirmSpy.called, 'dispatched `confirm`').to.be.true;\n expect(secondarySpy.called).to.be.false;\n expect(cancelSpy.called).to.be.false;\n\n primaryButton.click();\n\n await elementUpdated(el);\n expect(confirmSpy.callCount).to.equal(1);\n expect(secondarySpy.called, 'dispatched `cancel`').to.be.true;\n expect(cancelSpy.called).to.be.false;\n\n secondaryButton.click();\n\n await elementUpdated(el);\n expect(confirmSpy.callCount).to.equal(1);\n expect(secondarySpy.callCount).to.equal(1);\n expect(cancelSpy.called, 'dispatched `secondary`').to.be.true;\n });\n\n it('warns in Dev Mode when accessible attributes are not leveraged', async () => {\n const consoleWarnStub = stub(console, 'warn');\n const el = await fixture<DialogWrapper>(html`\n <sp-dialog-wrapper></sp-dialog-wrapper>\n `);\n\n await elementUpdated(el);\n\n expect(consoleWarnStub.called).to.be.true;\n const spyCall = consoleWarnStub.getCall(0);\n expect(\n spyCall.args.at(0).includes('accessible'),\n 'confirm accessibility-centric message'\n ).to.be.true;\n expect(spyCall.args.at(-1), 'confirm `data` shape').to.deep.equal({\n data: {\n localName: 'sp-dialog-wrapper',\n type: 'accessibility',\n level: 'default',\n },\n });\n consoleWarnStub.restore();\n });\n});\n"],
|
|
5
|
-
"mappings": ";AAYA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,KAAK,YAAY;AAE1B,OAAO;AACP,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 elementUpdated,\n expect,\n fixture,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { spy, stub } from 'sinon';\n\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport '@spectrum-web-components/dialog/sp-dialog-wrapper.js';\nimport { Dialog, DialogWrapper } from '@spectrum-web-components/dialog';\nimport { ActionButton } from '@spectrum-web-components/action-button';\nimport { Button } from '@spectrum-web-components/button';\nimport { Underlay } from '@spectrum-web-components/underlay';\nimport {\n longContent,\n wrapperButtons,\n wrapperButtonsUnderlay,\n wrapperDismissable,\n wrapperDismissableUnderlayError,\n wrapperFullscreen,\n wrapperHeadlineVisibilityNone,\n wrapperLabeledHero,\n wrapperWithHeadline,\n wrapperWithHeadlineNoDivider,\n} from '../stories/dialog-wrapper.stories.js';\nimport { OverlayTrigger } from '@spectrum-web-components/overlay';\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\nimport { Divider } from '@spectrum-web-components/divider/src/Divider.js';\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme theme=\"classic\" scale=\"medium\" color=\"dark\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('Dialog Wrapper', () => {\n testForLitDevWarnings(\n async () => await styledFixture<DialogWrapper>(wrapperDismissable())\n );\n it('loads wrapped dialog accessibly', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperDismissable());\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('loads labeled hero dialog accessibly', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperLabeledHero());\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('loads fullscreen wrapped dialog accessibly', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperFullscreen());\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n xit('loads with underlay and no headline accessibly', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperButtonsUnderlay());\n await elementUpdated(el);\n el.headline = '';\n await elementUpdated(el);\n await expect(el).to.be.accessible();\n });\n it('opens and closes', async () => {\n const closeSpy = spy();\n const test = await styledFixture<OverlayTrigger>(longContent());\n const el = test.querySelector('sp-dialog-wrapper') as DialogWrapper;\n el.addEventListener('close', () => closeSpy());\n\n await elementUpdated(el);\n\n const opened = oneEvent(test, 'sp-opened');\n test.open = 'click';\n await opened;\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(test, 'sp-closed');\n test.open = undefined;\n await closed;\n await nextFrame();\n\n expect(el.open).to.be.false;\n expect(closeSpy.callCount).to.equal(1);\n });\n it('opens and closes when element is recycled', async () => {\n const closeSpy = spy();\n const test = await styledFixture<OverlayTrigger>(longContent());\n const el = test.querySelector('sp-dialog-wrapper') as DialogWrapper;\n el.addEventListener('close', () => closeSpy());\n\n await elementUpdated(el);\n\n const opened = oneEvent(test, 'sp-opened');\n test.open = 'click';\n await opened;\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(test, 'sp-closed');\n test.open = undefined;\n await closed;\n await nextFrame();\n\n expect(el.open).to.be.false;\n expect(closeSpy.callCount).to.equal(1);\n });\n it(\"shows header divider when there's a header\", async () => {\n const wrapper = await styledFixture<DialogWrapper>(\n wrapperWithHeadline()\n );\n await elementUpdated(wrapper);\n\n const dialog = wrapper.shadowRoot.querySelector('sp-dialog') as Dialog;\n const divider = dialog.shadowRoot.querySelector(\n 'sp-divider.divider'\n ) as Divider;\n\n expect(divider).to.be.not.null;\n });\n it('hides header divider when there\\'s a header but \"no-divider\"', async () => {\n const wrapper = await styledFixture<DialogWrapper>(\n wrapperWithHeadlineNoDivider()\n );\n await elementUpdated(wrapper);\n\n await expect(wrapper).to.be.accessible();\n\n const dialog = wrapper.shadowRoot.querySelector('sp-dialog') as Dialog;\n const divider = dialog.shadowRoot.querySelector(\n 'sp-divider.divider'\n ) as Divider;\n\n expect(divider).to.be.null;\n });\n it(\"hides header divider when there's no header\", async () => {\n const wrapper = await styledFixture<DialogWrapper>(\n wrapperHeadlineVisibilityNone()\n );\n await elementUpdated(wrapper);\n\n await expect(wrapper).to.be.accessible();\n\n const dialog = wrapper.shadowRoot.querySelector('sp-dialog') as Dialog;\n const divider = dialog.shadowRoot.querySelector(\n 'sp-divider.divider'\n ) as Divider;\n\n expect(divider).to.be.null;\n });\n it('dismisses via clicking the underlay when [dismissable]', async () => {\n const test = await styledFixture<DialogWrapper>(\n wrapperDismissableUnderlayError()\n );\n const el = test.querySelector('sp-dialog-wrapper') as DialogWrapper;\n await elementUpdated(el);\n expect(el.open).to.be.true;\n el.dismissable = true;\n const underlay = el.shadowRoot.querySelector('sp-underlay') as Underlay;\n underlay.click();\n await elementUpdated(el);\n expect(el.open).to.be.false;\n });\n it('does not dismiss via clicking the underlay :not([dismissable])', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperButtonsUnderlay());\n await elementUpdated(el);\n expect(el.open).to.be.true;\n const underlay = el.shadowRoot.querySelector('sp-underlay') as Underlay;\n underlay.click();\n await elementUpdated(el);\n expect(el.open).to.be.true;\n });\n it('dismisses', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperDismissable());\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n\n const root = el.shadowRoot ? el.shadowRoot : el;\n const dialog = root.querySelector('sp-dialog') as Dialog;\n const dialogRoot = dialog.shadowRoot ? dialog.shadowRoot : dialog;\n const dismissButton = dialogRoot.querySelector(\n '.close-button'\n ) as HTMLButtonElement;\n dismissButton.click();\n\n await elementUpdated(el);\n expect(el.open).to.be.false;\n });\n it('manages entry focus - dismissable', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperDismissable());\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n expect(document.activeElement !== el, 'no focused').to.be.true;\n\n const dialog = el.shadowRoot.querySelector('sp-dialog') as Dialog;\n const dialogRoot = dialog.shadowRoot ? dialog.shadowRoot : dialog;\n const dismissButton = dialogRoot.querySelector(\n '.close-button'\n ) as ActionButton;\n\n el.focus();\n await elementUpdated(el);\n expect(\n document.activeElement === el,\n `focused generally, ${document.activeElement}`\n ).to.be.true;\n expect(\n (dismissButton.getRootNode() as Document).activeElement !==\n dismissButton,\n `does not focus specifically, ${\n (dismissButton.getRootNode() as Document).activeElement\n }`\n ).to.be.true;\n\n dismissButton.click();\n await elementUpdated(el);\n expect(el.open).to.be.false;\n });\n it('manages entry focus - buttons', async () => {\n const el = await styledFixture<DialogWrapper>(wrapperButtons());\n\n await elementUpdated(el);\n expect(el.open).to.be.true;\n expect(document.activeElement !== el, 'no focused').to.be.true;\n\n const button = el.shadowRoot.querySelector('sp-button') as Button;\n\n el.focus();\n await elementUpdated(el);\n expect(\n document.activeElement === el,\n `focused generally, ${document.activeElement}`\n ).to.be.true;\n expect(\n (button.getRootNode() as Document).activeElement === button,\n `focused specifically, ${\n (button.getRootNode() as Document).activeElement?.outerHTML\n }`\n ).to.be.true;\n });\n it('dispatches `confirm`, `cancel` and `secondary`', async () => {\n const confirmSpy = spy();\n const cancelSpy = spy();\n const secondarySpy = spy();\n const handleConfirm = (): void => confirmSpy();\n const handleCancel = (): void => cancelSpy();\n const handleSecondary = (): void => secondarySpy();\n const el = await styledFixture<DialogWrapper>(wrapperButtons());\n el.addEventListener('confirm', handleConfirm);\n el.addEventListener('cancel', handleCancel);\n el.addEventListener('secondary', handleSecondary);\n\n await elementUpdated(el);\n expect(confirmSpy.called).to.be.false;\n expect(cancelSpy.called).to.be.false;\n expect(secondarySpy.called).to.be.false;\n\n const accentButton = el.shadowRoot.querySelector(\n '[variant=\"accent\"]'\n ) as Button;\n const primaryButton = el.shadowRoot.querySelector(\n '[variant=\"primary\"]'\n ) as Button;\n const secondaryButton = el.shadowRoot.querySelector(\n '[variant=\"secondary\"]'\n ) as Button;\n\n accentButton.click();\n\n await elementUpdated(el);\n expect(confirmSpy.called, 'dispatched `confirm`').to.be.true;\n expect(secondarySpy.called).to.be.false;\n expect(cancelSpy.called).to.be.false;\n\n primaryButton.click();\n\n await elementUpdated(el);\n expect(confirmSpy.callCount).to.equal(1);\n expect(secondarySpy.called, 'dispatched `cancel`').to.be.true;\n expect(cancelSpy.called).to.be.false;\n\n secondaryButton.click();\n\n await elementUpdated(el);\n expect(confirmSpy.callCount).to.equal(1);\n expect(secondarySpy.callCount).to.equal(1);\n expect(cancelSpy.called, 'dispatched `secondary`').to.be.true;\n });\n\n it('warns in Dev Mode when accessible attributes are not leveraged', async () => {\n const consoleWarnStub = stub(console, 'warn');\n const el = await fixture<DialogWrapper>(html`\n <sp-dialog-wrapper></sp-dialog-wrapper>\n `);\n\n await elementUpdated(el);\n\n expect(consoleWarnStub.called).to.be.true;\n const spyCall = consoleWarnStub.getCall(0);\n expect(\n spyCall.args.at(0).includes('accessible'),\n 'confirm accessibility-centric message'\n ).to.be.true;\n expect(spyCall.args.at(-1), 'confirm `data` shape').to.deep.equal({\n data: {\n localName: 'sp-dialog-wrapper',\n type: 'accessibility',\n level: 'default',\n },\n });\n consoleWarnStub.restore();\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAYA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,KAAK,YAAY;AAE1B,OAAO;AACP,OAAO;AACP,OAAO;AAKP;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,S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