@luzmo/analytics-components-kit 1.2.1 → 1.4.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 (159) hide show
  1. package/README.md +8 -3
  2. package/angular/components/add-to-dashboard.ts +20 -6
  3. package/angular/components/data-fields-select.ts +5 -0
  4. package/angular/components/interactive-viz-item.ts +89 -24
  5. package/angular/components/item-grid-item-actions-menu.ts +5 -0
  6. package/angular/components/item-grid.ts +7 -0
  7. package/angular/components/item-option-color-picker.ts +28 -28
  8. package/angular/components/item-option-guidelines.ts +22 -1
  9. package/angular/components/item-option-multi-language-field.ts +7 -7
  10. package/angular/components/item-option-number-field.ts +14 -14
  11. package/angular/components/item-option-positions-number-field.ts +14 -14
  12. package/angular/components/item-option-radio-button-group.ts +7 -7
  13. package/angular/components/item-option-text-field.ts +7 -7
  14. package/angular/components/item-slot-picker-panel.ts +1 -1
  15. package/angular/components/item-slot-picker.ts +7 -7
  16. package/angular/esm/components/add-to-dashboard.d.ts +8 -4
  17. package/angular/esm/components/add-to-dashboard.js +23 -7
  18. package/angular/esm/components/data-fields-select.d.ts +2 -0
  19. package/angular/esm/components/data-fields-select.js +4 -0
  20. package/angular/esm/components/interactive-viz-item.d.ts +32 -11
  21. package/angular/esm/components/interactive-viz-item.js +99 -28
  22. package/angular/esm/components/item-grid-item-actions-menu.d.ts +2 -0
  23. package/angular/esm/components/item-grid-item-actions-menu.js +4 -0
  24. package/angular/esm/components/item-grid.d.ts +3 -1
  25. package/angular/esm/components/item-grid.js +9 -1
  26. package/angular/esm/components/item-option-color-picker.d.ts +10 -10
  27. package/angular/esm/components/item-option-color-picker.js +34 -34
  28. package/angular/esm/components/item-option-guidelines.d.ts +8 -2
  29. package/angular/esm/components/item-option-guidelines.js +26 -2
  30. package/angular/esm/components/item-option-multi-language-field.d.ts +3 -3
  31. package/angular/esm/components/item-option-multi-language-field.js +10 -10
  32. package/angular/esm/components/item-option-number-field.d.ts +5 -5
  33. package/angular/esm/components/item-option-number-field.js +18 -18
  34. package/angular/esm/components/item-option-positions-number-field.d.ts +5 -5
  35. package/angular/esm/components/item-option-positions-number-field.js +18 -18
  36. package/angular/esm/components/item-option-radio-button-group.d.ts +3 -3
  37. package/angular/esm/components/item-option-radio-button-group.js +10 -10
  38. package/angular/esm/components/item-option-text-field.d.ts +3 -3
  39. package/angular/esm/components/item-option-text-field.js +10 -10
  40. package/angular/esm/components/item-slot-picker-panel.d.ts +1 -1
  41. package/angular/esm/components/item-slot-picker-panel.js +1 -1
  42. package/angular/esm/components/item-slot-picker.d.ts +3 -3
  43. package/angular/esm/components/item-slot-picker.js +9 -9
  44. package/angular/package.json +2 -2
  45. package/components/add-to-dashboard/dashboard-actions.d.ts +2 -1
  46. package/components/add-to-dashboard/index.cjs +1 -1
  47. package/components/add-to-dashboard/index.js +1 -1
  48. package/components/{add-to-dashboard-NwsCPIlg.cjs → add-to-dashboard-BtzTZdjN.cjs} +1 -1
  49. package/components/{add-to-dashboard-NcVHlqrc.js → add-to-dashboard-Bu6S3qVz.js} +125 -120
  50. package/components/chart-helpers-BHxQbLBw.cjs +20 -0
  51. package/components/{chart-helpers-Dng_LGfq.js → chart-helpers-BKeMLhov.js} +53 -39
  52. package/components/filters/index.cjs +1 -1
  53. package/components/filters/index.js +1 -1
  54. package/components/{filters-CxIzuI5q.js → filters-DEpmh9Nj.js} +113 -102
  55. package/components/filters-LDXhe1Bp.cjs +187 -0
  56. package/components/index.cjs +1 -1
  57. package/components/index.js +6 -6
  58. package/components/interactive-viz-item/helpers/chart-helpers.d.ts +2 -1
  59. package/components/interactive-viz-item/index.cjs +1 -1
  60. package/components/interactive-viz-item/index.d.ts +1 -1
  61. package/components/interactive-viz-item/index.js +3 -3
  62. package/components/interactive-viz-item/interactive-viz-item.d.ts +47 -1
  63. package/components/interactive-viz-item/types.d.ts +4 -0
  64. package/components/interactive-viz-item-Cc3Ix95e.js +630 -0
  65. package/components/interactive-viz-item-SF12d97t.cjs +269 -0
  66. package/components/item-grid/item-grid.d.ts +1 -0
  67. package/components/item-slot-picker-panel/index.cjs +1 -1
  68. package/components/item-slot-picker-panel/index.js +1 -1
  69. package/components/item-slot-picker-panel/item-slot-picker-panel.d.ts +19 -1
  70. package/components/item-slot-picker-panel-Cw3UCK03.cjs +84 -0
  71. package/components/{item-slot-picker-panel-fJqEmxeD.js → item-slot-picker-panel-DprM9Rli.js} +64 -33
  72. package/custom-elements.json +3051 -2531
  73. package/grid-core/item-grid-base.d.ts +5 -4
  74. package/package.json +2 -2
  75. package/react/package.json +2 -2
  76. package/standalone/add-to-dashboard.js +40 -40
  77. package/standalone/chunks/{chart-helpers-DsIGsaDc.js → chart-helpers-DZsidiCl.js} +2 -2
  78. package/standalone/chunks/{choropleth-map-options.config-rUJsEJcm.js → choropleth-map-options.config-CDMjKnJD.js} +1 -1
  79. package/standalone/chunks/{color-range-utils-DxOtqAKB.js → color-range-utils-BVyHBRiq.js} +1 -1
  80. package/standalone/chunks/data-broker-DpSrH3IP.js +2 -0
  81. package/standalone/chunks/de-BkB0q1Eg.js +2 -0
  82. package/standalone/chunks/display-settings-binning-DhHlclWH.js +38 -0
  83. package/standalone/chunks/display-settings-datetime-C8xvOvi4.js +199 -0
  84. package/standalone/chunks/display-settings-grand-totals-CUpigDcs.js +26 -0
  85. package/standalone/chunks/display-settings-numeric-BLWF54Jx.js +172 -0
  86. package/standalone/chunks/display-settings-period-over-period-COd4tvUw.js +209 -0
  87. package/standalone/chunks/embed-Bv1ps-EM.js +260 -0
  88. package/standalone/chunks/en-DNsyAwgq.js +2 -0
  89. package/standalone/chunks/en-GB-Di3OzVdL.js +2 -0
  90. package/standalone/chunks/en-US-DNsyAwgq.js +2 -0
  91. package/standalone/chunks/es-Bo0jStZn.js +2 -0
  92. package/standalone/chunks/{filters-DKgJcQGP.js → filters-lhg_WVDK.js} +108 -108
  93. package/standalone/chunks/{formula-codemirror-BbyvNEVD.js → formula-codemirror-DZMzLE2I.js} +17 -17
  94. package/standalone/chunks/fr-Co_qVhhV.js +2 -0
  95. package/standalone/chunks/{heat-map-options.config-D93AeYFi.js → heat-map-options.config-DDQMD38W.js} +1 -1
  96. package/standalone/chunks/{heat-table-options.config-ZVML76FK.js → heat-table-options.config-B4K0Ygug.js} +1 -1
  97. package/standalone/chunks/{is-same-option-value-Di-A7Wmg.js → is-same-option-value-7kXNF4st.js} +1 -1
  98. package/standalone/chunks/item-option-action-button-group-Bl1HR1JK.js +35 -0
  99. package/standalone/chunks/item-option-base-DF24wTyv.js +38 -0
  100. package/standalone/chunks/item-option-color-palette-picker-MkIIn56p.js +22 -0
  101. package/standalone/chunks/item-option-color-picker-CxosMo_p.js +19 -0
  102. package/standalone/chunks/item-option-color-range-C7C70r4J.js +83 -0
  103. package/standalone/chunks/item-option-guidelines-iu8yWRzr.js +120 -0
  104. package/standalone/chunks/{item-option-multi-language-field-DPPpN2qg.js → item-option-multi-language-field-foanqCdr.js} +1 -1
  105. package/standalone/chunks/{item-option-number-field-CkqJjInE.js → item-option-number-field-ByVD4oq0.js} +1 -1
  106. package/standalone/chunks/item-option-panel-Bya-K7HH.js +316 -0
  107. package/standalone/chunks/{item-option-picker-BnwQPT9A.js → item-option-picker-CqNNVIML.js} +1 -1
  108. package/standalone/chunks/item-option-position-picker-BjCFVtDH.js +14 -0
  109. package/standalone/chunks/item-option-positions-number-field-BJJtXZL-.js +31 -0
  110. package/standalone/chunks/{item-option-radio-button-group-BkymJq3E.js → item-option-radio-button-group-C5bxsD85.js} +1 -1
  111. package/standalone/chunks/item-option-slider-DUXWz70B.js +18 -0
  112. package/standalone/chunks/item-option-switch-BHyJuOkP.js +12 -0
  113. package/standalone/chunks/{item-option-text-field-D7bkuhsv.js → item-option-text-field-rBZY9OX4.js} +1 -1
  114. package/standalone/chunks/{item-slot-picker-panel-D4BMxGs9.js → item-slot-picker-panel-BM82vSXi.js} +101 -99
  115. package/standalone/chunks/load-data-fields-for-datasets-DS9O1oyy.js +25 -0
  116. package/standalone/chunks/localize-DLl7tgQp.js +2 -0
  117. package/standalone/chunks/localized-decorator-DosMCCQo.js +2 -0
  118. package/standalone/chunks/{version-BW4Ixl63.js → localized-mixin-BWJj88bd.js} +1 -1
  119. package/standalone/chunks/nl-CQz2jrVx.js +2 -0
  120. package/standalone/chunks/{option-interaction-controller-BslAXAHF.js → option-interaction-controller-BuwRr21c.js} +1 -1
  121. package/standalone/chunks/{route-map-options.config-Dwy0JSVq.js → route-map-options.config-CGBkHnhM.js} +1 -1
  122. package/standalone/chunks/{spike-map-options.config-DFmuNxym.js → spike-map-options.config-CSenlJ_F.js} +1 -1
  123. package/standalone/interactive-viz-item.js +88 -84
  124. package/standalone/item-grid.js +10 -10
  125. package/standalone/manifest.json +46 -46
  126. package/types.d.ts +1 -1
  127. package/components/chart-helpers-ufZ6VbXs.cjs +0 -20
  128. package/components/filters-BPbPFOu5.cjs +0 -187
  129. package/components/interactive-viz-item-CwRRaCZB.js +0 -583
  130. package/components/interactive-viz-item-CxdrGRKc.cjs +0 -265
  131. package/components/item-slot-picker-panel-BhhN54IM.cjs +0 -82
  132. package/standalone/chunks/data-broker-DXDyIrj_.js +0 -2
  133. package/standalone/chunks/de-mdZT2W1G.js +0 -2
  134. package/standalone/chunks/display-settings-binning-Byffw2Kl.js +0 -38
  135. package/standalone/chunks/display-settings-datetime-CD52d6Sv.js +0 -199
  136. package/standalone/chunks/display-settings-grand-totals-Cky99LX9.js +0 -26
  137. package/standalone/chunks/display-settings-numeric-C9ea7Tgc.js +0 -172
  138. package/standalone/chunks/display-settings-period-over-period-BLSGumkD.js +0 -209
  139. package/standalone/chunks/embed-CBu7iQRx.js +0 -231
  140. package/standalone/chunks/en-CSboh17P.js +0 -2
  141. package/standalone/chunks/en-GB-HoXKQBOY.js +0 -2
  142. package/standalone/chunks/en-US-CSboh17P.js +0 -2
  143. package/standalone/chunks/es-Di5D8JFd.js +0 -2
  144. package/standalone/chunks/fr-DZku7iB9.js +0 -2
  145. package/standalone/chunks/item-option-action-button-group-BEAwPHVw.js +0 -35
  146. package/standalone/chunks/item-option-base-CRUxNhJQ.js +0 -38
  147. package/standalone/chunks/item-option-color-palette-picker-CBz61iZb.js +0 -22
  148. package/standalone/chunks/item-option-color-picker-lLvBPnKA.js +0 -19
  149. package/standalone/chunks/item-option-color-range-BqeatOei.js +0 -83
  150. package/standalone/chunks/item-option-guidelines-Cop8rM8y.js +0 -120
  151. package/standalone/chunks/item-option-panel-CzSKFCVl.js +0 -316
  152. package/standalone/chunks/item-option-position-picker-Bkc4JvJX.js +0 -14
  153. package/standalone/chunks/item-option-positions-number-field-Dr_315TE.js +0 -31
  154. package/standalone/chunks/item-option-slider-K_bsNci8.js +0 -18
  155. package/standalone/chunks/item-option-switch-DeihDHhM.js +0 -12
  156. package/standalone/chunks/load-data-fields-for-datasets-ClctSj6y.js +0 -25
  157. package/standalone/chunks/localize-DXRmGRe-.js +0 -2
  158. package/standalone/chunks/localized-decorator-DJVBmJVH.js +0 -2
  159. package/standalone/chunks/nl-CViTevL3.js +0 -2
