@plurid/plurid-ui-components-react 0.0.0-21 → 0.0.0-22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { Theme } from '@plurid/plurid-themes';
3
+ import { Dashboard } from '../../data';
4
+ export interface RenderAreaProperties {
5
+ dashboards: Dashboard[];
6
+ selectedDashboard: string;
7
+ renderView: string;
8
+ fullRenderArea: boolean;
9
+ theme: Theme;
10
+ setSelectedDashboard: React.Dispatch<string>;
11
+ setRenderView: React.Dispatch<string>;
12
+ setFullRenderArea: React.Dispatch<boolean>;
13
+ }
14
+ declare const RenderArea: React.FC<RenderAreaProperties>;
15
+ export default RenderArea;
@@ -0,0 +1,5 @@
1
+ import { Theme } from '@plurid/plurid-themes';
2
+ export interface IStyledRenderArea {
3
+ theme: Theme;
4
+ }
5
+ export declare const StyledRenderArea: import("styled-components").StyledComponent<"div", any, IStyledRenderArea, never>;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { Theme } from '@plurid/plurid-themes';
3
+ import { Dashboard } from '../../../../data';
4
+ export interface SelectorProperties {
5
+ data: Dashboard;
6
+ compactSelectors: boolean;
7
+ theme: Theme;
8
+ selectedDashboard: string;
9
+ setSelectedDashboard: React.Dispatch<string>;
10
+ rendererID?: string;
11
+ }
12
+ declare const Selector: React.FC<SelectorProperties>;
13
+ export default Selector;
@@ -0,0 +1,11 @@
1
+ import { Theme } from '@plurid/plurid-themes';
2
+ export interface IStyledSelector {
3
+ theme: Theme;
4
+ selected: boolean;
5
+ compactSelectors: boolean;
6
+ }
7
+ export declare const StyledSelector: import("styled-components").StyledComponent<"li", any, IStyledSelector, never>;
8
+ export interface IStyledSelectorRelativeLabel {
9
+ theme: Theme;
10
+ }
11
+ export declare const StyledSelectorRelativeLabel: import("styled-components").StyledComponent<"div", any, IStyledSelectorRelativeLabel, never>;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { Theme } from '@plurid/plurid-themes';
3
+ import { Dashboard } from '../../data';
4
+ export interface SidebarProperties {
5
+ dashboards: Dashboard[];
6
+ theme: Theme;
7
+ compactSelectors: boolean;
8
+ setCompactSelectors: React.Dispatch<boolean>;
9
+ selectedDashboard: string;
10
+ setSelectedDashboard: React.Dispatch<string>;
11
+ rendererID?: string;
12
+ identonym?: string;
13
+ usageType?: string;
14
+ brandingName?: string;
15
+ brandingNameStyle?: React.CSSProperties;
16
+ brandingLogo?: string;
17
+ openManual?: () => void;
18
+ logout?: () => void;
19
+ }
20
+ declare const Sidebar: React.FC<SidebarProperties>;
21
+ export default Sidebar;
@@ -0,0 +1,20 @@
1
+ import { Theme } from '@plurid/plurid-themes';
2
+ export interface IStyledSidebar {
3
+ theme: Theme;
4
+ }
5
+ export declare const StyledSidebar: import("styled-components").StyledComponent<"div", any, IStyledSidebar, never>;
6
+ export interface IStyledSelectors {
7
+ theme: Theme;
8
+ compactSelectors: boolean;
9
+ helpItemsCount: number;
10
+ }
11
+ export declare const StyledSelectors: import("styled-components").StyledComponent<"div", any, IStyledSelectors, never>;
12
+ export interface IStyledBranding {
13
+ compactSelectors: boolean;
14
+ }
15
+ export declare const StyledBranding: import("styled-components").StyledComponent<"div", any, IStyledBranding, never>;
16
+ export declare const StyledHelp: import("styled-components").StyledComponent<"div", any, {}, never>;
17
+ export interface IStyledHelpItem {
18
+ compactSelectors: boolean;
19
+ }
20
+ export declare const StyledHelpItem: import("styled-components").StyledComponent<"li", any, IStyledHelpItem, never>;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { Theme } from '@plurid/plurid-themes';
3
+ export interface DashboardRenderProperties {
4
+ theme: Theme;
5
+ selectedDashboard: string;
6
+ setSelectedDashboard: React.Dispatch<string>;
7
+ renderView: string;
8
+ setRenderView: React.Dispatch<string>;
9
+ fullRenderArea: boolean;
10
+ setFullRenderArea: React.Dispatch<boolean>;
11
+ }
12
+ export interface Dashboard {
13
+ id: string;
14
+ icon?: React.FC<any> | JSX.Element;
15
+ label: string;
16
+ defaultRender?: string;
17
+ renderers: Record<string, React.FC<any> | undefined | any>;
18
+ }
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { Theme } from '@plurid/plurid-themes';
3
+ import { Dashboard } from './data';
4
+ export interface DashboardsRendererProperties {
5
+ dashboards: Dashboard[];
6
+ theme: Theme;
7
+ rendererID?: string;
8
+ identonym?: string;
9
+ usageType?: string;
10
+ brandingName?: string;
11
+ brandingNameStyle?: React.CSSProperties;
12
+ brandingLogo?: string;
13
+ activeDashboard?: string;
14
+ activeRender?: string;
15
+ compactSelectors?: boolean;
16
+ fullRenderArea?: boolean;
17
+ noDashboardRender?: JSX.Element;
18
+ openManual?: () => void;
19
+ atDashboardChange?: (newDashboard: string) => void;
20
+ atUIChange?: (type: string, value: any) => void;
21
+ logout?: () => void;
22
+ }
23
+ declare const DashboardsRenderer: React.FC<DashboardsRendererProperties>;
24
+ export default DashboardsRenderer;
@@ -0,0 +1,8 @@
1
+ import { Theme } from '@plurid/plurid-themes';
2
+ export interface IStyledDashboardsRenderer {
3
+ theme: Theme;
4
+ compactSelectors: boolean;
5
+ fullRenderArea: boolean;
6
+ }
7
+ export declare const StyledDashboardsRenderer: import("styled-components").StyledComponent<"div", any, IStyledDashboardsRenderer, never>;
8
+ export declare const StyledNoDashboardRender: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  declare const containers: {
3
+ DashboardsRenderer: import("react").FC<import("./DashboardsRenderer").DashboardsRendererProperties>;
3
4
  EntityView: import("react").ForwardRefExoticComponent<import("./EntityView").EntityViewType>;
4
5
  };
