@devgateway/dvz-ui-react 1.8.7 → 1.9.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 (68) hide show
  1. package/dist/cjs/common.css +1 -1
  2. package/dist/cjs/conf/index.js +1 -1
  3. package/dist/cjs/embeddable/big-number-trend/Alternative.js +1 -1
  4. package/dist/cjs/embeddable/big-number-trend/BigNumberTrendContainer.js +1 -0
  5. package/dist/cjs/embeddable/big-number-trend/Classic.js +1 -1
  6. package/dist/cjs/embeddable/big-number-trend/useBigNumberTrendData.js +1 -0
  7. package/dist/cjs/embeddable/chart/Bar.js +1 -1
  8. package/dist/cjs/embeddable/chart/Messages.js +2 -2
  9. package/dist/cjs/embeddable/chart/data/Line.js +1 -1
  10. package/dist/cjs/embeddable/chart/data/Utils.js +1 -1
  11. package/dist/cjs/embeddable/chart/index.js +1 -1
  12. package/dist/cjs/embeddable/d3Map/index.js +1 -1
  13. package/dist/cjs/embeddable/data/CategoriesProvider.js +1 -1
  14. package/dist/cjs/embeddable/data/DataConsumer.js +1 -1
  15. package/dist/cjs/embeddable/data/DataProvider.js +1 -1
  16. package/dist/cjs/embeddable/featuredtabs/index.js +1 -1
  17. package/dist/cjs/embeddable/map/index.js +2 -2
  18. package/dist/cjs/embeddable/reducers/data.js +1 -1
  19. package/dist/cjs/index.js +1 -1
  20. package/dist/cjs/layout/FlexWrapDetector.js +1 -1
  21. package/dist/cjs/styles.css +1 -1
  22. package/dist/cjs/tracker/InternalTrafficToggle.js +1 -1
  23. package/dist/cjs/tracker/InternalTrafficWatermark.js +1 -0
  24. package/dist/cjs/tracker/index.js +1 -1
  25. package/dist/cjs/tracker/internalTrafficUtils.js +1 -1
  26. package/dist/cjs/tracker/useInternalTrafficBypass.js +1 -0
  27. package/dist/esm/common.css +1 -1
  28. package/dist/esm/conf/index.js +1 -2
  29. package/dist/esm/embeddable/big-number-trend/Alternative.js +62 -211
  30. package/dist/esm/embeddable/big-number-trend/BigNumberTrendContainer.js +125 -0
  31. package/dist/esm/embeddable/big-number-trend/Classic.js +51 -181
  32. package/dist/esm/embeddable/big-number-trend/index.js +8 -8
  33. package/dist/esm/embeddable/big-number-trend/useBigNumberTrendData.js +49 -0
  34. package/dist/esm/embeddable/chart/Bar.js +464 -471
  35. package/dist/esm/embeddable/chart/Messages.js +18 -15
  36. package/dist/esm/embeddable/chart/data/Line.js +1 -4
  37. package/dist/esm/embeddable/chart/data/Utils.js +0 -1
  38. package/dist/esm/embeddable/chart/index.js +363 -359
  39. package/dist/esm/embeddable/d3Map/index.js +129 -125
  40. package/dist/esm/embeddable/data/CategoriesProvider.js +31 -38
  41. package/dist/esm/embeddable/data/DataConsumer.js +12 -8
  42. package/dist/esm/embeddable/data/DataProvider.js +62 -124
  43. package/dist/esm/embeddable/featuredtabs/index.js +64 -61
  44. package/dist/esm/embeddable/map/index.js +42 -42
  45. package/dist/esm/embeddable/reducers/data.js +46 -44
  46. package/dist/esm/index.js +71 -67
  47. package/dist/esm/layout/FlexWrapDetector.js +10 -10
  48. package/dist/esm/styles.css +1 -1
  49. package/dist/esm/tracker/InternalTrafficToggle.js +21 -73
  50. package/dist/esm/tracker/InternalTrafficWatermark.js +67 -0
  51. package/dist/esm/tracker/index.js +11 -8
  52. package/dist/esm/tracker/internalTrafficUtils.js +9 -10
  53. package/dist/esm/tracker/useInternalTrafficBypass.js +34 -0
  54. package/dist/types/conf/index.d.ts +0 -1
  55. package/dist/types/embeddable/big-number-trend/Alternative.d.ts +2 -4
  56. package/dist/types/embeddable/big-number-trend/BigNumberTrendContainer.d.ts +5 -0
  57. package/dist/types/embeddable/big-number-trend/Classic.d.ts +2 -4
  58. package/dist/types/embeddable/big-number-trend/useBigNumberTrendData.d.ts +21 -0
  59. package/dist/types/embeddable/chart/Bar.d.ts +1 -2
  60. package/dist/types/embeddable/data/DataConsumer.d.ts +5 -2
  61. package/dist/types/embeddable/data/DataProvider.d.ts +18 -3
  62. package/dist/types/layout/FlexWrapDetector.d.ts +2 -1
  63. package/dist/types/tracker/InternalTrafficToggle.d.ts +0 -1
  64. package/dist/types/tracker/InternalTrafficWatermark.d.ts +13 -0
  65. package/dist/types/tracker/index.d.ts +2 -0
  66. package/dist/types/tracker/internalTrafficUtils.d.ts +0 -7
  67. package/dist/types/tracker/useInternalTrafficBypass.d.ts +13 -0
  68. package/package.json +2 -2
