dash-button-web 0.0.23 → 0.0.24

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 (32) hide show
  1. package/dist/cjs/dash-button.cjs.entry.js +74 -31
  2. package/dist/cjs/dash-button.cjs.entry.js.map +1 -1
  3. package/dist/cjs/{index-87d4993d.js → index-bc7ebbee.js} +25 -1
  4. package/dist/cjs/index-bc7ebbee.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/web-compnont.cjs.js +2 -2
  7. package/dist/collection/components/my-component/dash-button.css +224 -0
  8. package/dist/collection/components/my-component/dash-button.js +75 -31
  9. package/dist/collection/components/my-component/dash-button.js.map +1 -1
  10. package/dist/components/dash-button.js +75 -31
  11. package/dist/components/dash-button.js.map +1 -1
  12. package/dist/esm/dash-button.entry.js +74 -31
  13. package/dist/esm/dash-button.entry.js.map +1 -1
  14. package/dist/esm/{index-e3df5eaf.js → index-51aa24d3.js} +25 -1
  15. package/dist/esm/index-51aa24d3.js.map +1 -0
  16. package/dist/esm/loader.js +3 -3
  17. package/dist/esm/web-compnont.js +3 -3
  18. package/dist/types/components/my-component/dash-button.d.ts +17 -2
  19. package/dist/types/components.d.ts +1 -1
  20. package/dist/web-compnont/p-06623215.js +3 -0
  21. package/dist/web-compnont/p-06623215.js.map +1 -0
  22. package/dist/web-compnont/{p-2e8505f3.entry.js → p-55f91c48.entry.js} +3 -3
  23. package/dist/web-compnont/p-55f91c48.entry.js.map +1 -0
  24. package/dist/web-compnont/web-compnont.esm.js +1 -1
  25. package/dist/web-compnont/web-compnont.esm.js.map +1 -1
  26. package/package.json +1 -1
  27. package/readme.md +18 -0
  28. package/dist/cjs/index-87d4993d.js.map +0 -1
  29. package/dist/esm/index-e3df5eaf.js.map +0 -1
  30. package/dist/web-compnont/p-2e8505f3.entry.js.map +0 -1
  31. package/dist/web-compnont/p-c1ec12fe.js +0 -3
  32. package/dist/web-compnont/p-c1ec12fe.js.map +0 -1
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-87d4993d.js');
5
+ const index = require('./index-bc7ebbee.js');
6
6
 
