@govtechsg/sgds-web-component 3.1.1-rc.3 → 3.1.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 (75) hide show
  1. package/base/button.js +1 -1
  2. package/components/Badge/index.umd.js +0 -5
  3. package/components/Badge/index.umd.js.map +1 -1
  4. package/components/Badge/sgds-badge.js +0 -5
  5. package/components/Badge/sgds-badge.js.map +1 -1
  6. package/components/Button/index.umd.js +1 -1
  7. package/components/ComboBox/index.umd.js +0 -5
  8. package/components/ComboBox/index.umd.js.map +1 -1
  9. package/components/Datepicker/index.umd.js +1 -1
  10. package/components/FileUpload/index.umd.js +1 -1
  11. package/components/IconButton/index.umd.js +1 -1
  12. package/components/Mainnav/index.umd.js +3 -3
  13. package/components/Mainnav/index.umd.js.map +1 -1
  14. package/components/Modal/index.umd.js +5 -2
  15. package/components/Modal/index.umd.js.map +1 -1
  16. package/components/Modal/modal.js +1 -1
  17. package/components/Modal/sgds-modal.js +2 -1
  18. package/components/Modal/sgds-modal.js.map +1 -1
  19. package/components/Pagination/index.umd.js +1 -1
  20. package/components/QuantityToggle/index.umd.js +1 -1
  21. package/components/Subnav/index.umd.js +95 -67
  22. package/components/Subnav/index.umd.js.map +1 -1
  23. package/components/Subnav/sgds-subnav.d.ts +3 -4
  24. package/components/Subnav/sgds-subnav.js +95 -66
  25. package/components/Subnav/sgds-subnav.js.map +1 -1
  26. package/components/Subnav/subnav-item.js +1 -1
  27. package/components/Subnav/subnav.js +1 -1
  28. package/components/Table/index.umd.js +44 -106
  29. package/components/Table/index.umd.js.map +1 -1
  30. package/components/Table/sgds-table.d.ts +5 -31
  31. package/components/Table/sgds-table.js +42 -104
  32. package/components/Table/sgds-table.js.map +1 -1
  33. package/components/Table/table.js +1 -1
  34. package/components/index.umd.js +144 -182
  35. package/components/index.umd.js.map +1 -1
  36. package/index.umd.js +145 -183
  37. package/index.umd.js.map +1 -1
  38. package/package.json +2 -2
  39. package/react/base/button.cjs.js +1 -1
  40. package/react/base/button.js +1 -1
  41. package/react/components/Badge/sgds-badge.cjs.js +0 -5
  42. package/react/components/Badge/sgds-badge.cjs.js.map +1 -1
  43. package/react/components/Badge/sgds-badge.js +0 -5
  44. package/react/components/Badge/sgds-badge.js.map +1 -1
  45. package/react/components/Modal/modal.cjs.js +1 -1
  46. package/react/components/Modal/modal.js +1 -1
  47. package/react/components/Modal/sgds-modal.cjs.js +2 -1
  48. package/react/components/Modal/sgds-modal.cjs.js.map +1 -1
  49. package/react/components/Modal/sgds-modal.js +2 -1
  50. package/react/components/Modal/sgds-modal.js.map +1 -1
  51. package/react/components/Subnav/sgds-subnav.cjs.js +93 -64
  52. package/react/components/Subnav/sgds-subnav.cjs.js.map +1 -1
  53. package/react/components/Subnav/sgds-subnav.js +95 -66
  54. package/react/components/Subnav/sgds-subnav.js.map +1 -1
  55. package/react/components/Subnav/subnav-item.cjs.js +1 -1
  56. package/react/components/Subnav/subnav-item.js +1 -1
  57. package/react/components/Subnav/subnav.cjs.js +1 -1
  58. package/react/components/Subnav/subnav.js +1 -1
  59. package/react/components/Table/sgds-table.cjs.js +42 -104
  60. package/react/components/Table/sgds-table.cjs.js.map +1 -1
  61. package/react/components/Table/sgds-table.js +42 -104
  62. package/react/components/Table/sgds-table.js.map +1 -1
  63. package/react/components/Table/table.cjs.js +1 -1
  64. package/react/components/Table/table.js +1 -1
  65. package/react/table/index.cjs.js +1 -3
  66. package/react/table/index.cjs.js.map +1 -1
  67. package/react/table/index.js +1 -3
  68. package/react/table/index.js.map +1 -1
  69. package/react/utils/breakpoints.cjs.js +2 -2
  70. package/react/utils/breakpoints.cjs.js.map +1 -1
  71. package/react/utils/breakpoints.js +2 -2
  72. package/react/utils/breakpoints.js.map +1 -1
  73. package/utils/breakpoints.d.ts +3 -2
  74. package/utils/breakpoints.js +2 -2
  75. package/utils/breakpoints.js.map +1 -1
@@ -4446,7 +4446,7 @@
4446
4446
 
4447
4447
  var css_248z$1b = css`:host([variant=border]) .accordion{border:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);border-radius:var(--sgds-border-radius-md)}`;
4448
4448
 
4449
- const VALID_KEYS$1 = ["Enter", "ArrowUp", "ArrowLeft", "ArrowDown", "ArrowRight"];
4449
+ const VALID_KEYS = ["Enter", "ArrowUp", "ArrowLeft", "ArrowDown", "ArrowRight"];
4450
4450
  /**
4451
4451
  * @summary A dropdown mechanism that allow users to either show or hide related content. `SgdsAccordion` is a wrapper to manage the behaviour for multiple `SgdsAccordionItems`
4452
4452
  * @slot default - slot for accordion-item
@@ -4504,7 +4504,7 @@
4504
4504
  });
4505
4505
  }
4506
4506
  async _onKeyboardToggle(event) {
4507
- if (!VALID_KEYS$1.includes(event.key))
4507
+ if (!VALID_KEYS.includes(event.key))
4508
4508
  return;
4509
4509
  return this._onToggle(event);
4510
4510
  }
@@ -7780,12 +7780,7 @@
7780
7780
  }
7781
7781
  /** Closes the badge */
7782
7782
  close() {
7783
- const sgdsHide = this.emit("sgds-hide", { cancelable: true });
7784
- if (sgdsHide.defaultPrevented) {
7785
- return;
7786
- }
7787
7783
  this.show = false;
7788
- this.emit("sgds-after-hide");
7789
7784
  }
7790
7785
  /**@internal */
7791
7786
  _handleShowChange() {
@@ -12184,7 +12179,7 @@
12184
12179
  property({ type: Boolean, reflect: true })
12185
12180
  ], SgdsBreadcrumbItem.prototype, "active", void 0);
