@luzmo/analytics-components-kit 1.0.1-alpha.98 → 1.0.1-alpha.99
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/angular/README.md +2 -2
- package/angular/components/ai-interaction-textarea.component.ts +8 -0
- package/angular/components/{filter-data-item-picker.component.ts → data-items-select.component.ts} +34 -17
- package/angular/components/edit-filters/index.ts +1 -0
- package/angular/components/edit-filters/types.ts +10 -0
- package/angular/components/edit-filters.component.ts +41 -0
- package/angular/components/slot-contents-picker.component.ts +8 -6
- package/angular/esm/components/ai-interaction-textarea.component.d.ts +5 -1
- package/angular/esm/components/ai-interaction-textarea.component.js +22 -2
- package/angular/esm/components/data-items-select.component.d.ts +33 -0
- package/angular/esm/components/{filter-data-item-picker.component.js → data-items-select.component.js} +41 -26
- package/angular/esm/components/edit-filters/index.d.ts +1 -0
- package/angular/esm/components/edit-filters/index.js +1 -0
- package/angular/esm/components/edit-filters/types.d.ts +8 -0
- package/angular/esm/components/edit-filters/types.js +1 -0
- package/angular/esm/components/edit-filters.component.d.ts +21 -0
- package/angular/esm/components/edit-filters.component.js +89 -0
- package/angular/esm/components/slot-contents-picker.component.d.ts +7 -6
- package/angular/esm/components/slot-contents-picker.component.js +11 -6
- package/angular/esm/index.d.ts +5 -5
- package/angular/esm/index.js +6 -6
- package/angular/esm/types.d.ts +9 -0
- package/angular/index.ts +6 -6
- package/angular/types.ts +17 -0
- package/angular/utils/filters/expressions.d.ts +1 -1
- package/components/ai-chat-message-assistant/index.cjs +1 -1
- package/components/ai-chat-message-assistant/index.js +0 -1
- package/components/ai-chat-messages-container/index.cjs +1 -1
- package/components/ai-chat-messages-container/index.js +2 -2
- package/components/ai-interaction-textarea/ai-interaction-textarea.d.ts +21 -0
- package/components/ai-interaction-textarea/index.cjs +17 -15
- package/components/ai-interaction-textarea/index.js +91 -67
- package/components/area-chart-options.config-Bl8bhhOo.cjs +20 -0
- package/components/{area-chart-options.config-_J0sG4NF.js → area-chart-options.config-u8itidsi.js} +14 -26
- package/components/bar-chart-options.config-CePAqM83.cjs +20 -0
- package/components/{bar-chart-options.config-D1mb5TDl.js → bar-chart-options.config-DIirbAJ0.js} +21 -35
- package/components/box-plot-options.config-BVNrV2eD.cjs +20 -0
- package/components/{box-plot-options.config-xu_i6ms7.js → box-plot-options.config-BWROiguA.js} +52 -88
- package/components/{bubble-chart-options.config-BacgXkJ_.js → bubble-chart-options.config-4QD8VPhU.js} +9 -18
- package/components/bubble-chart-options.config-BDgOe3GQ.cjs +20 -0
- package/components/{bullet-chart-options.config-CDPpX1yc.js → bullet-chart-options.config-3bH7uekx.js} +1 -1
- package/components/{bullet-chart-options.config-DfS4Bwds.cjs → bullet-chart-options.config-tWb6Fio-.cjs} +1 -1
- package/components/calculate-data-item-icon-DMDhKq_m.js +147 -0
- package/components/calculate-data-item-icon-DtVGbet3.cjs +20 -0
- package/components/{choropleth-map-options.config-B_W9-rhe.js → choropleth-map-options.config-CMxx3ORp.js} +63 -84
- package/components/choropleth-map-options.config-CWJACFd0.cjs +20 -0
- package/components/circular-gauge-options.config-BMxgq3zH.cjs +20 -0
- package/components/{circular-gauge-options.config-DAIjz4Rl.js → circular-gauge-options.config-DhIKn44k.js} +23 -36
- package/components/{color-DuJ4-73S.js → color-B7m0j8lX.js} +941 -950
- package/components/color-Czp4Im5q.cjs +20 -0
- package/components/{color-range-utils-Bvo9sm5A.js → color-range-utils-BSfqtB3A.js} +31 -32
- package/components/color-range-utils-DYYR-iwx.cjs +20 -0
- package/components/column-chart-options.config-BV9R3ssH.cjs +20 -0
- package/components/{column-chart-options.config-B5SjBVdy.js → column-chart-options.config-D5-yR7iq.js} +27 -37
- package/components/conditional-number-options.config-Co099Qfm.cjs +20 -0
- package/components/{conditional-number-options.config-BCEpSK9J.js → conditional-number-options.config-DPYsdML5.js} +24 -40
- package/components/{filter-data-item-picker/filter-data-item-picker.d.ts → data-items-select/data-items-select.d.ts} +36 -21
- package/components/data-items-select/index.cjs +39 -0
- package/components/data-items-select/index.d.ts +6 -0
- package/components/data-items-select/index.js +209 -0
- package/components/dataset-icon/index.cjs +1 -1
- package/components/dataset-icon/index.js +1 -2
- package/components/dataset-selector-list/index.cjs +1 -1
- package/components/dataset-selector-list/index.js +32 -35
- package/components/dataset-selector-row/index.cjs +9 -9
- package/components/dataset-selector-row/index.js +50 -52
- package/components/{date-comparison-filter-options.config-JA_yYpJa.js → date-comparison-filter-options.config-CSwGyuBg.js} +3 -6
- package/components/{date-comparison-filter-options.config-DAVncmi0.cjs → date-comparison-filter-options.config-QaoWaFUn.cjs} +1 -1
- package/components/{date-filter-options.config-DBRxlTWy.js → date-filter-options.config-BTVyHRkp.js} +3 -6
- package/components/{date-filter-options.config-CWPMtA18.cjs → date-filter-options.config-n-zhWaYa.cjs} +1 -1
- package/components/{de-COKGBX9L.cjs → de-DOYL4txr.cjs} +1 -1
- package/components/{de-DU0DlXuf.js → de-SDzGVifr.js} +10 -1
- package/components/display-settings/index.cjs +1 -1
- package/components/display-settings/index.js +1 -1
- package/components/display-settings-binning/index.cjs +5 -5
- package/components/display-settings-binning/index.js +29 -30
- package/components/display-settings-datetime/index.cjs +29 -29
- package/components/display-settings-datetime/index.js +112 -120
- package/components/display-settings-grand-totals/index.cjs +4 -4
- package/components/display-settings-grand-totals/index.js +23 -24
- package/components/display-settings-numeric/index.cjs +48 -48
- package/components/display-settings-numeric/index.js +190 -206
- package/components/display-settings-period-over-period/index.cjs +16 -16
- package/components/display-settings-period-over-period/index.js +91 -97
- package/components/{donut-chart-options.config-BulUEiaH.js → donut-chart-options.config-3ZqX8Cbb.js} +21 -37
- package/components/donut-chart-options.config-BQyPgnC9.cjs +20 -0
- package/components/draggable-data-item/index.cjs +5 -5
- package/components/draggable-data-item/index.js +45 -46
- package/components/draggable-data-item-level/index.cjs +11 -11
- package/components/draggable-data-item-level/index.js +70 -73
- package/components/{dropdown-filter-options.config-D9dvPypF.js → dropdown-filter-options.config-CGJTtgAX.js} +7 -10
- package/components/{dropdown-filter-options.config-DS-MORmq.cjs → dropdown-filter-options.config-DJvfCTk7.cjs} +1 -1
- package/components/droppable-slot/index.cjs +16 -16
- package/components/droppable-slot/index.js +174 -265
- package/components/edit-filters/edit-filters.d.ts +79 -0
- package/components/edit-filters/index.cjs +144 -0
- package/components/edit-filters/index.d.ts +8 -0
- package/components/edit-filters/index.js +341 -0
- package/components/edit-filters/types.d.ts +8 -0
- package/components/edit-item/index.cjs +9 -9
- package/components/edit-item/index.js +116 -119
- package/components/edit-option/index.cjs +1 -1
- package/components/edit-option/index.js +1 -1
- package/components/edit-option-action-button-group/index.cjs +8 -8
- package/components/edit-option-action-button-group/index.js +52 -53
- package/components/{edit-option-base-DIc7iC-b.js → edit-option-base-Bh29-Cak.js} +1 -1
- package/components/{edit-option-base-VhTih9T1.cjs → edit-option-base-tFr8Qg2B.cjs} +1 -1
- package/components/edit-option-color-palette-picker/index.cjs +1 -1
- package/components/edit-option-color-palette-picker/index.js +1 -1
- package/components/edit-option-color-picker/index.cjs +1 -1
- package/components/edit-option-color-picker/index.js +1 -1
- package/components/edit-option-color-range/index.cjs +19 -19
- package/components/edit-option-color-range/index.js +106 -117
- package/components/edit-option-multi-language-field/index.cjs +3 -3
- package/components/edit-option-multi-language-field/index.js +26 -27
- package/components/edit-option-number-field/index.cjs +1 -1
- package/components/edit-option-number-field/index.js +1 -1
- package/components/edit-option-picker/index.cjs +5 -5
- package/components/edit-option-picker/index.js +7 -7
- package/components/edit-option-position-picker/index.cjs +4 -4
- package/components/edit-option-position-picker/index.js +21 -25
- package/components/edit-option-positions-number-field/index.cjs +9 -9
- package/components/edit-option-positions-number-field/index.js +76 -81
- package/components/edit-option-radio-button-group/index.cjs +6 -6
- package/components/edit-option-radio-button-group/index.js +21 -22
- package/components/edit-option-slider/index.cjs +1 -1
- package/components/edit-option-slider/index.js +1 -1
- package/components/edit-option-switch/index.cjs +1 -1
- package/components/edit-option-switch/index.js +1 -1
- package/components/edit-option-text-field/index.cjs +2 -2
- package/components/edit-option-text-field/index.js +22 -23
- package/components/en-D3ihEGXg.js +1483 -0
- package/components/en-DZcn_iz_.cjs +20 -0
- package/components/{en-GB-DG6uS3sM.cjs → en-GB-TqvgIw9B.cjs} +1 -1
- package/components/{en-GB-CEHEs8F2.js → en-GB-ialeqj_z.js} +1 -1
- package/components/{es-BxR1uGKR.js → es-B1TeapPZ.js} +10 -1
- package/components/{es-CaKfa7fn.cjs → es-DcQvrHgz.cjs} +1 -1
- package/components/{evolution-number-options.config-DzkfeoIN.js → evolution-number-options.config-BIPO_4n3.js} +11 -14
- package/components/{evolution-number-options.config-BgIZY4gQ.cjs → evolution-number-options.config-Bc9eKYnn.cjs} +1 -1
- package/components/{extrapolate-color-0j_AeYkz.cjs → extrapolate-color-C0n1UDs-.cjs} +1 -1
- package/components/{extrapolate-color-CC9CURf6.js → extrapolate-color-v1PimdQr.js} +1 -1
- package/components/filter-expression-picker/index.cjs +1 -1
- package/components/filter-expression-picker/index.js +1 -1
- package/components/filter-item/filter-item.d.ts +1 -1
- package/components/filter-item/index.cjs +9 -7
- package/components/filter-item/index.js +123 -123
- package/components/filter-value-picker/index.cjs +2 -2
- package/components/filter-value-picker/index.js +34 -36
- package/components/filter-value-picker-datetime/index.cjs +8 -8
- package/components/filter-value-picker-datetime/index.js +56 -71
- package/components/filter-value-picker-hierarchy/index.cjs +12 -12
- package/components/filter-value-picker-hierarchy/index.js +113 -124
- package/components/filter-value-picker-numeric/index.cjs +9 -8
- package/components/filter-value-picker-numeric/index.js +102 -110
- package/components/{focusable-DCIFkpiW.js → focusable-BS2pbY7w.js} +24 -26
- package/components/focusable-QLh-LlNt.cjs +20 -0
- package/components/{fr-DiZbjx_a.cjs → fr-D6QmA3Ve.cjs} +1 -1
- package/components/{fr-CvltYxR_.js → fr-sZFBmltf.js} +10 -1
- package/components/{funnel-chart-options.config-C_VjTOvD.js → funnel-chart-options.config-CrJy2U7_.js} +5 -20
- package/components/funnel-chart-options.config-DrP4AFgk.cjs +20 -0
- package/components/get-css-variable-C0B_Sxqf.cjs +24 -0
- package/components/{get-css-variable-YlLiVgo8.js → get-css-variable-DgTBQV3c.js} +39 -38
- package/components/grid/index.cjs +43 -49
- package/components/grid/index.js +2610 -1878
- package/components/heat-map-options.config-CIHnPdYE.cjs +20 -0
- package/components/{heat-map-options.config-BnLWe8jS.js → heat-map-options.config-CmL87j1j.js} +35 -41
- package/components/{heat-table-options.config-CUsDdgUr.js → heat-table-options.config-BrCYAgYD.js} +60 -88
- package/components/heat-table-options.config-DTlZRc_i.cjs +20 -0
- package/components/helpers-9I0oLoUB.cjs +20 -0
- package/components/helpers-bR8Ibjqh.js +79 -0
- package/components/{hexbin-map-options.config-F-7uCqxb.js → hexbin-map-options.config-BguV1w8q.js} +20 -38
- package/components/hexbin-map-options.config-CKnn3VAB.cjs +20 -0
- package/components/index-BekTY3Em.cjs +121 -0
- package/components/index-BikhVAa1.js +1755 -0
- package/components/index-CAbDIHYI.cjs +20 -0
- package/components/{index-Do7O9azB.js → index-CqKpf0B8.js} +112 -123
- package/components/{index-BPNsFiyq.cjs → index-DM58h73U.cjs} +4 -4
- package/components/{index-D0GBF6tg.js → index-DR5275fa.js} +122 -102
- package/components/index-DvkzMbLt.cjs +249 -0
- package/components/{index-CdIUfo-L.js → index-haa7WNrl.js} +453 -481
- package/components/index.cjs +1 -1
- package/components/index.js +105 -106
- package/components/item-options-configs.cjs +1 -1
- package/components/item-options-configs.js +37 -37
- package/components/{line-chart-options.config-DB3IsXXr.js → line-chart-options.config-BhirTGqD.js} +13 -28
- package/components/line-chart-options.config-Cqwou5u6.cjs +20 -0
- package/components/{localize-r7ALOUy_.cjs → localize-C4zNlrwK.cjs} +1 -1
- package/components/{localize-BX7q0S0M.js → localize-CcDpq940.js} +10 -10
- package/components/{marker-map-options.config-DPJ955tt.js → marker-map-options.config-Bx17jmiq.js} +1 -1
- package/components/{marker-map-options.config-_FYZzRwA.cjs → marker-map-options.config-CvhCylSC.cjs} +1 -1
- package/components/{nl-CLs7FmRK.js → nl-BYXZ-qNp.js} +10 -1
- package/components/{nl-Bot6bJ4g.cjs → nl-D7oNsLn0.cjs} +1 -1
- package/components/{pivot-table-options.config-DNK_AIG7.js → pivot-table-options.config-CFc7y0IT.js} +15 -24
- package/components/pivot-table-options.config-uZDAertf.cjs +20 -0
- package/components/{pyramid-chart-options.config-CcVMatYx.js → pyramid-chart-options.config-2Waxb11l.js} +29 -43
- package/components/pyramid-chart-options.config-DoGfEvzU.cjs +20 -0
- package/components/{radar-chart-options.config-CUZn_3Fd.js → radar-chart-options.config-CPN5fOl8.js} +11 -23
- package/components/radar-chart-options.config-CtNUMN1l.cjs +20 -0
- package/components/{regular-table-options.config-BoLZsBry.js → regular-table-options.config-CFKCJQK1.js} +17 -23
- package/components/{regular-table-options.config-DTx3RTnS.cjs → regular-table-options.config-YRuoijIk.cjs} +1 -1
- package/components/route-map-options.config-CVTk5RVL.cjs +20 -0
- package/components/{route-map-options.config-CN86T7c0.js → route-map-options.config-CyolTJfK.js} +87 -109
- package/components/{sankey-diagram-options.config-RFB83YLZ.cjs → sankey-diagram-options.config-D7OSvSqm.cjs} +1 -1
- package/components/{sankey-diagram-options.config-tVLKy_Zn.js → sankey-diagram-options.config-Ldjk84ro.js} +7 -10
- package/components/scatter-plot-options.config-5gN7pMTm.cjs +20 -0
- package/components/{scatter-plot-options.config-Corlzno1.js → scatter-plot-options.config-CfxEfkQ1.js} +56 -86
- package/components/{search-filter-options.config-BE3JhR-F.js → search-filter-options.config-C0syQmP4.js} +3 -6
- package/components/{search-filter-options.config-BCaDlYqZ.cjs → search-filter-options.config-Oqco9BKj.cjs} +1 -1
- package/components/{set-locale-Dp3N_gXN.js → set-locale-B5562CBM.js} +2 -9
- package/components/{set-locale-BRRalqne.cjs → set-locale-B8iQGfk0.cjs} +1 -1
- package/components/slicer-filter-options.config-CrusP6a0.cjs +20 -0
- package/components/{slicer-filter-options.config-3JZZcw5C.js → slicer-filter-options.config-DmOe3440.js} +9 -18
- package/components/{slider-filter-options.config-DH4SS8wH.js → slider-filter-options.config-B1M8RcDs.js} +1 -1
- package/components/{slider-filter-options.config-_8Z2zKmU.cjs → slider-filter-options.config-k45I-t6G.cjs} +1 -1
- package/components/slot-contents-picker/index.cjs +35 -31
- package/components/slot-contents-picker/index.js +202 -200
- package/components/slot-contents-picker/slot-contents-picker.d.ts +26 -5
- package/components/slot-menu/index.cjs +12 -12
- package/components/slot-menu/index.js +189 -202
- package/components/slot-menu-list/index.cjs +3 -3
- package/components/slot-menu-list/index.js +97 -103
- package/components/slot-store-CRfN0nD3.js +98 -0
- package/components/slot-store-Dd_cPNXk.cjs +20 -0
- package/components/speedometer-chart-options.config-B4ceg_qI.cjs +20 -0
- package/components/{speedometer-chart-options.config-SL581yOa.js → speedometer-chart-options.config-CzOmuEF8.js} +31 -53
- package/components/spike-map-options.config-BkkDqb4g.cjs +20 -0
- package/components/{spike-map-options.config-C5KewecZ.js → spike-map-options.config-Cbt1YUw6.js} +91 -122
- package/components/{sunburst-chart-options.config-AbNjWS6t.cjs → sunburst-chart-options.config-Yrxc2i57.cjs} +1 -1
- package/components/{sunburst-chart-options.config-CNauGQJv.js → sunburst-chart-options.config-_dyLQxPJ.js} +9 -20
- package/components/{symbol-map-options.config-DdDA4aa7.js → symbol-map-options.config-BORL1NSU.js} +11 -20
- package/components/symbol-map-options.config-NpBKm64d.cjs +20 -0
- package/components/{treemap-chart-options.config-D5AJaF_u.js → treemap-chart-options.config-B9i9qIm_.js} +20 -37
- package/components/treemap-chart-options.config-x4J54WSw.cjs +20 -0
- package/components/utils.cjs +1 -1
- package/components/utils.js +94 -97
- package/components/{video-options.config-CGsDTwHc.cjs → video-options.config-B0asgYt8.cjs} +1 -1
- package/components/{video-options.config-Dk36zJ1B.js → video-options.config-UX-9MDfS.js} +7 -10
- package/components/viz-item-menu/index.cjs +5 -5
- package/components/viz-item-menu/index.js +26 -28
- package/components/{wordcloud-chart-options.config-vGfCW8kE.cjs → wordcloud-chart-options.config-BKtJT8Va.cjs} +1 -1
- package/components/{wordcloud-chart-options.config-w2NUIWVA.js → wordcloud-chart-options.config-BoB_KuhA.js} +4 -7
- package/custom-elements.json +1936 -1625
- package/index.d.ts +1 -1
- package/package.json +12 -12
- package/types.d.ts +9 -0
- package/utils/filters/expressions.d.ts +1 -1
- package/angular/components/filter-group.component.ts +0 -29
- package/angular/esm/components/filter-data-item-picker.component.d.ts +0 -30
- package/angular/esm/components/filter-group.component.d.ts +0 -12
- package/angular/esm/components/filter-group.component.js +0 -56
- package/components/area-chart-options.config-C7sMAHco.cjs +0 -20
- package/components/bar-chart-options.config-DcxEkOT5.cjs +0 -20
- package/components/box-plot-options.config-SrrbDEYW.cjs +0 -20
- package/components/bubble-chart-options.config-Ihn6eVQI.cjs +0 -20
- package/components/calculate-data-item-icon-CEa82-5u.cjs +0 -20
- package/components/calculate-data-item-icon-DjlZwMdO.js +0 -147
- package/components/choropleth-map-options.config-ZW8yoZH2.cjs +0 -20
- package/components/circular-gauge-options.config-msZ4mfpN.cjs +0 -20
- package/components/color-B6LaL8qz.cjs +0 -20
- package/components/color-range-utils-C5yXW7ZC.cjs +0 -20
- package/components/column-chart-options.config-BjDvA7i9.cjs +0 -20
- package/components/conditional-number-options.config-DgzUo0xi.cjs +0 -20
- package/components/donut-chart-options.config-tNpqBZfR.cjs +0 -20
- package/components/en-BKBhKBXY.cjs +0 -20
- package/components/en-BOTjhwEc.js +0 -1488
- package/components/filter-data-item-picker/index.cjs +0 -47
- package/components/filter-data-item-picker/index.d.ts +0 -7
- package/components/filter-data-item-picker/index.js +0 -192
- package/components/filter-group/filter-group.d.ts +0 -26
- package/components/filter-group/index.d.ts +0 -7
- package/components/focusable-B3E_hQmm.cjs +0 -20
- package/components/funnel-chart-options.config-D7H7gFcx.cjs +0 -20
- package/components/get-css-variable-DLiZYZEi.cjs +0 -24
- package/components/heat-map-options.config-DVH-Bb5-.cjs +0 -20
- package/components/heat-table-options.config-B12JEYnp.cjs +0 -20
- package/components/helpers-DXQwEH1P.cjs +0 -20
- package/components/helpers-v1bPALRP.js +0 -91
- package/components/hexbin-map-options.config-DZERRhM8.cjs +0 -20
- package/components/index-CDi4fe3N.js +0 -1716
- package/components/index-CQ9ck-BO.cjs +0 -249
- package/components/index-CXn67vdn.cjs +0 -121
- package/components/index-Cz9vSXy6.cjs +0 -20
- package/components/line-chart-options.config-DSugoe0t.cjs +0 -20
- package/components/pivot-table-options.config-BiJXKSFR.cjs +0 -20
- package/components/pyramid-chart-options.config-C4zbFS26.cjs +0 -20
- package/components/radar-chart-options.config-EqQu6PTh.cjs +0 -20
- package/components/route-map-options.config-D7NJePTu.cjs +0 -20
- package/components/scatter-plot-options.config-CFfGJXsV.cjs +0 -20
- package/components/slicer-filter-options.config-DNI-XevE.cjs +0 -20
- package/components/speedometer-chart-options.config-BX9LTQBH.cjs +0 -20
- package/components/spike-map-options.config-DoBFXPmN.cjs +0 -20
- package/components/symbol-map-options.config-m-lwLTtu.cjs +0 -20
- package/components/treemap-chart-options.config-C0Q9aQ1Z.cjs +0 -20
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import '@luzmo/lucero/action-button';
|
|
2
|
+
import '@luzmo/lucero/button';
|
|
3
|
+
import '@luzmo/lucero/icon';
|
|
4
|
+
import { LuzmoElement } from '@luzmo/lucero/utils';
|
|
5
|
+
import { CSSResultArray, PropertyValues, TemplateResult } from 'lit';
|
|
6
|
+
import '../filter-item';
|
|
7
|
+
import type { FilterGroup } from './types';
|
|
8
|
+
declare const LuzmoEditFilters_base: typeof LuzmoElement & {
|
|
9
|
+
new (...args: any[]): import("@luzmo/lucero").SizedElementInterface;
|
|
10
|
+
prototype: import("@luzmo/lucero").SizedElementInterface;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @element luzmo-edit-filters
|
|
14
|
+
* @fires filters-changed - Announces that the filters have changed
|
|
15
|
+
*/
|
|
16
|
+
export declare class LuzmoEditFilters extends LuzmoEditFilters_base {
|
|
17
|
+
static get styles(): CSSResultArray;
|
|
18
|
+
/**
|
|
19
|
+
* The API URL of the databroker
|
|
20
|
+
* @default https://api.luzmo.com
|
|
21
|
+
*/
|
|
22
|
+
apiUrl?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The auth key of the databroker
|
|
25
|
+
*/
|
|
26
|
+
authKey?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The auth token of the databroker
|
|
29
|
+
*/
|
|
30
|
+
authToken?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The cache time of the databroker
|
|
33
|
+
*/
|
|
34
|
+
cacheTime?: number;
|
|
35
|
+
/**
|
|
36
|
+
* The language of the settings interface
|
|
37
|
+
*/
|
|
38
|
+
language: string;
|
|
39
|
+
/**
|
|
40
|
+
* The language to use for locale-aware formatting and labels
|
|
41
|
+
*/
|
|
42
|
+
contentLanguage: string;
|
|
43
|
+
/**
|
|
44
|
+
* The time zone to use for the date picker
|
|
45
|
+
*/
|
|
46
|
+
timeZone?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The dataset ids to fetch columns & formulas
|
|
49
|
+
*/
|
|
50
|
+
datasetIds?: string[];
|
|
51
|
+
/**
|
|
52
|
+
* The filter group structure to display
|
|
53
|
+
*/
|
|
54
|
+
filters: FilterGroup | null;
|
|
55
|
+
private _internalFilterGroup;
|
|
56
|
+
/**
|
|
57
|
+
* Get a smaller size for the condition badges
|
|
58
|
+
*/
|
|
59
|
+
private get _oneSizeSmaller();
|
|
60
|
+
protected willUpdate(changedProperties: PropertyValues): void;
|
|
61
|
+
private _generateEmptyGroup;
|
|
62
|
+
private _generateEmptyFilter;
|
|
63
|
+
private _cleanFilterGroupForExport;
|
|
64
|
+
private _sendChangeEvent;
|
|
65
|
+
private _isGroup;
|
|
66
|
+
private _toggleCondition;
|
|
67
|
+
private _addFilter;
|
|
68
|
+
private _addSubGroup;
|
|
69
|
+
private _removeFilter;
|
|
70
|
+
private _updateFilter;
|
|
71
|
+
private _addGroup;
|
|
72
|
+
private _renderFilterItem;
|
|
73
|
+
private _renderGroup;
|
|
74
|
+
private _findParentGroup;
|
|
75
|
+
private _collapseIfNeeded;
|
|
76
|
+
private _collapseGroupsAfterDelete;
|
|
77
|
+
protected render(): TemplateResult;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 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
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@lit/localize"),d=require("@luzmo/icons");require("@luzmo/lucero/action-button");require("@luzmo/lucero/button");require("@luzmo/lucero/icon");const p=require("@luzmo/lucero/utils"),o=require("lit"),a=require("lit/decorators.js"),g=require("lit/directives/repeat.js"),m=require("../set-locale-B8iQGfk0.cjs");require("../filter-item/index.cjs");const f=':host{display:block;font-family:var(--luzmo-edit-filters-font-family, var(--luzmo-font-family));color:var(--luzmo-edit-filters-font-color, var(--luzmo-font-color));max-width:100%}.filter-group-container{max-width:100%;overflow:hidden}.filter-group{display:flex;flex-direction:row;max-width:100%;min-width:0}.filter-group.nested{margin-top:var(--luzmo-edit-filters-nested-group-margin-top, var(--edit-filters-nested-group-margin-top));margin-bottom:var(--luzmo-edit-filters-nested-group-margin-bottom, var(--edit-filters-nested-group-margin-bottom))}.group-content{display:flex;flex-direction:column;flex:1;min-width:0}.filters-list{display:flex;flex-direction:column;gap:var(--luzmo-edit-filters-filters-list-gap, var(--edit-filters-filters-list-gap));min-width:0;max-width:100%}.filter-item-wrapper{position:relative;display:flex;align-items:flex-start;min-width:0;max-width:100%}.filter-item-content{display:flex;align-items:center;gap:var(--luzmo-edit-filters-filter-line-gap, var(--edit-filters-filter-line-gap));flex:1;min-width:0}.filter-item-content luzmo-filter-item{flex:1;min-width:0}.filter-item-content .delete-filter-button{flex-shrink:0;align-self:center}.condition-wrapper{position:relative;flex:0 0 var(--luzmo-edit-filters-condition-warpper-width, var(--edit-filters-condition-warpper-width));display:flex;align-items:center;justify-content:center}.condition-wrapper:before{content:"";position:absolute;left:50%;top:var(--luzmo-edit-filters-vertical-line-top, var(--edit-filters-vertical-line-top));bottom:var(--luzmo-edit-filters-vertical-line-bottom, var(--edit-filters-vertical-line-bottom));width:var(--luzmo-edit-filters-vertical-line-width, var(--edit-filters-vertical-line-width));background:var(--luzmo-edit-filters-vertical-line-color, var(--luzmo-border-color))}.condition-badge{min-width:auto;padding-inline:var(--luzmo-edit-filters-condition-padding-horizontal, var(--edit-filters-condition-padding-horizontal));font-weight:700;text-transform:uppercase;background:var(--luzmo-edit-filters-condition-badge-background, var(--luzmo-primary));color:var(--luzmo-edit-filters-condition-badge-color, var(--luzmo-primary-inverse-color));border-radius:var(--luzmo-edit-filters-condition-badge-border-radius, var(--luzmo-border-radius));box-shadow:0 0 0 var(--luzmo-edit-filters-condition-badge-halo, var(--edit-filters-condition-badge-halo)) var(--luzmo-edit-filters-condition-badge-background, var(--luzmo-background-color))}.condition-badge:hover{background:var(--luzmo-edit-filters-condition-badge-background-hover, var(--luzmo-primary-hover))}.group-actions{display:flex;margin-top:var(--luzmo-edit-filters-group-actions-margin-top, var(--edit-filters-group-actions-margin-top));gap:var(--luzmo-edit-filters-group-actions-gap, var(--edit-filters-group-actions-gap));flex-wrap:wrap}.delete-group-button{margin-left:auto}.add-root-group-container{margin-top:var(--luzmo-edit-filters-add-root-group-container-margin-top, var(--edit-filters-add-root-group-container-margin-top));padding-left:0}.add-subgroup-button,.add-filter-button{--luzmo-action-button-text-to-visual: var(--luzmo-edit-filters-group-actions-text-to-visual, var(--edit-filters-group-actions-text-to-visual));--luzmo-action-button-content-color-default: var(--luzmo-edit-filters-group-actions-color, var(--luzmo-primary-hover));--luzmo-action-button-content-color-hover: var(--luzmo-edit-filters-group-actions-color-hover, var(--luzmo-primary-hover));--luzmo-action-button-content-color-down: var(--luzmo-edit-filters-group-actions-color-down, var(--luzmo-primary-down));--luzmo-action-button-content-color-focus: var(--luzmo-edit-filters-group-actions-color-focus, var(--luzmo-primary-focus))}.add-group-button{--luzmo-button-padding-label-to-icon: var(--luzmo-edit-filters-add-group-button-text-to-visual, var(--edit-filters-add-group-button-text-to-visual))}:host{--edit-filters-condition-warpper-width: 56px;--edit-filters-condition-padding-horizontal: var(--luzmo-spacing-2);--edit-filters-condition-badge-halo: var(--luzmo-spacing-3);--edit-filters-filters-list-gap: var(--luzmo-spacing-3);--edit-filters-nested-group-margin-top: var(--luzmo-spacing-3);--edit-filters-nested-group-margin-bottom: var(--luzmo-spacing-3);--edit-filters-vertical-line-top: var(--luzmo-spacing-2);--edit-filters-vertical-line-bottom: var(--luzmo-spacing-2);--edit-filters-vertical-line-width: 1px;--edit-filters-group-actions-text-to-visual: var(--luzmo-spacing-2);--edit-filters-add-group-button-text-to-visual: var(--luzmo-spacing-3);--edit-filters-group-actions-gap: var(--luzmo-spacing-3);--edit-filters-add-root-group-container-margin-top: var(--luzmo-spacing-4);--edit-filters-filter-line-gap: var(--luzmo-spacing-3);--edit-filters-group-actions-margin-top: var(--luzmo-spacing-3)}:host([size=s]){--edit-filters-condition-warpper-width: 48px;--edit-filters-condition-padding-horizontal: var(--luzmo-spacing-2);--edit-filters-condition-badge-halo: var(--luzmo-spacing-2);--edit-filters-filters-list-gap: calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--edit-filters-nested-group-margin-top: calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--edit-filters-nested-group-margin-bottom: calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--edit-filters-vertical-line-top: var(--luzmo-spacing-2);--edit-filters-vertical-line-bottom: var(--luzmo-spacing-2);--edit-filters-group-actions-text-to-visual: var(--luzmo-spacing-1);--edit-filters-add-group-button-text-to-visual: var(--luzmo-spacing-2);--edit-filters-group-actions-gap: var(--luzmo-spacing-2);--edit-filters-add-root-group-container-margin-top: var(--luzmo-spacing-3);--edit-filters-filter-line-gap: var(--luzmo-spacing-2);--edit-filters-group-actions-margin-top: var(--luzmo-spacing-2)}:host([size=l]){--edit-filters-condition-warpper-width: 64px;--edit-filters-condition-padding-horizontal: var(--luzmo-spacing-3);--edit-filters-condition-badge-halo: var(--luzmo-spacing-4);--edit-filters-filters-list-gap: var(--luzmo-spacing-4);--edit-filters-nested-group-margin-top: var(--luzmo-spacing-4);--edit-filters-nested-group-margin-bottom: var(--luzmo-spacing-4);--edit-filters-vertical-line-top: var(--luzmo-spacing-3);--edit-filters-vertical-line-bottom: var(--luzmo-spacing-3);--edit-filters-group-actions-text-to-visual: var(--luzmo-spacing-2);--edit-filters-add-group-button-text-to-visual: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--edit-filters-group-actions-gap: var(--luzmo-spacing-3);--edit-filters-add-root-group-container-margin-top: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--edit-filters-filter-line-gap: var(--luzmo-spacing-3);--edit-filters-group-actions-margin-top: var(--luzmo-spacing-3)}:host([size=xl]){--edit-filters-condition-warpper-width: 72px;--edit-filters-condition-padding-horizontal: var(--luzmo-spacing-3);--edit-filters-condition-badge-halo: var(--luzmo-spacing-4);--edit-filters-filters-list-gap: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--edit-filters-nested-group-margin-top: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--edit-filters-nested-group-margin-bottom: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--edit-filters-vertical-line-top: var(--luzmo-spacing-3);--edit-filters-vertical-line-bottom: var(--luzmo-spacing-3);--edit-filters-group-actions-text-to-visual: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--edit-filters-add-group-button-text-to-visual: var(--luzmo-spacing-4);--edit-filters-group-actions-gap: var(--luzmo-spacing-4);--edit-filters-add-root-group-container-margin-top: var(--luzmo-spacing-5);--edit-filters-filter-line-gap: var(--luzmo-spacing-4);--edit-filters-group-actions-margin-top: var(--luzmo-spacing-4)}';var h=Object.defineProperty,z=Object.getOwnPropertyDescriptor,n=(c,t,i,e)=>{for(var r=e>1?void 0:e?z(t,i):t,l=c.length-1,s;l>=0;l--)(s=c[l])&&(r=(e?s(t,i,r):s(r))||r);return e&&r&&h(t,i,r),r};exports.LuzmoEditFilters=class extends p.SizedMixin(p.LuzmoElement,{validSizes:Object.values(p.ElementSizes)}){constructor(){super(...arguments),this.apiUrl="https://api.luzmo.com",this.language="en",this.contentLanguage="en",this.filters=null,this._internalFilterGroup=null}static get styles(){return[o.unsafeCSS(f)]}get _oneSizeSmaller(){return{xxs:"xxs",xs:"xs",s:"xs",m:"s",l:"m",xl:"l",xxl:"xl"}[this.size]||"s"}willUpdate(t){t.has("language")&&this.language!==m.getLocale()&&([...m.targetLocales].includes(this.language??"en")||this.language==="en")&&m.setLocale(this.language),t.has("filters")&&(this._internalFilterGroup=this.filters?structuredClone(this.filters):this._generateEmptyGroup())}_generateEmptyGroup(){return{condition:"AND",filters:[]}}_generateEmptyFilter(){return{expression:void 0,parameters:[]}}_cleanFilterGroupForExport(t){return t?{condition:t.condition,filters:t.filters.map(e=>this._isGroup(e)?this._cleanFilterGroupForExport(e):{...e})}:null}_sendChangeEvent(){this.dispatchEvent(new CustomEvent("filters-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{filters:this._cleanFilterGroupForExport(this._internalFilterGroup)}}))}_isGroup(t){return"condition"in t&&"filters"in t}_toggleCondition(t){t.condition=t.condition==="AND"?"OR":"AND",this.requestUpdate(),this._sendChangeEvent()}_addFilter(t){t.filters.push(this._generateEmptyFilter()),this.requestUpdate(),this._sendChangeEvent()}_addSubGroup(t){const i=this._generateEmptyGroup();i.condition=t.condition==="AND"?"OR":"AND",i.filters.push(this._generateEmptyFilter()),t.filters.push(i),this.requestUpdate(),this._sendChangeEvent()}_removeFilter(t,i){if(!this._internalFilterGroup)return;if(t.filters.splice(i,1),!(t===this._internalFilterGroup)&&t.filters.length===0){const r=this._findParentGroup(this._internalFilterGroup,t);if(r){const l=r.filters.indexOf(t);l!==-1&&r.filters.splice(l,1)}}this._collapseGroupsAfterDelete(),this.requestUpdate(),this._sendChangeEvent()}_updateFilter(t,i,e){e.stopPropagation(),this._isGroup(t.filters[i])||(t.filters[i]=e.detail.filter,this._sendChangeEvent())}_addGroup(){this._internalFilterGroup||(this._internalFilterGroup=this._generateEmptyGroup());const t=this._generateEmptyGroup();t.condition=this._internalFilterGroup.condition==="AND"?"OR":"AND",t.filters.push(this._internalFilterGroup);const i=this._generateEmptyGroup();i.condition=t.condition==="AND"?"OR":"AND",i.filters.push(this._generateEmptyFilter()),t.filters.push(i),this._internalFilterGroup=t,this.requestUpdate(),this._sendChangeEvent()}_renderFilterItem(t,i,e){return o.html`
|
|
21
|
+
<div class="filter-item-wrapper">
|
|
22
|
+
<div class="filter-item-content">
|
|
23
|
+
<luzmo-filter-item
|
|
24
|
+
.apiUrl=${this.apiUrl}
|
|
25
|
+
.authKey=${this.authKey}
|
|
26
|
+
.authToken=${this.authToken}
|
|
27
|
+
.cacheTime=${this.cacheTime}
|
|
28
|
+
.language=${this.language}
|
|
29
|
+
.contentLanguage=${this.contentLanguage}
|
|
30
|
+
.timeZone=${this.timeZone}
|
|
31
|
+
.datasetIds=${this.datasetIds}
|
|
32
|
+
.filter=${t}
|
|
33
|
+
.size=${this.size}
|
|
34
|
+
@filter-changed=${this._updateFilter.bind(this,i,e)}
|
|
35
|
+
></luzmo-filter-item>
|
|
36
|
+
<luzmo-action-button
|
|
37
|
+
class="delete-filter-button"
|
|
38
|
+
.size=${this.size}
|
|
39
|
+
quiet
|
|
40
|
+
@click=${this._removeFilter.bind(this,i,e)}
|
|
41
|
+
>
|
|
42
|
+
<luzmo-icon slot="icon" .icon=${d.luzmoTrashOutline} .size=${this.size}></luzmo-icon>
|
|
43
|
+
</luzmo-action-button>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
`}_renderGroup(t,i=!1){const e=t.filters.length>0,r=t.filters.length>1;return o.html`
|
|
47
|
+
<div class="filter-group ${i?"nested":""}">
|
|
48
|
+
${i?o.html`
|
|
49
|
+
<div class="condition-wrapper">
|
|
50
|
+
${r?o.html`
|
|
51
|
+
<luzmo-action-button
|
|
52
|
+
class="condition-badge"
|
|
53
|
+
.size=${this._oneSizeSmaller}
|
|
54
|
+
quiet
|
|
55
|
+
@click=${this._toggleCondition.bind(this,t)}
|
|
56
|
+
>
|
|
57
|
+
${t.condition}
|
|
58
|
+
</luzmo-action-button>
|
|
59
|
+
`:""}
|
|
60
|
+
</div>
|
|
61
|
+
`:r?o.html`
|
|
62
|
+
<div class="condition-wrapper">
|
|
63
|
+
<luzmo-action-button
|
|
64
|
+
class="condition-badge"
|
|
65
|
+
.size=${this._oneSizeSmaller}
|
|
66
|
+
quiet
|
|
67
|
+
@click=${this._toggleCondition.bind(this,t)}
|
|
68
|
+
>
|
|
69
|
+
${t.condition}
|
|
70
|
+
</luzmo-action-button>
|
|
71
|
+
</div>
|
|
72
|
+
`:""}
|
|
73
|
+
<div class="group-content">
|
|
74
|
+
${e?o.html`
|
|
75
|
+
<div class="filters-list">
|
|
76
|
+
${g.repeat(t.filters,(l,s)=>s,(l,s)=>o.html`
|
|
77
|
+
${this._isGroup(l)?this._renderGroup(l,!0):this._renderFilterItem(l,t,s)}
|
|
78
|
+
`)}
|
|
79
|
+
</div>
|
|
80
|
+
`:""}
|
|
81
|
+
|
|
82
|
+
<div class="group-actions">
|
|
83
|
+
<luzmo-action-button
|
|
84
|
+
class="add-filter-button"
|
|
85
|
+
.size=${this.size}
|
|
86
|
+
quiet
|
|
87
|
+
@click=${this._addFilter.bind(this,t)}
|
|
88
|
+
>
|
|
89
|
+
<luzmo-icon slot="icon" .icon=${d.luzmoPlus} .size=${this._oneSizeSmaller}></luzmo-icon>
|
|
90
|
+
${u.msg("Filter",{desc:"Add filter button label"})}
|
|
91
|
+
</luzmo-action-button>
|
|
92
|
+
|
|
93
|
+
<luzmo-action-button
|
|
94
|
+
class="add-subgroup-button"
|
|
95
|
+
.size=${this.size}
|
|
96
|
+
quiet
|
|
97
|
+
@click=${this._addSubGroup.bind(this,t)}
|
|
98
|
+
>
|
|
99
|
+
<luzmo-icon slot="icon" .icon=${d.luzmoPlus} .size=${this._oneSizeSmaller}></luzmo-icon>
|
|
100
|
+
${u.msg("Subgroup",{desc:"Add subgroup button label"})}
|
|
101
|
+
</luzmo-action-button>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
`}_findParentGroup(t,i){for(const e of t.filters){if(e===i)return t;if(this._isGroup(e)){const r=this._findParentGroup(e,i);if(r)return r}}return null}_collapseIfNeeded(t){if(t.filters.length===1&&this._isGroup(t.filters[0])){const i=t.filters[0];t.condition=i.condition,t.filters=i.filters}}_collapseGroupsAfterDelete(){if(!this._internalFilterGroup)return;const t=i=>{for(const e of i.filters)this._isGroup(e)&&t(e);this._collapseIfNeeded(i)};t(this._internalFilterGroup)}render(){if(!this._internalFilterGroup)return o.html`
|
|
106
|
+
<div class="filter-group-container">
|
|
107
|
+
<luzmo-action-button
|
|
108
|
+
class="add-filter-group-button"
|
|
109
|
+
@click=${this._addGroup}
|
|
110
|
+
>
|
|
111
|
+
${u.msg("Add filter group",{desc:"Add filter group button label"})}
|
|
112
|
+
</luzmo-action-button>
|
|
113
|
+
</div>
|
|
114
|
+
`;if(!(this._internalFilterGroup.filters.length>0))return o.html`
|
|
115
|
+
<div class="filter-group-container">
|
|
116
|
+
<luzmo-button
|
|
117
|
+
class="add-filter-button"
|
|
118
|
+
.size=${this.size}
|
|
119
|
+
treatment="outline"
|
|
120
|
+
@click=${this._addFilter.bind(this,this._internalFilterGroup)}
|
|
121
|
+
>
|
|
122
|
+
<luzmo-icon slot="icon" .icon=${d.luzmoPlus} .size=${this._oneSizeSmaller}></luzmo-icon>
|
|
123
|
+
${u.msg("Add filter",{desc:"Add filter button label"})}
|
|
124
|
+
</luzmo-button>
|
|
125
|
+
</div>
|
|
126
|
+
`;const i=this._internalFilterGroup.filters.length>1;return o.html`
|
|
127
|
+
<div class="filter-group-container">
|
|
128
|
+
${this._renderGroup(this._internalFilterGroup)}
|
|
129
|
+
|
|
130
|
+
${i?o.html`
|
|
131
|
+
<div class="add-root-group-container">
|
|
132
|
+
<luzmo-button
|
|
133
|
+
class="add-group-button"
|
|
134
|
+
.size=${this.size}
|
|
135
|
+
treatment="outline"
|
|
136
|
+
@click=${this._addGroup}
|
|
137
|
+
>
|
|
138
|
+
<luzmo-icon slot="icon" .icon=${d.luzmoPlus} .size=${this._oneSizeSmaller}></luzmo-icon>
|
|
139
|
+
${u.msg("Group",{desc:"Add group button label"})}
|
|
140
|
+
</luzmo-button>
|
|
141
|
+
</div>
|
|
142
|
+
`:""}
|
|
143
|
+
</div>
|
|
144
|
+
`}};n([a.property({type:String,attribute:"api-url",reflect:!0})],exports.LuzmoEditFilters.prototype,"apiUrl",2);n([a.property({type:String,attribute:"auth-key",reflect:!0})],exports.LuzmoEditFilters.prototype,"authKey",2);n([a.property({type:String,attribute:"auth-token",reflect:!0})],exports.LuzmoEditFilters.prototype,"authToken",2);n([a.property({type:Number,attribute:"cache-time",reflect:!0})],exports.LuzmoEditFilters.prototype,"cacheTime",2);n([a.property({type:String,reflect:!0})],exports.LuzmoEditFilters.prototype,"language",2);n([a.property({type:String,attribute:"content-language",reflect:!0})],exports.LuzmoEditFilters.prototype,"contentLanguage",2);n([a.property({type:String,attribute:"time-zone",reflect:!0})],exports.LuzmoEditFilters.prototype,"timeZone",2);n([a.property({type:Array,attribute:"dataset-ids",reflect:!0})],exports.LuzmoEditFilters.prototype,"datasetIds",2);n([a.property({type:Object,reflect:!1})],exports.LuzmoEditFilters.prototype,"filters",2);n([a.state()],exports.LuzmoEditFilters.prototype,"_internalFilterGroup",2);exports.LuzmoEditFilters=n([u.localized()],exports.LuzmoEditFilters);customElements.get("luzmo-edit-filters")||customElements.define("luzmo-edit-filters",exports.LuzmoEditFilters);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LuzmoEditFilters } from './edit-filters';
|
|
2
|
+
declare global {
|
|
3
|
+
interface HTMLElementTagNameMap {
|
|
4
|
+
'luzmo-edit-filters': LuzmoEditFilters;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export { LuzmoEditFilters } from './edit-filters';
|
|
8
|
+
export type { FilterCondition, FilterGroup } from './types';
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 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 { msg as c, localized as m } from "@lit/localize";
|
|
21
|
+
import { luzmoTrashOutline as f, luzmoPlus as d } from "@luzmo/icons";
|
|
22
|
+
import "@luzmo/lucero/action-button";
|
|
23
|
+
import "@luzmo/lucero/button";
|
|
24
|
+
import "@luzmo/lucero/icon";
|
|
25
|
+
import { SizedMixin as g, LuzmoElement as z, ElementSizes as h } from "@luzmo/lucero/utils";
|
|
26
|
+
import { unsafeCSS as v, html as n } from "lit";
|
|
27
|
+
import { property as s, state as b } from "lit/decorators.js";
|
|
28
|
+
import { repeat as x } from "lit/directives/repeat.js";
|
|
29
|
+
import { g as _, t as y, s as w } from "../set-locale-B5562CBM.js";
|
|
30
|
+
import "../filter-item/index.js";
|
|
31
|
+
(function() {
|
|
32
|
+
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
33
|
+
const o = document.createElement("style");
|
|
34
|
+
o.setAttribute("data-luzmo-vars", ""), o.textContent = 'html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-background-color-alt-1: rgb(250, 250, 250);--luzmo-background-color-alt-2: rgb(239, 239, 239);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-color-disabled);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-secondary-outline: rgba(255, 0, 255, 0.2);--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-color-informative: #1a77e9;--luzmo-color-informative-rgb: 26, 119, 233;--luzmo-color-disabled: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}', document.head.appendChild(o);
|
|
35
|
+
}
|
|
36
|
+
})();
|
|
37
|
+
const G = ':host{display:block;font-family:var(--luzmo-edit-filters-font-family, var(--luzmo-font-family));color:var(--luzmo-edit-filters-font-color, var(--luzmo-font-color));max-width:100%}.filter-group-container{max-width:100%;overflow:hidden}.filter-group{display:flex;flex-direction:row;max-width:100%;min-width:0}.filter-group.nested{margin-top:var(--luzmo-edit-filters-nested-group-margin-top, var(--edit-filters-nested-group-margin-top));margin-bottom:var(--luzmo-edit-filters-nested-group-margin-bottom, var(--edit-filters-nested-group-margin-bottom))}.group-content{display:flex;flex-direction:column;flex:1;min-width:0}.filters-list{display:flex;flex-direction:column;gap:var(--luzmo-edit-filters-filters-list-gap, var(--edit-filters-filters-list-gap));min-width:0;max-width:100%}.filter-item-wrapper{position:relative;display:flex;align-items:flex-start;min-width:0;max-width:100%}.filter-item-content{display:flex;align-items:center;gap:var(--luzmo-edit-filters-filter-line-gap, var(--edit-filters-filter-line-gap));flex:1;min-width:0}.filter-item-content luzmo-filter-item{flex:1;min-width:0}.filter-item-content .delete-filter-button{flex-shrink:0;align-self:center}.condition-wrapper{position:relative;flex:0 0 var(--luzmo-edit-filters-condition-warpper-width, var(--edit-filters-condition-warpper-width));display:flex;align-items:center;justify-content:center}.condition-wrapper:before{content:"";position:absolute;left:50%;top:var(--luzmo-edit-filters-vertical-line-top, var(--edit-filters-vertical-line-top));bottom:var(--luzmo-edit-filters-vertical-line-bottom, var(--edit-filters-vertical-line-bottom));width:var(--luzmo-edit-filters-vertical-line-width, var(--edit-filters-vertical-line-width));background:var(--luzmo-edit-filters-vertical-line-color, var(--luzmo-border-color))}.condition-badge{min-width:auto;padding-inline:var(--luzmo-edit-filters-condition-padding-horizontal, var(--edit-filters-condition-padding-horizontal));font-weight:700;text-transform:uppercase;background:var(--luzmo-edit-filters-condition-badge-background, var(--luzmo-primary));color:var(--luzmo-edit-filters-condition-badge-color, var(--luzmo-primary-inverse-color));border-radius:var(--luzmo-edit-filters-condition-badge-border-radius, var(--luzmo-border-radius));box-shadow:0 0 0 var(--luzmo-edit-filters-condition-badge-halo, var(--edit-filters-condition-badge-halo)) var(--luzmo-edit-filters-condition-badge-background, var(--luzmo-background-color))}.condition-badge:hover{background:var(--luzmo-edit-filters-condition-badge-background-hover, var(--luzmo-primary-hover))}.group-actions{display:flex;margin-top:var(--luzmo-edit-filters-group-actions-margin-top, var(--edit-filters-group-actions-margin-top));gap:var(--luzmo-edit-filters-group-actions-gap, var(--edit-filters-group-actions-gap));flex-wrap:wrap}.delete-group-button{margin-left:auto}.add-root-group-container{margin-top:var(--luzmo-edit-filters-add-root-group-container-margin-top, var(--edit-filters-add-root-group-container-margin-top));padding-left:0}.add-subgroup-button,.add-filter-button{--luzmo-action-button-text-to-visual: var(--luzmo-edit-filters-group-actions-text-to-visual, var(--edit-filters-group-actions-text-to-visual));--luzmo-action-button-content-color-default: var(--luzmo-edit-filters-group-actions-color, var(--luzmo-primary-hover));--luzmo-action-button-content-color-hover: var(--luzmo-edit-filters-group-actions-color-hover, var(--luzmo-primary-hover));--luzmo-action-button-content-color-down: var(--luzmo-edit-filters-group-actions-color-down, var(--luzmo-primary-down));--luzmo-action-button-content-color-focus: var(--luzmo-edit-filters-group-actions-color-focus, var(--luzmo-primary-focus))}.add-group-button{--luzmo-button-padding-label-to-icon: var(--luzmo-edit-filters-add-group-button-text-to-visual, var(--edit-filters-add-group-button-text-to-visual))}:host{--edit-filters-condition-warpper-width: 56px;--edit-filters-condition-padding-horizontal: var(--luzmo-spacing-2);--edit-filters-condition-badge-halo: var(--luzmo-spacing-3);--edit-filters-filters-list-gap: var(--luzmo-spacing-3);--edit-filters-nested-group-margin-top: var(--luzmo-spacing-3);--edit-filters-nested-group-margin-bottom: var(--luzmo-spacing-3);--edit-filters-vertical-line-top: var(--luzmo-spacing-2);--edit-filters-vertical-line-bottom: var(--luzmo-spacing-2);--edit-filters-vertical-line-width: 1px;--edit-filters-group-actions-text-to-visual: var(--luzmo-spacing-2);--edit-filters-add-group-button-text-to-visual: var(--luzmo-spacing-3);--edit-filters-group-actions-gap: var(--luzmo-spacing-3);--edit-filters-add-root-group-container-margin-top: var(--luzmo-spacing-4);--edit-filters-filter-line-gap: var(--luzmo-spacing-3);--edit-filters-group-actions-margin-top: var(--luzmo-spacing-3)}:host([size=s]){--edit-filters-condition-warpper-width: 48px;--edit-filters-condition-padding-horizontal: var(--luzmo-spacing-2);--edit-filters-condition-badge-halo: var(--luzmo-spacing-2);--edit-filters-filters-list-gap: calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--edit-filters-nested-group-margin-top: calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--edit-filters-nested-group-margin-bottom: calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--edit-filters-vertical-line-top: var(--luzmo-spacing-2);--edit-filters-vertical-line-bottom: var(--luzmo-spacing-2);--edit-filters-group-actions-text-to-visual: var(--luzmo-spacing-1);--edit-filters-add-group-button-text-to-visual: var(--luzmo-spacing-2);--edit-filters-group-actions-gap: var(--luzmo-spacing-2);--edit-filters-add-root-group-container-margin-top: var(--luzmo-spacing-3);--edit-filters-filter-line-gap: var(--luzmo-spacing-2);--edit-filters-group-actions-margin-top: var(--luzmo-spacing-2)}:host([size=l]){--edit-filters-condition-warpper-width: 64px;--edit-filters-condition-padding-horizontal: var(--luzmo-spacing-3);--edit-filters-condition-badge-halo: var(--luzmo-spacing-4);--edit-filters-filters-list-gap: var(--luzmo-spacing-4);--edit-filters-nested-group-margin-top: var(--luzmo-spacing-4);--edit-filters-nested-group-margin-bottom: var(--luzmo-spacing-4);--edit-filters-vertical-line-top: var(--luzmo-spacing-3);--edit-filters-vertical-line-bottom: var(--luzmo-spacing-3);--edit-filters-group-actions-text-to-visual: var(--luzmo-spacing-2);--edit-filters-add-group-button-text-to-visual: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--edit-filters-group-actions-gap: var(--luzmo-spacing-3);--edit-filters-add-root-group-container-margin-top: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--edit-filters-filter-line-gap: var(--luzmo-spacing-3);--edit-filters-group-actions-margin-top: var(--luzmo-spacing-3)}:host([size=xl]){--edit-filters-condition-warpper-width: 72px;--edit-filters-condition-padding-horizontal: var(--luzmo-spacing-3);--edit-filters-condition-badge-halo: var(--luzmo-spacing-4);--edit-filters-filters-list-gap: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--edit-filters-nested-group-margin-top: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--edit-filters-nested-group-margin-bottom: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--edit-filters-vertical-line-top: var(--luzmo-spacing-3);--edit-filters-vertical-line-bottom: var(--luzmo-spacing-3);--edit-filters-group-actions-text-to-visual: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--edit-filters-add-group-button-text-to-visual: var(--luzmo-spacing-4);--edit-filters-group-actions-gap: var(--luzmo-spacing-4);--edit-filters-add-root-group-container-margin-top: var(--luzmo-spacing-5);--edit-filters-filter-line-gap: var(--luzmo-spacing-4);--edit-filters-group-actions-margin-top: var(--luzmo-spacing-4)}';
|
|
38
|
+
var $ = Object.defineProperty, F = Object.getOwnPropertyDescriptor, a = (t, o, i, r) => {
|
|
39
|
+
for (var e = r > 1 ? void 0 : r ? F(o, i) : o, u = t.length - 1, p; u >= 0; u--)
|
|
40
|
+
(p = t[u]) && (e = (r ? p(o, i, e) : p(e)) || e);
|
|
41
|
+
return r && e && $(o, i, e), e;
|
|
42
|
+
};
|
|
43
|
+
let l = class extends g(z, {
|
|
44
|
+
validSizes: Object.values(h)
|
|
45
|
+
}) {
|
|
46
|
+
constructor() {
|
|
47
|
+
super(...arguments), this.apiUrl = "https://api.luzmo.com", this.language = "en", this.contentLanguage = "en", this.filters = null, this._internalFilterGroup = null;
|
|
48
|
+
}
|
|
49
|
+
static get styles() {
|
|
50
|
+
return [v(G)];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get a smaller size for the condition badges
|
|
54
|
+
*/
|
|
55
|
+
get _oneSizeSmaller() {
|
|
56
|
+
return {
|
|
57
|
+
xxs: "xxs",
|
|
58
|
+
xs: "xs",
|
|
59
|
+
s: "xs",
|
|
60
|
+
m: "s",
|
|
61
|
+
l: "m",
|
|
62
|
+
xl: "l",
|
|
63
|
+
xxl: "xl"
|
|
64
|
+
}[this.size] || "s";
|
|
65
|
+
}
|
|
66
|
+
willUpdate(t) {
|
|
67
|
+
t.has("language") && this.language !== _() && ([...y].includes(this.language ?? "en") || this.language === "en") && w(this.language), t.has("filters") && (this._internalFilterGroup = this.filters ? structuredClone(this.filters) : this._generateEmptyGroup());
|
|
68
|
+
}
|
|
69
|
+
_generateEmptyGroup() {
|
|
70
|
+
return {
|
|
71
|
+
condition: "AND",
|
|
72
|
+
filters: []
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
_generateEmptyFilter() {
|
|
76
|
+
return {
|
|
77
|
+
expression: void 0,
|
|
78
|
+
parameters: []
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
_cleanFilterGroupForExport(t) {
|
|
82
|
+
return t ? {
|
|
83
|
+
condition: t.condition,
|
|
84
|
+
filters: t.filters.map((i) => this._isGroup(i) ? this._cleanFilterGroupForExport(i) : { ...i })
|
|
85
|
+
} : null;
|
|
86
|
+
}
|
|
87
|
+
_sendChangeEvent() {
|
|
88
|
+
this.dispatchEvent(
|
|
89
|
+
new CustomEvent("filters-changed", {
|
|
90
|
+
bubbles: !0,
|
|
91
|
+
composed: !0,
|
|
92
|
+
cancelable: !0,
|
|
93
|
+
detail: {
|
|
94
|
+
filters: this._cleanFilterGroupForExport(this._internalFilterGroup)
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
_isGroup(t) {
|
|
100
|
+
return "condition" in t && "filters" in t;
|
|
101
|
+
}
|
|
102
|
+
_toggleCondition(t) {
|
|
103
|
+
t.condition = t.condition === "AND" ? "OR" : "AND", this.requestUpdate(), this._sendChangeEvent();
|
|
104
|
+
}
|
|
105
|
+
_addFilter(t) {
|
|
106
|
+
t.filters.push(this._generateEmptyFilter()), this.requestUpdate(), this._sendChangeEvent();
|
|
107
|
+
}
|
|
108
|
+
_addSubGroup(t) {
|
|
109
|
+
const o = this._generateEmptyGroup();
|
|
110
|
+
o.condition = t.condition === "AND" ? "OR" : "AND", o.filters.push(this._generateEmptyFilter()), t.filters.push(o), this.requestUpdate(), this._sendChangeEvent();
|
|
111
|
+
}
|
|
112
|
+
_removeFilter(t, o) {
|
|
113
|
+
if (!this._internalFilterGroup) return;
|
|
114
|
+
if (t.filters.splice(o, 1), !(t === this._internalFilterGroup) && t.filters.length === 0) {
|
|
115
|
+
const r = this._findParentGroup(this._internalFilterGroup, t);
|
|
116
|
+
if (r) {
|
|
117
|
+
const e = r.filters.indexOf(t);
|
|
118
|
+
e !== -1 && r.filters.splice(e, 1);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
this._collapseGroupsAfterDelete(), this.requestUpdate(), this._sendChangeEvent();
|
|
122
|
+
}
|
|
123
|
+
_updateFilter(t, o, i) {
|
|
124
|
+
i.stopPropagation(), this._isGroup(t.filters[o]) || (t.filters[o] = i.detail.filter, this._sendChangeEvent());
|
|
125
|
+
}
|
|
126
|
+
_addGroup() {
|
|
127
|
+
this._internalFilterGroup || (this._internalFilterGroup = this._generateEmptyGroup());
|
|
128
|
+
const t = this._generateEmptyGroup();
|
|
129
|
+
t.condition = this._internalFilterGroup.condition === "AND" ? "OR" : "AND", t.filters.push(this._internalFilterGroup);
|
|
130
|
+
const o = this._generateEmptyGroup();
|
|
131
|
+
o.condition = t.condition === "AND" ? "OR" : "AND", o.filters.push(this._generateEmptyFilter()), t.filters.push(o), this._internalFilterGroup = t, this.requestUpdate(), this._sendChangeEvent();
|
|
132
|
+
}
|
|
133
|
+
_renderFilterItem(t, o, i) {
|
|
134
|
+
return n`
|
|
135
|
+
<div class="filter-item-wrapper">
|
|
136
|
+
<div class="filter-item-content">
|
|
137
|
+
<luzmo-filter-item
|
|
138
|
+
.apiUrl=${this.apiUrl}
|
|
139
|
+
.authKey=${this.authKey}
|
|
140
|
+
.authToken=${this.authToken}
|
|
141
|
+
.cacheTime=${this.cacheTime}
|
|
142
|
+
.language=${this.language}
|
|
143
|
+
.contentLanguage=${this.contentLanguage}
|
|
144
|
+
.timeZone=${this.timeZone}
|
|
145
|
+
.datasetIds=${this.datasetIds}
|
|
146
|
+
.filter=${t}
|
|
147
|
+
.size=${this.size}
|
|
148
|
+
@filter-changed=${this._updateFilter.bind(this, o, i)}
|
|
149
|
+
></luzmo-filter-item>
|
|
150
|
+
<luzmo-action-button
|
|
151
|
+
class="delete-filter-button"
|
|
152
|
+
.size=${this.size}
|
|
153
|
+
quiet
|
|
154
|
+
@click=${this._removeFilter.bind(this, o, i)}
|
|
155
|
+
>
|
|
156
|
+
<luzmo-icon slot="icon" .icon=${f} .size=${this.size}></luzmo-icon>
|
|
157
|
+
</luzmo-action-button>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
`;
|
|
161
|
+
}
|
|
162
|
+
_renderGroup(t, o = !1) {
|
|
163
|
+
const i = t.filters.length > 0, r = t.filters.length > 1;
|
|
164
|
+
return n`
|
|
165
|
+
<div class="filter-group ${o ? "nested" : ""}">
|
|
166
|
+
${o ? n`
|
|
167
|
+
<div class="condition-wrapper">
|
|
168
|
+
${r ? n`
|
|
169
|
+
<luzmo-action-button
|
|
170
|
+
class="condition-badge"
|
|
171
|
+
.size=${this._oneSizeSmaller}
|
|
172
|
+
quiet
|
|
173
|
+
@click=${this._toggleCondition.bind(this, t)}
|
|
174
|
+
>
|
|
175
|
+
${t.condition}
|
|
176
|
+
</luzmo-action-button>
|
|
177
|
+
` : ""}
|
|
178
|
+
</div>
|
|
179
|
+
` : r ? n`
|
|
180
|
+
<div class="condition-wrapper">
|
|
181
|
+
<luzmo-action-button
|
|
182
|
+
class="condition-badge"
|
|
183
|
+
.size=${this._oneSizeSmaller}
|
|
184
|
+
quiet
|
|
185
|
+
@click=${this._toggleCondition.bind(this, t)}
|
|
186
|
+
>
|
|
187
|
+
${t.condition}
|
|
188
|
+
</luzmo-action-button>
|
|
189
|
+
</div>
|
|
190
|
+
` : ""}
|
|
191
|
+
<div class="group-content">
|
|
192
|
+
${i ? n`
|
|
193
|
+
<div class="filters-list">
|
|
194
|
+
${x(
|
|
195
|
+
t.filters,
|
|
196
|
+
(e, u) => u,
|
|
197
|
+
(e, u) => n`
|
|
198
|
+
${this._isGroup(e) ? this._renderGroup(e, !0) : this._renderFilterItem(e, t, u)}
|
|
199
|
+
`
|
|
200
|
+
)}
|
|
201
|
+
</div>
|
|
202
|
+
` : ""}
|
|
203
|
+
|
|
204
|
+
<div class="group-actions">
|
|
205
|
+
<luzmo-action-button
|
|
206
|
+
class="add-filter-button"
|
|
207
|
+
.size=${this.size}
|
|
208
|
+
quiet
|
|
209
|
+
@click=${this._addFilter.bind(this, t)}
|
|
210
|
+
>
|
|
211
|
+
<luzmo-icon slot="icon" .icon=${d} .size=${this._oneSizeSmaller}></luzmo-icon>
|
|
212
|
+
${c("Filter", { desc: "Add filter button label" })}
|
|
213
|
+
</luzmo-action-button>
|
|
214
|
+
|
|
215
|
+
<luzmo-action-button
|
|
216
|
+
class="add-subgroup-button"
|
|
217
|
+
.size=${this.size}
|
|
218
|
+
quiet
|
|
219
|
+
@click=${this._addSubGroup.bind(this, t)}
|
|
220
|
+
>
|
|
221
|
+
<luzmo-icon slot="icon" .icon=${d} .size=${this._oneSizeSmaller}></luzmo-icon>
|
|
222
|
+
${c("Subgroup", { desc: "Add subgroup button label" })}
|
|
223
|
+
</luzmo-action-button>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
`;
|
|
228
|
+
}
|
|
229
|
+
_findParentGroup(t, o) {
|
|
230
|
+
for (const i of t.filters) {
|
|
231
|
+
if (i === o)
|
|
232
|
+
return t;
|
|
233
|
+
if (this._isGroup(i)) {
|
|
234
|
+
const r = this._findParentGroup(i, o);
|
|
235
|
+
if (r) return r;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
_collapseIfNeeded(t) {
|
|
241
|
+
if (t.filters.length === 1 && this._isGroup(t.filters[0])) {
|
|
242
|
+
const o = t.filters[0];
|
|
243
|
+
t.condition = o.condition, t.filters = o.filters;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
_collapseGroupsAfterDelete() {
|
|
247
|
+
if (!this._internalFilterGroup) return;
|
|
248
|
+
const t = (o) => {
|
|
249
|
+
for (const i of o.filters)
|
|
250
|
+
this._isGroup(i) && t(i);
|
|
251
|
+
this._collapseIfNeeded(o);
|
|
252
|
+
};
|
|
253
|
+
t(this._internalFilterGroup);
|
|
254
|
+
}
|
|
255
|
+
render() {
|
|
256
|
+
if (!this._internalFilterGroup)
|
|
257
|
+
return n`
|
|
258
|
+
<div class="filter-group-container">
|
|
259
|
+
<luzmo-action-button
|
|
260
|
+
class="add-filter-group-button"
|
|
261
|
+
@click=${this._addGroup}
|
|
262
|
+
>
|
|
263
|
+
${c("Add filter group", {
|
|
264
|
+
desc: "Add filter group button label"
|
|
265
|
+
})}
|
|
266
|
+
</luzmo-action-button>
|
|
267
|
+
</div>
|
|
268
|
+
`;
|
|
269
|
+
if (!(this._internalFilterGroup.filters.length > 0))
|
|
270
|
+
return n`
|
|
271
|
+
<div class="filter-group-container">
|
|
272
|
+
<luzmo-button
|
|
273
|
+
class="add-filter-button"
|
|
274
|
+
.size=${this.size}
|
|
275
|
+
treatment="outline"
|
|
276
|
+
@click=${this._addFilter.bind(this, this._internalFilterGroup)}
|
|
277
|
+
>
|
|
278
|
+
<luzmo-icon slot="icon" .icon=${d} .size=${this._oneSizeSmaller}></luzmo-icon>
|
|
279
|
+
${c("Add filter", { desc: "Add filter button label" })}
|
|
280
|
+
</luzmo-button>
|
|
281
|
+
</div>
|
|
282
|
+
`;
|
|
283
|
+
const o = this._internalFilterGroup.filters.length > 1;
|
|
284
|
+
return n`
|
|
285
|
+
<div class="filter-group-container">
|
|
286
|
+
${this._renderGroup(this._internalFilterGroup)}
|
|
287
|
+
|
|
288
|
+
${o ? n`
|
|
289
|
+
<div class="add-root-group-container">
|
|
290
|
+
<luzmo-button
|
|
291
|
+
class="add-group-button"
|
|
292
|
+
.size=${this.size}
|
|
293
|
+
treatment="outline"
|
|
294
|
+
@click=${this._addGroup}
|
|
295
|
+
>
|
|
296
|
+
<luzmo-icon slot="icon" .icon=${d} .size=${this._oneSizeSmaller}></luzmo-icon>
|
|
297
|
+
${c("Group", { desc: "Add group button label" })}
|
|
298
|
+
</luzmo-button>
|
|
299
|
+
</div>
|
|
300
|
+
` : ""}
|
|
301
|
+
</div>
|
|
302
|
+
`;
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
a([
|
|
306
|
+
s({ type: String, attribute: "api-url", reflect: !0 })
|
|
307
|
+
], l.prototype, "apiUrl", 2);
|
|
308
|
+
a([
|
|
309
|
+
s({ type: String, attribute: "auth-key", reflect: !0 })
|
|
310
|
+
], l.prototype, "authKey", 2);
|
|
311
|
+
a([
|
|
312
|
+
s({ type: String, attribute: "auth-token", reflect: !0 })
|
|
313
|
+
], l.prototype, "authToken", 2);
|
|
314
|
+
a([
|
|
315
|
+
s({ type: Number, attribute: "cache-time", reflect: !0 })
|
|
316
|
+
], l.prototype, "cacheTime", 2);
|
|
317
|
+
a([
|
|
318
|
+
s({ type: String, reflect: !0 })
|
|
319
|
+
], l.prototype, "language", 2);
|
|
320
|
+
a([
|
|
321
|
+
s({ type: String, attribute: "content-language", reflect: !0 })
|
|
322
|
+
], l.prototype, "contentLanguage", 2);
|
|
323
|
+
a([
|
|
324
|
+
s({ type: String, attribute: "time-zone", reflect: !0 })
|
|
325
|
+
], l.prototype, "timeZone", 2);
|
|
326
|
+
a([
|
|
327
|
+
s({ type: Array, attribute: "dataset-ids", reflect: !0 })
|
|
328
|
+
], l.prototype, "datasetIds", 2);
|
|
329
|
+
a([
|
|
330
|
+
s({ type: Object, reflect: !1 })
|
|
331
|
+
], l.prototype, "filters", 2);
|
|
332
|
+
a([
|
|
333
|
+
b()
|
|
334
|
+
], l.prototype, "_internalFilterGroup", 2);
|
|
335
|
+
l = a([
|
|
336
|
+
m()
|
|
337
|
+
], l);
|
|
338
|
+
customElements.get("luzmo-edit-filters") || customElements.define("luzmo-edit-filters", l);
|
|
339
|
+
export {
|
|
340
|
+
l as LuzmoEditFilters
|
|
341
|
+
};
|