@devgateway/dvz-ui-react 1.6.20 → 1.7.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.
Files changed (156) hide show
  1. package/dist/cjs/_virtual/_commonjsHelpers.js +1 -0
  2. package/dist/cjs/_virtual/debounce.js +1 -0
  3. package/dist/cjs/embeddable/big-filter/BigNumberGroup.js +1 -0
  4. package/dist/cjs/embeddable/big-filter/BigNumberItem.js +1 -0
  5. package/dist/cjs/embeddable/big-filter/DataProvider.js +1 -0
  6. package/dist/cjs/embeddable/big-filter/index.js +1 -0
  7. package/dist/cjs/embeddable/big-number/index.js +1 -1
  8. package/dist/cjs/embeddable/big-number-trend/Alternative.js +1 -0
  9. package/dist/cjs/embeddable/big-number-trend/Classic.js +1 -0
  10. package/dist/cjs/embeddable/big-number-trend/index.js +1 -1
  11. package/dist/cjs/embeddable/chart/Bar.js +1 -1
  12. package/dist/cjs/embeddable/chart/Line.js +1 -1
  13. package/dist/cjs/embeddable/chart/data/Bar.js +1 -1
  14. package/dist/cjs/embeddable/chart/data/Line.js +1 -1
  15. package/dist/cjs/embeddable/chart/data/Utils.js +1 -1
  16. package/dist/cjs/embeddable/chart/index.js +1 -1
  17. package/dist/cjs/embeddable/d3Map/BaseLayer.js +1 -1
  18. package/dist/cjs/embeddable/d3Map/BreaksStyles.js +1 -1
  19. package/dist/cjs/embeddable/d3Map/DataLayer.js +1 -1
  20. package/dist/cjs/embeddable/d3Map/FlowLayer.js +1 -1
  21. package/dist/cjs/embeddable/d3Map/GradientColors.js +1 -1
  22. package/dist/cjs/embeddable/d3Map/LatLongLayer.js +1 -1
  23. package/dist/cjs/embeddable/d3Map/Layer.js +1 -1
  24. package/dist/cjs/embeddable/d3Map/Legends.js +1 -1
  25. package/dist/cjs/embeddable/d3Map/ProjectedContainer.js +1 -1
  26. package/dist/cjs/embeddable/d3Map/Utils.js +1 -1
  27. package/dist/cjs/embeddable/d3Map/ZoomControl.js +1 -1
  28. package/dist/cjs/embeddable/d3Map/index.js +1 -1
  29. package/dist/cjs/embeddable/data/CategoriesProvider.js +1 -1
  30. package/dist/cjs/embeddable/data/D3MapDataConsumer.js +1 -0
  31. package/dist/cjs/embeddable/data/D3MapDataProvider.js +1 -0
  32. package/dist/cjs/embeddable/data/DataContext.js +1 -1
  33. package/dist/cjs/embeddable/data/DataProvider.js +1 -1
  34. package/dist/cjs/embeddable/data-paragraph/index.js +1 -0
  35. package/dist/cjs/embeddable/download/dom-to-image.js +2 -2
  36. package/dist/cjs/embeddable/download/index.js +5 -5
  37. package/dist/cjs/embeddable/filter/index.js +1 -1
  38. package/dist/cjs/embeddable/grouped-bars/GroupedBars.js +1 -0
  39. package/dist/cjs/embeddable/grouped-bars/index.js +1 -0
  40. package/dist/cjs/embeddable/index.js +1 -1
  41. package/dist/cjs/embeddable/posts-filter/CategoricalFilter.js +1 -1
  42. package/dist/cjs/embeddable/reducers/data-api.js +1 -1
  43. package/dist/cjs/embeddable/reducers/data.js +1 -1
  44. package/dist/cjs/embeddable/utils/common.js +1 -1
  45. package/dist/cjs/index.js +1 -1
  46. package/dist/cjs/layout/Customizer.js +1 -1
  47. package/dist/cjs/layout/SearchControl.js +1 -1
  48. package/dist/cjs/layout/containers/SlugPostContainer.js +1 -1
  49. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +1 -0
  50. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +1 -0
  51. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js +1 -0
  52. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +1 -0
  53. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +1 -0
  54. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +1 -0
  55. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +1 -0
  56. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js +1 -0
  57. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js +1 -0
  58. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +1 -0
  59. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +1 -0
  60. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +1 -0
  61. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js +1 -0
  62. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js +1 -0
  63. package/dist/cjs/styles.css +1 -1
  64. package/dist/esm/_virtual/_commonjsHelpers.js +8 -0
  65. package/dist/esm/_virtual/debounce.js +7 -0
  66. package/dist/esm/embeddable/big-filter/BigNumberGroup.js +129 -0
  67. package/dist/esm/embeddable/big-filter/BigNumberItem.js +107 -0
  68. package/dist/esm/embeddable/big-filter/DataProvider.js +53 -0
  69. package/dist/esm/embeddable/big-filter/index.js +130 -0
  70. package/dist/esm/embeddable/big-number/index.js +154 -102
  71. package/dist/esm/embeddable/big-number-trend/Alternative.js +227 -0
  72. package/dist/esm/embeddable/big-number-trend/Classic.js +190 -0
  73. package/dist/esm/embeddable/big-number-trend/index.js +12 -147
  74. package/dist/esm/embeddable/chart/Bar.js +450 -395
  75. package/dist/esm/embeddable/chart/Line.js +216 -184
  76. package/dist/esm/embeddable/chart/data/Bar.js +16 -18
  77. package/dist/esm/embeddable/chart/data/Line.js +27 -24
  78. package/dist/esm/embeddable/chart/data/Utils.js +3 -1
  79. package/dist/esm/embeddable/chart/index.js +168 -162
  80. package/dist/esm/embeddable/d3Map/BaseLayer.js +25 -28
  81. package/dist/esm/embeddable/d3Map/BreaksStyles.js +17 -10
  82. package/dist/esm/embeddable/d3Map/DataLayer.js +290 -289
  83. package/dist/esm/embeddable/d3Map/FlowLayer.js +122 -136
  84. package/dist/esm/embeddable/d3Map/GradientColors.js +27 -20
  85. package/dist/esm/embeddable/d3Map/LatLongLayer.js +62 -62
  86. package/dist/esm/embeddable/d3Map/Layer.js +31 -27
  87. package/dist/esm/embeddable/d3Map/Legends.js +204 -190
  88. package/dist/esm/embeddable/d3Map/ProjectedContainer.js +1 -3
  89. package/dist/esm/embeddable/d3Map/Utils.js +12 -8
  90. package/dist/esm/embeddable/d3Map/ZoomControl.js +41 -41
  91. package/dist/esm/embeddable/d3Map/index.js +135 -117
  92. package/dist/esm/embeddable/data/CategoriesProvider.js +39 -26
  93. package/dist/esm/embeddable/data/D3MapDataConsumer.js +7 -0
  94. package/dist/esm/embeddable/data/D3MapDataProvider.js +83 -0
  95. package/dist/esm/embeddable/data/DataContext.js +2 -2
  96. package/dist/esm/embeddable/data/DataProvider.js +124 -55
  97. package/dist/esm/embeddable/data-paragraph/index.js +168 -0
  98. package/dist/esm/embeddable/download/dom-to-image.js +163 -148
  99. package/dist/esm/embeddable/download/index.js +102 -76
  100. package/dist/esm/embeddable/filter/index.js +335 -298
  101. package/dist/esm/embeddable/grouped-bars/GroupedBars.js +549 -0
  102. package/dist/esm/embeddable/grouped-bars/index.js +16 -0
  103. package/dist/esm/embeddable/index.js +33 -30
  104. package/dist/esm/embeddable/posts-filter/CategoricalFilter.js +18 -18
  105. package/dist/esm/embeddable/reducers/data-api.js +39 -35
  106. package/dist/esm/embeddable/reducers/data.js +141 -182
  107. package/dist/esm/embeddable/utils/common.js +3 -3
  108. package/dist/esm/index.js +111 -94
  109. package/dist/esm/layout/Customizer.js +10 -9
  110. package/dist/esm/layout/SearchControl.js +103 -113
  111. package/dist/esm/layout/containers/SlugPostContainer.js +1 -1
  112. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +11 -0
  113. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +16 -0
  114. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js +14 -0
  115. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +11 -0
  116. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +21 -0
  117. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +13 -0
  118. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +11 -0
  119. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js +15 -0
  120. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js +60 -0
  121. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +13 -0
  122. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +12 -0
  123. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +15 -0
  124. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js +13 -0
  125. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js +28 -0
  126. package/dist/esm/styles.css +1 -1
  127. package/dist/types/embeddable/big-filter/BigNumberGroup.d.ts +3 -0
  128. package/dist/types/embeddable/big-filter/BigNumberItem.d.ts +2 -0
  129. package/dist/types/embeddable/big-filter/DataProvider.d.ts +7 -0
  130. package/dist/types/embeddable/big-filter/index.d.ts +5 -0
  131. package/dist/types/embeddable/big-number-trend/Alternative.d.ts +5 -0
  132. package/dist/types/embeddable/big-number-trend/Classic.d.ts +5 -0
  133. package/dist/types/embeddable/big-number-trend/index.d.ts +2 -4
  134. package/dist/types/embeddable/chart/Bar.d.ts +3 -0
  135. package/dist/types/embeddable/chart/Line.d.ts +6 -0
  136. package/dist/types/embeddable/d3Map/GradientColors.d.ts +6 -2
  137. package/dist/types/embeddable/d3Map/Layer.d.ts +1 -1
  138. package/dist/types/embeddable/d3Map/Utils.d.ts +1 -1
  139. package/dist/types/embeddable/data/D3MapDataProvider.d.ts +7 -0
  140. package/dist/types/embeddable/data/index.d.ts +6 -0
  141. package/dist/types/embeddable/data-paragraph/index.d.ts +5 -0
  142. package/dist/types/embeddable/filter/index.d.ts +13 -1
  143. package/dist/types/embeddable/grouped-bars/GroupedBars.d.ts +5 -0
  144. package/dist/types/embeddable/grouped-bars/index.d.ts +3 -0
  145. package/dist/types/embeddable/reducers/data-api.d.ts +5 -0
  146. package/dist/types/embeddable/reducers/data.d.ts +16 -9
  147. package/dist/types/embeddable/utils/index.d.ts +1 -0
  148. package/dist/types/embeddable/utils/parseUtils.d.ts +0 -6
  149. package/dist/types/index.d.ts +6 -0
  150. package/dist/types/layout/Customizer.d.ts +1 -0
  151. package/dist/types/layout/containers/PageContainer.d.ts +8 -0
  152. package/dist/types/layout/containers/PostContainer.d.ts +0 -0
  153. package/dist/types/layout/index.d.ts +1 -0
  154. package/dist/types/utils/Logger.d.ts +1 -0
  155. package/package.json +3 -2
  156. /package/dist/types/embeddable/data/{DataConsumerMap.d.ts → D3MapDataConsumer.d.ts} +0 -0