12186
12181
 
12187
- var css_248z$Y = css`:host{--btn-font-weight:var(--sgds-font-weight-regular);--btn-bg:var(--sgds-primary-surface-default);--btn-hover-bg:var(--sgds-primary-surface-emphasis);--btn-border-radius:var(--sgds-border-radius-md)}:host([variant=primary]){--btn-bg:var(--sgds-primary-surface-default);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-primary-surface-translucent);--btn-color:var(--sgds-primary-color-default);--btn-border-width:var(--sgds-border-width-1);--btn-border-color:var(--sgds-primary-border-color-default)}:host([variant=ghost]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-primary-surface-translucent);--btn-color:var(--sgds-primary-color-default)}:host([variant=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=ghost]) .btn,:host([variant=outline]) .btn,:host([variant=primary]) .btn{color:var(--btn-color)}:host([variant=outline]) .btn{border:var(--btn-border-width) solid var(--btn-border-color)}:host([size=lg]) .btn{font-size:var(--sgds-font-size-3);height:var(--sgds-dimension-56);min-width:var(--sgds-dimension-112);padding:0 var(--sgds-padding-xl)}:host([size=sm]) .btn{font-size:var(--sgds-font-size-1);height:var(--sgds-dimension-40);line-height:var(--sgds-line-height-min);min-width:var(--sgds-dimension-80);padding:0 var(--sgds-padding-md)}.btn{align-items:center;background-color:var(--btn-bg);border:1px solid var(--sgds-border-color-transparent);border-radius:var(--btn-border-radius);color:var(--sgds-color-fixed-light);cursor:pointer;display:inline-flex;font-size:var(--sgds-font-size-2);font-weight:var(--btn-font-weight);gap:var(--sgds-gap-2-xs);height:var(--sgds-dimension-48);justify-content:center;line-height:var(--sgds-line-height-body);min-width:var(--sgds-dimension-96);padding:0 var(--sgds-padding-lg);text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;user-select:none;vertical-align:middle;white-space:nowrap;width:inherit}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn.active,.btn:hover{background-color:var(--btn-hover-bg)}.btn:focus,.btn:focus-visible{background-color:var(--btn-hover-bg);border-color:transparent;box-shadow:var(--sgds-box-shadow-focus);outline:0}.btn.disabled,.btn:disabled{color:var(--btn-color);cursor:not-allowed;opacity:var(--sgds-opacity-50)}.btn slot::slotted(*){color:var(--btn-color)}`;
12182
+ var css_248z$Y = css`:host{--btn-font-weight:var(--sgds-font-weight-regular);--btn-bg:var(--sgds-primary-surface-default);--btn-hover-bg:var(--sgds-primary-surface-emphasis);--btn-border-radius:var(--sgds-border-radius-md)}:host([variant=primary]){--btn-bg:var(--sgds-primary-surface-default);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-primary-surface-translucent);--btn-color:var(--sgds-primary-color-default);--btn-border-width:var(--sgds-border-width-1);--btn-border-color:var(--sgds-primary-border-color-default)}:host([variant=ghost]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-primary-surface-translucent);--btn-color:var(--sgds-primary-color-default)}:host([variant=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=ghost]) .btn,:host([variant=outline]) .btn,:host([variant=primary]) .btn{color:var(--btn-color)}:host([variant=outline]) .btn{border:var(--btn-border-width) solid var(--btn-border-color)}:host([size=lg]) .btn{font-size:var(--sgds-font-size-3);height:var(--sgds-dimension-56);min-width:var(--sgds-dimension-112);padding:0 var(--sgds-padding-xl)}:host([size=sm]) .btn{font-size:var(--sgds-font-size-1);height:var(--sgds-dimension-40);line-height:var(--sgds-line-height-min);min-width:var(--sgds-dimension-80);padding:0 var(--sgds-padding-md)}.btn{align-items:center;background-color:var(--btn-bg);border:1px solid var(--sgds-border-color-transparent);border-radius:var(--btn-border-radius);color:var(--sgds-color-fixed-light);cursor:pointer;display:inline-flex;font-size:var(--sgds-font-size-2);font-weight:var(--btn-font-weight);gap:var(--sgds-gap-2-xs);height:var(--sgds-dimension-48);justify-content:center;line-height:var(--sgds-line-height-body);min-width:var(--sgds-dimension-96);padding:0 var(--sgds-padding-lg);text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;user-select:none;vertical-align:middle}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn.active,.btn:hover{background-color:var(--btn-hover-bg)}.btn:focus,.btn:focus-visible{background-color:var(--btn-hover-bg);border-color:transparent;box-shadow:var(--sgds-box-shadow-focus);outline:0}.btn.disabled,.btn:disabled{color:var(--btn-color);cursor:not-allowed;opacity:var(--sgds-opacity-50)}.btn slot::slotted(*){color:var(--btn-color)}`;
12188
12183
 
12189
12184
  class ButtonElement extends SgdsElement {
12190
12185
  constructor() {
@@ -26317,9 +26312,9 @@
26317
26312
  });
26318
26313
  }
26319
26314
 
26320
- const LG_BREAKPOINT = 1024;
26321
- const MD_BREAKPOINT = 768;
26322
26315
  const SM_BREAKPOINT = 512;
26316
+ const MD_BREAKPOINT = 768;
26317
+ const LG_BREAKPOINT = 1024;
26323
26318
  const XL_BREAKPOINT = 1280;
26324
26319
  const XXL_BREAKPOINT = 1440;
26325
26320
 
@@ -27243,7 +27238,7 @@
27243
27238
  }
27244
27239
  }
27245
27240
 
