@devgateway/dvz-ui-react 1.6.19 → 1.7.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.
Files changed (153) hide show
  1. package/dist/cjs/_virtual/_commonjsHelpers.js +1 -0
  2. package/dist/cjs/_virtual/debounce.js +1 -0
  3. package/dist/cjs/api/commons.js +1 -1
  4. package/dist/cjs/embeddable/big-filter/BigNumberGroup.js +1 -0
  5. package/dist/cjs/embeddable/big-filter/BigNumberItem.js +1 -0
  6. package/dist/cjs/embeddable/big-filter/DataProvider.js +1 -0
  7. package/dist/cjs/embeddable/big-filter/index.js +1 -0
  8. package/dist/cjs/embeddable/big-number/index.js +1 -1
  9. package/dist/cjs/embeddable/big-number-trend/Alternative.js +1 -0
  10. package/dist/cjs/embeddable/big-number-trend/Classic.js +1 -0
  11. package/dist/cjs/embeddable/big-number-trend/index.js +1 -1
  12. package/dist/cjs/embeddable/chart/Bar.js +1 -1
  13. package/dist/cjs/embeddable/chart/Line.js +1 -1
  14. package/dist/cjs/embeddable/chart/data/Bar.js +1 -1
  15. package/dist/cjs/embeddable/chart/index.js +1 -1
  16. package/dist/cjs/embeddable/d3Map/BaseLayer.js +1 -1
  17. package/dist/cjs/embeddable/d3Map/BreaksStyles.js +1 -1
  18. package/dist/cjs/embeddable/d3Map/DataLayer.js +1 -1
  19. package/dist/cjs/embeddable/d3Map/FlowLayer.js +1 -1
  20. package/dist/cjs/embeddable/d3Map/GradientColors.js +1 -1
  21. package/dist/cjs/embeddable/d3Map/LatLongLayer.js +1 -1
  22. package/dist/cjs/embeddable/d3Map/Layer.js +1 -1
  23. package/dist/cjs/embeddable/d3Map/Legends.js +1 -1
  24. package/dist/cjs/embeddable/d3Map/ProjectedContainer.js +1 -1
  25. package/dist/cjs/embeddable/d3Map/Utils.js +1 -1
  26. package/dist/cjs/embeddable/d3Map/ZoomControl.js +1 -1
  27. package/dist/cjs/embeddable/d3Map/index.js +1 -1
  28. package/dist/cjs/embeddable/data/CategoriesProvider.js +1 -1
  29. package/dist/cjs/embeddable/data/D3MapDataConsumer.js +1 -0
  30. package/dist/cjs/embeddable/data/D3MapDataProvider.js +1 -0
  31. package/dist/cjs/embeddable/data/DataContext.js +1 -1
  32. package/dist/cjs/embeddable/data/DataProvider.js +1 -1
  33. package/dist/cjs/embeddable/data-paragraph/index.js +1 -0
  34. package/dist/cjs/embeddable/download/dom-to-image.js +2 -2
  35. package/dist/cjs/embeddable/download/index.js +5 -5
  36. package/dist/cjs/embeddable/filter/index.js +1 -1
  37. package/dist/cjs/embeddable/grouped-bars/GroupedBars.js +1 -0
  38. package/dist/cjs/embeddable/grouped-bars/index.js +1 -0
  39. package/dist/cjs/embeddable/index.js +1 -1
  40. package/dist/cjs/embeddable/reducers/data-api.js +1 -1
  41. package/dist/cjs/embeddable/reducers/data.js +1 -1
  42. package/dist/cjs/embeddable/utils/common.js +1 -1
  43. package/dist/cjs/index.js +1 -1
  44. package/dist/cjs/layout/Customizer.js +1 -1
  45. package/dist/cjs/layout/PreviewComponent.js +1 -1
  46. package/dist/cjs/layout/containers/SlugPostContainer.js +1 -1
  47. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +1 -0
  48. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +1 -0
  49. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js +1 -0
  50. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +1 -0
  51. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +1 -0
  52. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +1 -0
  53. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +1 -0
  54. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js +1 -0
  55. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js +1 -0
  56. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +1 -0
  57. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +1 -0
  58. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +1 -0
  59. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js +1 -0
  60. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js +1 -0
  61. package/dist/cjs/styles.css +1 -1
  62. package/dist/esm/_virtual/_commonjsHelpers.js +8 -0
  63. package/dist/esm/_virtual/debounce.js +7 -0
  64. package/dist/esm/api/commons.js +26 -17
  65. package/dist/esm/embeddable/big-filter/BigNumberGroup.js +129 -0
  66. package/dist/esm/embeddable/big-filter/BigNumberItem.js +107 -0
  67. package/dist/esm/embeddable/big-filter/DataProvider.js +53 -0
  68. package/dist/esm/embeddable/big-filter/index.js +130 -0
  69. package/dist/esm/embeddable/big-number/index.js +154 -102
  70. package/dist/esm/embeddable/big-number-trend/Alternative.js +227 -0
  71. package/dist/esm/embeddable/big-number-trend/Classic.js +190 -0
  72. package/dist/esm/embeddable/big-number-trend/index.js +12 -147
  73. package/dist/esm/embeddable/chart/Bar.js +450 -395
  74. package/dist/esm/embeddable/chart/Line.js +216 -184
  75. package/dist/esm/embeddable/chart/data/Bar.js +16 -18
  76. package/dist/esm/embeddable/chart/index.js +168 -162
  77. package/dist/esm/embeddable/d3Map/BaseLayer.js +25 -28
  78. package/dist/esm/embeddable/d3Map/BreaksStyles.js +17 -10
  79. package/dist/esm/embeddable/d3Map/DataLayer.js +290 -289
  80. package/dist/esm/embeddable/d3Map/FlowLayer.js +122 -136
  81. package/dist/esm/embeddable/d3Map/GradientColors.js +27 -20
  82. package/dist/esm/embeddable/d3Map/LatLongLayer.js +62 -62
  83. package/dist/esm/embeddable/d3Map/Layer.js +31 -27
  84. package/dist/esm/embeddable/d3Map/Legends.js +204 -190
  85. package/dist/esm/embeddable/d3Map/ProjectedContainer.js +1 -3
  86. package/dist/esm/embeddable/d3Map/Utils.js +12 -8
  87. package/dist/esm/embeddable/d3Map/ZoomControl.js +41 -41
  88. package/dist/esm/embeddable/d3Map/index.js +135 -117
  89. package/dist/esm/embeddable/data/CategoriesProvider.js +39 -26
  90. package/dist/esm/embeddable/data/D3MapDataConsumer.js +7 -0
  91. package/dist/esm/embeddable/data/D3MapDataProvider.js +83 -0
  92. package/dist/esm/embeddable/data/DataContext.js +2 -2
  93. package/dist/esm/embeddable/data/DataProvider.js +125 -56
  94. package/dist/esm/embeddable/data-paragraph/index.js +168 -0
  95. package/dist/esm/embeddable/download/dom-to-image.js +163 -148
  96. package/dist/esm/embeddable/download/index.js +102 -76
  97. package/dist/esm/embeddable/filter/index.js +335 -298
  98. package/dist/esm/embeddable/grouped-bars/GroupedBars.js +549 -0
  99. package/dist/esm/embeddable/grouped-bars/index.js +16 -0
  100. package/dist/esm/embeddable/index.js +33 -30
  101. package/dist/esm/embeddable/reducers/data-api.js +44 -35
  102. package/dist/esm/embeddable/reducers/data.js +141 -182
  103. package/dist/esm/embeddable/utils/common.js +3 -3
  104. package/dist/esm/index.js +111 -94
  105. package/dist/esm/layout/Customizer.js +10 -9
  106. package/dist/esm/layout/PreviewComponent.js +23 -26
  107. package/dist/esm/layout/containers/SlugPostContainer.js +9 -8
  108. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +11 -0
  109. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +16 -0
  110. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js +14 -0
  111. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +11 -0
  112. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +21 -0
  113. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +13 -0
  114. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +11 -0
  115. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js +15 -0
  116. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js +60 -0
  117. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +13 -0
  118. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +12 -0
  119. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +15 -0
  120. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js +13 -0
  121. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js +28 -0
  122. package/dist/esm/styles.css +1 -1
  123. package/dist/types/api/commons.d.ts +4 -1
  124. package/dist/types/embeddable/big-filter/BigNumberGroup.d.ts +3 -0
  125. package/dist/types/embeddable/big-filter/BigNumberItem.d.ts +2 -0
  126. package/dist/types/embeddable/big-filter/DataProvider.d.ts +7 -0
  127. package/dist/types/embeddable/big-filter/index.d.ts +5 -0
  128. package/dist/types/embeddable/big-number-trend/Alternative.d.ts +5 -0
  129. package/dist/types/embeddable/big-number-trend/Classic.d.ts +5 -0
  130. package/dist/types/embeddable/big-number-trend/index.d.ts +2 -4
  131. package/dist/types/embeddable/chart/Bar.d.ts +3 -0
  132. package/dist/types/embeddable/chart/Line.d.ts +6 -0
  133. package/dist/types/embeddable/d3Map/GradientColors.d.ts +6 -2
  134. package/dist/types/embeddable/d3Map/Layer.d.ts +1 -1
  135. package/dist/types/embeddable/d3Map/Utils.d.ts +1 -1
  136. package/dist/types/embeddable/data/D3MapDataProvider.d.ts +7 -0
  137. package/dist/types/embeddable/data/index.d.ts +6 -0
  138. package/dist/types/embeddable/data-paragraph/index.d.ts +5 -0
  139. package/dist/types/embeddable/filter/index.d.ts +13 -1
  140. package/dist/types/embeddable/grouped-bars/GroupedBars.d.ts +5 -0
  141. package/dist/types/embeddable/grouped-bars/index.d.ts +3 -0
  142. package/dist/types/embeddable/reducers/data-api.d.ts +5 -0
  143. package/dist/types/embeddable/reducers/data.d.ts +16 -9
  144. package/dist/types/embeddable/utils/index.d.ts +1 -0
  145. package/dist/types/embeddable/utils/parseUtils.d.ts +0 -6
  146. package/dist/types/index.d.ts +6 -0
  147. package/dist/types/layout/Customizer.d.ts +1 -0
  148. package/dist/types/layout/containers/PageContainer.d.ts +8 -0
  149. package/dist/types/layout/containers/PostContainer.d.ts +0 -0
  150. package/dist/types/layout/index.d.ts +1 -0
  151. package/dist/types/utils/Logger.d.ts +1 -0
  152. package/package.json +4 -3
  153. /package/dist/types/embeddable/data/{DataConsumerMap.d.ts → D3MapDataConsumer.d.ts} +0 -0
