@luzmo/analytics-components-kit 1.3.0 → 1.4.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 +6 -3
- package/angular/components/add-to-dashboard.ts +20 -6
- package/angular/components/data-fields-select.ts +5 -0
- package/angular/components/interactive-viz-item.ts +87 -22
- package/angular/components/item-grid-item-actions-menu.ts +5 -0
- package/angular/components/item-grid.ts +7 -0
- package/angular/components/item-option-color-picker.ts +28 -28
- package/angular/components/item-option-guidelines.ts +22 -1
- package/angular/components/item-option-multi-language-field.ts +7 -7
- package/angular/components/item-option-number-field.ts +14 -14
- package/angular/components/item-option-positions-number-field.ts +14 -14
- package/angular/components/item-option-radio-button-group.ts +7 -7
- package/angular/components/item-option-text-field.ts +7 -7
- package/angular/components/item-slot-picker-panel.ts +1 -1
- package/angular/components/item-slot-picker.ts +7 -7
- package/angular/esm/components/add-to-dashboard.d.ts +8 -4
- package/angular/esm/components/add-to-dashboard.js +23 -7
- package/angular/esm/components/data-fields-select.d.ts +2 -0
- package/angular/esm/components/data-fields-select.js +4 -0
- package/angular/esm/components/interactive-viz-item.d.ts +30 -9
- package/angular/esm/components/interactive-viz-item.js +98 -27
- package/angular/esm/components/item-grid-item-actions-menu.d.ts +2 -0
- package/angular/esm/components/item-grid-item-actions-menu.js +4 -0
- package/angular/esm/components/item-grid.d.ts +3 -1
- package/angular/esm/components/item-grid.js +9 -1
- package/angular/esm/components/item-option-color-picker.d.ts +10 -10
- package/angular/esm/components/item-option-color-picker.js +34 -34
- package/angular/esm/components/item-option-guidelines.d.ts +8 -2
- package/angular/esm/components/item-option-guidelines.js +26 -2
- package/angular/esm/components/item-option-multi-language-field.d.ts +3 -3
- package/angular/esm/components/item-option-multi-language-field.js +10 -10
- package/angular/esm/components/item-option-number-field.d.ts +5 -5
- package/angular/esm/components/item-option-number-field.js +18 -18
- package/angular/esm/components/item-option-positions-number-field.d.ts +5 -5
- package/angular/esm/components/item-option-positions-number-field.js +18 -18
- package/angular/esm/components/item-option-radio-button-group.d.ts +3 -3
- package/angular/esm/components/item-option-radio-button-group.js +10 -10
- package/angular/esm/components/item-option-text-field.d.ts +3 -3
- package/angular/esm/components/item-option-text-field.js +10 -10
- package/angular/esm/components/item-slot-picker-panel.d.ts +1 -1
- package/angular/esm/components/item-slot-picker-panel.js +1 -1
- package/angular/esm/components/item-slot-picker.d.ts +3 -3
- package/angular/esm/components/item-slot-picker.js +9 -9
- package/angular/package.json +2 -2
- package/components/add-to-dashboard/dashboard-actions.d.ts +2 -1
- package/components/add-to-dashboard/index.cjs +1 -1
- package/components/add-to-dashboard/index.js +1 -1
- package/components/{add-to-dashboard-CzIuDtAq.cjs → add-to-dashboard-BtzTZdjN.cjs} +1 -1
- package/components/{add-to-dashboard-DGC0_hRB.js → add-to-dashboard-Bu6S3qVz.js} +125 -120
- package/components/chart-helpers-BHxQbLBw.cjs +20 -0
- package/components/{chart-helpers-Cbl3sRra.js → chart-helpers-BKeMLhov.js} +51 -38
- package/components/filters/index.cjs +1 -1
- package/components/filters/index.js +1 -1
- package/components/{filters-CxIzuI5q.js → filters-DEpmh9Nj.js} +113 -102
- package/components/filters-LDXhe1Bp.cjs +187 -0
- package/components/index.cjs +1 -1
- package/components/index.js +6 -6
- package/components/interactive-viz-item/helpers/chart-helpers.d.ts +2 -1
- package/components/interactive-viz-item/index.cjs +1 -1
- package/components/interactive-viz-item/index.js +3 -3
- package/components/interactive-viz-item/interactive-viz-item.d.ts +44 -0
- package/components/{interactive-viz-item-BKLOmawA.js → interactive-viz-item-Cc3Ix95e.js} +151 -110
- package/components/interactive-viz-item-SF12d97t.cjs +269 -0
- package/components/item-grid/item-grid.d.ts +1 -0
- package/components/item-slot-picker-panel/index.cjs +1 -1
- package/components/item-slot-picker-panel/index.js +1 -1
- package/components/item-slot-picker-panel/item-slot-picker-panel.d.ts +19 -1
- package/components/item-slot-picker-panel-Cw3UCK03.cjs +84 -0
- package/components/{item-slot-picker-panel-fJqEmxeD.js → item-slot-picker-panel-DprM9Rli.js} +64 -33
- package/custom-elements.json +3044 -2532
- package/grid-core/item-grid-base.d.ts +5 -4
- package/package.json +1 -1
- package/react/package.json +2 -2
- package/standalone/add-to-dashboard.js +1 -1
- package/standalone/chunks/{chart-helpers-CR-EUEPf.js → chart-helpers-DZsidiCl.js} +1 -1
- package/standalone/chunks/data-broker-DpSrH3IP.js +2 -0
- package/standalone/chunks/{display-settings-binning-BeLLxd3i.js → display-settings-binning-DhHlclWH.js} +1 -1
- package/standalone/chunks/{display-settings-datetime-BkeiKIVV.js → display-settings-datetime-C8xvOvi4.js} +1 -1
- package/standalone/chunks/{display-settings-grand-totals-BuhpQKJ6.js → display-settings-grand-totals-CUpigDcs.js} +1 -1
- package/standalone/chunks/{display-settings-numeric-m30IYI7I.js → display-settings-numeric-BLWF54Jx.js} +1 -1
- package/standalone/chunks/{display-settings-period-over-period-CqDlOSRn.js → display-settings-period-over-period-COd4tvUw.js} +1 -1
- package/standalone/chunks/en-DNsyAwgq.js +2 -0
- package/standalone/chunks/en-GB-Di3OzVdL.js +2 -0
- package/standalone/chunks/en-US-DNsyAwgq.js +2 -0
- package/standalone/chunks/{filters-CxgBXUF1.js → filters-lhg_WVDK.js} +72 -72
- package/standalone/chunks/{formula-codemirror-Cq94j3-f.js → formula-codemirror-DZMzLE2I.js} +1 -1
- package/standalone/chunks/{item-option-action-button-group-BoyqF9vt.js → item-option-action-button-group-Bl1HR1JK.js} +1 -1
- package/standalone/chunks/{item-option-base-CBcDT8MX.js → item-option-base-DF24wTyv.js} +1 -1
- package/standalone/chunks/{item-option-color-palette-picker-C9PGAv4V.js → item-option-color-palette-picker-MkIIn56p.js} +1 -1
- package/standalone/chunks/{item-option-color-picker-D4fVJlqF.js → item-option-color-picker-CxosMo_p.js} +1 -1
- package/standalone/chunks/{item-option-color-range-BlAdTguE.js → item-option-color-range-C7C70r4J.js} +1 -1
- package/standalone/chunks/{item-option-guidelines-DMsYsHDu.js → item-option-guidelines-iu8yWRzr.js} +1 -1
- package/standalone/chunks/{item-option-multi-language-field-NUbm1drg.js → item-option-multi-language-field-foanqCdr.js} +1 -1
- package/standalone/chunks/{item-option-number-field-DRp7kbHL.js → item-option-number-field-ByVD4oq0.js} +1 -1
- package/standalone/chunks/{item-option-panel-cXrRclzM.js → item-option-panel-Bya-K7HH.js} +2 -2
- package/standalone/chunks/{item-option-picker-Ba09L4Cs.js → item-option-picker-CqNNVIML.js} +1 -1
- package/standalone/chunks/{item-option-position-picker-GEGTnhjw.js → item-option-position-picker-BjCFVtDH.js} +1 -1
- package/standalone/chunks/{item-option-positions-number-field-n44s1k5v.js → item-option-positions-number-field-BJJtXZL-.js} +1 -1
- package/standalone/chunks/{item-option-radio-button-group-3s_b1NvR.js → item-option-radio-button-group-C5bxsD85.js} +1 -1
- package/standalone/chunks/{item-option-slider-DtY65Gxk.js → item-option-slider-DUXWz70B.js} +1 -1
- package/standalone/chunks/{item-option-switch-4sJaI0mx.js → item-option-switch-BHyJuOkP.js} +1 -1
- package/standalone/chunks/{item-option-text-field-Bt6Lj6kh.js → item-option-text-field-rBZY9OX4.js} +1 -1
- package/standalone/chunks/{item-slot-picker-panel-BOSVFBIy.js → item-slot-picker-panel-BM82vSXi.js} +74 -72
- package/standalone/chunks/load-data-fields-for-datasets-DS9O1oyy.js +25 -0
- package/standalone/chunks/localize-DLl7tgQp.js +2 -0
- package/standalone/interactive-viz-item.js +54 -53
- package/standalone/manifest.json +31 -31
- package/types.d.ts +1 -1
- package/components/chart-helpers-fMnqHRzC.cjs +0 -20
- package/components/filters-BPbPFOu5.cjs +0 -187
- package/components/interactive-viz-item-ojdH1uk0.cjs +0 -268
- package/components/item-slot-picker-panel-BhhN54IM.cjs +0 -82
- package/standalone/chunks/data-broker-DXDyIrj_.js +0 -2
- package/standalone/chunks/en-63f7j4v7.js +0 -2
- package/standalone/chunks/en-GB-QAmXQf8W.js +0 -2
- package/standalone/chunks/en-US-63f7j4v7.js +0 -2
- package/standalone/chunks/load-data-fields-for-datasets-CDlut-6S.js +0 -25
- package/standalone/chunks/localize-DXRmGRe-.js +0 -2
|
@@ -1,187 +0,0 @@
|
|
|
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("./decorate-DCJt-2rt.cjs"),t=require("./localized-mixin-EoNvtTBG.cjs"),n=require("./data-broker-DCghLjhq.cjs"),r=require("./type-check-BehV9ZL1.cjs"),i=require("./v4-Dyp-SQ1c.cjs"),a=require("./filter-item-DQNbp7Qn.cjs");let o=require("@luzmo/icons");require("@luzmo/lucero/action-button"),require("@luzmo/lucero/button"),require("@luzmo/lucero/icon"),require("@luzmo/lucero/tooltip");let s=require("lit"),c=require("lit/decorators.js"),l=require("@lit/localize"),u=require("lit/directives/repeat.js");require("@luzmo/lucero/progress-circle");let d=require("@luzmo/lucero/utils");var ee=20,f=class extends Error{constructor(e){super(e),this.name=`FilterUnrepresentableError`}},p=new Set([`and`,`or`]),m=[`datasetId`,`dataset_id`,`columnId`,`column_id`,`formulaId`,`formula_id`,`formula`,`columnExpression`,`value`,`ignoredItemIds`];function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g(e){return!h(e)||e.condition!==void 0&&(typeof e.condition!=`string`||!p.has(e.condition.toLowerCase()))?!1:`filters`in e||`subGroups`in e}function _(e){return h(e)&&`expression`in e&&!(`condition`in e)}function v(e){return m.some(t=>t in e)}function te(e,t=!1){let n=[e.columnId!==void 0||e.column_id!==void 0,e.formulaId!==void 0||e.formula_id!==void 0,e.formula!==void 0].filter(Boolean).length;return n===1?!0:n>1?!1:e.columnExpression!==void 0||t&&e.expression!==void 0}function y(e){return!_(e)||typeof e.expression!=`string`||e.expression.length===0||`parameters`in e||typeof e.datasetId!=`string`&&typeof e.dataset_id!=`string`?!1:te(e)}function b(e){return!_(e)||!Array.isArray(e.parameters)?!1:!v(e)}function ne(e){if(!(`parameters`in e))return;let t=m.find(t=>t in e);if(t!==void 0)throw new f(`Filter leaf mixes "parameters" with the clean inline key "${t}".`)}function re(e){throw typeof e.expression!=`string`||e.expression.length===0?new f(`Clean filter leaf is missing a non-empty "expression".`):typeof e.datasetId!=`string`&&typeof e.dataset_id!=`string`?new f(`Clean filter leaf "${e.expression}" is missing a "datasetId".`):new f(`Clean filter leaf "${e.expression}" must name exactly one of "columnId", "formulaId", "formula", or "columnExpression".`)}function x(e){return e===`where`||e===`having`}function S(e){if(e>20)throw new f(`Filter nesting exceeds the maximum depth of 20.`)}function ie(e){if(e==null)return`empty`;if(!Array.isArray(e))return`unknown`;if(e.length===0)return`empty`;let t=!1,n=!1,r=!1,i=(e,a)=>{if(a>20)r=!0;else if(g(e)){x(e.clause)&&(n=!0);let t=[...Array.isArray(e.filters)?e.filters:[],...Array.isArray(e.subGroups)?e.subGroups:[]];for(let e of t)i(e,a+1)}else _(e)?`parameters`in e&&v(e)?r=!0:y(e)?n=!0:b(e)?t=!0:r=!0:r=!0};for(let t of e)i(t,1);return r?`unknown`:n&&t?`mixed`:n?`clean`:t?`canonical`:`empty`}var C=new Set([`? is null`,`? is not null`]),w=new Set([`? = ?`,`? != ?`,`? < ?`,`? <= ?`,`? > ?`,`? >= ?`]),ae=new Set([`? in ?`,`? not in ?`,`? between ?`]),oe={"array[numeric]":`numeric[]`,"array[hierarchy]":`hierarchy[]`,"array[datetime]":`datetime[]`},T=new Set([`level`,`lowestLevel`,`unnest`,`discretization`,`aggregation`,`index`,`include_nonoccurring`,`simplification`]);function E(e,t){return e!==`lowestLevel`&&!(t===null&&T.has(e))}function D(e){return structuredClone(e)}function O(e){let t=e.datasetId??e.dataset_id;if(typeof t!=`string`||t.length===0)throw new f(`Filter reference is missing a "datasetId".`);return t}function k(e){return h(e)?typeof e.columnId==`string`||typeof e.column_id==`string`||typeof e.formulaId==`string`||typeof e.formula_id==`string`||typeof e.formula==`string`||(typeof e.datasetId==`string`||typeof e.dataset_id==`string`)&&(e.columnExpression!==void 0||e.expression!==void 0):!1}function A(e){let t={type:e.type};return e.bins!==void 0&&(t.bins=e.bins),Array.isArray(e.over)&&(t.over=e.over.map(e=>L(e))),t}function j(e){let t={type:e.type},n=e.datasetId??e.dataset_id,r=e.columnId??e.column_id;return n!==void 0&&(t.datasetId=n),r!==void 0&&(t.columnId=r),e.level!==void 0&&E(`level`,e.level)&&(t.level=e.level),h(e.discretization)&&(t.discretization=A(e.discretization)),e.unnest!==void 0&&E(`unnest`,e.unnest)&&(t.unnest=e.unnest),t}function M(e){let t={type:e.type};return e.bins!==void 0&&(t.bins=e.bins),Array.isArray(e.over)&&(t.over=e.over.map(e=>h(e)?I(e):e)),t}function N(e){let t={type:e.type},n=e.datasetId??e.dataset_id,r=e.columnId??e.column_id;return n!==void 0&&(t.datasetId=n),r!==void 0&&(t.columnId=r),e.level!==void 0&&(t.level=e.level),h(e.discretization)&&(t.discretization=M(e.discretization)),e.unnest!==void 0&&(t.unnest=e.unnest),t}function P(e,t){e.level!==void 0&&(t.level=D(e.level)),h(e.discretization)&&(t.discretization=M(e.discretization)),h(e.aggregation)&&(t.aggregation=N(e.aggregation)),e.unnest!==void 0&&(t.unnest=D(e.unnest))}function F(e,t){let n=e.columnId??e.column_id;if(n!==void 0)return{kind:`columnId`,value:n};let r=e.formulaId??e.formula_id;if(r!==void 0)return{kind:`formulaId`,value:r};if(e.formula!==void 0)return{kind:`formula`,value:e.formula};let i=e.columnExpression??(t?e.expression:void 0);if(i!==void 0)return{kind:`expression`,value:i}}function I(e,t=!0){let n={datasetId:O(e)},r=F(e,t);return r!==void 0&&(r.kind===`expression`?n.expression=r.value:n[r.kind]=r.value),P(e,n),n}function L(e){if(!h(e))throw new f(`Cannot emit a clean filter reference.`);let t={datasetId:O(e)};e.level!==void 0&&E(`level`,e.level)&&(t.level=e.level),h(e.discretization)&&(t.discretization=A(e.discretization)),h(e.aggregation)&&(t.aggregation=j(e.aggregation)),e.unnest!==void 0&&E(`unnest`,e.unnest)&&(t.unnest=e.unnest);let n=F(e,!0);if(n===void 0)throw new f(`Cannot emit a clean filter reference: no column, formula, or expression.`);return n.kind===`expression`?t.columnExpression=n.value:t[n.kind]=n.value,t}function se(e){if(!h(e)||typeof e.parameter!=`string`||typeof e.type!=`string`)return e;let t=oe[e.type];return t===void 0?e:{...e,type:t}}function ce(e,t){return h(t)&&typeof t.parameter==`string`?!0:Array.isArray(t)?e!==`? between ?`||t.length===2:!1}function le(e,t){let n=e.expression,r=[I(e,!1)];if(!C.has(n)&&e.value!==void 0){let t=w.has(n)&&k(e.value);r.push(t?I(e.value):D(e.value))}let i={};typeof e.id==`string`&&(i.id=e.id),`ignoredItemIds`in e&&(i.ignore=D(e.ignoredItemIds)),t!==void 0&&(i.type=t);let a={expression:n,parameters:r};return Object.keys(i).length>0&&(a.properties=i),a}function ue(e){let{expression:t}=e;if(typeof t!=`string`||t.length===0)return null;let n=Array.isArray(e.parameters)?e.parameters:[];if(!h(n[0]))throw new f(`Cannot emit a clean filter reference for "${t}".`);let r={...L(n[0]),expression:t};if(!C.has(t)){let e=n[1];if(e===void 0)throw new f(`Filter "${t}" is missing its value operand.`);if(r.value=k(e)&&w.has(t)?L(e):se(D(e)),ae.has(t)&&!ce(t,r.value))throw new f(`Cannot emit an invalid clean filter value for "${t}".`)}let{properties:i}=e;return i?.id!==void 0&&(r.id=i.id),i!==void 0&&`ignore`in i&&(r.ignoredItemIds=D(i.ignore)),r}function R(e){return g(e)}function z(e){return Array.isArray(e.filters)?e.filters:[]}function B(e,t){return e.properties?.type===`having`||e.properties?.type===`where`?e.properties.type:t??`where`}function V(e,t,n=1,r=new Set){S(n);let i=e.clause??t;for(let t of z(e))R(t)?V(t,i,n+1,r):typeof t.expression==`string`&&t.expression.length>0&&r.add(B(t,i));return r}function H(e,t,n=1){S(n);let r=e.clause??t;if(e.condition===`or`&&V(e,r,n).size>1)throw new f(`An "or" group mixes "where" and "having" filters, which clean output cannot represent.`);for(let t of z(e))R(t)&&H(t,r,n+1)}function U(e,t,n,r=1){S(r);let i=e.clause??n,a=[];for(let n of z(e)){if(R(n)){let e=U(n,t,i,r+1);e.filters.length>0&&a.push(e);continue}if(B(n,i)!==t)continue;let e=ue(n);e&&a.push(e)}let o={condition:e.condition===`or`?`or`:`and`,filters:a};return e.id!==void 0&&V(e,i,r).size<=1&&(o.id=e.id),o}function de(e){let t=e.clause;H(e,t);let n=V(e,t);return n.size===0&&n.add(t??`where`),[`where`,`having`].filter(e=>n.has(e)).map(n=>({...U(e,n,t),clause:n})).filter(e=>e.filters.length>0)}var fe=[`origin`,`datasetId`,`vizId`,`itemId`,`isDrilldown`,`type`];function W(e){return typeof e==`string`&&e.toLowerCase()===`or`?`or`:`and`}function pe(e){return g(e)}function me(e){if(!Array.isArray(e)||e.length===0)return[];let t=h(e[0])?e[0]:void 0,n=e.length>1?e[1]:void 0;return e.length>1?[t,n]:[t]}function he(e){if(typeof e.expression!=`string`||e.expression.length===0)return null;let t={expression:e.expression,parameters:me(e.parameters)};return e.properties!==void 0&&Object.keys(e.properties).length>0&&(t.properties=structuredClone(e.properties)),t}function G(e,t){let n=e,r=t;for(let e of fe)n[e]!==void 0&&(r[e]=n[e])}function K(e){if(!e||!e.filters)return{condition:`and`,filters:[],subGroups:[]};let t=[],n=[];for(let r of e.filters)if(pe(r))n.push(K(r));else{let e=he(r);e&&t.push(e)}let r={condition:W(e.condition),filters:t,subGroups:n};return e.id!==void 0&&(r.id=e.id),G(e,r),r}function q(e,t){return e?t?.format===`clean`?de(e):[K(e)]:[]}function ge(e,t){let n={expression:typeof e.expression==`string`?e.expression:void 0,parameters:Array.isArray(e.parameters)?[...e.parameters]:[]},r=h(e.properties)?structuredClone(e.properties):{};return t!==void 0&&r.type===void 0&&(r.type=t),Object.keys(r).length>0&&(n.properties=r),n}function _e(e,t,n){if(g(e))return J(e,t,n);if(!h(e))return;let r=e.expression;if(ne(e),y(e))return le(e,t);if(v(e)&&re(e),b(e))return ge(e,t);throw new f(`Filter leaf "${String(r)}" matches neither a complete clean nor a complete canonical encoding.`)}function J(e,t,n){S(n);let r=x(e.clause)?e.clause:void 0,i=r??t,a=[];for(let t of Array.isArray(e.filters)?e.filters:[]){let e=_e(t,i,n+1);e!==void 0&&a.push(e)}for(let t of Array.isArray(e.subGroups)?e.subGroups:[])g(t)&&a.push(J(t,i,n+1));let o={condition:W(e.condition),filters:a};return typeof e.id==`string`&&(o.id=e.id),r!==void 0&&(o.clause=r),G(e,o),o}function Y(e){return!e||e.length===0?[]:e.filter(e=>g(e)).map(e=>J(e,void 0,1))}var ve=`:host{font-family:var(--luzmo-filters-font-family,var(--luzmo-font-family));color:var(--luzmo-filters-font-color,var(--luzmo-font-color));max-width:100%;display:block;container-type:inline-size}.filter-group-container{max-width:100%;padding:calc(var(--luzmo-indicator-gap) + 2 * var(--luzmo-indicator-width));overflow-x:hidden}.filter-group{flex-direction:row;min-width:0;max-width:100%;display:flex}.filter-group.nested{margin-top:var(--luzmo-filters-nested-group-margin-top,var(--filters-nested-group-margin-top));margin-bottom:var(--luzmo-filters-nested-group-margin-bottom,var(--filters-nested-group-margin-bottom))}.group-content{flex-direction:column;flex:1;min-width:0;display:flex}.filters-list{gap:var(--luzmo-filters-filters-list-gap,var(--filters-filters-list-gap));flex-direction:column;min-width:0;max-width:100%;display:flex}.filter-item-wrapper{align-items:flex-start;min-width:0;max-width:100%;display:flex;position:relative}.filter-item-content{align-items:flex-start;gap:var(--luzmo-filters-filter-line-gap,var(--filters-filter-line-gap));flex-wrap:nowrap;flex:1;min-width:0;display:flex}.filter-item-content luzmo-filter-item{flex:1;min-width:0}.filter-item-content .delete-filter-button{flex-shrink:0;align-self:flex-end;margin-inline-start:auto}.condition-wrapper{flex:0 0 var(--luzmo-filters-condition-warpper-width,var(--filters-condition-warpper-width));justify-content:center;align-items:center;display:flex;position:relative}.condition-wrapper:before{content:"";left:50%;top:var(--luzmo-filters-vertical-line-top,var(--filters-vertical-line-top));bottom:var(--luzmo-filters-vertical-line-bottom,var(--filters-vertical-line-bottom));width:var(--luzmo-filters-vertical-line-width,var(--filters-vertical-line-width));background:var(--luzmo-filters-vertical-line-color,var(--luzmo-border-color));position:absolute}.condition-badge{min-width:auto;padding-inline:var(--luzmo-filters-condition-padding-horizontal,var(--filters-condition-padding-horizontal));font-weight:var(--luzmo-filters-condition-font-weight,var(--filters-condition-font-weight-emphasized));text-transform:uppercase;background:var(--luzmo-filters-condition-badge-background,var(--luzmo-primary));color:var(--luzmo-filters-condition-badge-color,var(--luzmo-primary-inverse-color));border-radius:var(--luzmo-filters-condition-badge-border-radius,var(--luzmo-border-radius));box-shadow:0 0 0 var(--luzmo-filters-condition-badge-halo,var(--filters-condition-badge-halo)) var(--luzmo-filters-condition-badge-background,var(--luzmo-background-color))}.condition-badge:hover{background:var(--luzmo-filters-condition-badge-background-hover,var(--luzmo-primary-hover))}.group-actions{margin-top:var(--luzmo-filters-group-actions-margin-top,var(--filters-group-actions-margin-top));gap:var(--luzmo-filters-group-actions-gap,var(--filters-group-actions-gap));flex-wrap:wrap;display:flex}.delete-group-button{margin-left:auto}.add-root-group-container{margin-top:var(--luzmo-filters-add-root-group-container-margin-top,var(--filters-add-root-group-container-margin-top));padding-left:0}.add-subgroup-button,.add-filter-button{--luzmo-action-button-text-to-visual:var(--luzmo-filters-group-actions-text-to-visual,var(--filters-group-actions-text-to-visual));--luzmo-action-button-content-color-default:var(--luzmo-filters-group-actions-color,var(--luzmo-primary-hover));--luzmo-action-button-content-color-hover:var(--luzmo-filters-group-actions-color-hover,var(--luzmo-primary-hover));--luzmo-action-button-content-color-down:var(--luzmo-filters-group-actions-color-down,var(--luzmo-primary-down));--luzmo-action-button-content-color-focus:var(--luzmo-filters-group-actions-color-focus,var(--luzmo-primary-focus))}.add-group-button{--luzmo-button-padding-label-to-icon:var(--luzmo-filters-add-group-button-text-to-visual,var(--filters-add-group-button-text-to-visual))}.dataset-ids-empty-message{color:var(--luzmo-filters-error-message-color,var(--luzmo-disabled-color));font-size:var(--luzmo-filters-error-message-font-size,var(--filters-font-size))}@container (width<=480px){.condition-badge{--luzmo-action-button-font-size:.6875rem;--luzmo-action-button-height:1.2rem;--luzmo-button-line-height:1.2rem;font-size:.6875rem;line-height:1.2rem;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)rotate(-90deg)}:host([dir=rtl]) .condition-badge{transform:translate(-50%,-50%)rotate(90deg)}}.filters-loading{min-height:var(--filters-progress-circle-size);align-items:center;display:inline-flex}.filters-loading luzmo-progress-circle{--luzmo-progress-circle-size:var(--filters-progress-circle-size)}.filters-text,.filters-outline{font-size:var(--luzmo-filters-text-font-size,var(--filters-text-font-size));line-height:1.5}.filters-outline{--filters-outline-sentence-padding-block:calc((var(--filters-outline-row-min-height) - 1lh) / 2)}luzmo-filter-item[display=text]{--luzmo-filter-item-column-badge-color:var(--luzmo-filters-column-badge-color);--luzmo-filter-item-column-badge-font-color:var(--luzmo-filters-column-badge-font-color);--luzmo-filter-item-text-font-size:var(--luzmo-filters-text-font-size,var(--filters-text-font-size));--luzmo-filter-item-text-expression-color:var(--luzmo-filters-expression-color,var(--filters-expression-color));--luzmo-filter-item-text-expression-font-weight:var(--luzmo-filters-expression-font-weight,var(--filters-expression-font-weight))}.filters-text luzmo-filter-item[display=text],.filters-text-group luzmo-filter-item[display=text]{--luzmo-filter-item-text-icon-gap:var(--luzmo-filters-text-icon-gap,var(--filters-text-icon-gap))}.outline-sentence>luzmo-filter-item[display=text]{--luzmo-filter-item-text-icon-gap:var(--luzmo-filters-text-part-gap,var(--filters-text-part-gap))}.filters-text{white-space:pre-wrap;word-break:break-word}.filters-text .filters-text-condition{margin-inline-start:0;margin-inline-end:0}.filters-text-condition,.filters-text-paren{vertical-align:middle}.filters-text-condition{color:var(--luzmo-filters-condition-color,var(--filters-condition-color));font-weight:var(--luzmo-filters-condition-font-weight,var(--filters-condition-font-weight))}.outline-group{gap:var(--luzmo-spacing-1);flex-direction:column;min-width:0;display:flex}.outline-children>.outline-group:not(:first-child){margin-top:calc(var(--luzmo-spacing-1) + var(--filters-outline-sentence-padding-block) + var(--filters-outline-join-spacing) - var(--luzmo-spacing-2))}.outline-condition{color:var(--luzmo-filters-condition-color,var(--filters-condition-color));font-size:var(--luzmo-filters-outline-condition-font-size,var(--filters-outline-condition-font-size));font-weight:var(--luzmo-filters-condition-font-weight,var(--filters-condition-font-weight-emphasized));letter-spacing:.04em}.outline-children{gap:var(--luzmo-spacing-2);min-width:0;flex-direction:column;margin-inline-start:var(--luzmo-filters-outline-children-margin-inline-start,var(--filters-outline-children-margin-inline-start));padding-inline-start:var(--luzmo-filters-outline-children-padding-inline-start,var(--filters-outline-children-padding-inline-start));display:flex;position:relative}.outline-children:not(.outline-children--single):before{content:"";inset-block:var(--luzmo-filters-outline-bracket-inset,var(--filters-outline-bracket-inset));width:var(--luzmo-spacing-2);border-inline-start:1px solid var(--luzmo-border-color);border-block-start:1px solid var(--luzmo-border-color);border-block-end:1px solid var(--luzmo-border-color);position:absolute}.outline-children:not(.outline-children--single):not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))):before{border-top-left-radius:var(--luzmo-border-radius);border-bottom-left-radius:var(--luzmo-border-radius);left:0}.outline-children:not(.outline-children--single):not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))):before{border-top-left-radius:var(--luzmo-border-radius);border-bottom-left-radius:var(--luzmo-border-radius);left:0}.outline-children:not(.outline-children--single):-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)):before{border-top-right-radius:var(--luzmo-border-radius);border-bottom-right-radius:var(--luzmo-border-radius);right:0}.outline-children:not(.outline-children--single):is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)):before{border-top-right-radius:var(--luzmo-border-radius);border-bottom-right-radius:var(--luzmo-border-radius);right:0}.outline-children--single{margin-inline-start:0;padding-inline-start:0}.outline-row{align-items:flex-start;column-gap:var(--luzmo-spacing-2);min-width:0;min-height:var(--filters-outline-row-min-height);flex-wrap:nowrap;display:flex}.outline-sentence{align-items:center;gap:var(--luzmo-filters-text-part-gap,var(--filters-text-part-gap));min-width:0;padding-block:var(--filters-outline-sentence-padding-block);flex-wrap:wrap;flex:auto;display:flex}.outline-delete{flex:none;align-self:flex-end;margin-inline-start:auto}:host{--filters-condition-warpper-width:56px;--filters-condition-padding-horizontal:var(--luzmo-spacing-2);--filters-condition-badge-halo:var(--luzmo-spacing-3);--filters-filters-list-gap:var(--luzmo-spacing-3);--filters-nested-group-margin-top:var(--luzmo-spacing-3);--filters-nested-group-margin-bottom:var(--luzmo-spacing-3);--filters-vertical-line-top:var(--luzmo-spacing-2);--filters-vertical-line-bottom:var(--luzmo-spacing-2);--filters-vertical-line-width:1px;--filters-group-actions-text-to-visual:var(--luzmo-spacing-2);--filters-add-group-button-text-to-visual:var(--luzmo-spacing-3);--filters-group-actions-gap:var(--luzmo-spacing-3);--filters-add-root-group-container-margin-top:var(--luzmo-spacing-4);--filters-filter-line-gap:var(--luzmo-spacing-3);--filters-group-actions-margin-top:var(--luzmo-spacing-3);--filters-error-message-font-size:var(--luzmo-font-size);--filters-text-font-size:var(--luzmo-font-size-m);--filters-outline-row-min-height:var(--luzmo-component-height);--filters-progress-circle-size:var(--luzmo-component-height);--filters-text-part-gap:var(--luzmo-spacing-2);--filters-text-icon-gap:var(--luzmo-spacing-1);--filters-outline-children-margin-inline-start:var(--luzmo-spacing-2);--filters-outline-children-padding-inline-start:var(--luzmo-spacing-3);--filters-outline-bracket-inset:var(--luzmo-spacing-2);--filters-outline-join-spacing:var(--luzmo-spacing-2);--filters-expression-color:var(--luzmo-filters-font-color,var(--luzmo-font-color));--filters-expression-font-weight:var(--luzmo-font-weight);--filters-condition-color:var(--luzmo-filters-font-color,var(--luzmo-font-color));--filters-condition-font-weight:var(--luzmo-font-weight);--filters-condition-font-weight-emphasized:var(--luzmo-font-weight-bold);--filters-outline-condition-font-size:var(--luzmo-font-size-s)}:host([size=s]){--filters-condition-warpper-width:48px;--filters-condition-padding-horizontal:var(--luzmo-spacing-2);--filters-condition-badge-halo:var(--luzmo-spacing-2);--filters-filters-list-gap:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--filters-nested-group-margin-top:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--filters-nested-group-margin-bottom:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--filters-vertical-line-top:var(--luzmo-spacing-2);--filters-vertical-line-bottom:var(--luzmo-spacing-2);--filters-group-actions-text-to-visual:var(--luzmo-spacing-1);--filters-add-group-button-text-to-visual:var(--luzmo-spacing-2);--filters-group-actions-gap:var(--luzmo-spacing-2);--filters-add-root-group-container-margin-top:var(--luzmo-spacing-3);--filters-filter-line-gap:var(--luzmo-spacing-2);--filters-group-actions-margin-top:var(--luzmo-spacing-2);--filters-error-message-font-size:var(--luzmo-font-size-s);--filters-text-font-size:var(--luzmo-font-size-s);--filters-outline-row-min-height:var(--luzmo-component-height-s);--filters-progress-circle-size:var(--luzmo-component-height-s);--filters-text-part-gap:var(--luzmo-spacing-1);--filters-text-icon-gap:var(--luzmo-spacing-1);--filters-outline-children-margin-inline-start:var(--luzmo-spacing-1);--filters-outline-children-padding-inline-start:var(--luzmo-spacing-3);--filters-outline-bracket-inset:var(--luzmo-spacing-1);--filters-outline-join-spacing:var(--luzmo-spacing-1);--filters-outline-condition-font-size:var(--luzmo-font-size-xs)}:host([size=l]){--filters-condition-warpper-width:64px;--filters-condition-padding-horizontal:var(--luzmo-spacing-3);--filters-condition-badge-halo:var(--luzmo-spacing-4);--filters-filters-list-gap:var(--luzmo-spacing-4);--filters-nested-group-margin-top:var(--luzmo-spacing-4);--filters-nested-group-margin-bottom:var(--luzmo-spacing-4);--filters-vertical-line-top:var(--luzmo-spacing-3);--filters-vertical-line-bottom:var(--luzmo-spacing-3);--filters-group-actions-text-to-visual:var(--luzmo-spacing-2);--filters-add-group-button-text-to-visual:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--filters-group-actions-gap:var(--luzmo-spacing-3);--filters-add-root-group-container-margin-top:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-filter-line-gap:var(--luzmo-spacing-3);--filters-group-actions-margin-top:var(--luzmo-spacing-3);--filters-error-message-font-size:var(--luzmo-font-size-l);--filters-text-font-size:var(--luzmo-font-size-l);--filters-outline-row-min-height:var(--luzmo-component-height-l);--filters-progress-circle-size:var(--luzmo-component-height-l);--filters-text-part-gap:var(--luzmo-spacing-3);--filters-text-icon-gap:var(--luzmo-spacing-2);--filters-outline-children-margin-inline-start:var(--luzmo-spacing-3);--filters-outline-children-padding-inline-start:var(--luzmo-spacing-4);--filters-outline-bracket-inset:var(--luzmo-spacing-2);--filters-outline-join-spacing:var(--luzmo-spacing-3);--filters-outline-condition-font-size:var(--luzmo-font-size-m)}:host([size=xl]){--filters-condition-warpper-width:72px;--filters-condition-padding-horizontal:var(--luzmo-spacing-3);--filters-condition-badge-halo:var(--luzmo-spacing-4);--filters-filters-list-gap:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-nested-group-margin-top:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-nested-group-margin-bottom:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-vertical-line-top:var(--luzmo-spacing-3);--filters-vertical-line-bottom:var(--luzmo-spacing-3);--filters-group-actions-text-to-visual:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--filters-add-group-button-text-to-visual:var(--luzmo-spacing-4);--filters-group-actions-gap:var(--luzmo-spacing-4);--filters-add-root-group-container-margin-top:var(--luzmo-spacing-5);--filters-filter-line-gap:var(--luzmo-spacing-4);--filters-group-actions-margin-top:var(--luzmo-spacing-4);--filters-error-message-font-size:var(--luzmo-font-size-xl);--filters-text-font-size:var(--luzmo-font-size-xl);--filters-outline-row-min-height:var(--luzmo-component-height-xl);--filters-progress-circle-size:var(--luzmo-component-height-xl);--filters-text-part-gap:var(--luzmo-spacing-4);--filters-text-icon-gap:var(--luzmo-spacing-2);--filters-outline-children-margin-inline-start:var(--luzmo-spacing-4);--filters-outline-children-padding-inline-start:var(--luzmo-spacing-5);--filters-outline-bracket-inset:var(--luzmo-spacing-3);--filters-outline-join-spacing:var(--luzmo-spacing-3);--filters-outline-condition-font-size:var(--luzmo-font-size-l)}@container (width<=480px){.filter-group-container{--filters-condition-warpper-width:32px;--filters-condition-padding-horizontal:var(--luzmo-spacing-2);--filters-condition-badge-halo:var(--luzmo-spacing-2);--filters-filters-list-gap:var(--luzmo-spacing-5)}}`;function X(e){if(e instanceof f)return e;throw e}var Z={and:()=>(0,l.msg)(`AND`,{desc:`Logical AND condition for combining filters`}),or:()=>(0,l.msg)(`OR`,{desc:`Logical OR condition for combining filters`})};function Q(e){return e===`and`?`or`:`and`}var $=class extends t.t((0,d.SizedMixin)(d.LuzmoElement,{validSizes:Object.values(d.ElementSizes)})){constructor(...e){super(...e),this.apiUrl=`https://api.luzmo.com`,this.contentLanguage=`en`,this.filters=[],this.format=`canonical`,this.simple=!1,this.display=`rich`,this.columnDisplay=`text`,this.quiet=!1,this.readonly=!1,this.allowParameters=!1,this.parameters=[],this.debounce=300,this._internalFilterGroup=null,this._datasets=[],this._datasetsLoading=!1,this._hierarchyLabels=new Map,this._hierarchyLabelsLoading=!1,this._hasSyntheticRoot=!1,this._datasetRequest=0,this._hierarchyRequest=0,this._debounceTimeout=null,this._filterKeys=new WeakMap}static get styles(){return[(0,s.unsafeCSS)(ve)]}_filterKey(e){let t=this._filterKeys.get(e);return t||(t={},this._filterKeys.set(e,t)),t}_preserveFilterKeys(e,t){this._isGroup(e)===this._isGroup(t)&&(this._filterKeys.set(t,this._filterKey(e)),this._isGroup(e)&&this._isGroup(t)&&t.filters.forEach((t,n)=>{let r=e.filters[n];r&&this._preserveFilterKeys(r,t)}))}_isCurrentGroup(e){return this._internalFilterGroup!==null&&(e===this._internalFilterGroup||this._findParentGroup(this._internalFilterGroup,e)!==null)}get _oneSizeSmaller(){return{xxs:`xxs`,xs:`xs`,s:`xs`,m:`s`,l:`m`,xl:`l`,xxl:`xl`}[this.size]||`s`}get _isDatasetIdsEmpty(){return!this.datasetIds||this.datasetIds.length===0}get _hasUnsupportedConditions(){let e=t=>t.condition===`or`||t.filters.some(t=>this._isGroup(t)&&e(t));return this.simple&&this._internalFilterGroup!==null&&e(this._internalFilterGroup)}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.display!==`rich`&&this._loadDatasetsForDisplay()}disconnectedCallback(){super.disconnectedCallback(),this._datasetRequest+=1,this._hierarchyRequest+=1,this._debounceTimeout&&=(clearTimeout(this._debounceTimeout),null)}willUpdate(e){if(super.willUpdate(e),e.has(`filters`))try{let e=Y(this.filters),t=this._internalFilterGroup;this._debounceTimeout&&=(clearTimeout(this._debounceTimeout),null),e.length===0?(this._internalFilterGroup=null,this._hasSyntheticRoot=!1):e.length===1?(this._internalFilterGroup=structuredClone(e[0]),this._hasSyntheticRoot=!1):(this._internalFilterGroup={condition:`and`,filters:structuredClone(e)},this._hasSyntheticRoot=!0),t&&this._internalFilterGroup&&this._preserveFilterKeys(t,this._internalFilterGroup)}catch(t){console.warn(`[${this.localName}] Keeping the current filters, the new value cannot be normalized:`,X(t)),this.filters=e.get(`filters`)??[]}this.display!==`rich`&&(e.has(`display`)||e.has(`datasetIds`)||e.has(`authKey`)||e.has(`authToken`)||e.has(`apiUrl`)||e.has(`cacheTime`))&&this._loadDatasetsForDisplay(),this.display!==`rich`&&(e.has(`filters`)||e.has(`display`)||e.has(`contentLanguage`))&&this._loadHierarchyLabelsForDisplay()}async _loadDatasetsForDisplay(){let e=++this._datasetRequest;if(!this.datasetIds||this.datasetIds.length===0){this._datasets=[],this._datasetsLoading=!1,this._loadHierarchyLabelsForDisplay();return}let{valid:t,invalid:i}=r.c(this.datasetIds);if(i.length>0&&console.warn(`[${this.localName}] Invalid dataset IDs provided (not valid UUIDs): ${i.join(`, `)}. These will be skipped.`),t.length===0)this._datasets=[],this._datasetsLoading=!1,this._loadHierarchyLabelsForDisplay();else{this._datasetsLoading=!0,this._configureDataBroker();try{let r=await n.n.fetchDatasetsWithColumnsAndFormulas(t);if(!this.isConnected||e!==this._datasetRequest)return;this._datasets=r}catch(t){if(!this.isConnected||e!==this._datasetRequest)return;console.error(`[${this.localName}] Error fetching dataset columns & formulas:`,t),this._datasets=[]}finally{this.isConnected&&e===this._datasetRequest&&(this._datasetsLoading=!1,this._loadHierarchyLabelsForDisplay())}}}_configureDataBroker(){let e={authKey:this.authKey||``,authToken:this.authToken||``};this.apiUrl&&(e.apiUrl=this.apiUrl),this.cacheTime&&(e.staleTime=this.cacheTime,e.gcTime=this.cacheTime*2),n.n.configure(e)}async _loadHierarchyLabelsForDisplay(){let e=++this._hierarchyRequest;if(this.display===`rich`||!this._internalFilterGroup){if(!this.isConnected||e!==this._hierarchyRequest)return;this._hierarchyLabels=new Map,this._hierarchyLabelsLoading=!1;return}let t=a.n(this._internalFilterGroup,this._filterTextContext());if(t.length===0){if(!this.isConnected||e!==this._hierarchyRequest)return;this._hierarchyLabels=new Map,this._hierarchyLabelsLoading=!1}else{this._hierarchyLabelsLoading=!0,this._configureDataBroker();try{let n=await a.i(t,this.contentLanguage);if(!this.isConnected||e!==this._hierarchyRequest)return;this._hierarchyLabels=n}catch(t){if(!this.isConnected||e!==this._hierarchyRequest)return;console.error(`[${this.localName}] Error fetching hierarchy member names:`,t)}finally{this.isConnected&&e===this._hierarchyRequest&&(this._hierarchyLabelsLoading=!1)}}}_filterTextContext(){return{datasets:this._datasets,contentLanguage:this.contentLanguage,timeZone:this.timeZone,hierarchyLabels:this._hierarchyLabels,hierarchyLabelsLoading:this._hierarchyLabelsLoading}}_generateEmptyGroup(){return{id:i.t(),condition:`and`,filters:[]}}_generateEmptyFilter(){return{expression:void 0,parameters:[],properties:{id:i.t()}}}_rootGroupsForExport(){if(!this._internalFilterGroup)return[];let e=this._internalFilterGroup.filters.length>0&&this._internalFilterGroup.filters.every(e=>this._isGroup(e));return this._hasSyntheticRoot&&e?structuredClone(this._internalFilterGroup.filters):[structuredClone(this._internalFilterGroup)]}_getFiltersForExport(){let e=this._rootGroupsForExport(),t=this.format===`clean`?`clean`:`canonical`;if(e.length===0)return{filters:[],format:t};if(t===`clean`)try{return{filters:e.flatMap(e=>q(e,{format:`clean`})),format:`clean`}}catch(e){console.warn(`[${this.localName}] Cannot emit clean filters, falling back to canonical output:`,X(e))}return{filters:e.flatMap(e=>q(e)),format:`canonical`}}_sendChangeEvent(){this._debounceTimeout&&clearTimeout(this._debounceTimeout);let e=()=>{this._debounceTimeout=null,!this._hasUnsupportedConditions&&this.dispatchEvent(new CustomEvent(`luzmo-filters-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:this._getFiltersForExport()}))};this.debounce>0?this._debounceTimeout=setTimeout(e,this.debounce):e()}_isGroup(e){return`condition`in e&&`filters`in e}_handleParameterCreated(e){let t=e.detail?.parameter;this.readonly||!t||this.parameters.some(({parameter:e})=>e===t.parameter)||(this.parameters=[...this.parameters,t])}_toggleCondition(e){this.readonly||this.simple||(e.condition=Q(e.condition),e===this._internalFilterGroup&&(this._hasSyntheticRoot=!1),this.requestUpdate(),this._sendChangeEvent())}_addFilter(e){if(this.readonly||this._isDatasetIdsEmpty||this._hasUnsupportedConditions)return;let t=e;t||=(this._internalFilterGroup||=this._generateEmptyGroup(),this._internalFilterGroup),t.filters.push(this._generateEmptyFilter()),this.requestUpdate(),this._sendChangeEvent()}_addSubGroup(e){if(this.readonly||this._isDatasetIdsEmpty||this.simple)return;let t=this._generateEmptyGroup();t.condition=Q(e.condition),t.filters.push(this._generateEmptyFilter()),e.filters.push(t),this.requestUpdate(),this._sendChangeEvent()}_removeFilter(e,t){if(this.readonly||!this._internalFilterGroup||!this._isCurrentGroup(e)||this._hasUnsupportedConditions)return;let n=e.filters.findIndex(e=>this._filterKey(e)===t);if(n!==-1){if(e.filters.splice(n,1),e!==this._internalFilterGroup&&e.filters.length===0){let t=this._findParentGroup(this._internalFilterGroup,e);if(t){let n=t.filters.indexOf(e);n!==-1&&t.filters.splice(n,1)}}this._collapseGroupsAfterDelete(),this.requestUpdate(),this._sendChangeEvent()}}_updateFilter(e,t,n){n.stopPropagation();let r=n.currentTarget;if(this.readonly||!r?.isConnected||this._hasUnsupportedConditions||!this._isCurrentGroup(e))return;let i=e.filters.findIndex(e=>this._filterKey(e)===t);i!==-1&&(this._isGroup(e.filters[i])||(this._filterKeys.set(n.detail.filter,t),e.filters[i]=n.detail.filter,this._sendChangeEvent()))}_addGroup(){if(this.readonly||this._isDatasetIdsEmpty||this.simple)return;this._internalFilterGroup||=this._generateEmptyGroup();let e=this._generateEmptyGroup();e.condition=Q(this._internalFilterGroup.condition),e.filters.push(this._internalFilterGroup);let t=this._generateEmptyGroup();t.condition=Q(e.condition),t.filters.push(this._generateEmptyFilter()),e.filters.push(t),this._internalFilterGroup=e,this._hasSyntheticRoot=!1,this.requestUpdate(),this._sendChangeEvent()}_renderFilterItem(e,t){return s.html`
|
|
21
|
-
<div class="filter-item-wrapper">
|
|
22
|
-
<div class="filter-item-content">
|
|
23
|
-
<luzmo-filter-item
|
|
24
|
-
.apiUrl=${this.apiUrl}
|
|
25
|
-
.authKey=${this.authKey}
|
|
26
|
-
.authToken=${this.authToken}
|
|
27
|
-
.cacheTime=${this.cacheTime}
|
|
28
|
-
.language=${this.language}
|
|
29
|
-
.contentLanguage=${this.contentLanguage}
|
|
30
|
-
.timeZone=${this.timeZone}
|
|
31
|
-
.datasetIds=${this.datasetIds}
|
|
32
|
-
.filter=${e}
|
|
33
|
-
.allowParameters=${this.allowParameters}
|
|
34
|
-
.parameters=${this.parameters}
|
|
35
|
-
.size=${this.size}
|
|
36
|
-
.quiet=${this.quiet}
|
|
37
|
-
.readonly=${this.readonly}
|
|
38
|
-
@luzmo-filter-changed=${this._updateFilter.bind(this,t,this._filterKey(e))}
|
|
39
|
-
@luzmo-parameter-created=${this._handleParameterCreated}
|
|
40
|
-
></luzmo-filter-item>
|
|
41
|
-
<luzmo-action-button
|
|
42
|
-
class="delete-filter-button"
|
|
43
|
-
.size=${this.size}
|
|
44
|
-
quiet
|
|
45
|
-
aria-disabled=${this.readonly?`true`:s.nothing}
|
|
46
|
-
.label=${(0,l.msg)(`Remove filter`,{desc:`Aria label for remove filter button`})}
|
|
47
|
-
@click=${this._removeFilter.bind(this,t,this._filterKey(e))}
|
|
48
|
-
>
|
|
49
|
-
<luzmo-icon slot="icon" .icon=${o.luzmoTrashOutline} .size=${this.size}></luzmo-icon>
|
|
50
|
-
</luzmo-action-button>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
`}_renderGroup(e,t=!1){let n=e.filters.length>0,r=e.filters.length>1,i=Z[e.condition]?.()??e.condition;return s.html`
|
|
54
|
-
<div class="filter-group ${t&&!this.simple?`nested`:``}" role="group">
|
|
55
|
-
${!this.simple&&(t||r)?s.html`
|
|
56
|
-
<div class="condition-wrapper">
|
|
57
|
-
${r?s.html`
|
|
58
|
-
<luzmo-action-button
|
|
59
|
-
class="condition-badge"
|
|
60
|
-
.size=${this._oneSizeSmaller}
|
|
61
|
-
quiet
|
|
62
|
-
aria-disabled=${this.readonly?`true`:s.nothing}
|
|
63
|
-
aria-pressed=${e.condition===`and`?`true`:`false`}
|
|
64
|
-
.label=${(0,l.msg)(`Toggle filter condition, currently `,{desc:`Aria label prefix for filter condition toggle`})+i}
|
|
65
|
-
@click=${this._toggleCondition.bind(this,e)}
|
|
66
|
-
>
|
|
67
|
-
${i}
|
|
68
|
-
</luzmo-action-button>
|
|
69
|
-
`:s.nothing}
|
|
70
|
-
</div>
|
|
71
|
-
`:s.nothing}
|
|
72
|
-
<div class="group-content">
|
|
73
|
-
${n?s.html`
|
|
74
|
-
<div class="filters-list">
|
|
75
|
-
${(0,u.repeat)(e.filters,e=>this._filterKey(e),t=>s.html`
|
|
76
|
-
${this._isGroup(t)?this._renderGroup(t,!0):this._renderFilterItem(t,e)}
|
|
77
|
-
`)}
|
|
78
|
-
</div>
|
|
79
|
-
`:``}
|
|
80
|
-
|
|
81
|
-
<div class="group-actions">
|
|
82
|
-
<luzmo-action-button
|
|
83
|
-
class="add-filter-button"
|
|
84
|
-
.size=${this.size}
|
|
85
|
-
quiet
|
|
86
|
-
aria-disabled=${this.readonly?`true`:s.nothing}
|
|
87
|
-
?disabled=${this._isDatasetIdsEmpty}
|
|
88
|
-
@click=${this._addFilter.bind(this,e)}
|
|
89
|
-
>
|
|
90
|
-
<luzmo-icon slot="icon" .icon=${o.luzmoPlus} .size=${this._oneSizeSmaller}></luzmo-icon>
|
|
91
|
-
${(0,l.msg)(`Filter`,{desc:`Add filter button label`})}
|
|
92
|
-
</luzmo-action-button>
|
|
93
|
-
|
|
94
|
-
${this.simple?s.nothing:s.html`<luzmo-action-button
|
|
95
|
-
class="add-subgroup-button"
|
|
96
|
-
.size=${this.size}
|
|
97
|
-
quiet
|
|
98
|
-
aria-disabled=${this.readonly?`true`:s.nothing}
|
|
99
|
-
?disabled=${this._isDatasetIdsEmpty}
|
|
100
|
-
@click=${this._addSubGroup.bind(this,e)}
|
|
101
|
-
>
|
|
102
|
-
<luzmo-icon slot="icon" .icon=${o.luzmoPlus} .size=${this._oneSizeSmaller}></luzmo-icon>
|
|
103
|
-
${(0,l.msg)(`Subgroup`,{desc:`Add subgroup button label`})}
|
|
104
|
-
</luzmo-action-button>`}
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
`}_findParentGroup(e,t){for(let n of e.filters){if(n===t)return e;if(this._isGroup(n)){let e=this._findParentGroup(n,t);if(e)return e}}return null}_collapseIfNeeded(e){if(e.filters.length===1&&this._isGroup(e.filters[0])){let t=e.filters[0];e.condition=t.condition,e.filters=t.filters,e.id=t.id,e.clause=t.clause,e.origin=t.origin,e.datasetId=t.datasetId,e.vizId=t.vizId,e.itemId=t.itemId,e.isDrilldown=t.isDrilldown,e.type=t.type,e===this._internalFilterGroup&&(this._hasSyntheticRoot=!1)}}_collapseGroupsAfterDelete(){if(!this._internalFilterGroup)return;let e=t=>{for(let n of t.filters)this._isGroup(n)&&e(n);this._collapseIfNeeded(t)};e(this._internalFilterGroup)}_renderTextLeaf(e){return a.r(e,this._filterTextContext())?s.html`<luzmo-filter-item
|
|
109
|
-
class="filters-text-leaf"
|
|
110
|
-
display="text"
|
|
111
|
-
.columnDisplay=${this.columnDisplay}
|
|
112
|
-
.filter=${e}
|
|
113
|
-
.textContext=${this._filterTextContext()}
|
|
114
|
-
.language=${this.language}
|
|
115
|
-
.contentLanguage=${this.contentLanguage}
|
|
116
|
-
.timeZone=${this.timeZone}
|
|
117
|
-
.size=${this.size}
|
|
118
|
-
readonly
|
|
119
|
-
></luzmo-filter-item>`:s.nothing}_renderTextGroup(e,t){let n=[];for(let t of e.filters){let e=this._isGroup(t)?this._renderTextGroup(t,!1):this._renderTextLeaf(t);e!==s.nothing&&n.push(e)}if(n.length===0)return s.nothing;if(n.length===1)return n[0];let r=s.html`<span class="filters-text-condition">${Z[e.condition]()}</span>`,i=e.condition===`or`?(0,l.msg)(l.str`${a.a[0]}\u2063 ${a.a[1]}\u2063 ${a.a[2]}`,{id:`filters-sentence-or`,desc:`Left filter sentence, logical OR condition, and right filter sentence`}):(0,l.msg)(l.str`${a.a[0]}\u2063 ${a.a[1]}\u2063 ${a.a[2]}`,{id:`filters-sentence-and`,desc:`Left filter sentence, logical AND condition, and right filter sentence`}),o=n.slice(1).reduce((e,t)=>a.o(i,[s.html`${e}`,r,t]),[n[0]]);return t?s.html`${o}`:s.html`<span class="filters-text-group"
|
|
120
|
-
>${a.o((0,l.msg)(l.str`(${a.a[0]})`,{id:`filters-sentence-parentheses`,desc:`Nested filter sentence wrapped in parentheses`}),[s.html`${o}`]).map(e=>typeof e==`string`?s.html`<span class="filters-text-paren">${e}</span>`:e)}</span
|
|
121
|
-
>`}_renderDatasetLoading(){let e=(0,l.msg)(`Loading filters`,{desc:`Accessible label while filter column names are loading`});return s.html`<div class="filters-loading" role="status">
|
|
122
|
-
<luzmo-progress-circle indeterminate .label=${e} .size=${this.size}></luzmo-progress-circle>
|
|
123
|
-
</div>`}_renderTextDisplay(){return s.html`<span class="filters-text" part="filters-text"
|
|
124
|
-
>${this._internalFilterGroup?this._renderTextGroup(this._internalFilterGroup,!0):s.nothing}</span
|
|
125
|
-
>`}_deleteOutlineFilter(e,t){this.readonly||this.display!==`outline`||this._removeFilter(e,t)}_renderOutlineRow(e,t){let n=this._renderTextLeaf(e);if(n===s.nothing)return s.nothing;let r=(0,l.msg)(`Remove filter`,{desc:`Aria label for remove filter button`});return s.html`<div class="outline-row" part="filters-outline-row">
|
|
126
|
-
<span class="outline-sentence">${n}</span>
|
|
127
|
-
${this.readonly?s.nothing:s.html`<luzmo-action-button
|
|
128
|
-
class="delete-filter-button outline-delete"
|
|
129
|
-
.size=${this.size}
|
|
130
|
-
quiet
|
|
131
|
-
.label=${r}
|
|
132
|
-
@click=${()=>this._deleteOutlineFilter(t,this._filterKey(e))}
|
|
133
|
-
>
|
|
134
|
-
<luzmo-icon slot="icon" .icon=${o.luzmoTrashOutline} .size=${this.size}></luzmo-icon>
|
|
135
|
-
</luzmo-action-button>`}
|
|
136
|
-
</div>`}_renderOutlineGroup(e,t=!0){let n=e.filters.some(e=>this._isGroup(e)),r=e.filters.length>1&&!(t&&!n&&e.condition===`and`),i=Z[e.condition]?.()??e.condition;return s.html`<div class="outline-group" role=${r?`group`:s.nothing} aria-label=${r?i:s.nothing}>
|
|
137
|
-
${r?s.html`<div class="outline-condition">${i}</div>`:s.nothing}
|
|
138
|
-
<div class=${r?`outline-children`:`outline-children outline-children--single`}>
|
|
139
|
-
${(0,u.repeat)(e.filters,e=>this._filterKey(e),t=>this._isGroup(t)?this._renderOutlineGroup(t,!1):this._renderOutlineRow(t,e))}
|
|
140
|
-
</div>
|
|
141
|
-
</div>`}_renderOutlineDisplay(){return s.html`<div class="filters-outline" part="filters-outline">
|
|
142
|
-
${this._internalFilterGroup?this._renderOutlineGroup(this._internalFilterGroup):s.nothing}
|
|
143
|
-
</div>`}render(){if(this._hasUnsupportedConditions&&this.display!==`text`)return s.html`<div class="filter-group-container" role="status">
|
|
144
|
-
${(0,l.msg)(`Filters containing OR cannot be edited in AND-only mode.`,{desc:`Explains why existing OR filters are not editable in the simplified filter editor`})}
|
|
145
|
-
</div>`;if(this.display===`text`||this.display===`outline`)return this._datasetsLoading&&this._datasets.length===0?this._renderDatasetLoading():this.display===`text`?this._renderTextDisplay():this._renderOutlineDisplay();if(this._isDatasetIdsEmpty)return s.html`
|
|
146
|
-
<div class="filter-group-container">
|
|
147
|
-
<div class="dataset-ids-empty-message" role="status">
|
|
148
|
-
${(0,l.msg)(`Cannot retrieve dataset data fields`,{desc:`Error message when datasetIds is empty`})}
|
|
149
|
-
</div>
|
|
150
|
-
</div>
|
|
151
|
-
`;if(!this._internalFilterGroup||this._internalFilterGroup.filters.length===0)return s.html`
|
|
152
|
-
<div class="filter-group-container">
|
|
153
|
-
<luzmo-button
|
|
154
|
-
class="add-filter-button"
|
|
155
|
-
.size=${this.size}
|
|
156
|
-
treatment="outline"
|
|
157
|
-
?quiet=${this.quiet}
|
|
158
|
-
aria-disabled=${this.readonly?`true`:s.nothing}
|
|
159
|
-
?disabled=${this._isDatasetIdsEmpty}
|
|
160
|
-
@click=${()=>this._addFilter()}
|
|
161
|
-
>
|
|
162
|
-
<luzmo-icon slot="icon" .icon=${o.luzmoPlus} .size=${this._oneSizeSmaller}></luzmo-icon>
|
|
163
|
-
${(0,l.msg)(`Add filter`,{desc:`Add filter button label`})}
|
|
164
|
-
</luzmo-button>
|
|
165
|
-
</div>
|
|
166
|
-
`;let e=this._internalFilterGroup.filters.length>1;return s.html`
|
|
167
|
-
<div class="filter-group-container">
|
|
168
|
-
${this._renderGroup(this._internalFilterGroup)}
|
|
169
|
-
|
|
170
|
-
${e&&!this.simple?s.html`
|
|
171
|
-
<div class="add-root-group-container">
|
|
172
|
-
<luzmo-button
|
|
173
|
-
class="add-group-button"
|
|
174
|
-
.size=${this.size}
|
|
175
|
-
treatment="outline"
|
|
176
|
-
?quiet=${this.quiet}
|
|
177
|
-
aria-disabled=${this.readonly?`true`:s.nothing}
|
|
178
|
-
?disabled=${this._isDatasetIdsEmpty}
|
|
179
|
-
@click=${this._addGroup}
|
|
180
|
-
>
|
|
181
|
-
<luzmo-icon slot="icon" .icon=${o.luzmoPlus} .size=${this._oneSizeSmaller}></luzmo-icon>
|
|
182
|
-
${(0,l.msg)(`Group`,{desc:`Add group button label`})}
|
|
183
|
-
</luzmo-button>
|
|
184
|
-
</div>
|
|
185
|
-
`:``}
|
|
186
|
-
</div>
|
|
187
|
-
`}};e.t([(0,c.property)({type:String,attribute:`api-url`,reflect:!0})],$.prototype,`apiUrl`,void 0),e.t([(0,c.property)({type:String,attribute:`auth-key`,reflect:!0})],$.prototype,`authKey`,void 0),e.t([(0,c.property)({type:String,attribute:`auth-token`,reflect:!0})],$.prototype,`authToken`,void 0),e.t([(0,c.property)({type:Number,attribute:`cache-time`,reflect:!0})],$.prototype,`cacheTime`,void 0),e.t([(0,c.property)({type:String,attribute:`content-language`,reflect:!0})],$.prototype,`contentLanguage`,void 0),e.t([(0,c.property)({type:String,attribute:`time-zone`,reflect:!0})],$.prototype,`timeZone`,void 0),e.t([(0,c.property)({type:Array,attribute:`dataset-ids`,reflect:!0})],$.prototype,`datasetIds`,void 0),e.t([(0,c.property)({type:Array,reflect:!1})],$.prototype,`filters`,void 0),e.t([(0,c.property)({type:String,reflect:!0})],$.prototype,`format`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0})],$.prototype,`simple`,void 0),e.t([(0,c.property)({type:String,reflect:!0})],$.prototype,`display`,void 0),e.t([(0,c.property)({type:String,attribute:`column-display`,reflect:!0})],$.prototype,`columnDisplay`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0})],$.prototype,`quiet`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0})],$.prototype,`readonly`,void 0),e.t([(0,c.property)({type:Boolean,attribute:`allow-parameters`,reflect:!0})],$.prototype,`allowParameters`,void 0),e.t([(0,c.property)({attribute:!1})],$.prototype,`parameters`,void 0),e.t([(0,c.property)({type:Number,reflect:!0})],$.prototype,`debounce`,void 0),e.t([(0,c.state)()],$.prototype,`_internalFilterGroup`,void 0),e.t([(0,c.state)()],$.prototype,`_datasets`,void 0),e.t([(0,c.state)()],$.prototype,`_datasetsLoading`,void 0),e.t([(0,c.state)()],$.prototype,`_hierarchyLabels`,void 0),e.t([(0,c.state)()],$.prototype,`_hierarchyLabelsLoading`,void 0),$=e.t([(0,l.localized)()],$),customElements.get(`luzmo-filters`)||customElements.define(`luzmo-filters`,$),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
|
|
@@ -1,268 +0,0 @@
|
|
|
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}});
|