geostyler 10.2.0 → 10.3.0
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/README.md +5 -1
- package/browser/geostyler.css +1 -1
- package/browser/geostyler.js +1 -1
- package/browser/geostyler.js.LICENSE.txt +10 -0
- package/dist/Component/CodeEditor/CodeEditor.js +1 -1
- package/dist/Component/CompositionContext/CompositionContext.d.ts +85 -0
- package/dist/Component/CompositionContext/CompositionContext.js +52 -0
- package/dist/Component/CompositionContext/CompositionContext.js.map +1 -0
- package/dist/Component/DataInput/StyleLoader/StyleLoader.js +1 -1
- package/dist/Component/DefaultValueContext/DefaultValueContext.d.ts +60 -0
- package/dist/Component/DefaultValueContext/DefaultValueContext.js +52 -0
- package/dist/Component/DefaultValueContext/DefaultValueContext.js.map +1 -0
- package/dist/Component/{ParserFeedback/ParserFeedback.css → DragDroppable/DragDroppable.css} +6 -8
- package/dist/Component/DragDroppable/DragDroppable.d.ts +13 -0
- package/dist/Component/DragDroppable/DragDroppable.js +68 -0
- package/dist/Component/DragDroppable/DragDroppable.js.map +1 -0
- package/dist/Component/DropIndicator/DropIndicator.css +30 -0
- package/dist/Component/DropIndicator/DropIndicator.d.ts +6 -0
- package/dist/Component/DropIndicator/DropIndicator.js +41 -0
- package/dist/Component/DropIndicator/DropIndicator.js.map +1 -0
- package/dist/Component/Filter/ComparisonFilter/ComparisonFilter.d.ts +1 -1
- package/dist/Component/Legacy/CodeEditor/CodeEditor.css +59 -0
- package/dist/Component/Legacy/CodeEditor/CodeEditor.d.ts +131 -0
- package/dist/Component/Legacy/CodeEditor/CodeEditor.js +317 -0
- package/dist/Component/Legacy/CodeEditor/CodeEditor.js.map +1 -0
- package/dist/Component/Rule/TitleField/TitleField.d.ts +0 -1
- package/dist/Component/Rule/TitleField/TitleField.js +1 -6
- package/dist/Component/Rule/TitleField/TitleField.js.map +1 -1
- package/dist/Component/RuleCard/RuleCard.css +27 -0
- package/dist/Component/RuleCard/RuleCard.js +3 -4
- package/dist/Component/RuleCard/RuleCard.js.map +1 -1
- package/dist/Component/RuleGenerator/ClassificationCombo/ClassificationCombo.d.ts +1 -1
- package/dist/Component/RuleGenerator/RuleGenerator.d.ts +1 -1
- package/dist/Component/Rules/Rules.js +43 -8
- package/dist/Component/Rules/Rules.js.map +1 -1
- package/dist/Component/Symbolizer/Field/ChannelSelectionField/ChannelSelectionField.d.ts +1 -1
- package/dist/Component/Symbolizer/Field/ColorField/BaseColorField/BaseColorField.css +34 -0
- package/dist/Component/Symbolizer/Field/ColorField/BaseColorField/BaseColorField.d.ts +88 -0
- package/dist/Component/Symbolizer/Field/ColorField/BaseColorField/BaseColorField.js +136 -0
- package/dist/Component/Symbolizer/Field/ColorField/BaseColorField/BaseColorField.js.map +1 -0
- package/dist/Component/Symbolizer/Field/ExpressionField/ExpressionField.d.ts +13 -0
- package/dist/Component/Symbolizer/Field/ExpressionField/ExpressionField.js +73 -0
- package/dist/Component/Symbolizer/Field/ExpressionField/ExpressionField.js.map +1 -0
- package/dist/Component/Symbolizer/IconSelector/IconSelector.d.ts +1 -1
- package/dist/Component/Symbolizer/Preview/Preview.js +1 -1
- package/dist/Component/Symbolizer/RasterEditor/RasterEditor.d.ts +1 -1
- package/dist/Component/Symbolizer/Renderer/Renderer.js +1 -1
- package/dist/Component/Symbolizer/SLDRenderer/SLDRenderer.js +1 -1
- package/dist/Component/SymbolizerCard/SymbolizerCard.js +3 -4
- package/dist/Component/SymbolizerCard/SymbolizerCard.js.map +1 -1
- package/dist/Component/Symbolizers/Symbolizers.js +52 -19
- package/dist/Component/Symbolizers/Symbolizers.js.map +1 -1
- package/dist/Component/UploadButton/UploadButton.d.ts +1 -1
- package/dist/DataProvider/ParserDesc.d.ts +1 -1
- package/dist/Util/DndUtil.d.ts +114 -0
- package/dist/Util/DndUtil.js +159 -0
- package/dist/Util/DndUtil.js.map +1 -0
- package/dist/Util/FileUtil.js +1 -1
- package/dist/Util/FilterUtil.d.ts +1 -1
- package/dist/Util/HTTPUtil.d.ts +1 -1
- package/dist/Util/HTTPUtil.js +1 -1
- package/dist/Util/UnsupportedPropertiesUtil.d.ts +2 -2
- package/dist/context/UnsupportedPropertiesContext/UnsupportedPropertiesContext.d.ts +2 -2
- package/dist/hook/UseDragDrop.d.ts +20 -0
- package/dist/hook/UseDragDrop.js +238 -0
- package/dist/hook/UseDragDrop.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/locale/fr_FR.js +3 -3
- package/dist/locale/fr_FR.js.map +1 -1
- package/package.json +4 -2
- package/dist/Util/StyleUtil.d.ts +0 -9
- package/dist/Util/StyleUtil.js +0 -87
- package/dist/Util/StyleUtil.js.map +0 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import 'codemirror/lib/codemirror.css';
|
|
3
|
+
import 'codemirror/mode/xml/xml';
|
|
4
|
+
import 'codemirror/mode/javascript/javascript';
|
|
5
|
+
import 'blob';
|
|
6
|
+
import './CodeEditor.css';
|
|
7
|
+
import { Style as GsStyle, StyleParser } from 'geostyler-style';
|
|
8
|
+
export interface CodeEditorLocale {
|
|
9
|
+
downloadButtonLabel: string;
|
|
10
|
+
formatSelectLabel: string;
|
|
11
|
+
copyButtonLabel: string;
|
|
12
|
+
styleCopied: string;
|
|
13
|
+
}
|
|
14
|
+
interface CodeEditorDefaultProps {
|
|
15
|
+
/** Locale object containing translated text snippets */
|
|
16
|
+
locale: CodeEditorLocale;
|
|
17
|
+
/** Delay in ms until onStyleChange will be called */
|
|
18
|
+
delay: number;
|
|
19
|
+
/** Show save button */
|
|
20
|
+
showSaveButton: boolean;
|
|
21
|
+
/** show copy button */
|
|
22
|
+
showCopyButton: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface CodeEditorProps extends Partial<CodeEditorDefaultProps> {
|
|
25
|
+
/** GeoStyler Style Object to display */
|
|
26
|
+
style?: GsStyle;
|
|
27
|
+
/** List of StylerParsers to parse from/to */
|
|
28
|
+
parsers?: StyleParser[];
|
|
29
|
+
/** Default parser */
|
|
30
|
+
defaultParser?: StyleParser;
|
|
31
|
+
/** The callback method that is triggered when the state changes */
|
|
32
|
+
onStyleChange?: (rule: GsStyle) => void;
|
|
33
|
+
}
|
|
34
|
+
interface CodeEditorState {
|
|
35
|
+
value: string;
|
|
36
|
+
invalidMessage?: string;
|
|
37
|
+
activeParser?: StyleParser;
|
|
38
|
+
hasError: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The CodeEditor.
|
|
42
|
+
*/
|
|
43
|
+
export declare class CodeEditor extends React.Component<CodeEditorProps, CodeEditorState> {
|
|
44
|
+
static defaultProps: CodeEditorDefaultProps;
|
|
45
|
+
static componentName: string;
|
|
46
|
+
private editTimeout;
|
|
47
|
+
constructor(props: CodeEditorProps);
|
|
48
|
+
componentDidMount(): void;
|
|
49
|
+
shouldComponentUpdate(nextProps: CodeEditorProps, nextState: CodeEditorState): boolean;
|
|
50
|
+
componentDidUpdate(prevProps: CodeEditorProps, prevState: CodeEditorState): void;
|
|
51
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
52
|
+
updateValueFromStyle: (style: GsStyle) => void;
|
|
53
|
+
getModeByParser: () => string;
|
|
54
|
+
valueFromStyleInput: (style: GsStyle) => Promise<unknown>;
|
|
55
|
+
styleFromValue: (value: string) => Promise<unknown>;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
onChange: (editor: any, data: any, value: string) => void;
|
|
60
|
+
onSelect: (selection: string) => void;
|
|
61
|
+
onUnitSelect: (selection: string) => void;
|
|
62
|
+
handleOnChange: (editor: any, data: any, value: string) => void;
|
|
63
|
+
getParserOptions: () => JSX.Element[];
|
|
64
|
+
onDownloadButtonClick: () => void;
|
|
65
|
+
onCopyButtonClick: () => void;
|
|
66
|
+
/**
|
|
67
|
+
* Copies the a value to the clipboard.
|
|
68
|
+
* Credits: https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f
|
|
69
|
+
*
|
|
70
|
+
* @param {string} str The string to copy to the clipboard.
|
|
71
|
+
*/
|
|
72
|
+
copyToClipboard: (str: string) => void;
|
|
73
|
+
render(): JSX.Element;
|
|
74
|
+
}
|
|
75
|
+
declare const _default: {
|
|
76
|
+
new (props: (CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps) | Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>): {
|
|
77
|
+
render(): JSX.Element;
|
|
78
|
+
context: any;
|
|
79
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: () => void): void;
|
|
80
|
+
forceUpdate(callback?: () => void): void;
|
|
81
|
+
readonly props: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps> & Readonly<{
|
|
82
|
+
children?: React.ReactNode;
|
|
83
|
+
}>;
|
|
84
|
+
state: Readonly<{}>;
|
|
85
|
+
refs: {
|
|
86
|
+
[key: string]: React.ReactInstance;
|
|
87
|
+
};
|
|
88
|
+
componentDidMount?(): void;
|
|
89
|
+
shouldComponentUpdate?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
90
|
+
componentWillUnmount?(): void;
|
|
91
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
92
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, prevState: Readonly<{}>): any;
|
|
93
|
+
componentDidUpdate?(prevProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
94
|
+
componentWillMount?(): void;
|
|
95
|
+
UNSAFE_componentWillMount?(): void;
|
|
96
|
+
componentWillReceiveProps?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextContext: any): void;
|
|
97
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextContext: any): void;
|
|
98
|
+
componentWillUpdate?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
99
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
100
|
+
};
|
|
101
|
+
new (props: CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps, context: any): {
|
|
102
|
+
render(): JSX.Element;
|
|
103
|
+
context: any;
|
|
104
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: () => void): void;
|
|
105
|
+
forceUpdate(callback?: () => void): void;
|
|
106
|
+
readonly props: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps> & Readonly<{
|
|
107
|
+
children?: React.ReactNode;
|
|
108
|
+
}>;
|
|
109
|
+
state: Readonly<{}>;
|
|
110
|
+
refs: {
|
|
111
|
+
[key: string]: React.ReactInstance;
|
|
112
|
+
};
|
|
113
|
+
componentDidMount?(): void;
|
|
114
|
+
shouldComponentUpdate?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
115
|
+
componentWillUnmount?(): void;
|
|
116
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
117
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, prevState: Readonly<{}>): any;
|
|
118
|
+
componentDidUpdate?(prevProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
119
|
+
componentWillMount?(): void;
|
|
120
|
+
UNSAFE_componentWillMount?(): void;
|
|
121
|
+
componentWillReceiveProps?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextContext: any): void;
|
|
122
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextContext: any): void;
|
|
123
|
+
componentWillUpdate?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
124
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<CodeEditorProps & import("../../LocaleWrapper/LocaleWrapper").LocaleProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
125
|
+
};
|
|
126
|
+
contextTypes: {
|
|
127
|
+
locale: import("prop-types").Requireable<object>;
|
|
128
|
+
};
|
|
129
|
+
contextType?: React.Context<any>;
|
|
130
|
+
};
|
|
131
|
+
export default _default;
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Released under the BSD 2-Clause License
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2018-present, terrestris GmbH & Co. KG and GeoStyler contributors
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
|
9
|
+
*
|
|
10
|
+
* * Redistributions of source code must retain the above copyright notice,
|
|
11
|
+
* this list of conditions and the following disclaimer.
|
|
12
|
+
*
|
|
13
|
+
* * Redistributions in binary form must reproduce the above copyright notice,
|
|
14
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
15
|
+
* and/or other materials provided with the distribution.
|
|
16
|
+
*
|
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
18
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
20
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
21
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
22
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
23
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
24
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
25
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
26
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
27
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
*/
|
|
29
|
+
var __extends = (this && this.__extends) || (function () {
|
|
30
|
+
var extendStatics = function (d, b) {
|
|
31
|
+
extendStatics = Object.setPrototypeOf ||
|
|
32
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
33
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
34
|
+
return extendStatics(d, b);
|
|
35
|
+
};
|
|
36
|
+
return function (d, b) {
|
|
37
|
+
if (typeof b !== "function" && b !== null)
|
|
38
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
39
|
+
extendStatics(d, b);
|
|
40
|
+
function __() { this.constructor = d; }
|
|
41
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
45
|
+
if (k2 === undefined) k2 = k;
|
|
46
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
47
|
+
}) : (function(o, m, k, k2) {
|
|
48
|
+
if (k2 === undefined) k2 = k;
|
|
49
|
+
o[k2] = m[k];
|
|
50
|
+
}));
|
|
51
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
52
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
53
|
+
}) : function(o, v) {
|
|
54
|
+
o["default"] = v;
|
|
55
|
+
});
|
|
56
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
57
|
+
if (mod && mod.__esModule) return mod;
|
|
58
|
+
var result = {};
|
|
59
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
60
|
+
__setModuleDefault(result, mod);
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
64
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
65
|
+
to[j] = from[i];
|
|
66
|
+
return to;
|
|
67
|
+
};
|
|
68
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
69
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
70
|
+
};
|
|
71
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
72
|
+
exports.CodeEditor = void 0;
|
|
73
|
+
var React = __importStar(require("react"));
|
|
74
|
+
// Favourite Editor should be Monaco Editor but its React Wrapper is currently
|
|
75
|
+
// not very stable
|
|
76
|
+
var react_codemirror2_1 = require("react-codemirror2");
|
|
77
|
+
require("codemirror/lib/codemirror.css");
|
|
78
|
+
require("codemirror/mode/xml/xml");
|
|
79
|
+
require("codemirror/mode/javascript/javascript");
|
|
80
|
+
require("blob");
|
|
81
|
+
var file_saver_1 = require("file-saver");
|
|
82
|
+
require("./CodeEditor.css");
|
|
83
|
+
var antd_1 = require("antd");
|
|
84
|
+
var Option = antd_1.Select.Option;
|
|
85
|
+
var isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
86
|
+
var LocaleWrapper_1 = require("../../LocaleWrapper/LocaleWrapper");
|
|
87
|
+
var en_US_1 = __importDefault(require("../../../locale/en_US"));
|
|
88
|
+
var SLDUnitsSelect_1 = require("../../Symbolizer/SLDUnitsSelect/SLDUnitsSelect");
|
|
89
|
+
/**
|
|
90
|
+
* The CodeEditor.
|
|
91
|
+
*/
|
|
92
|
+
var CodeEditor = /** @class */ (function (_super) {
|
|
93
|
+
__extends(CodeEditor, _super);
|
|
94
|
+
function CodeEditor(props) {
|
|
95
|
+
var _this = _super.call(this, props) || this;
|
|
96
|
+
_this.updateValueFromStyle = function (style) {
|
|
97
|
+
_this.valueFromStyleInput(style)
|
|
98
|
+
.then(function (parsedStyle) {
|
|
99
|
+
_this.setState({
|
|
100
|
+
value: parsedStyle
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
_this.getModeByParser = function () {
|
|
105
|
+
var activeParser = _this.state.activeParser;
|
|
106
|
+
if (activeParser && activeParser.sldVersion) {
|
|
107
|
+
return 'application/xml';
|
|
108
|
+
}
|
|
109
|
+
return 'application/json';
|
|
110
|
+
};
|
|
111
|
+
_this.valueFromStyleInput = function (style) {
|
|
112
|
+
var activeParser = _this.state.activeParser;
|
|
113
|
+
return new Promise(function (resolve, reject) {
|
|
114
|
+
if (activeParser) {
|
|
115
|
+
resolve(activeParser.writeStyle(style));
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
resolve(JSON.stringify(style, null, 2));
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
_this.styleFromValue = function (value) {
|
|
123
|
+
var activeParser = _this.state.activeParser;
|
|
124
|
+
return new Promise(function (resolve, reject) {
|
|
125
|
+
if (activeParser) {
|
|
126
|
+
resolve(activeParser.readStyle(value));
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
resolve(JSON.parse(value));
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
_this.onChange = function (editor, data, value) {
|
|
137
|
+
_this.setState({
|
|
138
|
+
value: value,
|
|
139
|
+
invalidMessage: undefined
|
|
140
|
+
});
|
|
141
|
+
var onStyleChange = _this.props.onStyleChange;
|
|
142
|
+
try {
|
|
143
|
+
_this.styleFromValue(value)
|
|
144
|
+
.then(function (style) {
|
|
145
|
+
if (onStyleChange) {
|
|
146
|
+
onStyleChange(style);
|
|
147
|
+
}
|
|
148
|
+
}).catch(function (err) {
|
|
149
|
+
_this.setState({
|
|
150
|
+
invalidMessage: err.message
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
_this.setState({
|
|
156
|
+
invalidMessage: 'Error'
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
_this.onSelect = function (selection) {
|
|
161
|
+
var _a = _this.props, parsers = _a.parsers, style = _a.style;
|
|
162
|
+
if (parsers) {
|
|
163
|
+
var activeParser = parsers.find(function (parser) { return parser.title === selection; });
|
|
164
|
+
_this.setState({ activeParser: activeParser }, function () {
|
|
165
|
+
if (style) {
|
|
166
|
+
_this.updateValueFromStyle(style);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
_this.onUnitSelect = function (selection) {
|
|
172
|
+
var style = _this.props.style;
|
|
173
|
+
var activeParser = _this.state.activeParser;
|
|
174
|
+
var parser = activeParser;
|
|
175
|
+
parser.symbolizerUnits = selection;
|
|
176
|
+
if (style) {
|
|
177
|
+
_this.updateValueFromStyle(style);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
_this.handleOnChange = function (editor, data, value) {
|
|
181
|
+
var delay = _this.props.delay;
|
|
182
|
+
clearTimeout(_this.editTimeout);
|
|
183
|
+
_this.editTimeout = setTimeout(function () {
|
|
184
|
+
_this.onChange(editor, data, value);
|
|
185
|
+
}, delay);
|
|
186
|
+
};
|
|
187
|
+
_this.getParserOptions = function () {
|
|
188
|
+
var parserOptions = [
|
|
189
|
+
React.createElement(Option, { key: "GeoStyler Style", value: "GeoStyler Style" }, "Geostyler Style")
|
|
190
|
+
];
|
|
191
|
+
if (_this.props.parsers) {
|
|
192
|
+
var additionalOptions = _this.props.parsers.map(function (parser) {
|
|
193
|
+
var title = parser.title;
|
|
194
|
+
return React.createElement(Option, { key: title, value: title }, title);
|
|
195
|
+
});
|
|
196
|
+
return __spreadArray(__spreadArray([], parserOptions), additionalOptions);
|
|
197
|
+
}
|
|
198
|
+
return parserOptions;
|
|
199
|
+
};
|
|
200
|
+
_this.onDownloadButtonClick = function () {
|
|
201
|
+
var activeParser = _this.state.activeParser;
|
|
202
|
+
var value = _this.state.value;
|
|
203
|
+
var style = _this.props.style;
|
|
204
|
+
if (style) {
|
|
205
|
+
var fileName = style.name;
|
|
206
|
+
var type = 'application/json;charset=utf-8';
|
|
207
|
+
var title = activeParser && activeParser.title;
|
|
208
|
+
if (title === 'SLD Style Parser') {
|
|
209
|
+
type = 'text/xml;charset=utf-8';
|
|
210
|
+
fileName += '.sld';
|
|
211
|
+
}
|
|
212
|
+
var blob = new Blob([value], { type: type });
|
|
213
|
+
file_saver_1.saveAs(blob, fileName);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
_this.onCopyButtonClick = function () {
|
|
217
|
+
var value = _this.state.value;
|
|
218
|
+
_this.copyToClipboard(value);
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Copies the a value to the clipboard.
|
|
222
|
+
* Credits: https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f
|
|
223
|
+
*
|
|
224
|
+
* @param {string} str The string to copy to the clipboard.
|
|
225
|
+
*/
|
|
226
|
+
_this.copyToClipboard = function (str) {
|
|
227
|
+
var locale = _this.props.locale;
|
|
228
|
+
var el = document.createElement('textarea');
|
|
229
|
+
el.value = str;
|
|
230
|
+
el.setAttribute('readonly', '');
|
|
231
|
+
el.style.position = 'absolute';
|
|
232
|
+
el.style.left = '-9999px';
|
|
233
|
+
document.body.appendChild(el);
|
|
234
|
+
var selected = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false;
|
|
235
|
+
el.select();
|
|
236
|
+
document.execCommand('copy');
|
|
237
|
+
document.body.removeChild(el);
|
|
238
|
+
antd_1.message.info(locale.styleCopied);
|
|
239
|
+
if (selected) {
|
|
240
|
+
document.getSelection().removeAllRanges();
|
|
241
|
+
document.getSelection().addRange(selected);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
_this.editTimeout = null;
|
|
245
|
+
_this.state = {
|
|
246
|
+
value: '',
|
|
247
|
+
hasError: false
|
|
248
|
+
};
|
|
249
|
+
return _this;
|
|
250
|
+
}
|
|
251
|
+
CodeEditor.prototype.componentDidMount = function () {
|
|
252
|
+
var _this = this;
|
|
253
|
+
this.setState({
|
|
254
|
+
activeParser: this.props.defaultParser
|
|
255
|
+
}, function () {
|
|
256
|
+
if (_this.props.style) {
|
|
257
|
+
_this.updateValueFromStyle(_this.props.style);
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
CodeEditor.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
|
262
|
+
var diffProps = !isEqual_1.default(this.props, nextProps);
|
|
263
|
+
var diffState = !isEqual_1.default(this.state, nextState);
|
|
264
|
+
return diffProps || diffState;
|
|
265
|
+
};
|
|
266
|
+
CodeEditor.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
267
|
+
if (this.props.style && !isEqual_1.default(this.props.style, prevProps.style)) {
|
|
268
|
+
this.updateValueFromStyle(this.props.style);
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
CodeEditor.prototype.componentDidCatch = function (error, errorInfo) {
|
|
272
|
+
this.setState({
|
|
273
|
+
hasError: true
|
|
274
|
+
});
|
|
275
|
+
};
|
|
276
|
+
CodeEditor.prototype.render = function () {
|
|
277
|
+
var _a = this.props, locale = _a.locale, showSaveButton = _a.showSaveButton, showCopyButton = _a.showCopyButton;
|
|
278
|
+
var activeParser = this.state.activeParser;
|
|
279
|
+
var _b = this.state, hasError = _b.hasError, value = _b.value;
|
|
280
|
+
if (hasError) {
|
|
281
|
+
return React.createElement("h1", null, "An error occured in the CodeEditor UI.");
|
|
282
|
+
}
|
|
283
|
+
return (React.createElement("div", { className: "gs-code-editor" },
|
|
284
|
+
React.createElement("div", { className: "gs-code-editor-toolbar" },
|
|
285
|
+
locale.formatSelectLabel,
|
|
286
|
+
": ",
|
|
287
|
+
React.createElement(antd_1.Select, { className: "gs-code-editor-format-select", style: { width: 300 }, onSelect: this.onSelect, value: activeParser ? activeParser.title : 'GeoStyler Style' }, this.getParserOptions()),
|
|
288
|
+
activeParser &&
|
|
289
|
+
activeParser.sldVersion &&
|
|
290
|
+
activeParser.sldVersion !== '1.0.0' &&
|
|
291
|
+
React.createElement(SLDUnitsSelect_1.SLDUnitsSelect, { changeHandler: this.onUnitSelect })),
|
|
292
|
+
React.createElement(react_codemirror2_1.UnControlled, { className: "gs-code-editor-codemirror", value: value, autoCursor: false, options: {
|
|
293
|
+
gutters: ['CodeMirror-lint-markers'],
|
|
294
|
+
lint: true,
|
|
295
|
+
mode: this.getModeByParser(),
|
|
296
|
+
lineNumbers: true,
|
|
297
|
+
lineWrapping: true
|
|
298
|
+
}, onChange: this.handleOnChange }),
|
|
299
|
+
React.createElement("div", { className: "gs-code-editor-errormessage" }, this.state.invalidMessage),
|
|
300
|
+
React.createElement("div", { className: "gs-code-editor-bottombar" },
|
|
301
|
+
!showCopyButton ? null :
|
|
302
|
+
React.createElement(antd_1.Button, { className: "gs-code-editor-copy-button", type: "primary", onClick: this.onCopyButtonClick }, locale.copyButtonLabel),
|
|
303
|
+
!showSaveButton ? null :
|
|
304
|
+
React.createElement(antd_1.Button, { className: "gs-code-editor-download-button", type: "primary", onClick: this.onDownloadButtonClick }, locale.downloadButtonLabel))));
|
|
305
|
+
};
|
|
306
|
+
CodeEditor.defaultProps = {
|
|
307
|
+
locale: en_US_1.default.GsCodeEditor,
|
|
308
|
+
delay: 500,
|
|
309
|
+
showSaveButton: false,
|
|
310
|
+
showCopyButton: false
|
|
311
|
+
};
|
|
312
|
+
CodeEditor.componentName = 'CodeEditor';
|
|
313
|
+
return CodeEditor;
|
|
314
|
+
}(React.Component));
|
|
315
|
+
exports.CodeEditor = CodeEditor;
|
|
316
|
+
exports.default = LocaleWrapper_1.localize(CodeEditor, CodeEditor.componentName);
|
|
317
|
+
//# sourceMappingURL=CodeEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../../../src/Component/Legacy/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA+B;AAC/B,8EAA8E;AAC9E,kBAAkB;AAClB,uDAE2B;AAC3B,yCAAuC;AACvC,mCAAiC;AACjC,iDAA+C;AAE/C,gBAAc;AACd,yCAEoB;AAEpB,6BAA2B;AAE3B,6BAIc;AACd,IAAM,MAAM,GAAG,aAAM,CAAC,MAAM,CAAC;AAO7B,2DAAsC;AAEtC,mEAA6D;AAC7D,gEAA0C;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
15
|
-
* @deprecated
|
|
16
15
|
*/
|
|
17
16
|
export declare class TitleField extends React.Component<TitleFieldProps> {
|
|
18
17
|
static defaultProps: TitleFieldDefaultProps;
|
|
@@ -43,11 +43,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
43
43
|
})();
|
|
44
44
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
45
45
|
if (k2 === undefined) k2 = k;
|
|
46
|
-
|
|
47
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
48
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
49
|
-
}
|
|
50
|
-
Object.defineProperty(o, k2, desc);
|
|
46
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
51
47
|
}) : (function(o, m, k, k2) {
|
|
52
48
|
if (k2 === undefined) k2 = k;
|
|
53
49
|
o[k2] = m[k];
|
|
@@ -71,7 +67,6 @@ var antd_1 = require("antd");
|
|
|
71
67
|
require("./TitleField.css");
|
|
72
68
|
/**
|
|
73
69
|
* Input field for the rule title.
|
|
74
|
-
* @deprecated
|
|
75
70
|
*/
|
|
76
71
|
var TitleField = /** @class */ (function (_super) {
|
|
77
72
|
__extends(TitleField, _super);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleField.js","sourceRoot":"","sources":["../../../../src/Component/Rule/TitleField/TitleField.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG
|
|
1
|
+
{"version":3,"file":"TitleField.js","sourceRoot":"","sources":["../../../../src/Component/Rule/TitleField/TitleField.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA+B;AAC/B,6BAAmC;AAEnC,6BAA2B;AAe3B;;GAEG;AACH;IAAgC,8BAAgC;IAAhE;QAAA,qEAsCC;QA/BC;;;WAGG;QACH,cAAQ,GAAG,UAAC,CAAsC;YAE9C,IAAA,QAAQ,GACN,KAAI,CAAC,KAAK,SADJ,CACK;YACf,IAAI,QAAQ,EAAE;gBACZ,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aAC1B;QACH,CAAC,CAAC;;IAoBJ,CAAC;IAlBC,2BAAM,GAAN;QAEE,OAAO,CACL,6BAAK,SAAS,EAAC,oBAAoB;YAEjC,oBAAC,WAAI,CAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK;gBAE9C,oBAAC,YAAK,IACJ,SAAS,EAAC,0BAA0B,EACpC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,GACnC,CAEQ,CAER,CACP,CAAC;IACJ,CAAC;IAnCa,uBAAY,GAA2B;QACnD,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,gCAAgC;KAC9C,CAAC;IAiCJ,iBAAC;CAAA,AAtCD,CAAgC,KAAK,CAAC,SAAS,GAsC9C;AAtCY,gCAAU;AAwCvB,kBAAe,UAAU,CAAC"}
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
/* Released under the BSD 2-Clause License
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2021-present, terrestris GmbH & Co. KG and GeoStyler contributors
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* Redistribution and use in source and binary forms, with or without
|
|
7
|
+
* modification, are permitted provided that the following conditions are met:
|
|
8
|
+
*
|
|
9
|
+
* * Redistributions of source code must retain the above copyright notice,
|
|
10
|
+
* this list of conditions and the following disclaimer.
|
|
11
|
+
*
|
|
12
|
+
* * Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
* and/or other materials provided with the distribution.
|
|
15
|
+
*
|
|
16
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
17
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
18
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
19
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
20
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
21
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
22
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
23
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
24
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
25
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
26
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
*/
|
|
1
28
|
.gs-rule-card > .ant-card-body {
|
|
2
29
|
display: flex;
|
|
3
30
|
}
|
|
@@ -52,7 +52,7 @@ var DataUtil_1 = __importDefault(require("../../Util/DataUtil"));
|
|
|
52
52
|
var antd_1 = require("antd");
|
|
53
53
|
var icons_1 = require("@ant-design/icons");
|
|
54
54
|
var Text = antd_1.Typography.Text;
|
|
55
|
-
|
|
55
|
+
exports.RuleCard = react_1.default.forwardRef(function (_a, ref) {
|
|
56
56
|
var _b, _c, _d;
|
|
57
57
|
var rule = _a.rule, duplicates = _a.duplicates, onClick = _a.onClick, data = _a.data, rendererProps = _a.rendererProps;
|
|
58
58
|
var amount;
|
|
@@ -64,7 +64,7 @@ var RuleCard = function (_a) {
|
|
|
64
64
|
if (rule.filter && rule.filter.length) {
|
|
65
65
|
cql = cqlParser.write(rule.filter);
|
|
66
66
|
}
|
|
67
|
-
return (react_1.default.createElement(antd_1.Card, { className: 'gs-rule-card', hoverable: true, onClick: onClick },
|
|
67
|
+
return (react_1.default.createElement(antd_1.Card, { ref: ref, className: 'gs-rule-card', hoverable: true, onClick: onClick },
|
|
68
68
|
react_1.default.createElement(Renderer_1.default, __assign({ symbolizers: rule.symbolizers, data: data }, rendererProps)),
|
|
69
69
|
react_1.default.createElement(antd_1.Divider, { type: 'vertical' }),
|
|
70
70
|
react_1.default.createElement("div", { className: 'gs-rule-card-content' },
|
|
@@ -88,7 +88,6 @@ var RuleCard = function (_a) {
|
|
|
88
88
|
((_d = rule.filter) === null || _d === void 0 ? void 0 : _d.length) && (react_1.default.createElement(Text, { type: 'secondary' },
|
|
89
89
|
react_1.default.createElement(icons_1.FilterFilled, { className: 'gs-rule-card-icon' }))),
|
|
90
90
|
react_1.default.createElement(Text, { type: 'secondary' }, cql)))));
|
|
91
|
-
};
|
|
92
|
-
exports.RuleCard = RuleCard;
|
|
91
|
+
});
|
|
93
92
|
exports.default = exports.RuleCard;
|
|
94
93
|
//# sourceMappingURL=RuleCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuleCard.js","sourceRoot":"","sources":["../../../src/Component/RuleCard/RuleCard.tsx"],"names":[],"mappings":";AAAA,8BAA8B;AAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;;;;;;;;;;;;AAEH,gDAA0B;AAK1B,6DAAiD;AAEjD,2BAAyB;AACzB,kEAA+D;AAC/D,qEAA+C;AAC/C,iEAA2C;AAE3C,6BAAiD;AACjD,2CAA+E;AACvE,IAAA,IAAI,GAAK,iBAAU,KAAf,CAAgB;
|
|
1
|
+
{"version":3,"file":"RuleCard.js","sourceRoot":"","sources":["../../../src/Component/RuleCard/RuleCard.tsx"],"names":[],"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I,CAAM;YACpB;gBACE;;oBAAK,CAAA,MAAA,IAAI,CAAC,gBAAgB,0CAAE,GAAG,KAAI,GAAG;;oBAAE,8BAAC,qBAAa,OAAG;;oBAAI,CAAA,MAAA,IAAI,CAAC,gBAAgB,0CAAE,GAAG,KAAI,GAAG,CAAI,CAC7F;YACP,wCAAM,SAAS,EAAC,+BAA+B;gBAC7C,8BAAC,IAAI,IAAC,IAAI,EAAC,WAAW;oBACpB,wCAAM,SAAS,EAAC,mBAAmB,aAAS;oBAC3C,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAC/B;gBACP,8BAAC,IAAI,IAAC,IAAI,EAAC,WAAW;oBACpB,8BAAC,qBAAa,IAAC,SAAS,EAAC,mBAAmB,GAAG;oBAC9C,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CACvC,CACF;YACP,wCAAM,SAAS,EAAC,kBAAkB;gBAE9B,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,MAAM,KAAI,CACrB,8BAAC,IAAI,IAAC,IAAI,EAAC,WAAW;oBACpB,8BAAC,oBAAY,IAAC,SAAS,EAAC,mBAAmB,GAAG,CACzC,CACR;gBAEH,8BAAC,IAAI,IAAC,IAAI,EAAC,WAAW,IAAE,GAAU,CAAQ,CACrC,CACH,CACD,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAe,gBAAQ,CAAC","sourcesContent":["/* eslint-disable camelcase */\n/* Released under the BSD 2-Clause License\n *\n * Copyright © 2021-present, terrestris GmbH & Co. KG and GeoStyler contributors\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * * Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport React from 'react';\n\nimport {\n Rule as GsRule,\n} from 'geostyler-style';\nimport { CqlParser } from 'geostyler-cql-parser';\n\nimport './RuleCard.less';\nimport Renderer, { RendererProps } from '../Renderer/Renderer';\nimport FilterUtil from '../../Util/FilterUtil';\nimport DataUtil from '../../Util/DataUtil';\nimport { Data } from 'geostyler-data';\nimport { Divider, Card, Typography } from 'antd';\nimport { BlockOutlined, FilterFilled, MinusOutlined } from '@ant-design/icons';\nconst { Text } = Typography;\n\n// default props\ninterface RuleCardDefaultProps {\n}\n\n// non default props\nexport interface RuleCardProps extends Partial<RuleCardDefaultProps> {\n /** The rule to display. */\n rule: GsRule;\n /** The number of features that are also matched by other rules. */\n duplicates?: number;\n /** Reference to internal data object (holding schema and example features). */\n data?: Data;\n /** The callback when the card was clicked. */\n onClick?: () => void;\n /** The passthrough props for the Renderer component. */\n rendererProps?: Partial<RendererProps>;\n}\n\nexport const RuleCard: React.FC<RuleCardProps> = React.forwardRef<HTMLDivElement, RuleCardProps>(({\n rule,\n duplicates,\n onClick,\n data,\n rendererProps\n}, ref) => {\n\n let amount;\n if (data && DataUtil.isVector(data) && rule.filter && rule.filter.length) {\n amount = FilterUtil.getMatches(rule.filter, data).length;\n }\n\n const cqlParser = new CqlParser();\n let cql;\n if (rule.filter && rule.filter.length) {\n cql = cqlParser.write(rule.filter);\n }\n\n return (\n <Card\n ref={ref}\n className='gs-rule-card'\n hoverable={true}\n onClick={onClick}\n >\n <Renderer\n symbolizers={rule.symbolizers}\n data={data}\n {...rendererProps}\n />\n <Divider type='vertical' />\n <div className='gs-rule-card-content'>\n <h2>{rule.name}</h2>\n <span>\n <>1:{rule.scaleDenominator?.min || '-'} <MinusOutlined /> 1:{rule.scaleDenominator?.max || '-'}</>\n </span>\n <span className='gs-rule-card-content-icon-row'>\n <Text type='secondary'>\n <span className='gs-rule-card-icon'>Σ</span>\n {amount !== undefined ? amount : '-'}\n </Text>\n <Text type='secondary'>\n <BlockOutlined className='gs-rule-card-icon' />\n {duplicates !== undefined ? duplicates : '-'}\n </Text>\n </span>\n <span className='gs-rule-card-cql'>\n {\n rule.filter?.length && (\n <Text type='secondary'>\n <FilterFilled className='gs-rule-card-icon' />\n </Text>\n )\n }\n <Text type='secondary'>{cql as any}</Text>\n </span>\n </div>\n </Card>\n );\n});\n\nexport default RuleCard;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GeoStylerLocale } from '../../../locale/locale';
|
|
3
|
-
export
|
|
3
|
+
export type ClassificationMethod = 'equalInterval' | 'quantile' | 'logarithmic' | 'kmeans';
|
|
4
4
|
export interface ClassificationComboDefaultProps {
|
|
5
5
|
/** Locale object containing translated text snippets */
|
|
6
6
|
locale: GeoStylerLocale['ClassificationCombo'];
|
|
@@ -4,7 +4,7 @@ import { Data } from 'geostyler-data';
|
|
|
4
4
|
import './RuleGenerator.css';
|
|
5
5
|
import { InterpolationMode } from 'chroma-js';
|
|
6
6
|
import { GeoStylerLocale } from '../../locale/locale';
|
|
7
|
-
export
|
|
7
|
+
export type LevelOfMeasurement = 'nominal' | 'ordinal' | 'cardinal';
|
|
8
8
|
interface RuleGeneratorDefaultProps {
|
|
9
9
|
locale: GeoStylerLocale['RuleGenerator'];
|
|
10
10
|
/** List of provided color ramps */
|