@luzmo/analytics-components-kit 1.0.8-beta.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/{area-chart-positioning.config-BEwDQj3T.js → area-chart-positioning.config-BJK4Q4NL.js} +1 -1
- package/components/{area-chart-positioning.config-CS-5H8-C.cjs → area-chart-positioning.config-Cbeon6-x.cjs} +1 -1
- package/components/{bar-chart-positioning.config-CBbTYesB.js → bar-chart-positioning.config-B4UuSMIW.js} +1 -1
- package/components/{bar-chart-positioning.config-DkIvwJI5.cjs → bar-chart-positioning.config-BnhZQUtb.cjs} +1 -1
- package/components/base-BtRS5vm6.cjs +20 -0
- package/components/{base-DSeXdW9S.js → base-IE9Qxmub.js} +1 -2
- package/components/{box-plot-positioning.config-CNC-RTwl.js → box-plot-positioning.config-CYk5koLu.js} +1 -1
- package/components/{box-plot-positioning.config-o5D-mRFr.cjs → box-plot-positioning.config-DsldCFWm.cjs} +1 -1
- package/components/{bubble-chart-positioning.config-3ilPXLpZ.js → bubble-chart-positioning.config-BSDmuPwq.js} +1 -1
- package/components/{bubble-chart-positioning.config-CtreNdST.cjs → bubble-chart-positioning.config-BV-T_2cy.cjs} +1 -1
- package/components/{bullet-chart-positioning.config-CkFhShBk.js → bullet-chart-positioning.config-B3GeLs8o.js} +1 -1
- package/components/{bullet-chart-positioning.config-dHj3YrT_.cjs → bullet-chart-positioning.config-BoqQq4g_.cjs} +1 -1
- package/components/{choropleth-map-positioning.config-DOt86t59.js → choropleth-map-positioning.config-6OT0sZa5.js} +1 -1
- package/components/{choropleth-map-positioning.config-BSs-bRGv.cjs → choropleth-map-positioning.config-C_I3wf8H.cjs} +1 -1
- package/components/{circle-pack-chart-positioning.config-BkFATJjC.js → circle-pack-chart-positioning.config-BuuhKB85.js} +1 -1
- package/components/{circle-pack-chart-positioning.config-CVNdIYau.cjs → circle-pack-chart-positioning.config-D7Oke8BW.cjs} +1 -1
- package/components/{circular-gauge-positioning.config-SrbCaaOr.cjs → circular-gauge-positioning.config-B_IJzIBn.cjs} +1 -1
- package/components/{circular-gauge-positioning.config-BV2xb5TF.js → circular-gauge-positioning.config-DlWvKl0e.js} +1 -1
- package/components/{column-chart-positioning.config-T7juV3XT.js → column-chart-positioning.config-BLacEiY5.js} +1 -1
- package/components/{column-chart-positioning.config-DTQe3h_H.cjs → column-chart-positioning.config-DngsP5So.cjs} +1 -1
- package/components/{combination-chart-positioning.config-BrSmdan-.cjs → combination-chart-positioning.config-BVV0Bq-d.cjs} +1 -1
- package/components/{combination-chart-positioning.config-78C7wKnS.js → combination-chart-positioning.config-DxnmzV6O.js} +1 -1
- package/components/{conditional-number-positioning.config-_9ySKU1z.cjs → conditional-number-positioning.config-DfitbPT6.cjs} +1 -1
- package/components/{conditional-number-positioning.config-z_eEfpud.js → conditional-number-positioning.config-YEo_yFBu.js} +1 -1
- package/components/data-field/index.cjs +1 -1
- package/components/data-field/index.d.ts +0 -1
- package/components/data-field/index.js +1 -1
- package/components/data-field-fvlYzmfX.cjs +89 -0
- package/components/data-field-panel/index.cjs +1 -1
- package/components/data-field-panel/index.d.ts +0 -1
- package/components/data-field-panel/index.js +1 -1
- package/components/{data-field-panel-U-5Q-TRp.js → data-field-panel-BWBr1Fog.js} +4 -5
- package/components/data-field-panel-Yrqn4L79.cjs +87 -0
- package/components/{data-field-level-DR_dXjnL.js → data-field-yTJb-R63.js} +141 -47
- package/components/{data-fields-select-BYhAzdA6.js → data-fields-select-Bb1HXwlO.js} +3 -4
- package/components/data-fields-select-Cor6sfzL.cjs +41 -0
- package/components/{display-settings-binning-GIE6ww1Q.js → display-settings-binning-CaE87u3h.js} +19 -17
- package/components/{display-settings-binning-HrXOdGwO.cjs → display-settings-binning-CjvB12ds.cjs} +2 -2
- package/components/{display-settings-datetime-YS7_TUet.js → display-settings-datetime-5rq55OAn.js} +71 -69
- package/components/display-settings-datetime-B23w7aH4.cjs +217 -0
- package/components/display-settings-grand-totals-BZ0nlLhu.cjs +44 -0
- package/components/{display-settings-grand-totals-Bt_ju8jp.js → display-settings-grand-totals-DnKvI34n.js} +19 -17
- package/components/{display-settings-numeric-OHmktQsz.js → display-settings-numeric-B8MCRz-V.js} +81 -79
- package/components/display-settings-numeric-DoScgfRy.cjs +190 -0
- package/components/display-settings-period-over-period-C-hp0ZKN.cjs +227 -0
- package/components/{display-settings-period-over-period-B1_IJjWK.js → display-settings-period-over-period-W3dPK8LR.js} +98 -88
- package/components/{donut-chart-positioning.config-BY2TIeeY.cjs → donut-chart-positioning.config-QOZXaJmt.cjs} +1 -1
- package/components/{donut-chart-positioning.config-D34HegyZ.js → donut-chart-positioning.config-fGckMun2.js} +1 -1
- package/components/{en-US-q_Ruzags.cjs → en-CSPDwq2y.cjs} +1 -1
- package/components/{en-US-CcLhGxIh.js → en-DdS5q1ZT.js} +1 -1
- package/components/{en-GB-uxY5qmIM.cjs → en-GB-CJR66Ci_.cjs} +1 -1
- package/components/{en-GB-DzkdeUQh.js → en-GB-Cn0xDC0K.js} +1 -1
- package/components/{en-q_Ruzags.cjs → en-US-CSPDwq2y.cjs} +1 -1
- package/components/{en-CcLhGxIh.js → en-US-DdS5q1ZT.js} +1 -1
- package/components/{evolution-number-positioning.config-BBvULr59.cjs → evolution-number-positioning.config-B7lBArog.cjs} +1 -1
- package/components/{evolution-number-positioning.config-CKzCTjdO.js → evolution-number-positioning.config-CVIysE4H.js} +1 -1
- package/components/filters/index.cjs +1 -1
- package/components/filters/index.js +2 -2
- package/components/filters-DndJU6D5.js +2454 -0
- package/components/filters-oB9qOk_M.cjs +443 -0
- package/components/formula/index.cjs +1 -1
- package/components/formula/index.js +1 -1
- package/components/formula-BFvxm8kj.cjs +45 -0
- package/components/{formula-BYx4gH6i.js → formula-CdAkO1za.js} +14 -15
- package/components/{formula-codemirror-CVzyYNLO.js → formula-codemirror-jVC8mjQ3.js} +19 -21
- package/components/formula-codemirror-ucFOD-2a.cjs +215 -0
- package/components/{formula-display-store-BPn9m5TL.js → formula-display-store-CLAt_fik.js} +271 -242
- package/components/formula-display-store-DmT65fUB.cjs +20 -0
- package/components/formula-editor/index.cjs +1 -1
- package/components/formula-editor/index.d.ts +0 -1
- package/components/formula-editor/index.js +3 -4
- package/components/{formula-editor-BxoIkARr.js → formula-editor-Bd9F-xdZ.js} +351 -146
- package/components/formula-editor-BeZ-fu-7.cjs +253 -0
- package/components/{funnel-chart-positioning.config-CvhpE7rN.js → funnel-chart-positioning.config-BGi7ixet.js} +1 -1
- package/components/{funnel-chart-positioning.config-BPSmV76y.cjs → funnel-chart-positioning.config-zEqgz9Wz.cjs} +1 -1
- package/components/{heat-map-positioning.config-CHDHFIo2.cjs → heat-map-positioning.config-3dxU6qwG.cjs} +1 -1
- package/components/{heat-map-positioning.config-AOHTEJf7.js → heat-map-positioning.config-CK2DBngE.js} +1 -1
- package/components/{heat-table-positioning.config-DprOfmlW.js → heat-table-positioning.config-C55D814C.js} +1 -1
- package/components/{heat-table-positioning.config-DCLE9cy4.cjs → heat-table-positioning.config-CbscS7w1.cjs} +1 -1
- package/components/{hexbin-map-positioning.config-BjxkoqGh.js → hexbin-map-positioning.config-9nnyZGzx.js} +1 -1
- package/components/{hexbin-map-positioning.config-BmLljWez.cjs → hexbin-map-positioning.config-CHecaD9p.cjs} +1 -1
- package/components/index.cjs +840 -1
- package/components/index.js +6783 -67
- package/components/item-grid/index.cjs +1 -1
- package/components/item-grid/index.js +1 -1
- package/components/{item-grid-CcwnD_u5.cjs → item-grid-C2ZvM04g.cjs} +22 -22
- package/components/{item-grid-C_OTtv4T.js → item-grid-D4xYhMOD.js} +1 -2
- package/components/item-option/index.cjs +1 -1
- package/components/item-option/index.js +1 -1
- package/components/{item-option-DRWLN89_.js → item-option-28BU_oaD.js} +2 -2
- package/components/item-option-BQpS6rM_.cjs +269 -0
- package/components/item-option-action-button-group/index.cjs +1 -1
- package/components/item-option-action-button-group/index.js +1 -1
- package/components/item-option-action-button-group-BwBxRLzB.cjs +53 -0
- package/components/{item-option-action-button-group-B9ghoHeh.js → item-option-action-button-group-D_g6aoYd.js} +2 -2
- package/components/item-option-base-C6uwowJD.cjs +56 -0
- package/components/{item-option-base-pYrkqt6q.js → item-option-base-CxQhI83u.js} +2 -2
- package/components/item-option-color-palette-picker/index.cjs +1 -1
- package/components/item-option-color-palette-picker/index.js +1 -1
- package/components/item-option-color-palette-picker-BjHadiN0.cjs +40 -0
- package/components/{item-option-color-palette-picker-DnVqGnm4.js → item-option-color-palette-picker-CRDFqhWx.js} +2 -2
- package/components/item-option-color-picker/index.cjs +1 -1
- package/components/item-option-color-picker/index.js +1 -1
- package/components/{item-option-color-picker-CNkNZ1p-.cjs → item-option-color-picker-BJgpBbDp.cjs} +2 -2
- package/components/{item-option-color-picker-CO-OAFOs.js → item-option-color-picker-BlkpWjQh.js} +2 -2
- package/components/item-option-color-range/index.cjs +1 -1
- package/components/item-option-color-range/index.js +1 -1
- package/components/{item-option-color-range-bdYUxgQ9.js → item-option-color-range-3Wp-Ywz6.js} +2 -2
- package/components/item-option-color-range-CQo8uThO.cjs +98 -0
- package/components/item-option-guidelines/index.cjs +1 -1
- package/components/item-option-guidelines/index.js +1 -1
- package/components/{item-option-guidelines-Ce88dTV-.js → item-option-guidelines-CQ_yb7Ar.js} +3 -4
- package/components/item-option-guidelines-Daf8Ce5z.cjs +135 -0
- package/components/item-option-multi-language-field/index.cjs +1 -1
- package/components/item-option-multi-language-field/index.js +1 -1
- package/components/{item-option-multi-language-field-D0jRPAjY.cjs → item-option-multi-language-field-BApbe3pp.cjs} +2 -2
- package/components/{item-option-multi-language-field-0qfdBanp.js → item-option-multi-language-field-aLIpQWiQ.js} +2 -2
- package/components/item-option-number-field/index.cjs +1 -1
- package/components/item-option-number-field/index.js +1 -1
- package/components/{item-option-number-field-DYJ0eIf7.cjs → item-option-number-field-B72ZYOAX.cjs} +2 -2
- package/components/{item-option-number-field-CcEav5C3.js → item-option-number-field-Bv5eGoxB.js} +2 -2
- package/components/item-option-panel/index.cjs +1 -1
- package/components/item-option-panel/index.js +1 -1
- package/components/{item-option-panel-6Voh87nt.cjs → item-option-panel-A8Jxzwml.cjs} +2 -2
- package/components/{item-option-panel-DrI7HYrY.js → item-option-panel-kRH7GbzA.js} +3 -3
- package/components/item-option-picker/index.cjs +1 -1
- package/components/item-option-picker/index.js +1 -1
- package/components/{item-option-picker-Bv4aGaCO.js → item-option-picker-BuUtW6gD.js} +2 -2
- package/components/{item-option-picker-DkEgfEE7.cjs → item-option-picker-DOFJ1CnI.cjs} +2 -2
- package/components/item-option-position-picker/index.cjs +1 -1
- package/components/item-option-position-picker/index.js +1 -1
- package/components/item-option-position-picker-Cnis4wLA.cjs +32 -0
- package/components/{item-option-position-picker-1d7qZmDv.js → item-option-position-picker-mf3JQu5q.js} +2 -2
- package/components/item-option-positions-number-field/index.cjs +1 -1
- package/components/item-option-positions-number-field/index.js +1 -1
- package/components/item-option-positions-number-field-B7gI1IKO.cjs +49 -0
- package/components/{item-option-positions-number-field-DUlBsbUL.js → item-option-positions-number-field-BIBWpagB.js} +2 -2
- package/components/item-option-radio-button-group/index.cjs +1 -1
- package/components/item-option-radio-button-group/index.js +1 -1
- package/components/{item-option-radio-button-group-ChtTIO3B.cjs → item-option-radio-button-group-B2HYZguB.cjs} +2 -2
- package/components/{item-option-radio-button-group-DuMcIZvr.js → item-option-radio-button-group-CFnfadK2.js} +2 -2
- package/components/item-option-slider/index.cjs +1 -1
- package/components/item-option-slider/index.js +1 -1
- package/components/item-option-slider--7hmhi97.cjs +33 -0
- package/components/{item-option-slider-CWxRoAbA.js → item-option-slider-CH1l0Ena.js} +2 -2
- package/components/item-option-switch/index.cjs +1 -1
- package/components/item-option-switch/index.js +1 -1
- package/components/{item-option-switch-dO66fjoD.cjs → item-option-switch-hUFRE9MC.cjs} +2 -2
- package/components/{item-option-switch-DvMLATBO.js → item-option-switch-rqu2ePVU.js} +2 -2
- package/components/item-option-text-field/index.cjs +1 -1
- package/components/item-option-text-field/index.js +1 -1
- package/components/{item-option-text-field-Furz80ho.cjs → item-option-text-field-C6CocZ5q.cjs} +2 -2
- package/components/{item-option-text-field-DS-gn_Gc.js → item-option-text-field-CBFMmuK2.js} +2 -2
- package/components/item-slot-drop/index.cjs +1 -1
- package/components/item-slot-drop/index.d.ts +0 -2
- package/components/item-slot-drop/index.js +1 -1
- package/components/{item-slot-drop-DE90FDdS.js → item-slot-drop-DDGclwbP.js} +12 -17
- package/components/item-slot-drop-hK-rLhwa.cjs +91 -0
- package/components/item-slot-drop-panel/index.cjs +1 -1
- package/components/item-slot-drop-panel/index.js +1 -1
- package/components/item-slot-drop-panel-CE4f9X6F.cjs +57 -0
- package/components/{item-slot-drop-panel-CyfhbUlE.js → item-slot-drop-panel-Cj6vbgJl.js} +40 -41
- package/components/item-slot-picker/index.cjs +1 -1
- package/components/item-slot-picker/index.js +1 -1
- package/components/{item-slot-picker-BM03UNRE.js → item-slot-picker-CjQH3MU-.js} +17 -22
- package/components/item-slot-picker-Wf50lM5u.cjs +174 -0
- package/components/item-slot-picker-panel/index.cjs +1 -1
- package/components/item-slot-picker-panel/index.js +1 -1
- package/components/{item-slot-picker-panel-DPaabfv5.js → item-slot-picker-panel-7IFk5QFC.js} +4 -5
- package/components/item-slot-picker-panel-Csn1tabr.cjs +81 -0
- package/components/{line-chart-positioning.config-CPGyHeJF.js → line-chart-positioning.config-D5WVvIZT.js} +1 -1
- package/components/{line-chart-positioning.config-BnDYCjGX.cjs → line-chart-positioning.config-DuXn1WD-.cjs} +1 -1
- package/components/load-data-fields-for-datasets-B76UR0sG.js +86 -0
- package/components/load-data-fields-for-datasets-DFYeACsu.cjs +20 -0
- package/components/{ad-hoc-slot-content-BwcFfXCV.cjs → localized-mixin-DfpurTYo.cjs} +1 -1
- package/components/{decorate-DyMgX_Uh.js → localized-mixin-DhiGdPMj.js} +26 -2
- package/components/{marker-map-positioning.config-CBERtxkG.js → marker-map-positioning.config-D2L7cvCP.js} +1 -1
- package/components/{marker-map-positioning.config-Bq1EPg3J.cjs → marker-map-positioning.config-DfN39a-Q.cjs} +1 -1
- package/components/{ohlc-chart-positioning.config-CpPJyyLB.js → ohlc-chart-positioning.config-C53dCwaT.js} +1 -1
- package/components/{ohlc-chart-positioning.config-aCf-SEt7.cjs → ohlc-chart-positioning.config-DsBuB0VU.cjs} +1 -1
- package/components/{parallel-coordinates-plot-positioning.config-DsNDp1G7.js → parallel-coordinates-plot-positioning.config-DhoVstsb.js} +1 -1
- package/components/{parallel-coordinates-plot-positioning.config-D1CB7jOv.cjs → parallel-coordinates-plot-positioning.config-aiFzLnnh.cjs} +1 -1
- package/components/period-over-period-condition.const-DDgiXIfR.cjs +20 -0
- package/components/{formatter-Cq5dFCyU.js → period-over-period-condition.const-IOVIrgKJ.js} +234 -44
- package/components/{pivot-table-positioning.config-gBHM1_-K.cjs → pivot-table-positioning.config-Bq9BoQWM.cjs} +1 -1
- package/components/{pivot-table-positioning.config-BFWS3Yk_.js → pivot-table-positioning.config-Cnai84AH.js} +1 -1
- package/components/{pyramid-chart-positioning.config-B8dbZhvt.js → pyramid-chart-positioning.config-BeJ5R_Ln.js} +1 -1
- package/components/{pyramid-chart-positioning.config-DD64vCwl.cjs → pyramid-chart-positioning.config-D5AKNCPb.cjs} +1 -1
- package/components/{radar-chart-positioning.config-DN51_Tzb.cjs → radar-chart-positioning.config-BEIwrzhb.cjs} +1 -1
- package/components/{radar-chart-positioning.config-C2DWQu8V.js → radar-chart-positioning.config-DsfUBq4B.js} +1 -1
- package/components/{route-map-positioning.config-ryk_dUkh.cjs → route-map-positioning.config-4Wyvj5OH.cjs} +1 -1
- package/components/{route-map-positioning.config-D7X6QuWY.js → route-map-positioning.config-CuiRWzbs.js} +1 -1
- package/components/{sankey-diagram-positioning.config-CJfGpnPS.cjs → sankey-diagram-positioning.config-CZ-zVCQo.cjs} +1 -1
- package/components/{sankey-diagram-positioning.config-A_7xM06n.js → sankey-diagram-positioning.config-DtN7dARd.js} +1 -1
- package/components/{scatter-plot-positioning.config-qpwrugRe.js → scatter-plot-positioning.config-BXrzdLIc.js} +1 -1
- package/components/{scatter-plot-positioning.config-Duao2ftU.cjs → scatter-plot-positioning.config-CfAf_FUW.cjs} +1 -1
- package/components/{slicer-filter-positioning.config-93hC7jID.js → slicer-filter-positioning.config-BLGeCJys.js} +1 -1
- package/components/{slicer-filter-positioning.config-DxhC39ak.cjs → slicer-filter-positioning.config-CU86hJi6.cjs} +1 -1
- package/components/slot-menu-1zlmyLVl.js +1060 -0
- package/components/slot-menu-BSu8wKLi.cjs +217 -0
- package/components/{speedometer-chart-positioning.config-DtRG3-e5.cjs → speedometer-chart-positioning.config-AeMlNxSj.cjs} +1 -1
- package/components/{speedometer-chart-positioning.config-CZbwyYsk.js → speedometer-chart-positioning.config-Dam0wOqp.js} +1 -1
- package/components/{spike-map-positioning.config-CevjyQ5F.cjs → spike-map-positioning.config-9ShV1fUh.cjs} +1 -1
- package/components/{spike-map-positioning.config-LBqSYD2n.js → spike-map-positioning.config-BVzewpfi.js} +1 -1
- package/components/{strip-plot-positioning.config-DF5VxzvB.cjs → strip-plot-positioning.config-BVBdHZvL.cjs} +1 -1
- package/components/{strip-plot-positioning.config-cCdQxMM_.js → strip-plot-positioning.config-OHm3LEo3.js} +1 -1
- package/components/{sunburst-chart-positioning.config-DmkZEexM.js → sunburst-chart-positioning.config-BynNbbxB.js} +1 -1
- package/components/{sunburst-chart-positioning.config-CERBvfoF.cjs → sunburst-chart-positioning.config-DQmuKm-N.cjs} +1 -1
- package/components/{symbol-map-positioning.config-DhYxG8RC.cjs → symbol-map-positioning.config-D6rgxXTO.cjs} +1 -1
- package/components/{symbol-map-positioning.config-BwG_G6He.js → symbol-map-positioning.config-bQk_pdAr.js} +1 -1
- package/components/{treemap-chart-positioning.config-arjPT6b_.js → treemap-chart-positioning.config-BB1-rZKL.js} +1 -1
- package/components/{treemap-chart-positioning.config-BwrrXs4a.cjs → treemap-chart-positioning.config-ZaoIngRn.cjs} +1 -1
- package/components/utils/base.cjs +1 -1
- package/components/utils/base.js +2 -2
- package/components/utils-CPIzW8sp.cjs +20 -0
- package/components/{utils-B_rE5b7a.js → utils-ZoJ1cp2P.js} +41 -42
- package/components/utils.cjs +1 -1
- package/components/utils.js +5 -8
- package/components/{venn-diagram-positioning.config-DSh3Ns9L.js → venn-diagram-positioning.config-C9ARqREi.js} +1 -1
- package/components/{venn-diagram-positioning.config-GGLCcrqp.cjs → venn-diagram-positioning.config-Cb10sStL.cjs} +1 -1
- package/components/{wordcloud-chart-positioning.config-B8ZzwIdd.js → wordcloud-chart-positioning.config-D59ntNtd.js} +1 -1
- package/components/{wordcloud-chart-positioning.config-Cxyhs6gk.cjs → wordcloud-chart-positioning.config-DC89_DYc.cjs} +1 -1
- package/custom-elements.json +6760 -18304
- package/index.d.ts +0 -25
- package/package.json +1 -126
- package/react/esm/index.d.ts +2 -27
- package/react/esm/index.js +2 -102
- package/react/index.ts +2 -102
- package/react/luzmo-stub.d.ts +0 -140
- package/react/package.json +2 -2
- package/types.d.ts +0 -9
- package/utils/slot-state/slot-store.d.ts +4 -0
- package/angular/README.md +0 -40
- package/angular/components/ai-chat-empty-state.ts +0 -98
- package/angular/components/ai-chat.ts +0 -440
- package/angular/components/ai-interaction-textarea.ts +0 -283
- package/angular/components/data-field-level.ts +0 -130
- package/angular/components/data-field-panel.ts +0 -256
- package/angular/components/data-field.ts +0 -130
- package/angular/components/data-fields-select.ts +0 -212
- package/angular/components/dataset-icon.ts +0 -83
- package/angular/components/dataset-selector-list.ts +0 -147
- package/angular/components/dataset-selector-row.ts +0 -198
- package/angular/components/display-settings-binning.ts +0 -92
- package/angular/components/display-settings-datetime.ts +0 -100
- package/angular/components/display-settings-grand-totals.ts +0 -92
- package/angular/components/display-settings-numeric.ts +0 -113
- package/angular/components/display-settings-period-over-period.ts +0 -107
- package/angular/components/display-settings.ts +0 -227
- package/angular/components/filter-expression-picker.ts +0 -168
- package/angular/components/filter-item.ts +0 -175
- package/angular/components/filter-parameter-picker.ts +0 -155
- package/angular/components/filter-value-picker-datetime.ts +0 -125
- package/angular/components/filter-value-picker-hierarchy.ts +0 -146
- package/angular/components/filter-value-picker-numeric.ts +0 -146
- package/angular/components/filter-value-picker.ts +0 -160
- package/angular/components/filters.ts +0 -209
- package/angular/components/formula-editor.ts +0 -229
- package/angular/components/formula-field.ts +0 -198
- package/angular/components/formula.ts +0 -170
- package/angular/components/interactive-viz-item.ts +0 -186
- package/angular/components/item-grid-item-actions-menu.ts +0 -113
- package/angular/components/item-grid.ts +0 -242
- package/angular/components/item-option-action-button-group.ts +0 -105
- package/angular/components/item-option-color-palette-picker.ts +0 -126
- package/angular/components/item-option-color-picker.ts +0 -134
- package/angular/components/item-option-color-range.ts +0 -168
- package/angular/components/item-option-guidelines.ts +0 -84
- package/angular/components/item-option-multi-language-field.ts +0 -133
- package/angular/components/item-option-number-field.ts +0 -161
- package/angular/components/item-option-panel.ts +0 -149
- package/angular/components/item-option-picker.ts +0 -120
- package/angular/components/item-option-position-picker.ts +0 -98
- package/angular/components/item-option-positions-number-field.ts +0 -140
- package/angular/components/item-option-radio-button-group.ts +0 -119
- package/angular/components/item-option-slider.ts +0 -126
- package/angular/components/item-option-switch.ts +0 -98
- package/angular/components/item-option-text-field.ts +0 -112
- package/angular/components/item-option.ts +0 -163
- package/angular/components/item-slot-drop-panel.ts +0 -236
- package/angular/components/item-slot-drop.ts +0 -231
- package/angular/components/item-slot-picker-panel.ts +0 -299
- package/angular/components/item-slot-picker.ts +0 -241
- package/angular/components/slot-menu-list.ts +0 -121
- package/angular/components/slot-menu.ts +0 -304
- package/angular/components/viz-item-menu.ts +0 -118
- package/angular/esm/components/ai-chat-empty-state.d.ts +0 -39
- package/angular/esm/components/ai-chat-empty-state.js +0 -99
- package/angular/esm/components/ai-chat.d.ts +0 -147
- package/angular/esm/components/ai-chat.js +0 -455
- package/angular/esm/components/ai-interaction-textarea.d.ts +0 -106
- package/angular/esm/components/ai-interaction-textarea.js +0 -305
- package/angular/esm/components/data-field-level.d.ts +0 -50
- package/angular/esm/components/data-field-level.js +0 -129
- package/angular/esm/components/data-field-panel.d.ts +0 -86
- package/angular/esm/components/data-field-panel.js +0 -268
- package/angular/esm/components/data-field.d.ts +0 -50
- package/angular/esm/components/data-field.js +0 -129
- package/angular/esm/components/data-fields-select.d.ts +0 -81
- package/angular/esm/components/data-fields-select.js +0 -227
- package/angular/esm/components/dataset-icon.d.ts +0 -34
- package/angular/esm/components/dataset-icon.js +0 -86
- package/angular/esm/components/dataset-selector-list.d.ts +0 -56
- package/angular/esm/components/dataset-selector-list.js +0 -155
- package/angular/esm/components/dataset-selector-row.d.ts +0 -70
- package/angular/esm/components/dataset-selector-row.js +0 -197
- package/angular/esm/components/display-settings-binning.d.ts +0 -37
- package/angular/esm/components/display-settings-binning.js +0 -91
- package/angular/esm/components/display-settings-datetime.d.ts +0 -40
- package/angular/esm/components/display-settings-datetime.js +0 -99
- package/angular/esm/components/display-settings-grand-totals.d.ts +0 -37
- package/angular/esm/components/display-settings-grand-totals.js +0 -91
- package/angular/esm/components/display-settings-numeric.d.ts +0 -45
- package/angular/esm/components/display-settings-numeric.js +0 -115
- package/angular/esm/components/display-settings-period-over-period.d.ts +0 -44
- package/angular/esm/components/display-settings-period-over-period.js +0 -107
- package/angular/esm/components/display-settings.d.ts +0 -83
- package/angular/esm/components/display-settings.js +0 -231
- package/angular/esm/components/filter-expression-picker.d.ts +0 -64
- package/angular/esm/components/filter-expression-picker.js +0 -179
- package/angular/esm/components/filter-item.d.ts +0 -63
- package/angular/esm/components/filter-item.js +0 -187
- package/angular/esm/components/filter-parameter-picker.d.ts +0 -56
- package/angular/esm/components/filter-parameter-picker.js +0 -151
- package/angular/esm/components/filter-value-picker-datetime.d.ts +0 -47
- package/angular/esm/components/filter-value-picker-datetime.js +0 -131
- package/angular/esm/components/filter-value-picker-hierarchy.d.ts +0 -53
- package/angular/esm/components/filter-value-picker-hierarchy.js +0 -155
- package/angular/esm/components/filter-value-picker-numeric.d.ts +0 -53
- package/angular/esm/components/filter-value-picker-numeric.js +0 -155
- package/angular/esm/components/filter-value-picker.d.ts +0 -57
- package/angular/esm/components/filter-value-picker.js +0 -171
- package/angular/esm/components/filters.d.ts +0 -75
- package/angular/esm/components/filters.js +0 -215
- package/angular/esm/components/formula-editor.d.ts +0 -78
- package/angular/esm/components/formula-editor.js +0 -236
- package/angular/esm/components/formula-field.d.ts +0 -70
- package/angular/esm/components/formula-field.js +0 -209
- package/angular/esm/components/formula.d.ts +0 -60
- package/angular/esm/components/formula.js +0 -177
- package/angular/esm/components/interactive-viz-item.d.ts +0 -63
- package/angular/esm/components/interactive-viz-item.js +0 -188
- package/angular/esm/components/item-grid-item-actions-menu.d.ts +0 -45
- package/angular/esm/components/item-grid-item-actions-menu.js +0 -115
- package/angular/esm/components/item-grid.d.ts +0 -80
- package/angular/esm/components/item-grid.js +0 -245
- package/angular/esm/components/item-option-action-button-group.d.ts +0 -41
- package/angular/esm/components/item-option-action-button-group.js +0 -107
- package/angular/esm/components/item-option-color-palette-picker.d.ts +0 -48
- package/angular/esm/components/item-option-color-palette-picker.js +0 -131
- package/angular/esm/components/item-option-color-picker.d.ts +0 -51
- package/angular/esm/components/item-option-color-picker.js +0 -139
- package/angular/esm/components/item-option-color-range.d.ts +0 -66
- package/angular/esm/components/item-option-color-range.js +0 -179
- package/angular/esm/components/item-option-guidelines.d.ts +0 -34
- package/angular/esm/components/item-option-guidelines.js +0 -83
- package/angular/esm/components/item-option-multi-language-field.d.ts +0 -50
- package/angular/esm/components/item-option-multi-language-field.js +0 -139
- package/angular/esm/components/item-option-number-field.d.ts +0 -58
- package/angular/esm/components/item-option-number-field.js +0 -171
- package/angular/esm/components/item-option-panel.d.ts +0 -54
- package/angular/esm/components/item-option-panel.js +0 -155
- package/angular/esm/components/item-option-picker.d.ts +0 -46
- package/angular/esm/components/item-option-picker.js +0 -123
- package/angular/esm/components/item-option-position-picker.d.ts +0 -39
- package/angular/esm/components/item-option-position-picker.js +0 -99
- package/angular/esm/components/item-option-positions-number-field.d.ts +0 -54
- package/angular/esm/components/item-option-positions-number-field.js +0 -147
- package/angular/esm/components/item-option-radio-button-group.d.ts +0 -45
- package/angular/esm/components/item-option-radio-button-group.js +0 -123
- package/angular/esm/components/item-option-slider.d.ts +0 -46
- package/angular/esm/components/item-option-slider.js +0 -131
- package/angular/esm/components/item-option-switch.d.ts +0 -40
- package/angular/esm/components/item-option-switch.js +0 -99
- package/angular/esm/components/item-option-text-field.d.ts +0 -44
- package/angular/esm/components/item-option-text-field.js +0 -115
- package/angular/esm/components/item-option.d.ts +0 -58
- package/angular/esm/components/item-option.js +0 -171
- package/angular/esm/components/item-slot-drop-panel.d.ts +0 -82
- package/angular/esm/components/item-slot-drop-panel.js +0 -249
- package/angular/esm/components/item-slot-drop.d.ts +0 -77
- package/angular/esm/components/item-slot-drop.js +0 -227
- package/angular/esm/components/item-slot-picker-panel.d.ts +0 -97
- package/angular/esm/components/item-slot-picker-panel.js +0 -309
- package/angular/esm/components/item-slot-picker.d.ts +0 -86
- package/angular/esm/components/item-slot-picker.js +0 -259
- package/angular/esm/components/slot-menu-list.d.ts +0 -46
- package/angular/esm/components/slot-menu-list.js +0 -123
- package/angular/esm/components/slot-menu.d.ts +0 -104
- package/angular/esm/components/slot-menu.js +0 -300
- package/angular/esm/components/viz-item-menu.d.ts +0 -42
- package/angular/esm/components/viz-item-menu.js +0 -111
- package/angular/esm/index.d.ts +0 -109
- package/angular/esm/index.js +0 -217
- package/angular/index.ts +0 -223
- package/angular/package.json +0 -40
- package/angular/tsconfig.json +0 -36
- package/angular/type-fallbacks.d.ts +0 -0
- package/angular/utils/ai-prompt/attachments.d.ts +0 -10
- package/angular/utils/ai-prompt/dictation.d.ts +0 -50
- package/angular/utils/ai-prompt/image-upload.d.ts +0 -12
- package/angular/utils/ai-prompt/index.d.ts +0 -6
- package/angular/utils/ai-prompt/tests/dictation.test.d.ts +0 -1
- package/angular/utils/ai-prompt/tests/image-upload.test.d.ts +0 -1
- package/angular/utils/base/base.d.ts +0 -16
- package/angular/utils/base/focus-visible.d.ts +0 -29
- package/angular/utils/base/focusable.d.ts +0 -58
- package/angular/utils/base/index.d.ts +0 -5
- package/angular/utils/base/localized-mixin.d.ts +0 -22
- package/angular/utils/base/sized-mixin.d.ts +0 -17
- package/angular/utils/color/color-palettes.d.ts +0 -17
- package/angular/utils/color/extrapolate-color.d.ts +0 -1
- package/angular/utils/data/load-data-fields-for-datasets.d.ts +0 -22
- package/angular/utils/data-broker/index.d.ts +0 -263
- package/angular/utils/data-field-types/calculate-data-field-icon.d.ts +0 -12
- package/angular/utils/data-field-types/default-acceptable-data-field-types.d.ts +0 -1
- package/angular/utils/data-field-types/tests/calculate-data-field-icon.test.d.ts +0 -1
- package/angular/utils/drag/draggable.d.ts +0 -13
- package/angular/utils/drag/pragmatic-element-adapter.d.ts +0 -2
- package/angular/utils/drag/tests/pragmatic-element-adapter.first-import.test.d.ts +0 -1
- package/angular/utils/drag/tests/pragmatic-element-adapter.test.d.ts +0 -1
- package/angular/utils/filters/expressions.d.ts +0 -15
- package/angular/utils/filters/index.d.ts +0 -1
- package/angular/utils/formatter/calculate-duration.d.ts +0 -2
- package/angular/utils/formatter/decompose-numeric-format.d.ts +0 -11
- package/angular/utils/formatter/default-local-formats.d.ts +0 -20
- package/angular/utils/formatter/formats/cs.d.ts +0 -20
- package/angular/utils/formatter/formats/da.d.ts +0 -20
- package/angular/utils/formatter/formats/de.d.ts +0 -21
- package/angular/utils/formatter/formats/en-GB.d.ts +0 -21
- package/angular/utils/formatter/formats/en-US.d.ts +0 -1
- package/angular/utils/formatter/formats/en.d.ts +0 -1
- package/angular/utils/formatter/formats/es.d.ts +0 -54
- package/angular/utils/formatter/formats/fi.d.ts +0 -20
- package/angular/utils/formatter/formats/fr.d.ts +0 -54
- package/angular/utils/formatter/formats/he.d.ts +0 -20
- package/angular/utils/formatter/formats/hu.d.ts +0 -20
- package/angular/utils/formatter/formats/it.d.ts +0 -54
- package/angular/utils/formatter/formats/ja.d.ts +0 -20
- package/angular/utils/formatter/formats/ko.d.ts +0 -20
- package/angular/utils/formatter/formats/mk.d.ts +0 -20
- package/angular/utils/formatter/formats/nl.d.ts +0 -21
- package/angular/utils/formatter/formats/no.d.ts +0 -21
- package/angular/utils/formatter/formats/pl.d.ts +0 -20
- package/angular/utils/formatter/formats/pt.d.ts +0 -20
- package/angular/utils/formatter/formats/ru.d.ts +0 -20
- package/angular/utils/formatter/formats/sv.d.ts +0 -20
- package/angular/utils/formatter/formats/tr.d.ts +0 -21
- package/angular/utils/formatter/formats/zh-CN.d.ts +0 -20
- package/angular/utils/formatter/formats/zh-TW.d.ts +0 -20
- package/angular/utils/formatter/formatter.d.ts +0 -9
- package/angular/utils/formatter/get-dataset-name.d.ts +0 -2
- package/angular/utils/formatter/get-localized-name.d.ts +0 -4
- package/angular/utils/formatter/localize.d.ts +0 -3
- package/angular/utils/formatter/smart-datetime-formats.const.d.ts +0 -36
- package/angular/utils/formatter/tests/calculate-duration.test.d.ts +0 -1
- package/angular/utils/formatter/tests/decompose-numeric-format.test.d.ts +0 -1
- package/angular/utils/formatter/tests/default-local-formats.test.d.ts +0 -1
- package/angular/utils/formatter/tests/formatter.test.d.ts +0 -1
- package/angular/utils/formatter/tests/get-localized-name.test.d.ts +0 -1
- package/angular/utils/formatter/tests/localize.test.d.ts +0 -1
- package/angular/utils/formula/base/formula-base.d.ts +0 -117
- package/angular/utils/formula/base/formula-input-base.d.ts +0 -62
- package/angular/utils/formula/codemirror/actions.d.ts +0 -47
- package/angular/utils/formula/codemirror/drop-cursor.d.ts +0 -15
- package/angular/utils/formula/codemirror/icon-element.d.ts +0 -7
- package/angular/utils/formula/codemirror/parser.d.ts +0 -16
- package/angular/utils/formula/codemirror/tests/actions.test.d.ts +0 -1
- package/angular/utils/formula/codemirror/theme.d.ts +0 -20
- package/angular/utils/formula/codemirror/widget.d.ts +0 -18
- package/angular/utils/formula/config/aggregations.d.ts +0 -9
- package/angular/utils/formula/config/build-datasets.d.ts +0 -10
- package/angular/utils/formula/config/expression-helpers.d.ts +0 -42
- package/angular/utils/formula/config/functions.d.ts +0 -3
- package/angular/utils/formula/config/groupings.d.ts +0 -9
- package/angular/utils/formula/config/regex.d.ts +0 -39
- package/angular/utils/formula/config/resolve-column-presentation.d.ts +0 -19
- package/angular/utils/formula/config/tests/build-datasets.test.d.ts +0 -1
- package/angular/utils/formula/config/validate-expression.d.ts +0 -19
- package/angular/utils/formula/load-formula-codemirror.d.ts +0 -4
- package/angular/utils/formula/render-explanation-tooltip.d.ts +0 -7
- package/angular/utils/formula/store/formula-display-store.d.ts +0 -93
- package/angular/utils/formula/store/formula-editor-context.d.ts +0 -8
- package/angular/utils/formula/store/formula-editor-store.d.ts +0 -46
- package/angular/utils/formula/store/tests/formula-editor-store.test.d.ts +0 -1
- package/angular/utils/formula/tests/validate-expression.test.d.ts +0 -1
- package/angular/utils/get-css-variable.d.ts +0 -1
- package/angular/utils/index.d.ts +0 -10
- package/angular/utils/localize/set-locale.d.ts +0 -7
- package/angular/utils/map-tile-providers/index.d.ts +0 -93
- package/angular/utils/set-nested-value.d.ts +0 -6
- package/angular/utils/slot-content/ad-hoc-slot-content.d.ts +0 -7
- package/angular/utils/slot-content/render-calculation-label.d.ts +0 -7
- package/angular/utils/slot-content/tests/ad-hoc-slot-content.test.d.ts +0 -1
- package/angular/utils/slot-state/slot-context.d.ts +0 -4
- package/angular/utils/slot-state/slot-store.d.ts +0 -39
- package/angular/utils/store/base-store.d.ts +0 -158
- package/angular/utils/store/dashboard-store.d.ts +0 -49
- package/angular/utils/store/index.d.ts +0 -135
- package/angular/utils/store/item-store.d.ts +0 -33
- package/angular/utils/store/store-registry.d.ts +0 -170
- package/angular/utils/store/tests/dashboard-store.test.d.ts +0 -1
- package/angular/utils/store/tests/item-store.test.d.ts +0 -1
- package/angular/utils/store/tests/store-registry.test.d.ts +0 -1
- package/angular/utils/store/types.d.ts +0 -270
- package/angular/utils/switch-item/index.d.ts +0 -34
- package/angular/utils/switch-item/slot-role-classification.d.ts +0 -31
- package/angular/utils/switch-item/stories/switch-item.stories.d.ts +0 -17
- package/angular/utils/switch-item/tests/slot-role-classification.test.d.ts +0 -1
- package/angular/utils/switch-item/tests/switch-item.test.d.ts +0 -1
- package/angular/utils/tests/set-nested-value.test.d.ts +0 -1
- package/angular/utils/themes/bliss.d.ts +0 -2
- package/angular/utils/themes/classic-dark.d.ts +0 -2
- package/angular/utils/themes/classic.d.ts +0 -2
- package/angular/utils/themes/default-dark.d.ts +0 -2
- package/angular/utils/themes/default.d.ts +0 -2
- package/angular/utils/themes/index.d.ts +0 -4
- package/angular/utils/themes/orion.d.ts +0 -2
- package/angular/utils/themes/pinky.d.ts +0 -2
- package/angular/utils/themes/radiant.d.ts +0 -2
- package/angular/utils/themes/royale.d.ts +0 -2
- package/angular/utils/themes/seasonal.d.ts +0 -2
- package/angular/utils/themes/urban.d.ts +0 -2
- package/angular/utils/themes/vivid.d.ts +0 -2
- package/angular/utils/time/formats.const.d.ts +0 -4
- package/angular/utils/time/period-over-period-condition.const.d.ts +0 -8
- package/angular/utils/time/periods.const.d.ts +0 -15
- package/angular/utils/timezone/datetime-timezone.d.ts +0 -25
- package/angular/utils/timezone/tests/datetime-timezone.test.d.ts +0 -1
- package/angular/utils/transformations/convert-data-field-to-slot-content.d.ts +0 -9
- package/angular/utils/transformations/convert-datasets-to-data-fields.d.ts +0 -30
- package/angular/utils/transformations/tests/convert-data-field-to-slot-content.test.d.ts +0 -1
- package/angular/utils/transformations/tests/convert-datasets-to-data-fields.test.d.ts +0 -1
- package/angular/utils/types/tests/type-check.test.d.ts +0 -1
- package/angular/utils/types/type-check.d.ts +0 -28
- package/components/ad-hoc-slot-content-hSlT62VS.js +0 -29
- package/components/ai-chat/ai-chat-events.d.ts +0 -139
- package/components/ai-chat/ai-chat-request.d.ts +0 -25
- package/components/ai-chat/ai-chat.d.ts +0 -347
- package/components/ai-chat/ai-prompt-types.d.ts +0 -133
- package/components/ai-chat/empty-state/ai-chat-empty-state.d.ts +0 -46
- package/components/ai-chat/empty-state/index.d.ts +0 -8
- package/components/ai-chat/empty-state/types.d.ts +0 -14
- package/components/ai-chat/helpers/agent-config.d.ts +0 -12
- package/components/ai-chat/helpers/elicitation-template.d.ts +0 -18
- package/components/ai-chat/index.cjs +0 -20
- package/components/ai-chat/index.d.ts +0 -24
- package/components/ai-chat/index.js +0 -29
- package/components/ai-chat/session/ai-chat-session-controller.d.ts +0 -60
- package/components/ai-chat/session/ai-chat-session-types.d.ts +0 -119
- package/components/ai-chat/session/ai-chat-session.d.ts +0 -119
- package/components/ai-chat/session/index.d.ts +0 -2
- package/components/ai-chat/stream/chunk-extractors.d.ts +0 -29
- package/components/ai-chat/stream/index.d.ts +0 -53
- package/components/ai-chat/stream/progress.d.ts +0 -3
- package/components/ai-chat/stream/registry.d.ts +0 -6
- package/components/ai-chat/stream/stream-processor.d.ts +0 -2
- package/components/ai-chat/stream/transport.d.ts +0 -26
- package/components/ai-chat/stream/types.d.ts +0 -59
- package/components/ai-chat/types.d.ts +0 -24
- package/components/ai-chat-CG-eIiBr.cjs +0 -337
- package/components/ai-chat-CMc_9Oo2.js +0 -4350
- package/components/ai-interaction-textarea/ai-interaction-textarea.d.ts +0 -232
- package/components/ai-interaction-textarea/index.cjs +0 -20
- package/components/ai-interaction-textarea/index.d.ts +0 -10
- package/components/ai-interaction-textarea/index.js +0 -28
- package/components/ai-interaction-textarea/types.d.ts +0 -12
- package/components/ai-interaction-textarea-B6tZgh5k.cjs +0 -99
- package/components/ai-interaction-textarea-D9g9G0T1.js +0 -820
- package/components/base-D6QPZnpu.cjs +0 -20
- package/components/convert-data-field-to-slot-content-C6IIqU7G.js +0 -53
- package/components/convert-data-field-to-slot-content-DLzkk6dT.cjs +0 -20
- package/components/convert-datasets-to-data-fields-B13rl1an.cjs +0 -20
- package/components/convert-datasets-to-data-fields-PmQzeVLG.js +0 -68
- package/components/data-field-9ZZFw68C.cjs +0 -54
- package/components/data-field-D1WW_V0N.js +0 -121
- package/components/data-field-level/data-field-level.d.ts +0 -40
- package/components/data-field-level/helpers/generate-preview.d.ts +0 -9
- package/components/data-field-level/index.cjs +0 -20
- package/components/data-field-level/index.d.ts +0 -8
- package/components/data-field-level/index.js +0 -28
- package/components/data-field-level-Dc-EMhC3.cjs +0 -55
- package/components/data-field-panel-DFA97_8o.cjs +0 -87
- package/components/data-fields-select/data-fields-select.d.ts +0 -133
- package/components/data-fields-select/index.cjs +0 -20
- package/components/data-fields-select/index.d.ts +0 -9
- package/components/data-fields-select/index.js +0 -28
- package/components/data-fields-select/types.d.ts +0 -4
- package/components/data-fields-select-BtXNFZy9.cjs +0 -41
- package/components/dataset-icon/dataset-icon.d.ts +0 -45
- package/components/dataset-icon/index.cjs +0 -20
- package/components/dataset-icon/index.d.ts +0 -8
- package/components/dataset-icon/index.js +0 -28
- package/components/dataset-icon/types.d.ts +0 -11
- package/components/dataset-icon-BAV0S4sZ.cjs +0 -64
- package/components/dataset-icon-CWT5Ju8w.js +0 -125
- package/components/dataset-selector-list/dataset-selector-list.d.ts +0 -106
- package/components/dataset-selector-list/index.cjs +0 -20
- package/components/dataset-selector-list/index.d.ts +0 -8
- package/components/dataset-selector-list/index.js +0 -28
- package/components/dataset-selector-list-BXg6DIKI.cjs +0 -75
- package/components/dataset-selector-list-q6qWA7B-.js +0 -323
- package/components/dataset-selector-row/dataset-selector-row.d.ts +0 -135
- package/components/dataset-selector-row/index.cjs +0 -20
- package/components/dataset-selector-row/index.d.ts +0 -9
- package/components/dataset-selector-row/index.js +0 -28
- package/components/dataset-selector-row-ZKET7lVc.js +0 -427
- package/components/dataset-selector-row-bqwY3zaf.cjs +0 -102
- package/components/decompose-numeric-format-DGJua3rU.cjs +0 -20
- package/components/decompose-numeric-format-DS0j2wa1.js +0 -36
- package/components/decorate-DCJt-2rt.cjs +0 -20
- package/components/display-settings/display-settings.d.ts +0 -117
- package/components/display-settings/index.cjs +0 -20
- package/components/display-settings/index.d.ts +0 -8
- package/components/display-settings/index.js +0 -28
- package/components/display-settings/types.d.ts +0 -9
- package/components/display-settings-BlMhlvVS.cjs +0 -140
- package/components/display-settings-D_wBgzm1.js +0 -313
- package/components/display-settings-binning/display-settings-binning.d.ts +0 -32
- package/components/display-settings-binning/index.cjs +0 -20
- package/components/display-settings-binning/index.d.ts +0 -8
- package/components/display-settings-binning/index.js +0 -28
- package/components/display-settings-datetime/display-settings-datetime.d.ts +0 -86
- package/components/display-settings-datetime/index.cjs +0 -20
- package/components/display-settings-datetime/index.d.ts +0 -8
- package/components/display-settings-datetime/index.js +0 -28
- package/components/display-settings-datetime-DNeLEl3L.cjs +0 -217
- package/components/display-settings-grand-totals/display-settings-grand-totals.d.ts +0 -29
- package/components/display-settings-grand-totals/index.cjs +0 -20
- package/components/display-settings-grand-totals/index.d.ts +0 -8
- package/components/display-settings-grand-totals/index.js +0 -28
- package/components/display-settings-grand-totals-C-7s1Tyo.cjs +0 -44
- package/components/display-settings-numeric/display-settings-numeric.d.ts +0 -82
- package/components/display-settings-numeric/helpers/constants.d.ts +0 -19
- package/components/display-settings-numeric/index.cjs +0 -20
- package/components/display-settings-numeric/index.d.ts +0 -8
- package/components/display-settings-numeric/index.js +0 -28
- package/components/display-settings-numeric--uwJWzC1.cjs +0 -190
- package/components/display-settings-period-over-period/display-settings-period-over-period.d.ts +0 -68
- package/components/display-settings-period-over-period/helpers/constants.d.ts +0 -44
- package/components/display-settings-period-over-period/index.cjs +0 -20
- package/components/display-settings-period-over-period/index.d.ts +0 -8
- package/components/display-settings-period-over-period/index.js +0 -28
- package/components/display-settings-period-over-period-C4X8c-_R.cjs +0 -229
- package/components/filter-expression-picker/filter-expression-picker.d.ts +0 -73
- package/components/filter-expression-picker/index.cjs +0 -20
- package/components/filter-expression-picker/index.d.ts +0 -7
- package/components/filter-expression-picker/index.js +0 -28
- package/components/filter-expression-picker-BOLyxG2r.cjs +0 -38
- package/components/filter-expression-picker-DurfSgRY.js +0 -425
- package/components/filter-item/filter-item.d.ts +0 -103
- package/components/filter-item/index.cjs +0 -20
- package/components/filter-item/index.d.ts +0 -7
- package/components/filter-item/index.js +0 -28
- package/components/filter-item-C58zIpPh.js +0 -316
- package/components/filter-item-obyHcs9f.cjs +0 -71
- package/components/filter-parameter-picker/filter-parameter-picker.d.ts +0 -87
- package/components/filter-parameter-picker/filter-parameter-picker.helpers.d.ts +0 -8
- package/components/filter-parameter-picker/index.cjs +0 -20
- package/components/filter-parameter-picker/index.d.ts +0 -9
- package/components/filter-parameter-picker/index.js +0 -28
- package/components/filter-parameter-picker/types.d.ts +0 -4
- package/components/filter-parameter-picker-BWNBc8BI.js +0 -363
- package/components/filter-parameter-picker-DSYaE9Sv.cjs +0 -123
- package/components/filter-value-picker/filter-value-picker.d.ts +0 -66
- package/components/filter-value-picker/index.cjs +0 -20
- package/components/filter-value-picker/index.d.ts +0 -7
- package/components/filter-value-picker/index.js +0 -28
- package/components/filter-value-picker-DYl_1pis.cjs +0 -60
- package/components/filter-value-picker-datetime/filter-value-picker-datetime.d.ts +0 -45
- package/components/filter-value-picker-datetime/index.cjs +0 -20
- package/components/filter-value-picker-datetime/index.d.ts +0 -7
- package/components/filter-value-picker-datetime/index.js +0 -28
- package/components/filter-value-picker-datetime-BFbmCKs3.cjs +0 -42
- package/components/filter-value-picker-datetime-CP5__ua6.js +0 -139
- package/components/filter-value-picker-hierarchy/filter-value-picker-hierarchy.d.ts +0 -99
- package/components/filter-value-picker-hierarchy/index.cjs +0 -20
- package/components/filter-value-picker-hierarchy/index.d.ts +0 -7
- package/components/filter-value-picker-hierarchy/index.js +0 -28
- package/components/filter-value-picker-hierarchy-BTf992WX.cjs +0 -48
- package/components/filter-value-picker-hierarchy-j0LRYW1c.js +0 -299
- package/components/filter-value-picker-kzIrnmdp.js +0 -151
- package/components/filter-value-picker-numeric/filter-value-picker-numeric.d.ts +0 -83
- package/components/filter-value-picker-numeric/index.cjs +0 -20
- package/components/filter-value-picker-numeric/index.d.ts +0 -7
- package/components/filter-value-picker-numeric/index.js +0 -28
- package/components/filter-value-picker-numeric-BmKmeOol.js +0 -219
- package/components/filter-value-picker-numeric-DJi0Utk_.cjs +0 -48
- package/components/filters-BddhKRZC.js +0 -745
- package/components/filters-Dx6g0xl9.cjs +0 -153
- package/components/formatter-BeXmurVe.cjs +0 -20
- package/components/formula-cc2AaiLt.cjs +0 -45
- package/components/formula-codemirror/formula-codemirror.d.ts +0 -79
- package/components/formula-codemirror/index.d.ts +0 -7
- package/components/formula-codemirror/pills/formula-aggregation/formula-aggregation.d.ts +0 -125
- package/components/formula-codemirror/pills/formula-aggregation/index.d.ts +0 -7
- package/components/formula-codemirror/pills/formula-empty-argument-pill/formula-empty-argument-pill.d.ts +0 -28
- package/components/formula-codemirror/pills/formula-empty-argument-pill/index.d.ts +0 -7
- package/components/formula-codemirror/pills/formula-include-exclude-panel.d.ts +0 -38
- package/components/formula-codemirror-EMK3MCNZ.cjs +0 -215
- package/components/formula-display-store-DER7C0GG.cjs +0 -20
- package/components/formula-draggable-field/formula-draggable-field.d.ts +0 -53
- package/components/formula-draggable-field/index.d.ts +0 -8
- package/components/formula-draggable-field/types.d.ts +0 -24
- package/components/formula-editor-CWKXcUTF.cjs +0 -224
- package/components/formula-field/formula-field.d.ts +0 -20
- package/components/formula-field/index.cjs +0 -20
- package/components/formula-field/index.d.ts +0 -7
- package/components/formula-field/index.js +0 -28
- package/components/formula-field-BtvaOWki.js +0 -40
- package/components/formula-field-CzS2pKJI.cjs +0 -20
- package/components/formula-input-base-CvD0b2cO.cjs +0 -49
- package/components/formula-input-base-DVtGLoyA.js +0 -236
- package/components/get-dataset-name-D53TN7N9.js +0 -32
- package/components/get-dataset-name-DYLdbEs-.cjs +0 -20
- package/components/groupings-Bn9384Zw.cjs +0 -20
- package/components/groupings-BtmmUlPK.js +0 -52
- package/components/interactive-viz-item/helpers/chart-helpers.d.ts +0 -7
- package/components/interactive-viz-item/index.cjs +0 -20
- package/components/interactive-viz-item/index.d.ts +0 -10
- package/components/interactive-viz-item/index.js +0 -28
- package/components/interactive-viz-item/interactive-viz-item.d.ts +0 -96
- package/components/interactive-viz-item/types.d.ts +0 -117
- package/components/interactive-viz-item-DL5aqkvx.js +0 -693
- package/components/interactive-viz-item-DTr14-9-.cjs +0 -247
- package/components/item-menu/item-list/item-list.d.ts +0 -37
- package/components/item-option-action-button-group-Byg9h7uo.cjs +0 -53
- package/components/item-option-base/item-option-base.d.ts +0 -23
- package/components/item-option-base-Dwf3dByS.cjs +0 -56
- package/components/item-option-color-palette-picker-v6TBE-I0.cjs +0 -40
- package/components/item-option-color-range-BveD6fsp.cjs +0 -98
- package/components/item-option-guidelines-D8UjylMx.cjs +0 -135
- package/components/item-option-h8URFjZ2.cjs +0 -269
- package/components/item-option-position-picker-CKgaqFJR.cjs +0 -32
- package/components/item-option-positions-number-field-BJXer0y5.cjs +0 -49
- package/components/item-option-slider-CBSnkHVq.cjs +0 -33
- package/components/item-slot-drop-f8jm-34W.cjs +0 -91
- package/components/item-slot-drop-panel-DLqyYvKj.cjs +0 -57
- package/components/item-slot-picker-CgEtqhqe.cjs +0 -174
- package/components/item-slot-picker-panel-CuH3OcmV.cjs +0 -81
- package/components/load-data-fields-for-datasets-B3XcFFfg.js +0 -42
- package/components/load-data-fields-for-datasets-rL24A68g.cjs +0 -20
- package/components/localized-mixin-CtNoCjjI.cjs +0 -20
- package/components/localized-mixin-DBUkUh0o.js +0 -45
- package/components/period-over-period-condition.const-BZ7j5Z5t.js +0 -29
- package/components/period-over-period-condition.const-C1NZ9Bkp.cjs +0 -20
- package/components/slot-menu/index.cjs +0 -20
- package/components/slot-menu/index.d.ts +0 -10
- package/components/slot-menu/index.js +0 -28
- package/components/slot-menu/slot-menu.d.ts +0 -148
- package/components/slot-menu/types.d.ts +0 -24
- package/components/slot-menu-CPxyyKSe.cjs +0 -71
- package/components/slot-menu-DHJtAZ5_.js +0 -429
- package/components/slot-menu-list/index.cjs +0 -20
- package/components/slot-menu-list/index.d.ts +0 -8
- package/components/slot-menu-list/index.js +0 -28
- package/components/slot-menu-list/slot-menu-list.d.ts +0 -47
- package/components/slot-menu-list-CeWcE4KK.cjs +0 -44
- package/components/slot-menu-list-QltpaoWh.js +0 -347
- package/components/slot-role-classification-2wChhpcq.cjs +0 -20
- package/components/slot-role-classification-B8bkGhQ_.js +0 -133
- package/components/slots-config-Cd4xAG4H.cjs +0 -20
- package/components/slots-config-D3ivNWtC.js +0 -76
- package/components/utils-BwJNkc-z.cjs +0 -20
- package/components/viz-item-menu/index.cjs +0 -20
- package/components/viz-item-menu/index.d.ts +0 -8
- package/components/viz-item-menu/index.js +0 -28
- package/components/viz-item-menu/types.d.ts +0 -9
- package/components/viz-item-menu/viz-item-menu.d.ts +0 -75
- package/components/viz-item-menu-Ht6bklNL.js +0 -170
- package/components/viz-item-menu-XHh4qhtn.cjs +0 -55
- package/deprecated-react/components/ai-chat.component.cjs +0 -1
- package/deprecated-react/components/ai-interaction-textarea.component.cjs +0 -1
- package/deprecated-react/components/data-field-level.component.cjs +0 -1
- package/deprecated-react/components/data-fields-select.component.cjs +0 -1
- package/deprecated-react/components/dataset-icon.component.cjs +0 -1
- package/deprecated-react/components/dataset-selector-list.component.cjs +0 -1
- package/deprecated-react/components/dataset-selector-row.component.cjs +0 -1
- package/deprecated-react/components/display-settings-binning.component.cjs +0 -1
- package/deprecated-react/components/display-settings-datetime.component.cjs +0 -1
- package/deprecated-react/components/display-settings-grand-totals.component.cjs +0 -1
- package/deprecated-react/components/display-settings-numeric.component.cjs +0 -1
- package/deprecated-react/components/display-settings-period-over-period.component.cjs +0 -1
- package/deprecated-react/components/display-settings.component.cjs +0 -1
- package/deprecated-react/components/filter-expression-picker.component.cjs +0 -1
- package/deprecated-react/components/filter-item.component.cjs +0 -1
- package/deprecated-react/components/filter-parameter-picker.component.cjs +0 -1
- package/deprecated-react/components/filter-value-picker-datetime.component.cjs +0 -1
- package/deprecated-react/components/filter-value-picker-hierarchy.component.cjs +0 -1
- package/deprecated-react/components/filter-value-picker-numeric.component.cjs +0 -1
- package/deprecated-react/components/filter-value-picker.component.cjs +0 -1
- package/deprecated-react/components/formula-field.component.cjs +0 -1
- package/deprecated-react/components/interactive-viz-item.component.cjs +0 -1
- package/deprecated-react/components/slot-menu-list.component.cjs +0 -1
- package/deprecated-react/components/slot-menu.component.cjs +0 -1
- package/deprecated-react/components/viz-item-menu.component.cjs +0 -1
- package/react/components/ai-chat.component.ts +0 -45
- package/react/components/ai-interaction-textarea.component.ts +0 -30
- package/react/components/data-field-level.component.ts +0 -30
- package/react/components/data-fields-select.component.ts +0 -27
- package/react/components/dataset-icon.component.ts +0 -22
- package/react/components/dataset-selector-list.component.ts +0 -27
- package/react/components/dataset-selector-row.component.ts +0 -36
- package/react/components/display-settings-binning.component.ts +0 -27
- package/react/components/display-settings-datetime.component.ts +0 -27
- package/react/components/display-settings-grand-totals.component.ts +0 -27
- package/react/components/display-settings-numeric.component.ts +0 -27
- package/react/components/display-settings-period-over-period.component.ts +0 -27
- package/react/components/display-settings.component.ts +0 -33
- package/react/components/filter-expression-picker.component.ts +0 -27
- package/react/components/filter-item.component.ts +0 -27
- package/react/components/filter-parameter-picker.component.ts +0 -33
- package/react/components/filter-value-picker-datetime.component.ts +0 -27
- package/react/components/filter-value-picker-hierarchy.component.ts +0 -27
- package/react/components/filter-value-picker-numeric.component.ts +0 -27
- package/react/components/filter-value-picker.component.ts +0 -27
- package/react/components/formula-field.component.ts +0 -30
- package/react/components/interactive-viz-item.component.ts +0 -33
- package/react/components/slot-menu-list.component.ts +0 -27
- package/react/components/slot-menu.component.ts +0 -42
- package/react/components/viz-item-menu.component.ts +0 -33
- package/react/esm/components/ai-chat.component.d.ts +0 -24
- package/react/esm/components/ai-chat.component.js +0 -29
- package/react/esm/components/ai-interaction-textarea.component.d.ts +0 -14
- package/react/esm/components/ai-interaction-textarea.component.js +0 -19
- package/react/esm/components/data-field-level.component.d.ts +0 -14
- package/react/esm/components/data-field-level.component.js +0 -19
- package/react/esm/components/data-fields-select.component.d.ts +0 -12
- package/react/esm/components/data-fields-select.component.js +0 -17
- package/react/esm/components/dataset-icon.component.d.ts +0 -8
- package/react/esm/components/dataset-icon.component.js +0 -13
- package/react/esm/components/dataset-selector-list.component.d.ts +0 -12
- package/react/esm/components/dataset-selector-list.component.js +0 -17
- package/react/esm/components/dataset-selector-row.component.d.ts +0 -18
- package/react/esm/components/dataset-selector-row.component.js +0 -23
- package/react/esm/components/display-settings-binning.component.d.ts +0 -12
- package/react/esm/components/display-settings-binning.component.js +0 -17
- package/react/esm/components/display-settings-datetime.component.d.ts +0 -12
- package/react/esm/components/display-settings-datetime.component.js +0 -17
- package/react/esm/components/display-settings-grand-totals.component.d.ts +0 -12
- package/react/esm/components/display-settings-grand-totals.component.js +0 -17
- package/react/esm/components/display-settings-numeric.component.d.ts +0 -12
- package/react/esm/components/display-settings-numeric.component.js +0 -17
- package/react/esm/components/display-settings-period-over-period.component.d.ts +0 -12
- package/react/esm/components/display-settings-period-over-period.component.js +0 -17
- package/react/esm/components/display-settings.component.d.ts +0 -16
- package/react/esm/components/display-settings.component.js +0 -21
- package/react/esm/components/filter-expression-picker.component.d.ts +0 -12
- package/react/esm/components/filter-expression-picker.component.js +0 -17
- package/react/esm/components/filter-item.component.d.ts +0 -12
- package/react/esm/components/filter-item.component.js +0 -17
- package/react/esm/components/filter-parameter-picker.component.d.ts +0 -16
- package/react/esm/components/filter-parameter-picker.component.js +0 -21
- package/react/esm/components/filter-value-picker-datetime.component.d.ts +0 -12
- package/react/esm/components/filter-value-picker-datetime.component.js +0 -17
- package/react/esm/components/filter-value-picker-hierarchy.component.d.ts +0 -12
- package/react/esm/components/filter-value-picker-hierarchy.component.js +0 -17
- package/react/esm/components/filter-value-picker-numeric.component.d.ts +0 -12
- package/react/esm/components/filter-value-picker-numeric.component.js +0 -17
- package/react/esm/components/filter-value-picker.component.d.ts +0 -12
- package/react/esm/components/filter-value-picker.component.js +0 -17
- package/react/esm/components/formula-field.component.d.ts +0 -14
- package/react/esm/components/formula-field.component.js +0 -19
- package/react/esm/components/interactive-viz-item.component.d.ts +0 -16
- package/react/esm/components/interactive-viz-item.component.js +0 -21
- package/react/esm/components/slot-menu-list.component.d.ts +0 -12
- package/react/esm/components/slot-menu-list.component.js +0 -17
- package/react/esm/components/slot-menu.component.d.ts +0 -22
- package/react/esm/components/slot-menu.component.js +0 -27
- package/react/esm/components/viz-item-menu.component.d.ts +0 -16
- package/react/esm/components/viz-item-menu.component.js +0 -21
- package/storybook/inject-global-vars.d.ts +0 -1
- package/storybook/register-components.d.ts +0 -57
- package/types/agent.types.d.ts +0 -4
- package/types/ai-chat.types.d.ts +0 -104
- package/types/data-field-events.types.d.ts +0 -7
- /package/{angular/utils/ai-prompt/tests/attachments.test.d.ts → utils/slot-state/tests/slot-store.test.d.ts} +0 -0
|
@@ -0,0 +1,2454 @@
|
|
|
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 };
|