@devgateway/dvz-ui-react 1.9.5 → 1.9.6
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),g=require("react");class h extends g.Component{constructor(t){super(t)}formatNumber(t){const{intl:i,format:s}=this.props;return i.formatNumber(s.style==="percent"?t/100:t,{style:s.style,notation:s.notation,maximumFractionDigits:s.maximumFractionDigits,minimuFractionDigits:0,currency:s.currency})}render(){const{filteredBreaks:t,formattedLegendTitle:i,showLegendLabels:s,symbols:r,legendFontSize:c,legendFontWeight:d,autoGenerateBreaks:a,intl:N,numberFormat:b,mapNoDataColor:u,showNoDataLegendItem:o,noDataText:x}=this.props,n={fontSize:c+"px",fontWeight:d};return l.jsxs("div",{className:"legend-container",children:[l.jsx("div",{className:"legend-title-container",children:l.jsx("span",{className:"legend-title",children:t&&t.length>0?i:""})}),l.jsx("div",{className:"legend",children:l.jsxs("ul",{className:"legend-items-container",children:[t&&t.map((e,m)=>l.jsxs("li",{className:"legend-item",children:[l.jsx("span",{className:"symbol",style:{backgroundColor:e.color}}),s&&!a&&l.jsx("span",{className:"legend-label",style:n,children:e.label}),(!s||a)&&e.min!=null&&e.max!=null&&l.jsxs("span",{className:"legend-label",style:n,children:[this.formatNumber(e.min)," -"," ",this.formatNumber(e.max)]}),(!s||a)&&e.min==null&&e.max!=null&&l.jsxs("span",{className:"legend-label",style:n,children:[" ","< ",this.formatNumber(e.max)]}),(!s||a)&&e.min!=null&&e.max==null&&l.jsxs("span",{className:"legend-label",style:n,children:[" ","> ",this.formatNumber(e.min)," "]})]},"lg"+m)),console.log("showNoDataLegendItem",o),o&&l.jsxs("li",{className:"legend-item",children:[l.jsx("span",{className:"symbol",style:{backgroundColor:u}}),l.jsx("span",{className:"legend-label",style:n,children:x})]}),r&&r.map((e,m)=>l.jsxs("li",{className:"legend-item",children:[e.image&&l.jsx("img",{style:{width:"40px",height:"40px",marginTop:"-8px",marginRight:"-4px"},src:"/"+e.image}),l.jsx("span",{className:"legend-label",style:n,children:e.label?e.label:""})]},"k"+m))]})})]})}}exports.default=h;
|
|
@@ -1,44 +1,41 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as a, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import u from "react";
|
|
3
3
|
class D extends u.Component {
|
|
4
|
-
constructor(
|
|
5
|
-
super(
|
|
4
|
+
constructor(t) {
|
|
5
|
+
super(t);
|
|
6
6
|
}
|
|
7
|
-
formatNumber(
|
|
8
|
-
const { intl: m, format:
|
|
9
|
-
return m.formatNumber(
|
|
10
|
-
style:
|
|
11
|
-
notation:
|
|
12
|
-
maximumFractionDigits:
|
|
7
|
+
formatNumber(t) {
|
|
8
|
+
const { intl: m, format: l } = this.props;
|
|
9
|
+
return m.formatNumber(l.style === "percent" ? t / 100 : t, {
|
|
10
|
+
style: l.style,
|
|
11
|
+
notation: l.notation,
|
|
12
|
+
maximumFractionDigits: l.maximumFractionDigits,
|
|
13
13
|
minimuFractionDigits: 0,
|
|
14
|
-
currency:
|
|
14
|
+
currency: l.currency
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
18
|
const {
|
|
19
|
-
filteredBreaks:
|
|
19
|
+
filteredBreaks: t,
|
|
20
20
|
formattedLegendTitle: m,
|
|
21
|
-
showLegendLabels:
|
|
22
|
-
symbols:
|
|
21
|
+
showLegendLabels: l,
|
|
22
|
+
symbols: o,
|
|
23
23
|
legendFontSize: d,
|
|
24
24
|
legendFontWeight: h,
|
|
25
25
|
autoGenerateBreaks: i,
|
|
26
26
|
intl: b,
|
|
27
27
|
numberFormat: x,
|
|
28
|
-
mapNoDataColor:
|
|
29
|
-
showNoDataLegendItem:
|
|
30
|
-
noDataText:
|
|
31
|
-
} = this.props,
|
|
28
|
+
mapNoDataColor: g,
|
|
29
|
+
showNoDataLegendItem: c,
|
|
30
|
+
noDataText: p
|
|
31
|
+
} = this.props, s = {
|
|
32
32
|
fontSize: d + "px",
|
|
33
33
|
fontWeight: h
|
|
34
34
|
};
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
] }),
|
|
40
|
-
/* @__PURE__ */ n("div", { className: "legend", children: /* @__PURE__ */ s("ul", { className: "legend-items-container", children: [
|
|
41
|
-
l && l.map((e, r) => /* @__PURE__ */ s("li", { className: "legend-item", children: [
|
|
35
|
+
return /* @__PURE__ */ a("div", { className: "legend-container", children: [
|
|
36
|
+
/* @__PURE__ */ n("div", { className: "legend-title-container", children: /* @__PURE__ */ n("span", { className: "legend-title", children: t && t.length > 0 ? m : "" }) }),
|
|
37
|
+
/* @__PURE__ */ n("div", { className: "legend", children: /* @__PURE__ */ a("ul", { className: "legend-items-container", children: [
|
|
38
|
+
t && t.map((e, r) => /* @__PURE__ */ a("li", { className: "legend-item", children: [
|
|
42
39
|
/* @__PURE__ */ n(
|
|
43
40
|
"span",
|
|
44
41
|
{
|
|
@@ -46,38 +43,37 @@ class D extends u.Component {
|
|
|
46
43
|
style: { backgroundColor: e.color }
|
|
47
44
|
}
|
|
48
45
|
),
|
|
49
|
-
|
|
50
|
-
(!
|
|
46
|
+
l && !i && /* @__PURE__ */ n("span", { className: "legend-label", style: s, children: e.label }),
|
|
47
|
+
(!l || i) && e.min != null && e.max != null && /* @__PURE__ */ a("span", { className: "legend-label", style: s, children: [
|
|
51
48
|
this.formatNumber(e.min),
|
|
52
49
|
" -",
|
|
53
50
|
" ",
|
|
54
51
|
this.formatNumber(e.max)
|
|
55
52
|
] }),
|
|
56
|
-
(!
|
|
53
|
+
(!l || i) && e.min == null && e.max != null && /* @__PURE__ */ a("span", { className: "legend-label", style: s, children: [
|
|
57
54
|
" ",
|
|
58
55
|
"< ",
|
|
59
56
|
this.formatNumber(e.max)
|
|
60
57
|
] }),
|
|
61
|
-
(!
|
|
58
|
+
(!l || i) && e.min != null && e.max == null && /* @__PURE__ */ a("span", { className: "legend-label", style: s, children: [
|
|
62
59
|
" ",
|
|
63
60
|
"> ",
|
|
64
61
|
this.formatNumber(e.min),
|
|
65
62
|
" "
|
|
66
63
|
] })
|
|
67
64
|
] }, "lg" + r)),
|
|
68
|
-
console.log("showNoDataLegendItem",
|
|
69
|
-
|
|
65
|
+
console.log("showNoDataLegendItem", c),
|
|
66
|
+
c && /* @__PURE__ */ a("li", { className: "legend-item", children: [
|
|
70
67
|
/* @__PURE__ */ n(
|
|
71
68
|
"span",
|
|
72
69
|
{
|
|
73
70
|
className: "symbol",
|
|
74
|
-
style: { backgroundColor:
|
|
71
|
+
style: { backgroundColor: g }
|
|
75
72
|
}
|
|
76
73
|
),
|
|
77
|
-
/* @__PURE__ */ n("span", { className: "legend-label", style:
|
|
74
|
+
/* @__PURE__ */ n("span", { className: "legend-label", style: s, children: p })
|
|
78
75
|
] }),
|
|
79
|
-
|
|
80
|
-
/* @__PURE__ */ n("span", { className: "vertical-spacer", children: "|" }),
|
|
76
|
+
o && o.map((e, r) => /* @__PURE__ */ a("li", { className: "legend-item", children: [
|
|
81
77
|
e.image && /* @__PURE__ */ n(
|
|
82
78
|
"img",
|
|
83
79
|
{
|
|
@@ -90,7 +86,7 @@ class D extends u.Component {
|
|
|
90
86
|
src: "/" + e.image
|
|
91
87
|
}
|
|
92
88
|
),
|
|
93
|
-
/* @__PURE__ */ n("span", { className: "legend-label", style:
|
|
89
|
+
/* @__PURE__ */ n("span", { className: "legend-label", style: s, children: e.label ? e.label : "" })
|
|
94
90
|
] }, "k" + r))
|
|
95
91
|
] }) })
|
|
96
92
|
] });
|