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

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: {
@@ -9,6 +9,7 @@ export interface DropdownProperties {
9
9
  kind?: string;
10
10
  listTop?: string;
11
11
  dropdownToggled?: boolean;
12
+ dropdownSign?: string | boolean;
12
13
  /**
13
14
  * Hide dropdown after click selection.
14
15
  *
@@ -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
 
@@ -1228,12 +1228,13 @@ const StyledFilterUpdate = styled.div`
1228
1228
  `;
1229
1229
 
1230
1230
  const Dropdown$1 = properties => {
1231
- const {selected: selected, selectables: selectables, atSelect: atSelect, left: left, kind: kind, listTop: listTop, dropdownToggled: dropdownToggled, hideAtSelect: hideAtSelect, selectAtHover: selectAtHover, selectedColor: selectedColor, filterable: filterable, style: style, className: className, theme: themeProperty, generalTheme: generalThemeProperty, interactionTheme: interactionThemeProperty, level: level, heightItems: heightItems, width: width, setDropdownToggled: setDropdownToggled, filterUpdate: filterUpdate} = properties;
1231
+ const {selected: selected, selectables: selectables, atSelect: atSelect, left: left, kind: kind, listTop: listTop, dropdownToggled: dropdownToggled, dropdownSign: dropdownSign, hideAtSelect: hideAtSelect, selectAtHover: selectAtHover, selectedColor: selectedColor, filterable: filterable, style: style, className: className, theme: themeProperty, generalTheme: generalThemeProperty, interactionTheme: interactionThemeProperty, level: level, heightItems: heightItems, width: width, setDropdownToggled: setDropdownToggled, filterUpdate: filterUpdate} = properties;
1232
1232
  const _generalTheme = generalThemeProperty === undefined ? themeProperty === undefined ? plurid : themeProperty : generalThemeProperty;
1233
1233
  const _interactionTheme = interactionThemeProperty === undefined ? themeProperty === undefined ? plurid : themeProperty : interactionThemeProperty;
1234
1234
  const _level = level !== null && level !== void 0 ? level : 0;
1235
1235
  const _hideAtSelect = hideAtSelect !== null && hideAtSelect !== void 0 ? hideAtSelect : true;
1236
1236
  const _selectAtHover = selectAtHover !== null && selectAtHover !== void 0 ? selectAtHover : false;
1237
+ const _dropdownSign = typeof dropdownSign === "string" ? dropdownSign : !dropdownSign ? "" : "▼";
1237
1238
  const isMounted = useRef(true);
1238
1239
  const filterInput = useRef(null);
1239
1240
  const [generalTheme, setGeneralTheme] = useState(_generalTheme);
@@ -1397,7 +1398,7 @@ const Dropdown$1 = properties => {
1397
1398
  },
1398
1399
  theme: generalTheme,
1399
1400
  selectedColor: selectedColor
1400
- }, typeof selected === "string" ? selected : selected.value), showList && React.createElement(StyledDropdownList, {
1401
+ }, typeof selected === "string" ? selected : selected.value, _dropdownSign && React.createElement(React.Fragment, null, " ", _dropdownSign)), showList && React.createElement(StyledDropdownList, {
1401
1402
  theme: interactionTheme,
1402
1403
  left: left,
1403
1404
  listTop: listTop,
@@ -2567,6 +2568,306 @@ const universal = {
2567
2568
  varia: varia
2568
2569
  };
2569
2570
 
2571
+ const StyledDashboardsRenderer = styled.div`
2572
+ display: grid;
2573
+ grid-template-columns: ${({fullRenderArea: fullRenderArea, compactSelectors: compactSelectors}) => {
2574
+ if (fullRenderArea) {
2575
+ return "1fr";
2576
+ }
2577
+ return compactSelectors ? "60px auto" : "1fr 4fr";
2578
+ }};
2579
+ min-height: 700px;
2580
+ `;
2581
+
2582
+ const StyledNoDashboardRender = styled.div`
2583
+ display: grid;
2584
+ place-content: center;
2585
+ `;
2586
+
2587
+ const StyledSidebar = styled.div`
2588
+ `;
2589
+
2590
+ const StyledSelectors = styled.div`
2591
+ height: 100%;
2592
+ display: grid;
2593
+ justify-content: space-between;
2594
+ grid-template-columns: 1fr;
2595
+ grid-template-rows: ${({helpItemsCount: helpItemsCount}) => `120px auto ${45 * helpItemsCount}px`};
2596
+
2597
+ background-color: ${({theme: theme}) => theme.backgroundColorTertiary};
2598
+ box-shadow: inset -3px 0px 3px 0px ${({theme: theme}) => theme.boxShadowUmbraColor};
2599
+
2600
+ ul {
2601
+ list-style: none;
2602
+ padding: 0;
2603
+ margin: 0;
2604
+ }
2605
+
2606
+ li {
2607
+ cursor: pointer;
2608
+ padding: 0.7rem 1.4rem;
2609
+ user-select: none;
2610
+ }
2611
+ `;
2612
+
2613
+ const StyledBranding = styled.div`
2614
+ display: grid;
2615
+ place-content: center;
2616
+ grid-gap: 0.5rem;
2617
+ height: 100%;
2618
+ font-size: 0.9rem;
2619
+ text-align: center;
2620
+ user-select: none;
2621
+
2622
+ img {
2623
+ cursor: pointer;
2624
+ }
2625
+ `;
2626
+
2627
+ const StyledHelp = styled.div`
2628
+ li {
2629
+ font-size: 0.9rem;
2630
+ }
2631
+ `;
2632
+
2633
+ const StyledHelpItem = styled.li`
2634
+ display: grid;
2635
+ align-items: center;
2636
+ grid-gap: 0.5rem;
2637
+ grid-template-columns: ${({compactSelectors: compactSelectors}) => compactSelectors ? "16px" : "16px auto 16px"};
2638
+ min-height: 45px;
2639
+ `;
2640
+
2641
+ const StyledSelector = styled.li`
2642
+ background-color: ${({theme: theme, selected: selected}) => selected ? theme.backgroundColorPrimary : "initial"};
2643
+
2644
+ :hover {
2645
+ background-color: ${({theme: theme}) => theme.backgroundColorPrimary};
2646
+ }
2647
+
2648
+ display: grid;
2649
+ grid-template-columns: ${({compactSelectors: compactSelectors}) => compactSelectors ? "16px" : "16px auto"};
2650
+ grid-gap: 0.7rem;
2651
+ min-height: 45px;
2652
+ align-items: center;
2653
+ position: relative;
2654
+ `;
2655
+
2656
+ const StyledSelectorRelativeLabel = styled.div`
2657
+ position: absolute;
2658
+ left: 50px;
2659
+ z-index: 9999;
2660
+ min-height: 45px;
2661
+ display: grid;
2662
+ align-items: center;
2663
+ padding-right: 0.5rem;
2664
+ background-color: ${({theme: theme}) => theme.backgroundColorPrimaryAlpha};
2665
+ `;
2666
+
2667
+ const Selector = properties => {
2668
+ const {data: data, selectedDashboard: selectedDashboard, compactSelectors: compactSelectors, theme: theme, setSelectedDashboard: setSelectedDashboard, rendererID: rendererID} = properties;
2669
+ const {id: id, icon: icon, label: label} = data;
2670
+ const Icon = icon;
2671
+ const selected = id === selectedDashboard;
2672
+ const [mouseOver, setMouseOver] = useState(false);
2673
+ useEffect((() => {
2674
+ let mounted = true;
2675
+ if (mouseOver) {
2676
+ setTimeout((() => {
2677
+ if (!mounted) {
2678
+ return;
2679
+ }
2680
+ setMouseOver(false);
2681
+ }), 2e3);
2682
+ }
2683
+ return () => {
2684
+ mounted = false;
2685
+ };
2686
+ }), [ mouseOver ]);
2687
+ const selectorIcon = !icon ? React.createElement(PluridIconSpace, {
2688
+ theme: theme
2689
+ }) : typeof icon === "function" ? React.createElement(Icon, {
2690
+ theme: theme
2691
+ }) : React.createElement(React.Fragment, null, icon);
2692
+ return React.createElement(StyledSelector, {
2693
+ key: (rendererID || "") + id,
2694
+ onClick: () => setSelectedDashboard(id),
2695
+ onMouseEnter: () => setMouseOver(true),
2696
+ onMouseLeave: () => setMouseOver(false),
2697
+ theme: theme,
2698
+ selected: selected,
2699
+ compactSelectors: compactSelectors
2700
+ }, selectorIcon, !compactSelectors && React.createElement("div", null, label), compactSelectors && mouseOver && React.createElement(StyledSelectorRelativeLabel, {
2701
+ theme: theme
2702
+ }, label));
2703
+ };
2704
+
2705
+ const Sidebar = properties => {
2706
+ 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;
2707
+ const openManualCount = openManual ? 1 : 0;
2708
+ const usageTypeCount = usageType === "PRIVATE_USAGE" && logout ? 1 : 0;
2709
+ const helpItemsCount = openManualCount + usageTypeCount;
2710
+ const [mouseOverSelectors, setMouseOverSelectors] = useState(false);
2711
+ const branding = React.createElement(StyledBranding, {
2712
+ compactSelectors: compactSelectors
2713
+ }, !compactSelectors && React.createElement(React.Fragment, null, React.createElement("div", null, brandingLogo && React.createElement("img", {
2714
+ src: brandingLogo,
2715
+ alt: "icon",
2716
+ height: 40,
2717
+ onClick: () => {
2718
+ setCompactSelectors(true);
2719
+ setMouseOverSelectors(false);
2720
+ }
2721
+ })), brandingName && React.createElement("div", {
2722
+ style: brandingNameStyle
2723
+ }, brandingName)), compactSelectors && mouseOverSelectors && React.createElement(React.Fragment, null, React.createElement(PluridIconArrowRight, {
2724
+ atClick: () => setCompactSelectors(false)
2725
+ }), React.createElement("div", null, "ㅤ")));
2726
+ const selectors = React.createElement("ul", null, dashboards.map((dashboard => React.createElement(Selector, {
2727
+ key: dashboard.id,
2728
+ data: dashboard,
2729
+ compactSelectors: compactSelectors,
2730
+ theme: theme,
2731
+ selectedDashboard: selectedDashboard,
2732
+ setSelectedDashboard: setSelectedDashboard,
2733
+ rendererID: rendererID
2734
+ }))));
2735
+ const help = React.createElement(StyledHelp, null, mouseOverSelectors && React.createElement("ul", null, openManual && React.createElement(StyledHelpItem, {
2736
+ onClick: () => openManual(),
2737
+ compactSelectors: compactSelectors
2738
+ }, 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, {
2739
+ onClick: () => logout(),
2740
+ compactSelectors: compactSelectors
2741
+ }, React.createElement(PluridIconExit, null), !compactSelectors && React.createElement(React.Fragment, null, React.createElement("div", null, "logout (", identonym, ")"), React.createElement("div", null)))));
2742
+ return React.createElement(StyledSidebar, {
2743
+ theme: theme
2744
+ }, React.createElement(StyledSelectors, {
2745
+ onMouseEnter: () => setMouseOverSelectors(true),
2746
+ onMouseLeave: () => setMouseOverSelectors(false),
2747
+ theme: theme,
2748
+ compactSelectors: compactSelectors,
2749
+ helpItemsCount: helpItemsCount
2750
+ }, branding, selectors, help));
2751
+ };
2752
+
2753
+ const StyledRenderArea = styled.div`
2754
+ `;
2755
+
2756
+ const RenderArea = properties => {
2757
+ const {dashboards: dashboards, selectedDashboard: selectedDashboard, renderView: renderView, fullRenderArea: fullRenderArea, theme: theme, setSelectedDashboard: setSelectedDashboard, setRenderView: setRenderView, setFullRenderArea: setFullRenderArea} = properties;
2758
+ const dashboard = dashboards.find((dashboard => dashboard.id === selectedDashboard));
2759
+ if (!dashboard) {
2760
+ return React.createElement(React.Fragment, null);
2761
+ }
2762
+ const resolveView = () => {
2763
+ const dashboard = dashboards.find((dashboard => dashboard.id === selectedDashboard));
2764
+ if (!dashboard) {
2765
+ return;
2766
+ }
2767
+ const renderViewInDashboard = dashboard.renderers[renderView];
2768
+ if (renderViewInDashboard) {
2769
+ return renderView;
2770
+ }
2771
+ if (dashboard.defaultRender) {
2772
+ return dashboard.defaultRender;
2773
+ }
2774
+ return Object.keys(dashboard.renderers)[0];
2775
+ };
2776
+ const renderID = resolveView();
2777
+ useEffect((() => {
2778
+ if (renderID && renderID !== renderView) {
2779
+ setRenderView(renderID);
2780
+ }
2781
+ }), [ renderID ]);
2782
+ if (!renderID) {
2783
+ return React.createElement(React.Fragment, null);
2784
+ }
2785
+ const DashboardRender = dashboard.renderers[renderID];
2786
+ if (!DashboardRender) {
2787
+ return React.createElement(React.Fragment, null);
2788
+ }
2789
+ return React.createElement(StyledRenderArea, {
2790
+ theme: theme
2791
+ }, React.createElement(DashboardRender, {
2792
+ theme: theme,
2793
+ selectedDashboard: selectedDashboard,
2794
+ setSelectedDashboard: setSelectedDashboard,
2795
+ renderView: renderView,
2796
+ setRenderView: setRenderView,
2797
+ fullRenderArea: fullRenderArea,
2798
+ setFullRenderArea: setFullRenderArea
2799
+ }));
2800
+ };
2801
+
2802
+ const DashboardsRenderer$1 = properties => {
2803
+ 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;
2804
+ const [compactSelectors, setCompactSelectors] = useState(compactSelectorsProperty !== null && compactSelectorsProperty !== void 0 ? compactSelectorsProperty : false);
2805
+ const [fullRenderArea, setFullRenderArea] = useState(fullRenderAreaProperty !== null && fullRenderAreaProperty !== void 0 ? fullRenderAreaProperty : false);
2806
+ const [selectedDashboard, setSelectedDashboard] = useState(activeDashboard || "");
2807
+ const [renderView, setRenderView] = useState(activeRender || "");
2808
+ useEffect((() => {
2809
+ if (!activeDashboard) {
2810
+ return;
2811
+ }
2812
+ if (selectedDashboard === activeDashboard) {
2813
+ return;
2814
+ }
2815
+ setSelectedDashboard(activeDashboard);
2816
+ }), [ activeDashboard ]);
2817
+ useEffect((() => {
2818
+ if (atDashboardChange) {
2819
+ atDashboardChange(renderView);
2820
+ }
2821
+ }), [ renderView ]);
2822
+ useEffect((() => {
2823
+ if (typeof compactSelectorsProperty === "boolean") {
2824
+ setCompactSelectors(compactSelectorsProperty);
2825
+ }
2826
+ if (typeof fullRenderAreaProperty === "boolean") {
2827
+ setFullRenderArea(fullRenderAreaProperty);
2828
+ }
2829
+ }), [ compactSelectorsProperty, fullRenderAreaProperty ]);
2830
+ useEffect((() => {
2831
+ if (atUIChange) {
2832
+ atUIChange("compactSelectors", compactSelectors);
2833
+ }
2834
+ }), [ compactSelectors ]);
2835
+ useEffect((() => {
2836
+ if (atUIChange) {
2837
+ atUIChange("fullRenderArea", fullRenderArea);
2838
+ }
2839
+ }), [ fullRenderArea ]);
2840
+ return React.createElement(StyledDashboardsRenderer, {
2841
+ theme: theme,
2842
+ compactSelectors: compactSelectors,
2843
+ fullRenderArea: fullRenderArea
2844
+ }, !fullRenderArea && React.createElement(Sidebar, {
2845
+ dashboards: dashboards,
2846
+ theme: theme,
2847
+ compactSelectors: compactSelectors,
2848
+ setCompactSelectors: setCompactSelectors,
2849
+ selectedDashboard: selectedDashboard,
2850
+ setSelectedDashboard: setSelectedDashboard,
2851
+ identonym: identonym,
2852
+ usageType: usageType,
2853
+ openManual: openManual,
2854
+ logout: logout,
2855
+ rendererID: rendererID,
2856
+ brandingName: brandingName,
2857
+ brandingNameStyle: brandingNameStyle,
2858
+ brandingLogo: brandingLogo
2859
+ }), selectedDashboard && React.createElement(RenderArea, {
2860
+ dashboards: dashboards,
2861
+ selectedDashboard: selectedDashboard,
2862
+ setSelectedDashboard: setSelectedDashboard,
2863
+ renderView: renderView,
2864
+ setRenderView: setRenderView,
2865
+ fullRenderArea: fullRenderArea,
2866
+ setFullRenderArea: setFullRenderArea,
2867
+ theme: theme
2868
+ }), !selectedDashboard && noDashboardRender && React.createElement(StyledNoDashboardRender, null, noDashboardRender));
2869
+ };
2870
+
2570
2871
  const StyledEntityView = styled.div`
2571
2872
  position: relative;
2572
2873
  height: 100%;
@@ -2814,6 +3115,7 @@ const EntityView$1 = forwardRef(((properties, reference) => {
2814
3115
  }));
2815
3116
 
2816
3117
  const containers = {
3118
+ DashboardsRenderer: DashboardsRenderer$1,
2817
3119
  EntityView: EntityView$1
2818
3120
  };
2819
3121
 
@@ -3962,7 +4264,7 @@ var index = Object.assign(Object.assign(Object.assign(Object.assign(Object.assig
3962
4264
 
3963
4265
  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
4266
 
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;
4267
+ 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
4268
 
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 };
4269
+ 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
4270
  //# sourceMappingURL=index.es.js.map