27246
- var css_248z$o = css`:host([size=sm]) .modal-panel{max-width:var(--sgds-dimension-480)}:host([size=md]) .modal-panel{max-width:var(--sgds-dimension-640)}:host([size=lg]) .modal-panel{max-width:var(--sgds-dimension-800)}:host([size=fullscreen]) .modal-overlay{background-color:var(--sgds-surface-default)}:host([size=fullscreen]) .modal-header{padding:var(--sgds-padding-none) var(--sgds-padding-none) var(--sgds-padding-xl)}:host([size=fullscreen]) .modal-body{padding:var(--sgds-padding-none)}:host([size=fullscreen]) .modal-footer{padding:var(--sgds-padding-xl) var(--sgds-padding-none) var(--sgds-padding-none)}.modal{align-items:start;bottom:0;display:flex;font-family:var(--sgds-body-font-family);justify-content:center;left:0;position:fixed;right:0;top:0;z-index:105500}.modal-panel{border-radius:var(--sgds-border-radius-md);display:flex;flex-direction:column;gap:var(--sgds-gap-2-xl);margin:var(--sgds-margin-sm) var(--sgds-margin-xs);max-height:calc(100% - var(--sgds-margin-sm) - var(--sgds-margin-sm));position:relative;width:100%}:host(:not([size=fullscreen])) .modal-panel{background-color:var(--sgds-surface-default);max-width:var(--sgds-dimension-640);padding:var(--sgds-padding-xl)}.modal-panel:focus{outline:none}.modal-content{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--sgds-gap-2-xl);min-height:0;position:relative}.modal-header__close{position:absolute;right:calc(var(--sgds-padding-md)*-1);top:calc(var(--sgds-padding-md)*-1)}@media screen and (min-width:512px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-sm)}}@media screen and (min-width:768px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-md);max-height:calc(100% - var(--sgds-margin-md) - var(--sgds-margin-md))}}@media screen and (min-width:1024px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-xl) var(--sgds-margin-xs);max-height:calc(100% - var(--sgds-margin-xl) - var(--sgds-margin-xl));max-width:var(--sgds-dimension-896)}}@media screen and (min-width:1280px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1176)}}@media screen and (min-width:1440px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1320)}}.modal.show .modal-panel{opacity:1;transform:none}.modal-header{display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;max-width:var(--sgds-dimension-872)}.modal-header__title-description{display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}:host([size=fullscreen]) .modal-header__title-description{gap:var(--sgds-gap-md)}slot[name=title]::slotted(*){--sgds-margin-2-xs:var(--sgds-margin-none);--sgds-margin-xs:var(--sgds-margin-none);--sgds-font-size-6:var(--sgds-font-size-4);align-items:center;display:flex;flex:1 1 auto;font-size:var(--sgds-font-size-6,--sgds-font-size-4);gap:1rem;line-height:var(--sgds-line-height-heading);margin:var(--sgds-margin-none,var(--sgds-margin-xs,--sgds-margin-2-xs))}slot[name=description]::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none);color:var(--sgds-color-subtle);line-height:var(--sgds-line-height-body);margin:var(--sgds-margin-none,--sgds-paragraph-spacing-xl)}.modal-body{-webkit-overflow-scrolling:touch;flex:1 1 auto;overflow:auto}.modal-body slot::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none)}.modal-footer{display:flex;flex:0 0 auto;flex-wrap:wrap;gap:var(--sgds-gap-md);justify-content:flex-end;padding-top:var(--sgds-padding-md)}.modal:not(.has-footer) .modal-footer{display:none}.modal-overlay{background-color:var(--sgds-bg-overlay);bottom:0;left:0;position:fixed;right:0;top:0}[hidden]{display:none}`;
27241
+ var css_248z$o = css`:host([size=sm]) .modal-panel{max-width:var(--sgds-dimension-480)}:host([size=md]) .modal-panel{max-width:var(--sgds-dimension-640)}:host([size=lg]) .modal-panel{max-width:var(--sgds-dimension-800)}:host([size=fullscreen]) .modal-overlay{background-color:var(--sgds-surface-default)}.modal{align-items:start;bottom:0;display:flex;font-family:var(--sgds-body-font-family);justify-content:center;left:0;position:fixed;right:0;top:0;z-index:105500}.modal-panel{border-radius:var(--sgds-border-radius-md);display:flex;flex-direction:column;gap:var(--sgds-gap-2-xl);margin:var(--sgds-margin-sm) var(--sgds-margin-xs);max-height:calc(100% - var(--sgds-margin-sm) - var(--sgds-margin-sm));position:relative;width:100%}:host(:not([size=fullscreen])) .modal-panel{background-color:var(--sgds-surface-default);max-width:var(--sgds-dimension-640);padding:var(--sgds-padding-xl)}.modal-panel:focus{outline:none}.modal-content{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--sgds-gap-2-xl);min-height:0;position:relative}.modal-header__close{position:absolute;right:calc(var(--sgds-padding-md)*-1);top:calc(var(--sgds-padding-md)*-1)}@media screen and (min-width:512px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-sm)}}@media screen and (min-width:768px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-md);max-height:calc(100% - var(--sgds-margin-md) - var(--sgds-margin-md))}}@media screen and (min-width:1024px){:host([size=fullscreen]) .modal-panel{margin:var(--sgds-margin-xl) var(--sgds-margin-xs);max-height:calc(100% - var(--sgds-margin-xl) - var(--sgds-margin-xl));max-width:var(--sgds-dimension-896)}}@media screen and (min-width:1280px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1176)}}@media screen and (min-width:1440px){:host([size=fullscreen]) .modal-panel{max-width:var(--sgds-dimension-1320)}}.modal.show .modal-panel{opacity:1;transform:none}.modal-header{display:flex;flex:0 0 auto;flex-direction:row;justify-content:space-between;max-width:var(--sgds-dimension-872)}.modal-header__title-description{display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}:host([size=fullscreen]) .modal-header__title-description{gap:var(--sgds-gap-md)}slot[name=title]::slotted(*){--sgds-margin-2-xs:var(--sgds-margin-none);--sgds-margin-xs:var(--sgds-margin-none);--sgds-font-size-6:var(--sgds-font-size-4);align-items:center;display:flex;flex:1 1 auto;font-size:var(--sgds-font-size-6,--sgds-font-size-4);gap:1rem;line-height:var(--sgds-line-height-heading);margin:var(--sgds-margin-none,var(--sgds-margin-xs,--sgds-margin-2-xs))}slot[name=description]::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none);color:var(--sgds-color-subtle);line-height:var(--sgds-line-height-body);margin:var(--sgds-margin-none,--sgds-paragraph-spacing-xl)}.modal-body{-webkit-overflow-scrolling:touch;flex:1 1 auto;overflow:auto}.modal-body slot::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none)}.modal-footer{display:flex;flex:0 0 auto;flex-wrap:wrap;gap:var(--sgds-gap-md);justify-content:flex-end;padding-top:var(--sgds-padding-md)}.modal:not(.has-footer) .modal-footer{display:none}.modal-overlay{background-color:var(--sgds-bg-overlay);bottom:0;left:0;position:fixed;right:0;top:0}[hidden]{display:none}`;
27247
27242
 
