@vertigis/react-ui 11.35.1 → 12.0.1
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/Autocomplete/index.d.ts +1 -0
- package/Autocomplete/index.js +1 -0
- package/ColorInput/ColorInput.js +2 -2
- package/FormLabelAutocompleteField/FormLabelAutocompleteField .d.ts +37 -0
- package/FormLabelAutocompleteField/FormLabelAutocompleteField .js +20 -0
- package/FormLabelAutocompleteField/index.d.ts +2 -0
- package/FormLabelAutocompleteField/index.js +2 -0
- package/SymbolInput/FontInput.d.ts +28 -0
- package/SymbolInput/FontInput.js +101 -0
- package/SymbolInput/SimpleFillSymbolInput.d.ts +49 -0
- package/SymbolInput/SimpleFillSymbolInput.js +175 -0
- package/SymbolInput/SimpleLineSymbolInput.d.ts +38 -0
- package/SymbolInput/SimpleLineSymbolInput.js +125 -0
- package/SymbolInput/SimpleMarkerSymbolInput.d.ts +38 -0
- package/SymbolInput/SimpleMarkerSymbolInput.js +162 -0
- package/SymbolInput/SymbolInput.d.ts +15 -64
- package/SymbolInput/SymbolInput.js +18 -449
- package/SymbolInput/SymbolJson.d.ts +111 -1
- package/SymbolInput/TextSymbolInput.d.ts +58 -0
- package/SymbolInput/TextSymbolInput.js +131 -0
- package/SymbolInput/UnsupportedSymbol.d.ts +21 -0
- package/SymbolInput/UnsupportedSymbol.js +22 -0
- package/SymbolInput/fonts.d.ts +9 -0
- package/SymbolInput/fonts.js +352 -0
- package/SymbolInput/utilities.d.ts +83 -0
- package/SymbolInput/utilities.js +158 -0
- package/package.json +1 -1
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
export const DEFAULT_LANGUAGE = {
|
|
2
|
+
fillColorTitle: "Fill Color",
|
|
3
|
+
fillStyleTitle: "Fill Style",
|
|
4
|
+
lineColorTitle: "Line Color",
|
|
5
|
+
lineStyleTitle: "Line Style",
|
|
6
|
+
lineWidthTitle: "Line Width",
|
|
7
|
+
markerAngleTitle: "Marker Angle",
|
|
8
|
+
xOffsetTitle: "X Offset",
|
|
9
|
+
yOffsetTitle: "Y Offset",
|
|
10
|
+
markerSizeTitle: "Marker Size",
|
|
11
|
+
markerStyleTitle: "Marker Style",
|
|
12
|
+
symbolUnsupportedErrorMessage: "You are attempting to edit a symbol that is not currently supported.",
|
|
13
|
+
markerStyleCircle: "Circle",
|
|
14
|
+
markerStyleCross: "Cross",
|
|
15
|
+
markerStyleDiamond: "Diamond",
|
|
16
|
+
markerStyleSquare: "Square",
|
|
17
|
+
markerStyleTriangle: "Triangle",
|
|
18
|
+
markerStyleX: "X",
|
|
19
|
+
lineStyleDash: "Dash",
|
|
20
|
+
lineStyleDashDot: "Dash Dot",
|
|
21
|
+
lineStyleDot: "Dot",
|
|
22
|
+
lineStyleLongDashDot: "Long Dash Dot",
|
|
23
|
+
lineStyleLongDash: "Long Dash",
|
|
24
|
+
lineStyleNone: "None",
|
|
25
|
+
lineStyleShortDashDotDot: "Short Dash Dot Dot",
|
|
26
|
+
lineStyleShortDashDot: "Short Dash Dot",
|
|
27
|
+
lineStyleShortDash: "Short Dash",
|
|
28
|
+
lineStyleShortDot: "Short Dot",
|
|
29
|
+
lineStyleSolid: "Solid",
|
|
30
|
+
fillStyleBackwardDiagonal: "Backward Diagonal",
|
|
31
|
+
fillStyleCross: "Cross",
|
|
32
|
+
fillStyleDiagonalCross: "Diagonal Cross",
|
|
33
|
+
fillStyleForwardDiagonal: "Forward Diagonal",
|
|
34
|
+
fillStyleHorizontal: "Horizontal",
|
|
35
|
+
fillStyleNone: "None",
|
|
36
|
+
fillStyleSolid: "Solid",
|
|
37
|
+
fillStyleVertical: "Vertical",
|
|
38
|
+
angleTitle: "Text Angle",
|
|
39
|
+
backgroundColor: "Background Color",
|
|
40
|
+
borderLineColor: "Border line Color",
|
|
41
|
+
borderLineSize: "Border line Size",
|
|
42
|
+
color: "Color",
|
|
43
|
+
font: "Font",
|
|
44
|
+
fontSize: "Font Size",
|
|
45
|
+
fontFamily: "Font Family",
|
|
46
|
+
fontStyle: "Font Style",
|
|
47
|
+
fontWeight: "Font Style",
|
|
48
|
+
haloColor: "Halo Color",
|
|
49
|
+
haloSize: "Halo Size",
|
|
50
|
+
horizontalAlignment: "Horizontal Alignments",
|
|
51
|
+
horizontalAlignmentLeft: "Left",
|
|
52
|
+
horizontalAlignmentRight: "Right",
|
|
53
|
+
horizontalAlignmentCenter: "Center",
|
|
54
|
+
verticalAlignment: "Vertical Alignments",
|
|
55
|
+
verticalAlignmentBaseline: "Baseline",
|
|
56
|
+
verticalAlignmentTop: "Top",
|
|
57
|
+
verticalAlignmentMiddle: "Middle",
|
|
58
|
+
verticalAlignmentBottom: "Bottom",
|
|
59
|
+
decoration: "Font Decoration",
|
|
60
|
+
decorationNone: "None",
|
|
61
|
+
decorationLineThrough: "Line-through",
|
|
62
|
+
decorationLineUnderline: "Underline",
|
|
63
|
+
};
|
|
64
|
+
export const NO_FILL_MARKER_STYLES = [
|
|
65
|
+
"esriSMSCross",
|
|
66
|
+
"esriSMSX",
|
|
67
|
+
];
|
|
68
|
+
export const DEFAULT_PARSE_NUMBER = (s) => typeof s === "string" ? +s : 0;
|
|
69
|
+
export const DEFAULT_FORMAT_NUMBER = (n) => typeof n === "number" ? `${n}` : "0";
|
|
70
|
+
export const getLineStyle = (symbol) => {
|
|
71
|
+
switch (symbol?.type) {
|
|
72
|
+
case "esriSMS":
|
|
73
|
+
case "esriSFS":
|
|
74
|
+
return symbol.outline?.style;
|
|
75
|
+
case "esriSLS":
|
|
76
|
+
return symbol.style;
|
|
77
|
+
default:
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
export const getFillStyle = (symbol) => {
|
|
82
|
+
switch (symbol?.type) {
|
|
83
|
+
case "esriSFS":
|
|
84
|
+
return symbol.style;
|
|
85
|
+
default:
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
export const getLineColor = (symbol) => {
|
|
90
|
+
switch (symbol?.type) {
|
|
91
|
+
case "esriSMS":
|
|
92
|
+
case "esriSFS":
|
|
93
|
+
return symbol.outline?.color;
|
|
94
|
+
case "esriSLS":
|
|
95
|
+
return symbol.color;
|
|
96
|
+
default:
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
export const getFillColor = (symbol) => {
|
|
101
|
+
switch (symbol?.type) {
|
|
102
|
+
case "esriSMS":
|
|
103
|
+
case "esriSFS":
|
|
104
|
+
return symbol.color;
|
|
105
|
+
default:
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
export const getLineWidth = (symbol) => {
|
|
110
|
+
switch (symbol?.type) {
|
|
111
|
+
case "esriSMS":
|
|
112
|
+
case "esriSFS":
|
|
113
|
+
return symbol.outline?.width;
|
|
114
|
+
case "esriSLS":
|
|
115
|
+
return symbol.width;
|
|
116
|
+
default:
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
export const getMarkerProperty = (symbol, property) => {
|
|
121
|
+
if (symbol?.type !== "esriSMS") {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
return symbol[property];
|
|
125
|
+
};
|
|
126
|
+
export const toRgbaString = (color) => {
|
|
127
|
+
if (!color) {
|
|
128
|
+
return DEFAULT_RGBA_STRING;
|
|
129
|
+
}
|
|
130
|
+
const [r, g, b, a] = color;
|
|
131
|
+
const aVal = a / 255;
|
|
132
|
+
return `rgba(${r}, ${g}, ${b}, ${isNaN(aVal) ? 1 : aVal})`;
|
|
133
|
+
};
|
|
134
|
+
export const toColor = (color) => {
|
|
135
|
+
if (!color) {
|
|
136
|
+
return DEFAULT_COLOR;
|
|
137
|
+
}
|
|
138
|
+
return fromRgbaString(color) ?? fromRgbString(color) ?? DEFAULT_COLOR;
|
|
139
|
+
};
|
|
140
|
+
export const fromRgbString = (color) => {
|
|
141
|
+
const result = /rgb\(([\d.]+), ([\d.]+), ([\d.]+)\)/.exec(color);
|
|
142
|
+
if (result) {
|
|
143
|
+
const [, r, g, b] = result;
|
|
144
|
+
return [+r, +g, +b, 255];
|
|
145
|
+
}
|
|
146
|
+
return undefined;
|
|
147
|
+
};
|
|
148
|
+
export const fromRgbaString = (color) => {
|
|
149
|
+
const result = /rgba\(([\d.]+), ([\d.]+), ([\d.]+), ([\d.]+)\)/.exec(color);
|
|
150
|
+
if (result) {
|
|
151
|
+
const [, r, g, b, a] = result;
|
|
152
|
+
const aVal = +a * 255;
|
|
153
|
+
return [+r, +g, +b, isNaN(aVal) ? 255 : aVal];
|
|
154
|
+
}
|
|
155
|
+
return undefined;
|
|
156
|
+
};
|
|
157
|
+
export const DEFAULT_COLOR = [255, 255, 255, 255];
|
|
158
|
+
export const DEFAULT_RGBA_STRING = "rgba(255, 255, 255, 1)";
|