@govtechsg/sgds-web-component 2.0.0-rc.1 → 2.0.0-rc.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.
Files changed (78) hide show
  1. package/components/Accordion/accordion.cjs.js +1 -1
  2. package/components/Accordion/accordion.js +1 -1
  3. package/components/Accordion/index.umd.js +1 -1
  4. package/components/ActionCard/index.umd.js +1938 -1836
  5. package/components/ActionCard/index.umd.js.map +1 -1
  6. package/components/ActionCard/sgds-action-card.cjs.js +2 -2
  7. package/components/ActionCard/sgds-action-card.cjs.js.map +1 -1
  8. package/components/ActionCard/sgds-action-card.d.ts +1 -1
  9. package/components/ActionCard/sgds-action-card.js +1 -1
  10. package/components/ActionCard/sgds-action-card.js.map +1 -1
  11. package/components/Alert/index.umd.js +200 -98
  12. package/components/Alert/index.umd.js.map +1 -1
  13. package/components/Alert/sgds-alert.cjs.js +2 -2
  14. package/components/Alert/sgds-alert.cjs.js.map +1 -1
  15. package/components/Alert/sgds-alert.d.ts +1 -1
  16. package/components/Alert/sgds-alert.js +1 -1
  17. package/components/Alert/sgds-alert.js.map +1 -1
  18. package/components/ComboBox/index.umd.js +229 -127
  19. package/components/ComboBox/index.umd.js.map +1 -1
  20. package/components/ComboBox/sgds-combo-box.cjs.js +2 -2
  21. package/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
  22. package/components/ComboBox/sgds-combo-box.d.ts +1 -1
  23. package/components/ComboBox/sgds-combo-box.js +1 -1
  24. package/components/ComboBox/sgds-combo-box.js.map +1 -1
  25. package/components/Datepicker/index.umd.js +7836 -7734
  26. package/components/Datepicker/index.umd.js.map +1 -1
  27. package/components/Datepicker/sgds-datepicker.cjs.js +2 -2
  28. package/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
  29. package/components/Datepicker/sgds-datepicker.d.ts +1 -1
  30. package/components/Datepicker/sgds-datepicker.js +1 -1
  31. package/components/Datepicker/sgds-datepicker.js.map +1 -1
  32. package/components/Drawer/index.umd.js +200 -98
  33. package/components/Drawer/index.umd.js.map +1 -1
  34. package/components/Drawer/sgds-drawer.cjs.js +2 -2
  35. package/components/Drawer/sgds-drawer.cjs.js.map +1 -1
  36. package/components/Drawer/sgds-drawer.d.ts +1 -1
  37. package/components/Drawer/sgds-drawer.js +1 -1
  38. package/components/Drawer/sgds-drawer.js.map +1 -1
  39. package/components/Dropdown/index.umd.js +229 -127
  40. package/components/Dropdown/index.umd.js.map +1 -1
  41. package/components/Dropdown/sgds-dropdown.cjs.js +2 -2
  42. package/components/Dropdown/sgds-dropdown.cjs.js.map +1 -1
  43. package/components/Dropdown/sgds-dropdown.d.ts +1 -1
  44. package/components/Dropdown/sgds-dropdown.js +1 -1
  45. package/components/Dropdown/sgds-dropdown.js.map +1 -1
  46. package/components/FileUpload/index.umd.js +229 -127
  47. package/components/FileUpload/index.umd.js.map +1 -1
  48. package/components/FileUpload/sgds-file-upload.cjs.js +2 -2
  49. package/components/FileUpload/sgds-file-upload.cjs.js.map +1 -1
  50. package/components/FileUpload/sgds-file-upload.d.ts +1 -1
  51. package/components/FileUpload/sgds-file-upload.js +1 -1
  52. package/components/FileUpload/sgds-file-upload.js.map +1 -1
  53. package/components/Modal/index.umd.js +200 -98
  54. package/components/Modal/index.umd.js.map +1 -1
  55. package/components/Modal/sgds-modal.cjs.js +2 -2
  56. package/components/Modal/sgds-modal.cjs.js.map +1 -1
  57. package/components/Modal/sgds-modal.d.ts +1 -1
  58. package/components/Modal/sgds-modal.js +1 -1
  59. package/components/Modal/sgds-modal.js.map +1 -1
  60. package/components/QuantityToggle/index.umd.js +200 -98
  61. package/components/QuantityToggle/index.umd.js.map +1 -1
  62. package/components/QuantityToggle/sgds-quantity-toggle.cjs.js +2 -2
  63. package/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
  64. package/components/QuantityToggle/sgds-quantity-toggle.d.ts +1 -1
  65. package/components/QuantityToggle/sgds-quantity-toggle.js +1 -1
  66. package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
  67. package/components/Toast/index.umd.js +1938 -1836
  68. package/components/Toast/index.umd.js.map +1 -1
  69. package/components/Toast/sgds-toast.cjs.js +2 -2
  70. package/components/Toast/sgds-toast.cjs.js.map +1 -1
  71. package/components/Toast/sgds-toast.d.ts +1 -1
  72. package/components/Toast/sgds-toast.js +1 -1
  73. package/components/Toast/sgds-toast.js.map +1 -1
  74. package/components/index.umd.js +201 -99
  75. package/components/index.umd.js.map +1 -1
  76. package/index.umd.js +201 -99
  77. package/index.umd.js.map +1 -1
  78. package/package.json +2 -2
@@ -17,7 +17,7 @@ var scroll = require('../../utils/scroll.cjs.js');
17
17
  var slot = require('../../utils/slot.cjs.js');
18
18
  var watch = require('../../utils/watch.cjs.js');
19
19
  var modal$1 = require('./modal.cjs.js');
20
- var litElement_js = require('@open-wc/scoped-elements/lit-element.js');
20
+ var scopedElements = require('@open-wc/scoped-elements');
21
21
  var sgdsCloseButton = require('../../internals/CloseButton/sgds-close-button.cjs.js');
22
22
  var headerClass = require('../../styles/header-class.cjs.js');
23
23
  var svg = require('../../styles/svg.cjs.js');
@@ -51,7 +51,7 @@ var svg = require('../../styles/svg.cjs.js');
51
51
  * @cssproperty --modal-header-border-bottom - The bottom border of header
52
52
  * @cssproperty --modal-overlay-bg - The overlay's background color
53
53
  */