@@ -0,0 +1,549 @@
1
+ import { jsx as m, jsxs as A, Fragment as ze } from "react/jsx-runtime";
2
+ import { useRef as be, useState as ve } from "react";
3
+ import { Container as Ae } from "semantic-ui-react";
4
+ import Be from "../data/DataProvider.js";
5
+ import Le from "../data/DataConsumer.js";
6
+ import { connect as Te } from "react-redux";
7
+ import { alphaSort as xe } from "../utils/common.js";
8
+ import { formatContent as _e } from "../common/ChartTooltip.js";
9
+ const He = "No data matches your selection", Re = "-", Ee = "#5a5d68", Ue = "none", $e = 14, ke = "#3182ce", Ve = "none", de = 24, R = (o, l) => l ? o : decodeURIComponent(o), ne = (o, l) => {
10
+ try {
11
+ return JSON.parse(R(o, l));
12
+ } catch (s) {
13
+ return console.error("Error parsing value:", o, s), null;
14
+ }
15
+ }, we = (o) => o ? {
16
+ style: o.style === "compacted" ? "decimal" : o.style,
17
+ notation: o.style === "compacted" ? "compact" : "standard",
18
+ currency: o.currency,
19
+ minimumFractionDigits: parseInt(o.minimumFractionDigits, 10),
20
+ maximumFractionDigits: parseInt(o.maximumFractionDigits, 10),
21
+ prefix: o.prefix || "",
22
+ suffix: o.suffix || ""
23
+ } : {
24
+ notation: "standard",
25
+ currency: "USD",
26
+ minimumFractionDigits: 2,
27
+ maximumFractionDigits: 2,
28
+ prefix: "",
29
+ suffix: ""
30
+ }, Oe = (o, l, s, b = !0) => {
31
+ const i = [];
32
+ if (!o) return i;
33
+ const f = o[s];
34
+ if (f && typeof f == "object" && Object.entries(f).forEach(([p, w]) => {
35
+ if (w && w.selected) {
36
+ const E = b ? we(w.format || l) : l, I = w && typeof w.customLabel == "string" && w.customLabel.trim().length > 0 ? w.customLabel.trim() : p;
37
+ i.push({ name: p, format: E, label: I });
38
+ }
39
+ }), i.length === 0) {
40
+ const p = (Array.isArray(o), o[0]);
41
+ p && i.push({ name: p, format: l, label: p });
42
+ }
43
+ return i;
44
+ }, Ge = (o, l) => {
45
+ const s = {}, b = o || [];
46
+ return b.forEach && b.forEach((i) => {
47
+ var f;
48
+ ((f = i.value) == null ? void 0 : f.filter((p) => p != null && p.toString().trim() !== "").length) > 0 && (s[i.param] = i.value);
49
+ }), l && (s.dvzProxyDatasetId = l), s;
50
+ }, Pe = (o) => {
51
+ const l = [];
52
+ return o && o !== "none" && l.push(o), l;
53
+ }, Ze = ({
54
+ lineColor: o,
55
+ textColor: l = "#ffffff",
56
+ fontSizePx: s = "14px",
57
+ showLabel: b = !1,
58
+ label: i = "",
59
+ showValue: f = !1,
60
+ valueString: p = ""
61
+ }) => /* @__PURE__ */ A("div", { style: { display: "flex", alignItems: "center", height: "100%" }, children: [
62
+ /* @__PURE__ */ m(
63
+ "div",
64
+ {
65
+ className: "grouped-bar-zero-line",
66
+ style: {
67
+ width: "2px",
68
+ backgroundColor: o,
69
+ height: "100%"
70
+ }
71
+ }
72
+ ),
73
+ b && /* @__PURE__ */ m("span", { style: {
74
+ color: l,
75
+ fontSize: s,
76
+ fontWeight: "500",
77
+ whiteSpace: "nowrap",
78
+ marginLeft: "8px"
79
+ }, children: i }),
80
+ f && /* @__PURE__ */ m("span", { style: {
81
+ color: l,
82
+ fontSize: s,
83
+ fontWeight: "500",
84
+ whiteSpace: "nowrap",
85
+ marginLeft: b ? "6px" : "8px"
86
+ }, children: p })
87
+ ] }), We = ({ textColor: o, message: l = "No data to display" }) => /* @__PURE__ */ m("div", { className: "grouped-bars-data-frame", children: /* @__PURE__ */ m("div", { className: "no-data-text", style: { color: o }, children: l }) }), je = ({
88
+ dimensionValue: o,
89
+ measureEntries: l,
90
+ mainEntry: s,
91
+ barBackgroundColor: b,
92
+ textColor: i,
93
+ measureTextColor: f,
94
+ fontSize: p,
95
+ mainValueFontSize: w,
96
+ labelPosition: E,
97
+ labelWidth: I,
98
+ labelHeight: U,
99
+ labelFormat: $,
100
+ vars: k,
101
+ intl: B,
102
+ valuePosition: L,
103
+ format: y,
104
+ showMeasureLabels: V = !1
105
+ }) => {
106
+ var S, j;
107
+ const T = {
108
+ fontSize: p + "px",
109
+ color: i,
110
+ width: `${I}%`,
111
+ flex: `0 0 ${I}%`,
112
+ whiteSpace: "normal",
113
+ wordBreak: "break-word",
114
+ overflow: "hidden",
115
+ lineHeight: "1.2",
116
+ display: "flex",
117
+ alignItems: "center",
118
+ height: U + "px"
119
+ }, W = decodeURIComponent($ || ""), _ = _e(W, k || { value: o }, B), O = Array.isArray(l) && l.length === 1 && !s, G = L === "top" && O ? /* @__PURE__ */ A(
120
+ "div",
121
+ {
122
+ className: "grouped-bar-measure",
123
+ style: {
124
+ fontSize: (w || de) + "px",
125
+ color: i,
126
+ whiteSpace: "nowrap",
127
+ flex: "1",
128
+ textAlign: "right"
129
+ },
130
+ children: [
131
+ y.prefix,
132
+ new Intl.NumberFormat(B.locale, y).format(l[0].value),
133
+ y.suffix
134
+ ]
135
+ }
136
+ ) : null, P = /* @__PURE__ */ m("div", { style: { flex: "1", display: "flex", flexDirection: "column", gap: "6px", minWidth: 0 }, children: l.map((c, Q) => {
137
+ var Z, C, J, N;
138
+ return /* @__PURE__ */ m(
139
+ "div",
140
+ {
141
+ className: "grouped-bar-bar-container",
142
+ style: {
143
+ backgroundColor: b,
144
+ height: "28px",
145
+ borderRadius: "8px",
146
+ overflow: "hidden",
147
+ position: "relative",
148
+ display: "flex",
149
+ alignItems: "center"
150
+ },
151
+ children: c.width > 0 ? /* @__PURE__ */ m(
152
+ "div",
153
+ {
154
+ className: "grouped-bar-bar",
155
+ style: {
156
+ width: c.width + "%",
157
+ backgroundColor: c.color,
158
+ height: "100%",
159
+ display: "flex",
160
+ alignItems: "center",
161
+ paddingLeft: "8px",
162
+ paddingRight: "8px"
163
+ },
164
+ children: /* @__PURE__ */ A("span", { style: { color: f || "#ffffff", fontSize: p + "px", fontWeight: "500", whiteSpace: "nowrap" }, children: [
165
+ V ? /* @__PURE__ */ A(ze, { children: [
166
+ c.label || c.name,
167
+ c.label && c.label !== c.name ? " " : ": "
168
+ ] }) : null,
169
+ L === "bar" ? `${((Z = c.format) == null ? void 0 : Z.prefix) || ""}${new Intl.NumberFormat(B.locale, c.format || y).format(c.value)}${((C = c.format) == null ? void 0 : C.suffix) || ""}` : `${(c.width || 0).toFixed(1)}%`
170
+ ] })
171
+ }
172
+ ) : /* @__PURE__ */ m(
173
+ Ze,
174
+ {
175
+ lineColor: c.color,
176
+ textColor: f || "#ffffff",
177
+ fontSizePx: p + "px",
178
+ showLabel: !!V,
179
+ label: c.label || c.name,
180
+ showValue: !0,
181
+ valueString: `${((J = c.format) == null ? void 0 : J.prefix) || ""}${new Intl.NumberFormat(B.locale, c.format || y).format(c.value)}${((N = c.format) == null ? void 0 : N.suffix) || ""}`
182
+ }
183
+ )
184
+ },
185
+ `${o}-${c.name}-${Q}`
186
+ );
187
+ }) }), H = s ? /* @__PURE__ */ A(
188
+ "div",
189
+ {
190
+ className: "grouped-bar-main",
191
+ style: {
192
+ flex: "0 0 140px",
193
+ backgroundColor: s.color || b,
194
+ borderRadius: "8px",
195
+ padding: "10px",
196
+ display: "flex",
197
+ flexDirection: "column",
198
+ alignItems: "center",
199
+ justifyContent: "center",
200
+ minWidth: 0
201
+ },
202
+ children: [
203
+ /* @__PURE__ */ A("span", { style: {
204
+ color: f || i,
205
+ fontSize: (w || de) + "px",
206
+ fontWeight: 600,
207
+ lineHeight: 1,
208
+ whiteSpace: "nowrap"
209
+ }, children: [
210
+ ((S = s.format) == null ? void 0 : S.prefix) || "",
211
+ new Intl.NumberFormat(B.locale, s.format || y).format(s.value),
212
+ ((j = s.format) == null ? void 0 : j.suffix) || ""
213
+ ] }),
214
+ /* @__PURE__ */ m("span", { style: {
215
+ color: f || i,
216
+ fontSize: p + "px",
217
+ fontWeight: 500,
218
+ lineHeight: 1.2,
219
+ marginTop: 6,
220
+ textAlign: "center",
221
+ whiteSpace: "nowrap"
222
+ }, children: s.label || s.name })
223
+ ]
224
+ }
225
+ ) : null;
226
+ return E === "left" ? /* @__PURE__ */ m("div", { className: "grouped-bar-item", style: { marginBottom: "12px" }, children: /* @__PURE__ */ A("div", { style: { display: "flex", alignItems: "flex-start", gap: "12px" }, children: [
227
+ /* @__PURE__ */ m("div", { className: "grouped-bar-label", style: T, dangerouslySetInnerHTML: { __html: _ } }),
228
+ H,
229
+ P
230
+ ] }) }) : /* @__PURE__ */ A("div", { className: "grouped-bar-item", style: { marginBottom: "12px" }, children: [
231
+ /* @__PURE__ */ A("div", { style: { display: "flex", alignItems: "flex-start", gap: "12px", marginBottom: "6px" }, children: [
232
+ /* @__PURE__ */ m("div", { className: "grouped-bar-label", style: T, dangerouslySetInnerHTML: { __html: _ } }),
233
+ G
234
+ ] }),
235
+ /* @__PURE__ */ A("div", { style: { display: "flex", alignItems: "stretch", gap: "12px" }, children: [
236
+ H,
237
+ P
238
+ ] })
239
+ ] });
240
+ }, Je = (o) => {
241
+ const {
242
+ app: l,
243
+ measure: s,
244
+ dimension1: b,
245
+ data: i,
246
+ format: f,
247
+ textColor: p,
248
+ measureTextColor: w,
249
+ fontSize: E,
250
+ mainValueFontSize: I,
251
+ intl: U,
252
+ manualColors: $,
253
+ defaultBarColor: k,
254
+ barBackgroundColor: B,
255
+ labelPosition: L,
256
+ valuePosition: y,
257
+ labelWidth: V,
258
+ labelHeight: T,
259
+ labelFormat: W,
260
+ sorting: _,
261
+ sortDirection: O,
262
+ topN: G,
263
+ barSizeCriteria: P,
264
+ selectedMeasures: H,
265
+ mainMeasureName: S,
266
+ sortMeasureName: j,
267
+ barSizeUseGroup: c = !1,
268
+ showMeasureLabels: Q = !1,
269
+ onHeightChange: Z
270
+ } = o, C = be({ last: null, timer: null }), J = () => {
271
+ if (!i) return { dataItems: [], measureField: null, dimensionField: null };
272
+ if (l === "csv") {
273
+ const { data: e, meta: { fields: t } } = i, r = t[0], a = t[1];
274
+ return { dataItems: i.data.map((h) => ({
275
+ value: h[r],
276
+ [a]: h[a],
277
+ [r]: h[r]
278
+ })), measureField: a, dimensionField: r };
279
+ } else {
280
+ const e = i.children || [], t = s, r = b;
281
+ return { dataItems: e.map((u) => ({
282
+ value: u.value,
283
+ [t]: u[t],
284
+ [r]: u.value,
285
+ vars: { ...u }
286
+ })), measureField: t, dimensionField: r };
287
+ }
288
+ }, { dataItems: N, measureField: K, dimensionField: D } = J(), g = H && H.length > 0 ? H : K ? [{ name: K, format: f }] : s ? [{ name: s, format: f }] : [];
289
+ let x;
290
+ if (_ === "measure") {
291
+ const e = S || j || K || (g[0] ? g[0].name : null);
292
+ x = N.sort((t, r) => {
293
+ const a = e ? (t.vars && t.vars[e]) ?? t[e] ?? 0 : 0, u = e ? (r.vars && r.vars[e]) ?? r[e] ?? 0 : 0;
294
+ return O === "asc" ? a - u : u - a;
295
+ });
296
+ } else _ === "dimension" ? x = N.sort((e, t) => O === "asc" ? xe(!1, U.locale, e.value, t.value) : xe(!0, U.locale, e.value, t.value)) : x = N;
297
+ if (G && !isNaN(parseInt(G))) {
298
+ const e = parseInt(G);
299
+ if (e > 0)
300
+ if (g.length <= 1)
301
+ x = x.slice(0, e);
302
+ else if (S) {
303
+ const t = [...N].sort((a, u) => {
304
+ const h = ((a.vars && a.vars[S]) ?? a[S] ?? 0) || 0;
305
+ return (((u.vars && u.vars[S]) ?? u[S] ?? 0) || 0) - h;
306
+ }), r = new Set(
307
+ t.slice(0, e).map((a) => a[D])
308
+ );
309
+ x = x.filter((a) => r.has(a[D]));
310
+ } else {
311
+ const t = [...N].sort((a, u) => {
312
+ const h = g.reduce((n, v) => {
313
+ const d = ((a.vars && a.vars[v.name]) ?? a[v.name] ?? 0) || 0;
314
+ return n + d;
315
+ }, 0);
316
+ return g.reduce((n, v) => {
317
+ const d = ((u.vars && u.vars[v.name]) ?? u[v.name] ?? 0) || 0;
318
+ return n + d;
319
+ }, 0) - h;
320
+ }), r = new Set(
321
+ t.slice(0, e).map((a) => a[D])
322
+ );
323
+ x = x.filter((a) => r.has(a[D]));
324
+ }
325
+ }
326
+ const Y = {};
327
+ g.forEach((e) => {
328
+ Y[e.name] = x.reduce((t, r) => {
329
+ const a = (r.vars && r.vars[e.name]) ?? r[e.name] ?? 0;
330
+ return t + (a || 0);
331
+ }, 0);
332
+ });
333
+ const X = Math.max(
334
+ 0,
335
+ ...g.flatMap((e) => x.map((t) => (t.vars && t.vars[e.name]) ?? t[e.name] ?? 0))
336
+ ), se = Object.values(Y).reduce((e, t) => e + t, 0), ee = {};
337
+ x.forEach((e) => {
338
+ const t = e[D];
339
+ ee[t] = 0, g.forEach((r) => {
340
+ const a = (e.vars && e.vars[r.name]) ?? e[r.name] ?? 0;
341
+ ee[t] += a || 0;
342
+ });
343
+ });
344
+ const oe = {};
345
+ if (x.forEach((e) => {
346
+ const t = e[D], r = g.map((a) => ((e.vars && e.vars[a.name]) ?? e[a.name] ?? 0) || 0);
347
+ oe[t] = r.length > 0 ? Math.max(...r) : 0;
348
+ }), x.length === 0 || !D || g.length === 0 && !K)
349
+ return /* @__PURE__ */ m(We, { textColor: p });
350
+ const ie = (e, t) => {
351
+ const r = o.manualColorsMode || "dimension", a = ($ == null ? void 0 : $[l]) || {};
352
+ return r === "measure" ? a.measures && a.measures[e] ? a.measures[e] : t && a[t] ? a[t] : k : t && a[t] ? a[t] : a.measures && a.measures[e] ? a.measures[e] : k;
353
+ }, me = 28, fe = 6, re = 6 + (L === "left" ? 0 : 6), ce = T && parseInt(T, 10) || 0, le = (e) => {
354
+ if (o.showZeroNullMeasures) return g.length;
355
+ let t = 0;
356
+ return g.forEach((r) => {
357
+ const a = (e.vars && e.vars[r.name]) ?? e[r.name] ?? null, u = typeof a == "number" ? a : a != null ? parseFloat(a) : null;
358
+ u != null && u !== 0 && t++;
359
+ }), t;
360
+ };
361
+ let q = 0;
362
+ x.forEach((e) => {
363
+ const t = Math.max(1, le(e)), r = me * t + fe * Math.max(0, t - 1), a = L === "left" ? Math.max(r, ce) + 12 : r + 12 + re;
364
+ q += a;
365
+ });
366
+ const ue = q + 40;
367
+ if (typeof Z == "function") {
368
+ const e = Math.ceil(ue);
369
+ C.current.timer && (clearTimeout(C.current.timer), C.current.timer = null), C.current.last !== e && (C.current.timer = setTimeout(() => {
370
+ C.current.last !== e && (C.current.last = e, Z(e));
371
+ }, 100));
372
+ }
373
+ return /* @__PURE__ */ m("div", { className: "grouped-bars-data-frame", children: x.map((e, t) => {
374
+ const r = e[D], a = g.map((n) => {
375
+ const v = (e.vars && e.vars[n.name]) ?? e[n.name] ?? null, d = typeof v == "number" ? v : v != null ? parseFloat(v) : null;
376
+ let M = 0;
377
+ if (P === "percentage")
378
+ if (g.length > 1)
379
+ if (c) {
380
+ const F = ee[r] || 0;
381
+ M = F > 0 && d != null ? d / F * 100 : 0;
382
+ } else {
383
+ const F = se || 0;
384
+ M = F > 0 && d != null ? d / F * 100 : 0;
385
+ }
386
+ else {
387
+ const F = Y[n.name] || 0;
388
+ M = F > 0 && d != null ? d / F * 100 : 0;
389
+ }
390
+ else if (P === "relative_max")
391
+ if (g.length > 1 && c) {
392
+ const F = oe[r] || 0;
393
+ M = F > 0 && d != null ? d / F * 100 : 0;
394
+ } else
395
+ M = X > 0 && d != null ? d / X * 100 : 0;
396
+ else
397
+ M = X > 0 && d != null ? d / X * 100 : 0;
398
+ (d == null || d === 0) && (M = 0), M = Math.max(0, Math.min(100, M));
399
+ const ae = ie(n.name, r);
400
+ return { name: n.name, label: n.label || n.name, value: d, width: M, color: ae, format: n.format || f };
401
+ }), u = o.showZeroNullMeasures ? a : a.filter((n) => n.value != null && n.value !== 0);
402
+ let h = null;
403
+ if (S) {
404
+ const n = u.find((v) => v.name === S);
405
+ o.showZeroNullMeasures ? h = n || null : h = n && n.value != null && n.value !== 0 ? n : null;
406
+ }
407
+ let z = h ? u.filter((n) => n.name !== S) : u;
408
+ return _ === "measure" && (z = [...z].sort(
409
+ (n, v) => O === "asc" ? n.value - v.value : v.value - n.value
410
+ )), /* @__PURE__ */ m(
411
+ je,
412
+ {
413
+ dimensionValue: r,
414
+ measureEntries: z,
415
+ mainEntry: h,
416
+ barBackgroundColor: B,
417
+ textColor: p,
418
+ measureTextColor: w,
419
+ fontSize: E,
420
+ mainValueFontSize: I,
421
+ labelPosition: L,
422
+ valuePosition: y,
423
+ format: f,
424
+ labelWidth: V,
425
+ labelHeight: T,
426
+ labelFormat: W,
427
+ vars: e.vars,
428
+ intl: U,
429
+ showMeasureLabels: Q
430
+ },
431
+ `${r}-${t}`
432
+ );
433
+ }) });
434
+ }, Ke = (o) => {
435
+ var he;
436
+ const {
437
+ editing: l = !1,
438
+ unique: s,
439
+ intl: b,
440
+ "data-csv": i = "",
441
+ "data-dvz-proxy-dataset-id": f,
442
+ "data-no-data-message": p = He,
443
+ "data-view-mode": w = "info",
444
+ "data-height": E,
445
+ "data-app": I,
446
+ "data-measures": U = "{}",
447
+ "data-format": $ = "{}",
448
+ "data-group": k,
449
+ "data-filters": B = "[]",
450
+ "data-text-color": L = Ee,
451
+ "data-measure-text-color": y = "#ffffff",
452
+ "data-back-ground-color": V = Ue,
453
+ "data-font-size": T = $e,
454
+ "data-dimension1": W,
455
+ "data-wait-for-filters": _ = "false",
456
+ "data-no-data-text": O = Re,
457
+ "data-manual-colors": G = "{}",
458
+ "data-default-bar-color": P = ke,
459
+ "data-bar-background-color": H = Ve,
460
+ "data-label-position": S,
461
+ "data-value-position": j,
462
+ "data-label-width": c,
463
+ "data-label-height": Q,
464
+ "data-label-format": Z,
465
+ "data-sorting": C,
466
+ "data-sort-direction": J,
467
+ "data-sort-measure": N,
468
+ "data-top-n": K,
469
+ "data-bar-size-criteria": D,
470
+ "data-main-measure": g,
471
+ "data-show-measure-labels": x,
472
+ "data-bar-size-use-group": Y,
473
+ "data-enable-manual-colors": X,
474
+ "data-manual-colors-mode": se,
475
+ "data-main-value-font-size": ee,
476
+ "data-show-zero-null-measures": oe
477
+ } = o, ie = be(null), [me, fe] = ve(w), [re, ce] = ve(null), le = parseInt(E || 0, 10) || 0, q = Math.max(le, re || 0), ue = l ? q - 80 : q - 40, e = ne($, l), t = we(e), r = ne(B, l), a = ne(U, l), u = ne(G, l), h = Oe(a, t, I, o["data-enable-custom-measure-formats"] === "true"), z = h.map((te) => te.name), n = typeof g == "string" && g.length > 0 ? R(g) : null, v = n && n.toLowerCase() === "none" ? null : n || null, d = h.length > 1 ? v === null ? null : z.includes(v) ? v : z[0] : null, M = typeof N == "string" && N.length > 0 ? R(N) : null, ae = M && M.toLowerCase() === "none" ? null : M || null, F = h.length > 1 ? ae === null ? null : z.includes(ae) ? ae : z[0] : null, Se = Ge(r, f), pe = Pe(W), Me = D, Fe = Y === "true", Ce = X === "true", Ne = se || "dimension", Ie = parseInt(ee || de, 10), ye = x === "true", De = oe === "true";
478
+ return /* @__PURE__ */ m("div", { ref: ie, children: /* @__PURE__ */ m(
479
+ Ae,
480
+ {
481
+ className: `chart container grouped-bars-container ${l ? "editing" : ""}`,
482
+ style: { height: (q || le) + "px", backgroundColor: V },
483
+ fluid: !0,
484
+ children: /* @__PURE__ */ m(
485
+ Be,
486
+ {
487
+ style: { height: `${ue}px` },
488
+ params: Se,
489
+ app: I,
490
+ group: k,
491
+ csv: i,
492
+ editing: l,
493
+ waitForFilters: _ === "true",
494
+ store: [I, s, ...pe],
495
+ source: pe.join("/"),
496
+ children: /* @__PURE__ */ m(Le, { children: /* @__PURE__ */ m(
497
+ Je,
498
+ {
499
+ editing: l,
500
+ locale: b.locale,
501
+ intl: b,
502
+ app: I,
503
+ format: t,
504
+ dimension1: W,
505
+ manualColors: Ce ? u : {},
506
+ manualColorsMode: Ne,
507
+ measure: h.length === 1 ? (he = h[0]) == null ? void 0 : he.name : null,
508
+ fontSize: T,
509
+ textColor: R(L),
510
+ measureTextColor: R(y),
511
+ backGroundColor: R(V),
512
+ noDataText: O,
513
+ defaultBarColor: R(P),
514
+ barBackgroundColor: R(H),
515
+ labelPosition: S,
516
+ valuePosition: h.length > 1 ? "bar" : j,
517
+ labelWidth: c,
518
+ labelHeight: Q,
519
+ labelFormat: Z,
520
+ sorting: C,
521
+ sortDirection: J,
522
+ topN: K,
523
+ barSizeCriteria: Me,
524
+ barSizeUseGroup: Fe,
525
+ selectedMeasures: h,
526
+ mainMeasureName: d,
527
+ sortMeasureName: F,
528
+ mainValueFontSize: Ie,
529
+ showMeasureLabels: ye,
530
+ showZeroNullMeasures: De,
531
+ onHeightChange: (te) => {
532
+ if (typeof te == "number" && te > 0) {
533
+ const ge = Math.ceil(te);
534
+ ge !== re && ce(ge);
535
+ }
536
+ }
537
+ }
538
+ ) })
539
+ }
540
+ )
541
+ }
542
+ ) });
543
+ }, Xe = (o, l) => {
544
+ const { "data-app": s, "data-group": b } = l, i = o.getIn(["data", "measures", s, b]);
545
+ return i ? { injectedMeasures: i } : {};
546
+ }, qe = {}, na = Te(Xe, qe)(Ke);
547
+ export {
548
+ na as default
549
+ };
@@ -0,0 +1,16 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import "react";
3
+ import o from "./GroupedBars.js";
4
+ import "react-redux";
5
+ const f = (t) => {
6
+ const {
7
+ editing: i = !1,
8
+ unique: e,
9
+ intl: n,
10
+ childContent: m
11
+ } = t;
12
+ return /* @__PURE__ */ r(o, { ...t });
13
+ };
14
+ export {
15
+ f as default
16
+ };
@@ -1,27 +1,27 @@
1
- import i, { lazy as t } from "react";
2
- import c from "./reducers/data.js";
3
- import p from "./reducers/embeddable.js";
4
- import { injectIntl as a } from "react-intl";
5
- const l = t(() => import("./pagegallery/index.js")), d = t(() => import("./download/index.js")), u = t(() => import("./postscarousel/index.js")), b = t(() => import("./chart/index.js")), C = t(() => import("./filter/index.js")), g = t(() => import("./showcase/index.js")), f = t(() => import("./newsletter/index.js")), w = t(() => import("./tabbedposts/index.js")), P = t(() => import("./pagemodules/index.js")), y = t(() => import("./featuredtabs/index.js")), L = t(() => import("./vertical-featuredtabs/index.js")), F = t(() => import("./inlinelist/index.js")), h = t(() => import("./agree-and-download/index.js")), T = t(() => import("./downloadPDF/index.js")), N = t(() => import("./map/index.js")), R = t(() => import("./filter-reset-button/index.js")), D = t(() => import("./filters-apply-button/index.js")), M = t(() => import("./tooltip/index.js")), k = t(() => import("./references/ReferencesList.js")), B = t(() => import("./references/Reference.js")), j = t(() => import("./time-line/index.js")), A = t(() => import("./new-time-line/index.js")), I = t(() => import("./measures/index.js")), O = t(() => import("./menu/index.js")), S = t(() => import("./child-page-menu/index.js")), v = t(() => import("./d3Map/index.js")), x = t(() => import("./parallax/index.js")), z = t(() => import("./wrapped/index.js")), G = t(() => import("./sankeychart/index.js")), E = t(() => import("./datalabel/index.js")), V = t(() => import("./body/index.js")), W = t(() => import("./superset-chart/index.js")), q = t(() => import("./superset-dashboard/index.js")), H = t(() => import("./big-number/index.js")), J = t(() => import("./big-number-trend/index.js")), K = t(() => import("./posts-filter/index.js")), Q = t(() => import("./filtered-posts/index.js")), U = t(() => import("./posts-filters-reset-button/index.js")), X = t(() => import("./posts-pagination/index.js")), m = {
1
+ import a, { lazy as t } from "react";
2
+ import p from "./reducers/data.js";
3
+ import c from "./reducers/embeddable.js";
4
+ import { injectIntl as i } from "react-intl";
5
+ const l = t(() => import("./pagegallery/index.js")), d = t(() => import("./download/index.js")), u = t(() => import("./postscarousel/index.js")), g = t(() => import("./chart/index.js")), b = t(() => import("./filter/index.js")), C = t(() => import("./showcase/index.js")), f = t(() => import("./newsletter/index.js")), w = t(() => import("./tabbedposts/index.js")), P = t(() => import("./pagemodules/index.js")), y = t(() => import("./featuredtabs/index.js")), F = t(() => import("./vertical-featuredtabs/index.js")), L = t(() => import("./inlinelist/index.js")), h = t(() => import("./agree-and-download/index.js")), T = t(() => import("./downloadPDF/index.js")), B = t(() => import("./map/index.js")), D = t(() => import("./filter-reset-button/index.js")), N = t(() => import("./filters-apply-button/index.js")), R = t(() => import("./tooltip/index.js")), M = t(() => import("./references/ReferencesList.js")), k = t(() => import("./references/Reference.js")), j = t(() => import("./time-line/index.js")), A = t(() => import("./new-time-line/index.js")), I = t(() => import("./measures/index.js")), O = t(() => import("./menu/index.js")), S = t(() => import("./child-page-menu/index.js")), v = t(() => import("./d3Map/index.js")), x = t(() => import("./parallax/index.js")), G = t(() => import("./wrapped/index.js")), z = t(() => import("./sankeychart/index.js")), E = t(() => import("./datalabel/index.js")), V = t(() => import("./body/index.js")), W = t(() => import("./superset-chart/index.js")), q = t(() => import("./superset-dashboard/index.js")), H = t(() => import("./big-number/index.js")), J = t(() => import("./grouped-bars/index.js")), K = t(() => import("./big-number-trend/index.js")), Q = t(() => import("./posts-filter/index.js")), U = t(() => import("./filtered-posts/index.js")), X = t(() => import("./posts-filters-reset-button/index.js")), Y = t(() => import("./posts-pagination/index.js")), Z = t(() => import("./data-paragraph/index.js")), _ = t(() => import("./big-filter/index.js")), m = {
6
6
  pageGallery: l,
7
7
  postsCarousel: u,
8
- chart: b,
9
- filter: C,
10
- showCaseForm: g,
8
+ chart: g,
9
+ filter: b,
10
+ showCaseForm: C,
11
11
  newsLetter: f,
12
12
  tabbedPosts: w,
13
13
  pageModules: P,
14
14
  featuredTabs: y,
15
- verticalTabs: L,
16
- inlineList: F,
15
+ verticalTabs: F,
16
+ inlineList: L,
17
17
  download: d,
18
18
  downloadPdf: T,
19
- map: N,
20
- dataFiltersReset: R,
21
- dataFiltersApply: D,
22
- tooltip: M,
23
- references: k,
24
- reference: B,
19
+ map: B,
20
+ dataFiltersReset: D,
21
+ dataFiltersApply: N,
22
+ tooltip: R,
23
+ references: M,
24
+ reference: k,
25
25
  timeLine: j,
26
26
  newTimeLine: A,
27
27
  measures: I,
@@ -29,19 +29,22 @@ const l = t(() => import("./pagegallery/index.js")), d = t(() => import("./downl
29
29
  childPagesMenu: S,
30
30
  newMap: v,
31
31
  parallaxContainer: x,
32
- wrapped: z,
33
- sankeyChart: G,
32
+ wrapped: G,
33
+ sankeyChart: z,
34
34
  dataLabel: E,
35
35
  body: V,
36
36
  supersetChart: W,
37
37
  supersetDashboard: q,
38
38
  agreeAndDownload: h,
39
39
  bigNumber: H,
40
- bigNumberTrend: J,
41
- postsFilter: K,
42
- filteredPosts: Q,
43
- postsFiltersReset: U,
44
- postsPagination: X,
40
+ groupedBars: J,
41
+ bigNumberTrend: K,
42
+ postsFilter: Q,
43
+ filteredPosts: U,
44
+ postsFiltersReset: X,
45
+ postsPagination: Y,
46
+ dataParagraph: Z,
47
+ bigFilter: _,
45
48
  redirect: () => null
46
49
  }, s = {
47
50
  components: {},
@@ -54,7 +57,7 @@ const l = t(() => import("./pagegallery/index.js")), d = t(() => import("./downl
54
57
  const o = Object.keys(s.components).find((e) => e.toLowerCase() === r.toLowerCase());
55
58
  if (o) {
56
59
  const e = s.components[o];
57
- return i.memo(a(e));
60
+ return a.memo(i(e));
58
61
  }
59
62
  return null;
60
63
  },
@@ -63,18 +66,18 @@ const l = t(() => import("./pagegallery/index.js")), d = t(() => import("./downl
63
66
  s.reducers[o] = e;
64
67
  },
65
68
  getReducers: () => s.reducers
66
- }, tt = (r) => {
69
+ }, rt = (r) => {
67
70
  const o = Object.keys(m).find((n) => n.toLowerCase() === r.toLowerCase());
68
71
  if (o) {
69
72
  const n = m[o];
70
- return i.memo(a(n));
73
+ return a.memo(i(n));
71
74
  }
72
75
  const e = s.getComponentByNameIgnoreCase(r);
73
- return e ? i.memo(a(e)) : null;
74
- }, et = { data: c, embeddable: p, ...s.getReducers() };
76
+ return e ? a.memo(i(e)) : null;
77
+ }, st = { data: p, embeddable: c, ...s.getReducers() };
75
78
  export {
76
79
  m as components,
77
80
  s as customizer,
78
- tt as getComponentByNameIgnoreCase,
79
- et as reducers
81
+ rt as getComponentByNameIgnoreCase,
82
+ st as reducers
80
83
  };