27248
27243
  /**
27249
27244
  * @summary The modal component inform users about a specific task and may contain critical information which users then have to make a decision.
@@ -27308,7 +27303,7 @@
27308
27303
  return;
27309
27304
  if (buttonElements.length <= 1)
27310
27305
  return;
27311
- if (panelWidth < 512 || (this.size === "fullscreen" && panelWidth < 768)) {
27306
+ if (panelWidth < SM_BREAKPOINT || (this.size === "fullscreen" && panelWidth < MD_BREAKPOINT)) {
27312
27307
  buttonElements.forEach(buttonElement => {
27313
27308
  const button = buttonElement;
27314
27309
  button.fullWidth = true;
@@ -29405,11 +29400,10 @@
29405
29400
  watch("activeStep", { waitUntilFirstUpdate: true })
29406
29401
  ], SgdsStepper.prototype, "_handleActiveStepChange", null);
29407
29402
 
29408
- var css_248z$b = css`:host{display:block;position:sticky;top:0;z-index:1000}nav{background-color:var(--sgds-surface-default);border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);width:100%}.subnav{flex-direction:column;flex-wrap:nowrap}.header-container,.subnav{align-items:flex-start;display:flex}.header-container{gap:var(--sgds-gap-md);padding:var(--sgds-padding-md) var(--sgds-padding-lg);width:100%}slot[name=header]::slotted(*){--sgds-margin-3-xs:var(--sgds-margin-none);flex:1 1 auto;margin-bottom:var(--sgds-margin-3-xs,--sgds-margin-none);padding-top:var(--sgds-padding-none)}.subnav-toggler{cursor:pointer;transition:transform .2s ease-in-out}.subnav-toggler:focus,.subnav-toggler:focus-visible{box-shadow:var(--sgds-box-shadow-focus);outline:0}.subnav:not(.collapsed) .subnav-toggler{transform:rotate(-180deg)}.subnav-nav-group{display:flex;flex:1 1 0}.subnav-nav,.subnav-nav-group{align-items:flex-start;flex-direction:column;width:100%}.subnav-nav{display:none;overflow-y:auto;transition:transform .2s ease-in-out}.subnav-nav ::slotted(*){width:100%}.subnav-actions{bottom:0;display:flex;flex-direction:column;gap:var(--sgds-gap-md);padding:var(--sgds-padding-md) var(--sgds-padding-lg);position:sticky;width:100%}slot[name=actions]::slotted(*){width:100%}@media screen and (max-width:1023px){.subnav.sgds-container{max-width:inherit}}@media screen and (min-width:512px){.subnav-actions{flex-direction:row}}@media screen and (min-width:768px){nav{border-bottom:var(--sgds-border-width-0)}.subnav{flex-direction:row}.subnav.collapsed{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted)}.header-container{padding:var(--sgds-padding-lg) var(--sgds-padding-2-xl)}.subnav-nav{background-color:var(--sgds-surface-default);border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);left:0;position:absolute;top:100%}.subnav-actions{align-items:center;flex-direction:row;padding:var(--sgds-padding-sm) var(--sgds-padding-2-xl) var(--sgds-padding-sm) var(--sgds-padding-none);position:inherit}}@media screen and (min-width:1024px){nav{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);position:inherit}.subnav{flex-wrap:wrap;gap:var(--sgds-gap-xl);row-gap:var(--sgds-gap-none)}.subnav.collapsed{border-bottom:var(--sgds-border-width-0)}.header-container{flex:1;padding:var(--sgds-padding-none);width:auto}slot[name=header]::slotted(*){padding-top:var(--sgds-padding-lg);white-space:nowrap}.subnav-nav-group{align-items:center;flex:inherit;flex-direction:row;flex-wrap:wrap;gap:var(--sgds-gap-xl);justify-content:space-between;row-gap:var(--sgds-gap-none);width:auto}.subnav-nav{align-items:center;background-color:inherit;border-bottom:var(--sgds-border-width-0);display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--sgds-gap-lg);overflow-y:inherit;position:inherit;row-gap:0;transition:none;width:auto}.subnav-nav ::slotted(*){width:inherit}.subnav-toggler{display:none}.subnav-actions{padding:var(--sgds-padding-sm) var(--sgds-padding-none);width:auto}slot[name=actions]::slotted(*){width:inherit}}`;
29403
+ var css_248z$b = css`:host{display:block;position:sticky;top:0;z-index:1000}nav{background-color:var(--sgds-surface-default);border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted)}nav.mobile{border-bottom:none;position:absolute;width:100%}.subnav{align-items:flex-start;display:flex;flex-wrap:wrap;gap:var(--sgds-gap-xl);row-gap:var(--sgds-gap-none)}.subnav.mobile{flex-wrap:nowrap;gap:var(--sgds-gap-md);padding:var(--sgds-padding-md) var(--sgds-padding-lg)}slot[name=header]::slotted(*){--sgds-margin-3-xs:var(--sgds-margin-none);flex:1 1 auto;margin-bottom:var(--sgds-margin-3-xs,--sgds-margin-none);padding-top:var(--sgds-padding-lg)}.subnav.mobile slot[name=header]::slotted(*){padding-top:var(--sgds-padding-none)}.subnav-nav-group{flex:1 1 0;gap:var(--sgds-gap-xl);justify-content:space-between}.subnav-nav,.subnav-nav-group{align-items:center;display:flex}.subnav-nav{gap:var(--sgds-gap-lg)}.subnav-nav-mobile{display:flex;flex-direction:column;overflow-y:auto;transition:transform .2s ease-in-out}.subnav-actions{align-items:center;display:flex;gap:var(--sgds-gap-md)}.subnav-toggler{cursor:pointer;transition:transform .2s ease-in-out}.subnav:not(.collapsed) .subnav-toggler{transform:rotate(-180deg)}.subnav-dropdown{background-color:var(--sgds-surface-default);border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);width:100%}.subnav-actions-mobile{bottom:0;display:flex;flex-direction:column;gap:var(--sgds-gap-md);padding:var(--sgds-padding-md) var(--sgds-padding-lg);position:sticky}.hidden{display:none}`;
29409
29404
 
29410
29405
  var css_248z$a = css`.sgds-container{margin-left:auto;margin-right:auto;max-width:calc(100% - 40px);width:100%}.sgds-grid{display:grid;gap:var(--sgds-gap-md);grid-template-columns:repeat(4,1fr)}.sgds-col-1{grid-column:span 1}.sgds-col-2{grid-column:span 2}.sgds-col-3{grid-column:span 3}.sgds-col-4{grid-column:span 4}.sgds-col-center-2{grid-column:2/span 2}.sgds-col-none{display:none}@media (min-width:512px){.sgds-grid{grid-template-columns:repeat(8,1fr)}.sgds-container{max-width:calc(100% - 48px)}.sgds-col-sm-1{grid-column:span 1}.sgds-col-sm-2{grid-column:span 2}.sgds-col-sm-3{grid-column:span 3}.sgds-col-sm-4{grid-column:span 4}.sgds-col-sm-5{grid-column:span 5}.sgds-col-sm-6{grid-column:span 6}.sgds-col-sm-7{grid-column:span 7}.sgds-col-sm-8{grid-column:span 8}.sgds-col-sm-center-2{grid-column:4/span 2}.sgds-col-sm-center-4{grid-column:3/span 4}.sgds-col-sm-center-6{grid-column:2/span 6}.sgds-col-none{display:revert}.sgds-col-sm-none{display:none}}@media (min-width:768px){.sgds-container{max-width:calc(100% - 64px)}.sgds-col-md-1{grid-column:span 1}.sgds-col-md-2{grid-column:span 2}.sgds-col-md-3{grid-column:span 3}.sgds-col-md-4{grid-column:span 4}.sgds-col-md-5{grid-column:span 5}.sgds-col-md-6{grid-column:span 6}.sgds-col-md-7{grid-column:span 7}.sgds-col-md-8{grid-column:span 8}.sgds-col-md-center-2{grid-column:4/span 2}.sgds-col-md-center-4{grid-column:3/span 4}.sgds-col-md-center-6{grid-column:2/span 6}.sgds-col-sm-none{display:revert}.sgds-col-md-none{display:none}}@media (min-width:1024px){.sgds-grid{grid-template-columns:repeat(12,1fr)}.sgds-container{max-width:896px}.sgds-col-lg-1{grid-column:span 1}.sgds-col-lg-2{grid-column:span 2}.sgds-col-lg-3{grid-column:span 3}.sgds-col-lg-4{grid-column:span 4}.sgds-col-lg-5{grid-column:span 5}.sgds-col-lg-6{grid-column:span 6}.sgds-col-lg-7{grid-column:span 7}.sgds-col-lg-8{grid-column:span 8}.sgds-col-lg-9{grid-column:span 9}.sgds-col-lg-10{grid-column:span 10}.sgds-col-lg-11{grid-column:span 11}.sgds-col-lg-12{grid-column:span 12}.sgds-col-lg-center-2{grid-column:6/span 2}.sgds-col-lg-center-4{grid-column:5/span 4}.sgds-col-lg-center-6{grid-column:4/span 6}.sgds-col-lg-center-8{grid-column:3/span 8}.sgds-col-lg-center-10{grid-column:2/span 10}.sgds-col-md-none{display:revert}.sgds-col-lg-none{display:none}}@media (min-width:1280px){.sgds-grid{gap:var(--sgds-gap-xl)}.sgds-container{max-width:1176px}.sgds-col-xl-1{grid-column:span 1}.sgds-col-xl-2{grid-column:span 2}.sgds-col-xl-3{grid-column:span 3}.sgds-col-xl-4{grid-column:span 4}.sgds-col-xl-5{grid-column:span 5}.sgds-col-xl-6{grid-column:span 6}.sgds-col-xl-7{grid-column:span 7}.sgds-col-xl-8{grid-column:span 8}.sgds-col-xl-9{grid-column:span 9}.sgds-col-xl-10{grid-column:span 10}.sgds-col-xl-11{grid-column:span 11}.sgds-col-xl-12{grid-column:span 12}.sgds-col-xl-center-2{grid-column:6/span 2}.sgds-col-xl-center-4{grid-column:5/span 4}.sgds-col-xl-center-6{grid-column:4/span 6}.sgds-col-xl-center-8{grid-column:3/span 8}.sgds-col-xl-center-10{grid-column:2/span 10}.sgds-col-lg-none{display:revert}.sgds-col-xl-none{display:none}}@media (min-width:1440px){.sgds-container{max-width:1320px}.sgds-col-2-xl-1{grid-column:span 1}.sgds-col-2-xl-2{grid-column:span 2}.sgds-col-2-xl-3{grid-column:span 3}.sgds-col-2-xl-4{grid-column:span 4}.sgds-col-2-xl-5{grid-column:span 5}.sgds-col-2-xl-6{grid-column:span 6}.sgds-col-2-xl-7{grid-column:span 7}.sgds-col-2-xl-8{grid-column:span 8}.sgds-col-2-xl-9{grid-column:span 9}.sgds-col-2-xl-10{grid-column:span 10}.sgds-col-2-xl-11{grid-column:span 11}.sgds-col-2-xl-12{grid-column:span 12}.sgds-col-2-xl-center-2{grid-column:6/span 2}.sgds-col-2-xl-center-4{grid-column:5/span 4}.sgds-col-2-xl-center-6{grid-column:4/span 6}.sgds-col-2-xl-center-8{grid-column:3/span 8}.sgds-col-2-xl-center-10{grid-column:2/span 10}.sgds-col-xl-none{display:revert}.sgds-col-2-xl-none{display:none}}`;
29411
29406
 
29412
- const VALID_KEYS = ["Enter", " "];
29413
29407
  /**
29414
29408
  * @summary This component provides secondary navigation within a specific section or page. It typically appears below the main navigation and offers context-specific links or actions to help users explore related content.
29415
29409
  *
@@ -29426,34 +29420,40 @@
29426
29420
  class SgdsSubnav extends SgdsElement {
29427
29421
  constructor() {
29428
29422
  super(...arguments);
29429
- this.isCollapsed = false;
29423
+ this.isCollapsed = window.innerWidth < LG_BREAKPOINT;
29430
29424
  this.isMenuOpen = false;
29431
- this._handleResize = async () => {
29425
+ this._handleResize = () => {
29432
29426
  this.isCollapsed = window.innerWidth < LG_BREAKPOINT;
29433
- await this.updateComplete;
29434
29427
  if (!this.isCollapsed) {
29435
29428
  this.isMenuOpen = false;
29436
29429
  }
29437
29430
  this._updateMobileLayout();
29438
29431
  };
29439
29432
  this._updateMobileLayout = () => {
29440
- if (!this.nav || !this.headerContainer || !this.mobileActions || !this.mobileNav)
29433
+ var _a;
29434
+ if (!this.nav || !this.subnav || !this.mobileActions || !this.mobileNav)
29441
29435
  return;
29436
+ const actionsSlot = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot[name="actions"]');
29442
29437
  if (this.isCollapsed) {
29438
+ const subnavHeight = this.nav.clientHeight;
29443
29439
  const { top: subnavTop } = this.nav.getBoundingClientRect();
29444
- const headerHeight = this.headerContainer.clientHeight;
29440
+ const headerHeight = this.subnav.clientHeight;
29445
29441
  const actionsButtonHeight = this.mobileActions.clientHeight;
29446
- const offset = window.innerWidth >= MD_BREAKPOINT && window.innerWidth < LG_BREAKPOINT
29447
- ? subnavTop + headerHeight
29448
- : subnavTop + headerHeight + actionsButtonHeight;
29442
+ const offset = subnavTop + headerHeight + actionsButtonHeight;
29449
29443
  this.mobileNav.style.maxHeight = `calc(100dvh - ${offset}px)`;
29450
- this.style.minHeight = `${this.nav.clientHeight}px`;
29451
- this.nav.style.position = "absolute";
29444
+ this.style.minHeight = `${subnavHeight}px`;
29445
+ if (actionsSlot) {
29446
+ const buttons = actionsSlot.assignedElements({ flatten: true });
29447
+ buttons.forEach(el => el.setAttribute("fullWidth", "true"));
29448
+ }
29452
29449
  }
29453
29450
  else {
29454
29451
  this.mobileNav.style.maxHeight = "none";
29455
29452
  this.style.minHeight = "auto";
29456
- this.nav.style.position = "relative";
29453
+ if (actionsSlot) {
29454
+ const buttons = actionsSlot.assignedElements({ flatten: true });
29455
+ buttons.forEach(el => el.removeAttribute("isCollapsed"));
29456
+ }
29457
29457
  }
29458
29458
  };
29459
29459
  this._toggleMenu = () => {
@@ -29470,29 +29470,38 @@
29470
29470
  }
29471
29471
  connectedCallback() {
29472
29472
  super.connectedCallback();
29473
- // this._handleResize();
29473
+ this._handleResize();
29474
29474
  window.addEventListener("resize", this._handleResize);
29475
- window.addEventListener("click", (event) => this._handleClickOutOfElement(event, this.navGroup));
29475
+ window.addEventListener("click", (event) => this._handleClickOutOfElement(event, this.body));
29476
29476
  }
29477
29477
  disconnectedCallback() {
29478
29478
  super.disconnectedCallback();
29479
29479
  window.removeEventListener("resize", this._handleResize);
29480
- window.removeEventListener("click", (event) => this._handleClickOutOfElement(event, this.navGroup));
29480
+ window.removeEventListener("click", (event) => this._handleClickOutOfElement(event, this.body));
29481
29481
  }
29482
29482
  firstUpdated() {
29483
- this._handleResize();
29483
+ requestAnimationFrame(() => {
29484
+ this._updateMobileLayout();
29485
+ });
29486
+ }
29487
+ _handleSlotChange(e) {
29488
+ const childElements = e.target.assignedElements({ flatten: true });
29489
+ if (this.isCollapsed) {
29490
+ childElements.forEach(element => {
29491
+ element.setAttribute("isCollapsed", `${this.isCollapsed}`);
29492
+ });
29493
+ }
29494
+ else {
29495
+ childElements.forEach(element => {
29496
+ element.removeAttribute("isCollapsed");
29497
+ });
29498
+ }
29484
29499
  }
29485
29500
  _handleClickOutOfElement(e, self) {
29486
29501
  if (!e.composedPath().includes(self) && !e.composedPath().includes(this.toggler)) {
29487
29502
  this.hide();
29488
29503
  }
29489
29504
  }
29490
- async _onKeyboardToggle(event) {
29491
- if (!VALID_KEYS.includes(event.key))
29492
- return;
29493
- event.preventDefault();
29494
- this._toggleMenu();
29495
- }
29496
29505
  /** Shows the menu. For when subnav is in the collapsed form */