54
- class SgdsModal extends litElement_js.ScopedElementsMixin(sgdsElement["default"]) {
54
+ class SgdsModal extends scopedElements.ScopedElementsMixin(sgdsElement["default"]) {
55
55
  constructor() {
56
56
  super(...arguments);
57
57
  /**@internal */
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-modal.cjs.js","sources":["../../../src/components/Modal/sgds-modal.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { unsafeSVG } from \"lit/directives/unsafe-svg.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { animateTo, stopAnimations } from \"../../utils/animate\";\nimport { getAnimation, setDefaultAnimation } from \"../../utils/animation-registry\";\nimport { waitForEvent } from \"../../utils/event\";\nimport Modal from \"../../utils/modal\";\nimport { lockBodyScrolling, unlockBodyScrolling } from \"../../utils/scroll\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport { watch } from \"../../utils/watch\";\nimport modalStyle from \"./modal.css\";\nimport { ScopedElementsMixin } from \"@open-wc/scoped-elements/lit-element.js\";\nimport SgdsCloseButton from \"../../internals/CloseButton/sgds-close-button\";\nimport headerStyles from \"../../styles/header-class.css\";\nimport svgStyles from \"../../styles/svg.css\";\n/**\n * @summary The modal component inform users about a specific task and may contain critical information which users then have to make a decision.\n *\n * @slot default - The content of the Modal's body.\n * @slot footer - The content of the Modal's footer, typically used to pass in buttons for call to action.\n *\n * @event sgds-close - Emitted when the modal is called to close via mouseclick of close button, overlay or via keyboard esc key\n * @event sgds-show - Emitted when the modal opens\n * @event sgds-hide - Emitted when the modal closes\n * @event sgds-after-show - Emitted after modal opens and the animations has completed\n * @event sgds-after-hide - Emitted after modal closes and the animations has completed\n *\n * @csspart base - The component's base wrapper\n * @csspart overlay - The overlay that covers the screen behind the dialog\n * @csspart panel - The modal's dialog panel\n * @csspart header - The modal's header that wraps the title, titleIcon and close button\n * @csspart title - The h3 element wrapping title and titleIcon\n * @csspart body - The modal's body where the content lies\n * @csspart footers - The modal's footer\n *\n * @cssproperty --modal-panel-padding - The general modal padding of modal component. Applied to body, footer and header.\n * @cssproperty --modal-panel-z-index - The z-index of modal panel\n * @cssproperty --modal-panel-width - The width of modal panel.\n * @cssproperty --modal-panel-height - The height of modal panel.\n * @cssproperty --modal-panel-bg - The background color of modal panel\n * @cssproperty --modal-panel-border-radius - The border radius of modal panel\n * @cssproperty --modal-header-border-bottom - The bottom border of header\n * @cssproperty --modal-overlay-bg - The overlay's background color\n */\nexport class SgdsModal extends ScopedElementsMixin(SgdsElement) {\n static styles = [...SgdsElement.styles, headerStyles, svgStyles, modalStyle];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-close-button\": SgdsCloseButton\n };\n }\n /**@internal */\n @query(\".modal\") dialog: HTMLElement;\n /**@internal */\n @query(\".modal-panel\") panel: HTMLElement;\n /**@internal */\n @query(\".modal-overlay\") overlay: HTMLElement;\n /**@internal */\n @query(\".modal-title\") heading: HTMLElement;\n /**@internal */\n private readonly hasSlotController = new HasSlotController(this, \"footer\");\n /**@internal */\n private modal: Modal;\n /**@internal */\n private originalTrigger: HTMLElement | null;\n\n /**Indicates whether or not the modal is open. You can use this in lieu of the show/hide methods. */\n @property({ type: Boolean, reflect: true }) open = false;\n /**The modal's title as displayed in the header */\n @property({ reflect: true }) title = \"\";\n /**The modal's icon as displayed in the header. Pass in SVG format icons as string directly */\n @property({ reflect: true }) titleIcon = \"\";\n /** Disables the header. This will also remove the default close button */\n @property({ type: Boolean, reflect: true }) noHeader = false;\n /** Centers the modal vertically in page */\n @property({ type: Boolean, reflect: true }) centered = false;\n /** Centers the contents inside the modal */\n @property({ type: Boolean, reflect: true }) centeredAlignVariant = false;\n /** Removes the default animation when opening and closing of modal */\n @property({ type: Boolean, reflect: true }) noAnimation = false;\n /** Removes the close button from modal header */\n @property({ type: Boolean, reflect: true }) noCloseButton = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);\n this.modal = new Modal(this);\n }\n\n firstUpdated() {\n this.dialog.hidden = !this.open;\n\n if (this.open) {\n this.addOpenListeners();\n this.modal.activate();\n lockBodyScrolling(this);\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n unlockBodyScrolling(this);\n }\n\n /** Shows the dialog. */\n public async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, \"sgds-after-show\");\n }\n\n /** Hides the dialog */\n public async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, \"sgds-after-hide\");\n }\n\n private requestClose(source: \"close-button\" | \"keyboard\" | \"overlay\") {\n const sgdsRequestClose = this.emit(\"sgds-close\", {\n cancelable: true,\n detail: { source }\n });\n\n if (sgdsRequestClose.defaultPrevented) {\n const animation = getAnimation(this, \"modal.denyClose\");\n animateTo(this.panel, animation.keyframes);\n return;\n }\n\n this.hide();\n }\n\n addOpenListeners() {\n document.addEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n removeOpenListeners() {\n document.removeEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n handleDocumentKeyDown(event: KeyboardEvent) {\n if (this.open && event.key === \"Escape\") {\n event.stopPropagation();\n this.requestClose(\"keyboard\");\n }\n }\n\n @watch(\"open\", { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n // Show\n this.emit(\"sgds-show\");\n this.addOpenListeners();\n this.originalTrigger = document.activeElement as HTMLElement;\n this.modal.activate();\n\n lockBodyScrolling(this);\n\n await Promise.all([stopAnimations(this.dialog), stopAnimations(this.overlay)]);\n this.dialog.hidden = false;\n\n const panelAnimation = getAnimation(this, \"modal.show\");\n const overlayAnimation = getAnimation(this, \"modal.overlay.show\");\n !this.noAnimation &&\n (await Promise.all([\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)\n ]));\n\n this.emit(\"sgds-after-show\");\n\n // Add focus on modal heading after opening it\n this.heading.focus();\n } else {\n // Hide\n this.emit(\"sgds-hide\");\n this.removeOpenListeners();\n this.modal.deactivate();\n\n await Promise.all([stopAnimations(this.dialog), stopAnimations(this.overlay)]);\n const panelAnimation = getAnimation(this, \"modal.hide\");\n const overlayAnimation = getAnimation(this, \"modal.overlay.hide\");\n\n // Animate the overlay and the panel at the same time. Because animation durations might be different, we need to\n // hide each one individually when the animation finishes, otherwise the first one that finishes will reappear\n // unexpectedly. We'll unhide them after all animations have completed.\n !this.noAnimation &&\n (await Promise.all([\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options).then(() => {\n this.overlay.hidden = true;\n }),\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options).then(() => {\n this.panel.hidden = true;\n })\n ]));\n\n this.dialog.hidden = true;\n\n // Now that the dialog is hidden, restore the overlay and panel for next time\n this.overlay.hidden = false;\n this.panel.hidden = false;\n\n unlockBodyScrolling(this);\n\n // Restore focus to the original trigger\n const trigger = this.originalTrigger;\n if (typeof trigger?.focus === \"function\") {\n setTimeout(() => trigger.focus());\n }\n\n this.emit(\"sgds-after-hide\");\n }\n }\n\n render() {\n const withLabelIcon = html`${unsafeSVG(this.titleIcon)}`;\n return html`\n <div\n part=\"base\"\n class=${classMap({\n modal: true,\n \"modal--open\": this.open,\n \"modal--has-footer\": this.hasSlotController.test(\"footer\"),\n centered: this.centered\n })}\n >\n <div part=\"overlay\" class=\"modal-overlay\" @click=${() => this.requestClose(\"overlay\")}></div>\n\n <div\n part=\"panel\"\n class=\"modal-panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden=${this.open ? \"false\" : \"true\"}\n aria-label=${ifDefined(this.noHeader ? this.title : undefined)}\n aria-labelledby=${ifDefined(!this.noHeader ? \"title\" : undefined)}\n tabindex=\"-1\"\n >\n ${!this.noHeader\n ? html`\n <div\n part=\"header\"\n class=${classMap({\n \"modal-header\": true,\n centered: this.centeredAlignVariant\n })}\n >\n <h3\n part=\"title\"\n class=${classMap({\n \"modal-title\": true,\n centered: this.centeredAlignVariant\n })}\n id=\"title\"\n tabindex=\"-1\"\n >\n ${this.titleIcon ? withLabelIcon : \"\"} ${this.title}\n </h3>\n ${this.noCloseButton\n ? nothing\n : html`<sgds-close-button\n class=${classMap({\n \"modal-close\": true,\n centered: this.centeredAlignVariant\n })}\n @click=\"${() => this.requestClose(\"close-button\")}\"\n ariaLabel=\"close modal\"\n ></sgds-close-button>`}\n </div>\n `\n : \"\"}\n\n <div\n part=\"body\"\n class=${classMap({\n \"modal-body\": true,\n centered: this.centeredAlignVariant\n })}\n >\n <slot></slot>\n </div>\n\n <footer\n part=\"footer\"\n class=${classMap({\n \"modal-footer\": true,\n centered: this.centeredAlignVariant\n })}\n >\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n </div>\n `;\n }\n}\n\nsetDefaultAnimation(\"modal.show\", {\n keyframes: [\n { opacity: 0, transform: \"scale(1) translate(0, -100%)\" },\n { opacity: 1, transform: \"scale(1) translate(0, 0%)\" }\n ],\n options: { duration: 400, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"modal.hide\", {\n keyframes: [\n { opacity: 1, transform: \"scale(1) translate(0, 0)\" },\n { opacity: 0, transform: \"scale(1) translate(0, -100%)\" }\n ],\n options: { duration: 400, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"modal.denyClose\", {\n keyframes: [{ transform: \"scale(1)\" }, { transform: \"scale(1.02)\" }, { transform: \"scale(1)\" }],\n options: { duration: 400 }\n});\n\nsetDefaultAnimation(\"modal.overlay.show\", {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n options: { duration: 400 }\n});\n\nsetDefaultAnimation(\"modal.overlay.hide\", {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n options: { duration: 400 }\n});\n\nexport default SgdsModal;\n"],"names":["ScopedElementsMixin","SgdsElement","HasSlotController","SgdsCloseButton","Modal","lockBodyScrolling","unlockBodyScrolling","waitForEvent","getAnimation","animateTo","stopAnimations","html","unsafeSVG","classMap","ifDefined","nothing","headerStyles","svgStyles","modalStyle","__decorate","query","property","watch","setDefaultAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;MACU,SAAU,SAAQA,iCAAmB,CAACC,sBAAW,CAAC,CAAA;AAA/D,IAAA,WAAA,GAAA;;;QAiBmB,IAAiB,CAAA,iBAAA,GAAG,IAAIC,sBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;;QAO/B,IAAI,CAAA,IAAA,GAAG,KAAK,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A,CAAC,CAAC;AAEHA,qCAAmB,CAAC,oBAAoB,EAAE;AACxC,IAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC3C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC,CAAC;AAEHA,qCAAmB,CAAC,oBAAoB,EAAE;AACxC,IAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC3C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC;;;;;"}
1
+ {"version":3,"file":"sgds-modal.cjs.js","sources":["../../../src/components/Modal/sgds-modal.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { unsafeSVG } from \"lit/directives/unsafe-svg.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { animateTo, stopAnimations } from \"../../utils/animate\";\nimport { getAnimation, setDefaultAnimation } from \"../../utils/animation-registry\";\nimport { waitForEvent } from \"../../utils/event\";\nimport Modal from \"../../utils/modal\";\nimport { lockBodyScrolling, unlockBodyScrolling } from \"../../utils/scroll\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport { watch } from \"../../utils/watch\";\nimport modalStyle from \"./modal.css\";\nimport { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport SgdsCloseButton from \"../../internals/CloseButton/sgds-close-button\";\nimport headerStyles from \"../../styles/header-class.css\";\nimport svgStyles from \"../../styles/svg.css\";\n/**\n * @summary The modal component inform users about a specific task and may contain critical information which users then have to make a decision.\n *\n * @slot default - The content of the Modal's body.\n * @slot footer - The content of the Modal's footer, typically used to pass in buttons for call to action.\n *\n * @event sgds-close - Emitted when the modal is called to close via mouseclick of close button, overlay or via keyboard esc key\n * @event sgds-show - Emitted when the modal opens\n * @event sgds-hide - Emitted when the modal closes\n * @event sgds-after-show - Emitted after modal opens and the animations has completed\n * @event sgds-after-hide - Emitted after modal closes and the animations has completed\n *\n * @csspart base - The component's base wrapper\n * @csspart overlay - The overlay that covers the screen behind the dialog\n * @csspart panel - The modal's dialog panel\n * @csspart header - The modal's header that wraps the title, titleIcon and close button\n * @csspart title - The h3 element wrapping title and titleIcon\n * @csspart body - The modal's body where the content lies\n * @csspart footers - The modal's footer\n *\n * @cssproperty --modal-panel-padding - The general modal padding of modal component. Applied to body, footer and header.\n * @cssproperty --modal-panel-z-index - The z-index of modal panel\n * @cssproperty --modal-panel-width - The width of modal panel.\n * @cssproperty --modal-panel-height - The height of modal panel.\n * @cssproperty --modal-panel-bg - The background color of modal panel\n * @cssproperty --modal-panel-border-radius - The border radius of modal panel\n * @cssproperty --modal-header-border-bottom - The bottom border of header\n * @cssproperty --modal-overlay-bg - The overlay's background color\n */\nexport class SgdsModal extends ScopedElementsMixin(SgdsElement) {\n static styles = [...SgdsElement.styles, headerStyles, svgStyles, modalStyle];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-close-button\": SgdsCloseButton\n };\n }\n /**@internal */\n @query(\".modal\") dialog: HTMLElement;\n /**@internal */\n @query(\".modal-panel\") panel: HTMLElement;\n /**@internal */\n @query(\".modal-overlay\") overlay: HTMLElement;\n /**@internal */\n @query(\".modal-title\") heading: HTMLElement;\n /**@internal */\n private readonly hasSlotController = new HasSlotController(this, \"footer\");\n /**@internal */\n private modal: Modal;\n /**@internal */\n private originalTrigger: HTMLElement | null;\n\n /**Indicates whether or not the modal is open. You can use this in lieu of the show/hide methods. */\n @property({ type: Boolean, reflect: true }) open = false;\n /**The modal's title as displayed in the header */\n @property({ reflect: true }) title = \"\";\n /**The modal's icon as displayed in the header. Pass in SVG format icons as string directly */\n @property({ reflect: true }) titleIcon = \"\";\n /** Disables the header. This will also remove the default close button */\n @property({ type: Boolean, reflect: true }) noHeader = false;\n /** Centers the modal vertically in page */\n @property({ type: Boolean, reflect: true }) centered = false;\n /** Centers the contents inside the modal */\n @property({ type: Boolean, reflect: true }) centeredAlignVariant = false;\n /** Removes the default animation when opening and closing of modal */\n @property({ type: Boolean, reflect: true }) noAnimation = false;\n /** Removes the close button from modal header */\n @property({ type: Boolean, reflect: true }) noCloseButton = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);\n this.modal = new Modal(this);\n }\n\n firstUpdated() {\n this.dialog.hidden = !this.open;\n\n if (this.open) {\n this.addOpenListeners();\n this.modal.activate();\n lockBodyScrolling(this);\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n unlockBodyScrolling(this);\n }\n\n /** Shows the dialog. */\n public async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, \"sgds-after-show\");\n }\n\n /** Hides the dialog */\n public async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, \"sgds-after-hide\");\n }\n\n private requestClose(source: \"close-button\" | \"keyboard\" | \"overlay\") {\n const sgdsRequestClose = this.emit(\"sgds-close\", {\n cancelable: true,\n detail: { source }\n });\n\n if (sgdsRequestClose.defaultPrevented) {\n const animation = getAnimation(this, \"modal.denyClose\");\n animateTo(this.panel, animation.keyframes);\n return;\n }\n\n this.hide();\n }\n\n addOpenListeners() {\n document.addEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n removeOpenListeners() {\n document.removeEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n handleDocumentKeyDown(event: KeyboardEvent) {\n if (this.open && event.key === \"Escape\") {\n event.stopPropagation();\n this.requestClose(\"keyboard\");\n }\n }\n\n @watch(\"open\", { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n // Show\n this.emit(\"sgds-show\");\n this.addOpenListeners();\n this.originalTrigger = document.activeElement as HTMLElement;\n this.modal.activate();\n\n lockBodyScrolling(this);\n\n await Promise.all([stopAnimations(this.dialog), stopAnimations(this.overlay)]);\n this.dialog.hidden = false;\n\n const panelAnimation = getAnimation(this, \"modal.show\");\n const overlayAnimation = getAnimation(this, \"modal.overlay.show\");\n !this.noAnimation &&\n (await Promise.all([\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)\n ]));\n\n this.emit(\"sgds-after-show\");\n\n // Add focus on modal heading after opening it\n this.heading.focus();\n } else {\n // Hide\n this.emit(\"sgds-hide\");\n this.removeOpenListeners();\n this.modal.deactivate();\n\n await Promise.all([stopAnimations(this.dialog), stopAnimations(this.overlay)]);\n const panelAnimation = getAnimation(this, \"modal.hide\");\n const overlayAnimation = getAnimation(this, \"modal.overlay.hide\");\n\n // Animate the overlay and the panel at the same time. Because animation durations might be different, we need to\n // hide each one individually when the animation finishes, otherwise the first one that finishes will reappear\n // unexpectedly. We'll unhide them after all animations have completed.\n !this.noAnimation &&\n (await Promise.all([\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options).then(() => {\n this.overlay.hidden = true;\n }),\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options).then(() => {\n this.panel.hidden = true;\n })\n ]));\n\n this.dialog.hidden = true;\n\n // Now that the dialog is hidden, restore the overlay and panel for next time\n this.overlay.hidden = false;\n this.panel.hidden = false;\n\n unlockBodyScrolling(this);\n\n // Restore focus to the original trigger\n const trigger = this.originalTrigger;\n if (typeof trigger?.focus === \"function\") {\n setTimeout(() => trigger.focus());\n }\n\n this.emit(\"sgds-after-hide\");\n }\n }\n\n render() {\n const withLabelIcon = html`${unsafeSVG(this.titleIcon)}`;\n return html`\n <div\n part=\"base\"\n class=${classMap({\n modal: true,\n \"modal--open\": this.open,\n \"modal--has-footer\": this.hasSlotController.test(\"footer\"),\n centered: this.centered\n })}\n >\n <div part=\"overlay\" class=\"modal-overlay\" @click=${() => this.requestClose(\"overlay\")}></div>\n\n <div\n part=\"panel\"\n class=\"modal-panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden=${this.open ? \"false\" : \"true\"}\n aria-label=${ifDefined(this.noHeader ? this.title : undefined)}\n aria-labelledby=${ifDefined(!this.noHeader ? \"title\" : undefined)}\n tabindex=\"-1\"\n >\n ${!this.noHeader\n ? html`\n <div\n part=\"header\"\n class=${classMap({\n \"modal-header\": true,\n centered: this.centeredAlignVariant\n })}\n >\n <h3\n part=\"title\"\n class=${classMap({\n \"modal-title\": true,\n centered: this.centeredAlignVariant\n })}\n id=\"title\"\n tabindex=\"-1\"\n >\n ${this.titleIcon ? withLabelIcon : \"\"} ${this.title}\n </h3>\n ${this.noCloseButton\n ? nothing\n : html`<sgds-close-button\n class=${classMap({\n \"modal-close\": true,\n centered: this.centeredAlignVariant\n })}\n @click=\"${() => this.requestClose(\"close-button\")}\"\n ariaLabel=\"close modal\"\n ></sgds-close-button>`}\n </div>\n `\n : \"\"}\n\n <div\n part=\"body\"\n class=${classMap({\n \"modal-body\": true,\n centered: this.centeredAlignVariant\n })}\n >\n <slot></slot>\n </div>\n\n <footer\n part=\"footer\"\n class=${classMap({\n \"modal-footer\": true,\n centered: this.centeredAlignVariant\n })}\n >\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n </div>\n `;\n }\n}\n\nsetDefaultAnimation(\"modal.show\", {\n keyframes: [\n { opacity: 0, transform: \"scale(1) translate(0, -100%)\" },\n { opacity: 1, transform: \"scale(1) translate(0, 0%)\" }\n ],\n options: { duration: 400, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"modal.hide\", {\n keyframes: [\n { opacity: 1, transform: \"scale(1) translate(0, 0)\" },\n { opacity: 0, transform: \"scale(1) translate(0, -100%)\" }\n ],\n options: { duration: 400, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"modal.denyClose\", {\n keyframes: [{ transform: \"scale(1)\" }, { transform: \"scale(1.02)\" }, { transform: \"scale(1)\" }],\n options: { duration: 400 }\n});\n\nsetDefaultAnimation(\"modal.overlay.show\", {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n options: { duration: 400 }\n});\n\nsetDefaultAnimation(\"modal.overlay.hide\", {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n options: { duration: 400 }\n});\n\nexport default SgdsModal;\n"],"names":["ScopedElementsMixin","SgdsElement","HasSlotController","SgdsCloseButton","Modal","lockBodyScrolling","unlockBodyScrolling","waitForEvent","getAnimation","animateTo","stopAnimations","html","unsafeSVG","classMap","ifDefined","nothing","headerStyles","svgStyles","modalStyle","__decorate","query","property","watch","setDefaultAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;MACU,SAAU,SAAQA,kCAAmB,CAACC,sBAAW,CAAC,CAAA;AAA/D,IAAA,WAAA,GAAA;;;QAiBmB,IAAiB,CAAA,iBAAA,GAAG,IAAIC,sBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;;QAO/B,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;;QAE5B,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;;QAEX,IAAS,CAAA,SAAA,GAAG,EAAE,CAAC;;QAEA,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAEjB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAEjB,IAAoB,CAAA,oBAAA,GAAG,KAAK,CAAC;;QAE7B,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;;QAEpB,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC;KA6NnE;;AAhQC,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,mBAAmB,EAAEC,+BAAe;SACrC,CAAC;KACH;IAiCD,iBAAiB,GAAA;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,qBA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/CloseButton/sgds-close-button";
3
- declare const SgdsModal_base: typeof SgdsElement & import("@open-wc/scoped-elements/lit-element.js").ScopedElementsHostConstructor;
3
+ declare const SgdsModal_base: typeof SgdsElement & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
4
4
  /**
5
5
  * @summary The modal component inform users about a specific task and may contain critical information which users then have to make a decision.
6
6
  *
@@ -13,7 +13,7 @@ import { lockBodyScrolling, unlockBodyScrolling } from '../../utils/scroll.js';
13
13
  import { HasSlotController } from '../../utils/slot.js';
14
14
  import { watch } from '../../utils/watch.js';
15
15
  import css_248z$2 from './modal.js';
16
- import { ScopedElementsMixin } from '@open-wc/scoped-elements/lit-element.js';
16
+ import { ScopedElementsMixin } from '@open-wc/scoped-elements';
17
17
  import { SgdsCloseButton } from '../../internals/CloseButton/sgds-close-button.js';
18
18
  import css_248z from '../../styles/header-class.js';
19
19
  import css_248z$1 from '../../styles/svg.js';
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-modal.js","sources":["../../../src/components/Modal/sgds-modal.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { unsafeSVG } from \"lit/directives/unsafe-svg.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { animateTo, stopAnimations } from \"../../utils/animate\";\nimport { getAnimation, setDefaultAnimation } from \"../../utils/animation-registry\";\nimport { waitForEvent } from \"../../utils/event\";\nimport Modal from \"../../utils/modal\";\nimport { lockBodyScrolling, unlockBodyScrolling } from \"../../utils/scroll\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport { watch } from \"../../utils/watch\";\nimport modalStyle from \"./modal.css\";\nimport { ScopedElementsMixin } from \"@open-wc/scoped-elements/lit-element.js\";\nimport SgdsCloseButton from \"../../internals/CloseButton/sgds-close-button\";\nimport headerStyles from \"../../styles/header-class.css\";\nimport svgStyles from \"../../styles/svg.css\";\n/**\n * @summary The modal component inform users about a specific task and may contain critical information which users then have to make a decision.\n *\n * @slot default - The content of the Modal's body.\n * @slot footer - The content of the Modal's footer, typically used to pass in buttons for call to action.\n *\n * @event sgds-close - Emitted when the modal is called to close via mouseclick of close button, overlay or via keyboard esc key\n * @event sgds-show - Emitted when the modal opens\n * @event sgds-hide - Emitted when the modal closes\n * @event sgds-after-show - Emitted after modal opens and the animations has completed\n * @event sgds-after-hide - Emitted after modal closes and the animations has completed\n *\n * @csspart base - The component's base wrapper\n * @csspart overlay - The overlay that covers the screen behind the dialog\n * @csspart panel - The modal's dialog panel\n * @csspart header - The modal's header that wraps the title, titleIcon and close button\n * @csspart title - The h3 element wrapping title and titleIcon\n * @csspart body - The modal's body where the content lies\n * @csspart footers - The modal's footer\n *\n * @cssproperty --modal-panel-padding - The general modal padding of modal component. Applied to body, footer and header.\n * @cssproperty --modal-panel-z-index - The z-index of modal panel\n * @cssproperty --modal-panel-width - The width of modal panel.\n * @cssproperty --modal-panel-height - The height of modal panel.\n * @cssproperty --modal-panel-bg - The background color of modal panel\n * @cssproperty --modal-panel-border-radius - The border radius of modal panel\n * @cssproperty --modal-header-border-bottom - The bottom border of header\n * @cssproperty --modal-overlay-bg - The overlay's background color\n */\nexport class SgdsModal extends ScopedElementsMixin(SgdsElement) {\n static styles = [...SgdsElement.styles, headerStyles, svgStyles, modalStyle];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-close-button\": SgdsCloseButton\n };\n }\n /**@internal */\n @query(\".modal\") dialog: HTMLElement;\n /**@internal */\n @query(\".modal-panel\") panel: HTMLElement;\n /**@internal */\n @query(\".modal-overlay\") overlay: HTMLElement;\n /**@internal */\n @query(\".modal-title\") heading: HTMLElement;\n /**@internal */\n private readonly hasSlotController = new HasSlotController(this, \"footer\");\n /**@internal */\n private modal: Modal;\n /**@internal */\n private originalTrigger: HTMLElement | null;\n\n /**Indicates whether or not the modal is open. You can use this in lieu of the show/hide methods. */\n @property({ type: Boolean, reflect: true }) open = false;\n /**The modal's title as displayed in the header */\n @property({ reflect: true }) title = \"\";\n /**The modal's icon as displayed in the header. Pass in SVG format icons as string directly */\n @property({ reflect: true }) titleIcon = \"\";\n /** Disables the header. This will also remove the default close button */\n @property({ type: Boolean, reflect: true }) noHeader = false;\n /** Centers the modal vertically in page */\n @property({ type: Boolean, reflect: true }) centered = false;\n /** Centers the contents inside the modal */\n @property({ type: Boolean, reflect: true }) centeredAlignVariant = false;\n /** Removes the default animation when opening and closing of modal */\n @property({ type: Boolean, reflect: true }) noAnimation = false;\n /** Removes the close button from modal header */\n @property({ type: Boolean, reflect: true }) noCloseButton = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);\n this.modal = new Modal(this);\n }\n\n firstUpdated() {\n this.dialog.hidden = !this.open;\n\n if (this.open) {\n this.addOpenListeners();\n this.modal.activate();\n lockBodyScrolling(this);\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n unlockBodyScrolling(this);\n }\n\n /** Shows the dialog. */\n public async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, \"sgds-after-show\");\n }\n\n /** Hides the dialog */\n public async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, \"sgds-after-hide\");\n }\n\n private requestClose(source: \"close-button\" | \"keyboard\" | \"overlay\") {\n const sgdsRequestClose = this.emit(\"sgds-close\", {\n cancelable: true,\n detail: { source }\n });\n\n if (sgdsRequestClose.defaultPrevented) {\n const animation = getAnimation(this, \"modal.denyClose\");\n animateTo(this.panel, animation.keyframes);\n return;\n }\n\n this.hide();\n }\n\n addOpenListeners() {\n document.addEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n removeOpenListeners() {\n document.removeEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n handleDocumentKeyDown(event: KeyboardEvent) {\n if (this.open && event.key === \"Escape\") {\n event.stopPropagation();\n this.requestClose(\"keyboard\");\n }\n }\n\n @watch(\"open\", { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n // Show\n this.emit(\"sgds-show\");\n this.addOpenListeners();\n this.originalTrigger = document.activeElement as HTMLElement;\n this.modal.activate();\n\n lockBodyScrolling(this);\n\n await Promise.all([stopAnimations(this.dialog), stopAnimations(this.overlay)]);\n this.dialog.hidden = false;\n\n const panelAnimation = getAnimation(this, \"modal.show\");\n const overlayAnimation = getAnimation(this, \"modal.overlay.show\");\n !this.noAnimation &&\n (await Promise.all([\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)\n ]));\n\n this.emit(\"sgds-after-show\");\n\n // Add focus on modal heading after opening it\n this.heading.focus();\n } else {\n // Hide\n this.emit(\"sgds-hide\");\n this.removeOpenListeners();\n this.modal.deactivate();\n\n await Promise.all([stopAnimations(this.dialog), stopAnimations(this.overlay)]);\n const panelAnimation = getAnimation(this, \"modal.hide\");\n const overlayAnimation = getAnimation(this, \"modal.overlay.hide\");\n\n // Animate the overlay and the panel at the same time. Because animation durations might be different, we need to\n // hide each one individually when the animation finishes, otherwise the first one that finishes will reappear\n // unexpectedly. We'll unhide them after all animations have completed.\n !this.noAnimation &&\n (await Promise.all([\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options).then(() => {\n this.overlay.hidden = true;\n }),\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options).then(() => {\n this.panel.hidden = true;\n })\n ]));\n\n this.dialog.hidden = true;\n\n // Now that the dialog is hidden, restore the overlay and panel for next time\n this.overlay.hidden = false;\n this.panel.hidden = false;\n\n unlockBodyScrolling(this);\n\n // Restore focus to the original trigger\n const trigger = this.originalTrigger;\n if (typeof trigger?.focus === \"function\") {\n setTimeout(() => trigger.focus());\n }\n\n this.emit(\"sgds-after-hide\");\n }\n }\n\n render() {\n const withLabelIcon = html`${unsafeSVG(this.titleIcon)}`;\n return html`\n <div\n part=\"base\"\n class=${classMap({\n modal: true,\n \"modal--open\": this.open,\n \"modal--has-footer\": this.hasSlotController.test(\"footer\"),\n centered: this.centered\n })}\n >\n <div part=\"overlay\" class=\"modal-overlay\" @click=${() => this.requestClose(\"overlay\")}></div>\n\n <div\n part=\"panel\"\n class=\"modal-panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden=${this.open ? \"false\" : \"true\"}\n aria-label=${ifDefined(this.noHeader ? this.title : undefined)}\n aria-labelledby=${ifDefined(!this.noHeader ? \"title\" : undefined)}\n tabindex=\"-1\"\n >\n ${!this.noHeader\n ? html`\n <div\n part=\"header\"\n class=${classMap({\n \"modal-header\": true,\n centered: this.centeredAlignVariant\n })}\n >\n <h3\n part=\"title\"\n class=${classMap({\n \"modal-title\": true,\n centered: this.centeredAlignVariant\n })}\n id=\"title\"\n tabindex=\"-1\"\n >\n ${this.titleIcon ? withLabelIcon : \"\"} ${this.title}\n </h3>\n ${this.noCloseButton\n ? nothing\n : html`<sgds-close-button\n class=${classMap({\n \"modal-close\": true,\n centered: this.centeredAlignVariant\n })}\n @click=\"${() => this.requestClose(\"close-button\")}\"\n ariaLabel=\"close modal\"\n ></sgds-close-button>`}\n </div>\n `\n : \"\"}\n\n <div\n part=\"body\"\n class=${classMap({\n \"modal-body\": true,\n centered: this.centeredAlignVariant\n })}\n >\n <slot></slot>\n </div>\n\n <footer\n part=\"footer\"\n class=${classMap({\n \"modal-footer\": true,\n centered: this.centeredAlignVariant\n })}\n >\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n </div>\n `;\n }\n}\n\nsetDefaultAnimation(\"modal.show\", {\n keyframes: [\n { opacity: 0, transform: \"scale(1) translate(0, -100%)\" },\n { opacity: 1, transform: \"scale(1) translate(0, 0%)\" }\n ],\n options: { duration: 400, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"modal.hide\", {\n keyframes: [\n { opacity: 1, transform: \"scale(1) translate(0, 0)\" },\n { opacity: 0, transform: \"scale(1) translate(0, -100%)\" }\n ],\n options: { duration: 400, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"modal.denyClose\", {\n keyframes: [{ transform: \"scale(1)\" }, { transform: \"scale(1.02)\" }, { transform: \"scale(1)\" }],\n options: { duration: 400 }\n});\n\nsetDefaultAnimation(\"modal.overlay.show\", {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n options: { duration: 400 }\n});\n\nsetDefaultAnimation(\"modal.overlay.hide\", {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n options: { duration: 400 }\n});\n\nexport default SgdsModal;\n"],"names":["headerStyles","svgStyles","modalStyle"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;MACU,SAAU,SAAQ,mBAAmB,CAAC,WAAW,CAAC,CAAA;AAA/D,IAAA,WAAA,GAAA;;;QAiBmB,IAAiB,CAAA,iBAAA,GAAG,IAAI,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;;QAO/B,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;;QAE5B,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;;QAEX,IAAS,CAAA,SAAA,GAAG,EAAE,CAAC;;QAEA,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAEjB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAEjB,IAAoB,CAAA,oBAAA,GAAG,KAAK,CAAC;;QAE7B,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;;QAEpB,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC;KA6NnE;;AAhQC,IAAA,WAAW,cAAc,GAAA;QACvB,OAAO;AACL,YAAA,mBAAmB,EAAE,eAAe;SACrC,CAAC;KACH;IAiCD,iBAAiB,GAAA;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,C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,CAAC;AAEH,mBAAmB,CAAC,YAAY,EAAE;AAChC,IAAA,SAAS,EAAE;AACT,QAAA,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE;AACrD,QAAA,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,8BAA8B,EAAE;AAC1D,KAAA;IACD,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE;AAC3C,CAAA,CAAC,CAAC;AAEH,mBAAmB,CAAC,iBAAiB,EAAE;AACrC,IAAA,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AAC/F,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC,CAAC;AAEH,mBAAmB,CAAC,oBAAoB,EAAE;AACxC,IAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC3C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC,CAAC;AAEH,mBAAmB,CAAC,oBAAoB,EAAE;AACxC,IAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC3C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC3B,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"sgds-modal.js","sources":["../../../src/components/Modal/sgds-modal.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { unsafeSVG } from \"lit/directives/unsafe-svg.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { animateTo, stopAnimations } from \"../../utils/animate\";\nimport { getAnimation, setDefaultAnimation } from \"../../utils/animation-registry\";\nimport { waitForEvent } from \"../../utils/event\";\nimport Modal from \"../../utils/modal\";\nimport { lockBodyScrolling, unlockBodyScrolling } from \"../../utils/scroll\";\nimport { HasSlotController } from \"../../utils/slot\";\nimport { watch } from \"../../utils/watch\";\nimport modalStyle from \"./modal.css\";\nimport { ScopedElementsMixin } from \"@open-wc/scoped-elements\";\nimport SgdsCloseButton from \"../../internals/CloseButton/sgds-close-button\";\nimport headerStyles from \"../../styles/header-class.css\";\nimport svgStyles from \"../../styles/svg.css\";\n/**\n * @summary The modal component inform users about a specific task and may contain critical information which users then have to make a decision.\n *\n * @slot default - The content of the Modal's body.\n * @slot footer - The content of the Modal's footer, typically used to pass in buttons for call to action.\n *\n * @event sgds-close - Emitted when the modal is called to close via mouseclick of close button, overlay or via keyboard esc key\n * @event sgds-show - Emitted when the modal opens\n * @event sgds-hide - Emitted when the modal closes\n * @event sgds-after-show - Emitted after modal opens and the animations has completed\n * @event sgds-after-hide - Emitted after modal closes and the animations has completed\n *\n * @csspart base - The component's base wrapper\n * @csspart overlay - The overlay that covers the screen behind the dialog\n * @csspart panel - The modal's dialog panel\n * @csspart header - The modal's header that wraps the title, titleIcon and close button\n * @csspart title - The h3 element wrapping title and titleIcon\n * @csspart body - The modal's body where the content lies\n * @csspart footers - The modal's footer\n *\n * @cssproperty --modal-panel-padding - The general modal padding of modal component. Applied to body, footer and header.\n * @cssproperty --modal-panel-z-index - The z-index of modal panel\n * @cssproperty --modal-panel-width - The width of modal panel.\n * @cssproperty --modal-panel-height - The height of modal panel.\n * @cssproperty --modal-panel-bg - The background color of modal panel\n * @cssproperty --modal-panel-border-radius - The border radius of modal panel\n * @cssproperty --modal-header-border-bottom - The bottom border of header\n * @cssproperty --modal-overlay-bg - The overlay's background color\n */\nexport class SgdsModal extends ScopedElementsMixin(SgdsElement) {\n static styles = [...SgdsElement.styles, headerStyles, svgStyles, modalStyle];\n /**@internal */\n static get scopedElements() {\n return {\n \"sgds-close-button\": SgdsCloseButton\n };\n }\n /**@internal */\n @query(\".modal\") dialog: HTMLElement;\n /**@internal */\n @query(\".modal-panel\") panel: HTMLElement;\n /**@internal */\n @query(\".modal-overlay\") overlay: HTMLElement;\n /**@internal */\n @query(\".modal-title\") heading: HTMLElement;\n /**@internal */\n private readonly hasSlotController = new HasSlotController(this, \"footer\");\n /**@internal */\n private modal: Modal;\n /**@internal */\n private originalTrigger: HTMLElement | null;\n\n /**Indicates whether or not the modal is open. You can use this in lieu of the show/hide methods. */\n @property({ type: Boolean, reflect: true }) open = false;\n /**The modal's title as displayed in the header */\n @property({ reflect: true }) title = \"\";\n /**The modal's icon as displayed in the header. Pass in SVG format icons as string directly */\n @property({ reflect: true }) titleIcon = \"\";\n /** Disables the header. This will also remove the default close button */\n @property({ type: Boolean, reflect: true }) noHeader = false;\n /** Centers the modal vertically in page */\n @property({ type: Boolean, reflect: true }) centered = false;\n /** Centers the contents inside the modal */\n @property({ type: Boolean, reflect: true }) centeredAlignVariant = false;\n /** Removes the default animation when opening and closing of modal */\n @property({ type: Boolean, reflect: true }) noAnimation = false;\n /** Removes the close button from modal header */\n @property({ type: Boolean, reflect: true }) noCloseButton = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);\n this.modal = new Modal(this);\n }\n\n firstUpdated() {\n this.dialog.hidden = !this.open;\n\n if (this.open) {\n this.addOpenListeners();\n this.modal.activate();\n lockBodyScrolling(this);\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n unlockBodyScrolling(this);\n }\n\n /** Shows the dialog. */\n public async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, \"sgds-after-show\");\n }\n\n /** Hides the dialog */\n public async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, \"sgds-after-hide\");\n }\n\n private requestClose(source: \"close-button\" | \"keyboard\" | \"overlay\") {\n const sgdsRequestClose = this.emit(\"sgds-close\", {\n cancelable: true,\n detail: { source }\n });\n\n if (sgdsRequestClose.defaultPrevented) {\n const animation = getAnimation(this, \"modal.denyClose\");\n animateTo(this.panel, animation.keyframes);\n return;\n }\n\n this.hide();\n }\n\n addOpenListeners() {\n document.addEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n removeOpenListeners() {\n document.removeEventListener(\"keydown\", this.handleDocumentKeyDown);\n }\n\n handleDocumentKeyDown(event: KeyboardEvent) {\n if (this.open && event.key === \"Escape\") {\n event.stopPropagation();\n this.requestClose(\"keyboard\");\n }\n }\n\n @watch(\"open\", { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n // Show\n this.emit(\"sgds-show\");\n this.addOpenListeners();\n this.originalTrigger = document.activeElement as HTMLElement;\n this.modal.activate();\n\n lockBodyScrolling(this);\n\n await Promise.all([stopAnimations(this.dialog), stopAnimations(this.overlay)]);\n this.dialog.hidden = false;\n\n const panelAnimation = getAnimation(this, \"modal.show\");\n const overlayAnimation = getAnimation(this, \"modal.overlay.show\");\n !this.noAnimation &&\n (await Promise.all([\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)\n ]));\n\n this.emit(\"sgds-after-show\");\n\n // Add focus on modal heading after opening it\n this.heading.focus();\n } else {\n // Hide\n this.emit(\"sgds-hide\");\n this.removeOpenListeners();\n this.modal.deactivate();\n\n await Promise.all([stopAnimations(this.dialog), stopAnimations(this.overlay)]);\n const panelAnimation = getAnimation(this, \"modal.hide\");\n const overlayAnimation = getAnimation(this, \"modal.overlay.hide\");\n\n // Animate the overlay and the panel at the same time. Because animation durations might be different, we need to\n // hide each one individually when the animation finishes, otherwise the first one that finishes will reappear\n // unexpectedly. We'll unhide them after all animations have completed.\n !this.noAnimation &&\n (await Promise.all([\n animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options).then(() => {\n this.overlay.hidden = true;\n }),\n animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options).then(() => {\n this.panel.hidden = true;\n })\n ]));\n\n this.dialog.hidden = true;\n\n // Now that the dialog is hidden, restore the overlay and panel for next time\n this.overlay.hidden = false;\n this.panel.hidden = false;\n\n unlockBodyScrolling(this);\n\n // Restore focus to the original trigger\n const trigger = this.originalTrigger;\n if (typeof trigger?.focus === \"function\") {\n setTimeout(() => trigger.focus());\n }\n\n this.emit(\"sgds-after-hide\");\n }\n }\n\n render() {\n const withLabelIcon = html`${unsafeSVG(this.titleIcon)}`;\n return html`\n <div\n part=\"base\"\n class=${classMap({\n modal: true,\n \"modal--open\": this.open,\n \"modal--has-footer\": this.hasSlotController.test(\"footer\"),\n centered: this.centered\n })}\n >\n <div part=\"overlay\" class=\"modal-overlay\" @click=${() => this.requestClose(\"overlay\")}></div>\n\n <div\n part=\"panel\"\n class=\"modal-panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden=${this.open ? \"false\" : \"true\"}\n aria-label=${ifDefined(this.noHeader ? this.title : undefined)}\n aria-labelledby=${ifDefined(!this.noHeader ? \"title\" : undefined)}\n tabindex=\"-1\"\n >\n ${!this.noHeader\n ? html`\n <div\n part=\"header\"\n class=${classMap({\n \"modal-header\": true,\n centered: this.centeredAlignVariant\n })}\n >\n <h3\n part=\"title\"\n class=${classMap({\n \"modal-title\": true,\n centered: this.centeredAlignVariant\n })}\n id=\"title\"\n tabindex=\"-1\"\n >\n ${this.titleIcon ? withLabelIcon : \"\"} ${this.title}\n </h3>\n ${this.noCloseButton\n ? nothing\n : html`<sgds-close-button\n class=${classMap({\n \"modal-close\": true,\n centered: this.centeredAlignVariant\n })}\n @click=\"${() => this.requestClose(\"close-button\")}\"\n ariaLabel=\"close modal\"\n ></sgds-close-button>`}\n </div>\n `\n : \"\"}\n\n <div\n part=\"body\"\n class=${classMap({\n \"modal-body\": true,\n centered: this.centeredAlignVariant\n })}\n >\n <slot></slot>\n </div>\n\n <footer\n part=\"footer\"\n class=${classMap({\n \"modal-footer\": true,\n centered: this.centeredAlignVariant\n })}\n >\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n </div>\n `;\n }\n}\n\nsetDefaultAnimation(\"modal.show\", {\n keyframes: [\n { opacity: 0, transform: \"scale(1) translate(0, -100%)\" },\n { opacity: 1, transform: \"scale(1) translate(0, 0%)\" }\n ],\n options: { duration: 400, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"modal.hide\", {\n keyframes: [\n { opacity: 1, transform: \"scale(1) translate(0, 0)\" },\n { opacity: 0, transform: \"scale(1) translate(0, -100%)\" }\n ],\n options: { duration: 400, easing: \"ease\" }\n});\n\nsetDefaultAnimation(\"modal.denyClose\", {\n keyframes: [{ transform: \"scale(1)\" }, { transform: \"scale(1.02)\" }, { transform: \"scale(1)\" }],\n options: { duration: 400 }\n});\n\nsetDefaultAnimation(\"modal.overlay.show\", {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n options: { duration: 400 }\n});\n\nsetDefaultAnimation(\"modal.overlay.hide\", {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n options: { duration: 400 }\n});\n\nexport default SgdsModal;\n"],"names":["headerStyles","svgStyles","modalStyle"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;MACU,SAAU,SAAQ,mBAAmB,CAAC,WAAW,CAAC,CAAA;AAA/D,IAAA,WAAA,GAAA;;;QAiBmB,IAAiB,CAAA,iBAAA,GAAG,IAAI,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;;QAO/B,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;;QAE5B,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;;QAEX,IAAS,CAAA,SAAA,GAAG,EAAE,CAAC;;QAEA,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAEjB,IAAQ,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