@@ -1,583 +0,0 @@
1
- /*! * A kit of modern Luzmo Web Components for analytics in your web application.
2
- *
3
- * Copyright © 2026 Luzmo
4
- * All rights reserved.
5
- * Luzmo web components (“Luzmo Web Components”)
6
- * must be used according to the Luzmo Terms of Service.
7
- * This license allows users with a current active Luzmo account
8
- * to use the Luzmo Web Components. This license terminates
9
- * automatically if a user no longer has an active Luzmo account.
10
- * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
11
- *
12
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
- * SOFTWARE.
19
- * */
20
- import "./tokens-6HmQYnEP.js";
21
- import { i as e, n as t, t as n } from "./base-rAte-QzM.js";
22
- import { t as r } from "./decorate-B2TzfnLZ.js";
23
- import { t as i } from "./localized-mixin-FPDNaZhb.js";
24
- import { n as a } from "./is-same-option-value-B2oyvEqT.js";
25
- import { c as o, i as s, l as c, n as l, o as u, r as d, t as f, u as p } from "./chart-helpers-Dng_LGfq.js";
26
- import { t as m } from "./create-lazy-loader-BFqDG_WK.js";
27
- import { luzmoAlignLeft as h, luzmoInfoCircle as g, luzmoThumbsDown as _, luzmoThumbsUp as v } from "@luzmo/icons";
28
- import "@luzmo/lucero/action-button";
29
- import "@luzmo/lucero/icon";
30
- import "@luzmo/lucero/overlay";
31
- import "@luzmo/lucero/popover";
32
- import { html as y, nothing as b, unsafeCSS as x } from "lit";
33
- import { property as S, state as C } from "lit/decorators.js";
34
- import { msg as w } from "@lit/localize";
35
- import "@luzmo/embed";
36
- import "@luzmo/lucero/action-group";
37
- import "@luzmo/lucero/field-label";
38
- import "@luzmo/lucero/number-field";
39
- import "@luzmo/lucero/picker";
40
- import "@luzmo/lucero/progress-circle";
41
- import "@luzmo/lucero/tabs";
42
- // src/components/interactive-viz-item/interactive-viz-item.module.scss?inline
43
- var T = ":host{box-sizing:border-box;display:block;container-type:inline-size}.answer{width:100%;display:block}.chart-actions-bar{justify-content:space-between;align-items:flex-start;gap:var(--luzmo-interactive-viz-item-actions-gap,var(--interactive-viz-item-actions-gap));padding-block:var(--luzmo-interactive-viz-item-actions-padding-block,var(--interactive-viz-item-actions-padding-block));flex-wrap:nowrap;margin-block-start:var(--luzmo-interactive-viz-item-actions-margin-block-start,var(--interactive-viz-item-actions-margin-block-start));display:flex}.chart-actions-primary{gap:var(--luzmo-interactive-viz-item-actions-gap,var(--interactive-viz-item-actions-gap));flex-wrap:wrap;flex:1;align-items:center;min-width:0;display:flex}.ranking-content{gap:var(--luzmo-spacing-3);padding:var(--luzmo-spacing-3);flex-direction:column;display:flex}.ranking-row{gap:var(--luzmo-spacing-3);align-items:center;display:flex}.ranking-number{width:4rem}.icon-flipped{transform:scaleY(-1)}.chart-container{border-radius:var(--luzmo-interactive-viz-item-chart-border-radius,var(--interactive-viz-item-chart-border-radius));height:var(--luzmo-interactive-viz-item-chart-height,var(--interactive-viz-item-chart-height));overflow:hidden}.chart-container luzmo-embed-viz-item{width:100%;height:100%;display:block}.feedback-row{padding-block:var(--luzmo-interactive-viz-item-feedback-padding-block,var(--interactive-viz-item-feedback-padding-block));justify-content:space-between;align-items:center;display:flex}.rating-btn-positive{--luzmo-action-button-content-color-default-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-hover-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-down-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-focus-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-background-color-default-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-hover-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-down-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-focus-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background))}.rating-btn-negative{--luzmo-action-button-content-color-default-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-hover-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-down-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-focus-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-background-color-default-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-hover-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-down-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-focus-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background))}.config-toggle{--luzmo-action-button-border-radius:32px;margin-inline-start:auto}.sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.config-panel{border:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));border-radius:var(--luzmo-interactive-viz-item-config-panel-border-radius,var(--interactive-viz-item-config-panel-border-radius));padding:var(--luzmo-interactive-viz-item-config-panel-padding,var(--interactive-viz-item-config-panel-padding));background:var(--luzmo-interactive-viz-item-config-panel-background,var(--interactive-viz-item-config-panel-background));margin-block-start:var(--luzmo-spacing-2)}.config-panel luzmo-tab-panel[selected]{padding-block-start:var(--luzmo-spacing-4);display:block}.config-panel luzmo-item-option-panel,.config-panel luzmo-item-slot-picker-panel,.config-panel luzmo-filters{width:100%;max-height:15rem;scrollbar-width:thin;scrollbar-color:var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color)) transparent;padding-inline-end:var(--luzmo-spacing-3);overflow-y:auto}.edit-grid{min-height:12.5rem;display:flex}.edit-column{gap:var(--luzmo-spacing-3);flex-direction:column;display:flex}.edit-column:first-child{flex-shrink:0;max-width:15rem}.edit-column-filters{border-inline-start:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));flex:1;min-width:18.75rem;padding-inline-start:var(--luzmo-spacing-5)}@container (width<=520px){.edit-grid{flex-direction:column}.edit-column,.edit-column:first-child{width:100%;min-width:0;max-width:100%}.edit-column-filters{border-inline-start:none;border-block-start:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));min-width:0;margin-block-start:var(--luzmo-spacing-3);padding-block-start:var(--luzmo-spacing-4);padding-inline-start:0}}@container (width<=768px){.chart-container{height:calc(var(--luzmo-interactive-viz-item-chart-height,var(--interactive-viz-item-chart-height)) - var(--luzmo-interactive-viz-item-chart-narrow-offset,var(--interactive-viz-item-chart-narrow-offset)))}}:host{--interactive-viz-item-actions-gap:var(--luzmo-spacing-3);--interactive-viz-item-actions-padding-block:var(--luzmo-spacing-3);--interactive-viz-item-actions-margin-block-start:var(--luzmo-spacing-5);--interactive-viz-item-chart-height:20rem;--interactive-viz-item-chart-narrow-offset:2.5rem;--interactive-viz-item-chart-border-radius:var(--luzmo-border-radius);--interactive-viz-item-feedback-padding-block:var(--luzmo-spacing-4);--interactive-viz-item-config-panel-padding:var(--luzmo-spacing-5);--interactive-viz-item-config-panel-border-color:var(--luzmo-border-color);--interactive-viz-item-config-panel-border-radius:var(--luzmo-border-radius);--interactive-viz-item-config-panel-background:var(--luzmo-background-color);--interactive-viz-item-rating-positive-color:var(--luzmo-positive-color,#12855a);--interactive-viz-item-rating-negative-color:var(--luzmo-negative-color,#ca221c);--interactive-viz-item-rating-selected-background:var(--luzmo-background-color-focus,#0000000f)}:host([size=s]){--interactive-viz-item-chart-height:17.5rem}:host([size=l]){--interactive-viz-item-chart-height:22rem}:host([size=xl]){--interactive-viz-item-chart-height:24rem}", E = m(() => import("./add-to-dashboard/index.js")).load, D = [
44
- "luzmo-filters",
45
- "luzmo-item-option-panel",
46
- "luzmo-item-slot-picker-panel"
47
- ], O = m(() => Promise.all([
48
- import("./filters/index.js"),
49
- import("./item-option-panel/index.js"),
50
- import("./item-slot-picker-panel/index.js")
51
- ])), k = O.load, A = () => O.isLoaded() || D.every((e) => customElements.get(e) !== void 0), j = 0, M = {}, N = (e, t) => t !== null && a(JSON.parse(JSON.stringify(e)), JSON.parse(JSON.stringify(t))), P = class extends i(t(e, { validSizes: Object.values(n) })) {
52
- constructor(...e) {
53
- super(...e), this.chart = null, this.feedback = null, this.messageId = "", this.authKey = "", this.authToken = "", this.apiUrl = "https://api.luzmo.com", this.appServer = "https://app.luzmo.com", this.contentLanguage = "", this.hideActions = !1, this.hideFeedback = !1, this.hideConfigPanel = !1, this.addToDashboard = !1, this.dashboardActions = null, this.controlled = !1, this.liveInteractions = !1, this._configPanelOpen = !1, this._configPanelPending = !1, this._configPanelLoadFailed = !1, this._rankingTriggerId = `interactive-viz-item-ranking-${++j}`, this._interactionGeneration = 0, this._openInteractions = /* @__PURE__ */ new Map(), this._ownCharts = [], this._handleSlotsChanged = (e) => {
54
- this.chart && this._emitChart({
55
- ...this.chart,
56
- slots: e.detail.slotsContents
57
- });
58
- }, this._handleFiltersChanged = (e) => {
59
- this.chart && this._emitChart({
60
- ...this.chart,
61
- filters: e.detail.filters
62
- });
63
- }, this._handleOptionsChanged = (e) => {
64
- if (!this.chart) return;
65
- let { options: t, interaction: n } = e.detail;
66
- if (!t) return;
67
- if (n) {
68
- let e = this._openInteractions.get(n.id);
69
- if (!e || !this._isCurrentContext(e)) {
70
- e?.generation === this._interactionGeneration && this._invalidateInteractions();
71
- return;
72
- }
73
- }
74
- let r = this.chart.options.theme ?? {};
75
- this._emitChart({
76
- ...this.chart,
77
- options: {
78
- ...t,
79
- theme: r
80
- }
81
- }, n);
82
- }, this._handleInteractionStart = (e) => {
83
- if (!this.chart) return;
84
- let t = {
85
- chart: this.chart,
86
- generation: this._interactionGeneration,
87
- auth: this._auth
88
- };
89
- this._openInteractions.set(e.detail.id, t), this._dispatchInteraction(e, t);
90
- }, this._handleInteractionClosed = (e) => {
91
- let t = this._openInteractions.get(e.detail.id);
92
- this._openInteractions.delete(e.detail.id), this._openInteractions.size === 0 && (this._ownCharts = this._ownCharts.slice(-1)), t && this._dispatchInteraction(e, t);
93
- };
94
- }
95
- static get styles() {
96
- return [x(T)];
97
- }
98
- get _effectiveContentLanguage() {
99
- return this.contentLanguage || this.language;
100
- }
101
- _dispatch(e, t) {
102
- let n = new CustomEvent(e, {
103
- detail: t,
104
- bubbles: !0,
105
- composed: !0
106
- });
107
- this.dispatchEvent(n);
108
- }
109
- get _chartActions() {
110
- return this.chart ? l(u(this.chart)) : [];
111
- }
112
- get _rating() {
113
- return this.feedback?.rating ?? 0;
114
- }
115
- get _canShowConfigPanel() {
116
- return !!this.chart && !this.hideConfigPanel;
117
- }
118
- async _toggleConfigPanel() {
119
- if (this._configPanelLoadFailed = !1, this._configPanelOpen) this.endInteraction(), this._configPanelOpen = !1;
120
- else if (!this._configPanelPending) {
121
- if (!A()) {
122
- this._configPanelPending = !0;
123
- try {
124
- await k();
125
- } catch (e) {
126
- console.warn("Failed to load the chart configuration panel:", e), this._configPanelLoadFailed = !0;
127
- return;
128
- } finally {
129
- this._configPanelPending = !1;
130
- }
131
- }
132
- this.isConnected && this._canShowConfigPanel && (this._configPanelOpen = !0);
133
- }
134
- }
135
- endInteraction() {
136
- this.renderRoot?.querySelector("luzmo-item-option-panel")?.endInteraction?.();
137
- }
138
- willUpdate(e) {
139
- super.willUpdate(e), this._openInteractions.size > 0 && this._invalidatesInteractions(e) && this._invalidateInteractions(), e.has("addToDashboard") && this.addToDashboard && E().catch((e) => console.warn("Failed to load add to dashboard:", e));
140
- }
141
- _emitOptions(e) {
142
- !this.controlled && this.chart && (this.chart = {
143
- ...this.chart,
144
- options: e
145
- }), this._dispatch("luzmo-chart-options-changed", { options: e });
146
- }
147
- _invalidatesInteractions(e) {
148
- return e.has("authKey") || e.has("authToken") || e.has("apiUrl") || e.has("hideConfigPanel") ? !0 : e.has("chart") && [...this._openInteractions.values()].some((e) => !this._isCurrentChart(e));
149
- }
150
- _invalidateInteractions() {
151
- this._interactionGeneration++, this.endInteraction();
152
- }
153
- get _auth() {
154
- return [
155
- this.authKey,
156
- this.authToken,
157
- this.apiUrl
158
- ];
159
- }
160
- _isCurrentChart(e) {
161
- let t = this.chart;
162
- return t === e.chart || this._ownCharts.some((e) => e === t) || [...this._ownCharts].reverse().some((e) => N(e, t)) || N(e.chart, t);
163
- }
164
- _isCurrentContext(e) {
165
- return e.generation === this._interactionGeneration && e.auth.every((e, t) => e === this._auth[t]) && this._isCurrentChart(e);
166
- }
167
- _emitChart(e, t) {
168
- this._ownCharts = this._openInteractions.size > 0 ? [...this._ownCharts, e] : [e], this.controlled || (this.chart = e), this._dispatch("luzmo-chart-changed", t ? {
169
- chart: e,
170
- interaction: t
171
- } : { chart: e });
172
- }
173
- _handleDropdownChange(e, t) {
174
- if (!this.chart) return;
175
- t.stopPropagation();
176
- let n = t.detail, r = typeof n == "string" ? n : n?.value ?? t.target?.value;
177
- if (!r) return;
178
- let i = f({
179
- ...u(this.chart),
180
- options: this.chart.options
181
- }, {
182
- type: "chartAction",
183
- actionType: e.mutationType,
184
- key: r
185
- });
186
- this._emitOptions(i.options);
187
- }
188
- _currentRanking(e) {
189
- return e.ranking ?? {
190
- active: !1,
191
- number: 5,
192
- direction: o.Top
193
- };
194
- }
195
- _currentSort(e) {
196
- return e.sort ?? {
197
- direction: p.Desc,
198
- by: c.Measure
199
- };
200
- }
201
- _emitRankAndSort(e, t) {
202
- this.chart && this._emitOptions({
203
- ...this.chart.options,
204
- ranking: e,
205
- sort: t
206
- });
207
- }
208
- _renderOptionDropdown(e) {
209
- let t = e.values ?? [], n = e.currentValue || t[0]?.key || "";
210
- return y`
211
- <luzmo-picker
212
- size=${this.size}
213
- variant="highlight"
214
- value=${n}
215
- @change=${(t) => this._handleDropdownChange(e, t)}
216
- >
217
- ${t.map((e) => y`<luzmo-menu-item value=${e.key}>${e.label}</luzmo-menu-item>`)}
218
- </luzmo-picker>
219
- `;
220
- }
221
- _renderRankingPicker(e) {
222
- let t = this._currentRanking(e), n = this._currentSort(e);
223
- if (!t.active) return y`
224
- <luzmo-action-button
225
- size=${this.size}
226
- @click=${() => this._emitRankAndSort({
227
- active: !0,
228
- number: 5,
229
- direction: o.Top
230
- }, n)}
231
- >
232
- <luzmo-icon slot="icon" size="xs" .icon=${h}></luzmo-icon>
233
- ${w("Show top 5", { desc: "Label to activate top-N ranking on a chart" })}
234
- </luzmo-action-button>
235
- `;
236
- let r = t.direction === o.Bottom ? w("Bottom", { desc: "Ranking direction: keep the lowest values" }) : w("Top", { desc: "Ranking direction: keep the highest values" });
237
- return y`
238
- <luzmo-action-button size=${this.size} id=${this._rankingTriggerId}>
239
- <luzmo-icon slot="icon" size="xs" .icon=${h}></luzmo-icon>
240
- ${r} ${t.number || 5}
241
- </luzmo-action-button>
242
-
243
- <luzmo-overlay type="auto" placement="bottom-start" trigger=${`${this._rankingTriggerId}@click`}>
244
- <luzmo-popover>
245
- <div class="ranking-content">
246
- <div class="ranking-row">
247
- <luzmo-action-group
248
- size=${this.size}
249
- compact
250
- selects="single"
251
- .selected=${[t.direction]}
252
- @change=${(t) => this._handleDirectionChange(e, t)}
253
- >
254
- <luzmo-action-button value="top" emphasized
255
- >${w("Top", { desc: "Ranking direction: keep the highest values" })}</luzmo-action-button
256
- >
257
- <luzmo-action-button value="bottom" emphasized
258
- >${w("Bottom", { desc: "Ranking direction: keep the lowest values" })}</luzmo-action-button
259
- >
260
- </luzmo-action-group>
261
-
262
- <luzmo-number-field
263
- class="ranking-number"
264
- size=${this.size}
265
- hide-stepper
266
- min="1"
267
- max="100"
268
- step="1"
269
- .value=${t.number}
270
- @change=${(t) => this._handleNumberChange(e, t)}
271
- @input=${(t) => this._handleNumberChange(e, t)}
272
- ></luzmo-number-field>
273
- </div>
274
-
275
- <div class="ranking-row">
276
- <luzmo-action-group
277
- size=${this.size}
278
- compact
279
- selects="single"
280
- .selected=${[n.by]}
281
- @change=${(t) => this._handleSortByChange(e, t)}
282
- >
283
- <luzmo-action-button value="measure" emphasized>123</luzmo-action-button>
284
- <luzmo-action-button value="category" emphasized>ABC</luzmo-action-button>
285
- </luzmo-action-group>
286
-
287
- <luzmo-action-group
288
- size=${this.size}
289
- compact
290
- selects="single"
291
- .selected=${[n.direction]}
292
- @change=${(t) => this._handleSortDirectionChange(e, t)}
293
- >
294
- <luzmo-action-button
295
- value="desc"
296
- emphasized
297
- label=${w("Sort descending", { desc: "Sort chart values in descending order" })}
298
- >
299
- <luzmo-icon slot="icon" size="xs" .icon=${h}></luzmo-icon>
300
- </luzmo-action-button>
301
- <luzmo-action-button
302
- value="asc"
303
- emphasized
304
- label=${w("Sort ascending", { desc: "Sort chart values in ascending order" })}
305
- >
306
- <luzmo-icon slot="icon" size="xs" class="icon-flipped" .icon=${h}></luzmo-icon>
307
- </luzmo-action-button>
308
- </luzmo-action-group>
309
- </div>
310
- </div>
311
- </luzmo-popover>
312
- </luzmo-overlay>
313
- `;
314
- }
315
- _handleDirectionChange(e, t) {
316
- t.stopPropagation();
317
- let n = t.target?.selected;
318
- n?.length && this._emitRankAndSort({
319
- ...this._currentRanking(e),
320
- direction: n[0]
321
- }, this._currentSort(e));
322
- }
323
- _handleNumberChange(e, t) {
324
- t.stopPropagation();
325
- let n = t.target?.value, r = typeof n == "number" ? n : Number.parseInt(String(n), 10);
326
- !Number.isNaN(r) && r >= 1 && this._emitRankAndSort({
327
- ...this._currentRanking(e),
328
- number: r
329
- }, this._currentSort(e));
330
- }
331
- _handleSortByChange(e, t) {
332
- t.stopPropagation();
333
- let n = t.target?.selected;
334
- n?.length && this._emitRankAndSort(this._currentRanking(e), {
335
- ...this._currentSort(e),
336
- by: n[0]
337
- });
338
- }
339
- _handleSortDirectionChange(e, t) {
340
- t.stopPropagation();
341
- let n = t.target?.selected;
342
- n?.length && this._emitRankAndSort(this._currentRanking(e), {
343
- ...this._currentSort(e),
344
- direction: n[0]
345
- });
346
- }
347
- _renderAddToDashboard() {
348
- return this.addToDashboard ? y`
349
- <luzmo-add-to-dashboard
350
- size=${this.size}
351
- language=${this.language}
352
- .chart=${this.chart}
353
- .dashboardActions=${this.dashboardActions}
354
- .authKey=${this.authKey}
355
- .authToken=${this.authToken}
356
- .apiUrl=${this.apiUrl}
357
- ></luzmo-add-to-dashboard>
358
- ` : b;
359
- }
360
- _renderActions() {
361
- return this.hideActions ? y`
362
- <div class="chart-actions-bar">
363
- <div class="chart-actions-primary"></div>
364
- <slot name="chart-actions-extra"></slot>
365
- ${this._renderAddToDashboard()}
366
- </div>
367
- ` : y`
368
- <div class="chart-actions-bar">
369
- <div class="chart-actions-primary">
370
- ${this._chartActions.map((e) => e.type === "optionDropdown" ? this._renderOptionDropdown(e) : this._renderRankingPicker(e))}
371
- </div>
372
- <slot name="chart-actions-extra"></slot>
373
- ${this._renderAddToDashboard()}
374
- </div>
375
- `;
376
- }
377
- _renderChart() {
378
- if (!this.chart) return b;
379
- let e = u(this.chart);
380
- return y`
381
- <div class="chart-container" part="chart-container">
382
- <luzmo-embed-viz-item
383
- .type=${e.type}
384
- .options=${e.options}
385
- .slots=${e.slots}
386
- .filters=${e.filters ?? []}
387
- .authKey=${this.authKey}
388
- .authToken=${this.authToken}
389
- .apiHost=${this.apiUrl}
390
- .appServer=${this.appServer}
391
- .language=${this._effectiveContentLanguage}
392
- .canFilter=${this.canFilter ?? !1}
393
- ></luzmo-embed-viz-item>
394
- </div>
395
- `;
396
- }
397
- _renderFeedback() {
398
- let e = !this.hideFeedback && !!this.messageId, t = this._canShowConfigPanel, n = w("Loading", { desc: "Loading spinner label" });
399
- return !e && !t ? b : y`
400
- <div class="feedback-row">
401
- ${e ? y`
402
- <luzmo-action-group quiet size=${this.size}>
403
- <luzmo-action-button
404
- class="rating-btn-positive"
405
- value="positive"
406
- quiet
407
- label=${w("Good response", { desc: "Accessible label for the positive feedback button" })}
408
- ?selected=${this._rating === 1}
409
- @click=${() => this._toggleRating(!0)}
410
- >
411
- <luzmo-icon slot="icon" size="s" .icon=${v}></luzmo-icon>
412
- </luzmo-action-button>
413
- <luzmo-action-button
414
- class="rating-btn-negative"
415
- value="negative"
416
- quiet
417
- label=${w("Bad response", { desc: "Accessible label for the negative feedback button" })}
418
- ?selected=${this._rating === -1}
419
- @click=${() => this._toggleRating(!1)}
420
- >
421
- <luzmo-icon slot="icon" size="s" .icon=${_}></luzmo-icon>
422
- </luzmo-action-button>
423
- </luzmo-action-group>
424
- ` : b}
425
- ${t ? y`
426
- <luzmo-action-button
427
- class="config-toggle"
428
- size=${this.size}
429
- quiet
430
- ?selected=${this._configPanelOpen}
431
- aria-expanded=${this._configPanelOpen}
432
- aria-label=${this._configPanelPending ? n : w("Configure chart", { desc: "Accessible label for the chart config toggle" })}
433
- @click=${() => this._toggleConfigPanel()}
434
- >
435
- ${this._configPanelPending ? y`<luzmo-progress-circle slot="icon" size="s" indeterminate .label=${n}></luzmo-progress-circle>` : y`<luzmo-icon slot="icon" size="s" .icon=${g}></luzmo-icon>`}
436
- </luzmo-action-button>
437
- <span class="sr-only" role="status" aria-live="polite">${this._configPanelPending ? n : ""}</span>
438
- <span class="sr-only" role="alert">${this._configPanelLoadFailed ? w("Failed to load the chart configuration. Please try again.", { desc: "Error message when the chart config panel fails to load" }) : ""}</span>
439
- ` : b}
440
- </div>
441
- `;
442
- }
443
- _toggleRating(e) {
444
- let t = e ? 1 : -1, n = this._rating === t ? 0 : t;
445
- this._dispatch("luzmo-feedback-changed", {
446
- rating: n,
447
- comment: this.feedback?.comment
448
- });
449
- }
450
- _renderConfigPanel() {
451
- if (!this.chart || this.hideConfigPanel || !this._configPanelOpen) return b;
452
- let e = this.chart, t = d(e.slots ?? []), n = s(t), r = e.options.theme ?? M;
453
- return y`
454
- <div class="config-panel" part="config-panel">
455
- <luzmo-tabs selected="data" size=${this.size}>
456
- <luzmo-tab value="data">${w("Data", { desc: "Label for the data section" })}</luzmo-tab>
457
- <luzmo-tab value="options">${w("Options", { desc: "Label for the options section" })}</luzmo-tab>
458
-
459
- <luzmo-tab-panel value="data">
460
- <div class="edit-grid">
461
- <div class="edit-column">
462
- <luzmo-item-slot-picker-panel
463
- size=${this.size}
464
- slot-menu-placement="bottom-end"
465
- .itemType=${e.type}
466
- .slotsContents=${t}
467
- .datasetIds=${n}
468
- .authKey=${this.authKey}
469
- .authToken=${this.authToken}
470
- .apiUrl=${this.apiUrl}
471
- .language=${this.language}
472
- .contentLanguage=${this._effectiveContentLanguage}
473
- @luzmo-slots-contents-changed=${this._handleSlotsChanged}
474
- ></luzmo-item-slot-picker-panel>
475
- </div>
476
- <div class="edit-column edit-column-filters">
477
- <luzmo-field-label size=${this.size}
478
- >${w("Filters", { desc: "Label for the filters section" })}</luzmo-field-label
479
- >
480
- <luzmo-filters
481
- size=${this.size}
482
- .datasetIds=${n}
483
- .filters=${e.filters ?? []}
484
- .authKey=${this.authKey}
485
- .authToken=${this.authToken}
486
- .apiUrl=${this.apiUrl}
487
- .language=${this.language}
488
- .contentLanguage=${this._effectiveContentLanguage}
489
- @luzmo-filters-changed=${this._handleFiltersChanged}
490
- ></luzmo-filters>
491
- </div>
492
- </div>
493
- </luzmo-tab-panel>
494
-
495
- <luzmo-tab-panel value="options">
496
- <luzmo-item-option-panel
497
- size=${this.size}
498
- .itemType=${e.type}
499
- .options=${e.options || {}}
500
- .slots=${t}
501
- .theme=${r}
502
- .authKey=${this.authKey}
503
- .authToken=${this.authToken}
504
- .apiUrl=${this.apiUrl}
505
- .language=${this.language}
506
- ?live-interactions=${this.liveInteractions}
507
- @luzmo-options-changed=${this._handleOptionsChanged}
508
- @luzmo-option-interaction-start=${this._handleInteractionStart}
509
- @luzmo-option-interaction-end=${this._handleInteractionClosed}
510
- @luzmo-option-interaction-cancel=${this._handleInteractionClosed}
511
- ></luzmo-item-option-panel>
512
- </luzmo-tab-panel>
513
- </luzmo-tabs>
514
- </div>
515
- `;
516
- }
517
- _dispatchInteraction(e, { chart: t, generation: n }) {
518
- e.stopPropagation(), this._dispatch(e.type, {
519
- ...e.detail,
520
- chart: t,
521
- generation: n
522
- });
523
- }
524
- render() {
525
- return this.chart ? y`
526
- <div class="answer" part="container">
527
- ${this._renderActions()} ${this._renderChart()} ${this._renderFeedback()} ${this._renderConfigPanel()}
528
- </div>
529
- ` : y`
530
- <div
531
- class="answer"
532
- part="container"
533
- ></div>
534
- `;
535
- }
536
- };
537
- // src/components/interactive-viz-item/index.ts
538
- r([S({ type: Object })], P.prototype, "chart", void 0), r([S({ type: Object })], P.prototype, "feedback", void 0), r([S({
539
- type: String,
540
- attribute: "message-id"
541
- })], P.prototype, "messageId", void 0), r([S({
542
- type: String,
543
- attribute: "auth-key"
544
- })], P.prototype, "authKey", void 0), r([S({
545
- type: String,
546
- attribute: "auth-token"
547
- })], P.prototype, "authToken", void 0), r([S({
548
- type: String,
549
- attribute: "api-url"
550
- })], P.prototype, "apiUrl", void 0), r([S({
551
- type: String,
552
- attribute: "app-server"
553
- })], P.prototype, "appServer", void 0), r([S({
554
- type: String,
555
- attribute: "content-language"
556
- })], P.prototype, "contentLanguage", void 0), r([S({
557
- type: Boolean,
558
- attribute: "hide-actions",
559
- reflect: !0
560
- })], P.prototype, "hideActions", void 0), r([S({
561
- type: Boolean,
562
- attribute: "hide-feedback",
563
- reflect: !0
564
- })], P.prototype, "hideFeedback", void 0), r([S({
565
- type: Boolean,
566
- attribute: "hide-config-panel",
567
- reflect: !0
568
- })], P.prototype, "hideConfigPanel", void 0), r([S({
569
- type: Boolean,
570
- attribute: "add-to-dashboard",
571
- reflect: !0
572
- })], P.prototype, "addToDashboard", void 0), r([S({ attribute: !1 })], P.prototype, "dashboardActions", void 0), r([S({
573
- type: Boolean,
574
- reflect: !0
575
- })], P.prototype, "controlled", void 0), r([S({
576
- attribute: "can-filter",
577
- converter: { fromAttribute: (e) => e === null ? void 0 : "all" }
578
- })], P.prototype, "canFilter", void 0), r([S({
579
- type: Boolean,
580
- reflect: !0,
581
- attribute: "live-interactions"
582
- })], P.prototype, "liveInteractions", void 0), r([C()], P.prototype, "_configPanelOpen", void 0), r([C()], P.prototype, "_configPanelPending", void 0), r([C()], P.prototype, "_configPanelLoadFailed", void 0), customElements.get("luzmo-interactive-viz-item") || customElements.define("luzmo-interactive-viz-item", P);
583
- export { P as t };