29497
29506
  async show() {
29498
29507
  if (this.isMenuOpen) {
@@ -29517,11 +29526,10 @@
29517
29526
  return;
29518
29527
  }
29519
29528
  await stopAnimations(this.mobileNav);
29520
- if (this.isCollapsed) {
29521
- this.mobileNav.style.display = "flex";
29522
- }
29529
+ this.mobileNav.classList.remove("hidden");
29523
29530
  const { keyframes, options } = getAnimation(this, "subnav.show");
29524
29531
  await animateTo(this.mobileNav, shimKeyframesHeightAuto(keyframes, this.mobileNav.scrollHeight), options);
29532
+ // this.mobileNav.style.height = "auto";
29525
29533
  this.emit("sgds-after-show");
29526
29534
  }
29527
29535
  async _animateToHide() {
@@ -29533,9 +29541,8 @@
29533
29541
  await stopAnimations(this.mobileNav);
29534
29542
  const { keyframes, options } = getAnimation(this, "subnav.hide");
29535
29543
  await animateTo(this.mobileNav, shimKeyframesHeightAuto(keyframes, this.mobileNav.scrollHeight), options);
29536
- if (this.isCollapsed) {
29537
- this.mobileNav.style.display = "none";
29538
- }
29544
+ this.mobileNav.classList.add("hidden");
29545
+ // this.mobileNav.style.height = "auto";
29539
29546
  this.emit("sgds-after-hide");
29540
29547
  }
