@evergis/react 2.0.166 → 2.0.167
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/Legend/Legend.d.ts +5 -3
- package/dist/components/Legend/components/LegendParameterDescription.d.ts +5 -0
- package/dist/components/Legend/components/LegendSection.d.ts +3 -0
- package/dist/components/Legend/components/LegendSymbolRenderer.d.ts +5 -0
- package/dist/components/Legend/components/MaximizedLegend.d.ts +3 -0
- package/dist/components/{MapLegend → Legend/components}/MinimizedLegend.d.ts +1 -1
- package/dist/components/Legend/components/SvgSymbol.d.ts +3 -0
- package/dist/components/Legend/components/SymbolByType.d.ts +9 -0
- package/dist/components/Legend/components/index.d.ts +5 -0
- package/dist/components/Legend/constants.d.ts +32 -0
- package/dist/components/Legend/hooks/useSvgSymbol.d.ts +15 -0
- package/dist/components/Legend/index.d.ts +4 -4
- package/dist/components/Legend/styled.d.ts +36 -5
- package/dist/components/Legend/types.d.ts +78 -9
- package/dist/components/index.d.ts +0 -1
- package/dist/contexts/LegendContext.d.ts +1 -1
- package/dist/core/attributes/format.d.ts +0 -1
- package/dist/core/classification/parameterValue.d.ts +1 -3
- package/dist/core/classification/types.d.ts +2 -1
- package/dist/core/feature/getFeatureSymbol.d.ts +1 -1
- package/dist/core/style/EvergisStyle.d.ts +1 -1
- package/dist/core/style/types/parameterValue.d.ts +2 -2
- package/dist/core/style/types/symbol.d.ts +8 -2
- package/dist/hooks/useLegend/useMapLegend.d.ts +1 -1
- package/dist/hooks/useSymbol.d.ts +0 -1
- package/dist/index.d.ts +8 -2
- package/dist/react.cjs.development.js +1307 -320
- package/dist/react.cjs.development.js.map +1 -1
- package/dist/react.cjs.production.min.js +1 -1
- package/dist/react.cjs.production.min.js.map +1 -1
- package/dist/react.esm.js +1229 -313
- package/dist/react.esm.js.map +1 -1
- package/dist/utils/date.d.ts +16 -0
- package/dist/utils/legend.d.ts +72 -0
- package/dist/utils/svg.d.ts +6 -0
- package/package.json +8 -5
- package/dist/components/Legend/LegendSection.d.ts +0 -10
- package/dist/components/Legend/LegendSymbol.d.ts +0 -8
- package/dist/components/Legend/LegendValue.d.ts +0 -8
- package/dist/components/Legend/getSymbolSize.d.ts +0 -3
- package/dist/components/MapLegend/MapLegend.d.ts +0 -3
- package/dist/components/MapLegend/MapLegendDescription.d.ts +0 -5
- package/dist/components/MapLegend/MapLegendSymbol.d.ts +0 -7
- package/dist/components/MapLegend/index.d.ts +0 -5
- package/dist/components/MapLegend/styled.d.ts +0 -28
- package/dist/components/MapLegend/types.d.ts +0 -23
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const NO_CONTENT_VALUE = "\u2014";
|
|
2
|
+
export declare type DateType = number | Date;
|
|
3
|
+
export declare type RawDateType = string | DateType;
|
|
4
|
+
export declare enum DateFormat {
|
|
5
|
+
ClientDefaultFormat = "dd.MM.yyyy HH:mm",
|
|
6
|
+
DateTime = "dd.MM.yyyy HH:mm:ss",
|
|
7
|
+
UTC = "yyyy-MM-dd'T'HH:mm:ss.sssxxx",
|
|
8
|
+
AxisTooltip = "d MMMM yyyy"
|
|
9
|
+
}
|
|
10
|
+
interface FormatDateOptions {
|
|
11
|
+
dateFormat?: DateFormat;
|
|
12
|
+
defaultValue?: RawDateType;
|
|
13
|
+
}
|
|
14
|
+
export declare const getDate: (rawDate?: string | number | Date | null | undefined) => Date | null;
|
|
15
|
+
export declare const formatDate: (date?: string | number | Date | undefined, { dateFormat, defaultValue }?: FormatDateOptions) => string;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { AttributesConfigurationDc, AttributeType, FeatureLayerServiceInfoDc, LayerDefinitionDc, ServiceInfoDc, StyleDc } from "@evergis/api";
|
|
2
|
+
import { ClassifyParameter, LegendSectionItem, ParameterInfo } from "../components";
|
|
3
|
+
import { ClassificationParameter, ClassificationParameterExtended, ClassifyAble, FeatureAttributeValue, ImageSymbol, LabelType, LegendValueType, MaskedImageSymbol, ParameterByAttribute, ParameterValue, ParameterValueWithSymbol, PointSymbolType, PolygonSymbol, PolylineSymbol, RangeClass, StyleSymbolType, SvgPointSymbol, UniqueClass } from "../core";
|
|
4
|
+
export declare const isLayerService: (value?: unknown) => value is import("@evergis/api").ResourceInfoDc | ServiceInfoDc;
|
|
5
|
+
export declare const getAttributeFromCondition: (condition: string) => string;
|
|
6
|
+
export declare const getExprFromCondition: (condition: string, partIndex?: number | undefined) => string[];
|
|
7
|
+
export declare const getSignFromConditionPart: (condition: string, partIndex?: number | undefined) => string;
|
|
8
|
+
export declare const getValueFromConditionPart: (condition: string, partIndex?: number | undefined) => string;
|
|
9
|
+
export declare const isRangeCondition: (condition: string) => boolean;
|
|
10
|
+
export declare const getSymbolParameterInfo: (parameter: ClassificationParameter) => ParameterInfo;
|
|
11
|
+
export declare const formatValue: (value: FeatureAttributeValue, type?: AttributeType | undefined, calculatedParameter?: "symbol" | "fill.color" | "fill.hatchColor" | "stroke.width" | "stroke.color" | "background.fillColor" | "background.strokeColor" | "background.strokeWidth" | "figure.fillColor" | "fillColor" | "strokeColor" | "strokeWidth" | "size" | "angle" | "maskedColor" | undefined) => string | undefined;
|
|
12
|
+
export declare const formatUniqueClassValue: (value: UniqueClass) => string;
|
|
13
|
+
export declare const getRangeValues: ({ from, to }: Pick<RangeClass, "from" | "to">, isDouble: boolean, isDate: boolean, index: number) => Pick<RangeClass, "from" | "to">;
|
|
14
|
+
export declare const formatRangeClassValue: (value: RangeClass, index: number) => string;
|
|
15
|
+
export declare const checkLayerHasLegend: (layerInfo: FeatureLayerServiceInfoDc) => boolean;
|
|
16
|
+
export declare const getTitleFromCondition: (condition: string) => string;
|
|
17
|
+
export declare const enum LegendSymbolTypes {
|
|
18
|
+
Point = 0,
|
|
19
|
+
ImagePoint = 1,
|
|
20
|
+
Line = 2,
|
|
21
|
+
Polygon = 3
|
|
22
|
+
}
|
|
23
|
+
declare type LegendSymbolsMap = {
|
|
24
|
+
[LegendSymbolTypes.Point]: PointSymbolType;
|
|
25
|
+
[LegendSymbolTypes.ImagePoint]: MaskedImageSymbol;
|
|
26
|
+
[LegendSymbolTypes.Line]: PolylineSymbol;
|
|
27
|
+
[LegendSymbolTypes.Polygon]: PolygonSymbol;
|
|
28
|
+
};
|
|
29
|
+
export declare const DEFAULT_LEGEND_STYLES: LegendSymbolsMap;
|
|
30
|
+
export declare const SYMBOL_SIZE_PARAMETERS: string[];
|
|
31
|
+
export declare const DEFAULT_LEGEND_SIZES: Record<string, number>;
|
|
32
|
+
export declare const updateSymbolParameter: <S extends StyleSymbolType>(symbol: S, path: string, value: ClassifyAble<ParameterValue>) => S;
|
|
33
|
+
declare type Dimensions = {
|
|
34
|
+
height: number;
|
|
35
|
+
width: number;
|
|
36
|
+
};
|
|
37
|
+
export declare function getDimensions(symbol: ImageSymbol, size: number): Dimensions;
|
|
38
|
+
export declare const createLegendSymbol: (parameterValue: ParameterValueWithSymbol, parameter: ClassificationParameterExtended, classificationsParams: ClassificationParameterExtended[], baseSymbol: StyleSymbolType) => StyleSymbolType | null;
|
|
39
|
+
export declare const getMinimizedLegendValues: (attributeType: AttributeType, param: ParameterByAttribute<ParameterValue>, index: number) => LegendValueType[];
|
|
40
|
+
export declare const getMaximizedLegendValues: (attributeType: AttributeType, param: ClassificationParameterExtended, params: ClassificationParameterExtended[], classified: ParameterByAttribute<ParameterValue>, symbol: StyleDc["symbol"], sectionIndex: number, otherTitle: string) => LegendSectionItem[];
|
|
41
|
+
export declare type ClassifiedList = Record<ClassifyParameter, ParameterByAttribute<ParameterValue>>;
|
|
42
|
+
export declare const getClassified: (layerInfo: FeatureLayerServiceInfoDc) => ClassifiedList;
|
|
43
|
+
export declare const getSymbolStrokeWidth: (symbol: PointSymbolType) => number;
|
|
44
|
+
export declare const getParameterFromSymbol: <R extends ClassifyAble<ParameterValue>>(symbol: StyleSymbolType | LabelType, parameter: ClassificationParameterExtended) => R;
|
|
45
|
+
export declare const getLegendSymbolSize: (symbol: StyleSymbolType) => number;
|
|
46
|
+
export declare const serializeSvgPointSymbol: (symbol: SvgPointSymbol) => {
|
|
47
|
+
figure?: {
|
|
48
|
+
id: string;
|
|
49
|
+
fillColor: string;
|
|
50
|
+
};
|
|
51
|
+
background?: {
|
|
52
|
+
id: string;
|
|
53
|
+
fillColor: string;
|
|
54
|
+
strokeColor: string | null;
|
|
55
|
+
strokeWidth: import("@evergis/api").CalculatedParameterDc | null;
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
type: string;
|
|
59
|
+
size: number | ParameterByAttribute<number> | undefined;
|
|
60
|
+
offset: import("../core").SimpleOffset | import("../core").ClassifiedOffset | undefined;
|
|
61
|
+
angle: number | import("../core").CalculatedParameter<number> | undefined;
|
|
62
|
+
} | null;
|
|
63
|
+
export declare const isSizeClassification: (parameter: string) => boolean;
|
|
64
|
+
export declare const getServiceConfiguration: (layer?: ServiceInfoDc | undefined) => ServiceInfoDc["configuration"];
|
|
65
|
+
/** default attribute name which use for geometry info */
|
|
66
|
+
export declare const GEOMETRY_ATTRIBUTE = "geometry";
|
|
67
|
+
/** default attribute name which contains unique id info */
|
|
68
|
+
export declare const DEFAULT_ID_ATTRIBUTE_NAME = "gid";
|
|
69
|
+
export declare const getAttributesConfiguration: (layer: ServiceInfoDc) => AttributesConfigurationDc;
|
|
70
|
+
export declare const getLayerDefinition: (layer?: FeatureLayerServiceInfoDc | undefined) => LayerDefinitionDc;
|
|
71
|
+
export declare function getAttributeType(layer: FeatureLayerServiceInfoDc, attributeName: string): AttributeType;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Gradient, Svg } from "@svgdotjs/svg.js";
|
|
2
|
+
import { SvgSymbolBg } from "../components/Legend/types";
|
|
3
|
+
import { ParameterByAttributeValue, SvgPointSymbol } from "../core";
|
|
4
|
+
export declare const convertSvgToBase64: (svg: string) => string;
|
|
5
|
+
export declare const createSvgGradient: (svg: Svg, values: ParameterByAttributeValue<string>[]) => Gradient;
|
|
6
|
+
export declare const manipulateSvgSymbol: (SVGContainer: Svg, symbol: SvgPointSymbol, svg?: string | undefined, bg?: SvgSymbolBg | undefined) => Svg;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.0.
|
|
2
|
+
"version": "2.0.167",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@babel/core": "^7.17.5",
|
|
44
44
|
"@babel/plugin-transform-classes": "^7.16.7",
|
|
45
45
|
"@babel/preset-env": "^7.16.11",
|
|
46
|
-
"@evergis/api": "^3.0.
|
|
46
|
+
"@evergis/api": "^3.0.145",
|
|
47
47
|
"@evergis/sgis": "0.5.0-alpha.43",
|
|
48
48
|
"@storybook/addon-actions": "^6.4.18",
|
|
49
49
|
"@storybook/addon-controls": "^6.4.18",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"@storybook/addons": "^6.4.18",
|
|
56
56
|
"@storybook/react": "^6.4.18",
|
|
57
57
|
"@storybook/theming": "^6.4.18",
|
|
58
|
+
"@types/lodash": "^4.14.182",
|
|
58
59
|
"@types/react": "^17.0.36",
|
|
59
60
|
"@types/react-dom": "^16.9.8",
|
|
60
61
|
"@types/styled-components": "^5.1.3",
|
|
@@ -71,10 +72,12 @@
|
|
|
71
72
|
},
|
|
72
73
|
"dependencies": {
|
|
73
74
|
"@evergis/color": "^1.0.0-alpha.1",
|
|
74
|
-
"@evergis/condition": "^1.2.
|
|
75
|
-
"@evergis/icons": "^1.0.
|
|
75
|
+
"@evergis/condition": "^1.2.73",
|
|
76
|
+
"@evergis/icons": "^1.0.99",
|
|
77
|
+
"@svgdotjs/svg.js": "^3.1.2",
|
|
78
|
+
"lodash": "^4.17.21",
|
|
76
79
|
"punycode": "^2.1.1",
|
|
77
80
|
"styled-components": "^5.3.5"
|
|
78
81
|
},
|
|
79
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "1aefc5ac3e77204883be0e4a6ce0b656090e685f"
|
|
80
83
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { LegendItem, LegendValueType } from '../../core';
|
|
3
|
-
declare type LegendSectionProps = {
|
|
4
|
-
item: LegendItem;
|
|
5
|
-
children: (value: LegendValueType) => React.ReactNode;
|
|
6
|
-
hideTitle?: boolean;
|
|
7
|
-
renderLegendTitle?: (item: React.ReactNode | LegendItem) => React.ReactNode;
|
|
8
|
-
};
|
|
9
|
-
export declare const LegendSection: React.FC<LegendSectionProps>;
|
|
10
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { LegendSymbolPart } from '../../hooks';
|
|
3
|
-
import { SGisSymbolType } from '../../symbols';
|
|
4
|
-
declare type LegendSymbolProps = {
|
|
5
|
-
children: (symbol: SGisSymbolType) => React.ReactNode;
|
|
6
|
-
} & LegendSymbolPart;
|
|
7
|
-
export declare const LegendSymbol: React.FC<LegendSymbolProps>;
|
|
8
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ClassificationParameterExtended, LegendValueType } from '../../core';
|
|
3
|
-
import { LegendProps } from './types';
|
|
4
|
-
export declare type LegendValueProps = {
|
|
5
|
-
value: LegendValueType;
|
|
6
|
-
parameter: ClassificationParameterExtended;
|
|
7
|
-
} & Pick<LegendProps, 'maxSize'>;
|
|
8
|
-
export declare const LegendValue: React.FC<LegendValueProps>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ClassificationParameterExtended, LegendValueType } from '../../core';
|
|
3
|
-
export declare type MapLegendSymbolProps = {
|
|
4
|
-
value: LegendValueType;
|
|
5
|
-
parameter: ClassificationParameterExtended;
|
|
6
|
-
};
|
|
7
|
-
export declare const MapLegendSymbol: React.FC<MapLegendSymbolProps>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export * from './MapLegend';
|
|
2
|
-
export * from './MapLegendSymbol';
|
|
3
|
-
export * from './MapLegendDescription';
|
|
4
|
-
export * from './MinimizedLegend';
|
|
5
|
-
export { MapLegendContainer, MapLegendHeader, MapLegendValueDescr, MapLegendExpandButton, MapLegendValues, MapLegendItems, MapLegendItem, MapLegendOther, SizeMinimizedLegendDown, SizeMinimizedLegendUp, MapLegendDescriptionContainer, MapLegendSectionContainer, } from './styled';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ClassificationParameterExtended } from "../../core";
|
|
2
|
-
import { MapLegendItemProps } from "./types";
|
|
3
|
-
export declare const MapLegendControl: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
-
export declare const MapLegendContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
-
export declare const MapLegendHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
-
export declare const MapLegendDescriptionContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
-
export declare const MinimizedLegendContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
-
export declare const MapLegendSectionContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
|
-
export declare const MapLegendValueDescr: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
-
export declare const MapLegendItem: import("styled-components").StyledComponent<"div", any, MapLegendItemProps, never>;
|
|
11
|
-
export declare const MapLegendOther: import("styled-components").StyledComponent<"div", any, MapLegendItemProps, never>;
|
|
12
|
-
export declare const SizeMinimizedLegend: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
|
-
export declare const SizeMinimizedLegendSymbol: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
14
|
-
export declare const SizeMinimizedLegendLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
|
-
export declare const SizeMinimizedLegendDown: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
|
-
export declare const SizeMinimizedLegendUp: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
|
-
export declare const MapLegendItems: import("styled-components").StyledComponent<"div", any, {
|
|
18
|
-
parameter: ClassificationParameterExtended;
|
|
19
|
-
isSize?: boolean | undefined;
|
|
20
|
-
isStrokeWidth?: boolean | undefined;
|
|
21
|
-
isStrokeColor?: boolean | undefined;
|
|
22
|
-
isSingle?: boolean | undefined;
|
|
23
|
-
}, never>;
|
|
24
|
-
export declare const MapLegendItemsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
25
|
-
export declare const MapLegendValues: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
26
|
-
export declare const MapLegendValuesRange: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
27
|
-
export declare const MapLegendValuesOther: import("styled-components").StyledComponent<"div", any, MapLegendItemProps, never>;
|
|
28
|
-
export declare const MapLegendExpandButton: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import { AttributeType } from "@evergis/api";
|
|
3
|
-
import { LegendProps } from "../Legend";
|
|
4
|
-
import { ClassificationParameterExtended, LegendValueType } from "../../core";
|
|
5
|
-
export declare type MapLegendProps = LegendProps & {
|
|
6
|
-
fromToTitle?: [string, string];
|
|
7
|
-
isExpanded?: boolean;
|
|
8
|
-
className?: string;
|
|
9
|
-
hideTitle?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare type MinimizedLegendProps = {
|
|
12
|
-
title?: string | ReactNode;
|
|
13
|
-
defaultValue: string;
|
|
14
|
-
values: LegendValueType[];
|
|
15
|
-
parameter: ClassificationParameterExtended;
|
|
16
|
-
hiddenLegends?: string[];
|
|
17
|
-
attributeType?: AttributeType;
|
|
18
|
-
};
|
|
19
|
-
export declare type MapLegendItemProps = {
|
|
20
|
-
value?: string | number;
|
|
21
|
-
parameter?: ClassificationParameterExtended;
|
|
22
|
-
isHidden?: boolean;
|
|
23
|
-
};
|