@luzmo/analytics-components-kit 1.0.1-alpha.86 → 1.0.1-alpha.89
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/components/display-settings-binning.component.ts +2 -2
- package/angular/components/display-settings-datetime.component.ts +2 -2
- package/angular/components/display-settings-grand-totals.component.ts +2 -2
- package/angular/components/display-settings-numeric.component.ts +2 -2
- package/angular/components/display-settings.component.ts +3 -3
- package/angular/components/draggable-data-item/index.ts +1 -0
- package/angular/components/draggable-data-item/types.ts +40 -0
- package/angular/components/draggable-data-item-level/index.ts +1 -0
- package/angular/components/draggable-data-item-level/types.ts +15 -0
- package/angular/components/draggable-data-item-level.component.ts +4 -10
- package/angular/components/draggable-data-item.component.ts +4 -10
- package/angular/components/droppable-slot/index.ts +1 -0
- package/angular/components/droppable-slot/types.ts +16 -0
- package/angular/components/droppable-slot.component.ts +5 -3
- package/angular/components/slot-menu/index.ts +1 -0
- package/angular/components/slot-menu/types.ts +31 -0
- package/angular/components/slot-menu-list.component.ts +2 -2
- package/angular/components/slot-menu.component.ts +3 -3
- package/angular/esm/components/display-settings-binning.component.d.ts +2 -1
- package/angular/esm/components/display-settings-datetime.component.d.ts +2 -2
- package/angular/esm/components/display-settings-grand-totals.component.d.ts +2 -1
- package/angular/esm/components/display-settings-numeric.component.d.ts +2 -1
- package/angular/esm/components/display-settings.component.d.ts +3 -3
- package/angular/esm/components/draggable-data-item/index.d.ts +1 -0
- package/angular/esm/components/draggable-data-item/index.js +1 -0
- package/angular/esm/components/draggable-data-item/types.d.ts +22 -0
- package/angular/esm/components/draggable-data-item/types.js +1 -0
- package/angular/esm/components/draggable-data-item-level/index.d.ts +1 -0
- package/angular/esm/components/draggable-data-item-level/index.js +1 -0
- package/angular/esm/components/draggable-data-item-level/types.d.ts +12 -0
- package/angular/esm/components/draggable-data-item-level/types.js +1 -0
- package/angular/esm/components/draggable-data-item-level.component.d.ts +9 -7
- package/angular/esm/components/draggable-data-item-level.component.js +2 -17
- package/angular/esm/components/draggable-data-item.component.d.ts +9 -7
- package/angular/esm/components/draggable-data-item.component.js +2 -17
- package/angular/esm/components/droppable-slot/index.d.ts +1 -0
- package/angular/esm/components/droppable-slot/index.js +1 -0
- package/angular/esm/components/droppable-slot/types.d.ts +9 -0
- package/angular/esm/components/droppable-slot/types.js +1 -0
- package/angular/esm/components/droppable-slot.component.d.ts +5 -4
- package/angular/esm/components/droppable-slot.component.js +7 -2
- package/angular/esm/components/slot-menu/index.d.ts +1 -0
- package/angular/esm/components/slot-menu/index.js +1 -0
- package/angular/esm/components/slot-menu/types.d.ts +25 -0
- package/angular/esm/components/slot-menu/types.js +1 -0
- package/angular/esm/components/slot-menu-list.component.d.ts +2 -1
- package/angular/esm/components/slot-menu.component.d.ts +3 -3
- package/angular/esm/types.d.ts +9 -3
- package/angular/tsconfig.json +3 -0
- package/angular/types.ts +24 -3
- package/angular/utils/base/base.d.ts +16 -0
- package/angular/utils/base/focus-visible.d.ts +29 -0
- package/angular/utils/base/focusable.d.ts +58 -0
- package/angular/utils/base/index.d.ts +4 -0
- package/angular/utils/base/sized-mixin.d.ts +17 -0
- package/angular/utils/color/color-palettes.d.ts +17 -0
- package/angular/utils/color/extrapolate-color.d.ts +1 -0
- package/angular/utils/data/load-draggable-items-for-datasets.d.ts +24 -0
- package/angular/utils/data-broker/index.d.ts +191 -0
- package/angular/utils/data-item-types/calculate-data-item-icon.d.ts +10 -0
- package/angular/utils/data-item-types/tests/calculate-data-item-icon.test.d.ts +1 -0
- package/angular/utils/drag/draggable.d.ts +13 -0
- package/angular/utils/filters/expressions.d.ts +15 -0
- package/angular/utils/filters/index.d.ts +1 -0
- package/angular/utils/formatter/calculate-duration.d.ts +2 -0
- package/angular/utils/formatter/decompose-numeric-format.d.ts +11 -0
- package/angular/utils/formatter/default-local-formats.d.ts +20 -0
- package/angular/utils/formatter/formats/cs.d.ts +20 -0
- package/angular/utils/formatter/formats/da.d.ts +20 -0
- package/angular/utils/formatter/formats/de.d.ts +21 -0
- package/angular/utils/formatter/formats/en-GB.d.ts +21 -0
- package/angular/utils/formatter/formats/en-US.d.ts +1 -0
- package/angular/utils/formatter/formats/en.d.ts +1 -0
- package/angular/utils/formatter/formats/es.d.ts +54 -0
- package/angular/utils/formatter/formats/fi.d.ts +20 -0
- package/angular/utils/formatter/formats/fr.d.ts +54 -0
- package/angular/utils/formatter/formats/he.d.ts +20 -0
- package/angular/utils/formatter/formats/hu.d.ts +20 -0
- package/angular/utils/formatter/formats/it.d.ts +54 -0
- package/angular/utils/formatter/formats/ja.d.ts +20 -0
- package/angular/utils/formatter/formats/ko.d.ts +20 -0
- package/angular/utils/formatter/formats/mk.d.ts +20 -0
- package/angular/utils/formatter/formats/nl.d.ts +21 -0
- package/angular/utils/formatter/formats/no.d.ts +21 -0
- package/angular/utils/formatter/formats/pl.d.ts +20 -0
- package/angular/utils/formatter/formats/pt.d.ts +20 -0
- package/angular/utils/formatter/formats/ru.d.ts +20 -0
- package/angular/utils/formatter/formats/sv.d.ts +20 -0
- package/angular/utils/formatter/formats/tr.d.ts +21 -0
- package/angular/utils/formatter/formats/zh-CN.d.ts +20 -0
- package/angular/utils/formatter/formats/zh-TW.d.ts +20 -0
- package/angular/utils/formatter/formatter.d.ts +9 -0
- package/angular/utils/formatter/localize.d.ts +3 -0
- package/angular/utils/formatter/smart-datetime-formats.const.d.ts +36 -0
- package/angular/utils/get-css-variable.d.ts +1 -0
- package/angular/utils/index.d.ts +7 -0
- package/angular/utils/localize/set-locale.d.ts +7 -0
- package/angular/utils/map-tile-providers/index.d.ts +93 -0
- package/angular/utils/store/slot-context.d.ts +4 -0
- package/angular/utils/store/slot-store.d.ts +39 -0
- package/angular/utils/switch-item/index.d.ts +14 -0
- package/angular/utils/themes/bliss.d.ts +43 -0
- package/angular/utils/themes/classic-dark.d.ts +34 -0
- package/angular/utils/themes/classic.d.ts +43 -0
- package/angular/utils/themes/default-dark.d.ts +46 -0
- package/angular/utils/themes/default.d.ts +46 -0
- package/angular/utils/themes/index.d.ts +3 -0
- package/angular/utils/themes/orion.d.ts +44 -0
- package/angular/utils/themes/pinky.d.ts +42 -0
- package/angular/utils/themes/radiant.d.ts +42 -0
- package/angular/utils/themes/royale.d.ts +36 -0
- package/angular/utils/themes/seasonal.d.ts +43 -0
- package/angular/utils/themes/urban.d.ts +44 -0
- package/angular/utils/themes/vivid.d.ts +42 -0
- package/angular/utils/time/formats.const.d.ts +4 -0
- package/angular/utils/time/periods.const.d.ts +15 -0
- package/angular/utils/transformations/convert-data-item-to-slot-content.d.ts +9 -0
- package/angular/utils/transformations/convert-datasets-to-draggable-items.d.ts +17 -0
- package/angular/utils/transformations/tests/convert-data-item-to-slot-content.test.d.ts +1 -0
- package/angular/utils/transformations/tests/convert-datasets-to-draggable-items.test.d.ts +1 -0
- package/angular/utils/types/type-check.d.ts +7 -0
- 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-DjW1_RI1.cjs → calculate-data-item-icon-DtVGbet3.cjs} +1 -1
- 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 +51 -53
- 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/display-settings.d.ts +4 -2
- package/components/display-settings/index.cjs +1 -1
- package/components/display-settings/index.js +1 -1
- package/components/display-settings-binning/display-settings-binning.d.ts +2 -1
- package/components/display-settings-binning/index.cjs +5 -5
- package/components/display-settings-binning/index.js +29 -30
- package/components/display-settings-datetime/display-settings-datetime.d.ts +2 -1
- package/components/display-settings-datetime/index.cjs +29 -29
- package/components/display-settings-datetime/index.js +112 -120
- package/components/display-settings-grand-totals/display-settings-grand-totals.d.ts +2 -1
- 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 +2 -1
- package/components/display-settings-numeric/index.cjs +48 -48
- package/components/display-settings-numeric/index.js +192 -209
- 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/draggable-data-item.d.ts +5 -7
- package/components/draggable-data-item/index.cjs +16 -22
- package/components/draggable-data-item/index.d.ts +1 -0
- package/components/draggable-data-item/index.js +79 -87
- package/components/draggable-data-item/types.d.ts +22 -0
- package/components/draggable-data-item-level/draggable-data-item-level.d.ts +4 -6
- package/components/draggable-data-item-level/helpers/generate-preview.d.ts +9 -1
- package/components/draggable-data-item-level/index.cjs +13 -13
- package/components/draggable-data-item-level/index.js +85 -106
- package/components/draggable-data-item-level/types.d.ts +12 -0
- 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/droppable-slot.d.ts +4 -2
- package/components/droppable-slot/index.cjs +20 -20
- package/components/droppable-slot/index.d.ts +1 -0
- package/components/droppable-slot/index.js +239 -254
- package/components/droppable-slot/types.d.ts +9 -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/{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-COd1d84B.cjs +24 -0
- package/components/{get-css-variable-YlLiVgo8.js → get-css-variable-CdwF98oh.js} +35 -35
- 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-PMDgRSzR.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 +28 -26
- 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-B-Tz2sdI.js → set-locale-hKTMz37h.js} +7 -9
- 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.d.ts +1 -0
- package/components/slot-menu/index.js +174 -192
- package/components/slot-menu/slot-menu.d.ts +7 -6
- package/components/slot-menu/types.d.ts +25 -0
- package/components/slot-menu-list/index.cjs +3 -3
- package/components/slot-menu-list/index.js +97 -103
- package/components/slot-menu-list/slot-menu-list.d.ts +2 -1
- 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 +131 -65
- 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/{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 +143 -126
- package/item-definitions/slicer-filter/slicer-filter-options.config.d.ts +1 -1
- package/package.json +3 -3
- package/types.d.ts +9 -3
- package/utils/data/load-draggable-items-for-datasets.d.ts +24 -0
- package/utils/data-broker/index.d.ts +69 -66
- package/utils/data-item-types/calculate-data-item-icon.d.ts +8 -2
- package/utils/data-item-types/tests/calculate-data-item-icon.test.d.ts +1 -0
- package/utils/index.d.ts +2 -0
- package/utils/transformations/convert-data-item-to-slot-content.d.ts +9 -0
- package/utils/transformations/convert-datasets-to-draggable-items.d.ts +17 -0
- package/utils/transformations/tests/convert-data-item-to-slot-content.test.d.ts +1 -0
- package/utils/transformations/tests/convert-datasets-to-draggable-items.test.d.ts +1 -0
- 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-DZDqb3xu.js +0 -139
- 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-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-BPN3bG9X.js +0 -1733
- package/components/index-CQ9ck-BO.cjs +0 -249
- package/components/index-CXn67vdn.cjs +0 -121
- package/components/index-cfj52IbK.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
- package/utils/types/column.types.d.ts +0 -57
package/components/{hexbin-map-options.config-F-7uCqxb.js → hexbin-map-options.config-BguV1w8q.js}
RENAMED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
|
-
import { g as
|
|
21
|
-
import { m as
|
|
22
|
-
const
|
|
20
|
+
import { g as o, a } from "./color-palettes-BqH2Fv19.js";
|
|
21
|
+
import { m as s } from "./index-t45_zv93.js";
|
|
22
|
+
const c = [
|
|
23
23
|
{
|
|
24
24
|
key: "general",
|
|
25
25
|
type: "group",
|
|
@@ -88,8 +88,8 @@ const y = [
|
|
|
88
88
|
"Voyager",
|
|
89
89
|
"No Tiles"
|
|
90
90
|
],
|
|
91
|
-
parseValue: (e) =>
|
|
92
|
-
toValue: (e) =>
|
|
91
|
+
parseValue: (e) => e?.name || "Basic",
|
|
92
|
+
toValue: (e) => s[e] ?? {}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
]
|
|
@@ -117,7 +117,7 @@ const y = [
|
|
|
117
117
|
label: "Number of classes",
|
|
118
118
|
default: "5",
|
|
119
119
|
enum: ["3", "4", "5", "6", "7", "8", "9"],
|
|
120
|
-
parseValue: (e) =>
|
|
120
|
+
parseValue: (e) => e?.toString() ?? "5",
|
|
121
121
|
toValue: (e) => Number.parseInt(e, 10) ?? 5
|
|
122
122
|
}
|
|
123
123
|
},
|
|
@@ -164,20 +164,13 @@ const y = [
|
|
|
164
164
|
label: "Colors type",
|
|
165
165
|
default: "sequential",
|
|
166
166
|
enum: ["sequential", "divergent"],
|
|
167
|
-
calculateValue: ({ options: e }) =>
|
|
168
|
-
|
|
169
|
-
if (
|
|
170
|
-
return "manual";
|
|
171
|
-
const l = r();
|
|
172
|
-
return ((t = l == null ? void 0 : l[e == null ? void 0 : e.colorsClass]) == null ? void 0 : t.type) ?? "sequential";
|
|
173
|
-
},
|
|
174
|
-
toOptions: ({ options: e, value: l }) => {
|
|
175
|
-
var c;
|
|
176
|
-
if (l === "manual")
|
|
167
|
+
calculateValue: ({ options: e }) => e?.colorsClass === "manual" ? "manual" : o()?.[e?.colorsClass]?.type ?? "sequential",
|
|
168
|
+
toOptions: ({ options: e, value: t }) => {
|
|
169
|
+
if (t === "manual")
|
|
177
170
|
return { ...e, colorsClass: "manual" };
|
|
178
|
-
let
|
|
179
|
-
const
|
|
180
|
-
return
|
|
171
|
+
let l = e.colorClass;
|
|
172
|
+
const r = o()?.[e?.colorsClass]?.type;
|
|
173
|
+
return t !== r && (l = a(t ?? "sequential")[0]), { ...e, colorsClass: l };
|
|
181
174
|
}
|
|
182
175
|
}
|
|
183
176
|
},
|
|
@@ -188,14 +181,12 @@ const y = [
|
|
|
188
181
|
label: "Color palette",
|
|
189
182
|
hideLabel: !0,
|
|
190
183
|
default: ({ options: e }) => {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return s(a ?? "sequential")[0];
|
|
184
|
+
const l = o()?.[e?.colorsClass]?.type;
|
|
185
|
+
return a(l ?? "sequential")[0];
|
|
194
186
|
},
|
|
195
187
|
enum: ({ options: e }) => {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return s(a ?? "sequential");
|
|
188
|
+
const l = o()?.[e?.colorsClass]?.type;
|
|
189
|
+
return a(l ?? "sequential");
|
|
199
190
|
}
|
|
200
191
|
}
|
|
201
192
|
}
|
|
@@ -214,10 +205,7 @@ const y = [
|
|
|
214
205
|
default: "bar",
|
|
215
206
|
enum: ["bar", "list"]
|
|
216
207
|
},
|
|
217
|
-
visibleIf: ({ options: e }) =>
|
|
218
|
-
var l;
|
|
219
|
-
return ((l = e == null ? void 0 : e.display) == null ? void 0 : l.legend) !== !1;
|
|
220
|
-
}
|
|
208
|
+
visibleIf: ({ options: e }) => e?.display?.legend !== !1
|
|
221
209
|
},
|
|
222
210
|
{
|
|
223
211
|
key: "legend.size",
|
|
@@ -232,10 +220,7 @@ const y = [
|
|
|
232
220
|
},
|
|
233
221
|
selects: "single"
|
|
234
222
|
},
|
|
235
|
-
visibleIf: ({ options: e }) =>
|
|
236
|
-
var l;
|
|
237
|
-
return ((l = e == null ? void 0 : e.display) == null ? void 0 : l.legend) !== !1;
|
|
238
|
-
}
|
|
223
|
+
visibleIf: ({ options: e }) => e?.display?.legend !== !1
|
|
239
224
|
},
|
|
240
225
|
{
|
|
241
226
|
key: "legend.position",
|
|
@@ -254,14 +239,11 @@ const y = [
|
|
|
254
239
|
"left"
|
|
255
240
|
]
|
|
256
241
|
},
|
|
257
|
-
visibleIf: ({ options: e }) =>
|
|
258
|
-
var l;
|
|
259
|
-
return ((l = e == null ? void 0 : e.display) == null ? void 0 : l.legend) !== !1;
|
|
260
|
-
}
|
|
242
|
+
visibleIf: ({ options: e }) => e?.display?.legend !== !1
|
|
261
243
|
}
|
|
262
244
|
]
|
|
263
245
|
}
|
|
264
246
|
];
|
|
265
247
|
export {
|
|
266
|
-
|
|
248
|
+
c as default
|
|
267
249
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
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 t=require("./color-palettes-DhNHcib8.cjs"),r=require("./index-DhDgy1sp.cjs"),s=[{key:"general",type:"group",open:!0,children:[{key:"display.title",control:{type:"switch",label:"Title",default:!0}},{key:"display.legend",control:{type:"switch",label:"Legend",default:!0}},{key:"enabled.zoom",control:{type:"switch",label:"Zoom",default:!0}},{key:"enabled.pan",control:{type:"switch",label:"Pan",default:!0}},{key:"enabled.pitchBearing",control:{type:"switch",label:"Pitch & Rotate",default:!1}},{type:"divider"},{key:"vectorTileProvider",control:{type:"picker",label:"Map style",default:"Basic",enum:["Basic","Bright","Dark","Fiord","Liberty","Pastel","Positron","Streets","Toner","Topographique","Voyager","No Tiles"],parseValue:e=>e?.name||"Basic",toValue:e=>r.mapVectorTileProviders[e]??{}}}]},{key:"classification",type:"group",open:!0,children:[{key:"radius",control:{type:"slider",label:"Radius",default:16,min:4,max:100,step:1}},{key:"numberClasses",control:{type:"picker",label:"Number of classes",default:"5",enum:["3","4","5","6","7","8","9"],parseValue:e=>e?.toString()??"5",toValue:e=>Number.parseInt(e,10)??5}},{key:"aggregationType",control:{type:"picker",label:"Hexbin aggregation",default:"count",enum:["count","sum","mean","median","minimum","maximum"]}},{key:"classification",control:{type:"picker",label:"Color Method",default:"interval",enum:["interval","quantile"]}}]},{key:"colors",type:"group",open:!0,children:[{key:"opacity",control:{type:"slider",label:"Opacity",default:.85,min:0,max:1,step:.01}},{key:"colorsClassType",control:{type:"picker",label:"Colors type",default:"sequential",enum:["sequential","divergent"],calculateValue:({options:e})=>e?.colorsClass==="manual"?"manual":t.getColorMaps()?.[e?.colorsClass]?.type??"sequential",toOptions:({options:e,value:o})=>{if(o==="manual")return{...e,colorsClass:"manual"};let l=e.colorClass;const a=t.getColorMaps()?.[e?.colorsClass]?.type;return o!==a&&(l=t.getColorMapKeys(o??"sequential")[0]),{...e,colorsClass:l}}}},{key:"colorsClass",control:{type:"color-palette-picker",label:"Color palette",hideLabel:!0,default:({options:e})=>{const l=t.getColorMaps()?.[e?.colorsClass]?.type;return t.getColorMapKeys(l??"sequential")[0]},enum:({options:e})=>{const l=t.getColorMaps()?.[e?.colorsClass]?.type;return t.getColorMapKeys(l??"sequential")}}}]},{key:"legend",type:"group",open:!1,children:[{key:"legend.type",control:{type:"picker",label:"Type",default:"bar",enum:["bar","list"]},visibleIf:({options:e})=>e?.display?.legend!==!1},{key:"legend.size",control:{type:"action-button-group",label:"Size",default:["M"],values:{S:{buttonText:"S",label:"Small"},M:{buttonText:"M",label:"Medium"},L:{buttonText:"L",label:"Large"}},selects:"single"},visibleIf:({options:e})=>e?.display?.legend!==!1},{key:"legend.position",control:{type:"position-picker",label:"Position",default:"bottomLeft",enum:["topLeft","top","topRight","right","bottomRight","bottom","bottomLeft","left"]},visibleIf:({options:e})=>e?.display?.legend!==!1}]}];exports.default=s;
|
|
@@ -17,11 +17,11 @@
|
|
|
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";require("@luzmo/lucero/field-label");require("@luzmo/lucero/menu");require("@luzmo/lucero/select");const h=require("lit"),e=require("@lit/localize"),u=require("@luzmo/lucero/utils"),p=require("lit/decorators.js"),f=require("./set-locale-BRRalqne.cjs"),x=()=>[{id:"? = ?",key:"? = ?",expression:"? = ?",name:e.msg("equals",{desc:"Filter expression for equals comparison"}),description:e.msg("equals",{desc:"Filter expression for equals comparison"}),tiny:e.msg("eq",{desc:"Short form of equals comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? != ?",key:"? != ?",expression:"? != ?",name:e.msg("not equals",{desc:"Filter expression for not equals comparison"}),description:e.msg("not equals",{desc:"Filter expression for not equals comparison"}),tiny:e.msg("not eq",{desc:"Short form of not equals comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? in ?",key:"? in ?",expression:"? in ?",name:e.msg("is in",{desc:"Filter expression for in comparison"}),description:e.msg("is in",{desc:"Filter expression for in comparison"}),tiny:e.msg("is in",{desc:"Filter expression for in comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? not in ?",key:"? not in ?",expression:"? not in ?",name:e.msg("is not in",{desc:"Filter expression for not in comparison"}),description:e.msg("is not in",{desc:"Filter expression for not in comparison"}),tiny:e.msg("is not in",{desc:"Filter expression for not in comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? like ?",key:"? like ?",expression:"? like ?",name:e.msg("contains",{desc:"Filter expression for contains comparison"}),description:e.msg("contains",{desc:"Filter expression for contains comparison"}),tiny:e.msg("cont",{desc:"Short form of contains comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not like ?",key:"? not like ?",expression:"? not like ?",name:e.msg("does not contain",{desc:"Filter expression for does not contain comparison"}),description:e.msg("does not contain",{desc:"Filter expression for does not contain comparison"}),tiny:e.msg("not cont",{desc:"Short form of does not contain comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? starts with ?",key:"? starts with ?",expression:"? starts with ?",name:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),description:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),tiny:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not starts with ?",key:"? not starts with ?",expression:"? not starts with ?",name:e.msg("does not start with",{desc:"Filter expression for does not start with comparison"}),description:e.msg("does not start with",{desc:"Filter expression for does not start with comparison"}),tiny:e.msg("not starts with",{desc:"Short form of does not start with comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? ends with ?",key:"? ends with ?",expression:"? ends with ?",name:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),description:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),tiny:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not ends with ?",key:"? not ends with ?",expression:"? not ends with ?",name:e.msg("does not end with",{desc:"Filter expression for does not end with comparison"}),description:e.msg("does not end with",{desc:"Filter expression for does not end with comparison"}),tiny:e.msg("not ends with",{desc:"Short form of does not end with comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? < ?",key:"? < ?",expression:"? < ?",name:e.msg("less than",{desc:"Filter expression for less than comparison"}),description:e.msg("less than",{desc:"Filter expression for less than comparison"}),tiny:e.msg("less than",{desc:"Filter expression for less than comparison"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? <= ?",key:"? <= ?",expression:"? <= ?",name:e.msg("less than or equal",{desc:"Filter expression for less than or equal comparison"}),description:e.msg("less than or equal",{desc:"Filter expression for less than or equal comparison"}),tiny:e.msg("<=",{desc:"Short form of less than or equal comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? > ?",key:"? > ?",expression:"? > ?",name:e.msg("greater than",{desc:"Filter expression for greater than comparison"}),description:e.msg("greater than",{desc:"Filter expression for greater than comparison"}),tiny:e.msg(">",{desc:"Short form of greater than comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? >= ?",key:"? >= ?",expression:"? >= ?",name:e.msg("greater than or equal",{desc:"Filter expression for greater than or equal comparison"}),description:e.msg("greater than or equal",{desc:"Filter expression for greater than or equal comparison"}),tiny:e.msg(">=",{desc:"Short form of greater than or equal comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? between ?",key:"? between ?",expression:"? between ?",name:e.msg("is between",{desc:"Filter expression for between comparison"}),description:e.msg("is between",{desc:"Filter expression for between comparison"}),tiny:e.msg("between",{desc:"Short form of between comparison in filter expression"}),type:[],subtype:["ip_address"]},{id:"last_now",key:"last_now",expression:"last_now",name:e.msg("last (x) periods",{desc:"Filter expression for last (x) periods"}),description:e.msg("last (x) periods",{desc:"Filter expression for last (x) periods"}),tiny:e.msg("last",{desc:"Short form of last (x) periods in filter expression"}),type:["datetime"]},{id:"last_available",key:"last_available",expression:"last_available",name:e.msg("last (x) available periods",{desc:"Filter expression for last (x) available periods"}),description:e.msg("last (x) available periods",{desc:"Filter expression for last (x) available periods"}),tiny:e.msg("last available",{desc:"Short form of last (x) available periods in filter expression"}),type:["datetime"]},{id:"last_completed",key:"last_completed",expression:"last_completed",name:e.msg("last completed period",{desc:"Filter expression for last completed period"}),description:e.msg("last completed (period)",{desc:"Filter expression for last completed period"}),tiny:e.msg("last completed",{desc:"Short form of last completed period in filter expression"}),type:["datetime"]},{id:"next_now",key:"next_now",expression:"next_now",name:e.msg("next (x) periods",{desc:"Filter expression for next (x) periods"}),description:e.msg("next (x) periods",{desc:"Filter expression for next (x) periods"}),tiny:e.msg("next",{desc:"Short form of next (x) periods in filter expression"}),type:["datetime"]},{id:"next_full",key:"next_full",expression:"next_full",name:e.msg("next full (period)",{desc:"Filter expression for next full period"}),description:e.msg("next full (period)",{desc:"Filter expression for next full period"}),tiny:e.msg("next full",{desc:"Short form of next full period in filter expression"}),type:["datetime"]},{id:"WTD",key:"to_date",expression:"to_date",unit:4,name:e.msg("week to date",{desc:"Filter expression for week to date"}),description:e.msg("week to date",{desc:"Filter expression for week to date"}),tiny:e.msg("WTD",{desc:"Short form of week to date in filter expression"}),type:["datetime"]},{id:"MTD",key:"to_date",expression:"to_date",unit:3,name:e.msg("month to date",{desc:"Filter expression for month to date"}),description:e.msg("month to date",{desc:"Filter expression for month to date"}),tiny:e.msg("MTD",{desc:"Short form of month to date in filter expression"}),type:["datetime"]},{id:"QTD",key:"to_date",expression:"to_date",unit:2,name:e.msg("quarter to date",{desc:"Filter expression for quarter to date"}),description:e.msg("quarter to date",{desc:"Filter expression for quarter to date"}),tiny:e.msg("QTD",{desc:"Short form of quarter to date in filter expression"}),type:["datetime"]},{id:"YTD",key:"to_date",expression:"to_date",unit:1,name:e.msg("year to date",{desc:"Filter expression for year to date"}),description:e.msg("year to date",{desc:"Filter expression for year to date"}),tiny:e.msg("YTD",{desc:"Short form of year to date in filter expression"}),type:["datetime"]},{id:"? is null",key:"? is null",expression:"? is null",name:e.msg("is missing",{desc:"Filter expression for is missing"}),description:e.msg("is missing",{desc:"Filter expression for is missing"}),tiny:e.msg("missing",{desc:"Short form of is missing in filter expression"}),type:["numeric","datetime","hierarchy","spatial"],subtype:["ip_address"]},{id:"? is not null",key:"? is not null",expression:"? is not null",name:e.msg("is not missing",{desc:"Filter expression for is not missing"}),description:e.msg("is not missing",{desc:"Filter expression for is not missing"}),tiny:e.msg("not missing",{desc:"Short form of is not missing in filter expression"}),type:["numeric","datetime","hierarchy","spatial"],subtype:["ip_address"]}],y=(d,s,i)=>{const r=new Set(["? in ?","? not in ?"]);return!d&&!s?x():x().filter(t=>{var o;return(d&&t.type.includes(d)||s&&((o=t.subtype)==null?void 0:o.includes(s)))&&!(i&&r.has(t.key))})},q=":host{font-family:var(--luzmo-font-family)}:host{--var: blue}";var z=Object.defineProperty,v=Object.getOwnPropertyDescriptor,a=(d,s,i,r)=>{for(var t=r>1?void 0:r?v(s,i):s,o=d.length-1,n;o>=0;o--)(n=d[o])&&(t=(r?n(s,i,t):n(t))||t);return r&&t&&z(s,i,t),t};exports.LuzmoFilterExpressionPicker=class extends u.SizedMixin(u.LuzmoElement,{validSizes:Object.values(u.ElementSizes)}){constructor(){super(...arguments),this.language="en",this.hasLabel=!1,this.allowEmpty=!1,this.placeholder="",this.disabled=!1,this.invalid=!1,this.isFormula=!1,this._expressionConfigurations=x()}static get styles(){return[h.unsafeCSS(q)]}_sendChangeEvent(){var i,r,t,o,n,l,c;if(this.disabled)return;const s={expression:(i=this.filter)==null?void 0:i.expression};(o=(t=(r=this.filter)==null?void 0:r.parameters)==null?void 0:t[1])!=null&&o.unit&&(s.unit=(c=(l=(n=this.filter)==null?void 0:n.parameters)==null?void 0:l[1])==null?void 0:c.unit),this.dispatchEvent(new CustomEvent("expression-selected",{bubbles:!0,composed:!0,cancelable:!0,detail:s}))}setExpression(s){var t,o;this._richExpression=(o=(t=s==null?void 0:s.detail)==null?void 0:t.value)==null?void 0:o[0];const i=this._expressionConfigurations.find(n=>n.id===this._richExpression),r=structuredClone(this.filter);r.expression=i==null?void 0:i.expression,i!=null&&i.unit&&(this._unit=i.unit,r!=null&&r.parameters[0]&&(r.parameters[1]={unit:this._unit})),this.filter=r,this._sendChangeEvent()}willUpdate(s){var g,F,b,w,_,k,E;const i=s.has("language"),r=s.has("filter"),t=s.has("type"),o=s.has("subtype"),n=s.has("isFormula");i&&this.language!==f.getLocale()&&([...f.targetLocales].includes(this.language??"en")||this.language==="en")&&f.setLocale(this.language);const l=y(this.type,this.subtype,this.isFormula),c=["YTD","QTD","MTD","WTD"];if(((g=this.filter)==null?void 0:g.expression)==="to_date"){const m=((b=(F=this.filter)==null?void 0:F.parameters[1])==null?void 0:b.unit)??1;this._unit=m,this._richExpression=c[m-1]??"YTD"}else this._richExpression=(w=this.filter)==null?void 0:w.expression;(t||o||n||r)&&this.filter&&!this.disabled&&!(l!=null&&l.find(m=>{var S;return m.expression===((S=this.filter)==null?void 0:S.expression)}))?(this.invalid=!0,console.warn(`Warning: ${(_=this.filter)==null?void 0:_.expression} is not valid given the type: ${this.type} and subtype: ${this.subtype}`)):this.invalid=!1,!((k=this.filter)!=null&&k.expression)&&!this.allowEmpty&&(this._richExpression=(E=l==null?void 0:l[0])==null?void 0:E.id,this.filter={...this.filter,expression:this._richExpression},this._sendChangeEvent())}render(){var t,o;const s=(t=y(this.type,this.subtype,this.isFormula))==null?void 0:t.map(n=>({value:n.id,label:n.description,shortLabel:n.tiny})),i=this.disabled||!((o=this.filter)!=null&&o.expression)&&!this.allowEmpty,r=h.html`<luzmo-field-label
|
|
20
|
+
"use strict";require("@luzmo/lucero/field-label");require("@luzmo/lucero/menu");require("@luzmo/lucero/select");const c=require("lit"),e=require("@lit/localize"),m=require("@luzmo/lucero/utils"),n=require("lit/decorators.js"),h=require("./set-locale-BRRalqne.cjs"),f=()=>[{id:"? = ?",key:"? = ?",expression:"? = ?",name:e.msg("equals",{desc:"Filter expression for equals comparison"}),description:e.msg("equals",{desc:"Filter expression for equals comparison"}),tiny:e.msg("eq",{desc:"Short form of equals comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? != ?",key:"? != ?",expression:"? != ?",name:e.msg("not equals",{desc:"Filter expression for not equals comparison"}),description:e.msg("not equals",{desc:"Filter expression for not equals comparison"}),tiny:e.msg("not eq",{desc:"Short form of not equals comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? in ?",key:"? in ?",expression:"? in ?",name:e.msg("is in",{desc:"Filter expression for in comparison"}),description:e.msg("is in",{desc:"Filter expression for in comparison"}),tiny:e.msg("is in",{desc:"Filter expression for in comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? not in ?",key:"? not in ?",expression:"? not in ?",name:e.msg("is not in",{desc:"Filter expression for not in comparison"}),description:e.msg("is not in",{desc:"Filter expression for not in comparison"}),tiny:e.msg("is not in",{desc:"Filter expression for not in comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? like ?",key:"? like ?",expression:"? like ?",name:e.msg("contains",{desc:"Filter expression for contains comparison"}),description:e.msg("contains",{desc:"Filter expression for contains comparison"}),tiny:e.msg("cont",{desc:"Short form of contains comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not like ?",key:"? not like ?",expression:"? not like ?",name:e.msg("does not contain",{desc:"Filter expression for does not contain comparison"}),description:e.msg("does not contain",{desc:"Filter expression for does not contain comparison"}),tiny:e.msg("not cont",{desc:"Short form of does not contain comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? starts with ?",key:"? starts with ?",expression:"? starts with ?",name:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),description:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),tiny:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not starts with ?",key:"? not starts with ?",expression:"? not starts with ?",name:e.msg("does not start with",{desc:"Filter expression for does not start with comparison"}),description:e.msg("does not start with",{desc:"Filter expression for does not start with comparison"}),tiny:e.msg("not starts with",{desc:"Short form of does not start with comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? ends with ?",key:"? ends with ?",expression:"? ends with ?",name:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),description:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),tiny:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not ends with ?",key:"? not ends with ?",expression:"? not ends with ?",name:e.msg("does not end with",{desc:"Filter expression for does not end with comparison"}),description:e.msg("does not end with",{desc:"Filter expression for does not end with comparison"}),tiny:e.msg("not ends with",{desc:"Short form of does not end with comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? < ?",key:"? < ?",expression:"? < ?",name:e.msg("less than",{desc:"Filter expression for less than comparison"}),description:e.msg("less than",{desc:"Filter expression for less than comparison"}),tiny:e.msg("less than",{desc:"Filter expression for less than comparison"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? <= ?",key:"? <= ?",expression:"? <= ?",name:e.msg("less than or equal",{desc:"Filter expression for less than or equal comparison"}),description:e.msg("less than or equal",{desc:"Filter expression for less than or equal comparison"}),tiny:e.msg("<=",{desc:"Short form of less than or equal comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? > ?",key:"? > ?",expression:"? > ?",name:e.msg("greater than",{desc:"Filter expression for greater than comparison"}),description:e.msg("greater than",{desc:"Filter expression for greater than comparison"}),tiny:e.msg(">",{desc:"Short form of greater than comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? >= ?",key:"? >= ?",expression:"? >= ?",name:e.msg("greater than or equal",{desc:"Filter expression for greater than or equal comparison"}),description:e.msg("greater than or equal",{desc:"Filter expression for greater than or equal comparison"}),tiny:e.msg(">=",{desc:"Short form of greater than or equal comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? between ?",key:"? between ?",expression:"? between ?",name:e.msg("is between",{desc:"Filter expression for between comparison"}),description:e.msg("is between",{desc:"Filter expression for between comparison"}),tiny:e.msg("between",{desc:"Short form of between comparison in filter expression"}),type:[],subtype:["ip_address"]},{id:"last_now",key:"last_now",expression:"last_now",name:e.msg("last (x) periods",{desc:"Filter expression for last (x) periods"}),description:e.msg("last (x) periods",{desc:"Filter expression for last (x) periods"}),tiny:e.msg("last",{desc:"Short form of last (x) periods in filter expression"}),type:["datetime"]},{id:"last_available",key:"last_available",expression:"last_available",name:e.msg("last (x) available periods",{desc:"Filter expression for last (x) available periods"}),description:e.msg("last (x) available periods",{desc:"Filter expression for last (x) available periods"}),tiny:e.msg("last available",{desc:"Short form of last (x) available periods in filter expression"}),type:["datetime"]},{id:"last_completed",key:"last_completed",expression:"last_completed",name:e.msg("last completed period",{desc:"Filter expression for last completed period"}),description:e.msg("last completed (period)",{desc:"Filter expression for last completed period"}),tiny:e.msg("last completed",{desc:"Short form of last completed period in filter expression"}),type:["datetime"]},{id:"next_now",key:"next_now",expression:"next_now",name:e.msg("next (x) periods",{desc:"Filter expression for next (x) periods"}),description:e.msg("next (x) periods",{desc:"Filter expression for next (x) periods"}),tiny:e.msg("next",{desc:"Short form of next (x) periods in filter expression"}),type:["datetime"]},{id:"next_full",key:"next_full",expression:"next_full",name:e.msg("next full (period)",{desc:"Filter expression for next full period"}),description:e.msg("next full (period)",{desc:"Filter expression for next full period"}),tiny:e.msg("next full",{desc:"Short form of next full period in filter expression"}),type:["datetime"]},{id:"WTD",key:"to_date",expression:"to_date",unit:4,name:e.msg("week to date",{desc:"Filter expression for week to date"}),description:e.msg("week to date",{desc:"Filter expression for week to date"}),tiny:e.msg("WTD",{desc:"Short form of week to date in filter expression"}),type:["datetime"]},{id:"MTD",key:"to_date",expression:"to_date",unit:3,name:e.msg("month to date",{desc:"Filter expression for month to date"}),description:e.msg("month to date",{desc:"Filter expression for month to date"}),tiny:e.msg("MTD",{desc:"Short form of month to date in filter expression"}),type:["datetime"]},{id:"QTD",key:"to_date",expression:"to_date",unit:2,name:e.msg("quarter to date",{desc:"Filter expression for quarter to date"}),description:e.msg("quarter to date",{desc:"Filter expression for quarter to date"}),tiny:e.msg("QTD",{desc:"Short form of quarter to date in filter expression"}),type:["datetime"]},{id:"YTD",key:"to_date",expression:"to_date",unit:1,name:e.msg("year to date",{desc:"Filter expression for year to date"}),description:e.msg("year to date",{desc:"Filter expression for year to date"}),tiny:e.msg("YTD",{desc:"Short form of year to date in filter expression"}),type:["datetime"]},{id:"? is null",key:"? is null",expression:"? is null",name:e.msg("is missing",{desc:"Filter expression for is missing"}),description:e.msg("is missing",{desc:"Filter expression for is missing"}),tiny:e.msg("missing",{desc:"Short form of is missing in filter expression"}),type:["numeric","datetime","hierarchy","spatial"],subtype:["ip_address"]},{id:"? is not null",key:"? is not null",expression:"? is not null",name:e.msg("is not missing",{desc:"Filter expression for is not missing"}),description:e.msg("is not missing",{desc:"Filter expression for is not missing"}),tiny:e.msg("not missing",{desc:"Short form of is not missing in filter expression"}),type:["numeric","datetime","hierarchy","spatial"],subtype:["ip_address"]}],u=(a,s,o)=>{const t=new Set(["? in ?","? not in ?"]);return!a&&!s?f():f().filter(i=>(a&&i.type.includes(a)||s&&i.subtype?.includes(s))&&!(o&&t.has(i.key)))},g=":host{font-family:var(--luzmo-font-family)}:host{--var: blue}";var F=Object.defineProperty,b=Object.getOwnPropertyDescriptor,r=(a,s,o,t)=>{for(var i=t>1?void 0:t?b(s,o):s,p=a.length-1,l;p>=0;p--)(l=a[p])&&(i=(t?l(s,o,i):l(i))||i);return t&&i&&F(s,o,i),i};exports.LuzmoFilterExpressionPicker=class extends m.SizedMixin(m.LuzmoElement,{validSizes:Object.values(m.ElementSizes)}){constructor(){super(...arguments),this.language="en",this.hasLabel=!1,this.allowEmpty=!1,this.placeholder="",this.disabled=!1,this.invalid=!1,this.isFormula=!1,this._expressionConfigurations=f()}static get styles(){return[c.unsafeCSS(g)]}_sendChangeEvent(){if(this.disabled)return;const s={expression:this.filter?.expression};this.filter?.parameters?.[1]?.unit&&(s.unit=this.filter?.parameters?.[1]?.unit),this.dispatchEvent(new CustomEvent("expression-selected",{bubbles:!0,composed:!0,cancelable:!0,detail:s}))}setExpression(s){this._richExpression=s?.detail?.value?.[0];const o=this._expressionConfigurations.find(i=>i.id===this._richExpression),t=structuredClone(this.filter);t.expression=o?.expression,o?.unit&&(this._unit=o.unit,t?.parameters[0]&&(t.parameters[1]={unit:this._unit})),this.filter=t,this._sendChangeEvent()}willUpdate(s){const o=s.has("language"),t=s.has("filter"),i=s.has("type"),p=s.has("subtype"),l=s.has("isFormula");o&&this.language!==h.getLocale()&&([...h.targetLocales].includes(this.language??"en")||this.language==="en")&&h.setLocale(this.language);const x=u(this.type,this.subtype,this.isFormula),y=["YTD","QTD","MTD","WTD"];if(this.filter?.expression==="to_date"){const d=this.filter?.parameters[1]?.unit??1;this._unit=d,this._richExpression=y[d-1]??"YTD"}else this._richExpression=this.filter?.expression;(i||p||l||t)&&this.filter&&!this.disabled&&!x?.find(d=>d.expression===this.filter?.expression)?(this.invalid=!0,console.warn(`Warning: ${this.filter?.expression} is not valid given the type: ${this.type} and subtype: ${this.subtype}`)):this.invalid=!1,!this.filter?.expression&&!this.allowEmpty&&(this._richExpression=x?.[0]?.id,this.filter={...this.filter,expression:this._richExpression},this._sendChangeEvent())}render(){const s=u(this.type,this.subtype,this.isFormula)?.map(i=>({value:i.id,label:i.description,shortLabel:i.tiny})),o=this.disabled||!this.filter?.expression&&!this.allowEmpty,t=c.html`<luzmo-field-label
|
|
21
21
|
for="expression"
|
|
22
22
|
size=${this.size}
|
|
23
23
|
>${this.label??e.msg("Select an expression",{desc:"Label for expression picker"})}</luzmo-field-label
|
|
24
|
-
>`;return
|
|
24
|
+
>`;return c.html`${this.hasLabel?t:""}
|
|
25
25
|
<luzmo-select
|
|
26
26
|
label=${this.placeholder??e.msg("Select...")}
|
|
27
27
|
id="expression"
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
variant="highlight"
|
|
30
30
|
selects="single"
|
|
31
31
|
.language=${this.language}
|
|
32
|
-
?disabled=${
|
|
32
|
+
?disabled=${o}
|
|
33
33
|
?invalid=${this.invalid}
|
|
34
34
|
.options=${s}
|
|
35
35
|
.value=${[this._richExpression]}
|
|
36
36
|
@change=${this.setExpression}
|
|
37
37
|
>
|
|
38
|
-
</luzmo-select>`}};
|
|
38
|
+
</luzmo-select>`}};r([n.property({type:String,reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"language",2);r([n.property({type:String,reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"filter",2);r([n.property({type:Boolean,attribute:"has-label",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"hasLabel",2);r([n.property({type:String,reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"label",2);r([n.property({type:Boolean,attribute:"allow-empty",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"allowEmpty",2);r([n.property({type:String,attribute:"placeholder",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"placeholder",2);r([n.property({type:Boolean,attribute:"disabled",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"disabled",2);r([n.property({type:String,attribute:"type",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"type",2);r([n.property({type:String,attribute:"subtype",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"subtype",2);r([n.property({type:Boolean,attribute:"invalid",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"invalid",2);r([n.property({type:Boolean,attribute:"is-formula",reflect:!0})],exports.LuzmoFilterExpressionPicker.prototype,"isFormula",2);r([n.state()],exports.LuzmoFilterExpressionPicker.prototype,"_richExpression",2);r([n.state()],exports.LuzmoFilterExpressionPicker.prototype,"_unit",2);exports.LuzmoFilterExpressionPicker=r([e.localized()],exports.LuzmoFilterExpressionPicker);customElements.get("luzmo-filter-expression-picker")||customElements.define("luzmo-filter-expression-picker",exports.LuzmoFilterExpressionPicker);exports.getValidExpressions=u;
|
|
@@ -0,0 +1,121 @@
|
|
|
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";const v=require("@lit-labs/signals"),h=require("@lit/context"),z=require("@lit/task");require("@luzmo/lucero/divider");require("@luzmo/lucero/field-label");require("@luzmo/lucero/icon");require("@luzmo/lucero/multi-language-field");require("@luzmo/lucero/progress-circle");require("@luzmo/lucero/text-field");require("@luzmo/lucero/tooltip");const n=require("lit"),i=require("lit/decorators.js"),g=require("@lit/localize"),d=require("@luzmo/icons"),f=require("./focusable-QLh-LlNt.cjs"),c=require("./sized-mixin-DcvJLFeo.cjs"),b=require("./en-DZcn_iz_.cjs"),y=h.createContext(Symbol("slot-store-context")),_=":host{font-family:var(--luzmo-display-settings-font-family, var(--luzmo-font-family));font-size:var(--luzmo-display-settings-font-size, var(--display-settings-font-size));color:var(--luzmo-display-settings-font-color, var(--luzmo-font-color))}.settings-container{display:flex;flex-direction:column;gap:var(--luzmo-display-settings-vertical-gap, var(--luzmo-spacing-2))}.settings-row{display:flex;justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-gap, var(--display-settings-gap))}luzmo-divider{margin:var(--luzmo-display-settings-ids-container-vertical-margin, var(--display-settings-ids-container-vertical-margin)) 0}luzmo-tooltip{--tooltip-font-size: var( --luzmo-display-settings-tooltip-font-size, var(--tooltip-font-size) )}.setting{display:flex;align-items:center}.label-action-container{display:flex;align-items:center;justify-content:space-between;gap:var(--luzmo-display-settings-info-to-remove-icon-gap, var(--display-settings-info-to-remove-icon-gap))}.id-button,.remove-button{outline:none;cursor:pointer;border:none;background:none;font-size:var(--luzmo-display-settings-id-button-font-size, var(--luzmo-display-settings-font-size, var(--display-settings-font-size)));color:var(--luzmo-display-settings-font-color, var(--luzmo-font-color))}.remove-button{display:block;width:var(--luzmo-display-settings-remove-button-size, var(--display-settings-remove-button-size));height:var(--luzmo-display-settings-remove-button-size, var(--display-settings-remove-button-size));border-radius:var(--luzmo-display-settings-remove-button-border-radius, 50%)}.remove-button:hover{background-color:var(--luzmo-display-settings-remove-button-background-color-hover, var(--luzmo-background-color-hover))}.remove-button:active,.remove-button:focus{background-color:var(--luzmo-display-settings-remove-button-background-color-down, var(--luzmo-background-color-down))}.remove-button:focus-visible{box-shadow:0 0 0 var(--luzmo-display-settings-remove-button-indicator-thickness, var(--display-settings-remove-button-indicator-thickness)) var(--highcontrast-remove-button-indicator-color, var(--luzmo-display-settings-remove-button-indicator-color, var(--display-settings-remove-button-indicator-color)))}.ids-container{display:flex;flex-direction:column;gap:var(--luzmo-display-settings-ids-container-gap, var(--luzmo-spacing-2));border-radius:50%}.id-label{text-transform:var(--luzmo-display-settings-id-label-text-transform, var(--display-settings-id-label-text-transform));font-size:var(--luzmo-display-settings-id-label-font-size, var(--display-settings-id-label-font-size));color:var(--luzmo-display-settings-id-label-color, var(--display-settings-id-label-color))}.id-value{-webkit-user-select:text;user-select:text;cursor:text}.example-container{line-height:var(--luzmo-display-settings-example-height, var(--display-settings-example-height));font-size:var(--luzmo-display-settings-example-font-size, var(--display-settings-example-font-size));color:var(--luzmo-display-settings-example-color, var(--display-settings-example-color))}.example-container .example-label{font-weight:var(--luzmo-display-settings-example-label-font-weight, var(--display-settings-example-label-font-weight));color:var(--luzmo-display-settings-example-label-color, var(--display-settings-example-label-color))}.example-container .example-language{text-transform:uppercase;color:var(--luzmo-display-settings-example-language-color, var(--display-settings-example-language-color))}.example-container{gap:var(--luzmo-display-settings-example-container-gap, var(--luzmo-spacing-2))}:host{--display-settings-font-family: var(--luzmo-font-family);--display-settings-id-label-text-transform: uppercase;--display-settings-id-label-color: var(--luzmo-secondary);--display-settings-remove-button-indicator-color: var(--luzmo-primary);--display-settings-remove-button-indicator-thickness: var( --luzmo-border-width )}:host{--display-settings-font-size: var(--luzmo-font-size);--display-settings-id-label-font-size: var(--luzmo-font-size-s);--display-settings-gap: var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-4);--display-settings-info-to-remove-icon-gap: var(--luzmo-spacing-5);--display-settings-remove-button-size: var(--luzmo-component-height)}:host([size=s]){--display-settings-id-label-font-size: var(--luzmo-font-size-s);--display-settings-font-size: var(--luzmo-font-size-s);--display-settings-gap: var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-3);--display-settings-info-to-remove-icon-gap: var(--luzmo-spacing-4);--display-settings-remove-button-size: var(--luzmo-component-height-s)}:host([size=l]){--display-settings-id-label-font-size: var(--luzmo-font-size);--display-settings-font-size: var(--luzmo-font-size-l);--display-settings-gap: var(--luzmo-spacing-4);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-5);--display-settings-info-to-remove-icon-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--display-settings-remove-button-size: var(--luzmo-component-height-l)}:host([size=xl]){--display-settings-id-label-font-size: var(--luzmo-font-size-l);--display-settings-font-size: var(--luzmo-font-size-xl);--display-settings-gap: var(--luzmo-spacing-5);--display-settings-ids-container-vertical-margin: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--display-settings-info-to-remove-icon-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--display-settings-remove-button-size: var(--luzmo-component-height-xl)}:host{--display-settings-example-font-size: var(--luzmo-font-size);--display-settings-example-color: var(--luzmo-font-color);--display-settings-example-label-font-weight: bold;--display-settings-example-label-color: var(--luzmo-primary);--display-settings-example-language-color: var(--luzmo-primary)}:host{--display-settings-example-height: var(--luzmo-component-height)}:host([size=s]){--display-settings-example-height: var(--luzmo-component-height-s);--display-settings-example-font-size: var(--luzmo-font-size-s)}:host([size=l]){--display-settings-example-height: var(--luzmo-component-height-l);--display-settings-example-font-size: var(--luzmo-font-size)}:host([size=xl]){--display-settings-example-height: var(--luzmo-component-height-xl);--display-settings-example-font-size: var(--luzmo-font-size-l)}";var C=Object.defineProperty,s=(m,t,o,p)=>{for(var a=void 0,r=m.length-1,u;r>=0;r--)(u=m[r])&&(a=u(t,o,a)||a);return a&&C(t,o,a),a};class e extends v.SignalWatcher(c.SizedMixin(f.LuzmoElement,{validSizes:Object.values(c.ElementSizes)})){constructor(){super(...arguments),this._loadDisplaySettings=new z.Task(this,{task:async([t,o,p,a,r,u])=>{const l=[];u&&l.push("grandTotals"),p&&l.push("periodOverPeriod"),(t==="numeric"||t==="mixed"&&this._currentSlotContent?.type==="numeric")&&l.push("numeric"),t!=="numeric"&&this._currentSlotContent?.type==="datetime"&&l.push("datetime"),!["numeric","mixed"].includes(t??"")&&this._currentSlotContent?.type==="numeric"&&!a&&l.push("binning"),p&&!this._settingsTypeLoaded.periodOverPeriod&&(await Promise.resolve().then(()=>require("./display-settings-period-over-period/index.cjs")),this._settingsTypeLoaded.periodOverPeriod=!0),l.length>0&&!o&&(l.includes("numeric")&&!this._settingsTypeLoaded.numeric?(await Promise.resolve().then(()=>require("./display-settings-numeric/index.cjs")),this._settingsTypeLoaded.numeric=!0):l.includes("datetime")&&!this._settingsTypeLoaded.datetime&&r?(await Promise.resolve().then(()=>require("./display-settings-datetime/index.cjs")),this._settingsTypeLoaded.datetime=!0):l.includes("binning")&&!this._settingsTypeLoaded.binning?(await Promise.resolve().then(()=>require("./display-settings-binning/index.cjs")),this._settingsTypeLoaded.binning=!0):l.includes("grandTotals")&&!this._settingsTypeLoaded.grandTotals&&(await Promise.resolve().then(()=>require("./display-settings-grand-totals/index.cjs")),this._settingsTypeLoaded.grandTotals=!0))},args:()=>[this.slotType,this.hideDisplaySettings,this._store?.periodOverPeriodUiType.get(),this.isBinningDisabled,this.areDatetimeOptionsEnabled,this.areGrandTotalsEnabled,this.slotContent]}),this.language="en",this.contentLanguage="en",this.slotType="numeric",this.slotContent={},this._showIds=!1,this.measureColumns=[],this._settingsTypeLoaded={binning:!1,datetime:!1,numeric:!1,grandTotals:!1,periodOverPeriod:!1,hierarchy:!0},this._currentSlotContent={}}static get styles(){return[n.unsafeCSS(_)]}_datasetDatetimeColumns(){return this._store?.linkedDataset.get().flatMap(t=>t.columns?.filter(o=>o.type==="datetime").map(o=>({...o,datasetId:t.id})))}willUpdate(){const t=this._store?.activeSlotContents.get(),o=this._store?.periodOverPeriodUiType.get();this.periodOverPeriodUiType!==o&&(this.periodOverPeriodUiType=o),t&&t!==this._currentSlotContent&&(this._currentSlotContent=structuredClone(t))}_onSlotContentChange(t){t.stopPropagation(),t.preventDefault(),this._currentSlotContent=structuredClone(t.detail.slotContent),this._sendEvent(),this.requestUpdate()}_onLabelChange(){this._currentSlotContent=structuredClone(this._currentSlotContent),this._currentSlotContent.label=this._multiLanguageFieldElement.value||{},this._sendEvent(),this.requestUpdate()}_sendEvent(){this.dispatchEvent(new CustomEvent("slot-content-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:{...this._currentSlotContent}}})),this._store&&this._store.updateContent({...this._currentSlotContent})}_removeEvent(){this.dispatchEvent(new CustomEvent("remove-slot-content",{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:this._currentSlotContent}}))}_toggleIds(){this._showIds=!this._showIds}_renderExampleRow(){const t=this.slotType==="numeric"||this.slotType==="mixed"&&this._currentSlotContent.type==="numeric",o=this.slotType!=="datetime"&&this._currentSlotContent.type==="datetime"&&this.areDatetimeOptionsEnabled;if(!(t||o))return n.nothing;const p=!this._currentSlotContent.datetimeDisplayMode||this._currentSlotContent.datetimeDisplayMode==="default",a=t?1234.56:p?new Date:1,r=b.formatter({...this._currentSlotContent,type:t?"numeric":"datetime"},{locale:this.contentLanguage,level:this._currentSlotContent?.level})(a);return n.html`<div class="settings-row example-container">
|
|
21
|
+
<span class="example-label"
|
|
22
|
+
>${g.msg("Example",{desc:"Label for example"})}:</span
|
|
23
|
+
>
|
|
24
|
+
<span class="example">${r}</span>
|
|
25
|
+
</div>`}_renderDisplaySettings(){return n.html`<div class="settings-container">
|
|
26
|
+
<div class="settings-row">
|
|
27
|
+
<div class="setting">
|
|
28
|
+
<div class="label-container">
|
|
29
|
+
<luzmo-field-label side-aligned="start" .size=${this.size}
|
|
30
|
+
>Label:</luzmo-field-label
|
|
31
|
+
>
|
|
32
|
+
<luzmo-multi-language-field
|
|
33
|
+
.language=${this.language}
|
|
34
|
+
.value=${this._currentSlotContent.label}
|
|
35
|
+
.size=${this.size}
|
|
36
|
+
debounce="200"
|
|
37
|
+
@change=${this._onLabelChange}
|
|
38
|
+
></luzmo-multi-language-field>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="label-action-container">
|
|
41
|
+
<button class="id-button" @click=${this._toggleIds}>
|
|
42
|
+
${d.luzmoIcon(d.luzmoInfoCircleOutline)}
|
|
43
|
+
<luzmo-tooltip self-managed placement="top" size=${this.size}>
|
|
44
|
+
Show dataset and column id's
|
|
45
|
+
</luzmo-tooltip>
|
|
46
|
+
</button>
|
|
47
|
+
${this.showRemoveButton?n.html`<button
|
|
48
|
+
class="remove-button"
|
|
49
|
+
@click=${this._removeEvent}
|
|
50
|
+
>
|
|
51
|
+
${d.luzmoIcon(d.luzmoTrashOutline)}
|
|
52
|
+
<luzmo-tooltip
|
|
53
|
+
self-managed
|
|
54
|
+
placement="top"
|
|
55
|
+
size=${this.size}
|
|
56
|
+
>
|
|
57
|
+
Remove
|
|
58
|
+
</luzmo-tooltip>
|
|
59
|
+
</button>`:""}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
${this.areGrandTotalsEnabled?n.html`<luzmo-display-settings-grand-totals
|
|
64
|
+
.language=${this.language}
|
|
65
|
+
.slotContent=${this._currentSlotContent}
|
|
66
|
+
.size=${this.size}
|
|
67
|
+
@slot-content-changed=${this._onSlotContentChange}
|
|
68
|
+
></luzmo-display-settings-grand-totals>`:""}
|
|
69
|
+
${this.slotType==="numeric"||this.slotType==="mixed"&&this._currentSlotContent.type==="numeric"?n.html`<luzmo-display-settings-numeric
|
|
70
|
+
.language=${this.language}
|
|
71
|
+
.slotContent=${this._currentSlotContent}
|
|
72
|
+
.size=${this.size}
|
|
73
|
+
.measureColumns=${this.measureColumns}
|
|
74
|
+
.isAggregationDisabled=${this.isAggregationDisabled}
|
|
75
|
+
.isCumulativeSumEnabled=${this.isCumulativeSumEnabled}
|
|
76
|
+
@slot-content-changed=${this._onSlotContentChange}
|
|
77
|
+
></luzmo-display-settings-numeric>`:""}
|
|
78
|
+
${this.slotType!=="numeric"&&this._currentSlotContent.type==="datetime"&&this.areDatetimeOptionsEnabled?n.html`<luzmo-display-settings-datetime
|
|
79
|
+
.language=${this.language}
|
|
80
|
+
.contentLanguage=${this.contentLanguage}
|
|
81
|
+
.slotContent=${this._currentSlotContent}
|
|
82
|
+
.size=${this.size}
|
|
83
|
+
@slot-content-changed=${this._onSlotContentChange}
|
|
84
|
+
></luzmo-display-settings-datetime>`:""}
|
|
85
|
+
${!["numeric","mixed"].includes(this.slotType??"")&&this._currentSlotContent.type==="numeric"&&!this.isBinningDisabled?n.html`<luzmo-display-settings-binning
|
|
86
|
+
.language=${this.language}
|
|
87
|
+
.slotContent=${this._currentSlotContent}
|
|
88
|
+
.size=${this.size}
|
|
89
|
+
@slot-content-changed=${this._onSlotContentChange}
|
|
90
|
+
></luzmo-display-settings-binning>`:""}
|
|
91
|
+
${this.periodOverPeriodUiType?n.html`<luzmo-display-settings-period-over-period
|
|
92
|
+
.language=${this.language}
|
|
93
|
+
.slotContent=${this._currentSlotContent}
|
|
94
|
+
.size=${this.size}
|
|
95
|
+
.periodOverPeriodUiType=${this.periodOverPeriodUiType}
|
|
96
|
+
.linkedDatasetDatetimeColumns=${this._datasetDatetimeColumns()}
|
|
97
|
+
@slot-content-changed=${this._onSlotContentChange}
|
|
98
|
+
></luzmo-display-settings-period-over-period>`:""}
|
|
99
|
+
${this._renderExampleRow()}
|
|
100
|
+
</div>
|
|
101
|
+
${this._showIds?n.html` <luzmo-divider></luzmo-divider>
|
|
102
|
+
<div class="ids-container">
|
|
103
|
+
<div>
|
|
104
|
+
<span class="id-label"
|
|
105
|
+
>${this._currentSlotContent.formula?g.msg("Formula",{desc:"Label for formula type"}):g.msg("Column",{desc:"Label for column type"})}:
|
|
106
|
+
</span>
|
|
107
|
+
<span class="id-value">
|
|
108
|
+
${this._currentSlotContent.formula??this._currentSlotContent.columnId??this._currentSlotContent.column}
|
|
109
|
+
</span>
|
|
110
|
+
</div>
|
|
111
|
+
<div>
|
|
112
|
+
<span class="id-label">Dataset: </span>
|
|
113
|
+
<span class="id-value">
|
|
114
|
+
${this._currentSlotContent.datasetId??this._currentSlotContent.set}
|
|
115
|
+
</span>
|
|
116
|
+
</div>
|
|
117
|
+
<div></div>
|
|
118
|
+
</div>`:""}`}render(){return this._loadDisplaySettings.render({pending:()=>n.html`<luzmo-progress-circle
|
|
119
|
+
indeterminate
|
|
120
|
+
.size=${this.size}
|
|
121
|
+
></luzmo-progress-circle>`,complete:()=>this._renderDisplaySettings(),error:()=>this._renderDisplaySettings()})}disconnectedCallback(){super.disconnectedCallback?.(),this._loadDisplaySettings.abort?.()}}s([i.property({type:String})],e.prototype,"language");s([i.property({type:String,attribute:"content-language"})],e.prototype,"contentLanguage");s([i.property({type:Boolean,attribute:"hide-display-settings"})],e.prototype,"hideDisplaySettings");s([i.property({type:Boolean})],e.prototype,"isBinningDisabled");s([i.property({type:Boolean})],e.prototype,"areDatetimeOptionsEnabled");s([i.property({type:Boolean})],e.prototype,"areGrandTotalsEnabled");s([i.property({type:Boolean})],e.prototype,"isAggregationDisabled");s([i.property({type:Boolean})],e.prototype,"isCumulativeSumEnabled");s([i.property({type:String})],e.prototype,"periodOverPeriodUiType");s([i.property({type:Boolean,attribute:"show-remove-button"})],e.prototype,"showRemoveButton");s([i.property({type:String,attribute:"slot-type"})],e.prototype,"slotType");s([i.property()],e.prototype,"slotContent");s([i.state()],e.prototype,"_showIds");s([i.property({type:Array,reflect:!1})],e.prototype,"measureColumns");s([i.query("luzmo-multi-language-field")],e.prototype,"_multiLanguageFieldElement");s([h.consume({context:y,subscribe:!0})],e.prototype,"_store");customElements.get("luzmo-display-settings")||customElements.define("luzmo-display-settings",e);exports.LuzmoDisplaySettings=e;exports.slotContext=y;
|
|
@@ -0,0 +1,20 @@
|
|
|
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";var T=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},X={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Y=class{#t=X;#e=!1;setTimeoutProvider(t){this.#t=t}setTimeout(t,e){return this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}},Q=new Y;function tt(t){setTimeout(t,0)}var M=typeof window>"u"||"Deno"in globalThis;function v(){}function et(t,e){return typeof t=="function"?t(e):t}function st(t){return typeof t=="number"&&t>=0&&t!==1/0}function it(t,e){return Math.max(t+(e||0)-Date.now(),0)}function E(t,e){return typeof t=="function"?t(e):t}function rt(t,e){return typeof t=="function"?t(e):t}function U(t,e){const{type:s="all",exact:i,fetchStatus:n,predicate:a,queryKey:o,stale:r}=t;if(o){if(i){if(e.queryHash!==j(o,e.options))return!1}else if(!F(e.queryKey,o))return!1}if(s!=="all"){const u=e.isActive();if(s==="active"&&!u||s==="inactive"&&u)return!1}return!(typeof r=="boolean"&&e.isStale()!==r||n&&n!==e.state.fetchStatus||a&&!a(e))}function x(t,e){const{exact:s,status:i,predicate:n,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(s){if(P(e.options.mutationKey)!==P(a))return!1}else if(!F(e.options.mutationKey,a))return!1}return!(i&&e.state.status!==i||n&&!n(e))}function j(t,e){return(e?.queryKeyHashFn||P)(t)}function P(t){return JSON.stringify(t,(e,s)=>R(s)?Object.keys(s).sort().reduce((i,n)=>(i[n]=s[n],i),{}):s)}function F(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(s=>F(t[s],e[s])):!1}var nt=Object.prototype.hasOwnProperty;function $(t,e){if(t===e)return t;const s=L(t)&&L(e);if(!s&&!(R(t)&&R(e)))return e;const n=(s?t:Object.keys(t)).length,a=s?e:Object.keys(e),o=a.length,r=s?new Array(o):{};let u=0;for(let h=0;h<o;h++){const d=s?h:a[h],l=t[d],m=e[d];if(l===m){r[d]=l,(s?h<n:nt.call(t,d))&&u++;continue}if(l===null||m===null||typeof l!="object"||typeof m!="object"){r[d]=m;continue}const b=$(l,m);r[d]=b,b===l&&u++}return n===o&&u===n?t:r}function L(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function R(t){if(!H(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!H(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function H(t){return Object.prototype.toString.call(t)==="[object Object]"}function at(t){return new Promise(e=>{Q.setTimeout(e,t)})}function ot(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?$(t,e):e}function ut(t,e,s=0){const i=[...t,e];return s&&i.length>s?i.slice(1):i}function ht(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var I=Symbol();function B(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===I?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var ct=class extends T{#t;#e;#s;constructor(){super(),this.#s=t=>{if(!M&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},J=new ct;function lt(){let t,e;const s=new Promise((n,a)=>{t=n,e=a});s.status="pending",s.catch(()=>{});function i(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{i({status:"fulfilled",value:n}),t(n)},s.reject=n=>{i({status:"rejected",reason:n}),e(n)},s}var dt=tt;function ft(){let t=[],e=0,s=r=>{r()},i=r=>{r()},n=dt;const a=r=>{e?t.push(r):n(()=>{s(r)})},o=()=>{const r=t;t=[],r.length&&n(()=>{i(()=>{r.forEach(u=>{s(u)})})})};return{batch:r=>{let u;e++;try{u=r()}finally{e--,e||o()}return u},batchCalls:r=>(...u)=>{a(()=>{r(...u)})},schedule:a,setNotifyFunction:r=>{s=r},setBatchNotifyFunction:r=>{i=r},setScheduler:r=>{n=r}}}var y=ft(),yt=class extends T{#t=!0;#e;#s;constructor(){super(),this.#s=t=>{if(!M&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(s=>{s(t)}))}isOnline(){return this.#t}},D=new yt;function pt(t){return Math.min(1e3*2**t,3e4)}function z(t){return(t??"online")==="online"?D.isOnline():!0}var K=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function W(t){let e=!1,s=0,i;const n=lt(),a=()=>n.status!=="pending",o=c=>{if(!a()){const p=new K(c);m(p),t.onCancel?.(p)}},r=()=>{e=!0},u=()=>{e=!1},h=()=>J.isFocused()&&(t.networkMode==="always"||D.isOnline())&&t.canRun(),d=()=>z(t.networkMode)&&t.canRun(),l=c=>{a()||(i?.(),n.resolve(c))},m=c=>{a()||(i?.(),n.reject(c))},b=()=>new Promise(c=>{i=p=>{(a()||h())&&c(p)},t.onPause?.()}).then(()=>{i=void 0,a()||t.onContinue?.()}),f=()=>{if(a())return;let c;const p=s===0?t.initialPromise:void 0;try{c=p??t.fn()}catch(g){c=Promise.reject(g)}Promise.resolve(c).then(l).catch(g=>{if(a())return;const w=t.retry??(M?0:3),O=t.retryDelay??pt,q=typeof O=="function"?O(s,g):O,S=w===!0||typeof w=="number"&&s<w||typeof w=="function"&&w(s,g);if(e||!S){m(g);return}s++,t.onFail?.(s,g),at(q).then(()=>h()?void 0:b()).then(()=>{e?m(g):f()})})};return{promise:n,status:()=>n.status,cancel:o,continue:()=>(i?.(),n),cancelRetry:r,continueRetry:u,canStart:d,start:()=>(d()?f():b().then(f),n)}}var Z=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),st(this.gcTime)&&(this.#t=Q.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(M?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Q.clearTimeout(this.#t),this.#t=void 0)}},mt=class extends Z{#t;#e;#s;#r;#i;#a;#o;constructor(t){super(),this.#o=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#s=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=N(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(t){if(this.options={...this.#a,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=N(this.options);e.data!==void 0&&(this.setState(G(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(t,e){const s=ot(this.state.data,t,this.options);return this.#n({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#n({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#i?.promise;return this.#i?.cancel(t),e?e.then(v).catch(v):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(t=>rt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===I||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>E(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!it(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#n({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(t&&this.setOptions(t),!this.options.queryFn){const r=this.observers.find(u=>u.options.queryFn);r&&this.setOptions(r.options)}const s=new AbortController,i=r=>{Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},n=()=>{const r=B(this.options,e),h=(()=>{const d={client:this.#r,queryKey:this.queryKey,meta:this.meta};return i(d),d})();return this.#o=!1,this.options.persister?this.options.persister(r,h,this):r(h)},o=(()=>{const r={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:n};return i(r),r})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#n({type:"fetch",meta:o.fetchOptions?.meta}),this.#i=W({initialPromise:e?.initialPromise,fn:o.fetchFn,onCancel:r=>{r instanceof K&&r.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(r,u)=>{this.#n({type:"failed",failureCount:r,error:u})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const r=await this.#i.start();if(r===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(r),this.#s.config.onSuccess?.(r,this),this.#s.config.onSettled?.(r,this.state.error,this),r}catch(r){if(r instanceof K){if(r.silent)return this.#i.promise;if(r.revert){if(this.state.data===void 0)throw r;return this.state.data}}throw this.#n({type:"error",error:r}),this.#s.config.onError?.(r,this),this.#s.config.onSettled?.(this.state.data,r,this),r}finally{this.scheduleGc()}}#n(t){const e=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...vt(s.data,this.options),fetchMeta:t.meta??null};case"success":const i={...s,...G(t.data,t.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=t.manual?i:void 0,i;case"error":const n=t.error;return{...s,error:n,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=e(this.state),y.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:t})})}};function vt(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:z(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function G(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function N(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,i=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}function V(t){return{onFetch:(e,s)=>{const i=e.options,n=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let r={pages:[],pageParams:[]},u=0;const h=async()=>{let d=!1;const l=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(e.signal.aborted?d=!0:e.signal.addEventListener("abort",()=>{d=!0}),e.signal)})},m=B(e.options,e.fetchOptions),b=async(f,c,p)=>{if(d)return Promise.reject();if(c==null&&f.pages.length)return Promise.resolve(f);const w=(()=>{const k={client:e.client,queryKey:e.queryKey,pageParam:c,direction:p?"backward":"forward",meta:e.options.meta};return l(k),k})(),O=await m(w),{maxPages:q}=e.options,S=p?ht:ut;return{pages:S(f.pages,O,q),pageParams:S(f.pageParams,c,q)}};if(n&&a.length){const f=n==="backward",c=f?gt:_,p={pages:a,pageParams:o},g=c(i,p);r=await b(p,g,f)}else{const f=t??a.length;do{const c=u===0?o[0]??i.initialPageParam:_(i,r);if(u>0&&c==null)break;r=await b(r,c),u++}while(u<f)}return r};e.options.persister?e.fetchFn=()=>e.options.persister?.(h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=h}}}function _(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function gt(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}var bt=class extends Z{#t;#e;#s;#r;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||wt(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#i({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=W({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#i({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#i({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const i=this.state.status==="pending",n=!this.#r.canStart();try{if(i)e();else{this.#i({type:"pending",variables:t,isPaused:n}),await this.#s.config.onMutate?.(t,this,s);const o=await this.options.onMutate?.(t,s);o!==this.state.context&&this.#i({type:"pending",context:o,variables:t,isPaused:n})}const a=await this.#r.start();return await this.#s.config.onSuccess?.(a,t,this.state.context,this,s),await this.options.onSuccess?.(a,t,this.state.context,s),await this.#s.config.onSettled?.(a,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(a,null,t,this.state.context,s),this.#i({type:"success",data:a}),a}catch(a){try{throw await this.#s.config.onError?.(a,t,this.state.context,this,s),await this.options.onError?.(a,t,this.state.context,s),await this.#s.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(void 0,a,t,this.state.context,s),a}finally{this.#i({type:"error",error:a})}}finally{this.#s.runNext(this)}}#i(t){const e=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),y.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function wt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ct=class extends T{constructor(t={}){super(),this.config=t,this.#t=new Set,this.#e=new Map,this.#s=0}#t;#e;#s;build(t,e,s){const i=new bt({client:t,mutationCache:this,mutationId:++this.#s,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#t.add(t);const e=A(t);if(typeof e=="string"){const s=this.#e.get(e);s?s.push(t):this.#e.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){const e=A(t);if(typeof e=="string"){const s=this.#e.get(e);if(s)if(s.length>1){const i=s.indexOf(t);i!==-1&&s.splice(i,1)}else s[0]===t&&this.#e.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=A(t);if(typeof e=="string"){const i=this.#e.get(e)?.find(n=>n.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=A(t);return typeof e=="string"?this.#e.get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){y.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){const e={exact:!0,...t};return this.getAll().find(s=>x(e,s))}findAll(t={}){return this.getAll().filter(e=>x(t,e))}notify(t){y.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return y.batch(()=>Promise.all(t.map(e=>e.continue().catch(v))))}};function A(t){return t.options.scope?.id}var Ot=class extends T{constructor(t={}){super(),this.config=t,this.#t=new Map}#t;build(t,e,s){const i=e.queryKey,n=e.queryHash??j(i,e);let a=this.get(n);return a||(a=new mt({client:t,queryKey:i,queryHash:n,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#t.get(t.queryHash);e&&(t.destroy(),e===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){y.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(s=>U(e,s))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(s=>U(t,s)):e}notify(t){y.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){y.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){y.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Pt=class{#t;#e;#s;#r;#i;#a;#o;#n;constructor(t={}){this.#t=t.queryCache||new Ot,this.#e=t.mutationCache||new Ct,this.#s=t.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=J.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#n=D.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#n?.(),this.#n=void 0)}isFetching(t){return this.#t.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#e.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#t.build(this,e),i=s.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(E(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#t.findAll(t).map(({queryKey:e,state:s})=>{const i=s.data;return[e,i]})}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),a=this.#t.get(i.queryHash)?.state.data,o=et(e,a);if(o!==void 0)return this.#t.build(this,i).setData(o,{...s,manual:!0})}setQueriesData(t,e,s){return y.batch(()=>this.#t.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state}removeQueries(t){const e=this.#t;y.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=this.#t;return y.batch(()=>(s.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=y.batch(()=>this.#t.findAll(t).map(n=>n.cancel(s)));return Promise.all(i).then(v).catch(v)}invalidateQueries(t,e={}){return y.batch(()=>(this.#t.findAll(t).forEach(s=>{s.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=y.batch(()=>this.#t.findAll(t).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,s);return s.throwOnError||(a=a.catch(v)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(v)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=this.#t.build(this,e);return s.isStaleByTime(E(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(v).catch(v)}fetchInfiniteQuery(t){return t.behavior=V(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(v).catch(v)}ensureInfiniteQueryData(t){return t.behavior=V(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return D.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#s}setDefaultOptions(t){this.#s=t}setQueryDefaults(t,e){this.#r.set(P(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#r.values()],s={};return e.forEach(i=>{F(t,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(t,e){this.#i.set(P(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#i.values()],s={};return e.forEach(i=>{F(t,i.mutationKey)&&Object.assign(s,i.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#s.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=j(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===I&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#s.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}};class C{constructor(e={}){this.availableDatasets=[],this.apiUrl=e.apiUrl||"https://api.luzmo.com",this.apiVersion=e.apiVersion||"0.1.0",this.authKey=e.authKey||"",this.authToken=e.authToken||"",this.queryClient=new Pt({defaultOptions:{queries:{staleTime:e.staleTime||300*1e3,gcTime:e.gcTime||600*1e3,retry:e.retry||3,retryDelay:e.retryDelay||(s=>Math.min(1e3*2**s,3e4))}}}),this.initNetworkListeners()}configure(e={}){if(e.apiVersion&&(this.apiVersion=e.apiVersion),e.apiUrl&&(this.apiUrl=e.apiUrl),e.authKey&&(this.authKey=e.authKey),e.authToken&&(this.authToken=e.authToken),e.staleTime||e.gcTime||e.retry){const s={};e.staleTime&&(s.staleTime=e.staleTime),e.gcTime&&(s.gcTime=e.gcTime),e.retry&&(s.retry=e.retry),this.queryClient.setDefaultOptions({queries:{...this.queryClient.getDefaultOptions().queries,...s}})}}initNetworkListeners(){typeof window<"u"&&window.addEventListener("online",()=>{console.warn("Network connection restored, refreshing data..."),this.refreshAll()})}getHeaders(e={}){return{"Content-Type":"application/json",...e}}async fetchApi(e,s,i={}){const n=`${this.apiUrl}/${this.apiVersion}${e}`,o={method:i.method||"POST",headers:this.getHeaders(i.headers),mode:"cors",...i};s!==void 0&&(s.key=this.authKey,s.token=this.authToken,o.body=JSON.stringify(s));try{const r=await fetch(n,o);if(!r.ok){const u=await r.json().catch(()=>null);throw r.status===401||r.status===403?new Error("Authentication failed. Please check your API token."):r.status===404?new Error(`Resource not found: ${e}`):r.status===429?new Error("Rate limit exceeded. Please try again later."):new Error(u?.message||`API request failed with status ${r.status}`)}return await r.json()}catch(r){throw console.error(`API request to ${e} failed:`,r),r instanceof Error&&(r.endpoint=e,r.timestamp=new Date().toISOString()),r}}async fetchAllDatasets(e={}){const s=e.offset||0,i=e.limit||50,n=["datasets",s,i];return await this.queryClient.fetchQuery({queryKey:n,queryFn:async()=>{const a={action:"get",version:this.apiVersion,find:{where:{type:"dataset"},limit:i,offset:s}},o=await this.fetchApi("/securable",a);return{data:o?.rows??[],pagination:{offset:s,limit:i,total:o?.count??0,pages:Math.ceil((o?.count??0)/i)}}}})}async searchDatasets(e,s){if(!e)return{data:[]};const i=["datasets","search",e,s];return await this.queryClient.fetchQuery({queryKey:i,queryFn:async()=>{const n={action:"get",version:this.apiVersion,find:{where:{type:"dataset"}}};e?.length>0&&(n.find.search={match_types:["name"],keyphrase:e}),s?.offset&&(n.find.offset=s?.offset),s?.limit&&(n.find.limit=s?.limit);const a=await this.fetchApi("/securable",n),o={data:a?.rows??[]};return s?.limit&&(o.pagination={offset:s?.offset??0,limit:s?.limit,total:a?.count??0,pages:Math.ceil((a?.count??0)/s?.limit)}),o}})}async fetchDatasetsWithColumnsAndFormulas(e){if(!e||e.length===0)throw new Error("At least one dataset ID is required");const s=["datasets",e,this.authKey,this.authToken];return await this.queryClient.fetchQuery({queryKey:s,queryFn:async()=>{const i={action:"get",version:this.apiVersion,find:{where:{type:"dataset",id:{in:e}},attributes:["name","id","description"],include:[{model:"Column",attributes:["id","name","description","type","subtype","format","hidden","lowestLevel","expression","duration_levels","duration_format"],separate:!0,order:[["order","asc"]],include:[{model:"Column",attributes:["id","securable_id","hierarchy_enabled","currency_id"],as:"Joins"},{model:"HierarchyLevel",attributes:["id","level","name"],as:"HierarchyLevels"},{model:"Currency",attributes:["id","name","symbol"],as:"Currency"}]},{model:"Formula",attributes:["id","name","description","type","subtype","format","hidden","lowestLevel","expression","duration_levels","duration_format"],include:[{model:"Currency",attributes:["id","name","symbol"],as:"Currency"}]}]}};return(await this.fetchApi("/securable",i))?.rows??[]}})}async fetchData(e){if(!e)throw new Error("Query is required");const s=["data",e];return await this.queryClient.fetchQuery({queryKey:s,queryFn:async()=>{const i={action:"get",version:this.apiVersion,find:{queries:[e]}},n=await this.fetchApi("/data",i);return{data:n?.data||[],performance:n?.performance||{}}}})}refreshAll(){this.queryClient.refetchQueries()}invalidateDatasetData(e){e?(this.queryClient.invalidateQueries({queryKey:["dataset",e]}),this.queryClient.invalidateQueries({queryKey:["columns",e]})):this.queryClient.invalidateQueries({queryKey:["datasets"]})}invalidateAll(){this.queryClient.clear()}static getInstance(e={}){return C.instance?Object.keys(e).length>0&&C.instance.configure(e):C.instance=new C(e),C.instance}async fetchDatasetsRecursive(e){if(!e||e.length===0)throw new Error("At least one dataset ID is required");const s=[...new Set(e)],i=new Set,n=new Map,a=o=>{o&&!i.has(o)&&!s.includes(o)&&s.push(o)};for(;s.length>0;){const o=[];for(;s.length>0&&o.length<50;){const r=s.shift();i.has(r)||o.push(r)}if(o.length!==0)try{(await this.fetchDatasetsWithColumnsAndFormulas(o)).forEach(u=>{const h=this.postProcessDatasetMetadata(u);i.add(h.id),this.queryClient.setQueryData(["dataset",h.id],h),(h.outgoingJoins??[]).map(l=>l.securable_id).filter(l=>!!l&&l!==h.id).forEach(l=>{a(l)}),n.set(h.id,h),this.availableDatasets.some(l=>l.id===h.id)||this.availableDatasets.push({id:h.id,name:h.name,columns:h.columns})})}catch(r){console.error("Error fetching datasets recursively:",r)}}return[...n.values()]}postProcessDatasetMetadata(e){const s=[],i=(e.columns??[]).map(n=>{const a=n.joins??(Array.isArray(n.joins)?n.joins:[]);Array.isArray(a)&&a.length>0&&s.push(...a);const{joins:o,...r}=n;return{...r,joins:a}});return{...e,columns:i,formulas:e.formulas??[],outgoingJoins:s,dateLoaded:new Date}}getAvailableDatasets(){return this.availableDatasets}getLinkedDatasetsIds(e){const s=this.queryClient.getQueryData(["dataset",e]);return s?(s.outgoingJoins??[]).map(i=>i.securable_id).filter(i=>!!i&&i!==e):[]}}const Ft=C.getInstance();exports.dataBroker=Ft;
|