29541
29548
  async handleOpenChange() {
@@ -29548,41 +29555,61 @@
29548
29555
  this._animateToHide();
29549
29556
  }
29550
29557
  }
29551
- async handleCollapsedChange() {
29552
- await this.updateComplete;
29553
- this.mobileNav.style.display = this.isCollapsed ? "none" : "flex";
29554
- }
29555
29558
  render() {
29559
+ const isHydrated = this.hasUpdated;
29556
29560
  return html$1 `
29557
- <nav aria-label="Sub navigation">
29561
+ <nav
29562
+ class=${classMap({
29563
+ mobile: this.isCollapsed
29564
+ })}
29565
+ aria-label="Sub navigation"
29566
+ >
29558
29567
  <div
29559
29568
  class=${classMap({
29560
- "sgds-container": true,
29569
+ "sgds-container": !this.isCollapsed,
29561
29570
  subnav: true,
29571
+ mobile: this.isCollapsed,
29562
29572
  collapsed: !this.isMenuOpen
29563
29573
  })}
29564
29574
  >
29565
- <div class="header-container">
29566
- <slot name="header"></slot>
29567
- <sgds-icon
29568
- class="subnav-toggler"
29569
- name="chevron-down"
29570
- tabindex="0"
29571
- @click=${this._toggleMenu}
29572
- @keydown=${this._onKeyboardToggle}
29573
- aria-label="Toggle sub navigation"
29574
- aria-expanded=${this.isMenuOpen}
29575
- ></sgds-icon>
29576
- </div>
29577
- <div class="subnav-nav-group">
29578
- <div class="subnav-nav">
29579
- <slot></slot>
29580
- </div>
29581
- <div class="subnav-actions">
29582
- <slot name="actions"></slot>
29583
- </div>
29584
- </div>
29575
+ <slot name="header"></slot>
29576
+ ${this.isCollapsed
29577
+ ? html$1 `
29578
+ <sgds-icon
29579
+ class="subnav-toggler"
29580
+ name="chevron-down"
29581
+ @click=${this._toggleMenu}
29582
+ aria-label="Toggle sub navigation"
29583
+ ></sgds-icon>
29584
+ `
29585
+ : html$1 `
29586
+ <div class="subnav-nav-group">
29587
+ <div class="subnav-nav">
29588
+ <slot @slotchange="${this._handleSlotChange}"></slot>
29589
+ </div>
29590
+ <div class="subnav-actions">
29591
+ <slot name="actions"></slot>
29592
+ </div>
29593
+ </div>
29594
+ `}
29585
29595
  </div>
29596
+ ${this.isCollapsed
29597
+ ? html$1 `
29598
+ <div class="subnav-dropdown">
29599
+ <div
29600
+ class=${classMap({
29601
+ "subnav-nav-mobile": true,
29602
+ hidden: !this.isMenuOpen && !isHydrated
29603
+ })}
29604
+ >
29605
+ <slot @slotchange="${this._handleSlotChange}"></slot>
29606
+ </div>
29607
+ <div class="subnav-actions-mobile">
29608
+ <slot name="actions"></slot>
29609
+ </div>
29610
+ </div>
29611
+ `
29612
+ : nothing}
29586
29613
  </nav>
29587
29614
  `;
29588
29615
  }
