@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.
- package/dist/cjs/_virtual/_commonjsHelpers.js +1 -0
- package/dist/cjs/_virtual/debounce.js +1 -0
- package/dist/cjs/api/commons.js +1 -1
- package/dist/cjs/embeddable/big-filter/BigNumberGroup.js +1 -0
- package/dist/cjs/embeddable/big-filter/BigNumberItem.js +1 -0
- package/dist/cjs/embeddable/big-filter/DataProvider.js +1 -0
- package/dist/cjs/embeddable/big-filter/index.js +1 -0
- package/dist/cjs/embeddable/big-number/index.js +1 -1
- package/dist/cjs/embeddable/big-number-trend/Alternative.js +1 -0
- package/dist/cjs/embeddable/big-number-trend/Classic.js +1 -0
- package/dist/cjs/embeddable/big-number-trend/index.js +1 -1
- package/dist/cjs/embeddable/chart/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/Line.js +1 -1
- package/dist/cjs/embeddable/chart/data/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/index.js +1 -1
- package/dist/cjs/embeddable/d3Map/BaseLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/BreaksStyles.js +1 -1
- package/dist/cjs/embeddable/d3Map/DataLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/FlowLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/GradientColors.js +1 -1
- package/dist/cjs/embeddable/d3Map/LatLongLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/Layer.js +1 -1
- package/dist/cjs/embeddable/d3Map/Legends.js +1 -1
- package/dist/cjs/embeddable/d3Map/ProjectedContainer.js +1 -1
- package/dist/cjs/embeddable/d3Map/Utils.js +1 -1
- package/dist/cjs/embeddable/d3Map/ZoomControl.js +1 -1
- package/dist/cjs/embeddable/d3Map/index.js +1 -1
- package/dist/cjs/embeddable/data/CategoriesProvider.js +1 -1
- package/dist/cjs/embeddable/data/D3MapDataConsumer.js +1 -0
- package/dist/cjs/embeddable/data/D3MapDataProvider.js +1 -0
- package/dist/cjs/embeddable/data/DataContext.js +1 -1
- package/dist/cjs/embeddable/data/DataProvider.js +1 -1
- package/dist/cjs/embeddable/data-paragraph/index.js +1 -0
- package/dist/cjs/embeddable/download/dom-to-image.js +2 -2
- package/dist/cjs/embeddable/download/index.js +5 -5
- package/dist/cjs/embeddable/filter/index.js +1 -1
- package/dist/cjs/embeddable/grouped-bars/GroupedBars.js +1 -0
- package/dist/cjs/embeddable/grouped-bars/index.js +1 -0
- package/dist/cjs/embeddable/index.js +1 -1
- package/dist/cjs/embeddable/reducers/data-api.js +1 -1
- package/dist/cjs/embeddable/reducers/data.js +1 -1
- package/dist/cjs/embeddable/utils/common.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/layout/Customizer.js +1 -1
- package/dist/cjs/layout/PreviewComponent.js +1 -1
- package/dist/cjs/layout/containers/SlugPostContainer.js +1 -1
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js +1 -0
- package/dist/cjs/styles.css +1 -1
- package/dist/esm/_virtual/_commonjsHelpers.js +8 -0
- package/dist/esm/_virtual/debounce.js +7 -0
- package/dist/esm/api/commons.js +26 -17
- package/dist/esm/embeddable/big-filter/BigNumberGroup.js +129 -0
- package/dist/esm/embeddable/big-filter/BigNumberItem.js +107 -0
- package/dist/esm/embeddable/big-filter/DataProvider.js +53 -0
- package/dist/esm/embeddable/big-filter/index.js +130 -0
- package/dist/esm/embeddable/big-number/index.js +154 -102
- package/dist/esm/embeddable/big-number-trend/Alternative.js +227 -0
- package/dist/esm/embeddable/big-number-trend/Classic.js +190 -0
- package/dist/esm/embeddable/big-number-trend/index.js +12 -147
- package/dist/esm/embeddable/chart/Bar.js +450 -395
- package/dist/esm/embeddable/chart/Line.js +216 -184
- package/dist/esm/embeddable/chart/data/Bar.js +16 -18
- package/dist/esm/embeddable/chart/index.js +168 -162
- package/dist/esm/embeddable/d3Map/BaseLayer.js +25 -28
- package/dist/esm/embeddable/d3Map/BreaksStyles.js +17 -10
- package/dist/esm/embeddable/d3Map/DataLayer.js +290 -289
- package/dist/esm/embeddable/d3Map/FlowLayer.js +122 -136
- package/dist/esm/embeddable/d3Map/GradientColors.js +27 -20
- package/dist/esm/embeddable/d3Map/LatLongLayer.js +62 -62
- package/dist/esm/embeddable/d3Map/Layer.js +31 -27
- package/dist/esm/embeddable/d3Map/Legends.js +204 -190
- package/dist/esm/embeddable/d3Map/ProjectedContainer.js +1 -3
- package/dist/esm/embeddable/d3Map/Utils.js +12 -8
- package/dist/esm/embeddable/d3Map/ZoomControl.js +41 -41
- package/dist/esm/embeddable/d3Map/index.js +135 -117
- package/dist/esm/embeddable/data/CategoriesProvider.js +39 -26
- package/dist/esm/embeddable/data/D3MapDataConsumer.js +7 -0
- package/dist/esm/embeddable/data/D3MapDataProvider.js +83 -0
- package/dist/esm/embeddable/data/DataContext.js +2 -2
- package/dist/esm/embeddable/data/DataProvider.js +125 -56
- package/dist/esm/embeddable/data-paragraph/index.js +168 -0
- package/dist/esm/embeddable/download/dom-to-image.js +163 -148
- package/dist/esm/embeddable/download/index.js +102 -76
- package/dist/esm/embeddable/filter/index.js +335 -298
- package/dist/esm/embeddable/grouped-bars/GroupedBars.js +549 -0
- package/dist/esm/embeddable/grouped-bars/index.js +16 -0
- package/dist/esm/embeddable/index.js +33 -30
- package/dist/esm/embeddable/reducers/data-api.js +44 -35
- package/dist/esm/embeddable/reducers/data.js +141 -182
- package/dist/esm/embeddable/utils/common.js +3 -3
- package/dist/esm/index.js +111 -94
- package/dist/esm/layout/Customizer.js +10 -9
- package/dist/esm/layout/PreviewComponent.js +23 -26
- package/dist/esm/layout/containers/SlugPostContainer.js +9 -8
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +16 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +21 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js +60 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js +28 -0
- package/dist/esm/styles.css +1 -1
- package/dist/types/api/commons.d.ts +4 -1
- package/dist/types/embeddable/big-filter/BigNumberGroup.d.ts +3 -0
- package/dist/types/embeddable/big-filter/BigNumberItem.d.ts +2 -0
- package/dist/types/embeddable/big-filter/DataProvider.d.ts +7 -0
- package/dist/types/embeddable/big-filter/index.d.ts +5 -0
- package/dist/types/embeddable/big-number-trend/Alternative.d.ts +5 -0
- package/dist/types/embeddable/big-number-trend/Classic.d.ts +5 -0
- package/dist/types/embeddable/big-number-trend/index.d.ts +2 -4
- package/dist/types/embeddable/chart/Bar.d.ts +3 -0
- package/dist/types/embeddable/chart/Line.d.ts +6 -0
- package/dist/types/embeddable/d3Map/GradientColors.d.ts +6 -2
- package/dist/types/embeddable/d3Map/Layer.d.ts +1 -1
- package/dist/types/embeddable/d3Map/Utils.d.ts +1 -1
- package/dist/types/embeddable/data/D3MapDataProvider.d.ts +7 -0
- package/dist/types/embeddable/data/index.d.ts +6 -0
- package/dist/types/embeddable/data-paragraph/index.d.ts +5 -0
- package/dist/types/embeddable/filter/index.d.ts +13 -1
- package/dist/types/embeddable/grouped-bars/GroupedBars.d.ts +5 -0
- package/dist/types/embeddable/grouped-bars/index.d.ts +3 -0
- package/dist/types/embeddable/reducers/data-api.d.ts +5 -0
- package/dist/types/embeddable/reducers/data.d.ts +16 -9
- package/dist/types/embeddable/utils/index.d.ts +1 -0
- package/dist/types/embeddable/utils/parseUtils.d.ts +0 -6
- package/dist/types/index.d.ts +6 -0
- package/dist/types/layout/Customizer.d.ts +1 -0
- package/dist/types/layout/containers/PageContainer.d.ts +8 -0
- package/dist/types/layout/containers/PostContainer.d.ts +0 -0
- package/dist/types/layout/index.d.ts +1 -0
- package/dist/types/utils/Logger.d.ts +1 -0
- package/package.json +4 -3
- /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
|
|
2
|
-
import
|
|
3
|
-
import { connect as
|
|
4
|
-
import { injectIntl as
|
|
5
|
-
import { DataContext as
|
|
6
|
-
import { getData as
|
|
7
|
-
import { Container as
|
|
8
|
-
|
|
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:
|
|
16
|
-
|
|
17
|
-
|
|
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(
|
|
58
|
+
componentDidUpdate(t, i, a) {
|
|
24
59
|
const {
|
|
25
|
-
app:
|
|
26
|
-
filters:
|
|
27
|
-
apply:
|
|
60
|
+
app: e,
|
|
61
|
+
filters: h,
|
|
62
|
+
apply: s,
|
|
28
63
|
source: o,
|
|
29
|
-
store:
|
|
30
|
-
params:
|
|
64
|
+
store: n,
|
|
65
|
+
params: r,
|
|
31
66
|
csv: g,
|
|
32
|
-
group:
|
|
33
|
-
autoApply:
|
|
34
|
-
editing:
|
|
67
|
+
group: l,
|
|
68
|
+
autoApply: T,
|
|
69
|
+
editing: u,
|
|
35
70
|
lastInitialFilterChange: b,
|
|
36
|
-
lastUserFilterChange:
|
|
37
|
-
} = this.props,
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
this.dataLoaded = !0, this.setState({ showLoading: !1 }), console.log("Loading data
|
|
41
|
-
|
|
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:
|
|
45
|
-
i && a &&
|
|
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:
|
|
49
|
-
if (a && this.state.showLoading && !
|
|
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
|
-
},
|
|
125
|
+
}, g = Object.assign({}, i, {
|
|
57
126
|
height: "90%",
|
|
58
127
|
background: "transparent",
|
|
59
128
|
textAlign: "center",
|
|
60
129
|
margin: "30px"
|
|
61
|
-
}),
|
|
62
|
-
return o ? /* @__PURE__ */
|
|
63
|
-
} else return
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
] }) : /* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
] }) }) : /* @__PURE__ */
|
|
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
|
|
73
|
-
const { store: i, group: a, app:
|
|
141
|
+
const x = (c, t) => {
|
|
142
|
+
const { store: i, group: a, app: e } = t;
|
|
74
143
|
return {
|
|
75
|
-
lastUserFilterChange:
|
|
76
|
-
lastInitialFilterChange:
|
|
77
|
-
data:
|
|
78
|
-
filters:
|
|
79
|
-
autoApply:
|
|
80
|
-
apply:
|
|
81
|
-
error:
|
|
82
|
-
loading:
|
|
83
|
-
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
|
-
},
|
|
154
|
+
}, U = {
|
|
86
155
|
onSetData: v,
|
|
87
|
-
onLoadData:
|
|
88
|
-
}, q =
|
|
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
|
+
};
|