@luzmo/analytics-components-kit 1.1.1 → 1.3.0
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/README.md +10 -2
- package/angular/components/interactive-viz-item.ts +41 -4
- package/angular/components/item-option-color-picker.ts +30 -3
- package/angular/components/item-option-color-range.ts +30 -3
- package/angular/components/item-option-guidelines.ts +31 -4
- package/angular/components/item-option-panel.ts +41 -4
- package/angular/components/item-option-slider.ts +41 -4
- package/angular/components/item-option.ts +41 -4
- package/angular/esm/components/interactive-viz-item.d.ts +14 -5
- package/angular/esm/components/interactive-viz-item.js +30 -4
- package/angular/esm/components/item-option-color-picker.d.ts +11 -4
- package/angular/esm/components/item-option-color-picker.js +23 -3
- package/angular/esm/components/item-option-color-range.d.ts +11 -4
- package/angular/esm/components/item-option-color-range.js +23 -3
- package/angular/esm/components/item-option-guidelines.d.ts +11 -4
- package/angular/esm/components/item-option-guidelines.js +24 -4
- package/angular/esm/components/item-option-panel.d.ts +13 -4
- package/angular/esm/components/item-option-panel.js +30 -4
- package/angular/esm/components/item-option-slider.d.ts +13 -4
- package/angular/esm/components/item-option-slider.js +30 -4
- package/angular/esm/components/item-option.d.ts +13 -4
- package/angular/esm/components/item-option.js +30 -4
- package/angular/package.json +2 -2
- package/angular/utils/option-interaction/index.d.ts +2 -0
- package/angular/utils/option-interaction/is-same-option-value.d.ts +10 -0
- package/angular/utils/option-interaction/option-interaction-controller.d.ts +54 -0
- package/angular/utils/option-interaction/tests/option-interaction-controller.test.d.ts +1 -0
- package/angular/utils/store/base-store.d.ts +9 -0
- package/angular/utils/store/tests/store-base-history.test.d.ts +1 -0
- package/components/add-to-dashboard/index.cjs +1 -1
- package/components/add-to-dashboard/index.js +1 -1
- package/components/{add-to-dashboard-NwsCPIlg.cjs → add-to-dashboard-CzIuDtAq.cjs} +1 -1
- package/components/{add-to-dashboard-NcVHlqrc.js → add-to-dashboard-DGC0_hRB.js} +1 -1
- package/components/{base-store-SgJsjLap.cjs → base-store-D3whjduR.cjs} +1 -1
- package/components/{base-store-g0dt7ru7.js → base-store-DQYj8A1W.js} +3 -0
- package/components/{chart-helpers-Dng_LGfq.js → chart-helpers-Cbl3sRra.js} +3 -2
- package/components/chart-helpers-fMnqHRzC.cjs +20 -0
- package/components/{choropleth-map-options.config-D9-u-NwX.js → choropleth-map-options.config-Blu0Z2tR.js} +1 -1
- package/components/{choropleth-map-options.config-CXDGMiSJ.cjs → choropleth-map-options.config-DwFJ00CS.cjs} +1 -1
- package/components/{color-range-utils-CUCTsRXM.js → color-range-utils-CgwRGUkg.js} +18 -18
- package/components/{color-range-utils-BCFQAeY1.cjs → color-range-utils-D8uygiMe.cjs} +1 -1
- package/components/{heat-map-options.config-ChZeslEy.js → heat-map-options.config-BQkhkLPb.js} +16 -16
- package/components/{heat-map-options.config-DiNa8NnG.cjs → heat-map-options.config-DjQkB039.cjs} +1 -1
- package/components/{heat-table-options.config-BPCszrFn.js → heat-table-options.config-CMWWTeyo.js} +1 -1
- package/components/{heat-table-options.config-BvE6coaV.cjs → heat-table-options.config-D21xtaIk.cjs} +1 -1
- package/components/index.cjs +1 -1
- package/components/index.js +9 -9
- package/components/interactive-viz-item/index.cjs +1 -1
- package/components/interactive-viz-item/index.d.ts +2 -1
- package/components/interactive-viz-item/index.js +2 -2
- package/components/interactive-viz-item/interactive-viz-item.d.ts +34 -2
- package/components/interactive-viz-item/types.d.ts +17 -0
- package/components/{interactive-viz-item-CofUkpP6.js → interactive-viz-item-BKLOmawA.js} +166 -100
- package/components/interactive-viz-item-ojdH1uk0.cjs +268 -0
- package/components/is-same-option-value-B2oyvEqT.js +42 -0
- package/components/is-same-option-value-Cf6BQcs7.cjs +20 -0
- package/components/item-option/helpers/control-markup.d.ts +7 -0
- package/components/item-option/index.cjs +1 -1
- package/components/item-option/index.d.ts +1 -1
- package/components/item-option/index.js +1 -1
- package/components/item-option/item-option.d.ts +23 -2
- package/components/item-option/types.d.ts +19 -0
- package/components/{item-option-Cgx3c08E.js → item-option-DKLRnicU.js} +182 -136
- package/components/item-option-DpLdospV.cjs +285 -0
- package/components/item-option-color-picker/index.cjs +1 -1
- package/components/item-option-color-picker/index.d.ts +1 -1
- package/components/item-option-color-picker/index.js +1 -1
- package/components/item-option-color-picker/item-option-color-picker.d.ts +17 -1
- package/components/item-option-color-picker-CNW7GsCO.cjs +37 -0
- package/components/item-option-color-picker-DDvsY7hV.js +129 -0
- package/components/item-option-color-range/index.cjs +1 -1
- package/components/item-option-color-range/index.d.ts +1 -1
- package/components/item-option-color-range/index.js +1 -1
- package/components/item-option-color-range/item-option-color-range.d.ts +20 -1
- package/components/item-option-color-range-BqSbuSZh.cjs +101 -0
- package/components/item-option-color-range-FQduqtz3.js +265 -0
- package/components/item-option-guidelines/index.cjs +1 -1
- package/components/item-option-guidelines/index.d.ts +1 -1
- package/components/item-option-guidelines/index.js +1 -1
- package/components/item-option-guidelines/item-option-guidelines.d.ts +16 -1
- package/components/{item-option-guidelines-DNJevmVD.js → item-option-guidelines-k5DwMONo.js} +132 -104
- package/components/item-option-guidelines-z9BsGR-l.cjs +138 -0
- package/components/item-option-panel/index.cjs +1 -1
- package/components/item-option-panel/index.d.ts +1 -1
- package/components/item-option-panel/index.js +1 -1
- package/components/item-option-panel/item-option-panel.d.ts +12 -1
- package/components/{item-option-panel-DHdnisRb.js → item-option-panel-BLXWIbjX.js} +18 -6
- package/components/{item-option-panel-Dl3aYBNe.cjs → item-option-panel-CU51qvgV.cjs} +6 -4
- package/components/item-option-slider/index.cjs +1 -1
- package/components/item-option-slider/index.d.ts +1 -1
- package/components/item-option-slider/index.js +1 -1
- package/components/item-option-slider/item-option-slider.d.ts +15 -2
- package/components/item-option-slider-BKtJfL3D.js +119 -0
- package/components/item-option-slider-Kz2eFBql.cjs +36 -0
- package/components/item-options-configs.cjs +1 -1
- package/components/item-options-configs.js +5 -5
- package/components/option-interaction-controller-B8S1N_Oo.js +90 -0
- package/components/option-interaction-controller-D0U-CTpZ.cjs +20 -0
- package/components/{route-map-options.config-DdCaVtIF.cjs → route-map-options.config-DER6ENky.cjs} +1 -1
- package/components/{route-map-options.config-B7vT6KG_.js → route-map-options.config-DTcS47fW.js} +1 -1
- package/components/{spike-map-options.config-DkmRZ1JZ.js → spike-map-options.config-CPYfKWoF.js} +1 -1
- package/components/{spike-map-options.config-B3hDh2qU.cjs → spike-map-options.config-DeF1Whq5.cjs} +1 -1
- package/components/utils/store.cjs +1 -1
- package/components/utils/store.js +1 -1
- package/custom-elements.json +418 -104
- package/package.json +2 -2
- package/react/components/interactive-viz-item.component.ts +11 -2
- package/react/components/item-option-color-picker.component.ts +9 -3
- package/react/components/item-option-color-range.component.ts +9 -3
- package/react/components/item-option-guidelines.component.ts +9 -3
- package/react/components/item-option-panel.component.ts +12 -3
- package/react/components/item-option-slider.component.ts +12 -3
- package/react/components/item-option.component.ts +12 -3
- package/react/esm/components/interactive-viz-item.component.d.ts +8 -2
- package/react/esm/components/interactive-viz-item.component.js +7 -1
- package/react/esm/components/item-option-color-picker.component.d.ts +6 -2
- package/react/esm/components/item-option-color-picker.component.js +6 -2
- package/react/esm/components/item-option-color-range.component.d.ts +6 -2
- package/react/esm/components/item-option-color-range.component.js +6 -2
- package/react/esm/components/item-option-guidelines.component.d.ts +6 -2
- package/react/esm/components/item-option-guidelines.component.js +6 -2
- package/react/esm/components/item-option-panel.component.d.ts +8 -2
- package/react/esm/components/item-option-panel.component.js +8 -2
- package/react/esm/components/item-option-slider.component.d.ts +8 -2
- package/react/esm/components/item-option-slider.component.js +8 -2
- package/react/esm/components/item-option.component.d.ts +8 -2
- package/react/esm/components/item-option.component.js +8 -2
- package/react/luzmo-stub.d.ts +7 -0
- package/react/package.json +2 -2
- package/standalone/add-to-dashboard.js +40 -40
- package/standalone/chunks/{chart-helpers-DsIGsaDc.js → chart-helpers-CR-EUEPf.js} +2 -2
- package/standalone/chunks/{choropleth-map-options.config-Cs4Kvr9h.js → choropleth-map-options.config-CDMjKnJD.js} +1 -1
- package/standalone/chunks/{color-range-utils-CKDpd3gZ.js → color-range-utils-BVyHBRiq.js} +1 -1
- package/standalone/chunks/de-BkB0q1Eg.js +2 -0
- package/standalone/chunks/display-settings-binning-BeLLxd3i.js +38 -0
- package/standalone/chunks/display-settings-datetime-BkeiKIVV.js +199 -0
- package/standalone/chunks/display-settings-grand-totals-BuhpQKJ6.js +26 -0
- package/standalone/chunks/display-settings-numeric-m30IYI7I.js +172 -0
- package/standalone/chunks/display-settings-period-over-period-CqDlOSRn.js +209 -0
- package/standalone/chunks/embed-Bv1ps-EM.js +260 -0
- package/standalone/chunks/en-63f7j4v7.js +2 -0
- package/standalone/chunks/en-GB-QAmXQf8W.js +2 -0
- package/standalone/chunks/en-US-63f7j4v7.js +2 -0
- package/standalone/chunks/es-Bo0jStZn.js +2 -0
- package/standalone/chunks/{filters-DKgJcQGP.js → filters-CxgBXUF1.js} +61 -61
- package/standalone/chunks/{formula-codemirror-BbyvNEVD.js → formula-codemirror-Cq94j3-f.js} +17 -17
- package/standalone/chunks/fr-Co_qVhhV.js +2 -0
- package/standalone/chunks/{heat-map-options.config-DF5kjOOe.js → heat-map-options.config-DDQMD38W.js} +1 -1
- package/standalone/chunks/{heat-table-options.config-DaePzfHG.js → heat-table-options.config-B4K0Ygug.js} +1 -1
- package/standalone/chunks/is-same-option-value-7kXNF4st.js +2 -0
- package/standalone/chunks/item-option-action-button-group-BoyqF9vt.js +35 -0
- package/standalone/chunks/item-option-base-CBcDT8MX.js +38 -0
- package/standalone/chunks/item-option-color-palette-picker-C9PGAv4V.js +22 -0
- package/standalone/chunks/item-option-color-picker-D4fVJlqF.js +19 -0
- package/standalone/chunks/item-option-color-range-BlAdTguE.js +83 -0
- package/standalone/chunks/item-option-guidelines-DMsYsHDu.js +120 -0
- package/standalone/chunks/{item-option-multi-language-field-DPPpN2qg.js → item-option-multi-language-field-NUbm1drg.js} +1 -1
- package/standalone/chunks/{item-option-number-field-CkqJjInE.js → item-option-number-field-DRp7kbHL.js} +1 -1
- package/standalone/chunks/item-option-panel-cXrRclzM.js +316 -0
- package/standalone/chunks/{item-option-picker-BnwQPT9A.js → item-option-picker-Ba09L4Cs.js} +1 -1
- package/standalone/chunks/item-option-position-picker-GEGTnhjw.js +14 -0
- package/standalone/chunks/item-option-positions-number-field-n44s1k5v.js +31 -0
- package/standalone/chunks/{item-option-radio-button-group-BkymJq3E.js → item-option-radio-button-group-3s_b1NvR.js} +1 -1
- package/standalone/chunks/item-option-slider-DtY65Gxk.js +18 -0
- package/standalone/chunks/item-option-switch-4sJaI0mx.js +12 -0
- package/standalone/chunks/{item-option-text-field-D7bkuhsv.js → item-option-text-field-Bt6Lj6kh.js} +1 -1
- package/standalone/chunks/{item-slot-picker-panel-D4BMxGs9.js → item-slot-picker-panel-BOSVFBIy.js} +43 -43
- package/standalone/chunks/load-data-fields-for-datasets-CDlut-6S.js +25 -0
- package/standalone/chunks/localized-decorator-DosMCCQo.js +2 -0
- package/standalone/chunks/{version-BW4Ixl63.js → localized-mixin-BWJj88bd.js} +1 -1
- package/standalone/chunks/nl-CQz2jrVx.js +2 -0
- package/standalone/chunks/option-interaction-controller-BuwRr21c.js +2 -0
- package/standalone/chunks/{route-map-options.config-D7FfzIiU.js → route-map-options.config-CGBkHnhM.js} +1 -1
- package/standalone/chunks/{spike-map-options.config-CZiFzDm9.js → spike-map-options.config-CSenlJ_F.js} +1 -1
- package/standalone/interactive-viz-item.js +62 -55
- package/standalone/item-grid.js +10 -10
- package/standalone/manifest.json +44 -43
- package/utils/option-interaction/index.d.ts +2 -0
- package/utils/option-interaction/is-same-option-value.d.ts +10 -0
- package/utils/option-interaction/option-interaction-controller.d.ts +54 -0
- package/utils/option-interaction/tests/option-interaction-controller.test.d.ts +1 -0
- package/utils/store/base-store.d.ts +9 -0
- package/utils/store/tests/store-base-history.test.d.ts +1 -0
- package/components/chart-helpers-ufZ6VbXs.cjs +0 -20
- package/components/interactive-viz-item-D537mo3l.cjs +0 -261
- package/components/item-option-CqGDFdPj.cjs +0 -269
- package/components/item-option-color-picker-BpPoOO2b.cjs +0 -34
- package/components/item-option-color-picker-cojuCvu5.js +0 -84
- package/components/item-option-color-range-CMBEx1fi.cjs +0 -98
- package/components/item-option-color-range-Dt7Bv06p.js +0 -217
- package/components/item-option-guidelines-Beh0DlG0.cjs +0 -135
- package/components/item-option-slider-Bo5vs6nr.js +0 -89
- package/components/item-option-slider-CyWKWr5D.cjs +0 -33
- package/standalone/chunks/color-7IgCGZKz.js +0 -2
- package/standalone/chunks/de-mdZT2W1G.js +0 -2
- package/standalone/chunks/display-settings-binning-Byffw2Kl.js +0 -38
- package/standalone/chunks/display-settings-datetime-CD52d6Sv.js +0 -199
- package/standalone/chunks/display-settings-grand-totals-Cky99LX9.js +0 -26
- package/standalone/chunks/display-settings-numeric-C9ea7Tgc.js +0 -172
- package/standalone/chunks/display-settings-period-over-period-BLSGumkD.js +0 -209
- package/standalone/chunks/embed-BfHBKhIe.js +0 -231
- package/standalone/chunks/en-CSboh17P.js +0 -2
- package/standalone/chunks/en-GB-HoXKQBOY.js +0 -2
- package/standalone/chunks/en-US-CSboh17P.js +0 -2
- package/standalone/chunks/es-Di5D8JFd.js +0 -2
- package/standalone/chunks/fr-DZku7iB9.js +0 -2
- package/standalone/chunks/item-option-action-button-group-BEAwPHVw.js +0 -35
- package/standalone/chunks/item-option-base-CRUxNhJQ.js +0 -38
- package/standalone/chunks/item-option-color-palette-picker-CBz61iZb.js +0 -22
- package/standalone/chunks/item-option-color-picker-Cr7ujQNO.js +0 -16
- package/standalone/chunks/item-option-color-range-CyJd1LZ_.js +0 -80
- package/standalone/chunks/item-option-guidelines-6NjpzS6b.js +0 -117
- package/standalone/chunks/item-option-panel-VxvWU56c.js +0 -298
- package/standalone/chunks/item-option-position-picker-Bkc4JvJX.js +0 -14
- package/standalone/chunks/item-option-positions-number-field-Dr_315TE.js +0 -31
- package/standalone/chunks/item-option-slider-l9wt7_0c.js +0 -15
- package/standalone/chunks/item-option-switch-DeihDHhM.js +0 -12
- package/standalone/chunks/load-data-fields-for-datasets-ClctSj6y.js +0 -25
- package/standalone/chunks/localized-decorator-DJVBmJVH.js +0 -2
- package/standalone/chunks/nl-CViTevL3.js +0 -2
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2026 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Luzmo web components (“Luzmo Web Components”)
|
|
6
|
+
* must be used according to the Luzmo Terms of Service.
|
|
7
|
+
* This license allows users with a current active Luzmo account
|
|
8
|
+
* to use the Luzmo Web Components. This license terminates
|
|
9
|
+
* automatically if a user no longer has an active Luzmo account.
|
|
10
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
11
|
+
*
|
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
+
* SOFTWARE.
|
|
19
|
+
* */
|
|
20
|
+
require("./tokens-BWMfo_w4.cjs");const e=require("./base-CGDNY_7v.cjs"),t=require("./decorate-DCJt-2rt.cjs"),n=require("./localized-mixin-EoNvtTBG.cjs"),r=require("./is-same-option-value-Cf6BQcs7.cjs"),i=require("./chart-helpers-fMnqHRzC.cjs"),a=require("./create-lazy-loader-DYPgQh0L.cjs");let o=require("@luzmo/icons");require("@luzmo/lucero/action-button"),require("@luzmo/lucero/icon"),require("@luzmo/lucero/overlay"),require("@luzmo/lucero/popover");let s=require("lit"),c=require("lit/decorators.js"),l=require("@lit/localize");require("@luzmo/embed"),require("@luzmo/lucero/action-group"),require("@luzmo/lucero/field-label"),require("@luzmo/lucero/number-field"),require("@luzmo/lucero/picker"),require("@luzmo/lucero/progress-circle"),require("@luzmo/lucero/tabs");var u=`:host{box-sizing:border-box;display:block;container-type:inline-size}.answer{width:100%;display:block}.chart-actions-bar{justify-content:space-between;align-items:flex-start;gap:var(--luzmo-interactive-viz-item-actions-gap,var(--interactive-viz-item-actions-gap));padding-block:var(--luzmo-interactive-viz-item-actions-padding-block,var(--interactive-viz-item-actions-padding-block));flex-wrap:nowrap;margin-block-start:var(--luzmo-interactive-viz-item-actions-margin-block-start,var(--interactive-viz-item-actions-margin-block-start));display:flex}.chart-actions-primary{gap:var(--luzmo-interactive-viz-item-actions-gap,var(--interactive-viz-item-actions-gap));flex-wrap:wrap;flex:1;align-items:center;min-width:0;display:flex}.ranking-content{gap:var(--luzmo-spacing-3);padding:var(--luzmo-spacing-3);flex-direction:column;display:flex}.ranking-row{gap:var(--luzmo-spacing-3);align-items:center;display:flex}.ranking-number{width:4rem}.icon-flipped{transform:scaleY(-1)}.chart-container{border-radius:var(--luzmo-interactive-viz-item-chart-border-radius,var(--interactive-viz-item-chart-border-radius));height:var(--luzmo-interactive-viz-item-chart-height,var(--interactive-viz-item-chart-height));overflow:hidden}.chart-container luzmo-embed-viz-item{width:100%;height:100%;display:block}.feedback-row{padding-block:var(--luzmo-interactive-viz-item-feedback-padding-block,var(--interactive-viz-item-feedback-padding-block));justify-content:space-between;align-items:center;display:flex}.rating-btn-positive{--luzmo-action-button-content-color-default-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-hover-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-down-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-focus-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-background-color-default-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-hover-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-down-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-focus-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background))}.rating-btn-negative{--luzmo-action-button-content-color-default-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-hover-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-down-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-focus-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-background-color-default-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-hover-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-down-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-focus-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background))}.config-toggle{--luzmo-action-button-border-radius:32px;margin-inline-start:auto}.sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.config-panel{border:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));border-radius:var(--luzmo-interactive-viz-item-config-panel-border-radius,var(--interactive-viz-item-config-panel-border-radius));padding:var(--luzmo-interactive-viz-item-config-panel-padding,var(--interactive-viz-item-config-panel-padding));background:var(--luzmo-interactive-viz-item-config-panel-background,var(--interactive-viz-item-config-panel-background));margin-block-start:var(--luzmo-spacing-2)}.config-panel luzmo-tab-panel[selected]{padding-block-start:var(--luzmo-spacing-4);display:block}.config-panel luzmo-item-option-panel,.config-panel luzmo-item-slot-picker-panel,.config-panel luzmo-filters{width:100%;max-height:15rem;scrollbar-width:thin;scrollbar-color:var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color)) transparent;padding-inline-end:var(--luzmo-spacing-3);overflow-y:auto}.edit-grid{min-height:12.5rem;display:flex}.edit-column{gap:var(--luzmo-spacing-3);flex-direction:column;display:flex}.edit-column:first-child{flex-shrink:0;max-width:15rem}.edit-column-filters{border-inline-start:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));flex:1;min-width:18.75rem;padding-inline-start:var(--luzmo-spacing-5)}@container (width<=520px){.edit-grid{flex-direction:column}.edit-column,.edit-column:first-child{width:100%;min-width:0;max-width:100%}.edit-column-filters{border-inline-start:none;border-block-start:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));min-width:0;margin-block-start:var(--luzmo-spacing-3);padding-block-start:var(--luzmo-spacing-4);padding-inline-start:0}}@container (width<=768px){.chart-container{height:calc(var(--luzmo-interactive-viz-item-chart-height,var(--interactive-viz-item-chart-height)) - var(--luzmo-interactive-viz-item-chart-narrow-offset,var(--interactive-viz-item-chart-narrow-offset)))}}:host{--interactive-viz-item-actions-gap:var(--luzmo-spacing-3);--interactive-viz-item-actions-padding-block:var(--luzmo-spacing-3);--interactive-viz-item-actions-margin-block-start:var(--luzmo-spacing-5);--interactive-viz-item-chart-height:20rem;--interactive-viz-item-chart-narrow-offset:2.5rem;--interactive-viz-item-chart-border-radius:var(--luzmo-border-radius);--interactive-viz-item-feedback-padding-block:var(--luzmo-spacing-4);--interactive-viz-item-config-panel-padding:var(--luzmo-spacing-5);--interactive-viz-item-config-panel-border-color:var(--luzmo-border-color);--interactive-viz-item-config-panel-border-radius:var(--luzmo-border-radius);--interactive-viz-item-config-panel-background:var(--luzmo-background-color);--interactive-viz-item-rating-positive-color:var(--luzmo-positive-color,#12855a);--interactive-viz-item-rating-negative-color:var(--luzmo-negative-color,#ca221c);--interactive-viz-item-rating-selected-background:var(--luzmo-background-color-focus,#0000000f)}:host([size=s]){--interactive-viz-item-chart-height:17.5rem}:host([size=l]){--interactive-viz-item-chart-height:22rem}:host([size=xl]){--interactive-viz-item-chart-height:24rem}`,d=a.t(()=>Promise.resolve().then(()=>require("./add-to-dashboard/index.cjs"))).load,f=[`luzmo-filters`,`luzmo-item-option-panel`,`luzmo-item-slot-picker-panel`],p=a.t(()=>Promise.all([Promise.resolve().then(()=>require("./filters/index.cjs")),Promise.resolve().then(()=>require("./item-option-panel/index.cjs")),Promise.resolve().then(()=>require("./item-slot-picker-panel/index.cjs"))])),m=p.load,h=()=>p.isLoaded()||f.every(e=>customElements.get(e)!==void 0),g=0,_={},v=(e,t)=>t!==null&&r.n(JSON.parse(JSON.stringify(e)),JSON.parse(JSON.stringify(t))),y=class extends n.t(e.n(e.i,{validSizes:Object.values(e.t)})){constructor(...e){super(...e),this.chart=null,this.feedback=null,this.messageId=``,this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.appServer=`https://app.luzmo.com`,this.contentLanguage=``,this.hideActions=!1,this.hideFeedback=!1,this.hideConfigPanel=!1,this.addToDashboard=!1,this.dashboardActions=null,this.controlled=!1,this.liveInteractions=!1,this._configPanelOpen=!1,this._configPanelPending=!1,this._configPanelLoadFailed=!1,this._rankingTriggerId=`interactive-viz-item-ranking-${++g}`,this._interactionGeneration=0,this._openInteractions=new Map,this._ownCharts=[],this._handleSlotsChanged=e=>{this.chart&&this._emitChart({...this.chart,slots:e.detail.slotsContents})},this._handleFiltersChanged=e=>{this.chart&&this._emitChart({...this.chart,filters:e.detail.filters})},this._handleOptionsChanged=e=>{if(!this.chart)return;let{options:t,interaction:n}=e.detail;if(!t)return;if(n){let e=this._openInteractions.get(n.id);if(!e||!this._isCurrentContext(e)){e?.generation===this._interactionGeneration&&this._invalidateInteractions();return}}let r=this.chart.options.theme??{};this._emitChart({...this.chart,options:{...t,theme:r}},n)},this._handleInteractionStart=e=>{if(!this.chart)return;let t={chart:this.chart,generation:this._interactionGeneration,auth:this._auth};this._openInteractions.set(e.detail.id,t),this._dispatchInteraction(e,t)},this._handleInteractionClosed=e=>{let t=this._openInteractions.get(e.detail.id);this._openInteractions.delete(e.detail.id),this._openInteractions.size===0&&(this._ownCharts=this._ownCharts.slice(-1)),t&&this._dispatchInteraction(e,t)}}static get styles(){return[(0,s.unsafeCSS)(u)]}get _effectiveContentLanguage(){return this.contentLanguage||this.language}_dispatch(e,t){let n=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});this.dispatchEvent(n)}get _chartActions(){return this.chart?i.n(i.o(this.chart)):[]}get _rating(){return this.feedback?.rating??0}get _canShowConfigPanel(){return!this.chart||this.hideConfigPanel?!1:!this.chart.inlineData||i.i(i.o(this.chart).slots).length>0}async _toggleConfigPanel(){if(this._configPanelLoadFailed=!1,this._configPanelOpen)this.endInteraction(),this._configPanelOpen=!1;else if(!this._configPanelPending){if(!h()){this._configPanelPending=!0;try{await m()}catch(e){console.warn(`Failed to load the chart configuration panel:`,e),this._configPanelLoadFailed=!0;return}finally{this._configPanelPending=!1}}this.isConnected&&this._canShowConfigPanel&&(this._configPanelOpen=!0)}}endInteraction(){this.renderRoot?.querySelector(`luzmo-item-option-panel`)?.endInteraction?.()}willUpdate(e){super.willUpdate(e),this._openInteractions.size>0&&this._invalidatesInteractions(e)&&this._invalidateInteractions(),e.has(`addToDashboard`)&&this.addToDashboard&&d().catch(e=>console.warn(`Failed to load add to dashboard:`,e))}_emitOptions(e){!this.controlled&&this.chart&&(this.chart={...this.chart,options:e}),this._dispatch(`luzmo-chart-options-changed`,{options:e})}_invalidatesInteractions(e){return e.has(`authKey`)||e.has(`authToken`)||e.has(`apiUrl`)||e.has(`hideConfigPanel`)?!0:e.has(`chart`)&&[...this._openInteractions.values()].some(e=>!this._isCurrentChart(e))}_invalidateInteractions(){this._interactionGeneration++,this.endInteraction()}get _auth(){return[this.authKey,this.authToken,this.apiUrl]}_isCurrentChart(e){let t=this.chart;return t===e.chart||this._ownCharts.some(e=>e===t)||[...this._ownCharts].reverse().some(e=>v(e,t))||v(e.chart,t)}_isCurrentContext(e){return e.generation===this._interactionGeneration&&e.auth.every((e,t)=>e===this._auth[t])&&this._isCurrentChart(e)}_emitChart(e,t){this._ownCharts=this._openInteractions.size>0?[...this._ownCharts,e]:[e],this.controlled||(this.chart=e),this._dispatch(`luzmo-chart-changed`,t?{chart:e,interaction:t}:{chart:e})}_handleDropdownChange(e,t){if(!this.chart)return;t.stopPropagation();let n=t.detail,r=typeof n==`string`?n:n?.value??t.target?.value;if(!r)return;let a=i.t({...i.o(this.chart),options:this.chart.options},{type:`chartAction`,actionType:e.mutationType,key:r});this._emitOptions(a.options)}_currentRanking(e){return e.ranking??{active:!1,number:5,direction:i.c.Top}}_currentSort(e){return e.sort??{direction:i.u.Desc,by:i.l.Measure}}_emitRankAndSort(e,t){this.chart&&this._emitOptions({...this.chart.options,ranking:e,sort:t})}_renderOptionDropdown(e){let t=e.values??[],n=e.currentValue||t[0]?.key||``;return s.html`
|
|
21
|
+
<luzmo-picker
|
|
22
|
+
size=${this.size}
|
|
23
|
+
variant="highlight"
|
|
24
|
+
value=${n}
|
|
25
|
+
@change=${t=>this._handleDropdownChange(e,t)}
|
|
26
|
+
>
|
|
27
|
+
${t.map(e=>s.html`<luzmo-menu-item value=${e.key}>${e.label}</luzmo-menu-item>`)}
|
|
28
|
+
</luzmo-picker>
|
|
29
|
+
`}_renderRankingPicker(e){let t=this._currentRanking(e),n=this._currentSort(e);if(!t.active)return s.html`
|
|
30
|
+
<luzmo-action-button
|
|
31
|
+
size=${this.size}
|
|
32
|
+
@click=${()=>this._emitRankAndSort({active:!0,number:5,direction:i.c.Top},n)}
|
|
33
|
+
>
|
|
34
|
+
<luzmo-icon slot="icon" size="xs" .icon=${o.luzmoAlignLeft}></luzmo-icon>
|
|
35
|
+
${(0,l.msg)(`Show top 5`,{desc:`Label to activate top-N ranking on a chart`})}
|
|
36
|
+
</luzmo-action-button>
|
|
37
|
+
`;let r=t.direction===i.c.Bottom?(0,l.msg)(`Bottom`,{desc:`Ranking direction: keep the lowest values`}):(0,l.msg)(`Top`,{desc:`Ranking direction: keep the highest values`});return s.html`
|
|
38
|
+
<luzmo-action-button size=${this.size} id=${this._rankingTriggerId}>
|
|
39
|
+
<luzmo-icon slot="icon" size="xs" .icon=${o.luzmoAlignLeft}></luzmo-icon>
|
|
40
|
+
${r} ${t.number||5}
|
|
41
|
+
</luzmo-action-button>
|
|
42
|
+
|
|
43
|
+
<luzmo-overlay type="auto" placement="bottom-start" trigger=${`${this._rankingTriggerId}@click`}>
|
|
44
|
+
<luzmo-popover>
|
|
45
|
+
<div class="ranking-content">
|
|
46
|
+
<div class="ranking-row">
|
|
47
|
+
<luzmo-action-group
|
|
48
|
+
size=${this.size}
|
|
49
|
+
compact
|
|
50
|
+
selects="single"
|
|
51
|
+
.selected=${[t.direction]}
|
|
52
|
+
@change=${t=>this._handleDirectionChange(e,t)}
|
|
53
|
+
>
|
|
54
|
+
<luzmo-action-button value="top" emphasized
|
|
55
|
+
>${(0,l.msg)(`Top`,{desc:`Ranking direction: keep the highest values`})}</luzmo-action-button
|
|
56
|
+
>
|
|
57
|
+
<luzmo-action-button value="bottom" emphasized
|
|
58
|
+
>${(0,l.msg)(`Bottom`,{desc:`Ranking direction: keep the lowest values`})}</luzmo-action-button
|
|
59
|
+
>
|
|
60
|
+
</luzmo-action-group>
|
|
61
|
+
|
|
62
|
+
<luzmo-number-field
|
|
63
|
+
class="ranking-number"
|
|
64
|
+
size=${this.size}
|
|
65
|
+
hide-stepper
|
|
66
|
+
min="1"
|
|
67
|
+
max="100"
|
|
68
|
+
step="1"
|
|
69
|
+
.value=${t.number}
|
|
70
|
+
@change=${t=>this._handleNumberChange(e,t)}
|
|
71
|
+
@input=${t=>this._handleNumberChange(e,t)}
|
|
72
|
+
></luzmo-number-field>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div class="ranking-row">
|
|
76
|
+
<luzmo-action-group
|
|
77
|
+
size=${this.size}
|
|
78
|
+
compact
|
|
79
|
+
selects="single"
|
|
80
|
+
.selected=${[n.by]}
|
|
81
|
+
@change=${t=>this._handleSortByChange(e,t)}
|
|
82
|
+
>
|
|
83
|
+
<luzmo-action-button value="measure" emphasized>123</luzmo-action-button>
|
|
84
|
+
<luzmo-action-button value="category" emphasized>ABC</luzmo-action-button>
|
|
85
|
+
</luzmo-action-group>
|
|
86
|
+
|
|
87
|
+
<luzmo-action-group
|
|
88
|
+
size=${this.size}
|
|
89
|
+
compact
|
|
90
|
+
selects="single"
|
|
91
|
+
.selected=${[n.direction]}
|
|
92
|
+
@change=${t=>this._handleSortDirectionChange(e,t)}
|
|
93
|
+
>
|
|
94
|
+
<luzmo-action-button
|
|
95
|
+
value="desc"
|
|
96
|
+
emphasized
|
|
97
|
+
label=${(0,l.msg)(`Sort descending`,{desc:`Sort chart values in descending order`})}
|
|
98
|
+
>
|
|
99
|
+
<luzmo-icon slot="icon" size="xs" .icon=${o.luzmoAlignLeft}></luzmo-icon>
|
|
100
|
+
</luzmo-action-button>
|
|
101
|
+
<luzmo-action-button
|
|
102
|
+
value="asc"
|
|
103
|
+
emphasized
|
|
104
|
+
label=${(0,l.msg)(`Sort ascending`,{desc:`Sort chart values in ascending order`})}
|
|
105
|
+
>
|
|
106
|
+
<luzmo-icon slot="icon" size="xs" class="icon-flipped" .icon=${o.luzmoAlignLeft}></luzmo-icon>
|
|
107
|
+
</luzmo-action-button>
|
|
108
|
+
</luzmo-action-group>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</luzmo-popover>
|
|
112
|
+
</luzmo-overlay>
|
|
113
|
+
`}_handleDirectionChange(e,t){t.stopPropagation();let n=t.target?.selected;n?.length&&this._emitRankAndSort({...this._currentRanking(e),direction:n[0]},this._currentSort(e))}_handleNumberChange(e,t){t.stopPropagation();let n=t.target?.value,r=typeof n==`number`?n:Number.parseInt(String(n),10);!Number.isNaN(r)&&r>=1&&this._emitRankAndSort({...this._currentRanking(e),number:r},this._currentSort(e))}_handleSortByChange(e,t){t.stopPropagation();let n=t.target?.selected;n?.length&&this._emitRankAndSort(this._currentRanking(e),{...this._currentSort(e),by:n[0]})}_handleSortDirectionChange(e,t){t.stopPropagation();let n=t.target?.selected;n?.length&&this._emitRankAndSort(this._currentRanking(e),{...this._currentSort(e),direction:n[0]})}_renderAddToDashboard(){return this.addToDashboard?s.html`
|
|
114
|
+
<luzmo-add-to-dashboard
|
|
115
|
+
size=${this.size}
|
|
116
|
+
language=${this.language}
|
|
117
|
+
.chart=${this.chart}
|
|
118
|
+
.dashboardActions=${this.dashboardActions}
|
|
119
|
+
.authKey=${this.authKey}
|
|
120
|
+
.authToken=${this.authToken}
|
|
121
|
+
.apiUrl=${this.apiUrl}
|
|
122
|
+
></luzmo-add-to-dashboard>
|
|
123
|
+
`:s.nothing}_renderActions(){return this.hideActions?s.html`
|
|
124
|
+
<div class="chart-actions-bar">
|
|
125
|
+
<div class="chart-actions-primary"></div>
|
|
126
|
+
<slot name="chart-actions-extra"></slot>
|
|
127
|
+
${this._renderAddToDashboard()}
|
|
128
|
+
</div>
|
|
129
|
+
`:s.html`
|
|
130
|
+
<div class="chart-actions-bar">
|
|
131
|
+
<div class="chart-actions-primary">
|
|
132
|
+
${this._chartActions.map(e=>e.type===`optionDropdown`?this._renderOptionDropdown(e):this._renderRankingPicker(e))}
|
|
133
|
+
</div>
|
|
134
|
+
<slot name="chart-actions-extra"></slot>
|
|
135
|
+
${this._renderAddToDashboard()}
|
|
136
|
+
</div>
|
|
137
|
+
`}_renderChart(){if(!this.chart)return s.nothing;let e=i.o(this.chart);return s.html`
|
|
138
|
+
<div class="chart-container" part="chart-container">
|
|
139
|
+
<luzmo-embed-viz-item
|
|
140
|
+
.type=${e.type}
|
|
141
|
+
.options=${e.options}
|
|
142
|
+
.slots=${e.slots}
|
|
143
|
+
.filters=${e.filters??[]}
|
|
144
|
+
.inlineData=${e.inlineData}
|
|
145
|
+
.authKey=${this.authKey}
|
|
146
|
+
.authToken=${this.authToken}
|
|
147
|
+
.apiHost=${this.apiUrl}
|
|
148
|
+
.appServer=${this.appServer}
|
|
149
|
+
.language=${this._effectiveContentLanguage}
|
|
150
|
+
.canFilter=${this.canFilter??!1}
|
|
151
|
+
></luzmo-embed-viz-item>
|
|
152
|
+
</div>
|
|
153
|
+
`}_renderFeedback(){let e=!this.hideFeedback&&!!this.messageId,t=this._canShowConfigPanel,n=(0,l.msg)(`Loading`,{desc:`Loading spinner label`});return!e&&!t?s.nothing:s.html`
|
|
154
|
+
<div class="feedback-row">
|
|
155
|
+
${e?s.html`
|
|
156
|
+
<luzmo-action-group quiet size=${this.size}>
|
|
157
|
+
<luzmo-action-button
|
|
158
|
+
class="rating-btn-positive"
|
|
159
|
+
value="positive"
|
|
160
|
+
quiet
|
|
161
|
+
label=${(0,l.msg)(`Good response`,{desc:`Accessible label for the positive feedback button`})}
|
|
162
|
+
?selected=${this._rating===1}
|
|
163
|
+
@click=${()=>this._toggleRating(!0)}
|
|
164
|
+
>
|
|
165
|
+
<luzmo-icon slot="icon" size="s" .icon=${o.luzmoThumbsUp}></luzmo-icon>
|
|
166
|
+
</luzmo-action-button>
|
|
167
|
+
<luzmo-action-button
|
|
168
|
+
class="rating-btn-negative"
|
|
169
|
+
value="negative"
|
|
170
|
+
quiet
|
|
171
|
+
label=${(0,l.msg)(`Bad response`,{desc:`Accessible label for the negative feedback button`})}
|
|
172
|
+
?selected=${this._rating===-1}
|
|
173
|
+
@click=${()=>this._toggleRating(!1)}
|
|
174
|
+
>
|
|
175
|
+
<luzmo-icon slot="icon" size="s" .icon=${o.luzmoThumbsDown}></luzmo-icon>
|
|
176
|
+
</luzmo-action-button>
|
|
177
|
+
</luzmo-action-group>
|
|
178
|
+
`:s.nothing}
|
|
179
|
+
${t?s.html`
|
|
180
|
+
<luzmo-action-button
|
|
181
|
+
class="config-toggle"
|
|
182
|
+
size=${this.size}
|
|
183
|
+
quiet
|
|
184
|
+
?selected=${this._configPanelOpen}
|
|
185
|
+
aria-expanded=${this._configPanelOpen}
|
|
186
|
+
aria-label=${this._configPanelPending?n:(0,l.msg)(`Configure chart`,{desc:`Accessible label for the chart config toggle`})}
|
|
187
|
+
@click=${()=>this._toggleConfigPanel()}
|
|
188
|
+
>
|
|
189
|
+
${this._configPanelPending?s.html`<luzmo-progress-circle slot="icon" size="s" indeterminate .label=${n}></luzmo-progress-circle>`:s.html`<luzmo-icon slot="icon" size="s" .icon=${o.luzmoInfoCircle}></luzmo-icon>`}
|
|
190
|
+
</luzmo-action-button>
|
|
191
|
+
<span class="sr-only" role="status" aria-live="polite">${this._configPanelPending?n:``}</span>
|
|
192
|
+
<span class="sr-only" role="alert">${this._configPanelLoadFailed?(0,l.msg)(`Failed to load the chart configuration. Please try again.`,{desc:`Error message when the chart config panel fails to load`}):``}</span>
|
|
193
|
+
`:s.nothing}
|
|
194
|
+
</div>
|
|
195
|
+
`}_toggleRating(e){let t=e?1:-1,n=this._rating===t?0:t;this._dispatch(`luzmo-feedback-changed`,{rating:n,comment:this.feedback?.comment})}_renderFilters(e,t){return e.inlineData?s.nothing:s.html`
|
|
196
|
+
<div class="edit-column edit-column-filters">
|
|
197
|
+
<luzmo-field-label size=${this.size}
|
|
198
|
+
>${(0,l.msg)(`Filters`,{desc:`Label for the filters section`})}</luzmo-field-label
|
|
199
|
+
>
|
|
200
|
+
<luzmo-filters
|
|
201
|
+
size=${this.size}
|
|
202
|
+
.datasetIds=${t}
|
|
203
|
+
.filters=${e.filters??[]}
|
|
204
|
+
.authKey=${this.authKey}
|
|
205
|
+
.authToken=${this.authToken}
|
|
206
|
+
.apiUrl=${this.apiUrl}
|
|
207
|
+
.language=${this.language}
|
|
208
|
+
.contentLanguage=${this._effectiveContentLanguage}
|
|
209
|
+
@luzmo-filters-changed=${this._handleFiltersChanged}
|
|
210
|
+
></luzmo-filters>
|
|
211
|
+
</div>
|
|
212
|
+
`}_renderConfigPanel(){if(!this.chart||!this._canShowConfigPanel||!this._configPanelOpen)return s.nothing;let e=this.chart,t=i.r(e.slots??[]),n=i.i(t),r=e.options.theme??_;return s.html`
|
|
213
|
+
<div class="config-panel" part="config-panel">
|
|
214
|
+
<luzmo-tabs selected="data" size=${this.size}>
|
|
215
|
+
<luzmo-tab value="data">${(0,l.msg)(`Data`,{desc:`Label for the data section`})}</luzmo-tab>
|
|
216
|
+
<luzmo-tab value="options">${(0,l.msg)(`Options`,{desc:`Label for the options section`})}</luzmo-tab>
|
|
217
|
+
|
|
218
|
+
<luzmo-tab-panel value="data">
|
|
219
|
+
<div class="edit-grid">
|
|
220
|
+
<div class="edit-column">
|
|
221
|
+
<luzmo-item-slot-picker-panel
|
|
222
|
+
size=${this.size}
|
|
223
|
+
slot-menu-placement="bottom-end"
|
|
224
|
+
.itemType=${e.type}
|
|
225
|
+
.slotsContents=${t}
|
|
226
|
+
.datasetIds=${n}
|
|
227
|
+
.authKey=${this.authKey}
|
|
228
|
+
.authToken=${this.authToken}
|
|
229
|
+
.apiUrl=${this.apiUrl}
|
|
230
|
+
.language=${this.language}
|
|
231
|
+
.contentLanguage=${this._effectiveContentLanguage}
|
|
232
|
+
@luzmo-slots-contents-changed=${this._handleSlotsChanged}
|
|
233
|
+
></luzmo-item-slot-picker-panel>
|
|
234
|
+
</div>
|
|
235
|
+
${this._renderFilters(e,n)}
|
|
236
|
+
</div>
|
|
237
|
+
</luzmo-tab-panel>
|
|
238
|
+
|
|
239
|
+
<luzmo-tab-panel value="options">
|
|
240
|
+
<luzmo-item-option-panel
|
|
241
|
+
size=${this.size}
|
|
242
|
+
.itemType=${e.type}
|
|
243
|
+
.options=${e.options||{}}
|
|
244
|
+
.slots=${t}
|
|
245
|
+
.theme=${r}
|
|
246
|
+
.authKey=${this.authKey}
|
|
247
|
+
.authToken=${this.authToken}
|
|
248
|
+
.apiUrl=${this.apiUrl}
|
|
249
|
+
.language=${this.language}
|
|
250
|
+
?live-interactions=${this.liveInteractions}
|
|
251
|
+
@luzmo-options-changed=${this._handleOptionsChanged}
|
|
252
|
+
@luzmo-option-interaction-start=${this._handleInteractionStart}
|
|
253
|
+
@luzmo-option-interaction-end=${this._handleInteractionClosed}
|
|
254
|
+
@luzmo-option-interaction-cancel=${this._handleInteractionClosed}
|
|
255
|
+
></luzmo-item-option-panel>
|
|
256
|
+
</luzmo-tab-panel>
|
|
257
|
+
</luzmo-tabs>
|
|
258
|
+
</div>
|
|
259
|
+
`}_dispatchInteraction(e,{chart:t,generation:n}){e.stopPropagation(),this._dispatch(e.type,{...e.detail,chart:t,generation:n})}render(){return this.chart?s.html`
|
|
260
|
+
<div class="answer" part="container">
|
|
261
|
+
${this._renderActions()} ${this._renderChart()} ${this._renderFeedback()} ${this._renderConfigPanel()}
|
|
262
|
+
</div>
|
|
263
|
+
`:s.html`
|
|
264
|
+
<div
|
|
265
|
+
class="answer"
|
|
266
|
+
part="container"
|
|
267
|
+
></div>
|
|
268
|
+
`}};t.t([(0,c.property)({type:Object})],y.prototype,`chart`,void 0),t.t([(0,c.property)({type:Object})],y.prototype,`feedback`,void 0),t.t([(0,c.property)({type:String,attribute:`message-id`})],y.prototype,`messageId`,void 0),t.t([(0,c.property)({type:String,attribute:`auth-key`})],y.prototype,`authKey`,void 0),t.t([(0,c.property)({type:String,attribute:`auth-token`})],y.prototype,`authToken`,void 0),t.t([(0,c.property)({type:String,attribute:`api-url`})],y.prototype,`apiUrl`,void 0),t.t([(0,c.property)({type:String,attribute:`app-server`})],y.prototype,`appServer`,void 0),t.t([(0,c.property)({type:String,attribute:`content-language`})],y.prototype,`contentLanguage`,void 0),t.t([(0,c.property)({type:Boolean,attribute:`hide-actions`,reflect:!0})],y.prototype,`hideActions`,void 0),t.t([(0,c.property)({type:Boolean,attribute:`hide-feedback`,reflect:!0})],y.prototype,`hideFeedback`,void 0),t.t([(0,c.property)({type:Boolean,attribute:`hide-config-panel`,reflect:!0})],y.prototype,`hideConfigPanel`,void 0),t.t([(0,c.property)({type:Boolean,attribute:`add-to-dashboard`,reflect:!0})],y.prototype,`addToDashboard`,void 0),t.t([(0,c.property)({attribute:!1})],y.prototype,`dashboardActions`,void 0),t.t([(0,c.property)({type:Boolean,reflect:!0})],y.prototype,`controlled`,void 0),t.t([(0,c.property)({attribute:`can-filter`,converter:{fromAttribute:e=>e===null?void 0:`all`}})],y.prototype,`canFilter`,void 0),t.t([(0,c.property)({type:Boolean,reflect:!0,attribute:`live-interactions`})],y.prototype,`liveInteractions`,void 0),t.t([(0,c.state)()],y.prototype,`_configPanelOpen`,void 0),t.t([(0,c.state)()],y.prototype,`_configPanelPending`,void 0),t.t([(0,c.state)()],y.prototype,`_configPanelLoadFailed`,void 0),customElements.get(`luzmo-interactive-viz-item`)||customElements.define(`luzmo-interactive-viz-item`,y),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return y}});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2026 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Luzmo web components (“Luzmo Web Components”)
|
|
6
|
+
* must be used according to the Luzmo Terms of Service.
|
|
7
|
+
* This license allows users with a current active Luzmo account
|
|
8
|
+
* to use the Luzmo Web Components. This license terminates
|
|
9
|
+
* automatically if a user no longer has an active Luzmo account.
|
|
10
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
11
|
+
*
|
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
+
* SOFTWARE.
|
|
19
|
+
* */
|
|
20
|
+
import { t as e } from "./color-CQcCK-_O.js";
|
|
21
|
+
// src/utils/option-interaction/is-same-option-value.ts
|
|
22
|
+
var t = 1e-9, n = (e, n) => Object.is(e, n) || Math.abs(e - n) <= t, r = (t) => {
|
|
23
|
+
try {
|
|
24
|
+
let n = new e(t).to("srgb");
|
|
25
|
+
return [...n.coords.map((e) => e ?? 0), n.alpha ?? 1];
|
|
26
|
+
} catch {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
}, i = (e) => typeof e == "object" && !!e && Object.getPrototypeOf(e) === Object.prototype, a = (e, t) => {
|
|
30
|
+
if (Object.is(e, t)) return !0;
|
|
31
|
+
if (Array.isArray(e) && Array.isArray(t)) return e.length === t.length && e.every((e, n) => a(e, t[n]));
|
|
32
|
+
if (i(e) && i(t)) {
|
|
33
|
+
let n = Object.keys(e);
|
|
34
|
+
return n.length === Object.keys(t).length && n.every((n) => Object.hasOwn(t, n) && a(e[n], t[n]));
|
|
35
|
+
}
|
|
36
|
+
return !1;
|
|
37
|
+
}, o = (e, t) => {
|
|
38
|
+
if (typeof e != "string" || typeof t != "string" || e === t) return a(e, t);
|
|
39
|
+
let i = r(e), o = r(t);
|
|
40
|
+
return !!i && !!o && i.every((e, t) => n(e, o[t]));
|
|
41
|
+
};
|
|
42
|
+
export { a as n, o as t };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2026 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Luzmo web components (“Luzmo Web Components”)
|
|
6
|
+
* must be used according to the Luzmo Terms of Service.
|
|
7
|
+
* This license allows users with a current active Luzmo account
|
|
8
|
+
* to use the Luzmo Web Components. This license terminates
|
|
9
|
+
* automatically if a user no longer has an active Luzmo account.
|
|
10
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
11
|
+
*
|
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
+
* SOFTWARE.
|
|
19
|
+
* */
|
|
20
|
+
const e=require("./color-DKdzPrQX.cjs");var t=1e-9,n=(e,n)=>Object.is(e,n)||Math.abs(e-n)<=t,r=t=>{try{let n=new e.t(t).to(`srgb`);return[...n.coords.map(e=>e??0),n.alpha??1]}catch{return}},i=e=>typeof e==`object`&&!!e&&Object.getPrototypeOf(e)===Object.prototype,a=(e,t)=>{if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>a(e,t[n]));if(i(e)&&i(t)){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.hasOwn(t,n)&&a(e[n],t[n]))}return!1},o=(e,t)=>{if(typeof e!=`string`||typeof t!=`string`||e===t)return a(e,t);let i=r(e),o=r(t);return!!i&&!!o&&i.every((e,t)=>n(e,o[t]))};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { ElementSize } from '../../../utils/base';
|
|
2
|
+
import type { ItemOptionInteractionEventDetail } from '../types';
|
|
2
3
|
export interface ControlMarkupArgs {
|
|
3
4
|
controlType: string;
|
|
4
5
|
optionKey: string;
|
|
5
6
|
controlInfo: any;
|
|
6
7
|
options: any;
|
|
8
|
+
/** Returns the latest options when a change is applied, which can be newer than `options`. */
|
|
9
|
+
getOptions?: () => Record<string, unknown>;
|
|
7
10
|
slots: any;
|
|
8
11
|
theme: any;
|
|
9
12
|
language: string;
|
|
10
13
|
translations: any;
|
|
11
14
|
size: ElementSize;
|
|
12
15
|
changeCallback: any;
|
|
16
|
+
/** Turns on live updates and interaction lifecycle events on controls that support them. */
|
|
17
|
+
liveInteractions?: boolean;
|
|
18
|
+
/** Receives the control's `luzmo-option-interaction-*` events. */
|
|
19
|
+
interactionCallback?: (event: CustomEvent<ItemOptionInteractionEventDetail>) => void;
|
|
13
20
|
}
|
|
14
21
|
export declare const controlMarkup: (args: ControlMarkupArgs) => import("lit-html").TemplateResult<1> | undefined;
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../item-option-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../item-option-DpLdospV.cjs");exports.LuzmoItemOption=e.t;
|
|
@@ -5,4 +5,4 @@ declare global {
|
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
export { LuzmoItemOption } from './item-option';
|
|
8
|
-
export type { ItemOptionChangedEventDetail, ItemOptionsChangedEventDetail } from './types';
|
|
8
|
+
export type { ItemOptionChangedEventDetail, ItemOptionInteraction, ItemOptionInteractionEventDetail, ItemOptionInteractionEventName, ItemOptionsChangedEventDetail } from './types';
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { OptionConfig, OptionsConfig, OptionTranslation, ThemeConfig, TranslationOverrides, TranslationsFile, VizItemType } from '@luzmo/dashboard-contents-types';
|
|
2
2
|
import { ElementSize, LuzmoElement } from '../../utils/base';
|
|
3
|
+
import type { ItemOptionInteraction } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* @customElement luzmo-item-option
|
|
5
|
-
* @fires {CustomEvent<ItemOptionsChangedEventDetail>} luzmo-options-changed - Announces that the `options` of the element have changed
|
|
6
|
+
* @fires {CustomEvent<ItemOptionsChangedEventDetail>} luzmo-options-changed - Announces that the `options` of the element have changed. With `live-interactions`, updates inside a gesture carry `interaction`.
|
|
7
|
+
* @fires {CustomEvent<ItemOptionInteractionEventDetail>} luzmo-option-interaction-start - With `live-interactions`: a drag or held key first changed the control's value, right before that options update. A press that never changes the value emits no lifecycle. `detail.optionKey` is set.
|
|
8
|
+
* @fires {CustomEvent<ItemOptionInteractionEventDetail>} luzmo-option-interaction-end - With `live-interactions`: the gesture ended, after its last options update. `detail.changed` is false when the value is back at its start.
|
|
9
|
+
* @fires {CustomEvent<ItemOptionInteractionEventDetail>} luzmo-option-interaction-cancel - With `live-interactions`: the gesture was cancelled and the control reverted to its start value.
|
|
6
10
|
*/
|
|
7
11
|
export declare class LuzmoItemOption extends LuzmoElement {
|
|
8
12
|
static styles: import("lit").CSSResult;
|
|
@@ -39,6 +43,11 @@ export declare class LuzmoItemOption extends LuzmoElement {
|
|
|
39
43
|
authToken?: string;
|
|
40
44
|
/** The size variant of the option control (`s`, `m`, `l`, `xl`). */
|
|
41
45
|
size: ElementSize;
|
|
46
|
+
/**
|
|
47
|
+
* Emits options updates live, without the control's debounce, plus `luzmo-option-interaction-*` events
|
|
48
|
+
* around drags and held keys. Off by default.
|
|
49
|
+
*/
|
|
50
|
+
liveInteractions: boolean;
|
|
42
51
|
_controlTypeLoaded: string;
|
|
43
52
|
_itemTypeLoaded?: string;
|
|
44
53
|
_languageLoaded?: string;
|
|
@@ -47,8 +56,20 @@ export declare class LuzmoItemOption extends LuzmoElement {
|
|
|
47
56
|
_translationOverrides?: TranslationOverrides;
|
|
48
57
|
_effectiveTranslations: TranslationsFile;
|
|
49
58
|
_fullTheme?: any;
|
|
59
|
+
/**
|
|
60
|
+
* @internal Returns the owner's latest options. Supplied by `luzmo-item-option-panel`, whose other options can change it
|
|
61
|
+
* before this one re-renders, so a change applies on top of theirs.
|
|
62
|
+
*/
|
|
63
|
+
latestOptions?: () => Record<string, unknown> | undefined;
|
|
64
|
+
private _getLatestOptions;
|
|
50
65
|
/** Callback that updates `options` and emits `luzmo-options-changed`; used internally by the rendered control. */
|
|
51
|
-
changedOptions: (options: any) => void;
|
|
66
|
+
changedOptions: (options: any, interaction?: ItemOptionInteraction) => void;
|
|
67
|
+
/** Ends the control's open gesture now, keeping its value. Call before removing or rebinding the element. */
|
|
68
|
+
endInteraction(): void;
|
|
69
|
+
private get _renderedOptionKey();
|
|
70
|
+
/** Option key per open gesture, so a gesture ended after the element was rebound still names the option it edited. */
|
|
71
|
+
private readonly _interactionOptionKeys;
|
|
72
|
+
private _handleInteraction;
|
|
52
73
|
render(): import("lit-html").TemplateResult<1> | undefined;
|
|
53
74
|
private _getTranslationOverrides;
|
|
54
75
|
private _mergeOptionTranslations;
|
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
import type { OptionsConfig } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
/** Identifies the continuous gesture (drag or held key) that a live value update belongs to. */
|
|
3
|
+
export interface ItemOptionInteraction {
|
|
4
|
+
/** Unique id of the gesture, shared by its lifecycle events and its value updates. */
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
2
7
|
export interface ItemOptionChangedEventDetail {
|
|
3
8
|
value?: unknown;
|
|
4
9
|
values?: Record<string, number | undefined>;
|
|
10
|
+
/** Set only in live-interactions mode, on updates that belong to a gesture. */
|
|
11
|
+
interaction?: ItemOptionInteraction;
|
|
5
12
|
}
|
|
6
13
|
export interface ItemOptionsChangedEventDetail {
|
|
7
14
|
options: OptionsConfig;
|
|
15
|
+
/** Set only in live-interactions mode, on updates that belong to a gesture. */
|
|
16
|
+
interaction?: ItemOptionInteraction;
|
|
17
|
+
}
|
|
18
|
+
/** Detail of `luzmo-option-interaction-start`, `luzmo-option-interaction-end` and `luzmo-option-interaction-cancel`. */
|
|
19
|
+
export interface ItemOptionInteractionEventDetail {
|
|
20
|
+
/** Gesture id; matches `interaction.id` on the gesture's value updates. */
|
|
21
|
+
id: string;
|
|
22
|
+
/** Option key of the `luzmo-item-option` that hosts the control. Absent on events from a bare control. */
|
|
23
|
+
optionKey?: string;
|
|
24
|
+
/** On `end` and `cancel`: whether the final value differs from the value at `start` (normalized). */
|
|
25
|
+
changed?: boolean;
|
|
8
26
|
}
|
|
27
|
+
export type ItemOptionInteractionEventName = 'luzmo-option-interaction-start' | 'luzmo-option-interaction-end' | 'luzmo-option-interaction-cancel';
|