geostyler 18.4.2 → 18.5.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 +1 -1
- package/browser/geostyler.css +1 -1
- package/browser/geostyler.iife.js +48 -48
- package/dist/Component/RuleCard/RuleCard.d.ts +5 -0
- package/dist/Component/RuleCard/RuleCard.js +40 -43
- package/dist/Component/RuleFieldContainer/RuleFieldContainer.d.ts +6 -2
- package/dist/Component/RuleFieldContainer/RuleFieldContainer.js +58 -39
- package/dist/Component/RuleGenerator/RuleGenerator.d.ts +2 -1
- package/dist/Component/RuleGenerator/RuleGenerator.js +140 -113
- package/dist/Component/RuleOverview/RuleOverview.js +38 -33
- package/dist/Component/RuleTable/RuleTable.js +169 -148
- package/dist/Component/Rules/Rules.js +69 -68
- package/dist/Component/Symbolizer/Field/ElseRuleField/ElseRuleField.d.ts +12 -0
- package/dist/Component/Symbolizer/Field/ElseRuleField/ElseRuleField.js +27 -0
- package/dist/Util/FilterUtil.d.ts +1 -1
- package/dist/Util/FilterUtil.js +59 -59
- package/dist/Util/RuleGeneratorUtil.d.ts +1 -0
- package/dist/Util/RuleGeneratorUtil.js +60 -50
- package/dist/index.css +1 -1
- package/dist/locale/cs_CZ.js +11 -4
- package/dist/locale/de_DE.js +9 -2
- package/dist/locale/en_US.js +9 -2
- package/dist/locale/es_ES.js +9 -2
- package/dist/locale/fr_FR.js +9 -2
- package/dist/locale/locale.d.ts +7 -0
- package/dist/locale/pl_PL.js +9 -2
- package/dist/locale/zh_CN.js +9 -2
- package/package.json +3 -3
|
@@ -29,12 +29,17 @@ export interface RuleComposableProps {
|
|
|
29
29
|
/** ignored if actionsField.visibility is falsy */
|
|
30
30
|
remove?: boolean;
|
|
31
31
|
};
|
|
32
|
+
elseRuleField?: {
|
|
33
|
+
visibility?: boolean;
|
|
34
|
+
};
|
|
32
35
|
}
|
|
33
36
|
export interface RuleCardInternalProps {
|
|
34
37
|
/** The rule to display. */
|
|
35
38
|
rule: GsRule;
|
|
36
39
|
/** The number of features that are also matched by other rules. */
|
|
37
40
|
duplicates?: number;
|
|
41
|
+
/** The number of features that are matched by this rule. */
|
|
42
|
+
amount?: number;
|
|
38
43
|
/** The callback when the card was clicked. */
|
|
39
44
|
onClick?: () => void;
|
|
40
45
|
}
|
|
@@ -1,61 +1,58 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { CqlParser as
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { CqlParser as q } from "geostyler-cql-parser";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import { Renderer as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
onClick: C,
|
|
4
|
+
import { Renderer as $ } from "../Renderer/Renderer/Renderer.js";
|
|
5
|
+
import { Typography as w, Card as D, Divider as j } from "antd";
|
|
6
|
+
import { BlockOutlined as k, FilterFilled as z } from "@ant-design/icons";
|
|
7
|
+
import { useGeoStylerComposition as P } from "../../context/GeoStylerContext/GeoStylerContext.js";
|
|
8
|
+
const { Text: s } = w, E = (v) => {
|
|
9
|
+
var f, h;
|
|
10
|
+
const b = P("Rule"), g = { ...v, ...b }, {
|
|
11
|
+
rule: r,
|
|
12
|
+
duplicates: p,
|
|
13
|
+
amount: m,
|
|
14
|
+
onClick: N,
|
|
16
15
|
amountField: o,
|
|
17
16
|
duplicateField: c,
|
|
18
|
-
filterField:
|
|
17
|
+
filterField: t,
|
|
19
18
|
maxScaleField: a,
|
|
20
19
|
minScaleField: d,
|
|
21
|
-
nameField:
|
|
22
|
-
} =
|
|
23
|
-
let p;
|
|
24
|
-
j.isVector(u) && (p = R.getMatches(e.filter, u).length);
|
|
25
|
-
const D = new $();
|
|
20
|
+
nameField: u
|
|
21
|
+
} = g, C = new q();
|
|
26
22
|
let y;
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
|
|
23
|
+
r.filter && (y = C.write(r.filter));
|
|
24
|
+
const R = (i, n) => i === void 0 && n === void 0 ? "-" : i === void 0 ? `1:${n}` : n === void 0 ? `1:${i}` : `1:${i} < 1:${n}`;
|
|
25
|
+
return /* @__PURE__ */ l(
|
|
26
|
+
D,
|
|
31
27
|
{
|
|
32
28
|
className: "gs-rule-card",
|
|
33
29
|
hoverable: !0,
|
|
34
|
-
onClick:
|
|
30
|
+
onClick: N,
|
|
35
31
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
32
|
+
/* @__PURE__ */ e(
|
|
33
|
+
$,
|
|
38
34
|
{
|
|
39
|
-
symbolizers:
|
|
35
|
+
symbolizers: r.symbolizers
|
|
40
36
|
}
|
|
41
37
|
),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
(
|
|
45
|
-
(a == null ? void 0 : a.visibility) === !1 || (d == null ? void 0 : d.visibility) === !1 ? null : /* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
(o == null ? void 0 : o.visibility) === !1 ? null : /* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ e(j, { type: "vertical" }),
|
|
39
|
+
/* @__PURE__ */ l("div", { className: "gs-rule-card-content", children: [
|
|
40
|
+
(u == null ? void 0 : u.visibility) === !1 ? null : /* @__PURE__ */ e("h2", { children: r.elseRule ? /* @__PURE__ */ e("i", { children: r.name }) : r.name }),
|
|
41
|
+
(a == null ? void 0 : a.visibility) === !1 || (d == null ? void 0 : d.visibility) === !1 ? null : /* @__PURE__ */ e("span", { children: R((f = r.scaleDenominator) == null ? void 0 : f.min, (h = r.scaleDenominator) == null ? void 0 : h.max) }),
|
|
42
|
+
/* @__PURE__ */ l("span", { className: "gs-rule-card-content-icon-row", children: [
|
|
43
|
+
(o == null ? void 0 : o.visibility) === !1 ? null : /* @__PURE__ */ l(s, { type: "secondary", children: [
|
|
44
|
+
/* @__PURE__ */ e("span", { className: "gs-rule-card-icon", children: "Σ" }),
|
|
45
|
+
m !== void 0 ? m : "-"
|
|
46
|
+
] }),
|
|
47
|
+
(c == null ? void 0 : c.visibility) === !1 ? null : /* @__PURE__ */ l(s, { type: "secondary", children: [
|
|
48
|
+
/* @__PURE__ */ e(k, { className: "gs-rule-card-icon" }),
|
|
49
49
|
p !== void 0 ? p : "-"
|
|
50
50
|
] }),
|
|
51
|
-
|
|
52
|
-
/* @__PURE__ */ r(P, { className: "gs-rule-card-icon" }),
|
|
53
|
-
f !== void 0 ? f : "-"
|
|
54
|
-
] })
|
|
51
|
+
r.elseRule ? /* @__PURE__ */ e(s, { type: "secondary", children: /* @__PURE__ */ e("span", { className: "gs-rule-card-icon", children: "≠" }) }) : null
|
|
55
52
|
] }),
|
|
56
|
-
(
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
53
|
+
(t == null ? void 0 : t.visibility) === !1 ? null : /* @__PURE__ */ l("span", { className: "gs-rule-card-cql", children: [
|
|
54
|
+
/* @__PURE__ */ e(s, { type: "secondary", children: /* @__PURE__ */ e(z, { className: "gs-rule-card-icon" }) }),
|
|
55
|
+
/* @__PURE__ */ e(s, { type: "secondary", children: y })
|
|
59
56
|
] })
|
|
60
57
|
] })
|
|
61
58
|
]
|
|
@@ -63,5 +60,5 @@ const { Text: t } = k, J = (g) => {
|
|
|
63
60
|
);
|
|
64
61
|
};
|
|
65
62
|
export {
|
|
66
|
-
|
|
63
|
+
E as RuleCard
|
|
67
64
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { Expression, Symbolizer } from 'geostyler-style';
|
|
2
|
+
import { Expression, Rule, Symbolizer } from 'geostyler-style';
|
|
3
3
|
import { RuleComposableProps } from '../RuleCard/RuleCard';
|
|
4
|
-
export type RuleFieldContainerComposableProps = Pick<RuleComposableProps, 'maxScaleField' | 'minScaleField' | 'nameField'>;
|
|
4
|
+
export type RuleFieldContainerComposableProps = Pick<RuleComposableProps, 'maxScaleField' | 'minScaleField' | 'nameField' | 'elseRuleField'>;
|
|
5
5
|
export interface RuleFieldContainerInternalProps {
|
|
6
6
|
/** The callback method when the name changes */
|
|
7
7
|
onNameChange?: (name: string) => void;
|
|
@@ -17,6 +17,10 @@ export interface RuleFieldContainerInternalProps {
|
|
|
17
17
|
maxScale?: Expression<number>;
|
|
18
18
|
/** The symbolizers of the rule */
|
|
19
19
|
symbolizers?: Symbolizer[];
|
|
20
|
+
/** The else rule flag */
|
|
21
|
+
elseRule?: Rule['elseRule'];
|
|
22
|
+
/** The callback method when the elseRule changes */
|
|
23
|
+
onElseRuleChange?: (elseRule: Rule['elseRule']) => void;
|
|
20
24
|
}
|
|
21
25
|
export type RuleFieldContainerProps = RuleFieldContainerInternalProps & RuleFieldContainerComposableProps;
|
|
22
26
|
export declare const RuleFieldContainer: React.FC<RuleFieldContainerProps>;
|
|
@@ -1,67 +1,86 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { Form as
|
|
4
|
-
import { FieldContainer as
|
|
5
|
-
import { NameField as
|
|
6
|
-
import { MinScaleDenominator as
|
|
7
|
-
import { MaxScaleDenominator as
|
|
8
|
-
import { Renderer as
|
|
9
|
-
import { useGeoStylerComposition as
|
|
10
|
-
import { getFormItemConfig as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
import { Form as m, Divider as R } from "antd";
|
|
4
|
+
import { FieldContainer as F } from "../FieldContainer/FieldContainer.js";
|
|
5
|
+
import { NameField as S } from "../NameField/NameField.js";
|
|
6
|
+
import { MinScaleDenominator as x } from "../ScaleDenominator/MinScaleDenominator.js";
|
|
7
|
+
import { MaxScaleDenominator as M } from "../ScaleDenominator/MaxScaleDenominator.js";
|
|
8
|
+
import { Renderer as N } from "../Renderer/Renderer/Renderer.js";
|
|
9
|
+
import { useGeoStylerComposition as D, useGeoStylerLocale as I } from "../../context/GeoStylerContext/GeoStylerContext.js";
|
|
10
|
+
import { getFormItemConfig as L } from "../../Util/FormItemUtil.js";
|
|
11
|
+
import { ElseRuleField as j } from "../Symbolizer/Field/ElseRuleField/ElseRuleField.js";
|
|
12
|
+
const K = (s) => {
|
|
13
|
+
const c = D("Rule"), u = { ...s, ...c }, {
|
|
14
|
+
maxScale: f,
|
|
14
15
|
maxScaleField: o,
|
|
15
|
-
minScale:
|
|
16
|
+
minScale: d,
|
|
16
17
|
minScaleField: i,
|
|
17
18
|
name: p,
|
|
18
|
-
nameField:
|
|
19
|
-
onMaxScaleChange:
|
|
19
|
+
nameField: n,
|
|
20
|
+
onMaxScaleChange: h = () => {
|
|
20
21
|
},
|
|
21
|
-
onMinScaleChange:
|
|
22
|
+
onMinScaleChange: C = () => {
|
|
22
23
|
},
|
|
23
|
-
onNameChange:
|
|
24
|
+
onNameChange: g = () => {
|
|
24
25
|
},
|
|
25
|
-
symbolizers:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
symbolizers: v = [],
|
|
27
|
+
elseRuleField: r,
|
|
28
|
+
elseRule: b,
|
|
29
|
+
onElseRuleChange: y = () => {
|
|
30
|
+
}
|
|
31
|
+
} = u, a = I("RuleFieldContainer"), l = L();
|
|
32
|
+
return /* @__PURE__ */ t(F, { className: "gs-rule-field-container", children: [
|
|
33
|
+
/* @__PURE__ */ t("div", { className: "gs-rule-field-container-header", children: [
|
|
34
|
+
(n == null ? void 0 : n.visibility) === !1 ? null : /* @__PURE__ */ e(
|
|
35
|
+
m.Item,
|
|
31
36
|
{
|
|
32
|
-
...
|
|
33
|
-
label:
|
|
37
|
+
...l,
|
|
38
|
+
label: a.nameFieldLabel,
|
|
34
39
|
children: /* @__PURE__ */ e(
|
|
35
|
-
|
|
40
|
+
S,
|
|
36
41
|
{
|
|
37
42
|
value: p,
|
|
38
|
-
onChange:
|
|
39
|
-
placeholder:
|
|
43
|
+
onChange: g,
|
|
44
|
+
placeholder: a.nameFieldPlaceholder
|
|
40
45
|
}
|
|
41
46
|
)
|
|
42
47
|
}
|
|
43
48
|
),
|
|
44
49
|
(i == null ? void 0 : i.visibility) === !1 ? null : /* @__PURE__ */ e(
|
|
45
|
-
|
|
50
|
+
x,
|
|
46
51
|
{
|
|
47
|
-
value:
|
|
48
|
-
onChange:
|
|
49
|
-
...
|
|
52
|
+
value: d,
|
|
53
|
+
onChange: C,
|
|
54
|
+
...l
|
|
50
55
|
}
|
|
51
56
|
),
|
|
52
57
|
(o == null ? void 0 : o.visibility) === !1 ? null : /* @__PURE__ */ e(
|
|
53
|
-
|
|
58
|
+
M,
|
|
54
59
|
{
|
|
55
|
-
value:
|
|
56
|
-
onChange:
|
|
57
|
-
...
|
|
60
|
+
value: f,
|
|
61
|
+
onChange: h,
|
|
62
|
+
...l
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
(r == null ? void 0 : r.visibility) === !1 ? null : /* @__PURE__ */ e(
|
|
66
|
+
m.Item,
|
|
67
|
+
{
|
|
68
|
+
...l,
|
|
69
|
+
label: a.elseRuleFieldLabel,
|
|
70
|
+
children: /* @__PURE__ */ e(
|
|
71
|
+
j,
|
|
72
|
+
{
|
|
73
|
+
value: b,
|
|
74
|
+
onChange: y
|
|
75
|
+
}
|
|
76
|
+
)
|
|
58
77
|
}
|
|
59
78
|
)
|
|
60
79
|
] }),
|
|
61
|
-
/* @__PURE__ */ e(
|
|
62
|
-
/* @__PURE__ */ e(
|
|
80
|
+
/* @__PURE__ */ e(R, { type: "vertical" }),
|
|
81
|
+
/* @__PURE__ */ e(N, { symbolizers: v })
|
|
63
82
|
] });
|
|
64
83
|
};
|
|
65
84
|
export {
|
|
66
|
-
|
|
85
|
+
K as RuleFieldContainer
|
|
67
86
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { Rule } from 'geostyler-style';
|
|
3
3
|
import { InterpolationMode } from 'chroma-js';
|
|
4
|
+
import { RuleComposableProps } from '../RuleCard/RuleCard';
|
|
4
5
|
export type LevelOfMeasurement = 'nominal' | 'ordinal' | 'cardinal';
|
|
5
6
|
export interface RuleGeneratorComposableProps {
|
|
6
7
|
/** List of provided color ramps */
|
|
@@ -11,5 +12,5 @@ export interface RuleGeneratorComposableProps {
|
|
|
11
12
|
export interface RuleGeneratorInternalProps {
|
|
12
13
|
onRulesChange?: (rules: Rule[]) => void;
|
|
13
14
|
}
|
|
14
|
-
export type RuleGeneratorProps = RuleGeneratorInternalProps & RuleGeneratorComposableProps
|
|
15
|
+
export type RuleGeneratorProps = RuleGeneratorInternalProps & RuleGeneratorComposableProps & Pick<RuleComposableProps, 'elseRuleField'>;
|
|
15
16
|
export declare const RuleGenerator: React.FC<RuleGeneratorProps>;
|