@luzmo/analytics-components-kit 1.0.8 → 1.0.9-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (702) hide show
  1. package/README.md +6 -4
  2. package/components/ad-hoc-slot-content-BwcFfXCV.cjs +20 -0
  3. package/components/ad-hoc-slot-content-hSlT62VS.js +29 -0
  4. package/components/ai-chat/ai-chat-events.d.ts +139 -0
  5. package/components/ai-chat/ai-chat-request.d.ts +25 -0
  6. package/components/ai-chat/ai-chat.d.ts +347 -0
  7. package/components/ai-chat/ai-prompt-types.d.ts +133 -0
  8. package/components/ai-chat/empty-state/ai-chat-empty-state.d.ts +46 -0
  9. package/components/ai-chat/empty-state/index.d.ts +8 -0
  10. package/components/ai-chat/empty-state/types.d.ts +14 -0
  11. package/components/ai-chat/helpers/agent-config.d.ts +12 -0
  12. package/components/ai-chat/helpers/elicitation-template.d.ts +18 -0
  13. package/components/ai-chat/index.cjs +20 -0
  14. package/components/ai-chat/index.d.ts +24 -0
  15. package/components/ai-chat/index.js +29 -0
  16. package/components/ai-chat/session/ai-chat-session-controller.d.ts +60 -0
  17. package/components/ai-chat/session/ai-chat-session-types.d.ts +119 -0
  18. package/components/ai-chat/session/ai-chat-session.d.ts +119 -0
  19. package/components/ai-chat/session/index.d.ts +2 -0
  20. package/components/ai-chat/stream/chunk-extractors.d.ts +29 -0
  21. package/components/ai-chat/stream/index.d.ts +53 -0
  22. package/components/ai-chat/stream/progress.d.ts +3 -0
  23. package/components/ai-chat/stream/registry.d.ts +6 -0
  24. package/components/ai-chat/stream/stream-processor.d.ts +2 -0
  25. package/components/ai-chat/stream/transport.d.ts +26 -0
  26. package/components/ai-chat/stream/types.d.ts +59 -0
  27. package/components/ai-chat/types.d.ts +24 -0
  28. package/components/ai-chat-1OlRpimu.cjs +337 -0
  29. package/components/ai-chat-PesGGOLP.js +4350 -0
  30. package/components/ai-interaction-textarea/ai-interaction-textarea.d.ts +232 -0
  31. package/components/ai-interaction-textarea/index.cjs +20 -0
  32. package/components/ai-interaction-textarea/index.d.ts +10 -0
  33. package/components/ai-interaction-textarea/index.js +28 -0
  34. package/components/ai-interaction-textarea/types.d.ts +12 -0
  35. package/components/ai-interaction-textarea-BXKG2elT.js +820 -0
  36. package/components/ai-interaction-textarea-CmFGJzbb.cjs +99 -0
  37. package/components/{area-chart-options.config-B94ERc30.js → area-chart-options.config-DJnPr93H.js} +1 -1
  38. package/components/{area-chart-positioning.config-Cbeon6-x.cjs → area-chart-positioning.config-C37nmNfP.cjs} +1 -1
  39. package/components/{area-chart-positioning.config-BJK4Q4NL.js → area-chart-positioning.config-CF8Z7PuX.js} +1 -1
  40. package/components/{area-chart-slots.config-DdPO34_g.js → area-chart-slots.config-ClE-gYVY.js} +1 -1
  41. package/components/{bar-chart-options.config-B1C3t6uk.js → bar-chart-options.config-D1x5WPbL.js} +1 -1
  42. package/components/{bar-chart-positioning.config-BnhZQUtb.cjs → bar-chart-positioning.config-C4ii41mE.cjs} +1 -1
  43. package/components/{bar-chart-positioning.config-B4UuSMIW.js → bar-chart-positioning.config-vuRQZsYr.js} +1 -1
  44. package/components/{bar-chart-slots.config-BnbZRLIr.js → bar-chart-slots.config-rMFwFprg.js} +1 -1
  45. package/components/{base-IE9Qxmub.js → base-8L8Jt2vi.js} +3 -2
  46. package/components/base-K-bf6_7X.cjs +20 -0
  47. package/components/{box-plot-options.config-sBfVzPTw.js → box-plot-options.config-CooBIc6N.js} +1 -1
  48. package/components/{box-plot-positioning.config-DsldCFWm.cjs → box-plot-positioning.config-D2LpbgQ_.cjs} +1 -1
  49. package/components/{box-plot-positioning.config-CYk5koLu.js → box-plot-positioning.config-DMIsI9yU.js} +1 -1
  50. package/components/{box-plot-slots.config-D6F2R2dw.js → box-plot-slots.config-DS2UIfRF.js} +1 -1
  51. package/components/{bubble-chart-options.config-DKeBF5A0.js → bubble-chart-options.config-B6aLA_1d.js} +1 -1
  52. package/components/{bubble-chart-positioning.config-BV-T_2cy.cjs → bubble-chart-positioning.config-Btak-zwN.cjs} +1 -1
  53. package/components/{bubble-chart-positioning.config-BSDmuPwq.js → bubble-chart-positioning.config-jYu0Q0Mc.js} +1 -1
  54. package/components/{bubble-chart-slots.config-BJdtdpS0.js → bubble-chart-slots.config-2qy2RqaU.js} +1 -1
  55. package/components/{bullet-chart-options.config-DdTBWTAF.js → bullet-chart-options.config-CBmbmhzI.js} +1 -1
  56. package/components/{bullet-chart-positioning.config-B3GeLs8o.js → bullet-chart-positioning.config-BWHfPPyA.js} +1 -1
  57. package/components/{bullet-chart-positioning.config-BoqQq4g_.cjs → bullet-chart-positioning.config-CwoRVgNS.cjs} +1 -1
  58. package/components/{bullet-chart-slots.config-NeUTKgYI.js → bullet-chart-slots.config-BaMmwIH0.js} +1 -1
  59. package/components/{choropleth-map-options.config-nOE0NWaD.js → choropleth-map-options.config-DWWydGJ3.js} +1 -1
  60. package/components/{choropleth-map-positioning.config-C_I3wf8H.cjs → choropleth-map-positioning.config-DttV0Dk_.cjs} +1 -1
  61. package/components/{choropleth-map-positioning.config-6OT0sZa5.js → choropleth-map-positioning.config-KtxcLW7E.js} +1 -1
  62. package/components/{choropleth-map-slots.config-BbBwTeuw.js → choropleth-map-slots.config-DqOi1kCn.js} +1 -1
  63. package/components/{circle-pack-chart-options.config-CgE8vGP9.js → circle-pack-chart-options.config-D2RCikyA.js} +1 -1
  64. package/components/{circle-pack-chart-positioning.config-D7Oke8BW.cjs → circle-pack-chart-positioning.config-N-rZvQjR.cjs} +1 -1
  65. package/components/{circle-pack-chart-positioning.config-BuuhKB85.js → circle-pack-chart-positioning.config-QBO-pwDr.js} +1 -1
  66. package/components/{circle-pack-chart-slots.config-CJFjalBn.js → circle-pack-chart-slots.config-B7_1p86m.js} +1 -1
  67. package/components/{circular-gauge-options.config-DtNYelhq.js → circular-gauge-options.config-syWQJHKT.js} +1 -1
  68. package/components/{circular-gauge-positioning.config-B_IJzIBn.cjs → circular-gauge-positioning.config-Cf1zuLXa.cjs} +1 -1
  69. package/components/{circular-gauge-positioning.config-DlWvKl0e.js → circular-gauge-positioning.config-DKGmEpFj.js} +1 -1
  70. package/components/{circular-gauge-slots.config-DAKsa5Hq.js → circular-gauge-slots.config-BxjCP1ao.js} +1 -1
  71. package/components/{column-chart-options.config-C2GGiHOI.js → column-chart-options.config-B2LIl9lL.js} +1 -1
  72. package/components/{column-chart-positioning.config-DngsP5So.cjs → column-chart-positioning.config-DcErS56C.cjs} +1 -1
  73. package/components/{column-chart-positioning.config-BLacEiY5.js → column-chart-positioning.config-LkQSNtSH.js} +1 -1
  74. package/components/{column-chart-slots.config-Bpr-WaCi.js → column-chart-slots.config-D6MBTcj4.js} +1 -1
  75. package/components/{combination-chart-options.config-LddX4naq.js → combination-chart-options.config-0ATFph8S.js} +1 -1
  76. package/components/{combination-chart-positioning.config-DxnmzV6O.js → combination-chart-positioning.config-7iAEpO7h.js} +1 -1
  77. package/components/{combination-chart-positioning.config-BVV0Bq-d.cjs → combination-chart-positioning.config-Dzi93oAp.cjs} +1 -1
  78. package/components/{combination-chart-slots.config-u-QLoQQ-.js → combination-chart-slots.config-dYT9lz8M.js} +1 -1
  79. package/components/{conditional-number-options.config-qdX9T4zu.js → conditional-number-options.config-Bv2xONtI.js} +1 -1
  80. package/components/{conditional-number-positioning.config-YEo_yFBu.js → conditional-number-positioning.config-Bse6AKPP.js} +1 -1
  81. package/components/{conditional-number-positioning.config-DfitbPT6.cjs → conditional-number-positioning.config-CTy0zLXu.cjs} +1 -1
  82. package/components/{conditional-number-slots.config-CiLUXRSe.js → conditional-number-slots.config-DtYkqtN8.js} +1 -1
  83. package/components/convert-datasets-to-data-fields-B13rl1an.cjs +20 -0
  84. package/components/convert-datasets-to-data-fields-PmQzeVLG.js +68 -0
  85. package/components/create-lazy-loader-BO_oTDF5.js +31 -0
  86. package/components/create-lazy-loader-DYPgQh0L.cjs +20 -0
  87. package/components/data-field/index.cjs +1 -1
  88. package/components/data-field/index.d.ts +1 -0
  89. package/components/data-field/index.js +1 -1
  90. package/components/data-field-CSm9APdz.js +121 -0
  91. package/components/data-field-D2y4cv9j.cjs +54 -0
  92. package/components/data-field-level/data-field-level.d.ts +40 -0
  93. package/components/data-field-level/helpers/generate-preview.d.ts +9 -0
  94. package/components/data-field-level/index.cjs +20 -0
  95. package/components/data-field-level/index.d.ts +8 -0
  96. package/components/data-field-level/index.js +28 -0
  97. package/components/{data-field-yTJb-R63.js → data-field-level-B0aj8c5M.js} +48 -142
  98. package/components/data-field-level-Llx0Y9m-.cjs +55 -0
  99. package/components/data-field-panel/index.cjs +1 -1
  100. package/components/data-field-panel/index.d.ts +1 -0
  101. package/components/data-field-panel/index.js +1 -1
  102. package/components/{data-field-panel-BWBr1Fog.js → data-field-panel-DpBWJnes.js} +6 -5
  103. package/components/data-field-panel-Dv60lRUC.cjs +87 -0
  104. package/components/data-fields-select/data-fields-select.d.ts +137 -0
  105. package/components/data-fields-select/index.cjs +20 -0
  106. package/components/data-fields-select/index.d.ts +9 -0
  107. package/components/data-fields-select/index.js +28 -0
  108. package/components/data-fields-select/types.d.ts +4 -0
  109. package/components/{data-fields-select-Bb1HXwlO.js → data-fields-select-69TDpIG_.js} +17 -7
  110. package/components/data-fields-select-BHa8THub.cjs +43 -0
  111. package/components/dataset-icon/dataset-icon.d.ts +45 -0
  112. package/components/dataset-icon/index.cjs +20 -0
  113. package/components/dataset-icon/index.d.ts +8 -0
  114. package/components/dataset-icon/index.js +28 -0
  115. package/components/dataset-icon/types.d.ts +11 -0
  116. package/components/dataset-icon-BAV0S4sZ.cjs +64 -0
  117. package/components/dataset-icon-CWT5Ju8w.js +125 -0
  118. package/components/dataset-selector-list/dataset-selector-list.d.ts +106 -0
  119. package/components/dataset-selector-list/index.cjs +20 -0
  120. package/components/dataset-selector-list/index.d.ts +8 -0
  121. package/components/dataset-selector-list/index.js +28 -0
  122. package/components/dataset-selector-list-D5lBv2sD.cjs +75 -0
  123. package/components/dataset-selector-list-DTMXvqfO.js +323 -0
  124. package/components/dataset-selector-row/dataset-selector-row.d.ts +135 -0
  125. package/components/dataset-selector-row/index.cjs +20 -0
  126. package/components/dataset-selector-row/index.d.ts +9 -0
  127. package/components/dataset-selector-row/index.js +28 -0
  128. package/components/dataset-selector-row-gHWsZlrC.cjs +102 -0
  129. package/components/dataset-selector-row-kiHtzZcP.js +427 -0
  130. package/components/{date-comparison-filter-options.config-BSzzAJPM.js → date-comparison-filter-options.config-DgLx-m3L.js} +1 -1
  131. package/components/{date-comparison-filter-slots.config-Cvze969w.js → date-comparison-filter-slots.config-BKZ13uzB.js} +1 -1
  132. package/components/{date-filter-options.config-C6VvDjd8.js → date-filter-options.config-Cbiy0QKd.js} +1 -1
  133. package/components/{date-filter-slots.config-Y8hmQh0S.js → date-filter-slots.config-SzWky1y7.js} +1 -1
  134. package/components/{de-C5CMIy08.js → de-BhKtDR6p.js} +34 -0
  135. package/components/de-DXFLsh4N.cjs +20 -0
  136. package/components/decompose-numeric-format-DGJua3rU.cjs +20 -0
  137. package/components/decompose-numeric-format-DS0j2wa1.js +36 -0
  138. package/components/decorate-DCJt-2rt.cjs +20 -0
  139. package/components/{localized-mixin-DhiGdPMj.js → decorate-DyMgX_Uh.js} +2 -26
  140. package/components/default-acceptable-data-field-types-DFOFWWnT.js +53 -0
  141. package/components/default-acceptable-data-field-types-fPsz64ka.cjs +20 -0
  142. package/components/display-settings/display-settings.d.ts +117 -0
  143. package/components/display-settings/index.cjs +20 -0
  144. package/components/display-settings/index.d.ts +8 -0
  145. package/components/display-settings/index.js +28 -0
  146. package/components/display-settings/types.d.ts +9 -0
  147. package/components/display-settings-DKuvd62j.js +315 -0
  148. package/components/display-settings-DPqTRJ7E.cjs +142 -0
  149. package/components/display-settings-binning/display-settings-binning.d.ts +32 -0
  150. package/components/display-settings-binning/index.cjs +20 -0
  151. package/components/display-settings-binning/index.d.ts +8 -0
  152. package/components/display-settings-binning/index.js +28 -0
  153. package/components/{display-settings-binning-CaE87u3h.js → display-settings-binning-BkCNSkgf.js} +17 -19
  154. package/components/{display-settings-binning-CjvB12ds.cjs → display-settings-binning-DZKo_tBm.cjs} +2 -2
  155. package/components/display-settings-datetime/display-settings-datetime.d.ts +86 -0
  156. package/components/display-settings-datetime/index.cjs +20 -0
  157. package/components/display-settings-datetime/index.d.ts +8 -0
  158. package/components/display-settings-datetime/index.js +28 -0
  159. package/components/{display-settings-datetime-5rq55OAn.js → display-settings-datetime-BTgriFcv.js} +69 -71
  160. package/components/display-settings-datetime-DD7Oh-2T.cjs +217 -0
  161. package/components/display-settings-grand-totals/display-settings-grand-totals.d.ts +29 -0
  162. package/components/display-settings-grand-totals/index.cjs +20 -0
  163. package/components/display-settings-grand-totals/index.d.ts +8 -0
  164. package/components/display-settings-grand-totals/index.js +28 -0
  165. package/components/display-settings-grand-totals-BsIZg67h.cjs +44 -0
  166. package/components/{display-settings-grand-totals-DnKvI34n.js → display-settings-grand-totals-DH7AoyQY.js} +17 -19
  167. package/components/display-settings-numeric/display-settings-numeric.d.ts +82 -0
  168. package/components/display-settings-numeric/helpers/constants.d.ts +19 -0
  169. package/components/display-settings-numeric/index.cjs +20 -0
  170. package/components/display-settings-numeric/index.d.ts +8 -0
  171. package/components/display-settings-numeric/index.js +28 -0
  172. package/components/{display-settings-numeric-B8MCRz-V.js → display-settings-numeric-CkFpOoWU.js} +79 -81
  173. package/components/display-settings-numeric-CsmrnEp2.cjs +190 -0
  174. package/components/display-settings-period-over-period/display-settings-period-over-period.d.ts +76 -0
  175. package/components/display-settings-period-over-period/helpers/constants.d.ts +44 -0
  176. package/components/display-settings-period-over-period/index.cjs +20 -0
  177. package/components/display-settings-period-over-period/index.d.ts +8 -0
  178. package/components/display-settings-period-over-period/index.js +28 -0
  179. package/components/{display-settings-period-over-period-W3dPK8LR.js → display-settings-period-over-period-CdI5wuL_.js} +85 -86
  180. package/components/display-settings-period-over-period-Co37HcSm.cjs +227 -0
  181. package/components/{donut-chart-options.config-CPHgS1Wi.js → donut-chart-options.config-C8wpZzyJ.js} +1 -1
  182. package/components/{donut-chart-positioning.config-QOZXaJmt.cjs → donut-chart-positioning.config-BThtaJEt.cjs} +1 -1
  183. package/components/{donut-chart-positioning.config-fGckMun2.js → donut-chart-positioning.config-D2uG_Irk.js} +1 -1
  184. package/components/{donut-chart-slots.config-DilGk7ju.js → donut-chart-slots.config-fGqtoKZi.js} +1 -1
  185. package/components/{dropdown-filter-options.config-DFJKns3l.js → dropdown-filter-options.config-DkiapYtc.js} +1 -1
  186. package/components/{dropdown-filter-slots.config-7heZtoEY.js → dropdown-filter-slots.config-DPcT6v-9.js} +1 -1
  187. package/components/{en-DdS5q1ZT.js → en-CcLhGxIh.js} +1 -1
  188. package/components/{en-GB-Cn0xDC0K.js → en-GB-DzkdeUQh.js} +1 -1
  189. package/components/en-GB-uxY5qmIM.cjs +20 -0
  190. package/components/{en-US-DdS5q1ZT.js → en-US-CcLhGxIh.js} +1 -1
  191. package/components/{en-CSPDwq2y.cjs → en-US-q_Ruzags.cjs} +1 -1
  192. package/components/{en-US-CSPDwq2y.cjs → en-q_Ruzags.cjs} +1 -1
  193. package/components/es-DK-49nGv.cjs +20 -0
  194. package/components/{es-BCur0-77.js → es-DUENN-m1.js} +34 -0
  195. package/components/{evolution-number-options.config-DT7iGQA8.js → evolution-number-options.config-Ca9ABNVM.js} +1 -1
  196. package/components/{evolution-number-positioning.config-CVIysE4H.js → evolution-number-positioning.config-BtjobZqK.js} +1 -1
  197. package/components/{evolution-number-positioning.config-B7lBArog.cjs → evolution-number-positioning.config-DtYiv9oB.cjs} +1 -1
  198. package/components/{evolution-number-slots.config-noZzIHkT.js → evolution-number-slots.config-CKawNqUS.js} +1 -1
  199. package/components/filter-expression-picker/filter-expression-picker.d.ts +77 -0
  200. package/components/filter-expression-picker/index.cjs +20 -0
  201. package/components/filter-expression-picker/index.d.ts +7 -0
  202. package/components/filter-expression-picker/index.js +28 -0
  203. package/components/filter-expression-picker-C4kE_Thd.js +433 -0
  204. package/components/filter-expression-picker-CU-OfSmI.cjs +40 -0
  205. package/components/filter-item/filter-item.d.ts +142 -0
  206. package/components/filter-item/index.cjs +20 -0
  207. package/components/filter-item/index.d.ts +8 -0
  208. package/components/filter-item/index.js +28 -0
  209. package/components/filter-item-Be6Z7NMz.js +792 -0
  210. package/components/filter-item-CxPrwF-R.cjs +111 -0
  211. package/components/filter-parameter-picker/filter-parameter-picker.d.ts +91 -0
  212. package/components/filter-parameter-picker/filter-parameter-picker.helpers.d.ts +8 -0
  213. package/components/filter-parameter-picker/index.cjs +20 -0
  214. package/components/filter-parameter-picker/index.d.ts +9 -0
  215. package/components/filter-parameter-picker/index.js +28 -0
  216. package/components/filter-parameter-picker/types.d.ts +4 -0
  217. package/components/filter-parameter-picker-Ba8bvoPZ.js +371 -0
  218. package/components/filter-parameter-picker-BtJLCUbT.cjs +124 -0
  219. package/components/filter-value-picker/filter-value-picker.d.ts +72 -0
  220. package/components/filter-value-picker/index.cjs +20 -0
  221. package/components/filter-value-picker/index.d.ts +7 -0
  222. package/components/filter-value-picker/index.js +28 -0
  223. package/components/filter-value-picker-DD206JZl.js +169 -0
  224. package/components/filter-value-picker-Dpua1vcJ.cjs +69 -0
  225. package/components/filter-value-picker-datetime/filter-value-picker-datetime.d.ts +51 -0
  226. package/components/filter-value-picker-datetime/index.cjs +20 -0
  227. package/components/filter-value-picker-datetime/index.d.ts +7 -0
  228. package/components/filter-value-picker-datetime/index.js +28 -0
  229. package/components/filter-value-picker-datetime-Bj0YaPtB.js +159 -0
  230. package/components/filter-value-picker-datetime-DWgI83nJ.cjs +51 -0
  231. package/components/filter-value-picker-hierarchy/filter-value-picker-hierarchy.d.ts +105 -0
  232. package/components/filter-value-picker-hierarchy/index.cjs +20 -0
  233. package/components/filter-value-picker-hierarchy/index.d.ts +7 -0
  234. package/components/filter-value-picker-hierarchy/index.js +28 -0
  235. package/components/filter-value-picker-hierarchy-BEoqkQq0.cjs +54 -0
  236. package/components/filter-value-picker-hierarchy-ZMThNJYm.js +315 -0
  237. package/components/filter-value-picker-numeric/filter-value-picker-numeric.d.ts +89 -0
  238. package/components/filter-value-picker-numeric/index.cjs +20 -0
  239. package/components/filter-value-picker-numeric/index.d.ts +7 -0
  240. package/components/filter-value-picker-numeric/index.js +28 -0
  241. package/components/filter-value-picker-numeric-1Vxp_Vam.cjs +54 -0
  242. package/components/filter-value-picker-numeric-CVaDogFQ.js +236 -0
  243. package/components/filters/filters.d.ts +62 -2
  244. package/components/filters/index.cjs +1 -1
  245. package/components/filters/index.d.ts +2 -1
  246. package/components/filters/index.js +2 -2
  247. package/components/filters/types.d.ts +2 -0
  248. package/components/filters-Cnm0Kwk3.js +926 -0
  249. package/components/filters-Dtbt99BP.cjs +199 -0
  250. package/components/formatter-BeXmurVe.cjs +20 -0
  251. package/components/{period-over-period-condition.const-IOVIrgKJ.js → formatter-Cq5dFCyU.js} +44 -234
  252. package/components/formula/index.cjs +1 -1
  253. package/components/formula/index.js +1 -1
  254. package/components/{formula-CdAkO1za.js → formula-BE9bipho.js} +15 -14
  255. package/components/formula-DGMnKmnR.cjs +45 -0
  256. package/components/formula-codemirror/formula-codemirror.d.ts +79 -0
  257. package/components/formula-codemirror/index.d.ts +7 -0
  258. package/components/formula-codemirror/pills/formula-aggregation/formula-aggregation.d.ts +125 -0
  259. package/components/formula-codemirror/pills/formula-aggregation/index.d.ts +7 -0
  260. package/components/formula-codemirror/pills/formula-empty-argument-pill/formula-empty-argument-pill.d.ts +28 -0
  261. package/components/formula-codemirror/pills/formula-empty-argument-pill/index.d.ts +7 -0
  262. package/components/formula-codemirror/pills/formula-include-exclude-panel.d.ts +38 -0
  263. package/components/formula-codemirror-B14vsZXJ.cjs +215 -0
  264. package/components/{formula-codemirror-jVC8mjQ3.js → formula-codemirror-xfm0QtJN.js} +22 -20
  265. package/components/formula-display-store-8hohve9v.cjs +20 -0
  266. package/components/{formula-display-store-CLAt_fik.js → formula-display-store-JAaWuYNB.js} +239 -274
  267. package/components/formula-draggable-field/formula-draggable-field.d.ts +53 -0
  268. package/components/formula-draggable-field/index.d.ts +8 -0
  269. package/components/formula-draggable-field/types.d.ts +24 -0
  270. package/components/formula-editor/index.cjs +1 -1
  271. package/components/formula-editor/index.d.ts +1 -0
  272. package/components/formula-editor/index.js +4 -3
  273. package/components/formula-editor-CkW-JfyT.cjs +224 -0
  274. package/components/{formula-editor-Bd9F-xdZ.js → formula-editor-DN87mT8q.js} +147 -352
  275. package/components/formula-field/formula-field.d.ts +20 -0
  276. package/components/formula-field/index.cjs +20 -0
  277. package/components/formula-field/index.d.ts +7 -0
  278. package/components/formula-field/index.js +28 -0
  279. package/components/formula-field-B1EMJOfK.js +40 -0
  280. package/components/formula-field-CQYFSBHL.cjs +20 -0
  281. package/components/formula-input-base-BCQXmd1P.cjs +49 -0
  282. package/components/formula-input-base-HL0Fg74x.js +236 -0
  283. package/components/{fr-BnECl1nx.js → fr-CePmGBUH.js} +34 -0
  284. package/components/fr-uE3fb3kc.cjs +20 -0
  285. package/components/{funnel-chart-options.config-D21WdHBI.js → funnel-chart-options.config-CygQsQVD.js} +1 -1
  286. package/components/{funnel-chart-positioning.config-zEqgz9Wz.cjs → funnel-chart-positioning.config-DeLnAGGT.cjs} +1 -1
  287. package/components/{funnel-chart-positioning.config-BGi7ixet.js → funnel-chart-positioning.config-TVzSiV6I.js} +1 -1
  288. package/components/{funnel-chart-slots.config-BWszdEe8.js → funnel-chart-slots.config-CfnSH4Ay.js} +1 -1
  289. package/components/{get-css-variable-B8sJUuig.cjs → get-css-variable-CBXsAxR6.cjs} +1 -1
  290. package/components/{get-css-variable-r1spgqX0.js → get-css-variable-DYnldi15.js} +1 -1
  291. package/components/get-dataset-name-DLjeChNS.js +32 -0
  292. package/components/get-dataset-name-mGNEfkAv.cjs +20 -0
  293. package/components/groupings-CODDxpbZ.js +52 -0
  294. package/components/groupings-DKMq8DgS.cjs +20 -0
  295. package/components/{heat-map-options.config-DkuYkbWu.js → heat-map-options.config-X96sw-BV.js} +1 -1
  296. package/components/{heat-map-positioning.config-CK2DBngE.js → heat-map-positioning.config--wm9l7bB.js} +1 -1
  297. package/components/{heat-map-positioning.config-3dxU6qwG.cjs → heat-map-positioning.config-ddrgZXa9.cjs} +1 -1
  298. package/components/{heat-map-slots.config-Cwun49Qb.js → heat-map-slots.config-D2ypExJQ.js} +1 -1
  299. package/components/{heat-table-options.config-BJP1jVB8.js → heat-table-options.config-D6dA9J97.js} +1 -1
  300. package/components/{heat-table-positioning.config-C55D814C.js → heat-table-positioning.config-CIhhBEMg.js} +1 -1
  301. package/components/{heat-table-positioning.config-CbscS7w1.cjs → heat-table-positioning.config-qMDSRhZR.cjs} +1 -1
  302. package/components/{heat-table-slots.config-nGB_B2mh.js → heat-table-slots.config-B1iOn6ay.js} +1 -1
  303. package/components/{hexbin-map-options.config-Bqp3u2bH.js → hexbin-map-options.config-FK9DrXGD.js} +1 -1
  304. package/components/{hexbin-map-positioning.config-CHecaD9p.cjs → hexbin-map-positioning.config-E_BpcIFy.cjs} +1 -1
  305. package/components/{hexbin-map-positioning.config-9nnyZGzx.js → hexbin-map-positioning.config-S7VYUwVD.js} +1 -1
  306. package/components/{hexbin-map-slots.config-BK-ftozd.js → hexbin-map-slots.config-CC1xZINm.js} +1 -1
  307. package/components/{image-options.config-Cz55iN7J.js → image-options.config-DxF0RSUF.js} +1 -1
  308. package/components/{image-slots.config-kvHutBFK.js → image-slots.config-Ba8NXeCH.js} +1 -1
  309. package/components/index.cjs +1 -840
  310. package/components/index.js +67 -6783
  311. package/components/interactive-viz-item/helpers/chart-helpers.d.ts +7 -0
  312. package/components/interactive-viz-item/index.cjs +20 -0
  313. package/components/interactive-viz-item/index.d.ts +10 -0
  314. package/components/interactive-viz-item/index.js +28 -0
  315. package/components/interactive-viz-item/interactive-viz-item.d.ts +97 -0
  316. package/components/interactive-viz-item/load-config-panel.d.ts +2 -0
  317. package/components/interactive-viz-item/types.d.ts +117 -0
  318. package/components/interactive-viz-item--kqitfEZ.cjs +249 -0
  319. package/components/interactive-viz-item-cdShBZQA.js +722 -0
  320. package/components/item-grid/index.cjs +1 -1
  321. package/components/item-grid/index.js +1 -1
  322. package/components/{item-grid-C2ZvM04g.cjs → item-grid-BfhqMuQA.cjs} +22 -22
  323. package/components/{item-grid-D4xYhMOD.js → item-grid-xCM8AqRH.js} +25 -24
  324. package/components/item-menu/item-list/item-list.d.ts +37 -0
  325. package/components/item-option/index.cjs +1 -1
  326. package/components/item-option/index.js +1 -1
  327. package/components/item-option-B5FraAiv.cjs +269 -0
  328. package/components/{item-option-28BU_oaD.js → item-option-DaAlj_OB.js} +53 -53
  329. package/components/item-option-action-button-group/index.cjs +1 -1
  330. package/components/item-option-action-button-group/index.js +1 -1
  331. package/components/{item-option-action-button-group-D_g6aoYd.js → item-option-action-button-group-4w8ub3cT.js} +2 -2
  332. package/components/item-option-action-button-group-DHu8VjCy.cjs +53 -0
  333. package/components/item-option-base/item-option-base.d.ts +23 -0
  334. package/components/item-option-base-4Bwn-3Fc.cjs +56 -0
  335. package/components/{item-option-base-CxQhI83u.js → item-option-base-BxQUwXzg.js} +2 -2
  336. package/components/item-option-color-palette-picker/index.cjs +1 -1
  337. package/components/item-option-color-palette-picker/index.js +1 -1
  338. package/components/{item-option-color-palette-picker-CRDFqhWx.js → item-option-color-palette-picker-D5nO-Bqb.js} +2 -2
  339. package/components/item-option-color-palette-picker-DrhHKaAK.cjs +40 -0
  340. package/components/item-option-color-picker/index.cjs +1 -1
  341. package/components/item-option-color-picker/index.js +1 -1
  342. package/components/{item-option-color-picker-BJgpBbDp.cjs → item-option-color-picker-Bhv_k1uW.cjs} +2 -2
  343. package/components/{item-option-color-picker-BlkpWjQh.js → item-option-color-picker-CKokPQcS.js} +2 -2
  344. package/components/item-option-color-range/index.cjs +1 -1
  345. package/components/item-option-color-range/index.js +1 -1
  346. package/components/item-option-color-range-CwDkzRcx.cjs +98 -0
  347. package/components/{item-option-color-range-3Wp-Ywz6.js → item-option-color-range-DYsMbFEb.js} +2 -2
  348. package/components/item-option-guidelines/index.cjs +1 -1
  349. package/components/item-option-guidelines/index.js +1 -1
  350. package/components/{item-option-guidelines-CQ_yb7Ar.js → item-option-guidelines-CXl4Yla4.js} +4 -3
  351. package/components/item-option-guidelines-DMjA-h3h.cjs +135 -0
  352. package/components/item-option-multi-language-field/index.cjs +1 -1
  353. package/components/item-option-multi-language-field/index.js +1 -1
  354. package/components/{item-option-multi-language-field-BApbe3pp.cjs → item-option-multi-language-field-C75Hd2fG.cjs} +2 -2
  355. package/components/{item-option-multi-language-field-aLIpQWiQ.js → item-option-multi-language-field-S6Mt3k23.js} +2 -2
  356. package/components/item-option-number-field/index.cjs +1 -1
  357. package/components/item-option-number-field/index.js +1 -1
  358. package/components/{item-option-number-field-B72ZYOAX.cjs → item-option-number-field-Bg5r0IAX.cjs} +2 -2
  359. package/components/{item-option-number-field-Bv5eGoxB.js → item-option-number-field-CALw8q_J.js} +2 -2
  360. package/components/item-option-panel/index.cjs +1 -1
  361. package/components/item-option-panel/index.js +1 -1
  362. package/components/{item-option-panel-A8Jxzwml.cjs → item-option-panel-DBXgOsM4.cjs} +2 -2
  363. package/components/{item-option-panel-kRH7GbzA.js → item-option-panel-v7yUS9hb.js} +4 -4
  364. package/components/item-option-picker/index.cjs +1 -1
  365. package/components/item-option-picker/index.js +1 -1
  366. package/components/{item-option-picker-BuUtW6gD.js → item-option-picker-CZyzd3Nq.js} +2 -2
  367. package/components/{item-option-picker-DOFJ1CnI.cjs → item-option-picker-RFstpFwI.cjs} +2 -2
  368. package/components/item-option-position-picker/index.cjs +1 -1
  369. package/components/item-option-position-picker/index.js +1 -1
  370. package/components/{item-option-position-picker-mf3JQu5q.js → item-option-position-picker-C8cnHEH4.js} +2 -2
  371. package/components/item-option-position-picker-CKHbHHl1.cjs +32 -0
  372. package/components/item-option-positions-number-field/index.cjs +1 -1
  373. package/components/item-option-positions-number-field/index.js +1 -1
  374. package/components/item-option-positions-number-field-BGs3WWaz.cjs +49 -0
  375. package/components/{item-option-positions-number-field-BIBWpagB.js → item-option-positions-number-field-BJTY1qZR.js} +2 -2
  376. package/components/item-option-radio-button-group/index.cjs +1 -1
  377. package/components/item-option-radio-button-group/index.js +1 -1
  378. package/components/{item-option-radio-button-group-B2HYZguB.cjs → item-option-radio-button-group-CN8TLtsV.cjs} +2 -2
  379. package/components/{item-option-radio-button-group-CFnfadK2.js → item-option-radio-button-group-vhm4r4_k.js} +2 -2
  380. package/components/item-option-slider/index.cjs +1 -1
  381. package/components/item-option-slider/index.js +1 -1
  382. package/components/{item-option-slider-CH1l0Ena.js → item-option-slider-CQOKWBZQ.js} +2 -2
  383. package/components/item-option-slider-DbLPhpJd.cjs +33 -0
  384. package/components/item-option-switch/index.cjs +1 -1
  385. package/components/item-option-switch/index.js +1 -1
  386. package/components/{item-option-switch-hUFRE9MC.cjs → item-option-switch-CWpb0nf3.cjs} +2 -2
  387. package/components/{item-option-switch-rqu2ePVU.js → item-option-switch-azZX2vJr.js} +2 -2
  388. package/components/item-option-text-field/index.cjs +1 -1
  389. package/components/item-option-text-field/index.js +1 -1
  390. package/components/{item-option-text-field-CBFMmuK2.js → item-option-text-field-CIM_38yi.js} +2 -2
  391. package/components/{item-option-text-field-C6CocZ5q.cjs → item-option-text-field-CS3Lccda.cjs} +2 -2
  392. package/components/item-options-configs.js +45 -45
  393. package/components/item-slot-drop/index.cjs +1 -1
  394. package/components/item-slot-drop/index.d.ts +2 -0
  395. package/components/item-slot-drop/index.js +1 -1
  396. package/components/item-slot-drop-C8WYPu_w.cjs +91 -0
  397. package/components/{item-slot-drop-DDGclwbP.js → item-slot-drop-DeZ2GvAu.js} +26 -21
  398. package/components/item-slot-drop-panel/index.cjs +1 -1
  399. package/components/item-slot-drop-panel/index.js +1 -1
  400. package/components/item-slot-drop-panel-BcBHDDTT.cjs +57 -0
  401. package/components/{item-slot-drop-panel-Cj6vbgJl.js → item-slot-drop-panel-LpfX7ap0.js} +49 -48
  402. package/components/item-slot-picker/index.cjs +1 -1
  403. package/components/item-slot-picker/index.js +1 -1
  404. package/components/{item-slot-picker-CjQH3MU-.js → item-slot-picker-BSO1ltXC.js} +44 -39
  405. package/components/item-slot-picker-CvySq194.cjs +174 -0
  406. package/components/item-slot-picker-panel/index.cjs +1 -1
  407. package/components/item-slot-picker-panel/index.js +1 -1
  408. package/components/{item-slot-picker-panel-7IFk5QFC.js → item-slot-picker-panel-CsntXcAp.js} +16 -15
  409. package/components/item-slot-picker-panel-DQ_OzMO_.cjs +81 -0
  410. package/components/item-slots-configs.js +45 -45
  411. package/components/{line-chart-options.config-D8gRtfj3.js → line-chart-options.config-C3_RnROS.js} +1 -1
  412. package/components/{line-chart-positioning.config-D5WVvIZT.js → line-chart-positioning.config-CrreArf5.js} +1 -1
  413. package/components/{line-chart-positioning.config-DuXn1WD-.cjs → line-chart-positioning.config-DMe1Ldwk.cjs} +1 -1
  414. package/components/{line-chart-slots.config-C6LEwEwh.js → line-chart-slots.config-CA-I6B6o.js} +1 -1
  415. package/components/load-data-fields-for-datasets-B3XcFFfg.js +42 -0
  416. package/components/load-data-fields-for-datasets-rL24A68g.cjs +20 -0
  417. package/components/localized-mixin-DaLXe5J9.js +45 -0
  418. package/components/localized-mixin-DiUJOd06.cjs +20 -0
  419. package/components/{marker-map-options.config-BE8GnY_T.js → marker-map-options.config-OMdgbAc4.js} +1 -1
  420. package/components/{marker-map-positioning.config-DfN39a-Q.cjs → marker-map-positioning.config-CpI8nCtC.cjs} +1 -1
  421. package/components/{marker-map-positioning.config-D2L7cvCP.js → marker-map-positioning.config-DW9tMO2M.js} +1 -1
  422. package/components/{marker-map-slots.config-Cyk-QFPT.js → marker-map-slots.config-CcGNgr1_.js} +1 -1
  423. package/components/{nl-h9vVAk2e.js → nl-BaZM3WoR.js} +34 -0
  424. package/components/nl-BoEhzeIh.cjs +20 -0
  425. package/components/{ohlc-chart-options.config-xgegn34C.js → ohlc-chart-options.config-CWRI5bXI.js} +1 -1
  426. package/components/{ohlc-chart-positioning.config-DsBuB0VU.cjs → ohlc-chart-positioning.config-9DETh4xy.cjs} +1 -1
  427. package/components/{ohlc-chart-positioning.config-C53dCwaT.js → ohlc-chart-positioning.config-CkX8gyS2.js} +1 -1
  428. package/components/{ohlc-chart-slots.config-CQFi8BIT.js → ohlc-chart-slots.config-Pv0xst-Y.js} +1 -1
  429. package/components/{parallel-coordinates-plot-options.config-BUQLHO1k.js → parallel-coordinates-plot-options.config-DbuNgevO.js} +1 -1
  430. package/components/{parallel-coordinates-plot-positioning.config-aiFzLnnh.cjs → parallel-coordinates-plot-positioning.config-CLDZdGdh.cjs} +1 -1
  431. package/components/{parallel-coordinates-plot-positioning.config-DhoVstsb.js → parallel-coordinates-plot-positioning.config-DTJZLEeT.js} +1 -1
  432. package/components/{parallel-coordinates-plot-slots.config-D5o-5y_j.js → parallel-coordinates-plot-slots.config-GvYC-RXK.js} +1 -1
  433. package/components/period-over-period-condition.const-BZ7j5Z5t.js +29 -0
  434. package/components/period-over-period-condition.const-C1NZ9Bkp.cjs +20 -0
  435. package/components/{pivot-table-options.config-DW9UDipI.js → pivot-table-options.config-CTz4bcGJ.js} +1 -1
  436. package/components/{pivot-table-positioning.config-Bq9BoQWM.cjs → pivot-table-positioning.config-B-SALuVb.cjs} +1 -1
  437. package/components/{pivot-table-positioning.config-Cnai84AH.js → pivot-table-positioning.config-CtSYHD-n.js} +1 -1
  438. package/components/{pivot-table-slots.config-Cl5z3IQo.js → pivot-table-slots.config-BAW0U3nh.js} +1 -1
  439. package/components/{pragmatic-element-adapter-C_7HSvGV.js → pragmatic-element-adapter-D0LRKx5U.js} +75 -74
  440. package/components/{pragmatic-element-adapter-DPWYJiW9.cjs → pragmatic-element-adapter-DdyH32ix.cjs} +4 -4
  441. package/components/{pyramid-chart-options.config-Cbg351Yy.js → pyramid-chart-options.config-C7btzuZj.js} +1 -1
  442. package/components/{pyramid-chart-positioning.config-BeJ5R_Ln.js → pyramid-chart-positioning.config-0Juiava5.js} +1 -1
  443. package/components/{pyramid-chart-positioning.config-D5AKNCPb.cjs → pyramid-chart-positioning.config-BllFtneP.cjs} +1 -1
  444. package/components/{pyramid-chart-slots.config-DNzq2hMx.js → pyramid-chart-slots.config-CsMMyhV3.js} +1 -1
  445. package/components/{radar-chart-options.config-DrNyOkHq.js → radar-chart-options.config-CtA6MpUp.js} +1 -1
  446. package/components/{radar-chart-positioning.config-DsfUBq4B.js → radar-chart-positioning.config-BPbb63S6.js} +1 -1
  447. package/components/{radar-chart-positioning.config-BEIwrzhb.cjs → radar-chart-positioning.config-BY4RKNDi.cjs} +1 -1
  448. package/components/{radar-chart-slots.config-CXgfvAkt.js → radar-chart-slots.config-8Kf_WAFi.js} +1 -1
  449. package/components/{regular-table-options.config-CweBtAvm.js → regular-table-options.config-BRmS77t-.js} +1 -1
  450. package/components/{regular-table-slots.config-DCkw4Xkq.js → regular-table-slots.config-r-N9A-qA.js} +1 -1
  451. package/components/{route-map-options.config-DXHqb8Ve.js → route-map-options.config-C65J81_7.js} +1 -1
  452. package/components/{route-map-positioning.config-CuiRWzbs.js → route-map-positioning.config-D6nZFd8f.js} +1 -1
  453. package/components/{route-map-positioning.config-4Wyvj5OH.cjs → route-map-positioning.config-GQ9AJfej.cjs} +1 -1
  454. package/components/{route-map-slots.config-DJ76FOsJ.js → route-map-slots.config-DMII2UuP.js} +1 -1
  455. package/components/{sankey-diagram-options.config-1lSECht4.js → sankey-diagram-options.config-nQDCRhKs.js} +1 -1
  456. package/components/{sankey-diagram-positioning.config-CZ-zVCQo.cjs → sankey-diagram-positioning.config-DAuj5A08.cjs} +1 -1
  457. package/components/{sankey-diagram-positioning.config-DtN7dARd.js → sankey-diagram-positioning.config-R1EjoR5F.js} +1 -1
  458. package/components/{sankey-diagram-slots.config-BCc8P4j0.js → sankey-diagram-slots.config-DmWIGut0.js} +1 -1
  459. package/components/{scatter-plot-options.config-9zL4v24E.js → scatter-plot-options.config-BplrME7w.js} +1 -1
  460. package/components/{scatter-plot-positioning.config-BXrzdLIc.js → scatter-plot-positioning.config-DGoMnNZy.js} +1 -1
  461. package/components/{scatter-plot-positioning.config-CfAf_FUW.cjs → scatter-plot-positioning.config-o4c-wuRo.cjs} +1 -1
  462. package/components/{scatter-plot-slots.config-BMTdhTZG.js → scatter-plot-slots.config-B7wQVEEj.js} +1 -1
  463. package/components/{search-filter-options.config-B_qQjr68.js → search-filter-options.config-yAz6IIto.js} +1 -1
  464. package/components/{search-filter-slots.config-qCILSYzs.js → search-filter-slots.config-D8-V0BT5.js} +1 -1
  465. package/components/{set-locale-B-GvqA1H.cjs → set-locale-Xh_1AFbC.cjs} +1 -1
  466. package/components/{set-locale-CgCeLPlb.js → set-locale-ydAPif-7.js} +4 -4
  467. package/components/{slicer-filter-options.config-DK62SCMp.js → slicer-filter-options.config-BtGkT2hI.js} +1 -1
  468. package/components/{slicer-filter-positioning.config-CU86hJi6.cjs → slicer-filter-positioning.config-BqpIENEm.cjs} +1 -1
  469. package/components/{slicer-filter-positioning.config-BLGeCJys.js → slicer-filter-positioning.config-D_didkcw.js} +1 -1
  470. package/components/{slicer-filter-slots.config-C9_NdJm4.js → slicer-filter-slots.config-DR0Wg_Zr.js} +1 -1
  471. package/components/{slider-filter-options.config-CP5bXdih.js → slider-filter-options.config-D_yZ_nFz.js} +1 -1
  472. package/components/{slider-filter-slots.config-15eAAGVn.js → slider-filter-slots.config-BUHw-32u.js} +1 -1
  473. package/components/{en-GB-CJR66Ci_.cjs → slot-menu/index.cjs} +1 -1
  474. package/components/slot-menu/index.d.ts +10 -0
  475. package/components/slot-menu/index.js +28 -0
  476. package/components/slot-menu/slot-menu.d.ts +148 -0
  477. package/components/slot-menu/types.d.ts +24 -0
  478. package/components/slot-menu-CUdbaW3K.js +428 -0
  479. package/components/slot-menu-DRx1Ffla.cjs +71 -0
  480. package/components/slot-menu-list/index.cjs +20 -0
  481. package/components/slot-menu-list/index.d.ts +8 -0
  482. package/components/slot-menu-list/index.js +28 -0
  483. package/components/slot-menu-list/slot-menu-list.d.ts +47 -0
  484. package/components/slot-menu-list-DVSxamVa.js +347 -0
  485. package/components/slot-menu-list-DaHzz_ve.cjs +44 -0
  486. package/components/slot-role-classification-2wChhpcq.cjs +20 -0
  487. package/components/slot-role-classification-B8bkGhQ_.js +133 -0
  488. package/components/slots-config-Cd4xAG4H.cjs +20 -0
  489. package/components/slots-config-GlSNH7Gr.js +76 -0
  490. package/components/{speedometer-chart-options.config-dsUupCqm.js → speedometer-chart-options.config-BL7evgzP.js} +1 -1
  491. package/components/{speedometer-chart-positioning.config-Dam0wOqp.js → speedometer-chart-positioning.config-CmxsV4-x.js} +1 -1
  492. package/components/{speedometer-chart-positioning.config-AeMlNxSj.cjs → speedometer-chart-positioning.config-eVUWDhkL.cjs} +1 -1
  493. package/components/{speedometer-chart-slots.config-DfTw7JTF.js → speedometer-chart-slots.config-2Y_x52Gy.js} +1 -1
  494. package/components/{spike-map-options.config-Dh4Ky5ZP.js → spike-map-options.config-DjoTrAsC.js} +1 -1
  495. package/components/{spike-map-positioning.config-9ShV1fUh.cjs → spike-map-positioning.config-B38djRlf.cjs} +1 -1
  496. package/components/{spike-map-positioning.config-BVzewpfi.js → spike-map-positioning.config-Bta7ar9e.js} +1 -1
  497. package/components/{spike-map-slots.config-i-c0F9QM.js → spike-map-slots.config-DJWMFPIR.js} +1 -1
  498. package/components/{strip-plot-options.config-Vw3GoLef.js → strip-plot-options.config-tDmVlu9U.js} +1 -1
  499. package/components/{strip-plot-positioning.config-OHm3LEo3.js → strip-plot-positioning.config-0vlAfmDB.js} +1 -1
  500. package/components/{strip-plot-positioning.config-BVBdHZvL.cjs → strip-plot-positioning.config-atH68L8u.cjs} +1 -1
  501. package/components/{strip-plot-slots.config-BuF7X3xN.js → strip-plot-slots.config-suFyIf5-.js} +1 -1
  502. package/components/{sunburst-chart-options.config-CXOrVmIe.js → sunburst-chart-options.config-Bjue_lQN.js} +1 -1
  503. package/components/{sunburst-chart-positioning.config-BynNbbxB.js → sunburst-chart-positioning.config-B2x6afBV.js} +1 -1
  504. package/components/{sunburst-chart-positioning.config-DQmuKm-N.cjs → sunburst-chart-positioning.config-NFzFNuXB.cjs} +1 -1
  505. package/components/{sunburst-chart-slots.config-Cq-E6kyI.js → sunburst-chart-slots.config-BqVT-h0Z.js} +1 -1
  506. package/components/{symbol-map-options.config-Dultd0tF.js → symbol-map-options.config-Dyeya5Z2.js} +1 -1
  507. package/components/{symbol-map-positioning.config-bQk_pdAr.js → symbol-map-positioning.config-B6v9PFTk.js} +1 -1
  508. package/components/{symbol-map-positioning.config-D6rgxXTO.cjs → symbol-map-positioning.config-DGpmp_N1.cjs} +1 -1
  509. package/components/{symbol-map-slots.config-BfdBHkzN.js → symbol-map-slots.config-Rhpher5o.js} +1 -1
  510. package/components/{text-options.config-BUiRyi3L.js → text-options.config-CXhvzzPF.js} +1 -1
  511. package/components/{text-slots.config-CM_ZaW3p.js → text-slots.config-Dzj4-x2G.js} +1 -1
  512. package/components/{treemap-chart-options.config-6l3HzikF.js → treemap-chart-options.config-BzOCEWog.js} +1 -1
  513. package/components/{treemap-chart-positioning.config-BB1-rZKL.js → treemap-chart-positioning.config-Bf2VNVRQ.js} +1 -1
  514. package/components/{treemap-chart-positioning.config-ZaoIngRn.cjs → treemap-chart-positioning.config-NMULB8UM.cjs} +1 -1
  515. package/components/{treemap-chart-slots.config-CHkGtIOa.js → treemap-chart-slots.config-DRcafVU-.js} +1 -1
  516. package/components/utils/base.cjs +1 -1
  517. package/components/utils/base.js +2 -2
  518. package/components/utils/store.js +1 -1
  519. package/components/utils-SzKvwZ9-.cjs +20 -0
  520. package/components/{utils-ZoJ1cp2P.js → utils-_8LPCz9-.js} +54 -53
  521. package/components/utils.cjs +1 -1
  522. package/components/utils.js +9 -6
  523. package/components/{venn-diagram-options.config-Wi0dQsAu.js → venn-diagram-options.config-BMlduwIp.js} +1 -1
  524. package/components/{venn-diagram-positioning.config-Cb10sStL.cjs → venn-diagram-positioning.config-D4cODPGV.cjs} +1 -1
  525. package/components/{venn-diagram-positioning.config-C9ARqREi.js → venn-diagram-positioning.config-DgOl0Vh-.js} +1 -1
  526. package/components/{venn-diagram-slots.config-DY04aeYK.js → venn-diagram-slots.config-CMDndPVi.js} +1 -1
  527. package/components/{video-options.config-B6pQUPB7.js → video-options.config-DdfSTJEJ.js} +1 -1
  528. package/components/{video-slots.config-C-kXGzo3.js → video-slots.config-Utnn0DBW.js} +1 -1
  529. package/components/viz-item-menu/index.cjs +20 -0
  530. package/components/viz-item-menu/index.d.ts +8 -0
  531. package/components/viz-item-menu/index.js +28 -0
  532. package/components/viz-item-menu/types.d.ts +9 -0
  533. package/components/viz-item-menu/viz-item-menu.d.ts +78 -0
  534. package/components/viz-item-menu-CNHv6qDa.cjs +55 -0
  535. package/components/viz-item-menu-L_j0L08h.js +170 -0
  536. package/components/{wordcloud-chart-options.config-CpMtpG7q.js → wordcloud-chart-options.config-y9Z5I_ZN.js} +1 -1
  537. package/components/{wordcloud-chart-positioning.config-D59ntNtd.js → wordcloud-chart-positioning.config-BP6iqy-N.js} +1 -1
  538. package/components/{wordcloud-chart-positioning.config-DC89_DYc.cjs → wordcloud-chart-positioning.config-DZEkWvb0.cjs} +1 -1
  539. package/components/{wordcloud-chart-slots.config-Cc5F92Tv.js → wordcloud-chart-slots.config-CvabtgbP.js} +1 -1
  540. package/custom-elements.json +18790 -6833
  541. package/deprecated-react/components/ai-chat.component.cjs +1 -0
  542. package/deprecated-react/components/ai-interaction-textarea.component.cjs +1 -0
  543. package/deprecated-react/components/data-field-level.component.cjs +1 -0
  544. package/deprecated-react/components/data-fields-select.component.cjs +1 -0
  545. package/deprecated-react/components/dataset-icon.component.cjs +1 -0
  546. package/deprecated-react/components/dataset-selector-list.component.cjs +1 -0
  547. package/deprecated-react/components/dataset-selector-row.component.cjs +1 -0
  548. package/deprecated-react/components/display-settings-binning.component.cjs +1 -0
  549. package/deprecated-react/components/display-settings-datetime.component.cjs +1 -0
  550. package/deprecated-react/components/display-settings-grand-totals.component.cjs +1 -0
  551. package/deprecated-react/components/display-settings-numeric.component.cjs +1 -0
  552. package/deprecated-react/components/display-settings-period-over-period.component.cjs +1 -0
  553. package/deprecated-react/components/display-settings.component.cjs +1 -0
  554. package/deprecated-react/components/filter-expression-picker.component.cjs +1 -0
  555. package/deprecated-react/components/filter-item.component.cjs +1 -0
  556. package/deprecated-react/components/filter-parameter-picker.component.cjs +1 -0
  557. package/deprecated-react/components/filter-value-picker-datetime.component.cjs +1 -0
  558. package/deprecated-react/components/filter-value-picker-hierarchy.component.cjs +1 -0
  559. package/deprecated-react/components/filter-value-picker-numeric.component.cjs +1 -0
  560. package/deprecated-react/components/filter-value-picker.component.cjs +1 -0
  561. package/deprecated-react/components/formula-field.component.cjs +1 -0
  562. package/deprecated-react/components/interactive-viz-item.component.cjs +1 -0
  563. package/deprecated-react/components/slot-menu-list.component.cjs +1 -0
  564. package/deprecated-react/components/slot-menu.component.cjs +1 -0
  565. package/deprecated-react/components/viz-item-menu.component.cjs +1 -0
  566. package/index.d.ts +25 -0
  567. package/package.json +127 -2
  568. package/react/components/ai-chat.component.ts +45 -0
  569. package/react/components/ai-interaction-textarea.component.ts +30 -0
  570. package/react/components/data-field-level.component.ts +30 -0
  571. package/react/components/data-fields-select.component.ts +27 -0
  572. package/react/components/dataset-icon.component.ts +22 -0
  573. package/react/components/dataset-selector-list.component.ts +27 -0
  574. package/react/components/dataset-selector-row.component.ts +36 -0
  575. package/react/components/display-settings-binning.component.ts +27 -0
  576. package/react/components/display-settings-datetime.component.ts +27 -0
  577. package/react/components/display-settings-grand-totals.component.ts +27 -0
  578. package/react/components/display-settings-numeric.component.ts +27 -0
  579. package/react/components/display-settings-period-over-period.component.ts +27 -0
  580. package/react/components/display-settings.component.ts +33 -0
  581. package/react/components/filter-expression-picker.component.ts +27 -0
  582. package/react/components/filter-item.component.ts +27 -0
  583. package/react/components/filter-parameter-picker.component.ts +33 -0
  584. package/react/components/filter-value-picker-datetime.component.ts +27 -0
  585. package/react/components/filter-value-picker-hierarchy.component.ts +27 -0
  586. package/react/components/filter-value-picker-numeric.component.ts +27 -0
  587. package/react/components/filter-value-picker.component.ts +27 -0
  588. package/react/components/filters.component.ts +1 -1
  589. package/react/components/formula-field.component.ts +30 -0
  590. package/react/components/interactive-viz-item.component.ts +33 -0
  591. package/react/components/slot-menu-list.component.ts +27 -0
  592. package/react/components/slot-menu.component.ts +42 -0
  593. package/react/components/viz-item-menu.component.ts +33 -0
  594. package/react/esm/components/ai-chat.component.d.ts +24 -0
  595. package/react/esm/components/ai-chat.component.js +29 -0
  596. package/react/esm/components/ai-interaction-textarea.component.d.ts +14 -0
  597. package/react/esm/components/ai-interaction-textarea.component.js +19 -0
  598. package/react/esm/components/data-field-level.component.d.ts +14 -0
  599. package/react/esm/components/data-field-level.component.js +19 -0
  600. package/react/esm/components/data-fields-select.component.d.ts +12 -0
  601. package/react/esm/components/data-fields-select.component.js +17 -0
  602. package/react/esm/components/dataset-icon.component.d.ts +8 -0
  603. package/react/esm/components/dataset-icon.component.js +13 -0
  604. package/react/esm/components/dataset-selector-list.component.d.ts +12 -0
  605. package/react/esm/components/dataset-selector-list.component.js +17 -0
  606. package/react/esm/components/dataset-selector-row.component.d.ts +18 -0
  607. package/react/esm/components/dataset-selector-row.component.js +23 -0
  608. package/react/esm/components/display-settings-binning.component.d.ts +12 -0
  609. package/react/esm/components/display-settings-binning.component.js +17 -0
  610. package/react/esm/components/display-settings-datetime.component.d.ts +12 -0
  611. package/react/esm/components/display-settings-datetime.component.js +17 -0
  612. package/react/esm/components/display-settings-grand-totals.component.d.ts +12 -0
  613. package/react/esm/components/display-settings-grand-totals.component.js +17 -0
  614. package/react/esm/components/display-settings-numeric.component.d.ts +12 -0
  615. package/react/esm/components/display-settings-numeric.component.js +17 -0
  616. package/react/esm/components/display-settings-period-over-period.component.d.ts +12 -0
  617. package/react/esm/components/display-settings-period-over-period.component.js +17 -0
  618. package/react/esm/components/display-settings.component.d.ts +16 -0
  619. package/react/esm/components/display-settings.component.js +21 -0
  620. package/react/esm/components/filter-expression-picker.component.d.ts +12 -0
  621. package/react/esm/components/filter-expression-picker.component.js +17 -0
  622. package/react/esm/components/filter-item.component.d.ts +12 -0
  623. package/react/esm/components/filter-item.component.js +17 -0
  624. package/react/esm/components/filter-parameter-picker.component.d.ts +16 -0
  625. package/react/esm/components/filter-parameter-picker.component.js +21 -0
  626. package/react/esm/components/filter-value-picker-datetime.component.d.ts +12 -0
  627. package/react/esm/components/filter-value-picker-datetime.component.js +17 -0
  628. package/react/esm/components/filter-value-picker-hierarchy.component.d.ts +12 -0
  629. package/react/esm/components/filter-value-picker-hierarchy.component.js +17 -0
  630. package/react/esm/components/filter-value-picker-numeric.component.d.ts +12 -0
  631. package/react/esm/components/filter-value-picker-numeric.component.js +17 -0
  632. package/react/esm/components/filter-value-picker.component.d.ts +12 -0
  633. package/react/esm/components/filter-value-picker.component.js +17 -0
  634. package/react/esm/components/filters.component.d.ts +1 -1
  635. package/react/esm/components/filters.component.js +1 -1
  636. package/react/esm/components/formula-field.component.d.ts +14 -0
  637. package/react/esm/components/formula-field.component.js +19 -0
  638. package/react/esm/components/interactive-viz-item.component.d.ts +16 -0
  639. package/react/esm/components/interactive-viz-item.component.js +21 -0
  640. package/react/esm/components/slot-menu-list.component.d.ts +12 -0
  641. package/react/esm/components/slot-menu-list.component.js +17 -0
  642. package/react/esm/components/slot-menu.component.d.ts +22 -0
  643. package/react/esm/components/slot-menu.component.js +27 -0
  644. package/react/esm/components/viz-item-menu.component.d.ts +16 -0
  645. package/react/esm/components/viz-item-menu.component.js +21 -0
  646. package/react/esm/index.d.ts +27 -2
  647. package/react/esm/index.js +102 -2
  648. package/react/index.ts +102 -2
  649. package/react/luzmo-stub.d.ts +140 -0
  650. package/react/package.json +2 -2
  651. package/storybook/inject-global-vars.d.ts +1 -0
  652. package/storybook/register-components.d.ts +57 -0
  653. package/types/agent.types.d.ts +4 -0
  654. package/types/ai-chat.types.d.ts +104 -0
  655. package/types/data-field-events.types.d.ts +7 -0
  656. package/types.d.ts +9 -0
  657. package/utils/create-lazy-loader.d.ts +5 -0
  658. package/utils/filters/filter-text.d.ts +64 -0
  659. package/utils/filters/index.d.ts +1 -0
  660. package/utils/filters/presentation.d.ts +4 -0
  661. package/utils/filters/tests/filter-text.test.d.ts +1 -0
  662. package/utils/formatter/localized-template.d.ts +4 -0
  663. package/utils/formatter/tests/localized-template.test.d.ts +1 -0
  664. package/utils/tests/create-lazy-loader.test.d.ts +1 -0
  665. package/components/base-BtRS5vm6.cjs +0 -20
  666. package/components/data-field-fvlYzmfX.cjs +0 -89
  667. package/components/data-field-panel-Yrqn4L79.cjs +0 -87
  668. package/components/data-fields-select-Cor6sfzL.cjs +0 -41
  669. package/components/de-CdZnQbKI.cjs +0 -20
  670. package/components/display-settings-datetime-B23w7aH4.cjs +0 -217
  671. package/components/display-settings-grand-totals-BZ0nlLhu.cjs +0 -44
  672. package/components/display-settings-numeric-DoScgfRy.cjs +0 -190
  673. package/components/display-settings-period-over-period-C-hp0ZKN.cjs +0 -227
  674. package/components/es-7RD7O4q3.cjs +0 -20
  675. package/components/filters-DndJU6D5.js +0 -2454
  676. package/components/filters-oB9qOk_M.cjs +0 -443
  677. package/components/formula-BFvxm8kj.cjs +0 -45
  678. package/components/formula-codemirror-ucFOD-2a.cjs +0 -215
  679. package/components/formula-display-store-DmT65fUB.cjs +0 -20
  680. package/components/formula-editor-BeZ-fu-7.cjs +0 -253
  681. package/components/fr-CGw2IwXh.cjs +0 -20
  682. package/components/item-option-BQpS6rM_.cjs +0 -269
  683. package/components/item-option-action-button-group-BwBxRLzB.cjs +0 -53
  684. package/components/item-option-base-C6uwowJD.cjs +0 -56
  685. package/components/item-option-color-palette-picker-BjHadiN0.cjs +0 -40
  686. package/components/item-option-color-range-CQo8uThO.cjs +0 -98
  687. package/components/item-option-guidelines-Daf8Ce5z.cjs +0 -135
  688. package/components/item-option-position-picker-Cnis4wLA.cjs +0 -32
  689. package/components/item-option-positions-number-field-B7gI1IKO.cjs +0 -49
  690. package/components/item-option-slider--7hmhi97.cjs +0 -33
  691. package/components/item-slot-drop-hK-rLhwa.cjs +0 -91
  692. package/components/item-slot-drop-panel-CE4f9X6F.cjs +0 -57
  693. package/components/item-slot-picker-Wf50lM5u.cjs +0 -174
  694. package/components/item-slot-picker-panel-Csn1tabr.cjs +0 -81
  695. package/components/load-data-fields-for-datasets-B76UR0sG.js +0 -86
  696. package/components/load-data-fields-for-datasets-DFYeACsu.cjs +0 -20
  697. package/components/localized-mixin-DfpurTYo.cjs +0 -20
  698. package/components/nl-BnzS_ZtB.cjs +0 -20
  699. package/components/period-over-period-condition.const-DDgiXIfR.cjs +0 -20
  700. package/components/slot-menu-1zlmyLVl.js +0 -1060
  701. package/components/slot-menu-BSu8wKLi.cjs +0 -217
  702. package/components/utils-CPIzW8sp.cjs +0 -20