5
6
  export default containers;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  declare const pluridal: {
3
3
  containers: {
4
+ DashboardsRenderer: import("react").FC<import("./containers/DashboardsRenderer").DashboardsRendererProperties>;
4
5
  EntityView: import("react").ForwardRefExoticComponent<import("./containers/EntityView").EntityViewType>;
5
6
  };
6
7
  head: {
@@ -43,6 +43,7 @@ declare const _default: {
43
43
  children?: import("react").ReactNode;
44
44
  store?: import("@reduxjs/toolkit").Store<any, import("@reduxjs/toolkit").AnyAction> | undefined;
45
45
  }>;
46
+ DashboardsRenderer: import("react").FC<import("./components/pluridal/containers/DashboardsRenderer").DashboardsRendererProperties>;
46
47
  EntityView: import("react").ForwardRefExoticComponent<import("./components/pluridal/containers/EntityView").EntityViewType>;
47
48
  CopyableLine: import("react").FC<import("./components/universal/varia/CopyableLine").CopyableLineProperties>;
48
49
  NewPageLink: import("react").FC<import("./components/universal/varia/NewPageLink").NewPageLinkProperties>;
@@ -78,7 +79,7 @@ declare const _default: {
78
79
  };
79
80
  export default _default;
80
81
  declare const LinkButton: import("react").FC<import("./components/universal/buttons/LinkButton").LinkButtonProperties>, PureButton: import("react").FC<import("./components/universal/buttons/PureButton").PureButtonProperties>, RefreshButton: import("react").FC<import("./components/universal/buttons/RefreshButton").RefreshButtonProperties>, FormLeftRight: import("react").FC<import("./components/universal/form/FormLeftRight").FormLeftRightProperties>, FormObliterate: import("react").FC<import("./components/universal/form/FormObliterate").FormObliterateProperties>, Formbutton: import("react").FC<import("./components/universal/form/Formbutton").FormbuttonProperties>, Formitem: import("react").FC<import("./components/universal/form/Formitem").FormitemProperties>, Formline: import("react").FC<import("./components/universal/form/Formline").FormlineProperties>, GlobalStyles: import("styled-components").GlobalStyleComponent<import("./components/universal/general/GlobalStyles").IGlobalStyles, import("styled-components").DefaultTheme>, Dropdown: import("react").FC<import("./components/universal/inputs/Dropdown").DropdownProperties>, EntityPill: import("react").FC<import("./components/universal/inputs/EntityPill").EntityPillProperties>, EntityPillGroup: import("react").FC<import("./components/universal/inputs/EntityPillGroup").EntityPillGroupProperties>, InputBox: import("react").FC<import("./components/universal/inputs/InputBox").InputBoxProperties>, InputDescriptor: import("react").FC<import("./components/universal/inputs/InputDescriptor").InputDescriptorProperties>, InputLine: import("react").FC<import("./components/universal/inputs/InputLine").InputLineProperties>, InputSwitch: import("react").FC<import("./components/universal/inputs/InputSwitch").InputSwitchProperties>, Itemsline: import("react").FC<import("./components/universal/inputs/Itemsline").ItemslineProperties>, Select: import("react").FC<import("./components/universal/inputs/Select").PluridSelectProperties>, Slider: import("react").FC<import("./components/universal/inputs/Slider").SliderProperties>, Switch: import("react").FC<import("./components/universal/inputs/Switch").SwitchProperties>, Textline: import("react").ForwardRefExoticComponent<import("./components/universal/inputs/Textline").TextlineType>, HR: import("react").FC<import("./components/universal/markers/HR").HRProperties>, ProgressCircle: import("react").FC<import("./components/universal/markers/ProgressCircle").ProgressCircleProperties>, Spinner: import("react").FC<import("./components/universal/markers/Spinner").SpinnerProperties>, Tooltip: import("react").FC<import("./components/universal/markers/Tooltip").TooltipProperties>, Heading: import("react").FC<import("react").PropsWithChildren<import("./components/universal/typography/Heading").HeadingProperties>>, Paragraph: import("react").FC<import("react").PropsWithChildren<import("./components/universal/typography/Paragraph").ParagraphProperties>>, CopyableLine: import("react").FC<import("./components/universal/varia/CopyableLine").CopyableLineProperties>, NewPageLink: import("react").FC<import("./components/universal/varia/NewPageLink").NewPageLinkProperties>, ScrollableLine: import("react").FC<import("./components/universal/varia/ScrollableLine").ScrollableLineProperties>, TextItem: import("react").FC<import("./components/universal/varia/TextItem").TextItemProperties>;
81
- declare const EntityView: import("react").ForwardRefExoticComponent<import("./components/pluridal/containers/EntityView").EntityViewType>, Head: import("react-redux").ConnectedComponent<import("react").FC<import("./components/pluridal/head/Head").HeadProperties>, {
82
+ declare const DashboardsRenderer: import("react").FC<import("./components/pluridal/containers/DashboardsRenderer").DashboardsRendererProperties>, EntityView: import("react").ForwardRefExoticComponent<import("./components/pluridal/containers/EntityView").EntityViewType>, Head: import("react-redux").ConnectedComponent<import("react").FC<import("./components/pluridal/head/Head").HeadProperties>, {
82
83
  context: import("react").Context<any>;
83
84
  Helmet: any;
84
85
  defaults?: (Partial<import("@plurid/plurid-ui-state-react/distribution/modules/head").HeadState> & import("./components/pluridal/head/Head").HeadDefaults) | undefined;
@@ -109,4 +110,4 @@ declare const EntityView: import("react").ForwardRefExoticComponent<import("./co
109
110
  }>, ToolbarSpecific: import("react-redux").ConnectedComponent<import("react").FC<import("./components/pluridal/toolbars/ToolbarSpecific").ToolbarSpecificProperties>, {
110
111
  [x: string]: any;
111
112
  }>, VerticalToolbarButton: import("react").FC<import("./components/pluridal/toolbars/VerticalToolbarButton").VerticalToolbarButtonOwnProperties>;
112
- export { universal, pluridal, LinkButton, PureButton, RefreshButton, FormLeftRight, FormObliterate, Formbutton, Formitem, Formline, GlobalStyles, Dropdown, EntityPill, EntityPillGroup, InputBox, InputDescriptor, InputLine, InputSwitch, Itemsline, Select, Slider, Switch, Textline, HR, ProgressCircle, Spinner, Tooltip, Heading, Paragraph, CopyableLine, NewPageLink, ScrollableLine, TextItem, EntityView, Head, Notification, Notifications, SittingTray, HorizontalToolbarButton, ToolbarControls, ToolbarGeneral, ToolbarSpecific, VerticalToolbarButton, };
113
+ export { universal, pluridal, LinkButton, PureButton, RefreshButton, FormLeftRight, FormObliterate, Formbutton, Formitem, Formline, GlobalStyles, Dropdown, EntityPill, EntityPillGroup, InputBox, InputDescriptor, InputLine, InputSwitch, Itemsline, Select, Slider, Switch, Textline, HR, ProgressCircle, Spinner, Tooltip, Heading, Paragraph, CopyableLine, NewPageLink, ScrollableLine, TextItem, DashboardsRenderer, EntityView, Head, Notification, Notifications, SittingTray, HorizontalToolbarButton, ToolbarControls, ToolbarGeneral, ToolbarSpecific, VerticalToolbarButton, };
@@ -4,7 +4,7 @@ import themes, { plurid } from "@plurid/plurid-themes";
4
4
 
5
5
  import styled, { createGlobalStyle, css, keyframes } from "styled-components";
6
6
 
7
- import { PluridIconReset, PluridIconObliterate, PluridIconDelete, PluridIconCopy, PluridIconInfo, PluridIconPlay, PluridIconBranch, PluridIconNewStateline, PluridIconStateShareImage, PluridIconCopyCurrentState, PluridIconCopyStateHistory, PluridIconSittings, PluridIconSpeak } from "@plurid/plurid-icons-react";
7
+ import { PluridIconReset, PluridIconObliterate, PluridIconDelete, PluridIconCopy, PluridIconInfo, PluridIconSpace, PluridIconArrowRight, PluridIconDocuments, PluridIconExternalLink, PluridIconExit, PluridIconPlay, PluridIconBranch, PluridIconNewStateline, PluridIconStateShareImage, PluridIconCopyCurrentState, PluridIconCopyStateHistory, PluridIconSittings, PluridIconSpeak } from "@plurid/plurid-icons-react";
8
8
 
9
9
  import { mergeReferences, useMounted, useFalseAfterTimedTrue, useThrottledCallback, createMarkup } from "@plurid/plurid-functions-react";
10
10
 
@@ -2567,6 +2567,306 @@ const universal = {
2567
2567
  varia: varia
2568
2568
  };
2569
2569
 
2570
+ const StyledDashboardsRenderer = styled.div`
2571
+ display: grid;
2572
+ grid-template-columns: ${({fullRenderArea: fullRenderArea, compactSelectors: compactSelectors}) => {
2573
+ if (fullRenderArea) {
2574
+ return "1fr";
2575
+ }
2576
+ return compactSelectors ? "60px auto" : "1fr 4fr";
2577
+ }};
2578
+ min-height: 700px;
2579
+ `;
2580
+
2581
+ const StyledNoDashboardRender = styled.div`
2582
+ display: grid;
2583
+ place-content: center;
2584
+ `;
2585
+
2586
+ const StyledSidebar = styled.div`
2587
+ `;
2588
+
2589
+ const StyledSelectors = styled.div`
2590
+ height: 100%;
2591
+ display: grid;
2592
+ justify-content: space-between;
2593
+ grid-template-columns: 1fr;
2594
+ grid-template-rows: ${({helpItemsCount: helpItemsCount}) => `120px auto ${45 * helpItemsCount}px`};
2595
+
2596
+ background-color: ${({theme: theme}) => theme.backgroundColorTertiary};
2597
+ box-shadow: inset -3px 0px 3px 0px ${({theme: theme}) => theme.boxShadowUmbraColor};
2598
+
2599
+ ul {
2600
+ list-style: none;
2601
+ padding: 0;
2602
+ margin: 0;
2603
+ }
2604
+
2605
+ li {
2606
+ cursor: pointer;
2607
+ padding: 0.7rem 1.4rem;
2608
+ user-select: none;
2609
+ }
2610
+ `;
2611
+
2612
+ const StyledBranding = styled.div`
2613
+ display: grid;
2614
+ place-content: center;
2615
+ grid-gap: 0.5rem;
2616
+ height: 100%;
2617
+ font-size: 0.9rem;
2618
+ text-align: center;
2619
+ user-select: none;
2620
+
2621
+ img {
2622
+ cursor: pointer;
2623
+ }
2624
+ `;
2625
+
2626
+ const StyledHelp = styled.div`
2627
+ li {
2628
+ font-size: 0.9rem;
2629
+ }
2630
+ `;
2631
+
2632
+ const StyledHelpItem = styled.li`
2633
+ display: grid;
2634
+ align-items: center;
2635
+ grid-gap: 0.5rem;
2636
+ grid-template-columns: ${({compactSelectors: compactSelectors}) => compactSelectors ? "16px" : "16px auto 16px"};
2637
+ min-height: 45px;
2638
+ `;
2639
+
2640
+ const StyledSelector = styled.li`
2641
+ background-color: ${({theme: theme, selected: selected}) => selected ? theme.backgroundColorPrimary : "initial"};
2642
+
2643
+ :hover {
2644
+ background-color: ${({theme: theme}) => theme.backgroundColorPrimary};
2645
+ }
2646
+
2647
+ display: grid;
2648
+ grid-template-columns: ${({compactSelectors: compactSelectors}) => compactSelectors ? "16px" : "16px auto"};
2649
+ grid-gap: 0.7rem;
2650
+ min-height: 45px;
2651
+ align-items: center;
2652
+ position: relative;
2653
+ `;
2654
+
2655
+ const StyledSelectorRelativeLabel = styled.div`
2656
+ position: absolute;
2657
+ left: 50px;
2658
+ z-index: 9999;
2659
+ min-height: 45px;
2660
+ display: grid;
2661
+ align-items: center;
2662
+ padding-right: 0.5rem;
2663
+ background-color: ${({theme: theme}) => theme.backgroundColorPrimaryAlpha};
2664
+ `;
2665
+
2666
+ const Selector = properties => {
2667
+ const {data: data, selectedDashboard: selectedDashboard, compactSelectors: compactSelectors, theme: theme, setSelectedDashboard: setSelectedDashboard, rendererID: rendererID} = properties;
2668
+ const {id: id, icon: icon, label: label} = data;
2669
+ const Icon = icon;
2670
+ const selected = id === selectedDashboard;
2671
+ const [mouseOver, setMouseOver] = useState(false);
2672
+ useEffect((() => {
2673
+ let mounted = true;
2674
+ if (mouseOver) {
2675
+ setTimeout((() => {
2676
+ if (!mounted) {
2677
+ return;
2678
+ }
2679
+ setMouseOver(false);
2680
+ }), 2e3);
2681
+ }
2682
+ return () => {
2683
+ mounted = false;
2684
+ };
2685
+ }), [ mouseOver ]);
2686
+ const selectorIcon = !icon ? React.createElement(PluridIconSpace, {
2687
+ theme: theme
2688
+ }) : typeof icon === "function" ? React.createElement(Icon, {
2689
+ theme: theme
2690
+ }) : React.createElement(React.Fragment, null, icon);
2691
+ return React.createElement(StyledSelector, {
2692
+ key: (rendererID || "") + id,
2693
+ onClick: () => setSelectedDashboard(id),
2694
+ onMouseEnter: () => setMouseOver(true),
2695
+ onMouseLeave: () => setMouseOver(false),
2696
+ theme: theme,
2697
+ selected: selected,
2698
+ compactSelectors: compactSelectors
2699
+ }, selectorIcon, !compactSelectors && React.createElement("div", null, label), compactSelectors && mouseOver && React.createElement(StyledSelectorRelativeLabel, {
2700
+ theme: theme
2701
+ }, label));
2702
+ };
2703
+
2704
+ const Sidebar = properties => {
2705
+ const {dashboards: dashboards, theme: theme, compactSelectors: compactSelectors, setCompactSelectors: setCompactSelectors, selectedDashboard: selectedDashboard, setSelectedDashboard: setSelectedDashboard, identonym: identonym, usageType: usageType, openManual: openManual, logout: logout, rendererID: rendererID, brandingName: brandingName, brandingNameStyle: brandingNameStyle, brandingLogo: brandingLogo} = properties;
2706
+ const openManualCount = openManual ? 1 : 0;
2707
+ const usageTypeCount = usageType === "PRIVATE_USAGE" ? 1 : 0;
2708
+ const helpItemsCount = openManualCount + usageTypeCount;
2709
+ const [mouseOverSelectors, setMouseOverSelectors] = useState(false);
2710
+ const branding = React.createElement(StyledBranding, {
2711
+ compactSelectors: compactSelectors
2712
+ }, !compactSelectors && React.createElement(React.Fragment, null, React.createElement("div", null, brandingLogo && React.createElement("img", {
2713
+ src: brandingLogo,
2714
+ alt: "icon",
2715
+ height: 40,
2716
+ onClick: () => {
2717
+ setCompactSelectors(true);
2718
+ setMouseOverSelectors(false);
2719
+ }
2720
+ })), brandingName && React.createElement("div", {
2721
+ style: brandingNameStyle
2722
+ }, brandingName)), compactSelectors && mouseOverSelectors && React.createElement(React.Fragment, null, React.createElement(PluridIconArrowRight, {
2723
+ atClick: () => setCompactSelectors(false)
2724
+ }), React.createElement("div", null, "ㅤ")));
2725
+ const selectors = React.createElement("ul", null, dashboards.map((dashboard => React.createElement(Selector, {
2726
+ key: dashboard.id,
2727
+ data: dashboard,
2728
+ compactSelectors: compactSelectors,
2729
+ theme: theme,
2730
+ selectedDashboard: selectedDashboard,
2731
+ setSelectedDashboard: setSelectedDashboard,
2732
+ rendererID: rendererID
2733
+ }))));
2734
+ const help = React.createElement(StyledHelp, null, mouseOverSelectors && React.createElement("ul", null, openManual && React.createElement(StyledHelpItem, {
2735
+ onClick: () => openManual(),
2736
+ compactSelectors: compactSelectors
2737
+ }, React.createElement(PluridIconDocuments, null), !compactSelectors && React.createElement(React.Fragment, null, React.createElement("div", null, "manual"), React.createElement(PluridIconExternalLink, null))), usageType === "PRIVATE_USAGE" && logout && React.createElement(StyledHelpItem, {
2738
+ onClick: () => logout(),
2739
+ compactSelectors: compactSelectors
2740
+ }, React.createElement(PluridIconExit, null), !compactSelectors && React.createElement(React.Fragment, null, React.createElement("div", null, "logout (", identonym, ")"), React.createElement("div", null)))));
2741
+ return React.createElement(StyledSidebar, {
2742
+ theme: theme
2743
+ }, React.createElement(StyledSelectors, {
2744
+ onMouseEnter: () => setMouseOverSelectors(true),
2745
+ onMouseLeave: () => setMouseOverSelectors(false),
2746
+ theme: theme,
2747
+ compactSelectors: compactSelectors,
2748
+ helpItemsCount: helpItemsCount
2749
+ }, branding, selectors, help));
2750
+ };
2751
+
2752
+ const StyledRenderArea = styled.div`
2753
+ `;
2754
+
2755
+ const RenderArea = properties => {
2756
+ const {dashboards: dashboards, selectedDashboard: selectedDashboard, renderView: renderView, fullRenderArea: fullRenderArea, theme: theme, setSelectedDashboard: setSelectedDashboard, setRenderView: setRenderView, setFullRenderArea: setFullRenderArea} = properties;
2757
+ const dashboard = dashboards.find((dashboard => dashboard.id === selectedDashboard));
2758
+ if (!dashboard) {
2759
+ return React.createElement(React.Fragment, null);
2760
+ }
2761
+ const resolveView = () => {
2762
+ const dashboard = dashboards.find((dashboard => dashboard.id === selectedDashboard));
2763
+ if (!dashboard) {
2764
+ return;
2765
+ }
2766
+ const renderViewInDashboard = dashboard.renderers[renderView];
2767
+ if (renderViewInDashboard) {
2768
+ return renderView;
2769
+ }
2770
+ if (dashboard.defaultRender) {
2771
+ return dashboard.defaultRender;
2772
+ }
2773
+ return Object.keys(dashboard.renderers)[0];
2774
+ };
2775
+ const renderID = resolveView();
2776
+ useEffect((() => {
2777
+ if (renderID && renderID !== renderView) {
2778
+ setRenderView(renderID);
2779
+ }
2780
+ }), [ renderID ]);
2781
+ if (!renderID) {
2782
+ return React.createElement(React.Fragment, null);
2783
+ }
2784
+ const DashboardRender = dashboard.renderers[renderID];
2785
+ if (!DashboardRender) {
2786
+ return React.createElement(React.Fragment, null);
2787
+ }
2788
+ return React.createElement(StyledRenderArea, {
2789
+ theme: theme
2790
+ }, React.createElement(DashboardRender, {
2791
+ theme: theme,
2792
+ selectedDashboard: selectedDashboard,
2793
+ setSelectedDashboard: setSelectedDashboard,
2794
+ renderView: renderView,
2795
+ setRenderView: setRenderView,
2796
+ fullRenderArea: fullRenderArea,
2797
+ setFullRenderArea: setFullRenderArea
2798
+ }));
2799
+ };
2800
+
2801
+ const DashboardsRenderer$1 = properties => {
2802
+ const {dashboards: dashboards, theme: theme, rendererID: rendererID, identonym: identonym, usageType: usageType, brandingName: brandingName, brandingNameStyle: brandingNameStyle, brandingLogo: brandingLogo, activeDashboard: activeDashboard, activeRender: activeRender, compactSelectors: compactSelectorsProperty, fullRenderArea: fullRenderAreaProperty, noDashboardRender: noDashboardRender, atDashboardChange: atDashboardChange, atUIChange: atUIChange, openManual: openManual, logout: logout} = properties;
2803
+ const [compactSelectors, setCompactSelectors] = useState(compactSelectorsProperty !== null && compactSelectorsProperty !== void 0 ? compactSelectorsProperty : false);
2804
+ const [fullRenderArea, setFullRenderArea] = useState(fullRenderAreaProperty !== null && fullRenderAreaProperty !== void 0 ? fullRenderAreaProperty : false);
2805
+ const [selectedDashboard, setSelectedDashboard] = useState(activeDashboard || "");
2806
+ const [renderView, setRenderView] = useState(activeRender || "");
2807
+ useEffect((() => {
2808
+ if (!activeDashboard) {
2809
+ return;
2810
+ }
2811
+ if (selectedDashboard === activeDashboard) {
2812
+ return;
2813
+ }
2814
+ setSelectedDashboard(activeDashboard);
2815
+ }), [ activeDashboard ]);
2816
+ useEffect((() => {
2817
+ if (atDashboardChange) {
2818
+ atDashboardChange(renderView);
2819
+ }
2820
+ }), [ renderView ]);
2821
+ useEffect((() => {
2822
+ if (typeof compactSelectorsProperty === "boolean") {
2823
+ setCompactSelectors(compactSelectorsProperty);
2824
+ }
2825
+ if (typeof fullRenderAreaProperty === "boolean") {
2826
+ setFullRenderArea(fullRenderAreaProperty);
2827
+ }
2828
+ }), [ compactSelectorsProperty, fullRenderAreaProperty ]);
2829
+ useEffect((() => {
2830
+ if (atUIChange) {
2831
+ atUIChange("compactSelectors", compactSelectors);
2832
+ }
2833
+ }), [ compactSelectors ]);
2834
+ useEffect((() => {
2835
+ if (atUIChange) {
2836
+ atUIChange("fullRenderArea", fullRenderArea);
2837
+ }
2838
+ }), [ fullRenderArea ]);
2839
+ return React.createElement(StyledDashboardsRenderer, {
2840
+ theme: theme,
2841
+ compactSelectors: compactSelectors,
2842
+ fullRenderArea: fullRenderArea
2843
+ }, !fullRenderArea && React.createElement(Sidebar, {
2844
+ dashboards: dashboards,
2845
+ theme: theme,
2846
+ compactSelectors: compactSelectors,
2847
+ setCompactSelectors: setCompactSelectors,
2848
+ selectedDashboard: selectedDashboard,
2849
+ setSelectedDashboard: setSelectedDashboard,
2850
+ identonym: identonym,
2851
+ usageType: usageType,
2852
+ openManual: openManual,
2853
+ logout: logout,
2854
+ rendererID: rendererID,
2855
+ brandingName: brandingName,
2856
+ brandingNameStyle: brandingNameStyle,
2857
+ brandingLogo: brandingLogo
2858
+ }), selectedDashboard && React.createElement(RenderArea, {
2859
+ dashboards: dashboards,
2860
+ selectedDashboard: selectedDashboard,
2861
+ setSelectedDashboard: setSelectedDashboard,
2862
+ renderView: renderView,
2863
+ setRenderView: setRenderView,
2864
+ fullRenderArea: fullRenderArea,
2865
+ setFullRenderArea: setFullRenderArea,
2866
+ theme: theme
2867
+ }), !selectedDashboard && noDashboardRender && React.createElement(StyledNoDashboardRender, null, noDashboardRender));
2868
+ };
2869
+
2570
2870
  const StyledEntityView = styled.div`
2571
2871
  position: relative;
2572
2872
  height: 100%;
@@ -2814,6 +3114,7 @@ const EntityView$1 = forwardRef(((properties, reference) => {
2814
3114
  }));
2815
3115
 
2816
3116
  const containers = {
3117
+ DashboardsRenderer: DashboardsRenderer$1,
2817
3118
  EntityView: EntityView$1
2818
3119
  };
2819
3120
 
@@ -3962,7 +4263,7 @@ var index = Object.assign(Object.assign(Object.assign(Object.assign(Object.assig
3962
4263
 
3963
4264
  const {buttons: {LinkButton: LinkButton, PureButton: PureButton, RefreshButton: RefreshButton}, form: {FormLeftRight: FormLeftRight, FormObliterate: FormObliterate, Formbutton: Formbutton, Formitem: Formitem, Formline: Formline}, general: {GlobalStyles: GlobalStyles}, inputs: {Dropdown: Dropdown, EntityPill: EntityPill, EntityPillGroup: EntityPillGroup, InputBox: InputBox, InputDescriptor: InputDescriptor, InputLine: InputLine, InputSwitch: InputSwitch, Itemsline: Itemsline, Select: Select, Slider: Slider, Switch: Switch, Textline: Textline}, markers: {HR: HR, ProgressCircle: ProgressCircle, Spinner: Spinner, Tooltip: Tooltip}, typography: {Heading: Heading, Paragraph: Paragraph}, varia: {CopyableLine: CopyableLine, NewPageLink: NewPageLink, ScrollableLine: ScrollableLine, TextItem: TextItem}} = universal;
3964
4265
 
3965
- const {containers: {EntityView: EntityView}, head: {Head: Head}, notifications: {Notification: Notification, Notifications: Notifications}, sitting: {SittingTray: SittingTray}, toolbars: {HorizontalToolbarButton: HorizontalToolbarButton, ToolbarControls: ToolbarControls, ToolbarGeneral: ToolbarGeneral, ToolbarSpecific: ToolbarSpecific, VerticalToolbarButton: VerticalToolbarButton}} = pluridal;
4266
+ const {containers: {DashboardsRenderer: DashboardsRenderer, EntityView: EntityView}, head: {Head: Head}, notifications: {Notification: Notification, Notifications: Notifications}, sitting: {SittingTray: SittingTray}, toolbars: {HorizontalToolbarButton: HorizontalToolbarButton, ToolbarControls: ToolbarControls, ToolbarGeneral: ToolbarGeneral, ToolbarSpecific: ToolbarSpecific, VerticalToolbarButton: VerticalToolbarButton}} = pluridal;
3966
4267
 
3967
- export { CopyableLine, Dropdown, EntityPill, EntityPillGroup, EntityView, FormLeftRight, FormObliterate, Formbutton, Formitem, Formline, GlobalStyles, HR, Head, Heading, HorizontalPositions, HorizontalToolbarButton, InputBox, InputDescriptor, InputLine, InputSwitch, Itemsline, LinkButton, NewPageLink, Notification, Notifications, Paragraph, ProgressCircle, PureButton, RefreshButton, ScrollableLine, Select, SittingTray, SizeTypes, Slider, Spinner, Switch, TextItem, Textline, ToolbarControls, ToolbarGeneral, ToolbarSpecific, Tooltip, VerticalPositions, VerticalToolbarButton, index as default, pluridal, universal };
4268
+ export { CopyableLine, DashboardsRenderer, Dropdown, EntityPill, EntityPillGroup, EntityView, FormLeftRight, FormObliterate, Formbutton, Formitem, Formline, GlobalStyles, HR, Head, Heading, HorizontalPositions, HorizontalToolbarButton, InputBox, InputDescriptor, InputLine, InputSwitch, Itemsline, LinkButton, NewPageLink, Notification, Notifications, Paragraph, ProgressCircle, PureButton, RefreshButton, ScrollableLine, Select, SittingTray, SizeTypes, Slider, Spinner, Switch, TextItem, Textline, ToolbarControls, ToolbarGeneral, ToolbarSpecific, Tooltip, VerticalPositions, VerticalToolbarButton, index as default, pluridal, universal };
3968
4269
  //# sourceMappingURL=index.es.js.map