@@ -1 +1 @@
1
- @import"https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700;900&display=swap";@import"https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@300;400;700&display=swap";@import"https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800&display=swap";@import"https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700&display=swap";.buttonBack___1mlaL,.buttonFirst___2rhFr,.buttonLast___2yuh0,.buttonNext___2mOCa,.buttonNext___3Lm3s,.dot___3c3SI{cursor:pointer}.image___xtQGH{display:block;width:100%;height:100%}.spinner___27VUp{position:absolute;top:calc(50% - 15px);left:calc(50% - 15px);width:30px;height:30px;animation-name:spin___S3UuE;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;border:4px solid #a9a9a9;border-top-color:#000;border-radius:30px}@keyframes spin___S3UuE{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.container___2O72F{position:relative;overflow:hidden;height:100%;width:100%}.overlay___IV4qY{position:absolute;top:0;left:0;bottom:0;right:0;opacity:0;cursor:zoom-in;transition:opacity .3s,transform .3s}.hover___MYy31,.loading___1pvNI,.zoom___3kqYk{opacity:1}.imageLoadingSpinnerContainer___3UIPD{position:absolute;top:0;right:0;bottom:0;left:0;background-color:#f4f4f4}.slide___3-Nqo{position:relative;display:block;box-sizing:border-box;height:0;margin:0;list-style-type:none}.slide___3-Nqo:focus{outline:none!important}.slideHorizontal___1NzNV{float:left}[dir=rtl] .slideHorizontal___1NzNV{direction:rtl;transform:scaleX(-1)}.slideInner___2mfX9{position:absolute;top:0;left:0;width:100%;height:100%}.focusRing___1airF{position:absolute;top:5px;right:5px;bottom:5px;left:5px;pointer-events:none;outline-width:5px;outline-style:solid;outline-color:Highlight}@media (-webkit-min-device-pixel-ratio:0){.focusRing___1airF{outline-style:auto;outline-color:-webkit-focus-ring-color}}.horizontalSlider___281Ls{position:relative;overflow:hidden}.horizontalSlider___281Ls:not(.touchDisabled___2qs4y){touch-action:pan-y pinch-zoom}[dir=rtl] .horizontalSlider___281Ls{direction:ltr;transform:scaleX(-1)}.horizontalSliderTray___1L-0W{overflow:hidden;width:100%}.verticalSlider___34ZFD{position:relative;overflow:hidden}.verticalSliderTray___267D8{overflow:hidden}.verticalTray___12Key{float:left}.verticalSlideTrayWrap___2nO7o{overflow:hidden}.sliderTray___-vHFQ{display:block;list-style:none;padding:0;margin:0}.sliderAnimation___300FY{transition:transform .5s;transition-timing-function:cubic-bezier(.645,.045,.355,1);will-change:transform}.masterSpinnerContainer___1Z6hB{position:absolute;top:0;right:0;bottom:0;left:0;background-color:#f4f4f4}:root{--header-height: 90px;--footer-height: 227px !important}html{font-size:18px!important}body{height:100%;padding:0;margin:0;font-family:Open Sans,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#000;background-color:transparent!important;font-size:18px!important}a{outline:0;border:none;box-shadow:none;-moz-outline-style:none}a:hover,a:focus{outline:0;border:none;box-shadow:none;-moz-outline-style:none}.edit-post-visual-editor .tabacoo-wrap,#root .tabacoo-wrap{border-bottom:1px solid #e0e0e0}.edit-post-visual-editor .tabacoo-wrap .wp-block-column:nth-child(1),#root .tabacoo-wrap .wp-block-column:nth-child(1){padding-right:15px;border-right:1px solid #e0e0e0;margin-right:20px}.edit-post-visual-editor .tabacoo-wrap .wp-block-column li,#root .tabacoo-wrap .wp-block-column li{list-style-type:none;color:#333;margin-top:10px;position:relative}.edit-post-visual-editor .tabacoo-wrap .wp-block-column li:before,#root .tabacoo-wrap .wp-block-column li:before{content:"";position:absolute;left:-27px;top:5px;width:15px;height:15px;border-radius:100px;background:#5baf95}.edit-post-visual-editor .tabacoo-wrap .wp-block-column li strong,#root .tabacoo-wrap .wp-block-column li strong{font-size:22px;margin-bottom:5px;display:block;color:#5baf95}.edit-post-visual-editor iframe,#root iframe{margin:0;padding:0}.edit-post-visual-editor code,#root code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.edit-post-visual-editor .ui,#root .ui{font-family:Open Sans,sans-serif}.edit-post-visual-editor .ui.container.narrow,#root .ui.container.narrow{max-width:1080px}.edit-post-visual-editor .ui.container.fluid.desktop,#root .ui.container.fluid.desktop{max-width:1366px!important}.edit-post-visual-editor .ui.primary.button,#root .ui.primary.button{background-color:#5089a6}.edit-post-visual-editor .ui.secondary.button,#root .ui.secondary.button{background-color:#5baf95}h1.type{font-size:1rem;padding:0;margin:0;color:#5089a6;font-family:Open Sans,sans-serif}.ui.container.editing{margin:0!important;padding:5px!important}.ui.container.editing .ui.container{width:100%!important;margin-left:0!important;margin-right:0!important}.map-tooltip-light{font-size:1em;color:#1e1e1e;border-radius:5px;background-color:#f7f7f7!important;min-width:220px}.map-tooltip-light .tooltip-content{padding:5px}.map-tooltip-light .tooltip-content hr{margin:3px -5px;border-bottom:none}.map-tooltip-light .tooltip-content b{color:unset}.map-tooltip-light .header{padding:5px;border-bottom:1px solid #DDD}.map-tooltip-light .value{color:#1e1e1e;font-weight:700;margin-left:5px}.map-tooltip-light .footer{padding:5px}.map-tooltip-light .footer .confidence{font-weight:700;color:#1e1e1e}.map-tooltip-light .footer hr{margin:3px -5px}.map-tooltip-light .footer b{color:#1e1e1e}.map-tooltip-dark{font-size:1em;color:#fff;border-radius:5px;background-color:#5c5c5c!important;min-width:220px}.map-tooltip-dark .tooltip-content{padding:5px}.map-tooltip-dark .tooltip-content hr{margin:3px -5px;border-bottom:none}.map-tooltip-dark .header{padding:5px;border-bottom:1px solid #DDD}.map-tooltip-dark .value{color:#fff;font-weight:700;margin-left:5px}.map-tooltip-dark .footer{padding:5px}.map-tooltip-dark .footer .confidence{font-weight:700;color:#fff}.map-tooltip-dark .footer hr{margin:3px -5px;border-bottom:none}.map-tooltip-dark .footer b{color:#fff}.ui.container.filter .menu{z-index:1600}.d3MapTooltip{font-family:Roboto;font-size:13px;border-radius:5%;background-color:#3c434a;padding:5px;opacity:.9;color:#fff;min-width:200px;border:1px solid #000}
1
+ .buttonBack___1mlaL,.buttonFirst___2rhFr,.buttonLast___2yuh0,.buttonNext___2mOCa,.buttonNext___3Lm3s,.dot___3c3SI{cursor:pointer}.image___xtQGH{display:block;width:100%;height:100%}.spinner___27VUp{position:absolute;top:calc(50% - 15px);left:calc(50% - 15px);width:30px;height:30px;animation-name:spin___S3UuE;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;border:4px solid #a9a9a9;border-top-color:#000;border-radius:30px}@keyframes spin___S3UuE{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.container___2O72F{position:relative;overflow:hidden;height:100%;width:100%}.overlay___IV4qY{position:absolute;top:0;left:0;bottom:0;right:0;opacity:0;cursor:zoom-in;transition:opacity .3s,transform .3s}.hover___MYy31,.loading___1pvNI,.zoom___3kqYk{opacity:1}.imageLoadingSpinnerContainer___3UIPD{position:absolute;top:0;right:0;bottom:0;left:0;background-color:#f4f4f4}.slide___3-Nqo{position:relative;display:block;box-sizing:border-box;height:0;margin:0;list-style-type:none}.slide___3-Nqo:focus{outline:none!important}.slideHorizontal___1NzNV{float:left}[dir=rtl] .slideHorizontal___1NzNV{direction:rtl;transform:scaleX(-1)}.slideInner___2mfX9{position:absolute;top:0;left:0;width:100%;height:100%}.focusRing___1airF{position:absolute;top:5px;right:5px;bottom:5px;left:5px;pointer-events:none;outline-width:5px;outline-style:solid;outline-color:Highlight}@media (-webkit-min-device-pixel-ratio:0){.focusRing___1airF{outline-style:auto;outline-color:-webkit-focus-ring-color}}.horizontalSlider___281Ls{position:relative;overflow:hidden}.horizontalSlider___281Ls:not(.touchDisabled___2qs4y){touch-action:pan-y pinch-zoom}[dir=rtl] .horizontalSlider___281Ls{direction:ltr;transform:scaleX(-1)}.horizontalSliderTray___1L-0W{overflow:hidden;width:100%}.verticalSlider___34ZFD{position:relative;overflow:hidden}.verticalSliderTray___267D8{overflow:hidden}.verticalTray___12Key{float:left}.verticalSlideTrayWrap___2nO7o{overflow:hidden}.sliderTray___-vHFQ{display:block;list-style:none;padding:0;margin:0}.sliderAnimation___300FY{transition:transform .5s;transition-timing-function:cubic-bezier(.645,.045,.355,1);will-change:transform}.masterSpinnerContainer___1Z6hB{position:absolute;top:0;right:0;bottom:0;left:0;background-color:#f4f4f4}:root{--header-height: 90px;--footer-height: 227px !important}html{font-size:18px!important}body{height:100%;padding:0;margin:0;font-family:Open Sans,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#000;background-color:transparent!important;font-size:18px!important}a{outline:0;border:none;box-shadow:none;-moz-outline-style:none}a:hover,a:focus{outline:0;border:none;box-shadow:none;-moz-outline-style:none}.edit-post-visual-editor .tabacoo-wrap,#root .tabacoo-wrap{border-bottom:1px solid #e0e0e0}.edit-post-visual-editor .tabacoo-wrap .wp-block-column:nth-child(1),#root .tabacoo-wrap .wp-block-column:nth-child(1){padding-right:15px;border-right:1px solid #e0e0e0;margin-right:20px}.edit-post-visual-editor .tabacoo-wrap .wp-block-column li,#root .tabacoo-wrap .wp-block-column li{list-style-type:none;color:#333;margin-top:10px;position:relative}.edit-post-visual-editor .tabacoo-wrap .wp-block-column li:before,#root .tabacoo-wrap .wp-block-column li:before{content:"";position:absolute;left:-27px;top:5px;width:15px;height:15px;border-radius:100px;background:#5baf95}.edit-post-visual-editor .tabacoo-wrap .wp-block-column li strong,#root .tabacoo-wrap .wp-block-column li strong{font-size:22px;margin-bottom:5px;display:block;color:#5baf95}.edit-post-visual-editor iframe,#root iframe{margin:0;padding:0}.edit-post-visual-editor code,#root code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.edit-post-visual-editor .ui,#root .ui{font-family:Open Sans,sans-serif}.edit-post-visual-editor .ui.container.narrow,#root .ui.container.narrow{max-width:1080px}.edit-post-visual-editor .ui.container.fluid.desktop,#root .ui.container.fluid.desktop{max-width:1366px!important}.edit-post-visual-editor .ui.primary.button,#root .ui.primary.button{background-color:#5089a6}.edit-post-visual-editor .ui.secondary.button,#root .ui.secondary.button{background-color:#5baf95}h1.type{font-size:1rem;padding:0;margin:0;color:#5089a6;font-family:Open Sans,sans-serif}.ui.container.editing{margin:0!important;padding:5px!important}.ui.container.editing .ui.container{width:100%!important;margin-left:0!important;margin-right:0!important}.map-tooltip-light{font-size:1em;color:#1e1e1e;border-radius:5px;background-color:#f7f7f7!important;min-width:220px}.map-tooltip-light .tooltip-content{padding:5px}.map-tooltip-light .tooltip-content hr{margin:3px -5px;border-bottom:none}.map-tooltip-light .tooltip-content b{color:unset}.map-tooltip-light .header{padding:5px;border-bottom:1px solid #DDD}.map-tooltip-light .value{color:#1e1e1e;font-weight:700;margin-left:5px}.map-tooltip-light .footer{padding:5px}.map-tooltip-light .footer .confidence{font-weight:700;color:#1e1e1e}.map-tooltip-light .footer hr{margin:3px -5px}.map-tooltip-light .footer b{color:#1e1e1e}.map-tooltip-dark{font-size:1em;color:#fff;border-radius:5px;background-color:#5c5c5c!important;min-width:220px}.map-tooltip-dark .tooltip-content{padding:5px}.map-tooltip-dark .tooltip-content hr{margin:3px -5px;border-bottom:none}.map-tooltip-dark .header{padding:5px;border-bottom:1px solid #DDD}.map-tooltip-dark .value{color:#fff;font-weight:700;margin-left:5px}.map-tooltip-dark .footer{padding:5px}.map-tooltip-dark .footer .confidence{font-weight:700;color:#fff}.map-tooltip-dark .footer hr{margin:3px -5px;border-bottom:none}.map-tooltip-dark .footer b{color:#fff}.ui.container.filter .menu{z-index:1600}.d3MapTooltip{font-family:Roboto;font-size:13px;border-radius:5%;background-color:#3c434a;padding:5px;opacity:.9;color:#fff;min-width:200px;border:1px solid #000}
@@ -2,8 +2,7 @@ const _ = {
2
2
  REACT_APP_WP_API: process.env.VITE_REACT_APP_WP_API ?? "/wp/wp-json",
3
3
  REACT_APP_API_ROOT: process.env.VITE_REACT_APP_API_ROOT ?? null,
4
4
  GA_CODE: process.env.VITE_REACT_APP_GA_CODE ?? "",
5
- DEFAULT_LOCALE: process.env.VITE_REACT_APP_DEFAULT_LOCALE ?? "en",
6
- INTERNAL_GA_TOKEN: process.env.VITE_INTERNAL_GA_TOKEN ?? ""
5
+ DEFAULT_LOCALE: process.env.VITE_REACT_APP_DEFAULT_LOCALE ?? "en"
7
6
  };
8
7
  export {
9
8
  _ as Config
@@ -1,227 +1,78 @@
1
- import { jsx as n, jsxs as y } from "react/jsx-runtime";
2
- import { useRef as L, useState as Q } from "react";
3
- import { Container as W, Grid as g, Popup as X } from "semantic-ui-react";
4
- import Z from "../data/DataProvider.js";
5
- import ee from "../data/DataConsumer.js";
6
- import "@devgateway/wp-react-lib";
7
- import { connect as te } from "react-redux";
8
- import { alphaSort as ne } from "../utils/common.js";
9
- import B from "string-template";
10
- const oe = (t) => {
1
+ import { jsx as t, jsxs as i } from "react/jsx-runtime";
2
+ import "react";
3
+ import { Grid as n, Popup as R } from "semantic-ui-react";
4
+ import h from "string-template";
5
+ import D from "./BigNumberTrendContainer.js";
6
+ import B from "./useBigNumberTrendData.js";
7
+ const U = (e) => {
11
8
  const {
12
- editing: u = !1,
13
- unique: C,
14
- intl: v,
15
- childContent: F,
16
- "data-csv": p = "",
17
- "data-dvz-proxy-dataset-id": d,
18
- "data-no-data-message": q = "No data matches your selection",
19
- "data-view-mode": U = "info",
20
- "data-height": w,
21
- "data-app": b,
22
- "data-measures": Y = "{}",
23
- "data-format": k = "{}",
24
- "data-group": f,
25
- "data-filters": M = "[]",
26
- "data-text-color": e = "#5a5d68",
27
- "data-number-color": o = "#5a5d68",
28
- "data-percent-color": a = "#5a5d68",
29
- "data-back-ground-color": i = "#5a5d68",
30
- "data-big-number-font-size": m = 20,
31
- "data-label-font-size": l = 20,
32
- "data-percent-font-size": x = 20,
33
- "data-label": S = "",
34
- "data-dimension1": D,
35
- "data-show-percentage-change": N = "false",
36
- "data-wait-for-filters": z = "false",
37
- "data-no-data-text": I = "-",
38
- "data-icon-image": _ = "",
39
- "data-icon-up": T = "",
40
- "data-icon-down": V = "",
41
- "data-show-tooltip": R = "false",
42
- "data-tooltip-text": $ = "",
43
- "data-tooltip-style": A = "light"
44
- } = t, j = v.locale, P = L(null), r = (s) => u ? s : decodeURIComponent(s), h = (s) => {
45
- try {
46
- return JSON.parse(r(s));
47
- } catch {
48
- console.error("error parsing value:" + s);
49
- }
50
- return null;
51
- }, c = h(k), J = c ? {
52
- style: c.style === "compacted" ? "decimal" : c.style,
53
- notation: c.style === "compacted" ? "compact" : "standard",
54
- currency: c.currency,
55
- minimumFractionDigits: parseInt(c.minimumFractionDigits),
56
- maximumFractionDigits: parseInt(c.maximumFractionDigits)
57
- } : {
58
- notation: "standard",
59
- currency: "USD",
60
- minimumFractionDigits: 2,
61
- maximumFractionDigits: 2
62
- }, [le, ce] = Q(U), K = u ? w - 80 : w - 40, E = {}, G = h(M) || {};
63
- G && G.forEach && G.forEach((s) => {
64
- s.value != null && s.value.filter((O) => O != null && O.toString().trim() != "").length > 0 && (E[s.param] = s.value);
65
- }), d && (E.dvzProxyDatasetId = d);
66
- const H = [];
67
- return D != "none" && H.push(D), /* @__PURE__ */ n("div", { ref: P, children: /* @__PURE__ */ n(
68
- W,
69
- {
70
- className: `alternative big number container ${u ? "editing" : ""}`,
71
- style: { height: w + "px", backgroundColor: i },
72
- fluid: !0,
73
- children: /* @__PURE__ */ n(
74
- Z,
75
- {
76
- style: { height: `${K}px` },
77
- params: E,
78
- app: b,
79
- group: f,
80
- csv: p,
81
- editing: u,
82
- waitForFilters: z === "true",
83
- store: [b, C, ...H],
84
- source: H.join("/"),
85
- children: /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
86
- ae,
87
- {
88
- iconImage: _,
89
- iconUp: T,
90
- iconDown: V,
91
- editing: u,
92
- locale: j,
93
- intl: v,
94
- app: b,
95
- format: J,
96
- dimension1: D,
97
- measure: h(Y)[0] || null,
98
- label: S,
99
- bigNumberFontSize: m,
100
- textColor: e,
101
- numberColor: o,
102
- percentColor: a,
103
- backGroundColor: i,
104
- labelFontSize: l,
105
- percentFontSize: x,
106
- showPercentageChange: N == "true" || N == !0,
107
- noDataText: I,
108
- showTooltip: R == "true" || R === !0,
109
- tooltipText: r($),
110
- tooltipStyle: A
111
- }
112
- ) })
113
- }
114
- )
115
- }
116
- ) });
117
- }, ae = (t) => {
118
- const {
119
- editing: u,
120
- app: C,
121
- measure: v,
122
- dimension1: F,
123
- data: p,
124
- format: d,
125
- label: q,
126
- textColor: U,
127
- bigNumberFontSize: w,
128
- percentFontSize: b,
129
- labelFontSize: Y,
130
- showPercentageChange: k,
131
- intl: f,
132
- noDataText: M
133
- } = t;
134
- let e = [], o, a;
135
- if (C == "csv") {
136
- const { data: r, meta: { fields: h } } = p;
137
- o = h[0], a = h[1], e = p.data.map((c) => ({
138
- value: c[o],
139
- [a]: c[a],
140
- [o]: c[o]
141
- }));
142
- } else if (a = v, o = F, o == null || o == "none") {
143
- let r = {};
144
- r[a] = p[a], e = [r];
145
- } else
146
- e = !p.children || p.children.length == 0 ? [] : p.children, e = e.map((r) => ({
147
- value: r.value,
148
- [a]: r[a],
149
- [o]: r.value
150
- }));
151
- let i = null, m = null, l, x, S;
152
- e.length > 0 && (e = e.sort((r, h) => ne(!1, f.locale, r.value, h.value)), i = e[e.length - 1][a], e.length > 1 && (m = e[e.length - 2][a]), S = f.formatNumber(d.style === "percent" ? i / 100 : i, { ...d }), m && (l = (i - m) / m, x = f.formatNumber(l, {
153
- style: "percent",
154
- minimumFractionDigits: 2,
155
- maximumFractionDigits: 2
156
- }))), i == null && (S = M);
157
- const D = {
158
- color: decodeURIComponent(t.numberColor),
159
- fontSize: w + "px"
160
- }, N = {
161
- color: decodeURIComponent(t.percentColor),
162
- fontSize: b + "px"
163
- }, z = {
164
- color: decodeURIComponent(t.percentColor),
165
- fontSize: b + "px",
166
- lineHeight: 1.1
167
- }, I = {
168
- display: "inline-flex",
169
- flexDirection: "column",
170
- alignItems: "center"
171
- }, _ = {
172
- color: decodeURIComponent(U),
173
- fontSize: Y + "px"
174
- }, T = e.length > 0 ? e[e.length - 1] : {}, V = e.length > 0 ? T[o] : null, R = e.length > 1 ? e[e.length - 2][o] : null, $ = i != null ? f.formatNumber(d.style === "percent" ? i / 100 : i, { ...d }) : null, A = m != null ? f.formatNumber(d.style === "percent" ? m / 100 : m, { ...d }) : null, j = {
175
- ...T,
176
- current_year: V,
177
- previous_year: R,
178
- current_value: $,
179
- previous_value: A,
180
- percent_change: x
181
- }, P = t.showTooltip && t.tooltipText ? B(t.tooltipText, j) : void 0;
182
- return /* @__PURE__ */ y(g, { padded: !0, children: [
183
- /* @__PURE__ */ y(g.Row, { children: [
184
- /* @__PURE__ */ n(g.Column, { width: 4, children: t.iconImage && t.iconImage != "" && /* @__PURE__ */ n("img", { className: "icon main", src: t.iconImage }) }),
185
- /* @__PURE__ */ y(g.Column, { textAlign: "right", width: 12, children: [
186
- /* @__PURE__ */ n("img", { className: `icon up ${l > 0 ? "visible" : "hidden"}`, src: t.iconUp }),
187
- /* @__PURE__ */ n("img", { className: `icon up ${l < 0 ? "visible" : "hidden"}`, s: !0, src: t.iconDown }),
188
- k && l != null && (t.showTooltip && P ? /* @__PURE__ */ n(
189
- X,
9
+ app: g,
10
+ measure: u,
11
+ dimension1: p,
12
+ data: y,
13
+ format: C,
14
+ percentChangeFormat: b,
15
+ label: f,
16
+ textColor: x,
17
+ bigNumberFontSize: N,
18
+ percentFontSize: l,
19
+ labelFontSize: S,
20
+ showPercentageChange: v,
21
+ intl: w,
22
+ noDataText: T
23
+ } = e, {
24
+ percentChange: o,
25
+ percentChangeFormatted: r,
26
+ formattedNumber: z,
27
+ templateContext: c
28
+ } = B({ data: y, app: g, measure: u, dimension1: p, format: C, percentChangeFormat: b, intl: w, noDataText: T }), I = { color: decodeURIComponent(e.numberColor), fontSize: N + "px" }, a = { color: decodeURIComponent(e.percentColor), fontSize: l + "px" }, d = { color: decodeURIComponent(e.percentColor), fontSize: l + "px", lineHeight: 1.1 }, m = { display: "inline-flex", flexDirection: "column", alignItems: "center" }, F = { color: decodeURIComponent(x), fontSize: S + "px" }, s = e.showTooltip && e.tooltipText ? h(e.tooltipText, c) : void 0;
29
+ return /* @__PURE__ */ i(n, { padded: !0, children: [
30
+ /* @__PURE__ */ i(n.Row, { children: [
31
+ /* @__PURE__ */ t(n.Column, { width: 4, children: e.iconImage && e.iconImage != "" && /* @__PURE__ */ t("img", { className: "icon main", src: e.iconImage }) }),
32
+ /* @__PURE__ */ i(n.Column, { textAlign: "right", width: 12, children: [
33
+ /* @__PURE__ */ t("img", { className: `icon up ${o > 0 ? "visible" : "hidden"}`, src: e.iconUp }),
34
+ /* @__PURE__ */ t("img", { className: `icon up ${o < 0 ? "visible" : "hidden"}`, s: !0, src: e.iconDown }),
35
+ v && o != null && (e.showTooltip && s ? /* @__PURE__ */ t(
36
+ R,
190
37
  {
191
- content: P,
38
+ content: s,
192
39
  position: "top center",
193
- inverted: t.tooltipStyle === "dark",
40
+ inverted: e.tooltipStyle === "dark",
194
41
  size: "small",
195
- trigger: /* @__PURE__ */ y("div", { style: I, children: [
196
- /* @__PURE__ */ y("div", { className: "percentage", style: N, children: [
42
+ trigger: /* @__PURE__ */ i("div", { style: m, children: [
43
+ /* @__PURE__ */ i("div", { className: "percentage", style: a, children: [
197
44
  " ",
198
- l > 0 ? "+" : "",
199
- l == 0 ? "=" : "",
200
- x
45
+ o > 0 ? "+" : "",
46
+ o == 0 ? "=" : "",
47
+ r
201
48
  ] }),
202
- /* @__PURE__ */ n("div", { className: "percentage-yoy", style: z, children: "YoY" })
49
+ /* @__PURE__ */ t("div", { className: "percentage-yoy", style: d, children: "YoY" })
203
50
  ] })
204
51
  }
205
- ) : /* @__PURE__ */ y("div", { style: I, children: [
206
- /* @__PURE__ */ y("div", { className: "percentage", style: N, children: [
52
+ ) : /* @__PURE__ */ i("div", { style: m, children: [
53
+ /* @__PURE__ */ i("div", { className: "percentage", style: a, children: [
207
54
  " ",
208
- l > 0 ? "+" : "",
209
- l == 0 ? "=" : "",
210
- x
55
+ o > 0 ? "+" : "",
56
+ o == 0 ? "=" : "",
57
+ r
211
58
  ] }),
212
- /* @__PURE__ */ n("div", { className: "percentage-yoy", style: z, children: "YoY" })
59
+ /* @__PURE__ */ t("div", { className: "percentage-yoy", style: d, children: "YoY" })
213
60
  ] }))
214
61
  ] })
215
62
  ] }),
216
- /* @__PURE__ */ n(g.Row, { children: /* @__PURE__ */ n(g.Column, { width: 16, children: /* @__PURE__ */ n("span", { className: "number", style: D, children: S }) }) }),
217
- /* @__PURE__ */ n(g.Row, { children: /* @__PURE__ */ n(g.Column, { children: /* @__PURE__ */ n("div", { className: "label", style: _, children: B(q, j) }) }) })
63
+ /* @__PURE__ */ t(n.Row, { children: /* @__PURE__ */ t(n.Column, { width: 16, children: /* @__PURE__ */ t("span", { className: "number", style: I, children: z }) }) }),
64
+ /* @__PURE__ */ t(n.Row, { children: /* @__PURE__ */ t(n.Column, { children: /* @__PURE__ */ t("div", { className: "label", style: F, children: h(f, c) }) }) })
218
65
  ] });
219
- }, re = (t, u) => {
220
- const { "data-app": C, "data-group": v } = u, F = t.getIn(["data", "measures", C, v]);
221
- return F ? {
222
- injectedMeasures: F
223
- } : {};
224
- }, ie = {}, ve = te(re, ie)(oe);
66
+ }, G = (e) => /* @__PURE__ */ t(
67
+ D,
68
+ {
69
+ DataFrameComponent: U,
70
+ containerClassName: "alternative big number container",
71
+ defaultBackgroundColor: "#5a5d68",
72
+ decodeTooltip: !0,
73
+ ...e
74
+ }
75
+ );
225
76
  export {
226
- ve as default
77
+ G as default
227
78
  };
@@ -0,0 +1,125 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { useRef as Y, useState as Z } from "react";
3
+ import { Container as _ } from "semantic-ui-react";
4
+ import tt from "../data/DataProvider.js";
5
+ import et from "../data/DataConsumer.js";
6
+ import { connect as at } from "react-redux";
7
+ const ot = (r) => {
8
+ const {
9
+ DataFrameComponent: s,
10
+ containerClassName: c,
11
+ defaultBackgroundColor: d = "none",
12
+ decodeTooltip: n = !1,
13
+ editing: a = !1,
14
+ unique: v,
15
+ intl: b,
16
+ "data-csv": z = "",
17
+ "data-dvz-proxy-dataset-id": x,
18
+ "data-view-mode": S = "info",
19
+ "data-height": l,
20
+ "data-app": m,
21
+ "data-measures": I = "{}",
22
+ "data-format": j = "{}",
23
+ "data-group": N,
24
+ "data-filters": P = "[]",
25
+ "data-text-color": k = "#5a5d68",
26
+ "data-number-color": O = "#5a5d68",
27
+ "data-percent-color": $ = "#5a5d68",
28
+ "data-big-number-font-size": B = 20,
29
+ "data-label-font-size": M = 20,
30
+ "data-percent-font-size": R = 20,
31
+ "data-label": U = "",
32
+ "data-dimension1": u,
33
+ "data-show-percentage-change": C = "false",
34
+ "data-wait-for-filters": E = "false",
35
+ "data-no-data-text": q = "-",
36
+ "data-icon-image": G = "",
37
+ "data-icon-up": H = "",
38
+ "data-icon-down": J = "",
39
+ "data-show-tooltip": y = "false",
40
+ "data-tooltip-text": D = "",
41
+ "data-tooltip-style": A = "light",
42
+ "data-percent-change-format": K = "{}"
43
+ } = r, w = r["data-back-ground-color"] || d, L = Y(null), T = (t) => a ? t : decodeURIComponent(t), i = (t) => {
44
+ try {
45
+ return JSON.parse(T(t));
46
+ } catch {
47
+ console.error("error parsing value:" + t);
48
+ }
49
+ return null;
50
+ }, p = i(K), Q = p && Object.keys(p).length > 0 ? p : { style: "percent", minimumFractionDigits: 2, maximumFractionDigits: 2 }, e = i(j), V = e ? {
51
+ style: e.style === "compacted" ? "decimal" : e.style,
52
+ notation: e.style === "compacted" ? "compact" : "standard",
53
+ currency: e.currency,
54
+ minimumFractionDigits: parseInt(e.minimumFractionDigits),
55
+ maximumFractionDigits: parseInt(e.maximumFractionDigits)
56
+ } : {
57
+ notation: "standard",
58
+ currency: "USD",
59
+ minimumFractionDigits: 2,
60
+ maximumFractionDigits: 2
61
+ }, [nt, it] = Z(S), W = a ? l - 80 : l - 40, g = {}, f = i(P) || {};
62
+ f && f.forEach && f.forEach((t) => {
63
+ t.value != null && t.value.filter((F) => F != null && F.toString().trim() != "").length > 0 && (g[t.param] = t.value);
64
+ }), x && (g.dvzProxyDatasetId = x);
65
+ const h = [];
66
+ u !== "none" && h.push(u);
67
+ const X = n ? T(D) : D;
68
+ return /* @__PURE__ */ o("div", { ref: L, children: /* @__PURE__ */ o(
69
+ _,
70
+ {
71
+ className: `${c} ${a ? "editing" : ""}`,
72
+ style: { height: l + "px", backgroundColor: w },
73
+ fluid: !0,
74
+ children: /* @__PURE__ */ o(
75
+ tt,
76
+ {
77
+ style: { height: `${W}px` },
78
+ params: g,
79
+ app: m,
80
+ group: N,
81
+ csv: z,
82
+ editing: a,
83
+ waitForFilters: E === "true",
84
+ store: [m, v, ...h],
85
+ source: h.join("/"),
86
+ children: /* @__PURE__ */ o(et, { children: /* @__PURE__ */ o(
87
+ s,
88
+ {
89
+ iconImage: G,
90
+ iconUp: H,
91
+ iconDown: J,
92
+ editing: a,
93
+ locale: b.locale,
94
+ intl: b,
95
+ app: m,
96
+ format: V,
97
+ dimension1: u,
98
+ measure: i(I)[0] || null,
99
+ label: U,
100
+ bigNumberFontSize: B,
101
+ textColor: k,
102
+ numberColor: O,
103
+ percentColor: $,
104
+ backGroundColor: w,
105
+ labelFontSize: M,
106
+ percentFontSize: R,
107
+ showPercentageChange: C == "true" || C == !0,
108
+ noDataText: q,
109
+ showTooltip: y == "true" || y === !0,
110
+ tooltipText: X,
111
+ tooltipStyle: A,
112
+ percentChangeFormat: Q
113
+ }
114
+ ) })
115
+ }
116
+ )
117
+ }
118
+ ) });
119
+ }, rt = (r, s) => {
120
+ const { "data-app": c, "data-group": d } = s, n = r.getIn(["data", "measures", c, d]);
121
+ return n ? { injectedMeasures: n } : {};
122
+ }, pt = at(rt, {})(ot);
123
+ export {
124
+ pt as default
125
+ };