@@ -0,0 +1,83 @@
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import T from "react";
3
+ import { connect as D } from "react-redux";
4
+ import { injectIntl as F } from "react-intl";
5
+ import { DataContext as I } from "./DataContext.js";
6
+ import { getData as C, setData as y } from "../reducers/data.js";
7
+ import "semantic-ui-react";
8
+ class S extends T.Component {
9
+ constructor() {
10
+ super(), this.state = {
11
+ showLoading: !1
12
+ }, this.checkLoadingTime = this.checkLoadingTime.bind(this), this.loadingTimeout = null, this.fallbackTimeout = null, this.initialFilterTimeout = null;
13
+ }
14
+ componentDidMount() {
15
+ const { app: t, csv: i, store: a, params: e, source: l, group: n, editing: s, waitForFilters: r = !1 } = this.props;
16
+ console.log("Group & Store ", a, this.props.mySelf), t === "csv" ? this.props.onSetData({ app: t, csv: i, store: a, params: e, group: n }) : (this.setState({ showLoading: !1 }), (!r || s) && (console.log("📥 [D3 Map DataProvider] Initial data load triggered", { app: t, editing: s, waitForFilters: r }), this.loadData({ app: t, source: l, store: a, params: e, group: n })), !s && r && (this.fallbackTimeout = setTimeout(() => {
17
+ !this.props.data && !this.props.loading && (console.warn("⚠️ [D3 Map DataProvider] Fallback loading triggered"), this.loadData({ app: t, source: l, store: a, params: e, group: n }));
18
+ }, 2e3)));
19
+ }
20
+ componentWillUnmount() {
21
+ clearTimeout(this.fallbackTimeout), clearTimeout(this.loadingTimeout), clearTimeout(this.initialFilterTimeout);
22
+ }
23
+ componentDidUpdate(t) {
24
+ const {
25
+ app: i,
26
+ filters: a,
27
+ apply: e,
28
+ source: l,
29
+ store: n,
30
+ params: s,
31
+ csv: r,
32
+ group: d,
33
+ autoApply: g,
34
+ lastInitialFilterChange: c,
35
+ lastUserFilterChange: h,
36
+ waitForFilters: p
37
+ } = this.props;
38
+ if (e != null && e !== t.apply) {
39
+ console.log("🔄 [DataProvider] Manual reload (apply button)"), this.loadData({ app: i, source: l, store: n, params: s, group: d });
40
+ return;
41
+ }
42
+ if (g !== !1 && (a !== t.filters || JSON.stringify(s) !== JSON.stringify(t.params) || i !== t.app || JSON.stringify(t.source) !== JSON.stringify(l) || r !== t.csv))
43
+ if (i === "csv")
44
+ this.props.onSetData({ app: i, csv: r, store: n, params: s, group: d });
45
+ else {
46
+ const m = c !== t.lastInitialFilterChange, u = h !== t.lastUserFilterChange;
47
+ m && p ? (console.log("ℹ️ [DataProvider] Initial filters changing, debouncing..."), this.initialFilterTimeout && clearTimeout(this.initialFilterTimeout), this.initialFilterTimeout = setTimeout(() => {
48
+ console.log("✅ [DataProvider] Initial filters settled, loading data"), this.loadData({ app: i, source: l, store: n, params: s, group: d });
49
+ }, 500)) : u && (console.log("ℹ️ [DataProvider] User filters changed, loading data"), this.loadData({ app: i, source: l, store: n, params: s, group: d }));
50
+ }
51
+ }
52
+ loadData(t) {
53
+ console.log("Loading data for map", t), this.setState({ showLoading: !1 }), this.props.onLoadData(t), this.loadingTimeout && clearTimeout(this.loadingTimeout), this.loadingTimeout = setTimeout(this.checkLoadingTime, 200);
54
+ }
55
+ checkLoadingTime() {
56
+ const { loading: t, time: i } = this.props;
57
+ t && i && (Date.now() - i > 1e3 ? this.setState({ showLoading: !0 }) : this.loadingTimeout = setTimeout(this.checkLoadingTime, 200));
58
+ }
59
+ render() {
60
+ const { data: t } = this.props;
61
+ return /* @__PURE__ */ f(I.Provider, { value: t, children: this.props.children });
62
+ }
63
+ }
64
+ const L = (o, t) => {
65
+ const { store: i, group: a, app: e } = t;
66
+ return {
67
+ lastUserFilterChange: o.getIn(["data", "filters-settings", e, a, "lastUserFilterChange"]),
68
+ lastInitialFilterChange: o.getIn(["data", "filters-settings", e, a, "lastInitialFilterChange"]),
69
+ data: o.getIn(["data", ...i, "data"]),
70
+ filters: o.getIn(["data", "filters", e, a]),
71
+ autoApply: o.getIn(["data", "filters-settings", e, a, "autoApply"]),
72
+ apply: o.getIn(["data", "filters-settings", e, a, "apply"]),
73
+ error: o.getIn(["data", ...i, "error"]),
74
+ loading: o.getIn(["data", ...i, "loading"]),
75
+ time: o.getIn(["data", ...i, "time"])
76
+ };
77
+ }, k = {
78
+ onSetData: y,
79
+ onLoadData: C
80
+ }, M = D(L, k)(F(S));
81
+ export {
82
+ M as default
83
+ };
@@ -1,8 +1,8 @@
1
1
  import t from "react";
