@luzmo/analytics-components-kit 1.0.1-alpha.94 → 1.0.1-alpha.97
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 +1 -1
- package/angular/components/viz-item-menu.component.ts +25 -0
- package/angular/esm/components/viz-item-menu.component.d.ts +13 -0
- package/angular/esm/components/viz-item-menu.component.js +49 -0
- package/angular/esm/index.d.ts +3 -3
- package/angular/esm/index.js +3 -3
- package/angular/esm/types.d.ts +2 -2
- package/angular/index.ts +3 -3
- package/angular/types.ts +2 -2
- 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/index.cjs +1 -1
- package/components/ai-interaction-textarea/index.js +1 -2
- 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/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/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/display-settings-numeric.d.ts +1 -2
- package/components/display-settings-numeric/index.cjs +49 -48
- package/components/display-settings-numeric/index.js +193 -218
- 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 +208 -223
- 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/{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-data-item-picker/index.cjs +7 -7
- package/components/filter-data-item-picker/index.js +85 -86
- package/components/filter-expression-picker/index.cjs +1 -1
- package/components/filter-expression-picker/index.js +1 -1
- package/components/filter-item/index.cjs +6 -6
- package/components/filter-item/index.js +109 -119
- 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 +8 -8
- package/components/filter-value-picker-numeric/index.js +101 -110
- package/components/{focusable-DCIFkpiW.js → focusable-BS2pbY7w.js} +24 -26
- package/components/focusable-QLh-LlNt.cjs +20 -0
- 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-YlLiVgo8.js → get-css-variable-Bb7TxJdX.js} +37 -37
- package/components/get-css-variable-Pzks_rOx.cjs +24 -0
- 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-BPNsFiyq.cjs → index-BNAmjOkm.cjs} +4 -4
- package/components/index-BekTY3Em.cjs +121 -0
- package/components/index-CFL6gmIu.cjs +20 -0
- package/components/{index-Do7O9azB.js → index-CqKpf0B8.js} +112 -123
- package/components/index-DNPULp4A.js +1755 -0
- package/components/{index-D0GBF6tg.js → index-DdyZ2g5L.js} +94 -104
- 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 +13 -13
- 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/{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-hKTMz37h.js} +1 -8
- 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 +33 -33
- package/components/slot-contents-picker/index.js +194 -205
- package/components/slot-menu/index.cjs +12 -12
- package/components/slot-menu/index.js +171 -184
- package/components/slot-menu-list/index.cjs +3 -3
- package/components/slot-menu-list/index.js +97 -103
- 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 +51 -0
- package/components/viz-item-menu/index.d.ts +8 -0
- package/components/viz-item-menu/index.js +209 -0
- package/components/viz-item-menu/viz-item-menu.d.ts +77 -0
- 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 +43 -23
- package/index.d.ts +1 -1
- package/package.json +7 -7
- package/types.d.ts +2 -2
- package/angular/components/widget-menu.component.ts +0 -25
- package/angular/esm/components/widget-menu.component.d.ts +0 -13
- package/angular/esm/components/widget-menu.component.js +0 -49
- 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/focusable-B3E_hQmm.cjs +0 -20
- package/components/funnel-chart-options.config-D7H7gFcx.cjs +0 -20
- package/components/get-css-variable-BEYG097C.js +0 -1446
- package/components/get-css-variable-BZxY4IOa.cjs +0 -35
- 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/index-Dn0j_pcR.cjs +0 -20
- package/components/index-E239Dotg.js +0 -1735
- 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
- package/components/widget-menu/index.cjs +0 -51
- package/components/widget-menu/index.d.ts +0 -8
- package/components/widget-menu/index.js +0 -211
- package/components/widget-menu/widget-menu.d.ts +0 -77
|
@@ -17,23 +17,23 @@
|
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@luzmo/lucero/date-time-picker");require("@luzmo/lucero/number-field");require("@luzmo/lucero/picker");require("@luzmo/lucero/text-field");const
|
|
20
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@luzmo/lucero/date-time-picker");require("@luzmo/lucero/number-field");require("@luzmo/lucero/picker");require("@luzmo/lucero/text-field");const a=require("lit"),c=require("@luzmo/lucero/utils"),m=require("../set-locale-BRRalqne.cjs"),l=require("../periods.const-3jA-ECRf.cjs"),n=require("lit/decorators.js"),f=":host{display:flex;flex-direction:row;gap:var(--luzmo-filter-value-picker-datetime-gap, var(--filter-value-picker-datetime-gap))}:host{--filter-value-picker-datetime-gap: var(--luzmo-spacing-3)}: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)}";var g=Object.defineProperty,u=(o,e,t,i)=>{for(var r=void 0,p=o.length-1,h;p>=0;p--)(h=o[p])&&(r=h(e,t,r)||r);return r&&g(e,t,r),r};class s extends c.SizedMixin(c.LuzmoElement,{validSizes:Object.values(c.ElementSizes)}){constructor(){super(...arguments),this.language="en",this.contentLanguage="en"}static get styles(){return[a.unsafeCSS(f)]}willUpdate(e){const t=e.has("language"),i=e.get("filter");t&&this.language!==m.getLocale()&&([...m.targetLocales].includes(this.language??"en")||this.language==="en")&&m.setLocale(this.language),i&&(["last_now","last_available","next_now"].includes(this.filter?.expression)?this.filter.parameters[1]={quantity:this.filter?.parameters?.[1]?.quantity??1,unit:this.filter?.parameters?.[1]?.unit??1}:["last_completed","next_full","to_date"].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]:new Date().toISOString())}_sendChangeEvent(){this.filter.parameters=[{...this.filter?.parameters?.[0]},this._value],this.dispatchEvent(new CustomEvent("filter-value-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{value:this._value}}))}setDate(e){this._value=e.detail.value,this._value!==this.filter?.parameters?.[1]&&this._sendChangeEvent()}setUnit(e){const t=l.DATETIME_LEVELS.find(i=>i.key===e?.target?.value)?.level;this.filter?.parameters?.[1]?.unit!==t&&(this._value={unit:t??1,quantity:this.filter?.parameters?.[1]?.quantity??1},this._sendChangeEvent())}setQuantity(e){const t=e?.target?.value;this.filter?.parameters?.[1]?.quantity!==t&&(this._value={quantity:t,unit:this.filter?.parameters?.[1]?.unit??1},this._sendChangeEvent())}renderDatePicker(){let e="second";return this.filter?.parameters?.[0]?.lowestLevel>4&&(this.filter?.parameters?.[0]?.lowestLevel===5?e="day":this.filter?.parameters?.[0]?.lowestLevel===6?e="hour":this.filter?.parameters?.[0]?.lowestLevel===7?e="minute":e="second"),a.html`<luzmo-date-time-picker
|
|
21
21
|
.size=${this.size}
|
|
22
22
|
.precision=${e}
|
|
23
23
|
.timeZone=${this.timeZone}
|
|
24
24
|
@change=${this.setDate}
|
|
25
|
-
.value=${
|
|
26
|
-
></luzmo-date-time-picker>`}renderQuantityField(){
|
|
25
|
+
.value=${this.filter?.parameters?.[1]}
|
|
26
|
+
></luzmo-date-time-picker>`}renderQuantityField(){return a.html`<luzmo-number-field
|
|
27
27
|
.size=${this.size}
|
|
28
|
-
.value=${
|
|
28
|
+
.value=${this.filter?.parameters?.[1]?.quantity}
|
|
29
29
|
@input=${this.setQuantity}
|
|
30
30
|
@change=${this.setQuantity}
|
|
31
|
-
></luzmo-number-field>`}renderUnitPicker(){
|
|
32
|
-
${
|
|
33
|
-
</luzmo-menu-item>`),t=
|
|
31
|
+
></luzmo-number-field>`}renderUnitPicker(){const e=l.DATETIME_LEVELS.map(i=>a.html`<luzmo-menu-item .value=${i.key}>
|
|
32
|
+
${i.i18n()}
|
|
33
|
+
</luzmo-menu-item>`),t=l.DATETIME_LEVELS.find(i=>i.level===this.filter?.parameters?.[1]?.unit)?.key??l.DATETIME_LEVELS?.[0]?.key;return a.html`<luzmo-picker
|
|
34
34
|
.size=${this.size}
|
|
35
35
|
.value=${t}
|
|
36
36
|
@change=${this.setUnit}
|
|
37
37
|
variant="highlight"
|
|
38
38
|
>${e}</luzmo-picker
|
|
39
|
-
>`}render(){
|
|
39
|
+
>`}render(){const e=this.filter?.expression;return["last_now","last_available","next_now"].includes(e)?a.html`${this.renderQuantityField()}${this.renderUnitPicker()}`:["last_completed","next_full"].includes(e)?this.renderUnitPicker():this.renderDatePicker()}}u([n.property({type:String,reflect:!0})],s.prototype,"language");u([n.property({type:String,attribute:"content-language",reflect:!0})],s.prototype,"contentLanguage");u([n.property({type:String,attribute:"time-zone",reflect:!0})],s.prototype,"timeZone");u([n.property({type:Object,reflect:!1})],s.prototype,"filter");customElements.get("luzmo-filter-value-picker-datetime")||customElements.define("luzmo-filter-value-picker-datetime",s);exports.LuzmoFilterValuePickerDatetime=s;
|
|
@@ -21,49 +21,47 @@ import "@luzmo/lucero/date-time-picker";
|
|
|
21
21
|
import "@luzmo/lucero/number-field";
|
|
22
22
|
import "@luzmo/lucero/picker";
|
|
23
23
|
import "@luzmo/lucero/text-field";
|
|
24
|
-
import { unsafeCSS as
|
|
25
|
-
import { SizedMixin as
|
|
26
|
-
import { g
|
|
27
|
-
import { D as
|
|
28
|
-
import { property as
|
|
24
|
+
import { unsafeCSS as d, html as l } from "lit";
|
|
25
|
+
import { SizedMixin as z, LuzmoElement as f, ElementSizes as p } from "@luzmo/lucero/utils";
|
|
26
|
+
import { g, t as h, s as b } from "../set-locale-hKTMz37h.js";
|
|
27
|
+
import { D as u } from "../periods.const-CjHXYn-w.js";
|
|
28
|
+
import { property as n } from "lit/decorators.js";
|
|
29
29
|
(function() {
|
|
30
30
|
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
31
31
|
const e = document.createElement("style");
|
|
32
32
|
e.setAttribute("data-luzmo-vars", ""), e.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(e);
|
|
33
33
|
}
|
|
34
34
|
})();
|
|
35
|
-
const
|
|
36
|
-
var
|
|
37
|
-
for (var
|
|
38
|
-
(
|
|
39
|
-
return
|
|
35
|
+
const v = ":host{display:flex;flex-direction:row;gap:var(--luzmo-filter-value-picker-datetime-gap, var(--filter-value-picker-datetime-gap))}:host{--filter-value-picker-datetime-gap: var(--luzmo-spacing-3)}: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)}";
|
|
36
|
+
var x = Object.defineProperty, s = (a, e, o, t) => {
|
|
37
|
+
for (var r = void 0, m = a.length - 1, c; m >= 0; m--)
|
|
38
|
+
(c = a[m]) && (r = c(e, o, r) || r);
|
|
39
|
+
return r && x(e, o, r), r;
|
|
40
40
|
};
|
|
41
|
-
class
|
|
42
|
-
validSizes: Object.values(
|
|
41
|
+
class i extends z(f, {
|
|
42
|
+
validSizes: Object.values(p)
|
|
43
43
|
}) {
|
|
44
44
|
constructor() {
|
|
45
45
|
super(...arguments), this.language = "en", this.contentLanguage = "en";
|
|
46
46
|
}
|
|
47
47
|
static get styles() {
|
|
48
|
-
return [
|
|
48
|
+
return [d(v)];
|
|
49
49
|
}
|
|
50
50
|
willUpdate(e) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
(t = this.filter) == null ? void 0 : t.expression
|
|
51
|
+
const o = e.has("language"), t = e.get("filter");
|
|
52
|
+
o && this.language !== g() && ([...h].includes(this.language ?? "en") || this.language === "en") && b(this.language), t && (["last_now", "last_available", "next_now"].includes(
|
|
53
|
+
this.filter?.expression
|
|
55
54
|
) ? this.filter.parameters[1] = {
|
|
56
|
-
quantity:
|
|
57
|
-
unit:
|
|
55
|
+
quantity: this.filter?.parameters?.[1]?.quantity ?? 1,
|
|
56
|
+
unit: this.filter?.parameters?.[1]?.unit ?? 1
|
|
58
57
|
} : ["last_completed", "next_full", "to_date"].includes(
|
|
59
|
-
|
|
58
|
+
this.filter?.expression
|
|
60
59
|
) ? this.filter.parameters[1] = {
|
|
61
|
-
unit:
|
|
60
|
+
unit: this.filter?.parameters?.[1]?.unit ?? 1
|
|
62
61
|
} : this.filter.parameters[1] = typeof this.filter.parameters[1] == "string" ? this.filter.parameters[1] : (/* @__PURE__ */ new Date()).toISOString());
|
|
63
62
|
}
|
|
64
63
|
_sendChangeEvent() {
|
|
65
|
-
|
|
66
|
-
this.filter.parameters = [{ ...(o = (e = this.filter) == null ? void 0 : e.parameters) == null ? void 0 : o[0] }, this._value], this.dispatchEvent(
|
|
64
|
+
this.filter.parameters = [{ ...this.filter?.parameters?.[0] }, this._value], this.dispatchEvent(
|
|
67
65
|
new CustomEvent("filter-value-changed", {
|
|
68
66
|
bubbles: !0,
|
|
69
67
|
composed: !0,
|
|
@@ -75,61 +73,49 @@ class p extends k(w, {
|
|
|
75
73
|
);
|
|
76
74
|
}
|
|
77
75
|
setDate(e) {
|
|
78
|
-
|
|
79
|
-
this._value = e.detail.value, this._value !== ((r = (o = this.filter) == null ? void 0 : o.parameters) == null ? void 0 : r[1]) && this._sendChangeEvent();
|
|
76
|
+
this._value = e.detail.value, this._value !== this.filter?.parameters?.[1] && this._sendChangeEvent();
|
|
80
77
|
}
|
|
81
78
|
setUnit(e) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return m.key === ((n = e == null ? void 0 : e.target) == null ? void 0 : n.value);
|
|
87
|
-
}
|
|
88
|
-
)) == null ? void 0 : r.level;
|
|
89
|
-
((l = (i = (t = this.filter) == null ? void 0 : t.parameters) == null ? void 0 : i[1]) == null ? void 0 : l.unit) !== o && (this._value = {
|
|
79
|
+
const o = u.find(
|
|
80
|
+
(t) => t.key === e?.target?.value
|
|
81
|
+
)?.level;
|
|
82
|
+
this.filter?.parameters?.[1]?.unit !== o && (this._value = {
|
|
90
83
|
unit: o ?? 1,
|
|
91
|
-
quantity:
|
|
84
|
+
quantity: this.filter?.parameters?.[1]?.quantity ?? 1
|
|
92
85
|
}, this._sendChangeEvent());
|
|
93
86
|
}
|
|
94
87
|
setQuantity(e) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
((l = (i = (t = this.filter) == null ? void 0 : t.parameters) == null ? void 0 : i[1]) == null ? void 0 : l.quantity) !== o && (this._value = {
|
|
88
|
+
const o = e?.target?.value;
|
|
89
|
+
this.filter?.parameters?.[1]?.quantity !== o && (this._value = {
|
|
98
90
|
quantity: o,
|
|
99
|
-
unit:
|
|
91
|
+
unit: this.filter?.parameters?.[1]?.unit ?? 1
|
|
100
92
|
}, this._sendChangeEvent());
|
|
101
93
|
}
|
|
102
94
|
renderDatePicker() {
|
|
103
|
-
var o, r, t, i, l, a, u, s, m, n, c, d, z, x;
|
|
104
95
|
let e = "second";
|
|
105
|
-
return
|
|
96
|
+
return this.filter?.parameters?.[0]?.lowestLevel > 4 && (this.filter?.parameters?.[0]?.lowestLevel === 5 ? e = "day" : this.filter?.parameters?.[0]?.lowestLevel === 6 ? e = "hour" : this.filter?.parameters?.[0]?.lowestLevel === 7 ? e = "minute" : e = "second"), l`<luzmo-date-time-picker
|
|
106
97
|
.size=${this.size}
|
|
107
98
|
.precision=${e}
|
|
108
99
|
.timeZone=${this.timeZone}
|
|
109
100
|
@change=${this.setDate}
|
|
110
|
-
.value=${
|
|
101
|
+
.value=${this.filter?.parameters?.[1]}
|
|
111
102
|
></luzmo-date-time-picker>`;
|
|
112
103
|
}
|
|
113
104
|
renderQuantityField() {
|
|
114
|
-
|
|
115
|
-
return f`<luzmo-number-field
|
|
105
|
+
return l`<luzmo-number-field
|
|
116
106
|
.size=${this.size}
|
|
117
|
-
.value=${
|
|
107
|
+
.value=${this.filter?.parameters?.[1]?.quantity}
|
|
118
108
|
@input=${this.setQuantity}
|
|
119
109
|
@change=${this.setQuantity}
|
|
120
110
|
></luzmo-number-field>`;
|
|
121
111
|
}
|
|
122
112
|
renderUnitPicker() {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return l.level === ((s = (u = (a = this.filter) == null ? void 0 : a.parameters) == null ? void 0 : u[1]) == null ? void 0 : s.unit);
|
|
130
|
-
}
|
|
131
|
-
)) == null ? void 0 : r.key) ?? ((i = (t = h) == null ? void 0 : t[0]) == null ? void 0 : i.key);
|
|
132
|
-
return f`<luzmo-picker
|
|
113
|
+
const e = u.map((t) => l`<luzmo-menu-item .value=${t.key}>
|
|
114
|
+
${t.i18n()}
|
|
115
|
+
</luzmo-menu-item>`), o = u.find(
|
|
116
|
+
(t) => t.level === this.filter?.parameters?.[1]?.unit
|
|
117
|
+
)?.key ?? u?.[0]?.key;
|
|
118
|
+
return l`<luzmo-picker
|
|
133
119
|
.size=${this.size}
|
|
134
120
|
.value=${o}
|
|
135
121
|
@change=${this.setUnit}
|
|
@@ -138,27 +124,26 @@ class p extends k(w, {
|
|
|
138
124
|
>`;
|
|
139
125
|
}
|
|
140
126
|
render() {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return ["last_now", "last_available", "next_now"].includes(e) ? f`${this.renderQuantityField()}${this.renderUnitPicker()}` : ["last_completed", "next_full"].includes(e) ? this.renderUnitPicker() : this.renderDatePicker();
|
|
127
|
+
const e = this.filter?.expression;
|
|
128
|
+
return ["last_now", "last_available", "next_now"].includes(e) ? l`${this.renderQuantityField()}${this.renderUnitPicker()}` : ["last_completed", "next_full"].includes(e) ? this.renderUnitPicker() : this.renderDatePicker();
|
|
144
129
|
}
|
|
145
130
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
],
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
],
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
],
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
],
|
|
131
|
+
s([
|
|
132
|
+
n({ type: String, reflect: !0 })
|
|
133
|
+
], i.prototype, "language");
|
|
134
|
+
s([
|
|
135
|
+
n({ type: String, attribute: "content-language", reflect: !0 })
|
|
136
|
+
], i.prototype, "contentLanguage");
|
|
137
|
+
s([
|
|
138
|
+
n({ type: String, attribute: "time-zone", reflect: !0 })
|
|
139
|
+
], i.prototype, "timeZone");
|
|
140
|
+
s([
|
|
141
|
+
n({ type: Object, reflect: !1 })
|
|
142
|
+
], i.prototype, "filter");
|
|
158
143
|
customElements.get("luzmo-filter-value-picker-datetime") || customElements.define(
|
|
159
144
|
"luzmo-filter-value-picker-datetime",
|
|
160
|
-
|
|
145
|
+
i
|
|
161
146
|
);
|
|
162
147
|
export {
|
|
163
|
-
|
|
148
|
+
i as LuzmoFilterValuePickerDatetime
|
|
164
149
|
};
|
|
@@ -17,30 +17,30 @@
|
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@luzmo/lucero/select");require("@luzmo/lucero/text-field");const
|
|
20
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@luzmo/lucero/select");require("@luzmo/lucero/text-field");const f=require("lit"),c=require("@lit/localize"),_=require("@luzmo/lucero/utils"),L=require("../index-CFL6gmIu.cjs"),b=require("../localize-C4zNlrwK.cjs"),n=require("lit/decorators.js"),y=require("../set-locale-BRRalqne.cjs"),V=".missing-value{opacity:.4}:host{--var: blue}";var k=Object.defineProperty,S=Object.getOwnPropertyDescriptor,a=(g,e,t,i)=>{for(var r=i>1?void 0:i?S(e,t):e,s=g.length-1,u;s>=0;s--)(u=g[s])&&(r=(i?u(e,t,r):u(r))||r);return i&&r&&k(e,t,r),r};const z=5e3;exports.LuzmoFilterValuePickerHierarchy=class extends _.SizedMixin(_.LuzmoElement,{validSizes:Object.values(_.ElementSizes)}){constructor(){super(...arguments),this.language="en",this.contentLanguage="en",this._hierarchyValues=[],this._retrieving=!0,this._search="",this._error=null,this._allValuesRetrieved=!1,this._runningQueries=[]}static get styles(){return[f.unsafeCSS(V)]}connectedCallback(){super.connectedCallback();const e={};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),L.dataBroker.configure(e)}willUpdate(e){if(e.has("language")&&this.language!==y.getLocale()&&([...y.targetLocales].includes(this.language??"en")||this.language==="en")&&y.setLocale(this.language),e.has("filter")&&this.filter){const i=e.get("filter")?.expression,r=e.get("filter")?.parameters?.[0]?.columnId||e.get("filter")?.parameters?.[0]?.formulaId,s=this.filter?.parameters?.[0]?.columnId||this.filter?.parameters?.[0]?.formulaId;r!==s&&(["? in ?","? not in ?","? = ?","? != ?"].includes(this.filter?.expression)||!["? in ?","? not in ?","? = ?","? != ?"].includes(i))&&(this._hierarchyValues=[],this._allValuesRetrieved=!1,this._retrieving=!0)}}async _fetchHierarchyValues(e=0){if(this._allValuesRetrieved){this._retrieving=!1;return}if(!this.filter?.parameters?.[0]){this._retrieving=!1,this._error="Missing column parameters";return}const t=this.filter.parameters[0],i=t.columnId,r=t.formulaId,s=t.datasetId;if(!i&&!r){this._retrieving=!1,this._error="Missing column id or formula id";return}else if(!s){this._retrieving=!1,this._error="Missing dataset id";return}this._retrieving=!0,this._error=null;const u={expression:"? like ?",parameters:[{column_id:i,formula_id:r,dataset_id:s},this._search]},p={dimensions:[{column_id:i,formula_id:r,dataset_id:s}],where:[],order:[{column_id:i,formula_id:r,dataset_id:s,order:"asc"}],limit:{by:z,offset:e}};this._search&&this._allValuesRetrieved&&p.where.push(u);const d=new AbortController,o=new Promise((l,h)=>{L.dataBroker.fetchData(p).then(l).catch(h),d.signal.addEventListener("abort",()=>{console.warn("Request aborted"),h({status:"aborted"})})}),m={promise:o,abortController:d};this._runningQueries.push(m);try{const l=await o,h=l&&Array.isArray(l.data)?l.data.map(v=>v[0]):[];this._search||(this._allValuesRetrieved=h.length<z),this._hierarchyValues=e>0?[...this._hierarchyValues,...h]:h}catch(l){if(l?.status==="aborted")return;this._error=l instanceof Error?l.message:"Unknown error",this._hierarchyValues=[]}finally{this._runningQueries=this._runningQueries.filter(l=>l.promise!==o),this._retrieving=!1}}_sendChangeEvent(){this.dispatchEvent(new CustomEvent("filter-value-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{value:this._value}}))}setHierarchy(e){let t;["? in ?","? not in ?"].includes(this.filter?.expression)?t=e?.detail?.value:["? = ?","? != ?"].includes(this.filter?.expression)?t=e?.detail?.value?.[0]:t=e?.target?.value,this._value!==t&&(this._value=t,this.filter={...this.filter,parameters:[{...this.filter?.parameters?.[0]},this._value]},this._sendChangeEvent())}onScrolled(e){!this._retrieving&&!this._allValuesRetrieved&&e?.detail?.last===this._hierarchyValues.length-1&&this._fetchHierarchyValues(this._hierarchyValues.length)}renderTextField(){return f.html`<luzmo-text-field
|
|
21
21
|
.size=${this.size}
|
|
22
22
|
@change=${this.setHierarchy}
|
|
23
23
|
@input=${this.setHierarchy}
|
|
24
|
-
.value=${
|
|
25
|
-
></luzmo-text-field>`}setSearchString(e){
|
|
24
|
+
.value=${this.filter?.parameters?.[1]??""}
|
|
25
|
+
></luzmo-text-field>`}setSearchString(e){this._search=e?.detail?.string??"",this._allValuesRetrieved||(this._searchQueryTimeout&&(this._runningQueries.forEach(t=>{t?.abortController&&t.abortController.abort()}),this._runningQueries=[],clearTimeout(this._searchQueryTimeout)),this._searchQueryTimeout=setTimeout(()=>{this._fetchHierarchyValues()},500))}resetSearchString(){this._search=""}onOpened(){this._fetchHierarchyValues()}renderHierarchyPicker(){if(this._error)return f.html`<div class="error">Error: ${this._error}</div>`;const e=(this._search?this._hierarchyValues.filter(o=>b.localize(o.name,this.contentLanguage,{allowEmpty:!0})?.toLowerCase().includes(this._search.toLowerCase())||o.toString().toLowerCase().includes(this._search.toLowerCase())):this._hierarchyValues).map(o=>{let m=b.localize(o?.name,this.contentLanguage)??"N/A";return typeof m!="string"&&(m="N/A"),{value:o?.id,label:m}}),t=this.filter?.expression,i=["? = ?","? != ?"].includes(t),r=c.msg("Selected {count} items"),s=c.msg("Search"),u=c.msg("No data"),p=c.msg("No results"),d=c.msg("Select...");return f.html`<luzmo-select
|
|
26
26
|
.size=${this.size}
|
|
27
|
-
.label=${
|
|
27
|
+
.label=${d}
|
|
28
28
|
.retrieving=${this._retrieving}
|
|
29
|
-
.selects=${
|
|
30
|
-
.variant=${
|
|
29
|
+
.selects=${i?"single":"multiple"}
|
|
30
|
+
.variant=${i?"highlight":"checkboxes"}
|
|
31
31
|
emphasized
|
|
32
32
|
no-wrap
|
|
33
33
|
?invalid=${!!this._error}
|
|
34
|
-
.multipleLabelTemplate=${
|
|
35
|
-
.searchLabel=${
|
|
36
|
-
.noDataLabel=${
|
|
37
|
-
.noResultsLabel=${
|
|
34
|
+
.multipleLabelTemplate=${r}
|
|
35
|
+
.searchLabel=${s}
|
|
36
|
+
.noDataLabel=${u}
|
|
37
|
+
.noResultsLabel=${p}
|
|
38
38
|
@change=${this.setHierarchy}
|
|
39
39
|
@luzmo-search=${this.setSearchString}
|
|
40
40
|
@luzmo-opened=${this.onOpened}
|
|
41
41
|
@luzmo-closed=${this.resetSearchString}
|
|
42
42
|
@luzmo-scrolled=${this.onScrolled}
|
|
43
43
|
.options=${e}
|
|
44
|
-
.value=${
|
|
44
|
+
.value=${i?[this.filter?.parameters?.[1]]:this.filter?.parameters?.[1]}
|
|
45
45
|
>
|
|
46
|
-
</luzmo-select>`}render(){
|
|
46
|
+
</luzmo-select>`}render(){const e=this.filter?.expression;return["? in ?","? not in ?","? = ?","? != ?"].includes(e)?this.renderHierarchyPicker():this.renderTextField()}};a([n.property({type:String,attribute:"api-url",reflect:!0})],exports.LuzmoFilterValuePickerHierarchy.prototype,"apiUrl",2);a([n.property({type:String,attribute:"auth-key",reflect:!0})],exports.LuzmoFilterValuePickerHierarchy.prototype,"authKey",2);a([n.property({type:String,attribute:"auth-token",reflect:!0})],exports.LuzmoFilterValuePickerHierarchy.prototype,"authToken",2);a([n.property({type:Number,attribute:"cache-time",reflect:!0})],exports.LuzmoFilterValuePickerHierarchy.prototype,"cacheTime",2);a([n.property({type:String,reflect:!0})],exports.LuzmoFilterValuePickerHierarchy.prototype,"language",2);a([n.property({type:String,attribute:"content-language",reflect:!0})],exports.LuzmoFilterValuePickerHierarchy.prototype,"contentLanguage",2);a([n.property({type:Object,reflect:!1})],exports.LuzmoFilterValuePickerHierarchy.prototype,"filter",2);a([n.state()],exports.LuzmoFilterValuePickerHierarchy.prototype,"_hierarchyValues",2);a([n.state()],exports.LuzmoFilterValuePickerHierarchy.prototype,"_retrieving",2);a([n.state()],exports.LuzmoFilterValuePickerHierarchy.prototype,"_search",2);a([n.state()],exports.LuzmoFilterValuePickerHierarchy.prototype,"_error",2);exports.LuzmoFilterValuePickerHierarchy=a([c.localized()],exports.LuzmoFilterValuePickerHierarchy);customElements.get("luzmo-filter-value-picker-hierarchy")||customElements.define("luzmo-filter-value-picker-hierarchy",exports.LuzmoFilterValuePickerHierarchy);
|