dash-button-web 0.0.18 → 0.0.19-beta.0

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 (38) hide show
  1. package/dist/cjs/dash-button.cjs.entry.js +198 -101
  2. package/dist/cjs/dash-button.cjs.entry.js.map +1 -1
  3. package/dist/cjs/{index-ad267eeb.js → index-87d4993d.js} +1 -5
  4. package/dist/cjs/index-87d4993d.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 +3 -3
  8. package/dist/collection/components/my-component/dash-button.js +91 -299
  9. package/dist/collection/components/my-component/dash-button.js.map +1 -1
  10. package/dist/collection/services/config.js +59 -0
  11. package/dist/collection/services/config.js.map +1 -0
  12. package/dist/collection/services/menu.js +52 -0
  13. package/dist/collection/services/menu.js.map +1 -0
  14. package/dist/components/dash-button.js +201 -115
  15. package/dist/components/dash-button.js.map +1 -1
  16. package/dist/esm/dash-button.entry.js +198 -101
  17. package/dist/esm/dash-button.entry.js.map +1 -1
  18. package/dist/esm/{index-46149754.js → index-e3df5eaf.js} +1 -5
  19. package/dist/{cjs/index-ad267eeb.js.map → esm/index-e3df5eaf.js.map} +1 -1
  20. package/dist/esm/loader.js +3 -3
  21. package/dist/esm/web-compnont.js +3 -3
  22. package/dist/types/components/my-component/dash-button.d.ts +8 -18
  23. package/dist/types/components.d.ts +0 -22
  24. package/dist/types/services/config.d.ts +47 -0
  25. package/dist/types/services/menu.d.ts +27 -0
  26. package/dist/web-compnont/p-63d22b03.entry.js +10 -0
  27. package/dist/web-compnont/p-63d22b03.entry.js.map +1 -0
  28. package/dist/web-compnont/p-c1ec12fe.js +3 -0
  29. package/dist/web-compnont/p-c1ec12fe.js.map +1 -0
  30. package/dist/web-compnont/web-compnont.esm.js +1 -1
  31. package/dist/web-compnont/web-compnont.esm.js.map +1 -1
  32. package/package.json +1 -1
  33. package/readme.md +49 -47
  34. package/dist/esm/index-46149754.js.map +0 -1
  35. package/dist/web-compnont/p-ac1910bb.entry.js +0 -10
  36. package/dist/web-compnont/p-ac1910bb.entry.js.map +0 -1
  37. package/dist/web-compnont/p-db53c3e9.js +0 -3
  38. package/dist/web-compnont/p-db53c3e9.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { b as bootstrapLazy } from './index-46149754.js';
2
- export { s as setNonce } from './index-46149754.js';
1
+ import { b as bootstrapLazy } from './index-e3df5eaf.js';
2
+ export { s as setNonce } from './index-e3df5eaf.js';
3
3
 