@@ -1,2454 +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 { n as e, t } from "./localized-mixin-DhiGdPMj.js";
21
- import { t as n } from "./data-broker-B0uUO5er.js";
22
- import { c as r } from "./type-check-CGREdneG.js";
23
- import { t as i } from "./calculate-data-field-icon-DrSg1PuD.js";
24
- import { t as a } from "./localize-BT7REYBY.js";
25
- import { t as o } from "./v4-DIjJgmR0.js";
26
- import { n as s } from "./periods.const-NCTkxnvG.js";
27
- import "./data-fields-select-Bb1HXwlO.js";
28
- import "./utils-ZoJ1cp2P.js";
29
- import { luzmoFormula as c, luzmoPlus as l, luzmoTrashOutline as u } from "@luzmo/icons";
30
- import "@luzmo/lucero/button";
31
- import "@luzmo/lucero/icon";
32
- import "@luzmo/lucero/overlay";
33
- import "@luzmo/lucero/popover";
34
- import { html as d, nothing as f, unsafeCSS as p } from "lit";
35
- import { property as m, query as h, state as g } from "lit/decorators.js";
36
- import { localized as _, msg as v } from "@lit/localize";
37
- import "@luzmo/lucero/action-button";
38
- import "@luzmo/lucero/select";
39
- import "@luzmo/lucero/tags";
40
- import "@luzmo/lucero/tooltip";
41
- import { repeat as ee } from "lit/directives/repeat.js";
42
- import "@luzmo/lucero/field-label";
43
- import "@luzmo/lucero/number-field";
44
- import "@luzmo/lucero/picker";
45
- import { ElementSizes as y, LuzmoElement as b, SizedMixin as x } from "@luzmo/lucero/utils";
46
- import { ifDefined as te } from "lit/directives/if-defined.js";
47
- import "@luzmo/lucero/menu";
48
- import "@luzmo/lucero/divider";
49
- import "@luzmo/lucero/options";
50
- import "@luzmo/lucero/text-field";
51
- import "@luzmo/lucero/date-time-picker";
52
- //#region src/components/filters/transformations/filter-format.ts
53
- var ne = 20, S = class extends Error {
54
- constructor(e) {
55
- super(e), this.name = "FilterUnrepresentableError";
56
- }
57
- }, re = /* @__PURE__ */ new Set(["and", "or"]), ie = [
58
- "datasetId",
59
- "dataset_id",
60
- "columnId",
61
- "column_id",
62
- "formulaId",
63
- "formula_id",
64
- "formula",
65
- "columnExpression",
66
- "value",
67
- "ignoredItemIds"
68
- ];
69
- function C(e) {
70
- return typeof e == "object" && !!e && !Array.isArray(e);
71
- }
72
- function w(e) {
73
- return !C(e) || e.condition !== void 0 && (typeof e.condition != "string" || !re.has(e.condition.toLowerCase())) ? !1 : "filters" in e || "subGroups" in e;
74
- }
75
- function T(e) {
76
- return C(e) && "expression" in e && !("condition" in e);
77
- }
78
- function E(e) {
79
- return ie.some((t) => t in e);
80
- }
81
- function ae(e, t = !1) {
82
- let n = [
83
- e.columnId !== void 0 || e.column_id !== void 0,
84
- e.formulaId !== void 0 || e.formula_id !== void 0,
85
- e.formula !== void 0
86
- ].filter(Boolean).length;
87
- return n === 1 ? !0 : n > 1 ? !1 : e.columnExpression !== void 0 || t && e.expression !== void 0;
88
- }
89
- function oe(e) {
90
- return !T(e) || typeof e.expression != "string" || e.expression.length === 0 || "parameters" in e || typeof e.datasetId != "string" && typeof e.dataset_id != "string" ? !1 : ae(e);
91
- }
92
- function se(e) {
93
- return !T(e) || !Array.isArray(e.parameters) ? !1 : !E(e);
94
- }
95
- function ce(e) {
96
- if (!("parameters" in e)) return;
97
- let t = ie.find((t) => t in e);
98
- if (t !== void 0) throw new S(`Filter leaf mixes "parameters" with the clean inline key "${t}".`);
99
- }
100
- function le(e) {
101
- throw typeof e.expression != "string" || e.expression.length === 0 ? new S("Clean filter leaf is missing a non-empty \"expression\".") : typeof e.datasetId != "string" && typeof e.dataset_id != "string" ? new S(`Clean filter leaf "${e.expression}" is missing a "datasetId".`) : new S(`Clean filter leaf "${e.expression}" must name exactly one of "columnId", "formulaId", "formula", or "columnExpression".`);
102
- }
103
- function ue(e) {
104
- return e === "where" || e === "having";
105
- }
106
- function D(e) {
107
- if (e > 20) throw new S("Filter nesting exceeds the maximum depth of 20.");
108
- }
109
- function de(e) {
110
- if (e == null) return "empty";
111
- if (!Array.isArray(e)) return "unknown";
112
- if (e.length === 0) return "empty";
113
- let t = !1, n = !1, r = !1, i = (e, a) => {
114
- if (a > 20) {
115
- r = !0;
116
- return;
117
- }
118
- if (w(e)) {
119
- ue(e.clause) && (n = !0);
120
- let t = [...Array.isArray(e.filters) ? e.filters : [], ...Array.isArray(e.subGroups) ? e.subGroups : []];
121
- for (let e of t) i(e, a + 1);
122
- return;
123
- }
124
- if (T(e)) {
125
- "parameters" in e && E(e) ? r = !0 : oe(e) ? n = !0 : se(e) ? t = !0 : r = !0;
126
- return;
127
- }
128
- r = !0;
129
- };
130
- for (let t of e) i(t, 1);
131
- return r ? "unknown" : n && t ? "mixed" : n ? "clean" : t ? "canonical" : "empty";
132
- }
133
- //#endregion
134
- //#region src/components/filters/transformations/clean-filters.ts
135
- var fe = /* @__PURE__ */ new Set(["? is null", "? is not null"]), pe = /* @__PURE__ */ new Set([
136
- "? = ?",
137
- "? != ?",
138
- "? < ?",
139
- "? <= ?",
140
- "? > ?",
141
- "? >= ?"
142
- ]), me = /* @__PURE__ */ new Set([
143
- "? in ?",
144
- "? not in ?",
145
- "? between ?"
146
- ]), he = {
147
- "array[numeric]": "numeric[]",
148
- "array[hierarchy]": "hierarchy[]",
149
- "array[datetime]": "datetime[]"
150
- }, ge = /* @__PURE__ */ new Set([
151
- "level",
152
- "lowestLevel",
153
- "unnest",
154
- "discretization",
155
- "aggregation",
156
- "index",
157
- "include_nonoccurring",
158
- "simplification"
159
- ]);
160
- function O(e, t) {
161
- return e !== "lowestLevel" && !(t === null && ge.has(e));
162
- }
163
- function k(e) {
164
- return structuredClone(e);
165
- }
166
- function _e(e) {
167
- let t = e.datasetId ?? e.dataset_id;
168
- if (typeof t != "string" || t.length === 0) throw new S("Filter reference is missing a \"datasetId\".");
169
- return t;
170
- }
171
- function ve(e) {
172
- return C(e) ? typeof e.columnId == "string" || typeof e.column_id == "string" || typeof e.formulaId == "string" || typeof e.formula_id == "string" || typeof e.formula == "string" || (typeof e.datasetId == "string" || typeof e.dataset_id == "string") && (e.columnExpression !== void 0 || e.expression !== void 0) : !1;
173
- }
174
- function ye(e) {
175
- let t = { type: e.type };
176
- return e.bins !== void 0 && (t.bins = e.bins), Array.isArray(e.over) && (t.over = e.over.map((e) => j(e))), t;
177
- }
178
- function be(e) {
179
- let t = { type: e.type }, n = e.datasetId ?? e.dataset_id, r = e.columnId ?? e.column_id;
180
- return n !== void 0 && (t.datasetId = n), r !== void 0 && (t.columnId = r), e.level !== void 0 && O("level", e.level) && (t.level = e.level), C(e.discretization) && (t.discretization = ye(e.discretization)), e.unnest !== void 0 && O("unnest", e.unnest) && (t.unnest = e.unnest), t;
181
- }
182
- function xe(e) {
183
- let t = { type: e.type };
184
- return e.bins !== void 0 && (t.bins = e.bins), Array.isArray(e.over) && (t.over = e.over.map((e) => C(e) ? A(e) : e)), t;
185
- }
186
- function Se(e) {
187
- let t = { type: e.type }, n = e.datasetId ?? e.dataset_id, r = e.columnId ?? e.column_id;
188
- return n !== void 0 && (t.datasetId = n), r !== void 0 && (t.columnId = r), e.level !== void 0 && (t.level = e.level), C(e.discretization) && (t.discretization = xe(e.discretization)), e.unnest !== void 0 && (t.unnest = e.unnest), t;
189
- }
190
- function Ce(e, t) {
191
- e.level !== void 0 && (t.level = k(e.level)), C(e.discretization) && (t.discretization = xe(e.discretization)), C(e.aggregation) && (t.aggregation = Se(e.aggregation)), e.unnest !== void 0 && (t.unnest = k(e.unnest));
192
- }
193
- function we(e, t) {
194
- let n = e.columnId ?? e.column_id;
195
- if (n !== void 0) return {
196
- kind: "columnId",
197
- value: n
198
- };
199
- let r = e.formulaId ?? e.formula_id;
200
- if (r !== void 0) return {
201
- kind: "formulaId",
202
- value: r
203
- };
204
- if (e.formula !== void 0) return {
205
- kind: "formula",
206
- value: e.formula
207
- };
208
- let i = e.columnExpression ?? (t ? e.expression : void 0);
209
- if (i !== void 0) return {
210
- kind: "expression",
211
- value: i
212
- };
213
- }
214
- function A(e, t = !0) {
215
- let n = { datasetId: _e(e) }, r = we(e, t);
216
- return r !== void 0 && (r.kind === "expression" ? n.expression = r.value : n[r.kind] = r.value), Ce(e, n), n;
217
- }
218
- function j(e) {
219
- if (!C(e)) throw new S("Cannot emit a clean filter reference.");
220
- let t = { datasetId: _e(e) };
221
- e.level !== void 0 && O("level", e.level) && (t.level = e.level), C(e.discretization) && (t.discretization = ye(e.discretization)), C(e.aggregation) && (t.aggregation = be(e.aggregation)), e.unnest !== void 0 && O("unnest", e.unnest) && (t.unnest = e.unnest);
222
- let n = we(e, !0);
223
- if (n === void 0) throw new S("Cannot emit a clean filter reference: no column, formula, or expression.");
224
- return n.kind === "expression" ? t.columnExpression = n.value : t[n.kind] = n.value, t;
225
- }
226
- function Te(e) {
227
- if (!C(e) || typeof e.parameter != "string" || typeof e.type != "string") return e;
228
- let t = he[e.type];
229
- return t === void 0 ? e : {
230
- ...e,
231
- type: t
232
- };
233
- }
234
- function Ee(e, t) {
235
- return C(t) && typeof t.parameter == "string" ? !0 : Array.isArray(t) ? e !== "? between ?" || t.length === 2 : !1;
236
- }
237
- function De(e, t) {
238
- let n = e.expression, r = [A(e, !1)];
239
- if (!fe.has(n) && e.value !== void 0) {
240
- let t = pe.has(n) && ve(e.value);
241
- r.push(t ? A(e.value) : k(e.value));
242
- }
243
- let i = {};
244
- typeof e.id == "string" && (i.id = e.id), "ignoredItemIds" in e && (i.ignore = k(e.ignoredItemIds)), t !== void 0 && (i.type = t);
245
- let a = {
246
- expression: n,
247
- parameters: r
248
- };
249
- return Object.keys(i).length > 0 && (a.properties = i), a;
250
- }
251
- function Oe(e) {
252
- let { expression: t } = e;
253
- if (typeof t != "string" || t.length === 0) return null;
254
- let n = Array.isArray(e.parameters) ? e.parameters : [];
255
- if (!C(n[0])) throw new S(`Cannot emit a clean filter reference for "${t}".`);
256
- let r = {
257
- ...j(n[0]),
258
- expression: t
259
- };
260
- if (!fe.has(t)) {
261
- let e = n[1];
262
- if (e === void 0) throw new S(`Filter "${t}" is missing its value operand.`);
263
- if (r.value = ve(e) && pe.has(t) ? j(e) : Te(k(e)), me.has(t) && !Ee(t, r.value)) throw new S(`Cannot emit an invalid clean filter value for "${t}".`);
264
- }
265
- let { properties: i } = e;
266
- return i?.id !== void 0 && (r.id = i.id), i !== void 0 && "ignore" in i && (r.ignoredItemIds = k(i.ignore)), r;
267
- }
268
- function M(e) {
269
- return w(e);
270
- }
271
- function N(e) {
272
- return Array.isArray(e.filters) ? e.filters : [];
273
- }
274
- function ke(e, t) {
275
- return e.properties?.type === "having" || e.properties?.type === "where" ? e.properties.type : t ?? "where";
276
- }
277
- function P(e, t, n = 1, r = /* @__PURE__ */ new Set()) {
278
- D(n);
279
- let i = e.clause ?? t;
280
- for (let t of N(e)) M(t) ? P(t, i, n + 1, r) : typeof t.expression == "string" && t.expression.length > 0 && r.add(ke(t, i));
281
- return r;
282
- }
283
- function Ae(e, t, n = 1) {
284
- D(n);
285
- let r = e.clause ?? t;
286
- if (e.condition === "or" && P(e, r, n).size > 1) throw new S("An \"or\" group mixes \"where\" and \"having\" filters, which clean output cannot represent.");
287
- for (let t of N(e)) M(t) && Ae(t, r, n + 1);
288
- }
289
- function je(e, t, n, r = 1) {
290
- D(r);
291
- let i = e.clause ?? n, a = [];
292
- for (let n of N(e)) {
293
- if (M(n)) {
294
- let e = je(n, t, i, r + 1);
295
- e.filters.length > 0 && a.push(e);
296
- continue;
297
- }
298
- if (ke(n, i) !== t) continue;
299
- let e = Oe(n);
300
- e && a.push(e);
301
- }
302
- let o = {
303
- condition: e.condition === "or" ? "or" : "and",
304
- filters: a
305
- };
306
- return e.id !== void 0 && P(e, i, r).size <= 1 && (o.id = e.id), o;
307
- }
308
- function Me(e) {
309
- let t = e.clause;
310
- Ae(e, t);
311
- let n = P(e, t);
312
- return n.size === 0 && n.add(t ?? "where"), ["where", "having"].filter((e) => n.has(e)).map((n) => ({
313
- ...je(e, n, t),
314
- clause: n
315
- })).filter((e) => e.filters.length > 0);
316
- }
317
- //#endregion
318
- //#region src/components/filters/transformations/transform-filters.ts
319
- var Ne = [
320
- "origin",
321
- "datasetId",
322
- "vizId",
323
- "itemId",
324
- "isDrilldown",
325
- "type"
326
- ];
327
- function F(e) {
328
- return typeof e == "string" && e.toLowerCase() === "or" ? "or" : "and";
329
- }
330
- function Pe(e) {
331
- return w(e);
332
- }
333
- function Fe(e) {
334
- if (!Array.isArray(e) || e.length === 0) return [];
335
- let t = C(e[0]) ? e[0] : void 0, n = e.length > 1 ? e[1] : void 0;
336
- return e.length > 1 ? [t, n] : [t];
337
- }
338
- function Ie(e) {
339
- if (typeof e.expression != "string" || e.expression.length === 0) return null;
340
- let t = {
341
- expression: e.expression,
342
- parameters: Fe(e.parameters)
343
- };
344
- return e.properties !== void 0 && Object.keys(e.properties).length > 0 && (t.properties = structuredClone(e.properties)), t;
345
- }
346
- function Le(e, t) {
347
- let n = e, r = t;
348
- for (let e of Ne) n[e] !== void 0 && (r[e] = n[e]);
349
- }
350
- function Re(e) {
351
- if (!e || !e.filters) return {
352
- condition: "and",
353
- filters: [],
354
- subGroups: []
355
- };
356
- let t = [], n = [];
357
- for (let r of e.filters) if (Pe(r)) n.push(Re(r));
358
- else {
359
- let e = Ie(r);
360
- e && t.push(e);
361
- }
362
- let r = {
363
- condition: F(e.condition),
364
- filters: t,
365
- subGroups: n
366
- };
367
- return e.id !== void 0 && (r.id = e.id), Le(e, r), r;
368
- }
369
- function I(e, t) {
370
- return e ? t?.format === "clean" ? Me(e) : [Re(e)] : [];
371
- }
372
- function ze(e, t) {
373
- let n = {
374
- expression: typeof e.expression == "string" ? e.expression : void 0,
375
- parameters: Array.isArray(e.parameters) ? [...e.parameters] : []
376
- }, r = C(e.properties) ? structuredClone(e.properties) : {};
377
- return t !== void 0 && r.type === void 0 && (r.type = t), Object.keys(r).length > 0 && (n.properties = r), n;
378
- }
379
- function Be(e, t, n) {
380
- if (w(e)) return L(e, t, n);
381
- if (!C(e)) return;
382
- let r = e.expression;
383
- if (ce(e), oe(e)) return De(e, t);
384
- if (E(e) && le(e), se(e)) return ze(e, t);
385
- throw new S(`Filter leaf "${String(r)}" matches neither a complete clean nor a complete canonical encoding.`);
386
- }
387
- function L(e, t, n) {
388
- D(n);
389
- let r = ue(e.clause) ? e.clause : void 0, i = r ?? t, a = [];
390
- for (let t of Array.isArray(e.filters) ? e.filters : []) {
391
- let e = Be(t, i, n + 1);
392
- e !== void 0 && a.push(e);
393
- }
394
- for (let t of Array.isArray(e.subGroups) ? e.subGroups : []) w(t) && a.push(L(t, i, n + 1));
395
- let o = {
396
- condition: F(e.condition),
397
- filters: a
398
- };
399
- return typeof e.id == "string" && (o.id = e.id), r !== void 0 && (o.clause = r), Le(e, o), o;
400
- }
401
- function Ve(e) {
402
- return !e || e.length === 0 ? [] : e.filter((e) => w(e)).map((e) => L(e, void 0, 1));
403
- }
404
- //#endregion
405
- //#region src/utils/filters/expressions.ts
406
- var R = () => [
407
- {
408
- id: "? = ?",
409
- key: "? = ?",
410
- expression: "? = ?",
411
- name: v("equals", { desc: "Filter expression for equals comparison" }),
412
- description: v("equals", { desc: "Filter expression for equals comparison" }),
413
- tiny: v("eq", { desc: "Short form of equals comparison" }),
414
- type: ["numeric", "hierarchy"],
415
- subtype: ["ip_address"]
416
- },
417
- {
418
- id: "? != ?",
419
- key: "? != ?",
420
- expression: "? != ?",
421
- name: v("not equals", { desc: "Filter expression for not equals comparison" }),
422
- description: v("not equals", { desc: "Filter expression for not equals comparison" }),
423
- tiny: v("not eq", { desc: "Short form of not equals comparison" }),
424
- type: ["numeric", "hierarchy"],
425
- subtype: ["ip_address"]
426
- },
427
- {
428
- id: "? in ?",
429
- key: "? in ?",
430
- expression: "? in ?",
431
- name: v("is in", { desc: "Filter expression for in comparison" }),
432
- description: v("is in", { desc: "Filter expression for in comparison" }),
433
- tiny: v("is in", { desc: "Filter expression for in comparison" }),
434
- type: ["numeric", "hierarchy"],
435
- subtype: ["ip_address"]
436
- },
437
- {
438
- id: "? not in ?",
439
- key: "? not in ?",
440
- expression: "? not in ?",
441
- name: v("is not in", { desc: "Filter expression for not in comparison" }),
442
- description: v("is not in", { desc: "Filter expression for not in comparison" }),
443
- tiny: v("is not in", { desc: "Filter expression for not in comparison" }),
444
- type: ["numeric", "hierarchy"],
445
- subtype: ["ip_address"]
446
- },
447
- {
448
- id: "? like ?",
449
- key: "? like ?",
450
- expression: "? like ?",
451
- name: v("contains", { desc: "Filter expression for contains comparison" }),
452
- description: v("contains", { desc: "Filter expression for contains comparison" }),
453
- tiny: v("cont", { desc: "Short form of contains comparison in filter expression" }),
454
- type: ["hierarchy"],
455
- subtype: ["ip_address"]
456
- },
457
- {
458
- id: "? not like ?",
459
- key: "? not like ?",
460
- expression: "? not like ?",
461
- name: v("does not contain", { desc: "Filter expression for does not contain comparison" }),
462
- description: v("does not contain", { desc: "Filter expression for does not contain comparison" }),
463
- tiny: v("not cont", { desc: "Short form of does not contain comparison in filter expression" }),
464
- type: ["hierarchy"],
465
- subtype: ["ip_address"]
466
- },
467
- {
468
- id: "? starts with ?",
469
- key: "? starts with ?",
470
- expression: "? starts with ?",
471
- name: v("starts with", { desc: "Filter expression for starts with comparison" }),
472
- description: v("starts with", { desc: "Filter expression for starts with comparison" }),
473
- tiny: v("starts with", { desc: "Filter expression for starts with comparison" }),
474
- type: ["hierarchy"],
475
- subtype: ["ip_address"]
476
- },
477
- {
478
- id: "? not starts with ?",
479
- key: "? not starts with ?",
480
- expression: "? not starts with ?",
481
- name: v("does not start with", { desc: "Filter expression for does not start with comparison" }),
482
- description: v("does not start with", { desc: "Filter expression for does not start with comparison" }),
483
- tiny: v("not starts with", { desc: "Short form of does not start with comparison in filter expression" }),
484
- type: ["hierarchy"],
485
- subtype: ["ip_address"]
486
- },
487
- {
488
- id: "? ends with ?",
489
- key: "? ends with ?",
490
- expression: "? ends with ?",
491
- name: v("ends with", { desc: "Filter expression for ends with comparison" }),
492
- description: v("ends with", { desc: "Filter expression for ends with comparison" }),
493
- tiny: v("ends with", { desc: "Filter expression for ends with comparison" }),
494
- type: ["hierarchy"],
495
- subtype: ["ip_address"]
496
- },
497
- {
498
- id: "? not ends with ?",
499
- key: "? not ends with ?",
500
- expression: "? not ends with ?",
501
- name: v("does not end with", { desc: "Filter expression for does not end with comparison" }),
502
- description: v("does not end with", { desc: "Filter expression for does not end with comparison" }),
503
- tiny: v("not ends with", { desc: "Short form of does not end with comparison in filter expression" }),
504
- type: ["hierarchy"],
505
- subtype: ["ip_address"]
506
- },
507
- {
508
- id: "? < ?",
509
- key: "? < ?",
510
- expression: "? < ?",
511
- name: v("less than", { desc: "Filter expression for less than comparison" }),
512
- description: v("less than", { desc: "Filter expression for less than comparison" }),
513
- tiny: "<",
514
- type: ["numeric", "datetime"],
515
- subtype: ["ip_address"]
516
- },
517
- {
518
- id: "? <= ?",
519
- key: "? <= ?",
520
- expression: "? <= ?",
521
- name: v("less than or equal", { desc: "Filter expression for less than or equal comparison" }),
522
- description: v("less than or equal", { desc: "Filter expression for less than or equal comparison" }),
523
- tiny: "<=",
524
- type: ["numeric", "datetime"],
525
- subtype: ["ip_address"]
526
- },
527
- {
528
- id: "? > ?",
529
- key: "? > ?",
530
- expression: "? > ?",
531
- name: v("greater than", { desc: "Filter expression for greater than comparison" }),
532
- description: v("greater than", { desc: "Filter expression for greater than comparison" }),
533
- tiny: ">",
534
- type: ["numeric", "datetime"],
535
- subtype: ["ip_address"]
536
- },
537
- {
538
- id: "? >= ?",
539
- key: "? >= ?",
540
- expression: "? >= ?",
541
- name: v("greater than or equal", { desc: "Filter expression for greater than or equal comparison" }),
542
- description: v("greater than or equal", { desc: "Filter expression for greater than or equal comparison" }),
543
- tiny: ">=",
544
- type: ["numeric", "datetime"],
545
- subtype: ["ip_address"]
546
- },
547
- {
548
- id: "? between ?",
549
- key: "? between ?",
550
- expression: "? between ?",
551
- name: v("is between", { desc: "Filter expression for between comparison" }),
552
- description: v("is between", { desc: "Filter expression for between comparison" }),
553
- tiny: v("between", { desc: "Short form of between comparison in filter expression" }),
554
- type: [],
555
- subtype: ["ip_address"]
556
- },
557
- {
558
- id: "last_now",
559
- key: "last_now",
560
- expression: "last_now",
561
- name: v("last (x) periods", { desc: "Filter expression for last (x) periods" }),
562
- description: v("last (x) periods", { desc: "Filter expression for last (x) periods" }),
563
- tiny: v("last", { desc: "Short form of last (x) periods in filter expression" }),
564
- type: ["datetime"]
565
- },
566
- {
567
- id: "last_available",
568
- key: "last_available",
569
- expression: "last_available",
570
- name: v("last (x) available periods", { desc: "Filter expression for last (x) available periods" }),
571
- description: v("last (x) available periods", { desc: "Filter expression for last (x) available periods" }),
572
- tiny: v("last available", { desc: "Short form of last (x) available periods in filter expression" }),
573
- type: ["datetime"]
574
- },
575
- {
576
- id: "last_completed",
577
- key: "last_completed",
578
- expression: "last_completed",
579
- name: v("last completed period", { desc: "Filter expression for last completed period" }),
580
- description: v("last completed (period)", { desc: "Filter expression for last completed period" }),
581
- tiny: v("last completed", { desc: "Short form of last completed period in filter expression" }),
582
- type: ["datetime"]
583
- },
584
- {
585
- id: "next_now",
586
- key: "next_now",
587
- expression: "next_now",
588
- name: v("next (x) periods", { desc: "Filter expression for next (x) periods" }),
589
- description: v("next (x) periods", { desc: "Filter expression for next (x) periods" }),
590
- tiny: v("next", { desc: "Short form of next (x) periods in filter expression" }),
591
- type: ["datetime"]
592
- },
593
- {
594
- id: "more_than_ago",
595
- key: "more_than_ago",
596
- expression: "more_than_ago",
597
- name: v("more than (x) periods ago", { desc: "Filter expression for more than (x) periods ago" }),
598
- description: v("more than (x) periods ago", { desc: "Filter expression for more than (x) periods ago" }),
599
- tiny: v("more than ago", { desc: "Short form of more than (x) periods ago in filter expression" }),
600
- type: ["datetime"]
601
- },
602
- {
603
- id: "or_more_ago",
604
- key: "or_more_ago",
605
- expression: "or_more_ago",
606
- name: v("(x) periods or more ago", { desc: "Filter expression for (x) periods or more ago" }),
607
- description: v("(x) periods or more ago", { desc: "Filter expression for (x) periods or more ago" }),
608
- tiny: v("or more ago", { desc: "Short form of (x) periods or more ago in filter expression" }),
609
- type: ["datetime"]
610
- },
611
- {
612
- id: "next_full",
613
- key: "next_full",
614
- expression: "next_full",
615
- name: v("next full (period)", { desc: "Filter expression for next full period" }),
616
- description: v("next full (period)", { desc: "Filter expression for next full period" }),
617
- tiny: v("next full", { desc: "Short form of next full period in filter expression" }),
618
- type: ["datetime"]
619
- },
620
- {
621
- id: "WTD",
622
- key: "to_date",
623
- expression: "to_date",
624
- unit: 4,
625
- name: v("week to date", { desc: "Filter expression for week to date" }),
626
- description: v("week to date", { desc: "Filter expression for week to date" }),
627
- tiny: v("WTD", { desc: "Short form of week to date in filter expression" }),
628
- type: ["datetime"]
629
- },
630
- {
631
- id: "MTD",
632
- key: "to_date",
633
- expression: "to_date",
634
- unit: 3,
635
- name: v("month to date", { desc: "Filter expression for month to date" }),
636
- description: v("month to date", { desc: "Filter expression for month to date" }),
637
- tiny: v("MTD", { desc: "Short form of month to date in filter expression" }),
638
- type: ["datetime"]
639
- },
640
- {
641
- id: "QTD",
642
- key: "to_date",
643
- expression: "to_date",
644
- unit: 2,
645
- name: v("quarter to date", { desc: "Filter expression for quarter to date" }),
646
- description: v("quarter to date", { desc: "Filter expression for quarter to date" }),
647
- tiny: v("QTD", { desc: "Short form of quarter to date in filter expression" }),
648
- type: ["datetime"]
649
- },
650
- {
651
- id: "YTD",
652
- key: "to_date",
653
- expression: "to_date",
654
- unit: 1,
655
- name: v("year to date", { desc: "Filter expression for year to date" }),
656
- description: v("year to date", { desc: "Filter expression for year to date" }),
657
- tiny: v("YTD", { desc: "Short form of year to date in filter expression" }),
658
- type: ["datetime"]
659
- },
660
- {
661
- id: "? is null",
662
- key: "? is null",
663
- expression: "? is null",
664
- name: v("is missing", { desc: "Filter expression for is missing" }),
665
- description: v("is missing", { desc: "Filter expression for is missing" }),
666
- tiny: v("missing", { desc: "Short form of is missing in filter expression" }),
667
- type: [
668
- "numeric",
669
- "datetime",
670
- "hierarchy",
671
- "spatial"
672
- ],
673
- subtype: ["ip_address"]
674
- },
675
- {
676
- id: "? is not null",
677
- key: "? is not null",
678
- expression: "? is not null",
679
- name: v("is not missing", { desc: "Filter expression for is not missing" }),
680
- description: v("is not missing", { desc: "Filter expression for is not missing" }),
681
- tiny: v("not missing", { desc: "Short form of is not missing in filter expression" }),
682
- type: [
683
- "numeric",
684
- "datetime",
685
- "hierarchy",
686
- "spatial"
687
- ],
688
- subtype: ["ip_address"]
689
- }
690
- ], z = (e, t, n) => {
691
- let r = /* @__PURE__ */ new Set(["? in ?", "? not in ?"]);
692
- return !e && !t ? R() : R().filter((i) => (e && i.type.includes(e) || t && i.subtype?.includes(t)) && !(n && r.has(i.key)));
693
- }, He = ":host{font-family:var(--luzmo-font-family)}luzmo-select{width:100%}:host{--var:blue}", B = class extends t(x(b, { validSizes: Object.values(y) })) {
694
- constructor(...e) {
695
- super(...e), this.hasLabel = !1, this.allowEmpty = !1, this.placeholder = "", this.disabled = !1, this.invalid = !1, this.isFormula = !1, this._expressionConfigurations = R();
696
- }
697
- static get styles() {
698
- return [p(He)];
699
- }
700
- _sendChangeEvent() {
701
- if (this.disabled) return;
702
- let e = { expression: this.filter?.expression };
703
- this.filter?.parameters?.[1]?.unit && (e.unit = this.filter?.parameters?.[1]?.unit), this.dispatchEvent(new CustomEvent("luzmo-expression-selected", {
704
- bubbles: !0,
705
- composed: !0,
706
- cancelable: !0,
707
- detail: e
708
- }));
709
- }
710
- setExpression(e) {
711
- this._richExpression = e?.detail?.value?.[0];
712
- let t = this._expressionConfigurations.find((e) => e.id === this._richExpression), n = structuredClone(this.filter);
713
- n.expression = t?.expression, t?.unit && (this._unit = t.unit, n?.parameters[0] && (n.parameters[1] = { unit: this._unit })), this.filter = n, this._sendChangeEvent();
714
- }
715
- willUpdate(e) {
716
- super.willUpdate(e);
717
- let t = e.has("filter"), n = e.has("type"), r = e.has("subtype"), i = e.has("isFormula"), a = z(this.type, this.subtype, this.isFormula), o = [
718
- "YTD",
719
- "QTD",
720
- "MTD",
721
- "WTD"
722
- ];
723
- if (this.filter?.expression === "to_date") {
724
- let e = this.filter?.parameters[1]?.unit ?? 1;
725
- this._unit = e, this._richExpression = o[e - 1] ?? "YTD";
726
- } else this._richExpression = this.filter?.expression;
727
- (n || r || i || t) && this.filter && !this.disabled && !a?.find((e) => e.expression === this.filter?.expression) ? (this.invalid = !0, console.warn(`Warning: ${this.filter?.expression} is not valid given the type: ${this.type} and subtype: ${this.subtype}`)) : this.invalid = !1, !this.filter?.expression && !this.allowEmpty && (this._richExpression = a?.[0]?.id, this.filter = {
728
- ...this.filter,
729
- expression: this._richExpression
730
- }, this._sendChangeEvent());
731
- }
732
- render() {
733
- let e = z(this.type, this.subtype, this.isFormula)?.map((e) => ({
734
- value: e.id,
735
- label: e.description,
736
- shortLabel: e.tiny
737
- })), t = this.disabled || !this.filter?.expression && !this.allowEmpty, n = d`<luzmo-field-label
738
- for="expression"
739
- size=${this.size}
740
- >${this.label ?? v("Select an expression", { desc: "Label for expression picker" })}</luzmo-field-label
741
- >`, r = this.hasLabel ? this.placeholder ?? v("Select...") : this.placeholder || this.label || v("Filter expression", { desc: "Accessible label for expression picker" });
742
- return d`${this.hasLabel ? n : ""}
743
- <luzmo-select
744
- label=${r}
745
- id="expression"
746
- size=${this.size}
747
- variant="highlight"
748
- selects="single"
749
- .language=${this.language}
750
- ?disabled=${t}
751
- ?invalid=${this.invalid}
752
- .options=${e}
753
- .value=${[this._richExpression]}
754
- @change=${this.setExpression}
755
- >
756
- </luzmo-select>`;
757
- }
758
- };
759
- //#endregion
760
- //#region src/components/filter-expression-picker/index.ts
761
- e([m({
762
- type: String,
763
- reflect: !0
764
- })], B.prototype, "filter", void 0), e([m({
765
- type: Boolean,
766
- attribute: "has-label",
767
- reflect: !0
768
- })], B.prototype, "hasLabel", void 0), e([m({
769
- type: String,
770
- reflect: !0
771
- })], B.prototype, "label", void 0), e([m({
772
- type: Boolean,
773
- attribute: "allow-empty",
774
- reflect: !0
775
- })], B.prototype, "allowEmpty", void 0), e([m({
776
- type: String,
777
- attribute: "placeholder",
778
- reflect: !0
779
- })], B.prototype, "placeholder", void 0), e([m({
780
- type: Boolean,
781
- attribute: "disabled",
782
- reflect: !0
783
- })], B.prototype, "disabled", void 0), e([m({
784
- type: String,
785
- attribute: "type",
786
- reflect: !0
787
- })], B.prototype, "type", void 0), e([m({
788
- type: String,
789
- attribute: "subtype",
790
- reflect: !0
791
- })], B.prototype, "subtype", void 0), e([m({
792
- type: Boolean,
793
- attribute: "invalid",
794
- reflect: !0
795
- })], B.prototype, "invalid", void 0), e([m({
796
- type: Boolean,
797
- attribute: "is-formula",
798
- reflect: !0
799
- })], B.prototype, "isFormula", void 0), e([g()], B.prototype, "_richExpression", void 0), e([g()], B.prototype, "_unit", void 0), B = e([_()], B), customElements.get("luzmo-filter-expression-picker") || customElements.define("luzmo-filter-expression-picker", B);
800
- //#endregion
801
- //#region src/components/filter-parameter-picker/filter-parameter-picker.helpers.ts
802
- var Ue = /* @__PURE__ */ new Set([
803
- "? is null",
804
- "? is not null",
805
- "? between ?",
806
- "YTD",
807
- "QTD",
808
- "MTD",
809
- "WTD",
810
- "to_date",
811
- "last_available",
812
- "last_completed",
813
- "last_now",
814
- "more_than_ago",
815
- "or_more_ago",
816
- "next_now",
817
- "next_full"
818
- ]), We = /* @__PURE__ */ new Set([
819
- "? length = ?",
820
- "? length >= ?",
821
- "? length <= ?"
822
- ]), V = /* @__PURE__ */ new Set([
823
- "? in ?",
824
- "? not in ?",
825
- "? includes all ?",
826
- "? includes any ?",
827
- "? includes only ?"
828
- ]);
829
- function H(e, t) {
830
- return !e || e === "spatial" || !t || Ue.has(t) ? [] : We.has(t) ? ["numeric"] : e === "numeric" || e === "array[numeric]" ? V.has(t) ? ["array[numeric]"] : ["numeric"] : e === "datetime" || e === "array[datetime]" ? V.has(t) ? ["array[datetime]", "datetime"] : ["datetime", "array[datetime]"] : e === "hierarchy" || e === "array[hierarchy]" ? V.has(t) ? ["array[hierarchy]"] : ["hierarchy"] : [];
831
- }
832
- var Ge = {
833
- numeric: () => v("Numeric", {
834
- id: "filter-parameter-type-numeric",
835
- desc: "Numeric filter parameter type"
836
- }),
837
- datetime: () => v("Datetime", {
838
- id: "filter-parameter-type-datetime",
839
- desc: "Datetime filter parameter type"
840
- }),
841
- hierarchy: () => v("Hierarchy", {
842
- id: "filter-parameter-type-hierarchy",
843
- desc: "Hierarchy filter parameter type"
844
- }),
845
- "array[numeric]": () => v("Numeric[]", {
846
- id: "filter-parameter-type-numeric-list",
847
- desc: "List of numeric values filter parameter type"
848
- }),
849
- "array[datetime]": () => v("Datetime[]", {
850
- id: "filter-parameter-type-datetime-list",
851
- desc: "List of datetime values filter parameter type"
852
- }),
853
- "array[hierarchy]": () => v("Hierarchy[]", {
854
- id: "filter-parameter-type-hierarchy-list",
855
- desc: "List of hierarchy values filter parameter type"
856
- })
857
- };
858
- function Ke(e) {
859
- return Ge[e]?.() ?? e;
860
- }
861
- function U(e) {
862
- if (!e || typeof e != "object" || Array.isArray(e)) return !1;
863
- let t = e;
864
- return typeof t.parameter == "string" && typeof t.type == "string" && "value" in t;
865
- }
866
- function W(e) {
867
- return `metadata.${e.trim().replace(/^metadata\./i, "")}`;
868
- }
869
- function qe(e, t, n) {
870
- let r;
871
- if (t.startsWith("array[")) r = Array.isArray(n) ? structuredClone(n) : [];
872
- else if (t === "numeric") r = typeof n == "number" && Number.isFinite(n) ? n : 0;
873
- else if (t === "datetime") {
874
- let e = n instanceof Date ? n : new Date(typeof n == "string" ? n : Date.now());
875
- r = Number.isNaN(e.getTime()) ? (/* @__PURE__ */ new Date()).toISOString() : e.toISOString();
876
- } else r = typeof n == "string" ? n : "";
877
- return {
878
- parameter: W(e),
879
- type: t,
880
- value: r
881
- };
882
- }
883
- function G(e, t) {
884
- if (!t || t === "? is null" || t === "? is not null") return;
885
- let [n] = H(e, t);
886
- if (n?.startsWith("array[")) return [];
887
- if (n === "numeric") return 0;
888
- if (n === "datetime") return (/* @__PURE__ */ new Date()).toISOString();
889
- if (n === "hierarchy") return "";
890
- }
891
- //#endregion
892
- //#region src/components/filter-parameter-picker/filter-parameter-picker.module.scss?inline
893
- var Je = ":host{min-width:0;max-width:100%;color:var(--luzmo-font-color);font-family:var(--luzmo-font-family);font-size:var(--luzmo-font-size);align-items:center;display:inline-flex;position:relative}.parameter-control{align-items:center;gap:var(--filter-parameter-picker-gap);min-width:0;max-width:100%;display:flex}.create-row{align-items:center;gap:var(--filter-parameter-picker-panel-gap);display:flex}.parameter-trigger,.create-parameter{flex:none}.parameter-trigger{font-weight:var(--luzmo-font-weight-bold)}.selected-parameter-tags{--luzmo-tag-group-item-margin-block:0;min-width:0;max-width:100%}.selected-parameter{--luzmo-tag-max-inline-size:min(180px, 100%);min-width:0;max-width:100%}.parameter-panel{min-inline-size:var(--filter-parameter-picker-panel-min-width);padding:var(--filter-parameter-picker-panel-padding);display:block}.parameter-name-input{--luzmo-text-field-width:100%;flex:1;min-inline-size:0}.panel-content{gap:var(--filter-parameter-picker-panel-gap);flex-direction:column;display:flex}.validation-message{color:var(--filter-parameter-picker-error-color);font-size:var(--luzmo-font-size-s)}.parameter-options{max-block-size:var(--filter-parameter-picker-options-max-height);overflow-y:auto}.parameter-type-footer{gap:var(--filter-parameter-picker-panel-gap);flex-direction:column;display:flex}.parameter-type{justify-content:flex-end;align-items:center;gap:var(--luzmo-spacing-1);font-size:var(--filter-parameter-picker-type-font-size);font-weight:var(--luzmo-font-weight);display:flex}.parameter-type-icon{justify-content:center;align-items:center;min-block-size:24px;min-inline-size:24px;display:inline-flex}:host{--filter-parameter-picker-gap:var(--luzmo-spacing-2);--filter-parameter-picker-control-size:var(--luzmo-component-height);--filter-parameter-picker-panel-min-width:220px;--filter-parameter-picker-options-max-height:240px;--filter-parameter-picker-panel-padding:var(--luzmo-spacing-3);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-3);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-s);--filter-parameter-picker-panel-background:var(--luzmo-background-color);--filter-parameter-picker-panel-border:var(--luzmo-border-color);--filter-parameter-picker-error-color:var(--luzmo-negative-color)}:host([size=xxs]),:host([size=xs]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-2);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-2);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-xs)}:host([size=s]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-3);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-3);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-xs)}:host([size=l]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-4);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-4);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-m)}:host([size=xl]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-4);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-4);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-l)}:host([size=xxl]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-5);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-5);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-xl)}", K = class extends t(x(b, { validSizes: Object.values(y) })) {
894
- constructor(...e) {
895
- super(...e), this.parameters = [], this.allowedTypes = [], this.disabled = !1, this._open = !1, this._newParameterName = "", this._handleDocumentClick = (e) => {
896
- this._open && !e.composedPath().includes(this) && this._close();
897
- };
898
- }
899
- static get styles() {
900
- return [...super.styles ?? [], p(Je)];
901
- }
902
- connectedCallback() {
903
- super.connectedCallback(), document.addEventListener("click", this._handleDocumentClick);
904
- }
905
- disconnectedCallback() {
906
- document.removeEventListener("click", this._handleDocumentClick), super.disconnectedCallback();
907
- }
908
- get _selectableParameters() {
909
- return this.parameters.filter((e) => this.allowedTypes.includes(e.type));
910
- }
911
- get _parameterOptions() {
912
- return this._selectableParameters.map((e) => ({
913
- label: e.parameter.replace(/^metadata\./i, ""),
914
- value: e.parameter
915
- }));
916
- }
917
- get _parameterType() {
918
- return this.selectedParameter?.type ?? this.allowedTypes[0];
919
- }
920
- get _duplicateName() {
921
- if (!this._hasParameterName) return !1;
922
- let e = W(this._newParameterName).toLowerCase();
923
- return this.parameters.some((t) => W(t.parameter).toLowerCase() === e);
924
- }
925
- get _triggerIconSize() {
926
- return {
927
- xxs: "xs",
928
- xs: "xs",
929
- s: "xs",
930
- m: "xs",
931
- l: "s",
932
- xl: "m",
933
- xxl: "l"
934
- }[this.size] ?? "xs";
935
- }
936
- get _hasParameterName() {
937
- return W(this._newParameterName).replace(/^metadata\./i, "").trim().length > 0;
938
- }
939
- _dispatchSelected(e) {
940
- this.dispatchEvent(new CustomEvent("luzmo-parameter-selected", {
941
- bubbles: !0,
942
- composed: !0,
943
- detail: { parameter: e }
944
- }));
945
- }
946
- _dispatchCreated(e) {
947
- this.dispatchEvent(new CustomEvent("luzmo-parameter-created", {
948
- bubbles: !0,
949
- composed: !0,
950
- detail: { parameter: e }
951
- }));
952
- }
953
- _dispatchRemoved(e) {
954
- this.dispatchEvent(new CustomEvent("luzmo-parameter-removed", {
955
- bubbles: !0,
956
- composed: !0,
957
- detail: { parameter: e }
958
- }));
959
- }
960
- async _handleTriggerClick() {
961
- this.disabled || this.allowedTypes.length === 0 || !this._overlay || (this._open = !0, this._newParameterName = "", this._overlay.open = !0, await this.updateComplete, this.shadowRoot?.querySelector(".parameter-name-input")?.focusElement.focus());
962
- }
963
- _handleTriggerKeydown(e) {
964
- e.key !== "Enter" && e.key !== " " && e.key !== "Space" || (e.preventDefault(), this._handleTriggerClick());
965
- }
966
- _handleOpened() {
967
- this.shadowRoot?.querySelector(".parameter-name-input")?.focusElement.focus();
968
- }
969
- _handleClosed() {
970
- this._open = !1, this._newParameterName = "";
971
- }
972
- _close() {
973
- this._overlay && (this._overlay.open = !1), this._handleClosed(), this._triggerElement?.focusElement.focus();
974
- }
975
- _handlePanelKeydown(e) {
976
- e.key === "Escape" && (e.preventDefault(), this._close());
977
- }
978
- _handleNameInput(e) {
979
- this._newParameterName = e.currentTarget.value;
980
- }
981
- _selectParameter(e) {
982
- this.selectedParameter = e, this._dispatchSelected(e), this._close();
983
- }
984
- _handleOptionsChange(e) {
985
- e.stopPropagation();
986
- let [t] = e.detail.value, n = this._selectableParameters.find((e) => e.parameter === t);
987
- n && this._selectParameter(n);
988
- }
989
- async _handleCreateParameter() {
990
- let e = this.allowedTypes[0];
991
- if (!e || !this._hasParameterName || this._duplicateName) return;
992
- let t = qe(this._newParameterName, e, this.currentValue);
993
- this.parameters = [...this.parameters, t], this._newParameterName = "", this._dispatchCreated(t), await this.updateComplete, this.shadowRoot?.querySelector(".parameter-name-input")?.focusElement.focus();
994
- }
995
- _handleNameKeydown(e) {
996
- if (e.key === "Enter") {
997
- e.preventDefault(), this._handleCreateParameter();
998
- return;
999
- }
1000
- e.key === "ArrowDown" && this._optionsElement && (e.preventDefault(), this._optionsElement.focus());
1001
- }
1002
- _handleRemoveParameter() {
1003
- this.selectedParameter && this._dispatchRemoved(this.selectedParameter);
1004
- }
1005
- _renderParameterType() {
1006
- let e = this._parameterType;
1007
- if (!e) return f;
1008
- let t = Ke(e);
1009
- return d`
1010
- <div class="parameter-type-footer">
1011
- <luzmo-divider class="parameter-type-divider" size="s"></luzmo-divider>
1012
- <div class="parameter-type">
1013
- <span>${v("Parameter type:", { desc: "Label preceding the type of the filter parameter" })}</span>
1014
- <span class="parameter-type-icon" tabindex="0" role="img" aria-label=${t}>
1015
- <luzmo-icon
1016
- aria-hidden="true"
1017
- .icon=${i({ type: e }, "s")}
1018
- size="s"
1019
- ></luzmo-icon>
1020
- <luzmo-tooltip self-managed placement="top" .size=${this.size}>${t}</luzmo-tooltip>
1021
- </span>
1022
- </div>
1023
- </div>
1024
- `;
1025
- }
1026
- render() {
1027
- let e = this.selectedParameter?.parameter.replace(/^metadata\./i, ""), t = !this._hasParameterName || this._duplicateName;
1028
- return d`
1029
- <div class="parameter-control">
1030
- ${this.selectedParameter ? d`
1031
- <luzmo-tags class="selected-parameter-tags">
1032
- <luzmo-tag
1033
- class="selected-parameter"
1034
- size=${this.size}
1035
- variant="accent"
1036
- treatment="fill"
1037
- ?deletable=${!this.disabled}
1038
- ?disabled=${this.disabled}
1039
- aria-label=${v("Remove parameter", { desc: "Detach a parameter from a filter" })}
1040
- @delete=${this._handleRemoveParameter}
1041
- >
1042
- ${e}
1043
- </luzmo-tag>
1044
- </luzmo-tags>
1045
- ` : f}
1046
- <luzmo-action-button
1047
- id="parameter-trigger"
1048
- class="parameter-trigger"
1049
- size=${this.size}
1050
- ?quiet=${!this.selectedParameter}
1051
- .variant=${this.selectedParameter ? "primary" : "neutral"}
1052
- aria-label=${v("Use parameter", { desc: "Open the filter parameter picker" })}
1053
- .label=${v("Use parameter", { desc: "Open the filter parameter picker" })}
1054
- aria-haspopup="dialog"
1055
- aria-expanded=${this._open ? "true" : "false"}
1056
- .disabled=${this.disabled || this.allowedTypes.length === 0}
1057
- @click=${this._handleTriggerClick}
1058
- @keydown=${this._handleTriggerKeydown}
1059
- >
1060
- <luzmo-icon slot="icon" .icon=${c} .size=${this._triggerIconSize}></luzmo-icon>
1061
- </luzmo-action-button>
1062
- <luzmo-overlay
1063
- type="manual"
1064
- placement="bottom-end"
1065
- trigger="parameter-trigger"
1066
- receives-focus="false"
1067
- @luzmo-opened=${this._handleOpened}
1068
- @luzmo-closed=${this._handleClosed}
1069
- >
1070
- <luzmo-popover
1071
- class="parameter-panel"
1072
- size=${this.size}
1073
- role="dialog"
1074
- aria-label=${v("Filter parameters", { desc: "Filter parameter picker dialog label" })}
1075
- @keydown=${this._handlePanelKeydown}
1076
- >
1077
- <div class="panel-content">
1078
- <div class="create-row">
1079
- <luzmo-text-field
1080
- id="parameter-name"
1081
- class="parameter-name-input"
1082
- size=${this.size}
1083
- .label=${v("Parameter name", { desc: "Name for a new filter parameter" })}
1084
- .placeholder=${v("New parameter…", { desc: "Placeholder of the new filter parameter name field" })}
1085
- .invalid=${this._duplicateName}
1086
- .value=${this._newParameterName}
1087
- @input=${this._handleNameInput}
1088
- @keydown=${this._handleNameKeydown}
1089
- ></luzmo-text-field>
1090
- <luzmo-button
1091
- class="create-parameter"
1092
- size=${this.size}
1093
- variant="primary"
1094
- ?disabled=${t}
1095
- @click=${this._handleCreateParameter}
1096
- >
1097
- ${v("Add", { desc: "Create a new filter parameter" })}
1098
- </luzmo-button>
1099
- </div>
1100
- ${this._duplicateName ? d`<div class="validation-message" role="alert">
1101
- ${v("A parameter with this name already exists.", { desc: "Duplicate filter parameter name error" })}
1102
- </div>` : f}
1103
- ${this._parameterOptions.length > 0 ? d`<luzmo-options
1104
- class="parameter-options"
1105
- size=${this.size}
1106
- .label=${v("Available parameters", { desc: "Accessible label of the filter parameter list" })}
1107
- .options=${this._parameterOptions}
1108
- .value=${this.selectedParameter ? [this.selectedParameter.parameter] : []}
1109
- @change=${this._handleOptionsChange}
1110
- ></luzmo-options>` : f}
1111
- ${this._renderParameterType()}
1112
- </div>
1113
- </luzmo-popover>
1114
- </luzmo-overlay>
1115
- </div>
1116
- `;
1117
- }
1118
- };
1119
- //#endregion
1120
- //#region src/components/filter-parameter-picker/index.ts
1121
- e([m({ attribute: !1 })], K.prototype, "parameters", void 0), e([m({ attribute: !1 })], K.prototype, "allowedTypes", void 0), e([m({ attribute: !1 })], K.prototype, "selectedParameter", void 0), e([m({ attribute: !1 })], K.prototype, "currentValue", void 0), e([m({
1122
- type: Boolean,
1123
- reflect: !0
1124
- })], K.prototype, "disabled", void 0), e([g()], K.prototype, "_open", void 0), e([g()], K.prototype, "_newParameterName", void 0), e([h("luzmo-overlay")], K.prototype, "_overlay", void 0), e([h(".parameter-trigger")], K.prototype, "_triggerElement", void 0), e([h(".parameter-options")], K.prototype, "_optionsElement", void 0), K = e([_()], K), typeof customElements < "u" && !customElements.get("luzmo-filter-parameter-picker") && customElements.define("luzmo-filter-parameter-picker", K);
1125
- //#endregion
1126
- //#region src/components/filter-value-picker/filter-value-picker.module.scss?inline
1127
- var Ye = ":host{flex-direction:row;min-width:0;max-width:100%;display:flex}luzmo-text-field{min-width:var(--luzmo-filter-value-picker-control-min-width,var(--filter-value-picker-control-min-width));max-width:100%}luzmo-filter-value-picker-datetime,luzmo-filter-value-picker-hierarchy,luzmo-filter-value-picker-numeric{flex:1;min-width:0;max-width:100%}:host{--filter-value-picker-control-min-width:0}", Xe = ":host{gap:var(--luzmo-filter-value-picker-datetime-gap,var(--filter-value-picker-datetime-gap));flex-flow:row;width:100%;min-width:0;max-width:100%;display:flex}luzmo-date-time-picker{--luzmo-date-time-picker-min-width:var(--luzmo-filter-value-picker-datetime-control-min-width,var(--filter-value-picker-datetime-control-min-width));flex:auto;min-width:0;max-width:100%}luzmo-number-field{flex:0 1 var(--luzmo-filter-value-picker-datetime-quantity-width,var(--filter-value-picker-datetime-quantity-width));min-width:0;max-width:100%}luzmo-picker{flex:1 1 var(--luzmo-filter-value-picker-datetime-control-min-width,var(--filter-value-picker-datetime-control-min-width));min-width:0;max-width:100%}:host{--filter-value-picker-datetime-gap:var(--luzmo-spacing-3);--filter-value-picker-datetime-control-min-width:5rem;--filter-value-picker-datetime-quantity-width:4.5rem}:host([size=s]){--filter-value-picker-datetime-gap:var(--luzmo-spacing-2)}:host([size=m]){--filter-value-picker-datetime-gap:var(--luzmo-spacing-3)}:host([size=l]){--filter-value-picker-datetime-gap:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1))}:host([size=xl]){--filter-value-picker-datetime-gap:var(--luzmo-spacing-4)}", q = class extends t(x(b, { validSizes: Object.values(y) })) {
1128
- constructor(...e) {
1129
- super(...e), this.contentLanguage = "en";
1130
- }
1131
- static get styles() {
1132
- return [p(Xe)];
1133
- }
1134
- willUpdate(e) {
1135
- super.willUpdate(e), e.get("filter") && ([
1136
- "last_now",
1137
- "last_available",
1138
- "next_now",
1139
- "more_than_ago",
1140
- "or_more_ago"
1141
- ].includes(this.filter?.expression) ? this.filter.parameters[1] = {
1142
- quantity: this.filter?.parameters?.[1]?.quantity ?? 1,
1143
- unit: this.filter?.parameters?.[1]?.unit ?? 1
1144
- } : [
1145
- "last_completed",
1146
- "next_full",
1147
- "to_date"
1148
- ].includes(this.filter?.expression) ? this.filter.parameters[1] = { unit: this.filter?.parameters?.[1]?.unit ?? 1 } : this.filter.parameters[1] = typeof this.filter.parameters[1] == "string" ? this.filter.parameters[1] : (/* @__PURE__ */ new Date()).toISOString());
1149
- }
1150
- _sendChangeEvent() {
1151
- this.filter.parameters = [{ ...this.filter?.parameters?.[0] }, this._value], this.dispatchEvent(new CustomEvent("luzmo-filter-value-changed", {
1152
- bubbles: !0,
1153
- composed: !0,
1154
- cancelable: !0,
1155
- detail: { value: this._value }
1156
- }));
1157
- }
1158
- setDate(e) {
1159
- this._value = e.detail.value, this._value !== this.filter?.parameters?.[1] && this._sendChangeEvent();
1160
- }
1161
- setUnit(e) {
1162
- let t = s.find((t) => t.key === e?.target?.value)?.level;
1163
- this.filter?.parameters?.[1]?.unit !== t && (this._value = {
1164
- unit: t ?? 1,
1165
- quantity: this.filter?.parameters?.[1]?.quantity ?? 1
1166
- }, this._sendChangeEvent());
1167
- }
1168
- setQuantity(e) {
1169
- let t = e?.target?.value;
1170
- this.filter?.parameters?.[1]?.quantity !== t && (this._value = {
1171
- quantity: t,
1172
- unit: this.filter?.parameters?.[1]?.unit ?? 1
1173
- }, this._sendChangeEvent());
1174
- }
1175
- renderDatePicker() {
1176
- let e = "second";
1177
- return this.filter?.parameters?.[0]?.lowestLevel > 4 && (e = this.filter?.parameters?.[0]?.lowestLevel === 5 ? "day" : this.filter?.parameters?.[0]?.lowestLevel === 6 ? "hour" : this.filter?.parameters?.[0]?.lowestLevel === 7 ? "minute" : "second"), d`<luzmo-date-time-picker
1178
- aria-label=${v("Filter date", { desc: "Aria label for filter date picker" })}
1179
- .size=${this.size}
1180
- .precision=${e}
1181
- .timeZone=${this.timeZone}
1182
- @change=${this.setDate}
1183
- .value=${this.filter?.parameters?.[1]}
1184
- ></luzmo-date-time-picker>`;
1185
- }
1186
- renderQuantityField() {
1187
- return d`<luzmo-number-field
1188
- label=${v("Quantity", { desc: "Label for quantity number field" })}
1189
- .size=${this.size}
1190
- .value=${this.filter?.parameters?.[1]?.quantity}
1191
- @input=${this.setQuantity}
1192
- @change=${this.setQuantity}
1193
- ></luzmo-number-field>`;
1194
- }
1195
- renderUnitPicker() {
1196
- let e = s.map((e) => d`<luzmo-menu-item .value=${e.key}>
1197
- ${e.i18n()}
1198
- </luzmo-menu-item>`), t = s.find((e) => e.level === this.filter?.parameters?.[1]?.unit)?.key ?? s?.[0]?.key;
1199
- return d`<luzmo-picker
1200
- .label=${v("Time unit", { desc: "Aria label for time unit picker" })}
1201
- .size=${this.size}
1202
- .value=${t}
1203
- @change=${this.setUnit}
1204
- variant="highlight"
1205
- >${e}</luzmo-picker
1206
- >`;
1207
- }
1208
- render() {
1209
- let e = this.filter?.expression;
1210
- return [
1211
- "last_now",
1212
- "last_available",
1213
- "next_now",
1214
- "more_than_ago",
1215
- "or_more_ago"
1216
- ].includes(e) ? d`${this.renderQuantityField()}${this.renderUnitPicker()}` : ["last_completed", "next_full"].includes(e) ? this.renderUnitPicker() : this.renderDatePicker();
1217
- }
1218
- };
1219
- //#endregion
1220
- //#region src/components/filter-value-picker-datetime/index.ts
1221
- e([m({
1222
- type: String,
1223
- attribute: "content-language",
1224
- reflect: !0
1225
- })], q.prototype, "contentLanguage", void 0), e([m({
1226
- type: String,
1227
- attribute: "time-zone",
1228
- reflect: !0
1229
- })], q.prototype, "timeZone", void 0), e([m({
1230
- type: Object,
1231
- reflect: !1
1232
- })], q.prototype, "filter", void 0), q = e([_()], q), customElements.get("luzmo-filter-value-picker-datetime") || customElements.define("luzmo-filter-value-picker-datetime", q);
1233
- //#endregion
1234
- //#region src/components/filter-value-picker-hierarchy/filter-value-picker-hierarchy.module.scss?inline
1235
- var Ze = ":host{flex-direction:row;flex-shrink:1;min-width:0;display:flex}luzmo-select,luzmo-text-field{min-width:var(--luzmo-filter-value-picker-hierarchy-control-min-width,var(--filter-value-picker-hierarchy-control-min-width));flex:auto;max-width:100%}.missing-value{color:var(--luzmo-filter-value-picker-hierarchy-missing-value-color,#767676)}:host{--filter-value-picker-hierarchy-control-min-width:0}", Qe = 5e3, J = class extends t(x(b, { validSizes: Object.values(y) })) {
1236
- constructor(...e) {
1237
- super(...e), this.contentLanguage = "en", this._hierarchyValues = [], this._retrieving = !1, this._search = "", this._error = null, this._pending = !1, this._allValuesRetrieved = !1, this._hierarchyRequestGeneration = 0, this._runningQueries = [];
1238
- }
1239
- static get styles() {
1240
- return [p(Ze)];
1241
- }
1242
- connectedCallback() {
1243
- super.connectedCallback();
1244
- let e = {};
1245
- this.apiUrl && (e.apiUrl = this.apiUrl), this.cacheTime && (e.staleTime = this.cacheTime, e.gcTime = this.cacheTime * 2), this.authKey && this.authToken && (e.authKey = this.authKey, e.authToken = this.authToken), n.configure(e);
1246
- }
1247
- willUpdate(e) {
1248
- if (super.willUpdate(e), e.has("filter") && this.filter) {
1249
- let t = e.get("filter"), n = t?.expression, r = t?.parameters?.[0], i = this.filter?.parameters?.[0], a = (r?.columnId || r?.formulaId) !== (this.filter?.parameters?.[0]?.columnId || this.filter?.parameters?.[0]?.formulaId) || r?.datasetId !== i?.datasetId;
1250
- this.filter?.parameters?.[1] !== this._lastResolvedOutput && (this._lastResolutionKey = void 0), a && (this._hierarchyRequestGeneration++, this._pending = !1, this._retrieving = !1), a && ([
1251
- "? in ?",
1252
- "? not in ?",
1253
- "? = ?",
1254
- "? != ?"
1255
- ].includes(this.filter?.expression) || ![
1256
- "? in ?",
1257
- "? not in ?",
1258
- "? = ?",
1259
- "? != ?"
1260
- ].includes(n)) && (this._hierarchyValues = [], this._allValuesRetrieved = !1), [
1261
- "? in ?",
1262
- "? not in ?",
1263
- "? = ?",
1264
- "? != ?"
1265
- ].includes(this.filter.expression) && this._hierarchyValues.length === 0 && this._restoreCachedFirstPage();
1266
- }
1267
- }
1268
- updated(e) {
1269
- if (super.updated(e), !e.has("filter") || !this.filter) return;
1270
- let t = e.get("filter")?.expression, n = ["? = ?", "? != ?"].includes(this.filter.expression) && t !== void 0 && ![
1271
- "? in ?",
1272
- "? not in ?",
1273
- "? = ?",
1274
- "? != ?"
1275
- ].includes(t);
1276
- n && this._hierarchyValues.length > 0 ? this._resolveSingleSelectValue() : n && !this._retrieving && queueMicrotask(() => {
1277
- ["? = ?", "? != ?"].includes(this.filter?.expression) && this._hierarchyValues.length === 0 && !this._retrieving && this._fetchHierarchyValues(0, !0);
1278
- });
1279
- }
1280
- _buildHierarchyQuery(e = 0, t = this._search) {
1281
- let n = this.filter?.parameters?.[0];
1282
- if (!n?.datasetId || !n.columnId && !n.formulaId) return null;
1283
- let r = {
1284
- column_id: n.columnId,
1285
- formula_id: n.formulaId,
1286
- dataset_id: n.datasetId
1287
- }, i = {
1288
- dimensions: [r],
1289
- where: [],
1290
- order: [{
1291
- ...r,
1292
- order: "asc"
1293
- }],
1294
- limit: {
1295
- by: Qe,
1296
- offset: e
1297
- }
1298
- };
1299
- return t && i.where.push({
1300
- expression: "? like ?",
1301
- parameters: [r, t]
1302
- }), i;
1303
- }
1304
- _getValues(e) {
1305
- return e && Array.isArray(e.data) ? e.data.map((e) => e[0]) : [];
1306
- }
1307
- _applyHierarchyResult(e, t, n) {
1308
- let r = this._getValues(e);
1309
- n || (this._allValuesRetrieved = r.length < Qe), this._hierarchyValues = t > 0 ? [...this._hierarchyValues, ...r] : r;
1310
- }
1311
- _restoreCachedFirstPage() {
1312
- let e = this._buildHierarchyQuery(0, "");
1313
- if (!e) return !1;
1314
- let t = n.getCachedData(e);
1315
- return t ? (this._applyHierarchyResult(t, 0, ""), this._retrieving = !1, this._error = null, !0) : !1;
1316
- }
1317
- _getMemberLabel(e) {
1318
- let t = a(e?.name, this.contentLanguage, { allowEmpty: !0 });
1319
- return typeof t == "string" ? t : "";
1320
- }
1321
- _findExactMember(e) {
1322
- return this._hierarchyValues.find((t) => String(t?.id) === e || this._getMemberLabel(t) === e);
1323
- }
1324
- _resolveSingleSelectValue() {
1325
- if (!["? = ?", "? != ?"].includes(this.filter?.expression) || this._hierarchyValues.length === 0) return;
1326
- let e = this.filter?.parameters?.[1];
1327
- if (typeof e != "string" && typeof e != "number") return;
1328
- let t = String(e), n = this._findExactMember(t), r = t.toLocaleLowerCase(this.contentLanguage), i = n ?? this._hierarchyValues.find((e) => String(e?.id).toLocaleLowerCase(this.contentLanguage).includes(r) || this._getMemberLabel(e).toLocaleLowerCase(this.contentLanguage).includes(r)), a = (n ?? i ?? this._hierarchyValues[0])?.id;
1329
- if (typeof a != "string" && typeof a != "number") return;
1330
- let o = this.filter.parameters[0], s = [
1331
- o.datasetId,
1332
- o.columnId ?? o.formulaId,
1333
- this.filter.expression,
1334
- String(e),
1335
- String(a)
1336
- ].join("|");
1337
- s !== this._lastResolutionKey && (this._lastResolutionKey = s, this._lastResolvedOutput = a, this._value = a, this.filter = {
1338
- ...this.filter,
1339
- parameters: [{ ...this.filter.parameters[0] }, a]
1340
- }, this._sendChangeEvent());
1341
- }
1342
- async _fetchHierarchyValues(e = 0, t = !1) {
1343
- let r = this._search;
1344
- if (!r && this._allValuesRetrieved) {
1345
- this._retrieving = !1;
1346
- return;
1347
- }
1348
- if (e === 0 && !r && (this._restoreCachedFirstPage() || this._hierarchyValues.length > 0)) {
1349
- this._retrieving = !1;
1350
- return;
1351
- }
1352
- if (!this.filter?.parameters?.[0]) {
1353
- this._retrieving = !1, this._error = "Missing column parameters";
1354
- return;
1355
- }
1356
- let i = this.filter.parameters[0], a = i.columnId, o = i.formulaId, s = i.datasetId;
1357
- if (!a && !o) {
1358
- this._retrieving = !1, this._error = "Missing column id or formula id";
1359
- return;
1360
- } else if (!s) {
1361
- this._retrieving = !1, this._error = "Missing dataset id";
1362
- return;
1363
- }
1364
- let c = this._buildHierarchyQuery(e, r);
1365
- if (!c) return;
1366
- let l = this._hierarchyRequestGeneration;
1367
- this._pending = t, this._retrieving = !0, this._error = null;
1368
- let u = new AbortController(), d = new Promise((e, t) => {
1369
- n.fetchData(c).then(e).catch(t), u.signal.addEventListener("abort", () => {
1370
- console.warn("Request aborted"), t({ status: "aborted" });
1371
- });
1372
- }), f = {
1373
- promise: d,
1374
- abortController: u
1375
- };
1376
- this._runningQueries.push(f);
1377
- try {
1378
- let n = await d;
1379
- if (l !== this._hierarchyRequestGeneration) return;
1380
- this._applyHierarchyResult(n, e, r), t && !r && this._resolveSingleSelectValue();
1381
- } catch (e) {
1382
- if (l !== this._hierarchyRequestGeneration || e?.status === "aborted") return;
1383
- this._error = e instanceof Error ? e.message : "Unknown error", this._hierarchyValues = [];
1384
- } finally {
1385
- this._runningQueries = this._runningQueries.filter((e) => e.promise !== d), l === this._hierarchyRequestGeneration && (this._pending = !1, this._retrieving = !1);
1386
- }
1387
- }
1388
- _sendChangeEvent() {
1389
- this.dispatchEvent(new CustomEvent("luzmo-filter-value-changed", {
1390
- bubbles: !0,
1391
- composed: !0,
1392
- cancelable: !0,
1393
- detail: { value: this._value }
1394
- }));
1395
- }
1396
- setHierarchy(e) {
1397
- let t;
1398
- t = ["? in ?", "? not in ?"].includes(this.filter?.expression) ? e?.detail?.value : ["? = ?", "? != ?"].includes(this.filter?.expression) ? e?.detail?.value?.[0] : e?.target?.value, this._value !== t && (this._value = t, this.filter = {
1399
- ...this.filter,
1400
- parameters: [{ ...this.filter?.parameters?.[0] }, this._value]
1401
- }, this._sendChangeEvent());
1402
- }
1403
- onScrolled(e) {
1404
- !this._retrieving && !this._allValuesRetrieved && e?.detail?.last === this._hierarchyValues.length - 1 && this._fetchHierarchyValues(this._hierarchyValues.length);
1405
- }
1406
- renderTextField() {
1407
- return d`<luzmo-text-field
1408
- label=${v("Filter value", { desc: "Label for filter value text field" })}
1409
- .size=${this.size}
1410
- @change=${this.setHierarchy}
1411
- @input=${this.setHierarchy}
1412
- .value=${this.filter?.parameters?.[1] ?? ""}
1413
- ></luzmo-text-field>`;
1414
- }
1415
- setSearchString(e) {
1416
- this._search = e?.detail?.string ?? "", this._allValuesRetrieved || (this._searchQueryTimeout && (this._runningQueries.forEach((e) => {
1417
- e?.abortController && e.abortController.abort();
1418
- }), this._runningQueries = [], clearTimeout(this._searchQueryTimeout)), this._searchQueryTimeout = setTimeout(() => {
1419
- this._fetchHierarchyValues();
1420
- }, 500));
1421
- }
1422
- resetSearchString() {
1423
- this._search = "", this._hierarchyRequestGeneration++, this._pending = !1, this._retrieving = !1, this._restoreCachedFirstPage();
1424
- }
1425
- onOpened() {
1426
- this._fetchHierarchyValues();
1427
- }
1428
- _getSelectedOptionValue() {
1429
- let e = this.filter?.parameters?.[1];
1430
- return typeof e != "string" && typeof e != "number" ? e : this._findExactMember(String(e))?.id ?? e;
1431
- }
1432
- renderHierarchyPicker() {
1433
- if (this._error) return d`<div class="error" role="alert">Error: ${this._error}</div>`;
1434
- let e = (this._search ? this._hierarchyValues.filter((e) => a(e.name, this.contentLanguage, { allowEmpty: !0 })?.toLowerCase().includes(this._search.toLowerCase()) || e.toString().toLowerCase().includes(this._search.toLowerCase())) : this._hierarchyValues).map((e) => {
1435
- let t = a(e?.name, this.contentLanguage) ?? "N/A";
1436
- return typeof t != "string" && (t = "N/A"), {
1437
- value: e?.id,
1438
- label: t
1439
- };
1440
- }), t = this.filter?.expression, n = ["? = ?", "? != ?"].includes(t), r = v("Selected {count} items"), i = v("Search"), o = v("No data"), s = v("No results"), c = v("Select...");
1441
- return d`<luzmo-select
1442
- .size=${this.size}
1443
- .label=${c}
1444
- .retrieving=${this._retrieving}
1445
- .pending=${this._pending}
1446
- .selects=${n ? "single" : "multiple"}
1447
- .variant=${n ? "highlight" : "checkboxes"}
1448
- emphasized
1449
- no-wrap
1450
- ?invalid=${!!this._error}
1451
- .multipleLabelTemplate=${r}
1452
- .searchLabel=${i}
1453
- .noDataLabel=${o}
1454
- .noResultsLabel=${s}
1455
- @change=${this.setHierarchy}
1456
- @luzmo-search=${this.setSearchString}
1457
- @luzmo-opened=${this.onOpened}
1458
- @luzmo-closed=${this.resetSearchString}
1459
- @luzmo-scrolled=${this.onScrolled}
1460
- .options=${e}
1461
- .value=${n ? [this._getSelectedOptionValue()] : this.filter?.parameters?.[1]}
1462
- >
1463
- </luzmo-select>`;
1464
- }
1465
- render() {
1466
- let e = this.filter?.expression;
1467
- return [
1468
- "? in ?",
1469
- "? not in ?",
1470
- "? = ?",
1471
- "? != ?"
1472
- ].includes(e) ? this.renderHierarchyPicker() : this.renderTextField();
1473
- }
1474
- };
1475
- //#endregion
1476
- //#region src/components/filter-value-picker-hierarchy/index.ts
1477
- e([m({
1478
- type: String,
1479
- attribute: "api-url",
1480
- reflect: !0
1481
- })], J.prototype, "apiUrl", void 0), e([m({
1482
- type: String,
1483
- attribute: "auth-key",
1484
- reflect: !0
1485
- })], J.prototype, "authKey", void 0), e([m({
1486
- type: String,
1487
- attribute: "auth-token",
1488
- reflect: !0
1489
- })], J.prototype, "authToken", void 0), e([m({
1490
- type: Number,
1491
- attribute: "cache-time",
1492
- reflect: !0
1493
- })], J.prototype, "cacheTime", void 0), e([m({
1494
- type: String,
1495
- attribute: "content-language",
1496
- reflect: !0
1497
- })], J.prototype, "contentLanguage", void 0), e([m({
1498
- type: Object,
1499
- reflect: !1
1500
- })], J.prototype, "filter", void 0), e([g()], J.prototype, "_hierarchyValues", void 0), e([g()], J.prototype, "_retrieving", void 0), e([g()], J.prototype, "_search", void 0), e([g()], J.prototype, "_error", void 0), e([g()], J.prototype, "_pending", void 0), J = e([_()], J), customElements.get("luzmo-filter-value-picker-hierarchy") || customElements.define("luzmo-filter-value-picker-hierarchy", J);
1501
- //#endregion
1502
- //#region src/components/filter-value-picker-numeric/filter-value-picker-numeric.module.scss?inline
1503
- var $e = ":host{flex-direction:row;flex-shrink:1;min-width:0;display:flex}luzmo-number-field,luzmo-select{min-width:var(--luzmo-filter-value-picker-numeric-control-min-width,var(--filter-value-picker-numeric-control-min-width));flex:auto;max-width:100%}.missing-value{opacity:.4}:host{--filter-value-picker-numeric-control-min-width:0}", et = 5e3, Y = class extends t(x(b, { validSizes: Object.values(y) })) {
1504
- constructor(...e) {
1505
- super(...e), this.contentLanguage = "en", this._numericValues = [], this._retrieving = !0, this._search = "", this._error = null, this._allValuesRetrieved = !1, this._runningQueries = [];
1506
- }
1507
- static get styles() {
1508
- return [p($e)];
1509
- }
1510
- connectedCallback() {
1511
- super.connectedCallback();
1512
- let e = {};
1513
- this.apiUrl && (e.apiUrl = this.apiUrl), this.cacheTime && (e.staleTime = this.cacheTime, e.gcTime = this.cacheTime * 2), this.authKey && this.authToken && (e.authKey = this.authKey, e.authToken = this.authToken), n.configure(e);
1514
- }
1515
- willUpdate(e) {
1516
- if (super.willUpdate(e), e.has("filter") && this.filter) {
1517
- let t = e.get("filter")?.expression, n = this.filter?.expression;
1518
- ((e.get("filter")?.parameters?.[0]?.columnId || e.get("filter")?.parameters?.[0]?.formulaId) !== (this.filter?.parameters?.[0]?.columnId || this.filter?.parameters?.[0]?.formulaId) || !["? in ?", "? not in ?"].includes(t)) && ["? in ?", "? not in ?"].includes(n) && (this._numericValues = [], this._allValuesRetrieved = !1, this._retrieving = !0);
1519
- }
1520
- }
1521
- async _fetchNumericValues(e = 0) {
1522
- if (this._allValuesRetrieved) {
1523
- this._retrieving = !1;
1524
- return;
1525
- }
1526
- if (!this.filter?.parameters?.[0]) {
1527
- this._retrieving = !1, this._error = "Missing column parameters";
1528
- return;
1529
- }
1530
- let t = this.filter.parameters[0], r = t.columnId, i = t.formulaId, a = t.datasetId;
1531
- if (!r && !i) {
1532
- this._retrieving = !1, this._error = "Missing column id or formula id";
1533
- return;
1534
- } else if (!a) {
1535
- this._retrieving = !1, this._error = "Missing dataset id";
1536
- return;
1537
- }
1538
- this._retrieving = !0, this._error = null;
1539
- let o = {
1540
- expression: "? like ?",
1541
- parameters: [{
1542
- dataset_id: a,
1543
- expression: `CAST({${a}:${r ?? i}},hierarchy)`
1544
- }, this._search]
1545
- }, s = {
1546
- dimensions: [{
1547
- column_id: r,
1548
- formula_id: i,
1549
- dataset_id: a
1550
- }],
1551
- where: [],
1552
- order: [{
1553
- column_id: r,
1554
- formula_id: i,
1555
- dataset_id: a,
1556
- order: "asc"
1557
- }],
1558
- limit: {
1559
- by: et,
1560
- offset: e
1561
- }
1562
- };
1563
- this._search && !this._allValuesRetrieved && s.where.push(o);
1564
- let c = new AbortController(), l = new Promise((e, t) => {
1565
- n.fetchData(s).then(e).catch(t), c.signal.addEventListener("abort", () => {
1566
- console.warn("Request aborted"), t({ status: "aborted" });
1567
- });
1568
- }), u = {
1569
- promise: l,
1570
- abortController: c
1571
- };
1572
- this._runningQueries.push(u);
1573
- try {
1574
- let t = await l, n = t && Array.isArray(t.data) ? t.data.map((e) => e[0]) : [];
1575
- this._search || (this._allValuesRetrieved = n.length < et), this._numericValues = e > 0 ? [...this._numericValues, ...n] : n;
1576
- } catch (e) {
1577
- if (e?.status === "aborted") return;
1578
- this._error = e instanceof Error ? e.message : "Unknown error", this._numericValues = [];
1579
- } finally {
1580
- this._runningQueries = this._runningQueries.filter((e) => e.promise !== l), this._retrieving = !1;
1581
- }
1582
- }
1583
- _sendChangeEvent() {
1584
- this.dispatchEvent(new CustomEvent("luzmo-filter-value-changed", {
1585
- bubbles: !0,
1586
- composed: !0,
1587
- cancelable: !0,
1588
- detail: { value: this._value }
1589
- }));
1590
- }
1591
- setValue(e) {
1592
- let t = ["? in ?", "? not in ?"].includes(this.filter?.expression) ? e?.detail?.value : e?.target?.value;
1593
- this._value !== t && (this._value = t, this.filter = {
1594
- ...this.filter,
1595
- parameters: [{ ...this.filter?.parameters?.[0] }, t]
1596
- }, this._sendChangeEvent());
1597
- }
1598
- selectValue(e) {
1599
- let t = (e.detail?.value ?? "").map((e) => Number.parseFloat(e));
1600
- this.filter = {
1601
- ...this.filter,
1602
- parameters: [{ ...this.filter?.parameters?.[0] }, t]
1603
- }, this._value = t, this._sendChangeEvent();
1604
- }
1605
- onScrolled(e) {
1606
- !this._retrieving && !this._allValuesRetrieved && e?.detail?.last === this._numericValues.length - 1 && this._fetchNumericValues(this._numericValues.length);
1607
- }
1608
- renderNumberField() {
1609
- return d`<luzmo-number-field
1610
- label="Numeric filter value"
1611
- grows
1612
- .size=${this.size}
1613
- @change=${this.setValue}
1614
- @input=${this.setValue}
1615
- .value=${this.filter?.parameters?.[1]}
1616
- ></luzmo-number-field>`;
1617
- }
1618
- setSearchString(e) {
1619
- this._search = e?.detail?.string ?? "", this._allValuesRetrieved || (this._searchQueryTimeout && (this._runningQueries.forEach((e) => {
1620
- e?.abortController && e.abortController.abort();
1621
- }), this._runningQueries = [], clearTimeout(this._searchQueryTimeout)), this._searchQueryTimeout = setTimeout(() => {
1622
- this._fetchNumericValues();
1623
- }, 500));
1624
- }
1625
- resetSearchString() {
1626
- this._search = "";
1627
- }
1628
- onOpened() {
1629
- this._fetchNumericValues();
1630
- }
1631
- renderValuePicker() {
1632
- if (this._error) return d`<div class="error" role="alert">${this._error}</div>`;
1633
- let e = this._numericValues.filter((e) => e.toString().toLowerCase().includes(this._search.toLowerCase())).map((e) => ({
1634
- value: e,
1635
- label: e
1636
- })), t = v("Selected {count} items"), n = v("Search"), r = v("No data"), i = v("No results"), a = v("Select...");
1637
- return d`<luzmo-select
1638
- .size=${this.size}
1639
- .label=${a}
1640
- .retrieving=${this._retrieving}
1641
- selects="multiple"
1642
- variant="checkboxes"
1643
- emphasized
1644
- no-wrap
1645
- ?invalid=${!!this._error}
1646
- .multipleLabelTemplate=${t}
1647
- .searchLabel=${n}
1648
- .noDataLabel=${r}
1649
- .noResultsLabel=${i}
1650
- @change=${this.selectValue}
1651
- @luzmo-search=${this.setSearchString}
1652
- @luzmo-opened=${this.onOpened}
1653
- @luzmo-closed=${this.resetSearchString}
1654
- @luzmo-scrolled=${this.onScrolled}
1655
- .options=${e}
1656
- .value=${this.filter?.parameters?.[1]}
1657
- >
1658
- </luzmo-select>`;
1659
- }
1660
- render() {
1661
- let e = this.filter?.expression;
1662
- return ["? in ?", "? not in ?"].includes(e) ? this.renderValuePicker() : this.renderNumberField();
1663
- }
1664
- };
1665
- //#endregion
1666
- //#region src/components/filter-value-picker-numeric/index.ts
1667
- e([m({
1668
- type: String,
1669
- attribute: "api-url",
1670
- reflect: !0
1671
- })], Y.prototype, "apiUrl", void 0), e([m({
1672
- type: String,
1673
- attribute: "auth-key",
1674
- reflect: !0
1675
- })], Y.prototype, "authKey", void 0), e([m({
1676
- type: String,
1677
- attribute: "auth-token",
1678
- reflect: !0
1679
- })], Y.prototype, "authToken", void 0), e([m({
1680
- type: Number,
1681
- attribute: "cache-time",
1682
- reflect: !0
1683
- })], Y.prototype, "cacheTime", void 0), e([m({
1684
- type: String,
1685
- attribute: "content-language",
1686
- reflect: !0
1687
- })], Y.prototype, "contentLanguage", void 0), e([m({
1688
- type: Object,
1689
- reflect: !1
1690
- })], Y.prototype, "filter", void 0), e([g()], Y.prototype, "_numericValues", void 0), e([g()], Y.prototype, "_retrieving", void 0), e([g()], Y.prototype, "_search", void 0), e([g()], Y.prototype, "_error", void 0), Y = e([_()], Y), customElements.get("luzmo-filter-value-picker-numeric") || customElements.define("luzmo-filter-value-picker-numeric", Y);
1691
- //#endregion
1692
- //#region src/components/filter-value-picker/filter-value-picker.ts
1693
- var X = class extends t(x(b, { validSizes: Object.values(y) })) {
1694
- constructor(...e) {
1695
- super(...e), this.contentLanguage = "en", this._expressionsWithoutValuePicker = /* @__PURE__ */ new Set([
1696
- "? is null",
1697
- "? is not null",
1698
- "to_date"
1699
- ]);
1700
- }
1701
- static get styles() {
1702
- return [p(Ye)];
1703
- }
1704
- _sendChangeEvent(e) {
1705
- this.dispatchEvent(new CustomEvent("luzmo-filter-value-changed", {
1706
- bubbles: !0,
1707
- composed: !0,
1708
- cancelable: !0,
1709
- detail: { value: e }
1710
- }));
1711
- }
1712
- setFilterValue(e) {
1713
- e.stopPropagation(), this._sendChangeEvent(e?.detail?.value);
1714
- }
1715
- renderNumericValuePicker() {
1716
- return d`<luzmo-filter-value-picker-numeric
1717
- .apiUrl=${this.apiUrl}
1718
- .authKey=${this.authKey}
1719
- .authToken=${this.authToken}
1720
- .cacheTime=${this.cacheTime}
1721
- .filter=${this.filter}
1722
- .size=${this.size}
1723
- .language=${this.language}
1724
- .contentLanguage=${this.contentLanguage}
1725
- @luzmo-filter-value-changed=${this.setFilterValue}
1726
- ></luzmo-filter-value-picker-numeric>`;
1727
- }
1728
- renderHierarchyValuePicker() {
1729
- return d`<luzmo-filter-value-picker-hierarchy
1730
- .apiUrl=${this.apiUrl}
1731
- .authKey=${this.authKey}
1732
- .authToken=${this.authToken}
1733
- .cacheTime=${this.cacheTime}
1734
- .filter=${this.filter}
1735
- .size=${this.size}
1736
- .language=${this.language}
1737
- .contentLanguage=${this.contentLanguage}
1738
- @luzmo-filter-value-changed=${this.setFilterValue}
1739
- ></luzmo-filter-value-picker-hierarchy>`;
1740
- }
1741
- renderDateTimeValuePicker() {
1742
- return d`<luzmo-filter-value-picker-datetime
1743
- .apiUrl=${this.apiUrl}
1744
- .authKey=${this.authKey}
1745
- .authToken=${this.authToken}
1746
- .cacheTime=${this.cacheTime}
1747
- .filter=${this.filter}
1748
- .timeZone=${this.timeZone}
1749
- .language=${this.language}
1750
- .contentLanguage=${this.contentLanguage}
1751
- .size=${this.size}
1752
- @luzmo-filter-value-changed=${this.setFilterValue}
1753
- ></luzmo-filter-value-picker-datetime>`;
1754
- }
1755
- renderDisabledTextField() {
1756
- let e = this.filter?.parameters?.[1] ?? "";
1757
- return d`<luzmo-text-field
1758
- label=${v("Filter value", { desc: "Label for filter value text field" })}
1759
- .size=${this.size}
1760
- .value=${e}
1761
- .disabled=${!0}
1762
- ></luzmo-text-field>`;
1763
- }
1764
- render() {
1765
- let e = this.valueType ?? "", t = this.filter?.expression;
1766
- return !t || this._expressionsWithoutValuePicker.has(t) ? d`
1767
-
1768
- ` : [
1769
- "numeric",
1770
- "hierarchy",
1771
- "datetime"
1772
- ].includes(e) ? e === "numeric" ? this.renderNumericValuePicker() : e === "datetime" ? this.renderDateTimeValuePicker() : this.renderHierarchyValuePicker() : typeof this.filter?.parameters?.[1] == "string" ? this.renderDisabledTextField() : d`
1773
-
1774
- `;
1775
- }
1776
- };
1777
- //#endregion
1778
- //#region src/components/filter-value-picker/index.ts
1779
- e([m({
1780
- type: String,
1781
- attribute: "api-url",
1782
- reflect: !0
1783
- })], X.prototype, "apiUrl", void 0), e([m({
1784
- type: String,
1785
- attribute: "auth-key",
1786
- reflect: !0
1787
- })], X.prototype, "authKey", void 0), e([m({
1788
- type: String,
1789
- attribute: "auth-token",
1790
- reflect: !0
1791
- })], X.prototype, "authToken", void 0), e([m({
1792
- type: Number,
1793
- attribute: "cache-time",
1794
- reflect: !0
1795
- })], X.prototype, "cacheTime", void 0), e([m({
1796
- type: String,
1797
- attribute: "content-language",
1798
- reflect: !0
1799
- })], X.prototype, "contentLanguage", void 0), e([m({
1800
- type: String,
1801
- attribute: "time-zone",
1802
- reflect: !0
1803
- })], X.prototype, "timeZone", void 0), e([m({
1804
- type: String,
1805
- attribute: "value-type",
1806
- reflect: !0
1807
- })], X.prototype, "valueType", void 0), e([m({
1808
- type: Object,
1809
- reflect: !1
1810
- })], X.prototype, "filter", void 0), customElements.get("luzmo-filter-value-picker") || customElements.define("luzmo-filter-value-picker", X);
1811
- //#endregion
1812
- //#region src/components/filter-item/filter-item.module.scss?inline
1813
- var tt = ":host{box-sizing:border-box;flex-direction:row;min-width:0;max-width:100%;display:flex}[role=group]{box-sizing:border-box;align-items:center;gap:var(--luzmo-filter-item-gap,var(--filter-item-gap));flex-flow:wrap;width:100%;min-width:0;max-width:100%;display:flex}luzmo-data-fields-select{flex:0 1 var(--luzmo-filter-item-field-width,var(--filter-item-field-width));min-width:min(100%, var(--luzmo-filter-item-field-min-width,var(--filter-item-field-min-width)));max-width:100%}luzmo-filter-expression-picker{flex:0 0 var(--luzmo-filter-item-expression-width,var(--filter-item-expression-width));max-width:100%}.value-controls{align-items:center;gap:var(--luzmo-filter-item-gap,var(--filter-item-gap));flex-wrap:nowrap;flex:var(--luzmo-filter-item-value-grow,var(--filter-item-value-grow)) 1 var(--luzmo-filter-item-value-width,var(--filter-item-value-width));min-width:min(100%, var(--luzmo-filter-item-value-min-width,var(--filter-item-value-min-width)));max-width:100%;display:flex}luzmo-filter-value-picker{flex:auto;min-width:0;max-width:100%}luzmo-filter-parameter-picker{flex:0 auto;min-width:0;max-width:100%}:host{--filter-item-gap:var(--luzmo-spacing-3);--filter-item-field-width:auto;--filter-item-expression-width:auto;--filter-item-value-width:auto;--filter-item-value-grow:0;--filter-item-field-min-width:4.5rem;--filter-item-value-min-width:4.5rem}:host([size=s]){--filter-item-gap:var(--luzmo-spacing-2)}:host([size=m]){--filter-item-gap:var(--luzmo-spacing-3)}:host([size=l]){--filter-item-gap:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1))}:host([size=xl]){--filter-item-gap:var(--luzmo-spacing-4)}", Z = class extends t(x(b, { validSizes: Object.values(y) })) {
1814
- constructor(...e) {
1815
- super(...e), this.apiUrl = "https://api.luzmo.com", this.contentLanguage = "en", this.filter = {}, this.allowParameters = !1, this.parameters = [], this._loading = !1, this._datasetsDataFields = [];
1816
- }
1817
- static get styles() {
1818
- return [p(tt)];
1819
- }
1820
- connectedCallback() {
1821
- super.connectedCallback();
1822
- let e = {};
1823
- this.apiUrl && (e.apiUrl = this.apiUrl), this.cacheTime && (e.staleTime = this.cacheTime, e.gcTime = this.cacheTime * 2), e.authKey = this.authKey || "", e.authToken = this.authToken || "", n.configure(e);
1824
- }
1825
- _clearTypeState() {
1826
- this._type = void 0, this._subType = void 0, this._isFormula = void 0;
1827
- }
1828
- async _fetchDatasetDataFields() {
1829
- if (!this.datasetIds || this.datasetIds.length === 0) {
1830
- this._error = "Missing dataset ids to fetch columns & formulas", this._datasetsDataFields = [], this._loading = !1;
1831
- return;
1832
- }
1833
- let { valid: e, invalid: t } = r(this.datasetIds);
1834
- if (t.length > 0 && console.warn(`[LuzmoFilterItem] Invalid dataset IDs provided (not valid UUIDs): ${t.join(", ")}. These will be skipped.`), e.length === 0) {
1835
- this._error = "Invalid dataset IDs provided. Dataset IDs must be valid UUIDs.", this._datasetsDataFields = [], this._loading = !1;
1836
- return;
1837
- }
1838
- this._loading = !0, this._error = null;
1839
- try {
1840
- let t = await n.fetchDatasetsWithColumnsAndFormulas(e);
1841
- for (let e of t) for (let t of [...e.columns, ...e.formulas]) t.datasetId = e.id;
1842
- this._datasetsDataFields = t;
1843
- } catch (e) {
1844
- console.error("Error fetching dataset columns & formulas:", e), this._error = e instanceof Error ? e.message : "Unknown error", this._datasetsDataFields = [];
1845
- } finally {
1846
- this._loading = !1;
1847
- }
1848
- }
1849
- willUpdate(e) {
1850
- super.willUpdate(e);
1851
- let t = e.has("filter"), r = e.has("datasetIds"), i = e.has("authKey"), a = e.has("authToken"), o = e.has("_datasetsDataFields"), s = e.has("parameters");
1852
- if (t || r || o && (this.filter?.parameters?.[0]?.columnId || this.filter?.parameters?.[0]?.formulaId) && this.filter?.parameters?.[0]?.datasetId) if (!this.datasetIds || this.datasetIds.length === 0 || this._datasetsDataFields.length === 0) this._clearTypeState();
1853
- else {
1854
- let e = this._datasetsDataFields.find((e) => e.id === this.filter.parameters?.[0]?.datasetId);
1855
- if (e) {
1856
- let t = !1;
1857
- for (let n of [...e.columns || [], ...e?.formulas || []]) if (n.id === this.filter.parameters?.[0]?.columnId || n.id === this.filter.parameters?.[0]?.formulaId) {
1858
- this._type = n.type, this._subType = n.subtype, this._isFormula = n.id === this.filter.parameters?.[0]?.formulaId, t = !0;
1859
- break;
1860
- }
1861
- t || this._clearTypeState();
1862
- } else this._clearTypeState();
1863
- }
1864
- if (i || a) {
1865
- let e = {
1866
- authKey: this.authKey || "",
1867
- authToken: this.authToken || ""
1868
- };
1869
- n.configure(e);
1870
- }
1871
- (r || i || a) && this._fetchDatasetDataFields();
1872
- let c = this.filter?.parameters?.[1], l = e.get("filter"), u = !!l && l.expression !== this.filter?.expression;
1873
- if (this.allowParameters && this._type && (s || e.has("_type") || u) && U(c)) {
1874
- let t = this.parameters.find((e) => e.parameter === c.parameter), n = H(this._type, this.filter?.expression), r = s || e.has("_type");
1875
- if (u && !n.includes(c.type) || r && (!t || !n.includes(t.type))) {
1876
- let e = structuredClone(this.filter), t = G(this._type, e.expression);
1877
- e.parameters = t === void 0 ? [e.parameters[0]] : [e.parameters[0], t], this.filter = e, this._sendChangeEvent();
1878
- } else if (r && t && JSON.stringify(t) !== JSON.stringify(c)) {
1879
- let e = structuredClone(this.filter);
1880
- e.parameters[1] = structuredClone(t), this.filter = e, this._sendChangeEvent();
1881
- }
1882
- }
1883
- }
1884
- _sendChangeEvent() {
1885
- this.dispatchEvent(new CustomEvent("luzmo-filter-changed", {
1886
- bubbles: !0,
1887
- composed: !0,
1888
- cancelable: !0,
1889
- detail: { filter: this.filter }
1890
- }));
1891
- }
1892
- setFilterDataField(e) {
1893
- if (this._cannotReferenceColumn()) return;
1894
- let t = e.detail?.dataFields?.[0], n = this._type, r = this.filter?.parameters?.[0]?.columnId || this.filter?.parameters?.[0]?.formulaId, i = !!this.filter?.parameters?.[0]?.formulaId, a = t?.columnId || t?.formulaId, o = U(this.filter?.parameters?.[1]);
1895
- this._type = t?.type, this._subType = t?.subtype, this._isFormula = !!t?.formulaId;
1896
- let s = z(this._type, this._subType, this._isFormula);
1897
- this.filter = structuredClone(this.filter ?? {}), s?.includes(this.filter?.expression) || (this.filter.expression = s?.[0]?.expression), this.filter.parameters = this.filter?.parameters ?? [], this.filter.parameters[0] = { datasetId: t?.datasetId }, this._isFormula ? this.filter.parameters[0].formulaId = t?.formulaId : this.filter.parameters[0].columnId = t?.columnId;
1898
- let c = this.filter.properties ?? {};
1899
- if (this._isFormula ? i && c.type !== void 0 || (this.filter.properties = {
1900
- ...c,
1901
- type: "having"
1902
- }) : (c.type === void 0 || i && c.type === "having") && (this.filter.properties = {
1903
- ...c,
1904
- type: "where"
1905
- }), t?.lowestLevel, n !== this._type) this._type === "hierarchy" ? (this.filter.expression = "? like ?", this.filter.parameters[1] = "") : this._type === "numeric" ? (this.filter.expression = "? > ?", this.filter.parameters[1] = 0) : this._type === "datetime" ? (this.filter.expression = "? < ?", this.filter.parameters[1] = (/* @__PURE__ */ new Date()).toISOString()) : (this.filter.expression = "? is not null", this.filter.parameters = [this.filter.parameters[0]]);
1906
- else if (o && r !== a) {
1907
- let e = G(this._type, this.filter.expression);
1908
- this.filter.parameters = e === void 0 ? [this.filter.parameters[0]] : [this.filter.parameters[0], e];
1909
- } else r !== a && this._type === "hierarchy" && (this.filter.parameters[1] = ["? in ?", "? not in ?"].includes(this.filter.expression) ? [] : "");
1910
- this._sendChangeEvent();
1911
- }
1912
- setFilterExpression(e) {
1913
- if (this._cannotReferenceColumn()) return;
1914
- let t = structuredClone(this.filter ?? {}), n = t.expression;
1915
- if (t.expression = e.detail?.expression, n !== t.expression) {
1916
- if (U(t.parameters?.[1])) {
1917
- let e = t.parameters[1];
1918
- if (!H(this._type, t.expression).some((t) => t === e.type)) {
1919
- let e = G(this._type, t.expression);
1920
- t.parameters = e === void 0 ? [t.parameters[0]] : [t.parameters[0], e];
1921
- }
1922
- } else if (["? is null", "? is not null"].includes(t.expression)) t.parameters = [t.parameters[0]];
1923
- else if (this._type === "datetime") if ([
1924
- "YTD",
1925
- "QTD",
1926
- "MTD",
1927
- "WTD"
1928
- ].includes(t.expression)) {
1929
- let n = e?.detail?.unit;
1930
- n && (t.parameters[1] = { unit: typeof n == "number" ? n : 1 });
1931
- } else if ([
1932
- "last_completed",
1933
- "next_full",
1934
- "to_date"
1935
- ].includes(t.expression)) {
1936
- let e = t?.parameters?.[1]?.unit;
1937
- t.parameters[1] = { unit: typeof e == "number" ? e : 1 };
1938
- } else if ([
1939
- "last_now",
1940
- "last_available",
1941
- "next_now",
1942
- "more_than_ago",
1943
- "or_more_ago"
1944
- ].includes(t.expression)) {
1945
- let e = t?.parameters?.[1]?.unit, n = t?.parameters?.[1]?.quantity;
1946
- t.parameters[1] = {
1947
- unit: typeof e == "number" ? e : 1,
1948
- quantity: typeof n == "number" ? n : 1
1949
- };
1950
- } else t.parameters[1] = (/* @__PURE__ */ new Date()).toISOString();
1951
- else if (this._type === "hierarchy") if (["? in ?", "? not in ?"].includes(t.expression)) ["? = ?", "? != ?"].includes(n) ? t.parameters[1] = t.parameters[1] ? [t.parameters[1]] : [] : t.parameters[1] = [];
1952
- else if (["? = ?", "? != ?"].includes(t.expression)) if (["? in ?", "? not in ?"].includes(n)) t.parameters[1] = Array.isArray(t.parameters[1]) && t.parameters[1][0] != null ? t.parameters[1][0] : "";
1953
- else {
1954
- let e = t.parameters[1];
1955
- t.parameters[1] = typeof e == "string" || typeof e == "number" ? e : "";
1956
- }
1957
- else t.parameters[1] = ["? in ?", "? not in ?"].includes(n) ? "" : t.parameters[1] ?? "";
1958
- else this._type === "numeric" && (["? in ?", "? not in ?"].includes(t.expression) && ["? in ?", "? not in ?"].includes(n) ? t.parameters[1] = t.parameters[1] ?? [] : ["? in ?", "? not in ?"].includes(t.expression) ? t.parameters[1] = [] : t.parameters[1] = ["? in ?", "? not in ?"].includes(n) ? 0 : t.parameters[1] ?? 0);
1959
- this.filter = t, this._sendChangeEvent();
1960
- }
1961
- }
1962
- setFilterValue(e) {
1963
- this._cannotReferenceColumn() || (this.filter.parameters[1] = e?.detail?.value, this._sendChangeEvent());
1964
- }
1965
- handleFilterParameterSelected(e) {
1966
- let t = e.detail?.parameter;
1967
- if (!t) return;
1968
- let n = structuredClone(this.filter ?? {});
1969
- n.parameters = n.parameters ?? [], n.parameters[1] = structuredClone(t), this.filter = n, this._sendChangeEvent();
1970
- }
1971
- handleFilterParameterRemoved() {
1972
- if (!U(this.filter?.parameters?.[1])) return;
1973
- let e = structuredClone(this.filter), t = G(this._type, e.expression);
1974
- e.parameters = t === void 0 ? [e.parameters[0]] : [e.parameters[0], t], this.filter = e, this._sendChangeEvent();
1975
- }
1976
- _cannotReferenceColumn() {
1977
- if (!(this.filter?.parameters?.[0]?.columnId || this.filter?.parameters?.[0]?.formulaId)) return !1;
1978
- if (!this.datasetIds || this.datasetIds.length === 0 || this._datasetsDataFields.length === 0) return !0;
1979
- let e = this.filter?.parameters?.[0]?.datasetId, t = this._datasetsDataFields.find((t) => t.id === e);
1980
- return !t || ![...t.columns || [], ...t.formulas || []].find((e) => e.id === this.filter?.parameters?.[0]?.columnId || e.id === this.filter?.parameters?.[0]?.formulaId);
1981
- }
1982
- renderDataFieldPicker() {
1983
- let e = this._cannotReferenceColumn(), t = e ? v("Unknown") : void 0, n = e || this._loading ? "" : this.filter?.parameters?.[0]?.columnId || this.filter?.parameters?.[0]?.formulaId;
1984
- return d`<luzmo-data-fields-select
1985
- .language=${this.language}
1986
- .contentLanguage=${this.contentLanguage}
1987
- .size=${this.size}
1988
- .value=${n ? [n] : []}
1989
- selects="single"
1990
- levels="off"
1991
- .datasetsDataFields=${this._datasetsDataFields}
1992
- placeholder=${te(t)}
1993
- .invalid=${!!this._error || e}
1994
- ?disabled=${e}
1995
- .retrieving=${this._loading}
1996
- .pending=${this._loading}
1997
- @luzmo-data-fields-selected=${this.setFilterDataField}
1998
- ></luzmo-data-fields-select>`;
1999
- }
2000
- renderExpressionPicker() {
2001
- let e = this._cannotReferenceColumn(), t = this.filter?.parameters?.[0], n = !t?.datasetId || !t?.columnId && !t?.formulaId || e;
2002
- return d`<luzmo-filter-expression-picker
2003
- .language=${this.language}
2004
- .size=${this.size}
2005
- .type=${this._type}
2006
- .subtype=${this._subType}
2007
- .filter=${this.filter}
2008
- ?isFormula=${this._isFormula}
2009
- ?disabled=${n}
2010
- @luzmo-expression-selected=${this.setFilterExpression}
2011
- ></luzmo-filter-expression-picker>`;
2012
- }
2013
- renderValuePicker() {
2014
- let e = this._cannotReferenceColumn(), t = this.filter?.parameters?.[0], n = !t?.datasetId || !t?.columnId && !t?.formulaId || e;
2015
- return d`<luzmo-filter-value-picker
2016
- .apiUrl=${this.apiUrl}
2017
- .authKey=${this.authKey}
2018
- .authToken=${this.authToken}
2019
- .cacheTime=${this.cacheTime}
2020
- .language=${this.language}
2021
- .contentLanguage=${this.contentLanguage}
2022
- .timeZone=${this.timeZone}
2023
- .size=${this.size}
2024
- .filter=${this.filter}
2025
- .valueType=${this._type}
2026
- ?disabled=${n}
2027
- @luzmo-filter-value-changed=${this.setFilterValue}
2028
- ></luzmo-filter-value-picker>`;
2029
- }
2030
- renderParameterPicker() {
2031
- if (!this.allowParameters) return null;
2032
- let e = H(this._type, this.filter?.expression);
2033
- if (e.length === 0) return null;
2034
- let t = U(this.filter?.parameters?.[1]) ? this.filter.parameters[1] : void 0;
2035
- return d`<luzmo-filter-parameter-picker
2036
- .language=${this.language}
2037
- .size=${this.size}
2038
- .parameters=${this.parameters}
2039
- .allowedTypes=${e}
2040
- .selectedParameter=${t}
2041
- .currentValue=${t ? t.value : this.filter?.parameters?.[1]}
2042
- ?disabled=${this._cannotReferenceColumn()}
2043
- @luzmo-parameter-selected=${this.handleFilterParameterSelected}
2044
- @luzmo-parameter-removed=${this.handleFilterParameterRemoved}
2045
- ></luzmo-filter-parameter-picker>`;
2046
- }
2047
- render() {
2048
- let e = U(this.filter?.parameters?.[1]);
2049
- return d`<div role="group" aria-label=${v("Filter condition", { desc: "Accessible label for filter item group" })}>
2050
- ${this.renderDataFieldPicker()} ${this.renderExpressionPicker()}
2051
- <div class="value-controls">
2052
- ${e ? null : this.renderValuePicker()} ${this.renderParameterPicker()}
2053
- </div>
2054
- </div>`;
2055
- }
2056
- };
2057
- //#endregion
2058
- //#region src/components/filter-item/index.ts
2059
- e([m({
2060
- type: String,
2061
- attribute: "api-url",
2062
- reflect: !0
2063
- })], Z.prototype, "apiUrl", void 0), e([m({
2064
- type: String,
2065
- attribute: "auth-key",
2066
- reflect: !0
2067
- })], Z.prototype, "authKey", void 0), e([m({
2068
- type: String,
2069
- attribute: "auth-token",
2070
- reflect: !0
2071
- })], Z.prototype, "authToken", void 0), e([m({
2072
- type: Number,
2073
- attribute: "cache-time",
2074
- reflect: !0
2075
- })], Z.prototype, "cacheTime", void 0), e([m({
2076
- type: String,
2077
- reflect: !0
2078
- })], Z.prototype, "contentLanguage", void 0), e([m({
2079
- type: String,
2080
- attribute: "time-zone",
2081
- reflect: !0
2082
- })], Z.prototype, "timeZone", void 0), e([m({
2083
- type: Array,
2084
- attribute: "dataset-ids",
2085
- reflect: !0
2086
- })], Z.prototype, "datasetIds", void 0), e([m({
2087
- type: Object,
2088
- reflect: !1
2089
- })], Z.prototype, "filter", void 0), e([m({
2090
- type: Boolean,
2091
- attribute: "allow-parameters",
2092
- reflect: !0
2093
- })], Z.prototype, "allowParameters", void 0), e([m({ attribute: !1 })], Z.prototype, "parameters", void 0), e([g()], Z.prototype, "_type", void 0), e([g()], Z.prototype, "_subType", void 0), e([g()], Z.prototype, "_isFormula", void 0), e([g()], Z.prototype, "_error", void 0), e([g()], Z.prototype, "_loading", void 0), e([g()], Z.prototype, "_datasetsDataFields", void 0), Z = e([_()], Z), customElements.get("luzmo-filter-item") || customElements.define("luzmo-filter-item", Z);
2094
- //#endregion
2095
- //#region src/components/filters/filters.module.scss?inline
2096
- var nt = ":host{font-family:var(--luzmo-filters-font-family,var(--luzmo-font-family));color:var(--luzmo-filters-font-color,var(--luzmo-font-color));max-width:100%;display:block;container-type:inline-size}.filter-group-container{max-width:100%;padding:calc(var(--luzmo-indicator-gap) + 2 * var(--luzmo-indicator-width));overflow-x:hidden}.filter-group{flex-direction:row;min-width:0;max-width:100%;display:flex}.filter-group.nested{margin-top:var(--luzmo-filters-nested-group-margin-top,var(--filters-nested-group-margin-top));margin-bottom:var(--luzmo-filters-nested-group-margin-bottom,var(--filters-nested-group-margin-bottom))}.group-content{flex-direction:column;flex:1;min-width:0;display:flex}.filters-list{gap:var(--luzmo-filters-filters-list-gap,var(--filters-filters-list-gap));flex-direction:column;min-width:0;max-width:100%;display:flex}.filter-item-wrapper{align-items:flex-start;min-width:0;max-width:100%;display:flex;position:relative}.filter-item-content{align-items:flex-start;gap:var(--luzmo-filters-filter-line-gap,var(--filters-filter-line-gap));flex-wrap:nowrap;flex:1;min-width:0;display:flex}.filter-item-content luzmo-filter-item{flex:1;min-width:0}.filter-item-content .delete-filter-button{flex-shrink:0;align-self:flex-end;margin-inline-start:auto}.condition-wrapper{flex:0 0 var(--luzmo-filters-condition-warpper-width,var(--filters-condition-warpper-width));justify-content:center;align-items:center;display:flex;position:relative}.condition-wrapper:before{content:\"\";left:50%;top:var(--luzmo-filters-vertical-line-top,var(--filters-vertical-line-top));bottom:var(--luzmo-filters-vertical-line-bottom,var(--filters-vertical-line-bottom));width:var(--luzmo-filters-vertical-line-width,var(--filters-vertical-line-width));background:var(--luzmo-filters-vertical-line-color,var(--luzmo-border-color));position:absolute}.condition-badge{min-width:auto;padding-inline:var(--luzmo-filters-condition-padding-horizontal,var(--filters-condition-padding-horizontal));text-transform:uppercase;background:var(--luzmo-filters-condition-badge-background,var(--luzmo-primary));color:var(--luzmo-filters-condition-badge-color,var(--luzmo-primary-inverse-color));border-radius:var(--luzmo-filters-condition-badge-border-radius,var(--luzmo-border-radius));box-shadow:0 0 0 var(--luzmo-filters-condition-badge-halo,var(--filters-condition-badge-halo)) var(--luzmo-filters-condition-badge-background,var(--luzmo-background-color));font-weight:700}.condition-badge:hover{background:var(--luzmo-filters-condition-badge-background-hover,var(--luzmo-primary-hover))}.group-actions{margin-top:var(--luzmo-filters-group-actions-margin-top,var(--filters-group-actions-margin-top));gap:var(--luzmo-filters-group-actions-gap,var(--filters-group-actions-gap));flex-wrap:wrap;display:flex}.delete-group-button{margin-left:auto}.add-root-group-container{margin-top:var(--luzmo-filters-add-root-group-container-margin-top,var(--filters-add-root-group-container-margin-top));padding-left:0}.add-subgroup-button,.add-filter-button{--luzmo-action-button-text-to-visual:var(--luzmo-filters-group-actions-text-to-visual,var(--filters-group-actions-text-to-visual));--luzmo-action-button-content-color-default:var(--luzmo-filters-group-actions-color,var(--luzmo-primary-hover));--luzmo-action-button-content-color-hover:var(--luzmo-filters-group-actions-color-hover,var(--luzmo-primary-hover));--luzmo-action-button-content-color-down:var(--luzmo-filters-group-actions-color-down,var(--luzmo-primary-down));--luzmo-action-button-content-color-focus:var(--luzmo-filters-group-actions-color-focus,var(--luzmo-primary-focus))}.add-group-button{--luzmo-button-padding-label-to-icon:var(--luzmo-filters-add-group-button-text-to-visual,var(--filters-add-group-button-text-to-visual))}.dataset-ids-empty-message{color:var(--luzmo-filters-error-message-color,var(--luzmo-disabled-color));font-size:var(--luzmo-filters-error-message-font-size,var(--filters-font-size))}@container (width<=480px){.condition-badge{--luzmo-action-button-font-size:.6875rem;--luzmo-action-button-height:1.2rem;--luzmo-button-line-height:1.2rem;font-size:.6875rem;line-height:1.2rem;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)rotate(-90deg)}:host([dir=rtl]) .condition-badge{transform:translate(-50%,-50%)rotate(90deg)}}:host{--filters-condition-warpper-width:56px;--filters-condition-padding-horizontal:var(--luzmo-spacing-2);--filters-condition-badge-halo:var(--luzmo-spacing-3);--filters-filters-list-gap:var(--luzmo-spacing-3);--filters-nested-group-margin-top:var(--luzmo-spacing-3);--filters-nested-group-margin-bottom:var(--luzmo-spacing-3);--filters-vertical-line-top:var(--luzmo-spacing-2);--filters-vertical-line-bottom:var(--luzmo-spacing-2);--filters-vertical-line-width:1px;--filters-group-actions-text-to-visual:var(--luzmo-spacing-2);--filters-add-group-button-text-to-visual:var(--luzmo-spacing-3);--filters-group-actions-gap:var(--luzmo-spacing-3);--filters-add-root-group-container-margin-top:var(--luzmo-spacing-4);--filters-filter-line-gap:var(--luzmo-spacing-3);--filters-group-actions-margin-top:var(--luzmo-spacing-3);--filters-error-message-font-size:var(--luzmo-font-size)}:host([size=s]){--filters-condition-warpper-width:48px;--filters-condition-padding-horizontal:var(--luzmo-spacing-2);--filters-condition-badge-halo:var(--luzmo-spacing-2);--filters-filters-list-gap:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--filters-nested-group-margin-top:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--filters-nested-group-margin-bottom:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--filters-vertical-line-top:var(--luzmo-spacing-2);--filters-vertical-line-bottom:var(--luzmo-spacing-2);--filters-group-actions-text-to-visual:var(--luzmo-spacing-1);--filters-add-group-button-text-to-visual:var(--luzmo-spacing-2);--filters-group-actions-gap:var(--luzmo-spacing-2);--filters-add-root-group-container-margin-top:var(--luzmo-spacing-3);--filters-filter-line-gap:var(--luzmo-spacing-2);--filters-group-actions-margin-top:var(--luzmo-spacing-2);--filters-error-message-font-size:var(--luzmo-font-size-s)}:host([size=l]){--filters-condition-warpper-width:64px;--filters-condition-padding-horizontal:var(--luzmo-spacing-3);--filters-condition-badge-halo:var(--luzmo-spacing-4);--filters-filters-list-gap:var(--luzmo-spacing-4);--filters-nested-group-margin-top:var(--luzmo-spacing-4);--filters-nested-group-margin-bottom:var(--luzmo-spacing-4);--filters-vertical-line-top:var(--luzmo-spacing-3);--filters-vertical-line-bottom:var(--luzmo-spacing-3);--filters-group-actions-text-to-visual:var(--luzmo-spacing-2);--filters-add-group-button-text-to-visual:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--filters-group-actions-gap:var(--luzmo-spacing-3);--filters-add-root-group-container-margin-top:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-filter-line-gap:var(--luzmo-spacing-3);--filters-group-actions-margin-top:var(--luzmo-spacing-3);--filters-error-message-font-size:var(--luzmo-font-size-l)}:host([size=xl]){--filters-condition-warpper-width:72px;--filters-condition-padding-horizontal:var(--luzmo-spacing-3);--filters-condition-badge-halo:var(--luzmo-spacing-4);--filters-filters-list-gap:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-nested-group-margin-top:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-nested-group-margin-bottom:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-vertical-line-top:var(--luzmo-spacing-3);--filters-vertical-line-bottom:var(--luzmo-spacing-3);--filters-group-actions-text-to-visual:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--filters-add-group-button-text-to-visual:var(--luzmo-spacing-4);--filters-group-actions-gap:var(--luzmo-spacing-4);--filters-add-root-group-container-margin-top:var(--luzmo-spacing-5);--filters-filter-line-gap:var(--luzmo-spacing-4);--filters-group-actions-margin-top:var(--luzmo-spacing-4);--filters-error-message-font-size:var(--luzmo-font-size-xl)}@container (width<=480px){.filter-group-container{--filters-condition-warpper-width:32px;--filters-condition-padding-horizontal:var(--luzmo-spacing-2);--filters-condition-badge-halo:var(--luzmo-spacing-2);--filters-filters-list-gap:var(--luzmo-spacing-5)}}";
2097
- //#endregion
2098
- //#region src/components/filters/filters.ts
2099
- function rt(e) {
2100
- if (e instanceof S) return e;
2101
- throw e;
2102
- }
2103
- var it = {
2104
- and: () => v("AND", { desc: "Logical AND condition for combining filters" }),
2105
- or: () => v("OR", { desc: "Logical OR condition for combining filters" })
2106
- };
2107
- function Q(e) {
2108
- return e === "and" ? "or" : "and";
2109
- }
2110
- var $ = class extends t(x(b, { validSizes: Object.values(y) })) {
2111
- constructor(...e) {
2112
- super(...e), this.apiUrl = "https://api.luzmo.com", this.contentLanguage = "en", this.filters = [], this.format = "canonical", this.allowParameters = !1, this.parameters = [], this.debounce = 300, this._internalFilterGroup = null, this._hasSyntheticRoot = !1, this._debounceTimeout = null;
2113
- }
2114
- static get styles() {
2115
- return [p(nt)];
2116
- }
2117
- get _oneSizeSmaller() {
2118
- return {
2119
- xxs: "xxs",
2120
- xs: "xs",
2121
- s: "xs",
2122
- m: "s",
2123
- l: "m",
2124
- xl: "l",
2125
- xxl: "xl"
2126
- }[this.size] || "s";
2127
- }
2128
- get _isDatasetIdsEmpty() {
2129
- return !this.datasetIds || this.datasetIds.length === 0;
2130
- }
2131
- disconnectedCallback() {
2132
- super.disconnectedCallback(), this._debounceTimeout &&= (clearTimeout(this._debounceTimeout), null);
2133
- }
2134
- willUpdate(e) {
2135
- if (super.willUpdate(e), e.has("filters")) try {
2136
- let e = Ve(this.filters);
2137
- e.length === 0 ? (this._internalFilterGroup = null, this._hasSyntheticRoot = !1) : e.length === 1 ? (this._internalFilterGroup = structuredClone(e[0]), this._hasSyntheticRoot = !1) : (this._internalFilterGroup = {
2138
- condition: "and",
2139
- filters: structuredClone(e)
2140
- }, this._hasSyntheticRoot = !0);
2141
- } catch (t) {
2142
- console.warn(`[${this.localName}] Keeping the current filters, the new value cannot be normalized:`, rt(t)), this.filters = e.get("filters") ?? [];
2143
- }
2144
- }
2145
- _generateEmptyGroup() {
2146
- return {
2147
- id: o(),
2148
- condition: "and",
2149
- filters: []
2150
- };
2151
- }
2152
- _generateEmptyFilter() {
2153
- return {
2154
- expression: void 0,
2155
- parameters: [],
2156
- properties: { id: o() }
2157
- };
2158
- }
2159
- _rootGroupsForExport() {
2160
- if (!this._internalFilterGroup) return [];
2161
- let e = this._internalFilterGroup.filters.length > 0 && this._internalFilterGroup.filters.every((e) => this._isGroup(e));
2162
- return this._hasSyntheticRoot && e ? structuredClone(this._internalFilterGroup.filters) : [structuredClone(this._internalFilterGroup)];
2163
- }
2164
- _getFiltersForExport() {
2165
- let e = this._rootGroupsForExport(), t = this.format === "clean" ? "clean" : "canonical";
2166
- if (e.length === 0) return {
2167
- filters: [],
2168
- format: t
2169
- };
2170
- if (t === "clean") try {
2171
- return {
2172
- filters: e.flatMap((e) => I(e, { format: "clean" })),
2173
- format: "clean"
2174
- };
2175
- } catch (e) {
2176
- console.warn(`[${this.localName}] Cannot emit clean filters, falling back to canonical output:`, rt(e));
2177
- }
2178
- return {
2179
- filters: e.flatMap((e) => I(e)),
2180
- format: "canonical"
2181
- };
2182
- }
2183
- _sendChangeEvent() {
2184
- this._debounceTimeout && clearTimeout(this._debounceTimeout);
2185
- let e = () => {
2186
- this.dispatchEvent(new CustomEvent("luzmo-filters-changed", {
2187
- bubbles: !0,
2188
- composed: !0,
2189
- cancelable: !0,
2190
- detail: this._getFiltersForExport()
2191
- }));
2192
- };
2193
- this.debounce > 0 ? this._debounceTimeout = setTimeout(e, this.debounce) : e();
2194
- }
2195
- _isGroup(e) {
2196
- return "condition" in e && "filters" in e;
2197
- }
2198
- _handleParameterCreated(e) {
2199
- let t = e.detail?.parameter;
2200
- !t || this.parameters.some(({ parameter: e }) => e === t.parameter) || (this.parameters = [...this.parameters, t]);
2201
- }
2202
- _toggleCondition(e) {
2203
- e.condition = Q(e.condition), e === this._internalFilterGroup && (this._hasSyntheticRoot = !1), this.requestUpdate(), this._sendChangeEvent();
2204
- }
2205
- _addFilter(e) {
2206
- if (this._isDatasetIdsEmpty) return;
2207
- let t = e;
2208
- t ||= (this._internalFilterGroup ||= this._generateEmptyGroup(), this._internalFilterGroup), t.filters.push(this._generateEmptyFilter()), this.requestUpdate(), this._sendChangeEvent();
2209
- }
2210
- _addSubGroup(e) {
2211
- if (this._isDatasetIdsEmpty) return;
2212
- let t = this._generateEmptyGroup();
2213
- t.condition = Q(e.condition), t.filters.push(this._generateEmptyFilter()), e.filters.push(t), this.requestUpdate(), this._sendChangeEvent();
2214
- }
2215
- _removeFilter(e, t) {
2216
- if (this._internalFilterGroup) {
2217
- if (e.filters.splice(t, 1), e !== this._internalFilterGroup && e.filters.length === 0) {
2218
- let t = this._findParentGroup(this._internalFilterGroup, e);
2219
- if (t) {
2220
- let n = t.filters.indexOf(e);
2221
- n !== -1 && t.filters.splice(n, 1);
2222
- }
2223
- }
2224
- this._collapseGroupsAfterDelete(), this.requestUpdate(), this._sendChangeEvent();
2225
- }
2226
- }
2227
- _updateFilter(e, t, n) {
2228
- n.stopPropagation(), this._isGroup(e.filters[t]) || (e.filters[t] = n.detail.filter, this._sendChangeEvent());
2229
- }
2230
- _addGroup() {
2231
- if (this._isDatasetIdsEmpty) return;
2232
- this._internalFilterGroup ||= this._generateEmptyGroup();
2233
- let e = this._generateEmptyGroup();
2234
- e.condition = Q(this._internalFilterGroup.condition), e.filters.push(this._internalFilterGroup);
2235
- let t = this._generateEmptyGroup();
2236
- t.condition = Q(e.condition), t.filters.push(this._generateEmptyFilter()), e.filters.push(t), this._internalFilterGroup = e, this._hasSyntheticRoot = !1, this.requestUpdate(), this._sendChangeEvent();
2237
- }
2238
- _renderFilterItem(e, t, n) {
2239
- return d`
2240
- <div class="filter-item-wrapper">
2241
- <div class="filter-item-content">
2242
- <luzmo-filter-item
2243
- .apiUrl=${this.apiUrl}
2244
- .authKey=${this.authKey}
2245
- .authToken=${this.authToken}
2246
- .cacheTime=${this.cacheTime}
2247
- .language=${this.language}
2248
- .contentLanguage=${this.contentLanguage}
2249
- .timeZone=${this.timeZone}
2250
- .datasetIds=${this.datasetIds}
2251
- .filter=${e}
2252
- .allowParameters=${this.allowParameters}
2253
- .parameters=${this.parameters}
2254
- .size=${this.size}
2255
- @luzmo-filter-changed=${this._updateFilter.bind(this, t, n)}
2256
- @luzmo-parameter-created=${this._handleParameterCreated}
2257
- ></luzmo-filter-item>
2258
- <luzmo-action-button
2259
- class="delete-filter-button"
2260
- .size=${this.size}
2261
- quiet
2262
- .label=${v("Remove filter", { desc: "Aria label for remove filter button" })}
2263
- @click=${this._removeFilter.bind(this, t, n)}
2264
- >
2265
- <luzmo-icon slot="icon" .icon=${u} .size=${this.size}></luzmo-icon>
2266
- </luzmo-action-button>
2267
- </div>
2268
- </div>
2269
- `;
2270
- }
2271
- _renderGroup(e, t = !1) {
2272
- let n = e.filters.length > 0, r = e.filters.length > 1, i = it[e.condition]?.() ?? e.condition;
2273
- return d`
2274
- <div class="filter-group ${t ? "nested" : ""}" role="group">
2275
- ${t ? d`
2276
- <div class="condition-wrapper">
2277
- ${r ? d`
2278
- <luzmo-action-button
2279
- class="condition-badge"
2280
- .size=${this._oneSizeSmaller}
2281
- quiet
2282
- aria-pressed=${e.condition === "and" ? "true" : "false"}
2283
- .label=${v("Toggle filter condition, currently ", { desc: "Aria label prefix for filter condition toggle" }) + i}
2284
- @click=${this._toggleCondition.bind(this, e)}
2285
- >
2286
- ${i}
2287
- </luzmo-action-button>
2288
- ` : ""}
2289
- </div>
2290
- ` : r ? d`
2291
- <div class="condition-wrapper">
2292
- <luzmo-action-button
2293
- class="condition-badge"
2294
- .size=${this._oneSizeSmaller}
2295
- quiet
2296
- aria-pressed=${e.condition === "and" ? "true" : "false"}
2297
- .label=${v("Toggle filter condition, currently ", { desc: "Aria label prefix for filter condition toggle" }) + i}
2298
- @click=${this._toggleCondition.bind(this, e)}
2299
- >
2300
- ${i}
2301
- </luzmo-action-button>
2302
- </div>
2303
- ` : ""}
2304
- <div class="group-content">
2305
- ${n ? d`
2306
- <div class="filters-list">
2307
- ${ee(e.filters, (e, t) => t, (t, n) => d`
2308
- ${this._isGroup(t) ? this._renderGroup(t, !0) : this._renderFilterItem(t, e, n)}
2309
- `)}
2310
- </div>
2311
- ` : ""}
2312
-
2313
- <div class="group-actions">
2314
- <luzmo-action-button
2315
- class="add-filter-button"
2316
- .size=${this.size}
2317
- quiet
2318
- ?disabled=${this._isDatasetIdsEmpty}
2319
- @click=${this._addFilter.bind(this, e)}
2320
- >
2321
- <luzmo-icon slot="icon" .icon=${l} .size=${this._oneSizeSmaller}></luzmo-icon>
2322
- ${v("Filter", { desc: "Add filter button label" })}
2323
- </luzmo-action-button>
2324
-
2325
- <luzmo-action-button
2326
- class="add-subgroup-button"
2327
- .size=${this.size}
2328
- quiet
2329
- ?disabled=${this._isDatasetIdsEmpty}
2330
- @click=${this._addSubGroup.bind(this, e)}
2331
- >
2332
- <luzmo-icon slot="icon" .icon=${l} .size=${this._oneSizeSmaller}></luzmo-icon>
2333
- ${v("Subgroup", { desc: "Add subgroup button label" })}
2334
- </luzmo-action-button>
2335
- </div>
2336
- </div>
2337
- </div>
2338
- `;
2339
- }
2340
- _findParentGroup(e, t) {
2341
- for (let n of e.filters) {
2342
- if (n === t) return e;
2343
- if (this._isGroup(n)) {
2344
- let e = this._findParentGroup(n, t);
2345
- if (e) return e;
2346
- }
2347
- }
2348
- return null;
2349
- }
2350
- _collapseIfNeeded(e) {
2351
- if (e.filters.length === 1 && this._isGroup(e.filters[0])) {
2352
- let t = e.filters[0];
2353
- e.condition = t.condition, e.filters = t.filters, e.id = t.id, e.clause = t.clause, e.origin = t.origin, e.datasetId = t.datasetId, e.vizId = t.vizId, e.itemId = t.itemId, e.isDrilldown = t.isDrilldown, e.type = t.type, e === this._internalFilterGroup && (this._hasSyntheticRoot = !1);
2354
- }
2355
- }
2356
- _collapseGroupsAfterDelete() {
2357
- if (!this._internalFilterGroup) return;
2358
- let e = (t) => {
2359
- for (let n of t.filters) this._isGroup(n) && e(n);
2360
- this._collapseIfNeeded(t);
2361
- };
2362
- e(this._internalFilterGroup);
2363
- }
2364
- render() {
2365
- if (this._isDatasetIdsEmpty) return d`
2366
- <div class="filter-group-container">
2367
- <div class="dataset-ids-empty-message" role="status">
2368
- ${v("Cannot retrieve dataset data fields", { desc: "Error message when datasetIds is empty" })}
2369
- </div>
2370
- </div>
2371
- `;
2372
- if (!this._internalFilterGroup || this._internalFilterGroup.filters.length === 0) return d`
2373
- <div class="filter-group-container">
2374
- <luzmo-button
2375
- class="add-filter-button"
2376
- .size=${this.size}
2377
- treatment="outline"
2378
- ?disabled=${this._isDatasetIdsEmpty}
2379
- @click=${() => this._addFilter()}
2380
- >
2381
- <luzmo-icon slot="icon" .icon=${l} .size=${this._oneSizeSmaller}></luzmo-icon>
2382
- ${v("Add filter", { desc: "Add filter button label" })}
2383
- </luzmo-button>
2384
- </div>
2385
- `;
2386
- let e = this._internalFilterGroup.filters.length > 1;
2387
- return d`
2388
- <div class="filter-group-container">
2389
- ${this._renderGroup(this._internalFilterGroup)}
2390
-
2391
- ${e ? d`
2392
- <div class="add-root-group-container">
2393
- <luzmo-button
2394
- class="add-group-button"
2395
- .size=${this.size}
2396
- treatment="outline"
2397
- ?disabled=${this._isDatasetIdsEmpty}
2398
- @click=${this._addGroup}
2399
- >
2400
- <luzmo-icon slot="icon" .icon=${l} .size=${this._oneSizeSmaller}></luzmo-icon>
2401
- ${v("Group", { desc: "Add group button label" })}
2402
- </luzmo-button>
2403
- </div>
2404
- ` : ""}
2405
- </div>
2406
- `;
2407
- }
2408
- };
2409
- //#endregion
2410
- //#region src/components/filters/index.ts
2411
- e([m({
2412
- type: String,
2413
- attribute: "api-url",
2414
- reflect: !0
2415
- })], $.prototype, "apiUrl", void 0), e([m({
2416
- type: String,
2417
- attribute: "auth-key",
2418
- reflect: !0
2419
- })], $.prototype, "authKey", void 0), e([m({
2420
- type: String,
2421
- attribute: "auth-token",
2422
- reflect: !0
2423
- })], $.prototype, "authToken", void 0), e([m({
2424
- type: Number,
2425
- attribute: "cache-time",
2426
- reflect: !0
2427
- })], $.prototype, "cacheTime", void 0), e([m({
2428
- type: String,
2429
- attribute: "content-language",
2430
- reflect: !0
2431
- })], $.prototype, "contentLanguage", void 0), e([m({
2432
- type: String,
2433
- attribute: "time-zone",
2434
- reflect: !0
2435
- })], $.prototype, "timeZone", void 0), e([m({
2436
- type: Array,
2437
- attribute: "dataset-ids",
2438
- reflect: !0
2439
- })], $.prototype, "datasetIds", void 0), e([m({
2440
- type: Array,
2441
- reflect: !1
2442
- })], $.prototype, "filters", void 0), e([m({
2443
- type: String,
2444
- reflect: !0
2445
- })], $.prototype, "format", void 0), e([m({
2446
- type: Boolean,
2447
- attribute: "allow-parameters",
2448
- reflect: !0
2449
- })], $.prototype, "allowParameters", void 0), e([m({ attribute: !1 })], $.prototype, "parameters", void 0), e([m({
2450
- type: Number,
2451
- reflect: !0
2452
- })], $.prototype, "debounce", void 0), e([g()], $.prototype, "_internalFilterGroup", void 0), $ = e([_()], $), customElements.get("luzmo-filters") || customElements.define("luzmo-filters", $);
2453
- //#endregion
2454
- export { I as _, J as a, de as b, qe as c, H as d, U as f, F as g, Ve as h, Y as i, G as l, B as m, Z as n, q as o, W as p, X as r, K as s, $ as t, Ke as u, S as v, ne as y };