@asante-org/atlascopco-vt-litesitegenerator 3.8.12 → 3.8.14

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/index.esm.js CHANGED
@@ -5834,6 +5834,7 @@ var SELECTORS = {
5834
5834
  dialogForm: "[data-lsg-download-dialog-form]",
5835
5835
  dialogSuccess: "[data-lsg-download-dialog-success]",
5836
5836
  successLink: "[data-lsg-download-success-link]",
5837
+ formRoot: "[data-vtba-form]",
5837
5838
  form: ".cmp-vtba-form__form",
5838
5839
  focusable: 'input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled])'
5839
5840
  };
@@ -6023,6 +6024,11 @@ var LsgDownloadLibraryController = /** @class */function () {
6023
6024
  this.root = root;
6024
6025
  this.options = options;
6025
6026
  this.dialog = root.querySelector(SELECTORS.dialog);
6027
+ var success = this.dialog ? this.dialog.querySelector(SELECTORS.dialogSuccess) : null;
6028
+ this.successHome = success && success.parentNode ? {
6029
+ parent: success.parentNode,
6030
+ next: success.nextSibling
6031
+ } : null;
6026
6032
  }
6027
6033
  LsgDownloadLibraryController.prototype.init = function () {
6028
6034
  if (this.root.dataset.lsgDownloadReady === "true") {
@@ -6145,18 +6151,33 @@ var LsgDownloadLibraryController = /** @class */function () {
6145
6151
  this.dialog.close();
6146
6152
  }
6147
6153
  };
6154
+ /**
6155
+ * Form ⇄ success. The overlay page's container is the visible modal, so on success
6156
+ * the panel takes the <form>'s place inside the VTBA form root: the container's
6157
+ * background, padding and title stay. Showing the form puts the panel back.
6158
+ */
6148
6159
  LsgDownloadLibraryController.prototype.setRegions = function (showForm) {
6149
- if (!this.dialog) {
6160
+ var success = this.dialog ? this.dialog.querySelector(SELECTORS.dialogSuccess) : null;
6161
+ if (!this.dialog || !success) {
6150
6162
  return;
6151
6163
  }
6152
- var form = this.dialog.querySelector(SELECTORS.dialogForm);
6153
- var success = this.dialog.querySelector(SELECTORS.dialogSuccess);
6154
- if (form) {
6155
- form.hidden = !showForm;
6164
+ var formRoot = this.dialog.querySelector(SELECTORS.formRoot);
6165
+ var form = formRoot ? formRoot.querySelector(SELECTORS.form) : null;
6166
+ if (showForm) {
6167
+ success.hidden = true;
6168
+ if (this.successHome && success.parentNode !== this.successHome.parent) {
6169
+ this.successHome.parent.insertBefore(success, this.successHome.next);
6170
+ }
6171
+ if (form) {
6172
+ form.hidden = false;
6173
+ }
6174
+ return;
6156
6175
  }
6157
- if (success) {
6158
- success.hidden = showForm;
6176
+ if (form && form.parentNode) {
6177
+ form.hidden = true;
6178
+ form.parentNode.insertBefore(success, form.nextSibling);
6159
6179
  }
6180
+ success.hidden = false;
6160
6181
  };
6161
6182
  LsgDownloadLibraryController.prototype.focusFirstField = function () {
6162
6183
  var region = this.dialog ? this.dialog.querySelector(SELECTORS.dialogForm) : null;
@@ -6596,15 +6617,7 @@ var LsgDownloadLibrary = function (_a) {
6596
6617
  "data-lsg-download-dialog": ""
6597
6618
  }, /*#__PURE__*/React.createElement("div", {
6598
6619
  className: "lsg-download-library__dialog-panel"
6599
- }, /*#__PURE__*/React.createElement("div", {
6600
- className: "lsg-download-library__dialog-header"
6601
- }, /*#__PURE__*/React.createElement("h2", {
6602
- className: "lsg-download-library__dialog-title",
6603
- id: "".concat(libId, "-title")
6604
- }, strings.dialogTitle), /*#__PURE__*/React.createElement("p", {
6605
- className: "lsg-download-library__dialog-asset",
6606
- "data-lsg-download-dialog-asset": ""
6607
- }), /*#__PURE__*/React.createElement("button", {
6620
+ }, /*#__PURE__*/React.createElement("button", {
6608
6621
  type: "button",
6609
6622
  className: "lsg-download-library__dialog-close",
6610
6623
  "aria-label": strings.close,
@@ -6612,7 +6625,15 @@ var LsgDownloadLibrary = function (_a) {
6612
6625
  }, /*#__PURE__*/React.createElement("span", {
6613
6626
  className: "lsg-download-library__icon lsg-download-library__icon--close",
6614
6627
  "aria-hidden": "true"
6615
- }))), /*#__PURE__*/React.createElement("div", {
6628
+ })), /*#__PURE__*/React.createElement("div", {
6629
+ className: "lsg-download-library__dialog-header lsg-visually-hidden"
6630
+ }, /*#__PURE__*/React.createElement("h2", {
6631
+ className: "lsg-download-library__dialog-title",
6632
+ id: "".concat(libId, "-title")
6633
+ }, strings.dialogTitle), /*#__PURE__*/React.createElement("p", {
6634
+ className: "lsg-download-library__dialog-asset",
6635
+ "data-lsg-download-dialog-asset": ""
6636
+ })), /*#__PURE__*/React.createElement("div", {
6616
6637
  className: "lsg-download-library__dialog-form",
6617
6638
  "data-lsg-download-dialog-form": ""
6618
6639
  }, form), /*#__PURE__*/React.createElement("div", {