@@ -29596,19 +29623,19 @@
29596
29623
  query("nav")
29597
29624
  ], SgdsSubnav.prototype, "nav", void 0);
29598
29625
  __decorate([
29599
- query(".subnav-nav")
29600
- ], SgdsSubnav.prototype, "mobileNav", void 0);
29626
+ query(".subnav")
29627
+ ], SgdsSubnav.prototype, "subnav", void 0);
29601
29628
  __decorate([
29602
- query(".header-container")
29603
- ], SgdsSubnav.prototype, "headerContainer", void 0);
29629
+ query(".subnav-nav-mobile")
29630
+ ], SgdsSubnav.prototype, "mobileNav", void 0);
29604
29631
  __decorate([
29605
29632
  query(".subnav-toggler")
29606
29633
  ], SgdsSubnav.prototype, "toggler", void 0);
29607
29634
  __decorate([
29608
- query(".subnav-nav-group")
29609
- ], SgdsSubnav.prototype, "navGroup", void 0);
29635
+ query(".subnav-dropdown")
29636
+ ], SgdsSubnav.prototype, "body", void 0);
29610
29637
  __decorate([
29611
- query(".subnav-actions")
29638
+ query(".subnav-actions-mobile")
29612
29639
  ], SgdsSubnav.prototype, "mobileActions", void 0);
