@evergis/react 3.1.105 → 3.1.106
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.
- package/dist/components/Dashboard/headers/DashboardDefaultHeader/styled.d.ts +1 -3
- package/dist/components/Dashboard/hooks/useWidgetContext.d.ts +2 -1
- package/dist/contexts/DashboardContext/types.d.ts +2 -1
- package/dist/index.js +61 -16
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +61 -16
- package/dist/react.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -4,8 +4,6 @@ export declare const DefaultHeaderContainer: import('styled-components').StyledC
|
|
|
4
4
|
}, never>;
|
|
5
5
|
export declare const TopContainer: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps, never>;
|
|
6
6
|
export declare const TopContainerButtons: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps, never>;
|
|
7
|
-
export declare const PaginationDivider: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').DividerProps & {
|
|
8
|
-
vertical: boolean;
|
|
9
|
-
}, "vertical">;
|
|
10
7
|
export declare const LogoContainer: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps, never>;
|
|
11
8
|
export declare const PageTitle: import('styled-components').StyledComponent<"h2", any, {}, never>;
|
|
9
|
+
export declare const PageTitleContainer: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps, never>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { WidgetType } from '../types';
|
|
2
2
|
export declare const useWidgetContext: (type?: WidgetType) => {
|
|
3
|
+
toggleLayersVisibility: VoidFunction;
|
|
4
|
+
visibleLayers: boolean;
|
|
3
5
|
projectInfo: import('@evergis/api').ExtendedProjectInfoDc;
|
|
4
6
|
layerInfos: import('../../..').LayerInfo[];
|
|
5
7
|
updateProject: (projectInfo: import('@evergis/api').ExtendedProjectInfoDc) => void;
|
|
@@ -17,7 +19,6 @@ export declare const useWidgetContext: (type?: WidgetType) => {
|
|
|
17
19
|
changeControls: (controls: Record<string, string>) => void;
|
|
18
20
|
components: {
|
|
19
21
|
LayerItem?: import('react').FC<import('../..').LayerItemProps>;
|
|
20
|
-
ProjectCatalogMenu?: import('react').FC;
|
|
21
22
|
ProjectPanelMenu?: import('react').FC;
|
|
22
23
|
ProjectPagesMenu?: import('react').FC;
|
|
23
24
|
};
|
|
@@ -19,10 +19,11 @@ export type DashboardContextProps = PropsWithChildren<{
|
|
|
19
19
|
selectedTabId?: string;
|
|
20
20
|
components?: {
|
|
21
21
|
LayerItem?: FC<LayerItemProps>;
|
|
22
|
-
ProjectCatalogMenu?: FC;
|
|
23
22
|
ProjectPanelMenu?: FC;
|
|
24
23
|
ProjectPagesMenu?: FC;
|
|
25
24
|
};
|
|
25
|
+
toggleLayersVisibility: VoidFunction;
|
|
26
|
+
visibleLayers: boolean;
|
|
26
27
|
changeFilters?: (filters: SelectedFilters, resetFilters?: string[]) => void;
|
|
27
28
|
expandedContainers?: Record<string, boolean>;
|
|
28
29
|
expandContainer?: (id: string, expanded?: boolean) => void;
|
package/dist/index.js
CHANGED
|
@@ -4016,9 +4016,11 @@ const ServerNotificationsProvider = ({ url, initialized, children }) => {
|
|
|
4016
4016
|
};
|
|
4017
4017
|
|
|
4018
4018
|
const useWidgetContext = (type = exports.WidgetType.Dashboard) => {
|
|
4019
|
-
const { projectInfo, updateProject, layerInfos, geometryFilter, dashboardLayers, setDashboardLayer, components: dashboardComponents, config: dashboardConfig, containerIds, pageIndex: projectPageIndex, selectedTabId: projectSelectedTabId, setSelectedTabId: setProjectSelectedTabId, dataSources: projectDataSources, loading: projectLoading, editMode: projectEditMode, filters: projectFilters, changeFilters: projectChangeFilters, expandContainer: projectExpandContainer, expandedContainers: projectExpandedContainers, nextPage: projectNextPage, prevPage: projectPrevPage, changePage: projectChangePage, } = React.useContext(DashboardContext) || {};
|
|
4019
|
+
const { toggleLayersVisibility, visibleLayers, projectInfo, updateProject, layerInfos, geometryFilter, dashboardLayers, setDashboardLayer, components: dashboardComponents, config: dashboardConfig, containerIds, pageIndex: projectPageIndex, selectedTabId: projectSelectedTabId, setSelectedTabId: setProjectSelectedTabId, dataSources: projectDataSources, loading: projectLoading, editMode: projectEditMode, filters: projectFilters, changeFilters: projectChangeFilters, expandContainer: projectExpandContainer, expandedContainers: projectExpandedContainers, nextPage: projectNextPage, prevPage: projectPrevPage, changePage: projectChangePage, } = React.useContext(DashboardContext) || {};
|
|
4020
4020
|
const { layerInfo, attributes, feature, controls, changeControls, closeFeatureCard, config: featureConfig, pageIndex: featurePageIndex, selectedTabId: featureSelectedTabId, setSelectedTabId: setFeatureSelectedTabId, dataSources: featureDataSources, loading: featureLoading, editMode: featureEditMode, filters: featureFilters, changeFilters: featureChangeFilters, expandContainer: featureExpandContainer, expandedContainers: featureExpandedContainers, nextPage: featureNextPage, prevPage: featurePrevPage, changePage: featureChangePage, } = React.useContext(FeatureCardContext) || {};
|
|
4021
4021
|
return {
|
|
4022
|
+
toggleLayersVisibility,
|
|
4023
|
+
visibleLayers,
|
|
4022
4024
|
projectInfo,
|
|
4023
4025
|
layerInfos,
|
|
4024
4026
|
updateProject,
|
|
@@ -7469,13 +7471,6 @@ const TopContainerButtons = styled(uilibGl.Flex) `
|
|
|
7469
7471
|
padding: 0 0.5rem;
|
|
7470
7472
|
}
|
|
7471
7473
|
`;
|
|
7472
|
-
const PaginationDivider = styled(uilibGl.Divider).attrs(() => ({
|
|
7473
|
-
vertical: true,
|
|
7474
|
-
})) `
|
|
7475
|
-
height: 0.875rem;
|
|
7476
|
-
margin: 0 0.5rem 0 0.75rem;
|
|
7477
|
-
align-self: center;
|
|
7478
|
-
`;
|
|
7479
7474
|
const LogoContainer = styled(uilibGl.Flex) `
|
|
7480
7475
|
max-width: calc(100% - 1.4rem);
|
|
7481
7476
|
flex-grow: 1;
|
|
@@ -7490,21 +7485,71 @@ const LogoContainer = styled(uilibGl.Flex) `
|
|
|
7490
7485
|
}
|
|
7491
7486
|
`;
|
|
7492
7487
|
const PageTitle = styled(uilibGl.H2) `
|
|
7493
|
-
|
|
7494
|
-
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7488
|
+
cursor: pointer;
|
|
7489
|
+
text-align: left;
|
|
7490
|
+
flex: 1 1 auto;
|
|
7491
|
+
min-width: 0;
|
|
7497
7492
|
margin: 0;
|
|
7498
7493
|
font-size: 1.25rem;
|
|
7499
7494
|
font-weight: 600;
|
|
7500
7495
|
pointer-events: initial;
|
|
7501
7496
|
font-family: "Nunito Sans", serif;
|
|
7497
|
+
|
|
7498
|
+
> * {
|
|
7499
|
+
white-space: nowrap;
|
|
7500
|
+
overflow: hidden;
|
|
7501
|
+
text-overflow: ellipsis;
|
|
7502
|
+
}
|
|
7503
|
+
`;
|
|
7504
|
+
const PageTitleContainer = styled(uilibGl.Flex) `
|
|
7505
|
+
flex-grow: 1;
|
|
7506
|
+
align-items: center;
|
|
7507
|
+
|
|
7508
|
+
${PageTitle} {
|
|
7509
|
+
max-width: 15.75rem;
|
|
7510
|
+
}
|
|
7511
|
+
|
|
7512
|
+
&&& button {
|
|
7513
|
+
width: 0;
|
|
7514
|
+
overflow: hidden;
|
|
7515
|
+
|
|
7516
|
+
span[kind] {
|
|
7517
|
+
display: flex;
|
|
7518
|
+
align-items: center;
|
|
7519
|
+
justify-content: center;
|
|
7520
|
+
width: 0.75rem;
|
|
7521
|
+
|
|
7522
|
+
:after {
|
|
7523
|
+
font-size: 0.75rem;
|
|
7524
|
+
color: ${({ theme: { palette } }) => palette.textDisabled};
|
|
7525
|
+
transition: color ${uilibGl.transition.hover};
|
|
7526
|
+
}
|
|
7527
|
+
}
|
|
7528
|
+
|
|
7529
|
+
&:hover,
|
|
7530
|
+
&:active {
|
|
7531
|
+
span[kind]:after {
|
|
7532
|
+
color: ${({ theme: { palette } }) => palette.textPrimary};
|
|
7533
|
+
}
|
|
7534
|
+
}
|
|
7535
|
+
}
|
|
7536
|
+
|
|
7537
|
+
:hover {
|
|
7538
|
+
${PageTitle} {
|
|
7539
|
+
max-width: 14.25rem;
|
|
7540
|
+
}
|
|
7541
|
+
|
|
7542
|
+
&&& button {
|
|
7543
|
+
width: 1.5rem;
|
|
7544
|
+
}
|
|
7545
|
+
}
|
|
7502
7546
|
`;
|
|
7503
7547
|
|
|
7504
7548
|
const DashboardDefaultHeader = React.memo(() => {
|
|
7505
|
-
const {
|
|
7549
|
+
const { title } = useDashboardHeader();
|
|
7550
|
+
const { toggleLayersVisibility, components: { ProjectPanelMenu, ProjectPagesMenu }, } = useWidgetContext();
|
|
7506
7551
|
const { pageId, image, icon, tooltip, themeName } = useDashboardHeader();
|
|
7507
|
-
return (jsxRuntime.jsxs(DefaultHeaderContainer, { image: getResourceUrl(image), isDark: themeName === exports.ThemeName.Dark, children: [!pageId && jsxRuntime.jsx(uilibGl.LinearProgress, {}), jsxRuntime.jsxs(uilibGl.Flex, { column: true, gap: "1rem", children: [jsxRuntime.jsx(uilibGl.FlexSpan, { children: jsxRuntime.jsxs(TopContainer, { children: [jsxRuntime.jsx(LogoContainer, { children: icon }), jsxRuntime.
|
|
7552
|
+
return (jsxRuntime.jsxs(DefaultHeaderContainer, { image: getResourceUrl(image), isDark: themeName === exports.ThemeName.Dark, children: [!pageId && jsxRuntime.jsx(uilibGl.LinearProgress, {}), jsxRuntime.jsxs(uilibGl.Flex, { column: true, gap: "1rem", children: [jsxRuntime.jsx(uilibGl.FlexSpan, { children: jsxRuntime.jsxs(TopContainer, { children: [jsxRuntime.jsx(LogoContainer, { children: icon }), jsxRuntime.jsx(TopContainerButtons, { children: jsxRuntime.jsx(ProjectPanelMenu, {}) })] }) }), jsxRuntime.jsx(uilibGl.FlexSpan, { children: jsxRuntime.jsx(uilibGl.Flex, { column: true, gap: "0.25rem", children: jsxRuntime.jsx(uilibGl.FlexSpan, { children: jsxRuntime.jsxs(uilibGl.Flex, { alignItems: "center", children: [jsxRuntime.jsxs(PageTitleContainer, { children: [jsxRuntime.jsx(uilibGl.Tooltip, { arrow: true, content: tooltip, children: ref => (jsxRuntime.jsx(PageTitle, { ref: ref, onClick: toggleLayersVisibility, children: title })) }), jsxRuntime.jsx(ProjectPagesMenu, {})] }), jsxRuntime.jsx(uilibGl.FlexSpan, { children: jsxRuntime.jsx(Pagination, {}) })] }) }) }) })] })] }));
|
|
7508
7553
|
});
|
|
7509
7554
|
|
|
7510
7555
|
const HeaderFrontView = styled(uilibGl.Flex) `
|
|
@@ -10246,7 +10291,7 @@ const useDashboardHeader = () => {
|
|
|
10246
10291
|
const image = React.useMemo(() => (header?.children?.some(({ id }) => id === "image") ? renderElement({ id: "image", wrap: false }) : null), [header?.children, renderElement]);
|
|
10247
10292
|
const icon = React.useMemo(() => header?.children?.some(({ id }) => id === "icon") ? (renderElement({ id: "icon", wrap: false })) : (jsxRuntime.jsx(uilibGl.Icon, { kind: "logo", style: { width: "2rem", height: "2rem" } })), [header?.children, renderElement]);
|
|
10248
10293
|
const title = React.useMemo(() => header?.children?.some(({ id }) => id === "title") ? renderElement({ id: "title" }) : currentPage?.options?.title, [header?.children, renderElement, currentPage?.options?.title]);
|
|
10249
|
-
const tooltip = React.useMemo(() => (jsxRuntime.jsxs(
|
|
10294
|
+
const tooltip = React.useMemo(() => (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("span", { children: alias || name }), jsxRuntime.jsx("span", { style: { opacity: 0.54, marginLeft: "0.5rem" }, children: title })] })), [alias, name, title]);
|
|
10250
10295
|
const description = React.useMemo(() => (header?.children?.some(({ id }) => id === "description") ? renderElement({ id: "description" }) : ""), [header?.children, renderElement]);
|
|
10251
10296
|
return {
|
|
10252
10297
|
pageId,
|
|
@@ -11708,9 +11753,9 @@ exports.NoLiveSnapshotContainer = NoLiveSnapshotContainer;
|
|
|
11708
11753
|
exports.OneColumnContainer = OneColumnContainer;
|
|
11709
11754
|
exports.PageNavigator = PageNavigator;
|
|
11710
11755
|
exports.PageTitle = PageTitle;
|
|
11756
|
+
exports.PageTitleContainer = PageTitleContainer;
|
|
11711
11757
|
exports.PagesContainer = PagesContainer;
|
|
11712
11758
|
exports.Pagination = Pagination;
|
|
11713
|
-
exports.PaginationDivider = PaginationDivider;
|
|
11714
11759
|
exports.PresentationHeader = PresentationHeader;
|
|
11715
11760
|
exports.PresentationHeaderButtons = PresentationHeaderButtons;
|
|
11716
11761
|
exports.PresentationHeaderTools = PresentationHeaderTools;
|