4
4
  const defineCustomElements = (win, options) => {
5
5
  if (typeof window === 'undefined') return undefined;
6
- return bootstrapLazy([["dash-button",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"keycloakUri":[1,"keycloak-uri"],"realm":[1],"clientId":[1,"client-id"],"appId":[1,"app-id"],"portalUrl":[1,"portal-url"],"portalApiUrl":[1,"portal-api-url"],"plmUrl":[1,"plm-url"],"usageTrackingUrl":[1,"usage-tracking-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"postTextDelayDuration":[2,"post-text-delay-duration"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"otherLinkType":[1,"other-link-type"],"otherLinkDisplayName":[1,"other-link-display-name"],"applicationDisplayName":[1,"application-display-name"],"disableApplicationTab":[4,"disable-application-tab"],"menuViewType":[1,"menu-view-type"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"menuLinkList":[32],"mainMenuLinkList":[32],"showPostLoginLoadingSpinner":[32],"avatarSvg":[32],"dummyAppList":[32]}]]]], options);
6
+ return bootstrapLazy([["dash-button",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"appId":[1,"app-id"],"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]}]]]], options);
7
7
  };
8
8
 
9
9
  export { defineCustomElements };
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-46149754.js';
2
- export { s as setNonce } from './index-46149754.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-e3df5eaf.js';
2
+ export { s as setNonce } from './index-e3df5eaf.js';
3
3
 
4
4
  /*
5
5
  Stencil Client Patch Browser v4.12.0 | MIT Licensed | https://stenciljs.com
@@ -14,7 +14,7 @@ const patchBrowser = () => {
14
14
  };
15
15
 
16
16
  patchBrowser().then(options => {
17
- return bootstrapLazy([["dash-button",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"keycloakUri":[1,"keycloak-uri"],"realm":[1],"clientId":[1,"client-id"],"appId":[1,"app-id"],"portalUrl":[1,"portal-url"],"portalApiUrl":[1,"portal-api-url"],"plmUrl":[1,"plm-url"],"usageTrackingUrl":[1,"usage-tracking-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"postTextDelayDuration":[2,"post-text-delay-duration"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"otherLinkType":[1,"other-link-type"],"otherLinkDisplayName":[1,"other-link-display-name"],"applicationDisplayName":[1,"application-display-name"],"disableApplicationTab":[4,"disable-application-tab"],"menuViewType":[1,"menu-view-type"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"menuLinkList":[32],"mainMenuLinkList":[32],"showPostLoginLoadingSpinner":[32],"avatarSvg":[32],"dummyAppList":[32]}]]]], options);
17
+ return bootstrapLazy([["dash-button",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"appId":[1,"app-id"],"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]}]]]], options);
18
18
  });
19
19
 
20
20
  //# sourceMappingURL=web-compnont.js.map
@@ -1,41 +1,31 @@
1
+ import { AppConfig } from '../../services/config';
2
+ import { MenuLink } from '../../services/menu';
1
3
  export declare class DashButtonComponent {
2
4
  el: any;
3
5
  showPostLoginText: boolean;
4
6
  silentCheckSso: boolean;
5
7
  redirectUri: string;
6
8
  authMethod: string;
7
- keycloakUri: string;
8
- realm: string;
9
- clientId: string;
10
9
  appId: string;
11
- portalUrl: string;
12
10
  portalApiUrl: string;
13
11
  plmUrl: string;
14
- usageTrackingUrl: string;
15
12
  showUnauthorizedModal: boolean;
16
- postTextDelayDuration: number;
17
13
  primaryColor: string;
18
14
  accentColor: string;
19
- otherLinkType: string;
20
- otherLinkDisplayName: string;
21
- applicationDisplayName: string;
22
- disableApplicationTab: boolean;
23
- menuViewType: string;
24
15
  keycloak: any;
25
16
  isAuth: boolean;
26
17
  givenUserName: string;
27
18
  silentCheckSsoRedirectUri: string;
28
19
  appList: any[];
29
- menuLinkList: any[];
30
- mainMenuLinkList: any[];
31
- showPostLoginLoadingSpinner: boolean;
32
20
  avatarSvg: string;
33
- dummyAppList: string[];
34
- componentWillLoad(): void;
21
+ isLoading: boolean;
22
+ config: AppConfig;
23
+ localMenuLinks: MenuLink[];
24
+ organizationUrl: any;
25
+ componentWillLoad(): Promise<void>;
35
26
  initKeycloak(): Promise<void>;
27
+ loadOrganizationUrlAndLinks(): Promise<void>;
36
28
  getAppList(token: any): Promise<any>;
37
- getOtherMenuLinks(token: any): Promise<any>;
38
- getMainMenuLinks(token: any): Promise<any>;
39
29
  login(): void;
40
30
  logout(): void;
41
31
  showModal(): void;
@@ -9,25 +9,14 @@ export namespace Components {
9
9
  interface DashButton {
10
10
  "accentColor": string;
11
11
  "appId": string;
12
- "applicationDisplayName": string;
13
12
  "authMethod": string;
14
- "clientId": string;
15
- "disableApplicationTab": boolean;
16
- "keycloakUri": string;
17
- "menuViewType": string;
18
- "otherLinkDisplayName": string;
19
- "otherLinkType": string;
20
13
  "plmUrl": string;
21
14
  "portalApiUrl": string;
22
- "portalUrl": string;
23
- "postTextDelayDuration": number;
24
15
  "primaryColor": string;
25
- "realm": string;
26
16
  "redirectUri": string;
27
17
  "showPostLoginText": boolean;
28
18
  "showUnauthorizedModal": boolean;
29
19
  "silentCheckSso": boolean;
30
- "usageTrackingUrl": string;
31
20
  }
32
21
  }
33
22
  declare global {
@@ -45,25 +34,14 @@ declare namespace LocalJSX {
45
34
  interface DashButton {
46
35
  "accentColor"?: string;
47
36
  "appId"?: string;
48
- "applicationDisplayName"?: string;
49
37
  "authMethod"?: string;
50
- "clientId"?: string;
51
- "disableApplicationTab"?: boolean;
52
- "keycloakUri"?: string;
53
- "menuViewType"?: string;
54
- "otherLinkDisplayName"?: string;
55
- "otherLinkType"?: string;
56
38
  "plmUrl"?: string;
57
39
  "portalApiUrl"?: string;
58
- "portalUrl"?: string;
59
- "postTextDelayDuration"?: number;
60
40
  "primaryColor"?: string;
61
- "realm"?: string;
62
41
  "redirectUri"?: string;
63
42
  "showPostLoginText"?: boolean;
64
43
  "showUnauthorizedModal"?: boolean;
65
44
  "silentCheckSso"?: boolean;
66
- "usageTrackingUrl"?: string;
67
45
  }
68
46
  interface IntrinsicElements {
69
47
  "dash-button": DashButton;
@@ -0,0 +1,47 @@
1
+ export interface KeycloakConfig {
2
+ url: string;
3
+ realm: string;
4
+ clientId: string;
5
+ }
6
+ export interface LinkItem {
7
+ name: string;
8
+ url: string;
9
+ icon?: string;
10
+ }
11
+ export interface MenuSection {
12
+ name: string;
13
+ links: LinkItem[];
14
+ }
15
+ export interface LocalMenuSection {
16
+ name: string;
17
+ enableCustomLocalMenu: boolean;
18
+ links: LinkItem[];
19
+ }
20
+ export interface MenuConfig {
21
+ global: MenuSection;
22
+ local: LocalMenuSection;
23
+ }
24
+ export interface LoadingConfig {
25
+ isLoading: boolean;
26
+ duration: number;
27
+ }
28
+ export interface AppConfig {
29
+ keycloak: KeycloakConfig;
30
+ defaultLink: LinkItem;
31
+ menuViewType: string;
32
+ cookieName: string;
33
+ menu: MenuConfig;
34
+ loading?: LoadingConfig;
35
+ }
36
+ declare class ConfigService {
37
+ private static instance;
38
+ private _config;
39
+ static getInstance(): ConfigService;
40
+ fetchConfig(portalApiUrl: string): Promise<AppConfig>;
41
+ /**
42
+ * Return cached config without calling API
43
+ */
44
+ get config(): AppConfig;
45
+ }
46
+ export declare const configService: ConfigService;
47
+ export {};
@@ -0,0 +1,27 @@
1
+ export interface InstalledChartMetadata {
2
+ category?: string;
3
+ frontendUrlPrefix?: string;
4
+ }
5
+ export interface InstalledChart {
6
+ id: number;
7
+ installChartName: string;
8
+ metadata: InstalledChartMetadata;
9
+ }
10
+ export interface PaginatedInstalledChartsResponse {
11
+ data: InstalledChart[];
12
+ total: number;
13
+ page: number;
14
+ perPage: number;
15
+ totalPages: number;
16
+ }
17
+ export interface MenuLink {
18
+ name: string;
19
+ url: string;
20
+ category?: string;
21
+ }
22
+ declare class MenuService {
23
+ getMenuConfig(url: any): Promise<PaginatedInstalledChartsResponse>;
24
+ getMenuLinks(BASE_URL: any): Promise<MenuLink[]>;
25
+ }
26
+ export declare const menuService: MenuService;
27
+ export {};