29613
29640
  __decorate([
29614
29641
  state()
@@ -29619,9 +29646,6 @@
29619
29646
  __decorate([
29620
29647
  watch("isMenuOpen", { waitUntilFirstUpdate: true })
29621
29648
  ], SgdsSubnav.prototype, "handleOpenChange", null);
29622
- __decorate([
29623
- watch("isCollapsed", { waitUntilFirstUpdate: true })
29624
- ], SgdsSubnav.prototype, "handleCollapsedChange", null);
29625
29649
  setDefaultAnimation("subnav.show", {
29626
29650
  keyframes: [
29627
29651
  { height: "0", opacity: "0" },
@@ -30122,12 +30146,10 @@
30122
30146
  watch("active")
30123
30147
  ], SgdsTabPanel.prototype, "_handleActiveChange", null);
30124
30148
 
30125
- var css_248z$5 = css`tbody,td,th,thead,tr{border:var(--sgds-border-width-0) solid;border-color:inherit}th{text-align:-webkit-match-parent}table{border-collapse:collapse;caption-side:bottom}.table{border-color:var(--sgds-border-color-default);vertical-align:top;width:100%}.table>:not(caption) td,.table>:not(caption) th{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);padding:var(--sgds-padding-lg)}.table>tbody{vertical-align:inherit}.table>thead{vertical-align:bottom}.table>thead th{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-emphasis)}.table-group-divider{border-top:calc(var(--sgds-border-width)*2) solid}.table>:not(:first-child){border-top:var(--sgds-border-width-1) solid var(--sgds-border-color-emphasis)}.table-responsive{-webkit-overflow-scrolling:touch;overflow-x:auto}td>.row{display:flex;gap:var(--sgds-font-size-1)}@media (max-width:575.98px){.table-responsive-sm{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:767.98px){.table-responsive-md{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:991.98px){.table-responsive-lg{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:1199.98px){.table-responsive-xl{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:1399.98px){.table-responsive-xxl{-webkit-overflow-scrolling:touch;overflow-x:auto}}`;
30149
+ var css_248z$5 = css`tbody,td,th,thead,tr{border:var(--sgds-border-width-0) solid;border-color:inherit}th{text-align:-webkit-match-parent}table{border-collapse:collapse;caption-side:bottom}.table{border-color:var(--sgds-border-color-default);vertical-align:top;width:100%}.table>:not(caption) td,.table>:not(caption) th{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);padding:var(--sgds-padding-lg)}.table>tbody{vertical-align:inherit}.table>thead{vertical-align:bottom}.table>thead th{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-emphasis)}.table-group-divider{border-top:calc(var(--sgds-border-width)*2) solid}.table>:not(:first-child){border-top:var(--sgds-border-width-1) solid var(--sgds-border-color-emphasis)}.table-responsive{-webkit-overflow-scrolling:touch;overflow-x:auto}@media (max-width:575.98px){.table-responsive-sm{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:767.98px){.table-responsive-md{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:991.98px){.table-responsive-lg{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:1199.98px){.table-responsive-xl{-webkit-overflow-scrolling:touch;overflow-x:auto}}@media (max-width:1399.98px){.table-responsive-xxl{-webkit-overflow-scrolling:touch;overflow-x:auto}}`;
30126
30150
 
30127
30151
  /**
30128
30152
  * @summary The use of a table is to organise a collections of data into readable rows
30129
- *
30130
- * @event sgds-table-click - Emitted when a button is clicked in the table cell. Passes a CustomeEvent <code>{target: ICellItem, row: IGeneric}</code>
30131
30153
  */
30132
30154
  class SgdsTable extends SgdsElement {
30133
30155
  constructor() {
@@ -30141,7 +30163,7 @@
30141
30163
  */
30142
30164
  this.columnHeader = [];
30143
30165
  /**
30144
- * Populate data cells using Arrays. For custom rendering of cell use <code>ICellItem</code>.
30166
+ * Populate data cells using Arrays
30145
30167
  */
30146
30168
  this.tableData = [];
30147
30169
  /**
@@ -30155,112 +30177,52 @@
30155
30177
  super.connectedCallback();
30156
30178
  this.originalTableData = [...this.tableData];
30157
30179
  }
30158
- _handleClick(e, cell, row) {
30159
- const eventName = `sgds-table-click`;
30160
- const customClickEvent = this.emit(eventName, {
30161
- detail: {
30162
- target: cell,
30163
- row
30164
- },
30165
- cancelable: true
30166
- });
30167
- if (customClickEvent.defaultPrevented)
30168
- return;
30169
- e.preventDefault();
30170
- }
30171
- _mapElementType(cell, row) {
30172
- var _a, _b;
30173
- const val = cell === null || cell === void 0 ? void 0 : cell.value;
30174
- switch (cell === null || cell === void 0 ? void 0 : cell.type) {
30175
- case "link":
30176
- return html$1 `
30177
- <sgds-link slot="link" id="${cell.id}">
30178
- <a href="${(_a = cell.href) !== null && _a !== void 0 ? _a : "#"}" @click=${(e) => this._handleClick(e, cell, row)}>${val}</a>
30179
- </sgds-link>
30180
- `;
30181
- case "button":
30182
- return html$1 `
30183
- <sgds-button
30184
- id="${cell.id}"
30185
- .fullWidth=${cell.fullWidth}
30186
- variant=${cell.variant}
30187
- size=${(_b = cell.size) !== null && _b !== void 0 ? _b : "sm"}
30188
- .active=${cell.active}
30189
- .disabled=${cell.disabled}
30190
- href=${cell.href}
30191
- target=${cell.target}
30192
- download=${cell.download}
30193
- ariaLabel=${cell.ariaLabel}
30194
- @click=${(e) => this._handleClick(e, cell, row)}
30195
- >
30196
- ${val}
30197
- </sgds-button>
30198
- `;
30199
- case "icon-button":
30200
- return html$1 `
30201
- <sgds-icon-button
30202
- id="${cell.id}"
30203
- name=${cell.value}
30204
- variant=${cell.variant}
30205
- outlined=${cell.outlined}
30206
- @click=${(e) => this._handleClick(e, cell, row)}
30207
- >
30208
- </sgds-icon-button>
30209
- `;
30210
- case "badge":
30211
- return html$1 `
30212
- <sgds-badge
30213
- id="${cell.id}"
30214
- variant=${cell.variant}
30215
- outlined=${cell.outlined}
30216
- >
30217
- ${val}
30218
- </sgds-button>
30180
+ _renderTable() {
30181
+ if (this.headerPosition === "horizontal") {
30182
+ return html$1 `
30183
+ <thead>
30184
+ <tr>
30185
+ ${this.rowHeader.map((header, index) => html$1 ` <th>${header}</th> `)}
30186
+ </tr>
30187
+ </thead>
30188
+ <tbody>
30189
+ ${this.tableData.map(row => html$1 `
30190
+ <tr>
30191
+ ${row.map((cell) => html$1 `<td>${cell}</td>`)}
30192
+ </tr>
30193
+ `)}
30194
+ </tbody>
30219
30195
  `;
30220
- default:
30221
- return val;
30222
30196
  }
30223
- }
30224
- _renderRowData(row) {
30225
- return this.rowHeader.map((header) => {
30226
- const cellValue = row[header.key];
30227
- let ele = cellValue;
30228
- if (typeof cellValue !== "string" && typeof cellValue !== "number") {
30229
- if (Array.isArray(cellValue)) {
30230
- // when there is multiple items
30231
- ele = html$1 `<div class='row'>${cellValue.map(item => this._mapElementType(item, row))}</dive>`;
30232
- }
30233
- else {
30234
- // If provided is object
30235
- ele = html$1 `${this._mapElementType(cellValue, row)}`;
30236
- }
30237
- }
30238
- return header.key ? html$1 `<td>${ele === "" || !ele ? "-" : ele}</td>` : "";
30239
- });
30240
- }
30241
- _renderHeader() {
30242
- return this.rowHeader.map(({ value }) => {
30243
- return html$1 ` <th>${value}</th> `;
30244
- });
30245
- }
30246
- _renderTable() {
30247
- return html$1 `
30248
- ${this.headerPosition != "vertical"
30249
- ? html$1 `<thead>
30250
- <tr>
30251
- ${this._renderHeader()}
30252
- </tr>
30253
- </thead> `
30254
- : ""}
30255
- <tbody>
30256
- ${this.tableData.map((row, index) => html$1 `
30197
+ if (this.headerPosition === "both") {
30198
+ return html$1 `
30199
+ <thead>
30200
+ <tr>
30201
+ <th></th>
30202
+ ${this.rowHeader.map((header, index) => html$1 ` <th>${header}</th> `)}
30203
+ </tr>
30204
+ </thead>
30205
+ <tbody>
30206
+ ${this.tableData.map((row, index) => html$1 `
30207
+ <tr>
30208
+ <th>${this.columnHeader[index]}</th>
30209
+ ${row.map((cell) => html$1 `<td>${cell}</td>`)}
30210
+ </tr>
30211
+ `)}
30212
+ </tbody>
30213
+ `;
30214
+ }
30215
+ if (this.headerPosition === "vertical") {
30216
+ const flippedTableData = this.tableData[0].map((_, colIndex) => this.tableData.map(row => row[colIndex]));
30217
+ return html$1 `
30218
+ ${flippedTableData.map((row, index) => html$1 `
30257
30219
  <tr>
30258
- ${this.headerPosition !== "horizontal" ? html$1 `<th>${this.columnHeader[index]}</th>` : ""}
30259
- ${this._renderRowData(row)}
30220
+ <th>${this.columnHeader[index]}</th>
30221
+ ${row.map((cell) => html$1 `<td>${cell}</td>`)}
30260
30222
  </tr>
30261
30223
  `)}
30262
- </tbody>
30263
- `;
30224
+ `;
30225
+ }
30264
30226
  }
30265
30227
  render() {
30266
30228
  return html$1 `