2
- const o = t.createContext(), a = t.createContext();
3
- t.createContext();
2
+ const o = t.createContext(), a = t.createContext(), n = t.createContext();
4
3
  export {
5
4
  a as CategoriesContext,
6
5
  o as DataContext,
6
+ n as PostsContext,
7
7
  o as default
8
8
  };
@@ -1,91 +1,160 @@
1
- import { jsx as s, jsxs as u } from "react/jsx-runtime";
2
- import k from "react";
3
- import { connect as w } from "react-redux";
4
- import { injectIntl as C } from "react-intl";
5
- import { DataContext as I } from "./DataContext.js";
6
- import { getData as F, setData as v } from "../reducers/data.js";
7
- import { Container as p, Segment as m, Dimmer as x, Loader as A } from "semantic-ui-react";
8
- class O extends k.Component {
1
+ import { jsx as d, jsxs as L } from "react/jsx-runtime";
2
+ import w from "react";
3
+ import { connect as I } from "react-redux";
4
+ import { injectIntl as k } from "react-intl";
5
+ import { DataContext as F } from "./DataContext.js";
6
+ import { getData as O, setData as v } from "../reducers/data.js";
7
+ import { Container as m, Segment as p, Dimmer as C, Loader as N } from "semantic-ui-react";
8
+ import A from "../../_virtual/debounce.js";
9
+ class J extends w.Component {
9
10
  constructor() {
10
11
  super(), this.state = {
11
12
  showLoading: !1
12
- }, this.checkLoadingTime = this.checkLoadingTime.bind(this);
13
+ }, this.checkLoadingTime = this.checkLoadingTime.bind(this), this.debounces = [];
14
+ }
15
+ debouncedLoadData(t, i) {
16
+ const a = A((e) => {
17
+ console.log(`🔄 [DataProvider] Debounced load triggered (${t}ms delay)`, {
18
+ args: e,
19
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
20
+ }), this.setState({ showLoading: !1 }), this.props.onLoadData(e), this.dataLoaded = !0, this.checkLoadingTime = this.checkLoadingTime.bind(this), setTimeout(this.checkLoadingTime, 0);
21
+ }, t);
22
+ this.debounces.push(a(i));
13
23
  }
14
24
  componentDidMount() {
15
- const { app: e, source: i, store: a, params: t, csv: n, group: d, editing: o, waitForFilters: r = !1 } = this.props;
16
- e === "csv" ? this.props.onSetData({ app: e, csv: n, store: a, params: t, group: d }) : (this.setState({ showLoading: !1 }), !r || o ? (console.log("loading -----"), this.props.onLoadData({ app: e, source: i, store: a, params: t, group: d }), setTimeout(this.checkLoadingTime, 100)) : console.log("waiting for filters to be set before loading data", e, i, a, t, d)), !o && r && (this.fallbackTimeout = setTimeout(() => {
17
- this.dataLoaded || (console.warn("Fallback loading triggered"), this.setState({ showLoading: !1 }), this.props.onLoadData({ app: e, source: i, store: a, params: t, group: d }), setTimeout(this.checkLoadingTime, 100));
25
+ const { app: t, source: i, store: a, params: e, csv: h, group: s, editing: o, waitForFilters: n = !1 } = this.props;
26
+ t === "csv" ? this.props.onSetData({ app: t, csv: h, store: a, params: e, group: s }) : (this.setState({ showLoading: !1 }), !n || o ? (console.log("📥 [DataProvider] Initial data load triggered", {
27
+ app: t,
28
+ source: i,
29
+ store: a,
30
+ params: e,
31
+ group: s,
32
+ waitForFilters: n,
33
+ editing: o,
34
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
35
+ }), this.props.onLoadData({ app: t, source: i, store: a, params: e, group: s }), setTimeout(this.checkLoadingTime, 100)) : console.log("⏳ [DataProvider] Waiting for filters before loading data", {
36
+ app: t,
37
+ source: i,
38
+ store: a,
39
+ params: e,
40
+ group: s,
41
+ waitForFilters: n,
42
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
43
+ })), !o && n && (this.fallbackTimeout = setTimeout(() => {
44
+ this.dataLoaded || (console.warn("⚠️ [DataProvider] Fallback loading triggered - filters took too long", {
45
+ app: t,
46
+ source: i,
47
+ store: a,
48
+ params: e,
49
+ group: s,
50
+ dataLoaded: this.dataLoaded,
51
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
52
+ }), this.setState({ showLoading: !1 }), this.props.onLoadData({ app: t, source: i, store: a, params: e, group: s }), setTimeout(this.checkLoadingTime, 100));
18
53
  }, 1e3));
19
54
  }
20
55
  componentWillUnmount() {
21
- clearTimeout(this.fallbackTimeout), clearTimeout(this.debounceTimeout);
56
+ clearTimeout(this.fallbackTimeout), clearTimeout(this.debounceTimeout), this.debounces.forEach((t) => t ? t.cancel() : null);
22
57
  }
23
- componentDidUpdate(e, i, a) {
58
+ componentDidUpdate(t, i, a) {
24
59
  const {
25
- app: t,
26
- filters: n,
27
- apply: d,
60
+ app: e,
61
+ filters: h,
62
+ apply: s,
28
63
  source: o,
29
- store: r,
30
- params: c,
64
+ store: n,
65
+ params: r,
31
66
  csv: g,
32
- group: h,
33
- autoApply: L,
34
- editing: T,
67
+ group: l,
68
+ autoApply: T,
69
+ editing: u,
35
70
  lastInitialFilterChange: b,
36
- lastUserFilterChange: S
37
- } = this.props, y = b !== e.lastInitialFilterChange, D = S !== e.lastUserFilterChange;
38
- let f = !1;
39
- d != null && d != e.apply && (f = !0), L !== !1 ? (n != e.filters || JSON.stringify(c) != JSON.stringify(e.params) || t != e.app || JSON.stringify(e.source) != JSON.stringify(o) || g != e.csv) && (t === "csv" ? this.props.onSetData({ app: t, csv: g, store: r, params: c, group: h }) : (this.setState({ showLoading: !0 }), T && this.props.onLoadData({ app: t, source: o, store: r, params: c, group: h }), y && this.props.waitForFilters ? (console.log("initial filters has been updated", n, c), clearTimeout(this.debounceTimeout), clearTimeout(this.fallbackTimeout), this.debounceTimeout = setTimeout(() => {
40
- this.dataLoaded = !0, this.setState({ showLoading: !1 }), console.log("Loading data " + t + " " + o), this.props.onLoadData({ app: t, source: o, store: r, params: c, group: h }), setTimeout(this.checkLoadingTime, 100);
41
- }, 100)) : D ? (console.log("filters has been updated", n, e.filters, c, e.params, t, o, r, h), this.setState({ showLoading: !1 }), console.log("filters has been updated", n), this.props.onLoadData({ app: t, source: o, store: r, params: c, group: h }), setTimeout(this.checkLoadingTime, 100)) : console.log("no changes detected ............"))) : f && (console.log("reloading -----"), this.props.onLoadData({ app: t, source: o, store: r, params: c, group: h }), this.setState({ showLoading: !1 }), setTimeout(this.checkLoadingTime, 100));
71
+ lastUserFilterChange: y
72
+ } = this.props, f = b !== t.lastInitialFilterChange, S = y !== t.lastUserFilterChange;
73
+ let D = !1;
74
+ s != null && s != t.apply && (D = !0), T !== !1 ? (h != t.filters || JSON.stringify(r) != JSON.stringify(t.params) || e != t.app || JSON.stringify(t.source) != JSON.stringify(o) || g != t.csv) && (e === "csv" ? this.props.onSetData({ app: e, csv: g, store: n, params: r, group: l }) : (this.setState({ showLoading: !0 }), u && this.props.onLoadData({ app: e, source: o, store: n, params: r, group: l }), f && this.props.waitForFilters ? (clearTimeout(this.debounceTimeout), clearTimeout(this.fallbackTimeout), this.debounceTimeout = setTimeout(() => {
75
+ this.dataLoaded = !0, this.setState({ showLoading: !1 }), console.log("🔄 [DataProvider] Loading data after initial filter setup", {
76
+ app: e,
77
+ source: o,
78
+ store: n,
79
+ params: r,
80
+ group: l,
81
+ filters: h,
82
+ debounceDelay: "100ms",
83
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
84
+ }), this.props.onLoadData({ app: e, source: o, store: n, params: r, group: l }), setTimeout(this.checkLoadingTime, 100);
85
+ }, 100)) : S ? (console.log("🔧 [DataProvider] User filter change detected", {
86
+ currentFilters: h,
87
+ previousFilters: t.filters,
88
+ currentParams: r,
89
+ previousParams: t.params,
90
+ app: e,
91
+ source: o,
92
+ store: n,
93
+ group: l,
94
+ debounceDelay: "400ms",
95
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
96
+ }), this.setState({ showLoading: !1 }), this.debouncedLoadData(400, { app: e, source: o, store: n, params: r, group: l }), setTimeout(this.checkLoadingTime, 100)) : !u && (JSON.stringify(r) !== JSON.stringify(t.params) || e !== t.app || JSON.stringify(o) !== JSON.stringify(t.source)) ? (this.setState({ showLoading: !1 }), this.props.onLoadData({ app: e, source: o, store: n, params: r, group: l }), setTimeout(this.checkLoadingTime, 100)) : console.log("ℹ️ [DataProvider] Component updated but no filter changes detected", {
97
+ initialChanged: f,
98
+ userChanged: S,
99
+ waitForFilters: this.props.waitForFilters,
100
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
101
+ }))) : D && (console.log("🔄 [DataProvider] Manual reload triggered (apply button)", {
102
+ app: e,
103
+ source: o,
104
+ store: n,
105
+ params: r,
106
+ group: l,
107
+ apply: s,
108
+ previousApply: t.apply,
109
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
110
+ }), this.props.onLoadData({ app: e, source: o, store: n, params: r, group: l }), this.setState({ showLoading: !1 }), setTimeout(this.checkLoadingTime, 100));
42
111
  }
43
112
  checkLoadingTime() {
44
- const { data: e, loading: i, time: a, error: t } = this.props, n = Date.now() - a;
45
- i && a && n > 1e3 ? this.setState({ showLoading: !0 }) : i && setTimeout(this.checkLoadingTime, 100);
113
+ const { data: t, loading: i, time: a, error: e, verbose: h = !0 } = this.props, s = Date.now() - a;
114
+ i && a && s > 1e3 ? this.setState({ showLoading: !0 }) : i && setTimeout(this.checkLoadingTime, 100);
46
115
  }
47
116
  render() {
48
- const { data: e, style: i, loading: a, time: t, error: n, editing: d, isSvg: o } = this.props;
49
- if (a && this.state.showLoading && !d) {
117
+ const { data: t, style: i, loading: a, time: e, error: h, editing: s, isSvg: o, verbose: n = !0 } = this.props;
118
+ if (a && this.state.showLoading && !s) {
50
119
  const r = {
51
120
  width: "100%",
52
121
  height: "100%",
53
122
  background: "transparent",
54
123
  verticalAlign: "middle",
55
124
  overflow: "hidden"
56
- }, c = Object.assign({}, i, {
125
+ }, g = Object.assign({}, i, {
57
126
  height: "90%",
58
127
  background: "transparent",
59
128
  textAlign: "center",
60
129
  margin: "30px"
61
- }), g = /* @__PURE__ */ s(m, { basic: !0, padded: !0, style: c, children: /* @__PURE__ */ s(x, { active: !0, inverted: !0, style: { background: "transparent" }, children: /* @__PURE__ */ s(A, { size: "medium", style: { background: "transparent" } }) }) });
62
- return o ? /* @__PURE__ */ s("foreignObject", { style: r, children: /* @__PURE__ */ s(p, { style: i, className: "loading", children: g }) }) : /* @__PURE__ */ s(p, { style: i, className: "loading", children: g });
63
- } else return n ? n ? /* @__PURE__ */ u(m, { color: "red", children: [
64
- /* @__PURE__ */ s("h1", { children: "500" }),
65
- /* @__PURE__ */ s("p", { children: "Wasn't able to load data" })
66
- ] }) : /* @__PURE__ */ s(p, { children: /* @__PURE__ */ u(m, { color: "red", children: [
67
- /* @__PURE__ */ s("h1", { children: "404" }),
68
- /* @__PURE__ */ s("p", { children: "Can't find this page" })
69
- ] }) }) : /* @__PURE__ */ s(I.Provider, { value: e, children: this.props.children });
130
+ }), l = /* @__PURE__ */ d(p, { basic: !0, padded: !0, style: g, children: /* @__PURE__ */ d(C, { active: !0, inverted: !0, style: { background: "transparent" }, children: /* @__PURE__ */ d(N, { size: "medium", style: { background: "transparent" } }) }) });
131
+ return o ? /* @__PURE__ */ d("foreignObject", { style: r, children: /* @__PURE__ */ d(m, { style: i, className: "loading", children: l }) }) : /* @__PURE__ */ d(m, { style: i, className: "loading", children: l });
132
+ } else return h ? h ? /* @__PURE__ */ L(p, { color: "red", children: [
133
+ /* @__PURE__ */ d("h1", { children: "500" }),
134
+ /* @__PURE__ */ d("p", { children: "Wasn't able to load data" })
135
+ ] }) : /* @__PURE__ */ d(m, { children: /* @__PURE__ */ L(p, { color: "red", children: [
136
+ /* @__PURE__ */ d("h1", { children: "404" }),
137
+ /* @__PURE__ */ d("p", { children: "Can't find this page" })
138
+ ] }) }) : /* @__PURE__ */ d(F.Provider, { value: t, children: this.props.children });
70
139
  }
71
140
  }
72
- const j = (l, e) => {
73
- const { store: i, group: a, app: t } = e;
141
+ const x = (c, t) => {
142
+ const { store: i, group: a, app: e } = t;
74
143
  return {
75
- lastUserFilterChange: l.getIn(["data", "filters-settings", t, a, "lastUserFilterChange"]),
76
- lastInitialFilterChange: l.getIn(["data", "filters-settings", t, a, "lastInitialFilterChange"]),
77
- data: l.getIn(["data", ...i, "data"]),
78
- filters: l.getIn(["data", "filters", t, a]),
79
- autoApply: l.getIn(["data", "filters-settings", t, a, "autoApply"]),
80
- apply: l.getIn(["data", "filters-settings", t, a, "apply"]),
81
- error: l.getIn(["data", ...i, "error"]),
82
- loading: l.getIn(["data", ...i, "loading"]),
83
- time: l.getIn(["data", ...i, "time"])
144
+ lastUserFilterChange: c.getIn(["data", "filters-settings", e, a, "lastUserFilterChange"]),
145
+ lastInitialFilterChange: c.getIn(["data", "filters-settings", e, a, "lastInitialFilterChange"]),
146
+ data: c.getIn(["data", ...i, "data"]),
147
+ filters: c.getIn(["data", "filters", e, a]),
148
+ autoApply: c.getIn(["data", "filters-settings", e, a, "autoApply"]),
149
+ apply: c.getIn(["data", "filters-settings", e, a, "apply"]),
150
+ error: c.getIn(["data", ...i, "error"]),
151
+ loading: c.getIn(["data", ...i, "loading"]),
152
+ time: c.getIn(["data", ...i, "time"])
84
153
  };
85
- }, N = {
154
+ }, U = {
86
155
  onSetData: v,
87
- onLoadData: F
88
- }, q = w(j, N)(C(O));
156
+ onLoadData: O
157
+ }, q = I(x, U)(k(J));
89
158
  export {
90
159
  q as default
91
160
  };
@@ -0,0 +1,168 @@
1
+ import { jsx as S } from "react/jsx-runtime";
2
+ import { useRef as _, useState as P, useEffect as R } from "react";
3
+ import L from "../data/DataProvider.js";
4
+ import E from "../data/DataConsumer.js";
5
+ import { connect as O } from "react-redux";
6
+ import { formatContent as Z } from "../chart/Tooltip.js";
7
+ const $ = (l) => {
8
+ const {
9
+ editing: m = !1,
10
+ unique: p,
11
+ intl: r,
12
+ childContent: s,
13
+ "data-csv": h = "",
14
+ "data-dvz-proxy-dataset-id": f,
15
+ "data-view-mode": H = "info",
16
+ "data-app": b,
17
+ "data-measures": x = "{}",
18
+ "data-format": w = "{}",
19
+ "data-group": u,
20
+ "data-filters": y = "[]",
21
+ "data-number-font-size": n = 20,
22
+ "data-number-color": j = "#000000",
23
+ "data-wait-for-filters": T = "false",
24
+ "data-no-data-text": M = "-",
25
+ "data-text-template": z = ""
26
+ } = l, V = r.locale, A = _(null);
27
+ let v = !1, F = "";
28
+ try {
29
+ const t = new URLSearchParams(window.location.search);
30
+ v = t.get("autoHeight") === "1" || t.get("autoHeight") === "true", F = t.get("frameId") || "";
31
+ } catch {
32
+ }
33
+ const g = (t) => m ? t : decodeURIComponent(t), o = (t) => {
34
+ try {
35
+ return JSON.parse(g(t));
36
+ } catch {
37
+ console.error("error parsing value:" + t);
38
+ }
39
+ return null;
40
+ }, d = o(w), i = d ? {
41
+ style: d.style === "compacted" ? "decimal" : d.style,
42
+ notation: d.style === "compacted" ? "compact" : "standard",
43
+ currency: d.currency,
44
+ minimumFractionDigits: parseInt(d.minimumFractionDigits),
45
+ maximumFractionDigits: parseInt(d.maximumFractionDigits)
46
+ } : {
47
+ notation: "standard",
48
+ currency: "USD",
49
+ minimumFractionDigits: 2,
50
+ maximumFractionDigits: 2
51
+ }, [C, N] = P(H), D = Math.max(24, (n || 14) * 1.2), I = {}, c = o(y) || {};
52
+ c && c.forEach && c.forEach((t) => {
53
+ t.value != null && t.value.filter((e) => e != null && e.toString().trim() != "").length > 0 && (I[t.param] = t.value);
54
+ }), f && (I.dvzProxyDatasetId = f);
55
+ const a = [];
56
+ return q(A, v, F), /* @__PURE__ */ S("span", { ref: A, children: /* @__PURE__ */ S(
57
+ L,
58
+ {
59
+ style: { minHeight: `${D}px` },
60
+ params: I,
61
+ app: b,
62
+ group: u,
63
+ csv: h,
64
+ editing: m,
65
+ waitForFilters: T === "true",
66
+ store: [b, p, ...a],
67
+ source: a.join("/"),
68
+ children: /* @__PURE__ */ S(E, { children: /* @__PURE__ */ S(
69
+ k,
70
+ {
71
+ locale: V,
72
+ intl: r,
73
+ app: b,
74
+ format: i,
75
+ measure: o(x)[0] || null,
76
+ numberFontSize: n,
77
+ numberColor: j,
78
+ noDataText: M,
79
+ textTemplate: z
80
+ }
81
+ ) })
82
+ }
83
+ ) });
84
+ }, k = (l) => {
85
+ var v, F;
86
+ const {
87
+ app: m,
88
+ measure: p,
89
+ data: r,
90
+ format: s,
91
+ numberColor: h,
92
+ numberFontSize: f,
93
+ noDataText: H = "-",
94
+ textTemplate: b = "",
95
+ intl: x
96
+ } = l;
97
+ let w = p, u = r;
98
+ m === "csv" && ((v = r == null ? void 0 : r.meta) != null && v.fields) && ((F = r == null ? void 0 : r.data) != null && F.length) && (w = r.meta.fields[0], u = r.data[0]);
99
+ const y = (u == null ? void 0 : u[w]) ?? null, n = y ? (s == null ? void 0 : s.style) === "percent" ? y / 100 : y : null, [j, T] = P(n);
100
+ R(() => {
101
+ n != null && T(n);
102
+ }, [n]);
103
+ const M = {
104
+ color: decodeURIComponent(h),
105
+ fontSize: f + "px",
106
+ textAlign: "center",
107
+ whiteSpace: "normal",
108
+ wordBreak: "break-word"
109
+ }, z = (g) => x.formatNumber(g, { ...s }), V = (g) => {
110
+ if (!g) return "";
111
+ let o = String(g);
112
+ return o = o.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ""), o = o.replace(/\son\w+=(?:"[^"]*"|'[^']*')/gi, ""), o;
113
+ };
114
+ return /* @__PURE__ */ S("span", { style: M, dangerouslySetInnerHTML: { __html: (() => {
115
+ const o = {
116
+ ...u && typeof u == "object" ? u : {},
117
+ measure: w || "",
118
+ rawValue: y,
119
+ value: n,
120
+ formattedValue: n != null ? z(n) : H
121
+ }, d = n !== null ? z(n) : null;
122
+ let i = decodeURIComponent(b) || "";
123
+ i = i.replace(/(\%|\#C|\#)\(\s*([^)]*?)\s*\)/g, (c, a, t) => {
124
+ const e = t.replace(/\s+/g, "");
125
+ return `${a}(${e})`;
126
+ });
127
+ const C = (c, a, t) => x.formatNumber(c, { maximumFractionDigits: a ?? 2, ...t }), N = (c) => {
128
+ const a = o[c];
129
+ return typeof a == "string" ? Number(a) : a;
130
+ };
131
+ i = i.replace(/#C\(\{([a-zA-Z0-9_]+)\}(?:,([0-9]+))?\)/g, (c, a, t) => {
132
+ const e = N(a);
133
+ return e == null || isNaN(e) ? "" : C(e, t ? parseInt(t) : 2, { notation: "compact" });
134
+ }), i = i.replace(/#\(\{([a-zA-Z0-9_]+)\}(?:,([0-9]+))?\)/g, (c, a, t) => {
135
+ const e = N(a);
136
+ return e == null || isNaN(e) ? "" : C(e, t ? parseInt(t) : 2, { style: "decimal" });
137
+ }), i = i.replace(/%\(\{([a-zA-Z0-9_]+)\}(?:,([0-9]+))?\)/g, (c, a, t) => {
138
+ const e = N(a);
139
+ if (e == null || isNaN(e)) return "";
140
+ const U = e / 100;
141
+ return C(U, t ? parseInt(t) : 2, { style: "percent" });
142
+ });
143
+ const D = Z(i, o, x, !1), I = D && D.trim().length ? D : d ?? H;
144
+ return V(I);
145
+ })() } });
146
+ }, q = (l, m, p) => {
147
+ R(() => {
148
+ if (!m) return;
149
+ const r = l.current || document.body, s = () => {
150
+ try {
151
+ const f = (l.current ? l.current.scrollHeight : document.body.scrollHeight) || 0;
152
+ window.parent && f && window.parent.postMessage({ type: "dvz-embed-height", id: p, height: f }, "*");
153
+ } catch {
154
+ }
155
+ }, h = new MutationObserver(() => {
156
+ requestAnimationFrame(s);
157
+ });
158
+ return h.observe(r, { childList: !0, subtree: !0, characterData: !0 }), setTimeout(s, 0), () => h.disconnect();
159
+ }, [l, m, p]);
160
+ }, B = (l, m) => {
161
+ const { "data-app": p, "data-group": r } = m, s = l.getIn(["data", "measures", p, r]);
162
+ return s ? {
163
+ injectedMeasures: s
164
+ } : {};
165
+ }, J = {}, tt = O(B, J)($);
166
+ export {
167
+ tt as default
168
+ };