7
7
  const defineCustomElements = (win, options) => {
8
8
  if (typeof window === 'undefined') return undefined;
9
- return index.bootstrapLazy([["dash-button.cjs",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"portalApiUrl":[1,"portal-api-url"],"plmUrl":[1,"plm-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"avatarSvg":[32],"isLoading":[32],"config":[32],"localMenuLinks":[32],"organizationUrl":[32],"isRestricted":[32]}]]]], options);
9
+ return index.bootstrapLazy([["dash-button.cjs",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"portalApiUrl":[1,"portal-api-url"],"plmUrl":[1,"plm-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"avatarSvg":[32],"isLoading":[32],"config":[32],"localMenuLinks":[32],"organizationUrl":[32],"isRestricted":[32],"collapsedModuleSection":[32]}]]]], options);
10
10
  };
11
11
 
12
12
  exports.setNonce = index.setNonce;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-87d4993d.js');
5
+ const index = require('./index-bc7ebbee.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Browser v4.12.0 | MIT Licensed | https://stenciljs.com
@@ -17,7 +17,7 @@ const patchBrowser = () => {
17
17
  };
18
18
 
19
19
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["dash-button.cjs",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"portalApiUrl":[1,"portal-api-url"],"plmUrl":[1,"plm-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"avatarSvg":[32],"isLoading":[32],"config":[32],"localMenuLinks":[32],"organizationUrl":[32],"isRestricted":[32]}]]]], options);
20
+ return index.bootstrapLazy([["dash-button.cjs",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"portalApiUrl":[1,"portal-api-url"],"plmUrl":[1,"plm-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"avatarSvg":[32],"isLoading":[32],"config":[32],"localMenuLinks":[32],"organizationUrl":[32],"isRestricted":[32],"collapsedModuleSection":[32]}]]]], options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;
@@ -568,3 +568,227 @@ hr.solid {
568
568
  transform: translateY(0);
569
569
  }
570
570
  }
571
+
572
+
573
+ /*
574
+ Styles for the new "Applications" / "Modules" sections and the
575
+ icon-only Portal + Logout buttons now living in the profile header. */
576
+
577
+ /* Add these rules to your existing .dropdown-user-profile block
578
+ (keep whatever padding/border-bottom it already has) so the name
579
+ and the icon buttons sit on one row. */
580
+ .dropdown-user-profile {
581
+ display: flex;
582
+ align-items: center;
583
+ justify-content: space-between;
584
+ gap: 12px;
585
+ }
586
+
587
+ .user-profile-info {
588
+ min-width: 0;
589
+ overflow: hidden;
590
+ }
591
+
592
+ .user-profile-info .username,
593
+ .user-profile-info .first-last-name {
594
+ white-space: nowrap;
595
+ overflow: hidden;
596
+ text-overflow: ellipsis;
597
+ }
598
+
599
+ .user-profile-actions {
600
+ display: flex;
601
+ align-items: center;
602
+ gap: 8px;
603
+ flex-shrink: 0;
604
+ }
605
+
606
+ /* Section header row: icon chip + title + item-count badge on the left,
607
+ a circular chevron toggle on the right. Clickable to collapse/expand
608
+ Global Modules and Local Modules independently. Taller and more
609
+ deliberately styled than a plain label, with its own hover state and
610
+ a bottom divider so it reads as a distinct toolbar, not just text. */
611
+ .menu-section-header {
612
+ display: flex;
613
+ align-items: center;
614
+ justify-content: space-between;
615
+ gap: 10px;
616
+ padding: 12px 16px;
617
+ cursor: pointer;
618
+ user-select: none;
619
+ }
620
+
621
+ /* Same hover treatment as the regular dropdown items below it, so the
622
+ header reads as part of the same list rather than a separate card. */
623
+ .menu-section-header:hover {
624
+ background-color: #f1f1f1;
625
+ }
626
+
627
+ .menu-section-header-left {
628
+ display: flex;
629
+ align-items: center;
630
+ gap: 8px;
631
+ min-width: 0;
632
+ }
633
+
634
+ .menu-section-icon {
635
+ display: inline-flex;
636
+ align-items: center;
637
+ justify-content: center;
638
+ color: #128f8b;
639
+ font-size: 12px;
640
+ flex-shrink: 0;
641
+ }
642
+
643
+ .menu-section-title {
644
+ font-size: 11px;
645
+ font-weight: 600;
646
+ letter-spacing: 0.06em;
647
+ text-transform: uppercase;
648
+ color: #9aa0a6;
649
+ white-space: nowrap;
650
+ overflow: hidden;
651
+ text-overflow: ellipsis;
652
+ }
653
+
654
+ .menu-section-count {
655
+ font-size: 10px;
656
+ font-weight: 600;
657
+ color: #9aa0a6;
658
+ }
659
+
660
+ .menu-section-chevron-btn {
661
+ display: inline-flex;
662
+ align-items: center;
663
+ justify-content: center;
664
+ color: #9aa0a6;
665
+ font-size: 10px;
666
+ flex-shrink: 0;
667
+ transition: transform 0.2s ease;
668
+ }
669
+
670
+ .menu-section-chevron-btn-collapsed {
671
+ transform: rotate(-90deg);
672
+ }
673
+
674
+ /* Keep the Global Modules list-view section from growing unbounded.
675
+ .grid-view-menu already has its own max-height/overflow rule above
676
+ (230px) — not repeated here, since this would just override it with a
677
+ different value further down the cascade. */
678
+ .dropdown-content-link {
679
+ max-height: 230px;
680
+ overflow-y: auto;
681
+ position: relative;
682
+ }
683
+
684
+ /* Local Modules list-view items get their own scroll box, separate from
685
+ the shared Global Modules container above. Its max-height is set
686
+ inline by the component (capToRowPeek in dash-button.tsx) to 2.5x the
687
+ first item's real rendered height — a plain CSS rule can't know that
688
+ height in advance, and inline styles win over this max-height anyway,
689
+ so this is just the fallback + what makes it scroll. */
690
+ .local-modules-scroll {
691
+ max-height: 260px;
692
+ overflow-y: auto;
693
+ }
694
+
695
+ /* Local Modules list-view items reuse id="applications-btn" directly
696
+ (same as Global items), so they inherit your existing row styling
697
+ as-is — no separate class/rule needed here. This is only the
698
+ disabled-state dimming, applied as an extra class on top of that id. */
699
+ .applications-btn-disabled,
700
+ .grid-view-link-disabled {
701
+ opacity: 0.45;
702
+ cursor: not-allowed;
703
+ pointer-events: none;
704
+ }
705
+
706
+ /* Icon buttons for Portal + Logout, in the profile header. Sized up from
707
+ 28px to 38px so they read clearly at a glance, not just on hover.
708
+ Tinted per action so they stand out against the plain header text. */
709
+ .footer-icon-btn {
710
+ display: inline-flex;
711
+ align-items: center;
712
+ justify-content: center;
713
+ width: 38px;
714
+ height: 38px;
715
+ border-radius: 50%;
716
+ border: none;
717
+ font-size: 17px;
718
+ cursor: pointer;
719
+ text-decoration: none;
720
+ transition: background-color 0.15s ease, transform 0.15s ease;
721
+ }
722
+
723
+ .footer-icon-btn:active {
724
+ transform: scale(0.92);
725
+ }
726
+
727
+ .footer-icon-btn-portal {
728
+ background: rgba(18, 143, 139, 0.12);
729
+ color: #128f8b;
730
+ }
731
+
732
+ .footer-icon-btn-portal:hover {
733
+ background: rgba(18, 143, 139, 0.22);
734
+ }
735
+
736
+ .footer-icon-btn-logout {
737
+ background: rgba(220, 38, 38, 0.12);
738
+ color: #dc2626;
739
+ }
740
+
741
+ .footer-icon-btn-logout:hover {
742
+ background: rgba(220, 38, 38, 0.22);
743
+ }
744
+
745
+ /* Custom tooltip (via data-tooltip) instead of the native title tooltip,
746
+ shown below the icons since they sit at the top of the dropdown. */
747
+ .footer-icon-btn[data-tooltip] {
748
+ position: relative;
749
+ }
750
+
751
+ .footer-icon-btn[data-tooltip]::after {
752
+ content: attr(data-tooltip);
753
+ position: absolute;
754
+ top: 130%;
755
+ left: 50%;
756
+ transform: translateX(-50%) translateY(-4px);
757
+ background: rgba(0, 0, 0, 0.85);
758
+ color: #fff;
759
+ padding: 4px 8px;
760
+ border-radius: 4px;
761
+ font-size: 11px;
762
+ line-height: 1.2;
763
+ white-space: nowrap;
764
+ opacity: 0;
765
+ visibility: hidden;
766
+ pointer-events: none;
767
+ transition: opacity 0.15s ease, transform 0.15s ease;
768
+ z-index: 20;
769
+ }
770
+
771
+ .footer-icon-btn[data-tooltip]::before {
772
+ content: "";
773
+ position: absolute;
774
+ top: 115%;
775
+ left: 50%;
776
+ transform: translateX(-50%);
777
+ border: 4px solid transparent;
778
+ border-bottom-color: rgba(0, 0, 0, 0.85);
779
+ opacity: 0;
780
+ visibility: hidden;
781
+ pointer-events: none;
782
+ transition: opacity 0.15s ease;
783
+ z-index: 20;
784
+ }
785
+
786
+ .footer-icon-btn[data-tooltip]:hover::after,
787
+ .footer-icon-btn[data-tooltip]:hover::before,
788
+ .footer-icon-btn[data-tooltip]:focus-visible::after,
789
+ .footer-icon-btn[data-tooltip]:focus-visible::before {
790
+ opacity: 1;
791
+ visibility: visible;
792
+ transform: translateX(-50%) translateY(0);
793
+ }
794
+
@@ -5,6 +5,21 @@ import { configService } from "../../services/config";
5
5
  import { menuService } from "../../services/menu";
6
6
  export class DashButtonComponent {
7
7
  constructor() {
8
+ this.toggleGlobalModules = () => {
9
+ this.collapsedModuleSection = this.collapsedModuleSection === 'global' ? null : 'global';
10
+ };
11
+ this.toggleLocalModules = () => {
12
+ this.collapsedModuleSection = this.collapsedModuleSection === 'local' ? null : 'local';
13
+ };
14
+ // The dropdown only becomes visible via CSS :hover (no JS "opened" event),
15
+ // and componentDidRender's measurement can run while it's still
16
+ // display:none — offsetHeight is always 0 for a hidden subtree, so that
17
+ // first measurement can permanently stick maxHeight at 0px. Re-measuring
18
+ // on mouseenter (when the dropdown is guaranteed visible) fixes it.
19
+ this.handleDropdownMouseEnter = () => {
20
+ this.capToRowPeek(this.gridLocalListEl, 2.5);
21
+ this.capToRowPeek(this.listLocalScrollEl, 2.5);
22
+ };
8
23
  this.showPostLoginText = false;
9
24
  this.silentCheckSso = false;
10
25
  this.redirectUri = undefined;
@@ -25,6 +40,27 @@ export class DashButtonComponent {
25
40
  this.localMenuLinks = undefined;
26
41
  this.organizationUrl = undefined;
27
42
  this.isRestricted = false;
43
+ this.collapsedModuleSection = null;
44
+ }
45
+ componentDidRender() {
46
+ this.capToRowPeek(this.gridLocalListEl, 2.5);
47
+ this.capToRowPeek(this.listLocalScrollEl, 2.5);
48
+ }
49
+ // Caps a container to `rows` times its first item's rendered height, so
50
+ // Local Modules always shows a partial next row as a "scroll for more"
51
+ // cue instead of a clean cut. Measured off the real item (icon size,
52
+ // padding, etc. all vary) rather than a guessed pixel value; harmless
53
+ // to always set since max-height only constrains when content is
54
+ // actually taller than that.
55
+ capToRowPeek(container, rows) {
56
+ if (!container)
57
+ return;
58
+ const firstItem = container.firstElementChild;
59
+ if (!firstItem) {
60
+ container.style.maxHeight = '';
61
+ return;
62
+ }
63
+ container.style.maxHeight = `${firstItem.offsetHeight * rows}px`;
28
64
  }
29
65
  async componentWillLoad() {
30
66
  var _a, _b, _c, _d;
@@ -68,16 +104,17 @@ export class DashButtonComponent {
68
104
  onLoad: this.authMethod,
69
105
  checkLoginIframe: false,
70
106
  silentCheckSsoRedirectUri: this.silentCheckSso ? this.silentCheckSsoRedirectUri : '',
71
- }).then(res => {
107
+ }).then((res) => {
108
+ var _a, _b, _c;
72
109
  if (res) {
73
110
  this.isAuth = true;
74
111
  localStorage.setItem("keycloak", JSON.stringify(this.keycloak));
75
112
  // document.cookie = "DASH_BTN=" + JSON.parse(localStorage.getItem('keycloak')).token;
76
- document.cookie = this.config.cookieName + "=" + JSON.parse(localStorage.getItem('keycloak')).token;
113
+ document.cookie = this.config.cookieName + "=" + JSON.parse((_a = localStorage.getItem('keycloak')) !== null && _a !== void 0 ? _a : '{}').token;
77
114
  // Set userName
78
- this.givenUserName = JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.preferred_username;
115
+ this.givenUserName = JSON.parse((_b = localStorage.getItem('keycloak')) !== null && _b !== void 0 ? _b : '{}').idTokenParsed.preferred_username;
79
116
  // Set user avatar
80
- this.avatarSvg = toSvg(JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.sub, 40);
117
+ this.avatarSvg = toSvg(JSON.parse((_c = localStorage.getItem('keycloak')) !== null && _c !== void 0 ? _c : '{}').idTokenParsed.sub, 40);
81
118
  }
82
119
  });
83
120
  }
@@ -157,18 +194,32 @@ export class DashButtonComponent {
157
194
  document.cookie = this.config.cookieName + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
158
195
  this.keycloak.logout();
159
196
  }
160
- showModal() {
161
- const appModal = this.el.shadowRoot.querySelector('#appListModal');
162
- appModal.style.display = "block";
197
+ // Normalizes the "Modules" list so grid view and list view can render it
198
+ // with the exact same markup/classes used for the global "Applications" links.
199
+ get moduleLinks() {
200
+ var _a, _b, _c, _d, _e, _f;
201
+ const useCustom = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.menu) === null || _b === void 0 ? void 0 : _b.local) === null || _c === void 0 ? void 0 : _c.enableCustomLocalMenu;
202
+ if (useCustom) {
203
+ return (((_f = (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.menu) === null || _e === void 0 ? void 0 : _e.local) === null || _f === void 0 ? void 0 : _f.links) || []).map((item) => ({
204
+ name: item.name,
205
+ url: item.url,
206
+ icon: item.icon,
207
+ disabled: !item.url,
208
+ }));
209
+ }
210
+ return (this.localMenuLinks || []).map((item) => ({
211
+ name: item.name,
212
+ url: item.url,
213
+ icon: undefined,
214
+ disabled: !item.url,
215
+ }));
163
216
  }
164
- closeModal() {
165
- const appModal = this.el.shadowRoot.querySelector('#appListModal');
166
- appModal.style.display = "none";
217
+ renderSectionLabel(icon, label, count, collapsed, onToggle) {
218
+ return (h("div", { class: "menu-section-header", onClick: onToggle }, h("div", { class: "menu-section-header-left" }, h("span", { class: "menu-section-icon" }, h("i", { class: icon })), h("span", { class: "menu-section-title" }, label), h("span", { class: "menu-section-count" }, count)), h("span", { class: "menu-section-chevron-btn" + (collapsed ? " menu-section-chevron-btn-collapsed" : "") }, h("i", { class: "fa-solid fa-chevron-down" }))));
167
219
  }
168
220
  render() {
169
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
170
- return h("div", { key: '370786aa472fafd2bf9509a18bd62c87ac2893c7' }, h("div", { key: 'c0b091b19e7981ecc48e95c03c8d91e77e7a88df' }, (() => {
171
- var _a, _b, _c, _d, _e, _f;
221
+ return h("div", { key: '27f25b1f44d080a82d28ec01a9d75660948e2fa7' }, h("div", { key: '4992a52ef58625c1cb1591c783eef3c58be50bff' }, (() => {
222
+ var _a, _b, _c, _d, _e, _f, _g, _h;
172
223
  // GLOBAL LOADING SPINNER
173
224
  if (this.isLoading) {
174
225
  return (h("a", { id: "login-btn", class: "button button-link" }, h("div", { class: "lds-ring" }, h("div", null), h("div", null), h("div", null), h("div", null))));
@@ -180,29 +231,21 @@ export class DashButtonComponent {
180
231
  return (h("a", { style: { background: this.primaryColor != undefined ? this.primaryColor : "" }, href: this.redirectUri, id: "login-btn", class: "button button-link" }, h("span", { style: { color: this.accentColor != undefined ? this.accentColor : "" }, class: "button-text button-text-full-width" }, "Go to Dashboard")));
181
232
  }
182
233
  else if (this.isAuth) {
183
- return (h("div", { id: "profile-btn", class: "dropdown" }, h("button", { style: { background: this.primaryColor != undefined ? this.primaryColor : "" }, type: "button", class: "button" }, h("span", { class: "button-profile" }, JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.imageUrl ?
234
+ return (h("div", { class: "profile-actions", style: { display: "inline-flex", alignItems: "center", gap: "15px" } }, h("div", { id: "profile-btn", class: "dropdown", onMouseEnter: this.handleDropdownMouseEnter }, h("button", { style: { background: this.primaryColor != undefined ? this.primaryColor : "" }, type: "button", class: "button" }, h("span", { class: "button-profile" }, JSON.parse((_g = localStorage.getItem('keycloak')) !== null && _g !== void 0 ? _g : '{}').idTokenParsed.imageUrl ?
184
235
  h("img", { class: "profile-image", src: "https://s-damith.github.io/test-avatar/images/e24da9c5-0b1f-46fa-82cd-7c711c77b5c7.png" })
185
236
  :
186
- h("div", { innerHTML: this.avatarSvg })), h("span", { style: { color: this.accentColor != undefined ? this.accentColor : "" }, id: "given-name", class: "button-text" }, this.givenUserName), h("div", { class: "button-icon" }, (this.config.menuViewType == "grid") ? h("i", { class: "fa-solid fa-grip-vertical" }) : h("i", { class: "fa-solid fa-bars" }))), h("div", { class: "dropdown-content" }, h("div", { class: "dropdown-user-profile" }, h("div", { class: "username" }, "@", this.givenUserName), h("div", { class: "first-last-name" }, JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.name)), (this.config.menuViewType == "grid") ? (h("div", null, h("div", { class: "grid-view-menu" }, this.config.menu.global.links.map(item => {
187
- return (h("a", { href: item.url, target: '_blank', class: "grid-view-link" }, h("i", { class: item.icon + " fa-2x" }), h("div", { class: "grid-view-link-text" }, item.name)));
188
- })), this.config.menu.global.links.length != 0 && h("hr", { class: "solid" }), h("div", { class: "grid-view-menu", style: this.config.menu.global.links.length == 0 && { "margin-bottom": "12px" } }, h("a", { onClick: this.showModal.bind(this), class: "grid-view-link" }, h("i", { class: "fa-regular fa-window-restore fa-2x" }), h("div", { class: "grid-view-link-text" }, "Modules")), h("a", { href: this.config.defaultLink.url, target: '_blank', class: "grid-view-link" }, h("i", { class: "fa-solid fa-globe fa-2x" }), h("div", { class: "grid-view-link-text" }, this.config.defaultLink.name)), h("a", { onClick: this.logout.bind(this), class: "grid-view-link" }, h("i", { class: "fa-solid fa-right-from-bracket fa-2x" }), h("div", { class: "grid-view-link-text" }, "Logout"))))) : (
237
+ h("div", { innerHTML: this.avatarSvg })), h("span", { style: { color: this.accentColor != undefined ? this.accentColor : "" }, id: "given-name", class: "button-text" }, this.givenUserName), h("div", { class: "button-icon" }, (this.config.menuViewType == "grid") ? h("i", { class: "fa-solid fa-grip-vertical" }) : h("i", { class: "fa-solid fa-bars" }))), h("div", { class: "dropdown-content" }, h("div", { class: "dropdown-user-profile" }, h("div", { class: "user-profile-info" }, h("div", { class: "username" }, "@", this.givenUserName), h("div", { class: "first-last-name" }, JSON.parse((_h = localStorage.getItem('keycloak')) !== null && _h !== void 0 ? _h : '{}').idTokenParsed.name)), h("div", { class: "user-profile-actions" }, h("a", { href: this.config.defaultLink.url, target: "_blank", rel: "noopener noreferrer", class: "footer-icon-btn footer-icon-btn-portal", "aria-label": this.config.defaultLink.name || "Portal", "data-tooltip": this.config.defaultLink.name || "Portal" }, h("i", { class: "fa-solid fa-globe" })), h("button", { type: "button", onClick: this.logout.bind(this), class: "footer-icon-btn footer-icon-btn-logout", "aria-label": "Logout", "data-tooltip": "Logout" }, h("i", { class: "fa-solid fa-right-from-bracket" })))), (this.config.menuViewType == "grid") ? (h("div", null, this.moduleLinks.length > 0 && this.renderSectionLabel("fa-solid fa-earth-americas", "Global Modules", this.config.menu.global.links.length, (this.collapsedModuleSection === 'global'), this.toggleGlobalModules), (this.moduleLinks.length === 0 || this.collapsedModuleSection !== 'global') && (h("div", { class: "grid-view-menu" }, this.config.menu.global.links.map(item => {
238
+ return (h("a", { href: item.url, target: '_blank', rel: "noopener noreferrer", class: "grid-view-link" }, h("i", { class: item.icon + " fa-2x" }), h("div", { class: "grid-view-link-text" }, item.name)));
239
+ }))), this.moduleLinks.length > 0 && (h("div", { style: { display: "contents" } }, h("hr", { class: "solid" }), this.renderSectionLabel("fa-solid fa-building", "Local Modules", this.moduleLinks.length, (this.collapsedModuleSection === 'local'), this.toggleLocalModules), !(this.collapsedModuleSection === 'local') && (h("div", { class: "grid-view-menu", ref: (el) => this.gridLocalListEl = el }, this.moduleLinks.map(item => (h("a", { class: "grid-view-link" + (item.disabled ? " grid-view-link-disabled" : ""), href: item.disabled ? undefined : item.url, target: item.disabled ? undefined : "_blank", rel: item.disabled ? undefined : "noopener noreferrer", onClick: item.disabled ? (e) => e.preventDefault() : undefined }, h("i", { class: (item.icon || "fa-solid fa-cube") + " fa-2x" }), h("div", { class: "grid-view-link-text" }, item.name)))))))))) : (
189
240
  // List View
190
- h("div", { class: "dropdown-content-link" }, this.config.menu.global.links.map(item => {
191
- return (h("a", { href: item.url, target: '_blank', id: "applications-btn" }, h("i", { class: item.icon + " menu-bar-icons" }), item.name));
192
- }), h("a", { onClick: this.showModal.bind(this), id: "applications-btn" }, h("i", { class: "fa-regular fa-window-restore menu-bar-icons" }), "Modules"), h("a", { href: this.config.defaultLink.url, target: '_blank', id: "applications-btn" }, h("i", { class: "fa-solid fa-globe menu-bar-icons" }), this.config.defaultLink.name), h("a", { onClick: this.logout.bind(this), id: "logout-btn" }, h("i", { class: "fa-solid fa-right-from-bracket menu-bar-icons" }), "Logout"))))));
241
+ h("div", { class: "dropdown-content-link" }, this.moduleLinks.length > 0 && this.renderSectionLabel("fa-solid fa-earth-americas", "Global Modules", this.config.menu.global.links.length, (this.collapsedModuleSection === 'global'), this.toggleGlobalModules), (this.moduleLinks.length === 0 || this.collapsedModuleSection !== 'global') && (this.config.menu.global.links.map(item => {
242
+ return (h("a", { href: item.url, target: '_blank', rel: "noopener noreferrer", id: "applications-btn" }, h("i", { class: item.icon + " menu-bar-icons" }), item.name));
243
+ })), this.moduleLinks.length > 0 && (h("div", { style: { display: "contents" } }, this.renderSectionLabel("fa-solid fa-building", "Local Modules", this.moduleLinks.length, (this.collapsedModuleSection === 'local'), this.toggleLocalModules), !(this.collapsedModuleSection === 'local') && (h("div", { class: "local-modules-scroll", ref: (el) => this.listLocalScrollEl = el }, this.moduleLinks.map(item => (h("a", { id: "applications-btn", class: item.disabled ? "applications-btn-disabled" : undefined, href: item.disabled ? undefined : item.url, target: item.disabled ? undefined : "_blank", rel: item.disabled ? undefined : "noopener noreferrer", onClick: item.disabled ? (e) => e.preventDefault() : undefined }, h("i", { class: (item.icon || "fa-solid fa-cube") + " menu-bar-icons" }), item.name)))))))))))));
193
244
  }
194
245
  else {
195
246
  return (h("button", { style: { background: this.primaryColor != undefined ? this.primaryColor : "" }, onClick: this.login.bind(this), id: "login-btn", type: "button", class: "button" }, h("span", { style: { color: this.accentColor != undefined ? this.accentColor : "" }, class: "button-text" }, "Login")));
196
247
  }
197
- })()), h("div", { key: 'f98304920ef08f842700c5d26fe62a51cbbade96', id: "appListModal", class: "modal" }, h("div", { key: '2c4024b83e3cd0d638f4482d0e8907687ac12dd0', class: "modal-content" }, h("span", { key: '42a44145a7d7c33cae95344f02229d8163cc9607', onClick: this.closeModal.bind(this), class: "close" }, "\u00D7"), h("div", { key: 'ec3dbe646c76818ee90ec28e19671880670a2754', class: "box" }, h("input", { type: "radio", class: "tab-toggle", name: "tab-toggle", id: "tab1", checked: true }), h("ul", { key: 'c7dbcfd1b183bc6845cab0f17ef6f81dee30867f', class: "tab-list" }, h("li", { class: "tab-item" }, h("label", { class: "tab-trigger", htmlFor: "tab1" }, h("i", { class: "fa-solid fa-table-list menu-bar-icons" }), " ", this.config.menu.local.name))), h("div", { key: 'dc58df8e838c8babe3c679c6f1c498e286448cf3', class: "tab-container" }, h("div", { key: '486acbf570543ef0a92bd919e1c9c7973c87b3a7', class: "tab-content" }, h("div", { key: 'c9e093ce8d745097147405749e88ba35b1fc8679', class: "modal-body" }, !((_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.menu) === null || _b === void 0 ? void 0 : _b.local) === null || _c === void 0 ? void 0 : _c.enableCustomLocalMenu) ? (
198
- // <div>{this.localMenuLinks}</div>
199
- (_d = this.localMenuLinks) === null || _d === void 0 ? void 0 : _d.map((app, index) => {
200
- const isDisabled = !app.url;
201
- return (h("a", { key: index, class: "external-app-link", href: isDisabled ? undefined : app.url, target: isDisabled ? undefined : "_blank", rel: isDisabled ? undefined : "noopener noreferrer", onClick: isDisabled ? (e) => e.preventDefault() : undefined }, h("div", { class: "modal-app" }, h("div", null, app.name))));
202
- })) : ((_e = this.config.menu.local.links) === null || _e === void 0 ? void 0 : _e.map((app, index) => (h("a", { key: index, class: "external-app-link", target: "_blank", rel: "noopener noreferrer", href: app.url }, h("div", { class: "modal-app" }, h("div", null, app.name)))))), !this.organizationUrl ? (h("div", null, h("h3", { class: "gray-text" }, "Organization Domain URL not set"), h("p", { class: "gray-text" }, "Please set your Organization Domain URL on the Portal profile page."))) : (((!((_h = (_g = (_f = this.config) === null || _f === void 0 ? void 0 : _f.menu) === null || _g === void 0 ? void 0 : _g.local) === null || _h === void 0 ? void 0 : _h.enableCustomLocalMenu) &&
203
- ((_k = (_j = this.localMenuLinks) === null || _j === void 0 ? void 0 : _j.length) !== null && _k !== void 0 ? _k : 0) === 0) ||
204
- (((_o = (_m = (_l = this.config) === null || _l === void 0 ? void 0 : _l.menu) === null || _m === void 0 ? void 0 : _m.local) === null || _o === void 0 ? void 0 : _o.enableCustomLocalMenu) &&
205
- ((_t = (_s = (_r = (_q = (_p = this.config) === null || _p === void 0 ? void 0 : _p.menu) === null || _q === void 0 ? void 0 : _q.local) === null || _r === void 0 ? void 0 : _r.links) === null || _s === void 0 ? void 0 : _s.length) !== null && _t !== void 0 ? _t : 0) === 0)) && (h("div", null, h("h3", { class: "gray-text" }, "No installed ", ((_w = (_v = (_u = this.config) === null || _u === void 0 ? void 0 : _u.menu) === null || _v === void 0 ? void 0 : _v.local) === null || _w === void 0 ? void 0 : _w.name) || "menu", " found."), h("p", { class: "gray-text" }, "Please contact administration.")))))))))), h("div", { key: '349c7ff69d94c988a278677f497c0a9fef85c59c', id: "appPermissionErrorModal", class: "modal" }, h("div", { key: '788004858cf2f55f4e79cce0c023895274bab9ab', class: "modal-content" }, h("img", { key: '57ea43b0a21086eeaebe0585b9501967099ec999', src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGD0lEQVR4nO2cbU8TWRTH/W5WEAmF4nNiieFFoeBjYhQUWzUWYkpbDfGFCR9CoolvQF9aWgG3kMCG8LACC1ikuCuUh7bH/M/MmW131S2ZqTDjPcmkdub2tvPj3HP/55yJR44oU6ZMmTJlyg7YOsL9pI7+shkogGFzDqMAhhVAOsiQozwwrACS8sCwfXd+tYTDCiApDwwf/FJUSzisAJKjNhFlPzYF0KQpgCZNATRpCqBJUwBNmgJo0hRAk6YAmjQF0KkAs4uLtPz8OU2HQpRqaaFkQwPFq6v5SHo8fA7XVgYGKLu0dGC/81ABLORylB4cpInLl+nt0aP7OiauXKH00BAV8vlfE2AmkaCxpiYDSKK6mqaammjx+nX6FAzS348e0VYkwgf+jXO4Nun18lj53PuLF2kjmfx1AOa3t2mmt9cAkDxxghauXaPN3l7KxmJlHRgLmKNutzHPTCTCczsa4G4mQ6nWVr7h4WPHaL6trQTc+r17NOf30/iZMzTmdtNwVRWPA2Scm/H56FMgQNlolMfDO/9ob+cxmDPl99PuxoYzAe5mMrzcxOvWAALgolFauXmTxurry45/gPvnjRsG+LW7d3lOWdKVhHggAPPb24bnvW9ooL96evjGP4dC9NvJkwaY0fPnaa6vjzLJJG19+ED5bJY/u5NOUyYep/lnz2jk3Ll/4p/Hw/B4ru5unls8Mb+z4xyAM3rMg5cIvHRXFyVqavg8oKy+elXWjooxqy9f0luXy5gTm4xAFE+cjcWcATCT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LNu6OtZs+3m4CCIZnxGpIjGvUsv2UAEUQ9NblrSUoNDDQP4KT+TH2/QWJT/eFgjwNaRnnGHI4x3NzRXZbQ89QBg0GsQ2Wo+SnZR1uFycYbBI3kdv2XEAiw35KqQMGkDoYaCeaDzi29jIuziuYYyVua1jANrFFECTpgCaNAXQpCmAJk0BNGkKoElTACsNUB39ZTFQAMMW/78xypQpU6ZMmbIjP9e+AkAlsBlIjsPOAAAAAElFTkSuQmCC" }), h("h2", { key: 'c7663fb1503a0f0713350ac2ff2e52708c5425f9', class: "green-text margin-b" }, "You don't have permission to access this application."), h("h3", { key: '925b21fffdee5437664f690254821ffa63d736cb', class: "green-text" }, "Please contact the administration."), (this.config.defaultLink.url && this.showUnauthorizedModal) ?
248
+ })()), h("div", { key: 'ad2e0ae280f95f24057cb411f8c64f5949e8893b', id: "appPermissionErrorModal", class: "modal" }, h("div", { key: '04faf5f2d30538b5e85c339ca683a8c8559b486a', class: "modal-content" }, h("img", { key: '0e8063f377451a39718e83554e9fb74dae603b5f', src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGD0lEQVR4nO2cbU8TWRTH/W5WEAmF4nNiieFFoeBjYhQUWzUWYkpbDfGFCR9CoolvQF9aWgG3kMCG8LACC1ikuCuUh7bH/M/MmW131S2ZqTDjPcmkdub2tvPj3HP/55yJR44oU6ZMmTJlyg7YOsL9pI7+shkogGFzDqMAhhVAOsiQozwwrACS8sCwfXd+tYTDCiApDwwf/FJUSzisAJKjNhFlPzYF0KQpgCZNATRpCqBJUwBNmgJo0hRAk6YAmjQF0KkAs4uLtPz8OU2HQpRqaaFkQwPFq6v5SHo8fA7XVgYGKLu0dGC/81ABLORylB4cpInLl+nt0aP7OiauXKH00BAV8vlfE2AmkaCxpiYDSKK6mqaammjx+nX6FAzS348e0VYkwgf+jXO4Nun18lj53PuLF2kjmfx1AOa3t2mmt9cAkDxxghauXaP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PJTGRP6lTpwz5YpSz3ryxcUE1nzcaSeieFTeArIKH3Fq8GSX9koJqc7O9C6owNL0lO5CKsZTfzS7bqTt3+LPxornxKu2Cz6Oj5IymUkTLCOB54iWAKOIaMRE7JXbS/zOMwYYhMQ9/gOLOnPxBZh8/dlhb06+Vs9B6FIi4cYmJInGgEyGIkbHgc8idkWHgHHRecVsTMU/mwuuY3tYcv3TJWW1NGJrdJY113WtkdxaJU84BqSK7rRFXdc/Dd+w5rbFeDHG8rc2IiQj2UmwQsY1iKFIxlKSg46AjARfnkGGISOZHO6JRnkNiHjzPsY92iGFZoultLNu6OtZs+3m4CCIZnxGpIjGvUsv2UAEUQ9NblrSUoNDDQP4KT+TH2/QWJT/eFgjwNaRnnGHI4x3NzRXZbQ89QBg0GsQ2Wo+SnZR1uFycYbBI3kdv2XEAiw35KqQMGkDoYaCeaDzi29jIuziuYYyVua1jANrFFECTpgCaNAXQpCmAJk0BNGkKoElTACsNUB39ZTFQAMMW/78xypQpU6ZMmbIjP9e+AkAlsBlIjsPOAAAAAElFTkSuQmCC" }), h("h2", { key: '2073a6ee6e216778036b4637c80fb2c96361cbaf', class: "green-text margin-b" }, "You don't have permission to access this application."), h("h3", { key: 'd90e387ecf3aa39ff096b21e7e4b80e9234513e3', class: "green-text" }, "Please contact the administration."), (this.config.defaultLink.url && this.showUnauthorizedModal) ?
206
249
  h("div", null, h("h4", { class: "gray-text" }, "You will be automatically redirected to the portal."), h("div", { id: "countdown" }, h("div", { id: "countdown-number" }), h("svg", null, h("circle", { r: "18", cx: "20", cy: "20" }))))
207
250
  : h("div", null))));
208
251
  }
@@ -264,7 +307,7 @@ export class DashButtonComponent {
264
307
  "resolved": "string",
265
308
  "references": {}
266
309
  },
267
- "required": false,
310
+ "required": true,
268
311
  "optional": false,
269
312
  "docs": {
270
313
  "tags": [],
@@ -395,7 +438,8 @@ export class DashButtonComponent {
395
438
  "config": {},
396
439
  "localMenuLinks": {},
397
440
  "organizationUrl": {},
398
- "isRestricted": {}
441
+ "isRestricted": {},
442
+ "collapsedModuleSection": {}
399
443
  };
400
444
  }
401
445
  static get elementRef() { return "el"; }