dap-design-system 0.38.21 → 0.38.22

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/dist/dds.js CHANGED
@@ -13109,22 +13109,30 @@ const xl = class xl extends $ {
13109
13109
  super.updated(e), e.has("open") && e.get("open") !== void 0 && (this.open ? this.handleOpen() : this.handleCloseAction());
13110
13110
  }
13111
13111
  handleOpen() {
13112
- this.emit("dds-before-open"), this.scrollLock(!0), this.previouslyFocusedElement = this.getActiveElement(), this.dialog.showModal(), this.dialog.addEventListener(
13112
+ this.emit("dds-before-open", void 0, {
13113
+ cancelable: !0
13114
+ }).defaultPrevented || (this.scrollLock(!0), this.previouslyFocusedElement = this.getActiveElement(), this.dialog.showModal(), this.dialog.addEventListener(
13113
13115
  "transitionend",
13114
13116
  () => {
13115
- this.emit("dds-opened"), this.focusableElements = this.getFocusableElements(), this.focusableElements.length > 0 && this.focusableElements[0].focus();
13117
+ this.emit("dds-opened", void 0, {
13118
+ cancelable: !0
13119
+ }).defaultPrevented || (this.focusableElements = this.getFocusableElements(), this.focusableElements.length > 0 && this.focusableElements[0].focus());
13116
13120
  },
13117
13121
  { once: !0 }
13118
- ), this.setAttribute("aria-hidden", "false");
13122
+ ), this.setAttribute("aria-hidden", "false"));
13119
13123
  }
13120
13124
  handleCloseAction() {
13121
- this.emit("dds-before-close"), this.dialog.close(), this.scrollLock(!1), this.dialog.addEventListener(
13125
+ this.emit("dds-before-close", void 0, {
13126
+ cancelable: !0
13127
+ }).defaultPrevented || (this.dialog.close(), this.scrollLock(!1), this.dialog.addEventListener(
13122
13128
  "transitionend",
13123
13129
  () => {
13124
- this.emit("dds-closed"), this.previouslyFocusedElement instanceof HTMLElement && this.previouslyFocusedElement.focus();
13130
+ this.emit("dds-closed", void 0, {
13131
+ cancelable: !0
13132
+ }).defaultPrevented || this.previouslyFocusedElement instanceof HTMLElement && this.previouslyFocusedElement.focus();
13125
13133
  },
13126
13134
  { once: !0 }
13127
- ), this.setAttribute("aria-hidden", "true");
13135
+ ), this.setAttribute("aria-hidden", "true"));
13128
13136
  }
13129
13137
  firstUpdated(e) {
13130
13138
  super.firstUpdated(e), this.open ? (this.setAttribute("aria-hidden", "false"), this.dialog.showModal()) : this.setAttribute("aria-hidden", "true");
@@ -13147,20 +13155,40 @@ const xl = class xl extends $ {
13147
13155
  ).defaultPrevented || this.hide();
13148
13156
  }
13149
13157
  handleCancel(e) {
13150
- this.closeOnEsc !== "true" && (e.preventDefault(), this.canceled = !0);
13158
+ if (this.closeOnEsc !== "true") {
13159
+ e.preventDefault(), this.canceled = !0;
13160
+ return;
13161
+ }
13162
+ e.preventDefault();
13151
13163
  }
13152
13164
  handleEscClose(e) {
13153
- if (this.canceled) {
13165
+ if (this.canceled || this.closeOnEsc !== "true") {
13154
13166
  e.preventDefault();
13155
13167
  return;
13156
13168
  }
13157
- this.open && this.handleClose("esc");
13169
+ e.preventDefault();
13158
13170
  }
13159
13171
  handleOkButton() {
13160
- this.emit("dds-ok"), this.handleClose("ok-button");
13172
+ this.emit(
13173
+ "dds-ok",
13174
+ {
13175
+ source: "ok-button"
13176
+ },
13177
+ {
13178
+ cancelable: !0
13179
+ }
13180
+ ).defaultPrevented || this.handleClose("ok-button");
13161
13181
  }
13162
13182
  handleCancelButton() {
13163
- this.emit("dds-cancel"), this.handleClose("cancel-button");
13183
+ this.emit(
13184
+ "dds-cancel",
13185
+ {
13186
+ source: "cancel-button"
13187
+ },
13188
+ {
13189
+ cancelable: !0
13190
+ }
13191
+ ).defaultPrevented || this.handleClose("cancel-button");
13164
13192
  }
13165
13193
  handleClick(e) {
13166
13194
  this.closeOnOverlayClick === "true" && e.target === this.dialog && this.handleClose("overlay");
@@ -13170,7 +13198,7 @@ const xl = class xl extends $ {
13170
13198
  this.handleFocusTrap(e);
13171
13199
  return;
13172
13200
  }
13173
- this.closeOnEsc === "true" && e.key === "Escape" ? this.handleClose("esc") : e.key === "Escape" && (e.preventDefault(), e.stopImmediatePropagation());
13201
+ e.key === "Escape" && (this.closeOnEsc === "true" ? this.handleClose("esc") : (e.preventDefault(), e.stopImmediatePropagation()));
13174
13202
  }
13175
13203
  getFocusableElements() {
13176
13204
  const e = [