@luzmo/analytics-components-kit 1.0.1-alpha.41 → 1.0.1-alpha.43
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/components/{calculate-data-item-icon-B9B0iLjm.js → calculate-data-item-icon-DKjZwr-x.js} +61 -43
- package/components/{calculate-data-item-icon-CjHO4KtA.cjs → calculate-data-item-icon-DlfbBvFN.cjs} +1 -1
- package/components/display-settings/display-settings.d.ts +1 -0
- package/components/display-settings/index.cjs +1 -86
- package/components/display-settings/index.js +6 -216
- package/components/display-settings-binning/index.cjs +1 -1
- package/components/display-settings-binning/index.js +5 -5
- package/components/display-settings-datetime/index.cjs +1 -1
- package/components/display-settings-datetime/index.js +5 -5
- package/components/display-settings-grand-totals/index.cjs +1 -1
- package/components/display-settings-grand-totals/index.js +6 -6
- package/components/display-settings-numeric/index.cjs +2 -2
- package/components/display-settings-numeric/index.js +5 -5
- package/components/display-settings-period-over-period/index.cjs +8 -8
- package/components/display-settings-period-over-period/index.js +82 -71
- package/components/draggable-data-item/draggable-data-item.d.ts +2 -0
- package/components/draggable-data-item/index.cjs +6 -5
- package/components/draggable-data-item/index.js +21 -17
- package/components/draggable-data-item-level/draggable-data-item-level.d.ts +3 -0
- package/components/draggable-data-item-level/index.cjs +12 -7
- package/components/draggable-data-item-level/index.js +79 -60
- package/components/droppable-slot/droppable-slot.d.ts +6 -2
- package/components/droppable-slot/index.cjs +72 -11
- package/components/droppable-slot/index.js +659 -129
- package/components/edit-item/index.cjs +1 -1
- package/components/edit-item/index.js +4 -4
- package/components/edit-option/index.cjs +1 -1
- package/components/edit-option/index.js +1 -1
- package/components/edit-option-action-button-group/index.cjs +1 -1
- package/components/edit-option-action-button-group/index.js +3 -3
- package/components/{edit-option-base-BQc4gXup.js → edit-option-base-CbpBi6I7.js} +3 -3
- package/components/{edit-option-base-ByphLI4J.cjs → edit-option-base-Db3JjWMk.cjs} +1 -1
- package/components/edit-option-color-picker/index.cjs +1 -1
- package/components/edit-option-color-picker/index.js +2 -2
- package/components/edit-option-multi-language-field/index.cjs +1 -1
- package/components/edit-option-multi-language-field/index.js +2 -2
- package/components/edit-option-number-field/index.cjs +1 -1
- package/components/edit-option-number-field/index.js +2 -2
- package/components/edit-option-picker/index.cjs +1 -1
- package/components/edit-option-picker/index.js +2 -2
- package/components/edit-option-position-picker/index.cjs +1 -1
- package/components/edit-option-position-picker/index.js +2 -2
- package/components/edit-option-positions-number-field/index.cjs +2 -2
- package/components/edit-option-positions-number-field/index.js +4 -4
- package/components/edit-option-radio-button-group/index.cjs +1 -1
- package/components/edit-option-radio-button-group/index.js +2 -2
- package/components/edit-option-slider/index.cjs +1 -1
- package/components/edit-option-slider/index.js +2 -2
- package/components/edit-option-switch/index.cjs +1 -1
- package/components/edit-option-switch/index.js +2 -2
- package/components/edit-option-text-field/index.cjs +1 -1
- package/components/edit-option-text-field/index.js +2 -2
- package/components/filter-data-item-picker/index.cjs +1 -1
- package/components/filter-data-item-picker/index.js +2 -2
- package/components/filter-expression-picker/index.cjs +1 -1
- package/components/filter-expression-picker/index.js +1 -1
- package/components/filter-item/index.cjs +1 -1
- package/components/filter-item/index.js +3 -3
- package/components/filter-value-picker/index.cjs +1 -1
- package/components/filter-value-picker/index.js +1 -1
- package/components/filter-value-picker-datetime/index.cjs +1 -1
- package/components/filter-value-picker-datetime/index.js +1 -1
- package/components/filter-value-picker-hierarchy/index.cjs +1 -1
- package/components/filter-value-picker-hierarchy/index.js +2 -2
- package/components/filter-value-picker-numeric/index.cjs +1 -1
- package/components/filter-value-picker-numeric/index.js +2 -2
- package/components/{focusable-BTJYY_Mf.cjs → focusable-B8t8a-WJ.cjs} +1 -1
- package/components/{focusable-BXhQz3_k.js → focusable-Bhf_beoW.js} +1 -1
- package/components/grid/index.cjs +8 -8
- package/components/grid/index.js +126 -126
- package/components/{if-defined-CTc4c9nr.js → if-defined-Dg09naf2.js} +1 -1
- package/components/{if-defined-Bulnuz1A.cjs → if-defined-DjdbEoAa.cjs} +1 -1
- package/components/{index-8fxgV8-A.js → index-BNCgbOV2.js} +2 -2
- package/components/{index-DQbl3h5H.cjs → index-BNFpjvqX.cjs} +1 -1
- package/components/index-BqMMcuLX.cjs +121 -0
- package/components/index-Cw_HnduG.js +304 -0
- package/components/{index-BiY07GvX.js → index-DM0JWaVq.js} +4 -4
- package/components/{index-DM96Q1fX.cjs → index-MVmoiSxL.cjs} +1 -1
- package/components/index.cjs +1 -1
- package/components/index.js +3 -3
- package/components/luzmo-icons-Bvm-_ECi.cjs +31 -0
- package/components/{luzmo-icons-v9hKZ3HV.js → luzmo-icons-DnAqAQCX.js} +176 -142
- package/components/{property-Dn4zSyxu.js → property-BFMfZY1k.js} +81 -78
- package/components/property-BV1QaY8E.cjs +42 -0
- package/components/{sized-mixin-BNtmplgF.cjs → sized-mixin-C48t6K7U.cjs} +1 -1
- package/components/{sized-mixin-BR_Ii7le.js → sized-mixin-CkdMApAU.js} +1 -1
- package/components/slot-contents-picker/index.cjs +8 -8
- package/components/slot-contents-picker/index.js +8 -8
- package/components/slot-menu/index.cjs +10 -9
- package/components/slot-menu/index.js +150 -80
- package/components/slot-menu/slot-menu.d.ts +5 -5
- package/components/slot-menu-list/index.cjs +2 -2
- package/components/slot-menu-list/index.js +4 -4
- package/components/{state-vVJlsarL.js → state-BSTa7W6f.js} +1 -1
- package/components/{state-BxZEcclm.cjs → state-CuE7TJCY.cjs} +1 -1
- package/components/{task-qPJdeXO1.cjs → task-0B-FC3rj.cjs} +1 -1
- package/components/{task-PQaVY8Iw.js → task-CDsB8Kbr.js} +1 -1
- package/custom-elements.json +75 -13
- package/package.json +1 -1
- package/utils/data-item-types/calculate-data-item-icon.d.ts +1 -0
- package/utils/drag/draggable.d.ts +13 -0
- package/utils/store/slot-context.d.ts +4 -0
- package/utils/store/slot-store.d.ts +21 -0
- package/components/luzmo-icons-B_3XTuMC.cjs +0 -31
- package/components/property-BCb4Kybn.cjs +0 -42
@@ -17,7 +17,7 @@
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
18
|
* SOFTWARE.
|
19
19
|
* */
|
20
|
-
import { E as r } from "./property-
|
20
|
+
import { E as r } from "./property-BFMfZY1k.js";
|
21
21
|
/**
|
22
22
|
* @license
|
23
23
|
* Copyright 2018 Google LLC
|
@@ -17,7 +17,7 @@
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
18
|
* SOFTWARE.
|
19
19
|
* */
|
20
|
-
"use strict";const r=require("./property-
|
20
|
+
"use strict";const r=require("./property-BV1QaY8E.cjs");/**
|
21
21
|
* @license
|
22
22
|
* Copyright 2018 Google LLC
|
23
23
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -20,12 +20,12 @@
|
|
20
20
|
import "./index-CsDgk_sj.js";
|
21
21
|
import "./index-Bdy8Bz-n.js";
|
22
22
|
import "./index-ChDwMQlU.js";
|
23
|
-
import { r as v, x as _, n as d } from "./property-
|
23
|
+
import { r as v, x as _, n as d } from "./property-BFMfZY1k.js";
|
24
24
|
import { m as e, g as q, t as E, s as D } from "./set-locale-DbEAMqUs.js";
|
25
25
|
import { l as $ } from "./localized-decorator-DNr1P1m0.js";
|
26
26
|
import { m as z, b as T, I as L } from "./base-D76d76ww-BGkuhs54.js";
|
27
27
|
import "./focusable-BxtpnzWp-DJQkL8Zv.js";
|
28
|
-
import { r as S } from "./state-
|
28
|
+
import { r as S } from "./state-BSTa7W6f.js";
|
29
29
|
const m = () => [
|
30
30
|
{
|
31
31
|
id: "? = ?",
|
@@ -17,7 +17,7 @@
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
18
|
* SOFTWARE.
|
19
19
|
* */
|
20
|
-
"use strict";const F=require("./task-
|
20
|
+
"use strict";const F=require("./task-0B-FC3rj.cjs"),L=require("./property-BV1QaY8E.cjs"),S=require("./focusable-B8t8a-WJ.cjs"),D=require("./if-defined-DjdbEoAa.cjs"),B=(e,i,t)=>{const r=n=>{for(const o of n??[]){if(o.key===e)return t?o:o.control;if(o.children){const s=r(o.children);if(s)return s}}return null};if(i&&Array.isArray(i))for(const n of i){const o=r(n.children);if(o)return o}return null},G=":host{font-family:var(--luzmo-edit-option-font-family, var(--luzmo-font-family));font-size:var(--luzmo-edit-option-font-size, var(--luzmo-font-size))}:host([size=s]){font-size:var(--luzmo-edit-option-font-size-s, var(--luzmo-font-size-s))}:host([size=l]){font-size:var(--luzmo-edit-option-font-size-l, var(--luzmo-font-size-l))}:host([size=xl]){font-size:var(--luzmo-edit-option-font-size-xl, var(--luzmo-font-size-xl))}",A=e=>{var t,r,n;let i;return typeof((t=e==null?void 0:e.controlInfo)==null?void 0:t.default)=="function"?i=e.controlInfo.default({options:e.options,slots:e.slots,theme:e.theme}):((r=e.controlInfo)==null?void 0:r.default)!==void 0&&((n=e.controlInfo)==null?void 0:n.default)!==null&&(i=e.controlInfo.default),i},w=e=>{var o,s,a,p,f,l,y,q,v,b,c,m,u,h,d;let i;typeof((o=e.controlInfo)==null?void 0:o.extraLabel)=="function"?i=e.controlInfo.extraLabel({options:e.options,slots:e.slots,theme:e.theme}):typeof((s=e.controlInfo)==null?void 0:s.extraLabel)=="string"&&(i=e.controlInfo.extraLabel),typeof i=="string"&&(i=((l=(f=(p=(a=e.translations)==null?void 0:a.options)==null?void 0:p[e.optionKey])==null?void 0:f.extraLabel)==null?void 0:l[i])??i);let t;typeof((y=e.controlInfo)==null?void 0:y.extraLabelTooltip)=="function"?i=e.controlInfo.extraLabelTooltip({options:e.options,slots:e.slots,theme:e.theme}):typeof((q=e.controlInfo)==null?void 0:q.extraLabelTooltip)=="string"&&(t=e.controlInfo.extraLabelTooltip),typeof t=="string"&&(i=((m=(c=(b=(v=e.translations)==null?void 0:v.options)==null?void 0:b[e.optionKey])==null?void 0:c.extraLabelTooltip)==null?void 0:m[t])??t);let r;typeof((u=e.controlInfo)==null?void 0:u.extraLabelHasClickAction)=="function"?r=e.controlInfo.extraLabelHasClickAction({options:e.options,slots:e.slots,theme:e.theme}):typeof((h=e.controlInfo)==null?void 0:h.extraLabelHasClickAction)=="boolean"&&(r=e.controlInfo.extraLabelHasClickAction);const n=typeof((d=e.controlInfo)==null?void 0:d.extraLabelClickAction)=="function"?()=>e.controlInfo.extraLabelClickAction({options:e.options,slots:e.slots,theme:e.theme}):()=>{};return{extraLabel:i,extraLabelTooltip:t,extraLabelHasClickAction:r,extraLabelClickAction:n}},O=(e,i)=>{var r;const t=(e==null?void 0:e.options)??{};if(typeof((r=e==null?void 0:e.controlInfo)==null?void 0:r.calculateValue)=="function")return e.controlInfo.calculateValue({options:t});if(i.includes(".")){const n=i.split(".");let o=t;for(let a=0;a<n.length-1;a++)o=o[n[a]]??{};const s=n.length-1;return o[n[s]]}return t[i]},H=e=>i=>{var r,n;let t={...e.options};if(typeof((r=e==null?void 0:e.controlInfo)==null?void 0:r.toOptions)=="function")t=e.controlInfo.toOptions({options:t,value:(n=i==null?void 0:i.detail)==null?void 0:n.value});else if(e.optionKey.includes(".")){const o=e.optionKey.split(".");let s=t;for(let p=0;p<o.length-1;p++)s[o[p]]=s[o[p]]??{},s=s[o[p]];const a=o.length-1;s[o[a]]=i.detail.value}else t[e.optionKey]=i.detail.value;return e.changeCallback(t)},R=e=>{var q,v,b,c,m,u,h,d,P,x,$,I;const i=((b=(v=(q=e.translations)==null?void 0:q.options)==null?void 0:v[e.optionKey])==null?void 0:b.label)??((c=e.controlInfo)==null?void 0:c.label)??e.optionKey??"",t=e.size,r={};Object.keys((m=e.controlInfo)==null?void 0:m.values).forEach(k=>{var z,C,V,T,M,E;r[k]={...(z=e.controlInfo)==null?void 0:z.values[k],label:((M=(T=(V=(C=e.translations)==null?void 0:C.options)==null?void 0:V[e.optionKey])==null?void 0:T.enum)==null?void 0:M[k])??((E=e.controlInfo)==null?void 0:E.values[k].label)}});const n=((d=(h=(u=e.translations)==null?void 0:u.options)==null?void 0:h[e.optionKey])==null?void 0:d.tooltip)??((P=e.controlInfo)==null?void 0:P.tooltip),o=O(e,e.optionKey),s=A(e),{extraLabel:a,extraLabelTooltip:p,extraLabelHasClickAction:f,extraLabelClickAction:l}=w(e),y=H(e);return L.x`
|
21
21
|
<luzmo-edit-option-action-button-group
|
22
22
|
.label=${i}
|
23
23
|
.value=${o}
|
@@ -0,0 +1,121 @@
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
2
|
+
*
|
3
|
+
* Copyright © 2025 Luzmo
|
4
|
+
* All rights reserved.
|
5
|
+
* Luzmo web components (“Luzmo Web Components”)
|
6
|
+
* must be used according to the Luzmo Terms of Service.
|
7
|
+
* This license allows users with a current active Luzmo account
|
8
|
+
* to use the Luzmo Web Components. This license terminates
|
9
|
+
* automatically if a user no longer has an active Luzmo account.
|
10
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
11
|
+
*
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
* SOFTWARE.
|
19
|
+
* */
|
20
|
+
"use strict";const v=require("./task-0B-FC3rj.cjs");require("./index-DtohCwyO.cjs");require("./index-j8UKjHqY.cjs");require("./index-DSQyBS9Z.cjs");require("./index-Tx5oQjbt.cjs");require("./index-BKwbYw6x.cjs");require("./index-cHKqEi5-.cjs");require("./index-CYeQkVeJ.cjs");const i=require("./property-BV1QaY8E.cjs"),b=require("./state-CuE7TJCY.cjs"),y=require("./query-D5qWDopr.cjs"),d=require("./luzmo-icons-Bvm-_ECi.cjs"),z=require("./focusable-B8t8a-WJ.cjs"),c=require("./sized-mixin-C48t6K7U.cjs");/**
|
21
|
+
* @license
|
22
|
+
* Copyright 2021 Google LLC
|
23
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
24
|
+
*/let p=class extends Event{constructor(e,s,r,t){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=s,this.callback=r,this.subscribe=t??!1}};/**
|
25
|
+
* @license
|
26
|
+
* Copyright 2021 Google LLC
|
27
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
28
|
+
*//**
|
29
|
+
* @license
|
30
|
+
* Copyright 2021 Google LLC
|
31
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
32
|
+
*/class g{constructor(e,s,r,t){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(a,u)=>{this.unsubscribe&&(this.unsubscribe!==u&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=a,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(a,u)),this.unsubscribe=u},this.host=e,s.context!==void 0){const a=s;this.context=a.context,this.callback=a.callback,this.subscribe=a.subscribe??!1}else this.context=s,this.callback=r,this.subscribe=t??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new p(this.context,this.host,this.t,this.subscribe))}}/**
|
33
|
+
* @license
|
34
|
+
* Copyright 2022 Google LLC
|
35
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
36
|
+
*/function h({context:l,subscribe:e}){return(s,r)=>{typeof r=="object"?r.addInitializer(function(){new g(this,{context:l,callback:t=>{s.set.call(this,t)},subscribe:e})}):s.constructor.addInitializer(t=>{new g(t,{context:l,callback:a=>{t[r]=a},subscribe:e})})}}const m=Symbol("slot-store-context"),f=":host{font-family:var(--luzmo-display-settings-font-family, var(--luzmo-font-family));font-size:var(--luzmo-display-settings-font-size, var(--display-settings-font-size));color:var(--luzmo-display-settings-font-color, var(--luzmo-font-color))}.settings-container{display:flex;flex-direction:column;gap:var(--luzmo-spacing-2)}.settings-row{display:flex;justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-gap, var(--display-settings-gap))}luzmo-divider{margin:var(--luzmo-display-settings-ids-container-vertical-margin, var(--display-settings-ids-container-vertical-margin)) 0}.setting{display:flex;align-items:center}.label-action-container{display:flex;align-items:center;justify-content:space-between;gap:var(--luzmo-display-settings-info-to-remove-icon-gap, var(--display-settings-info-to-remove-icon-gap))}.id-button,.remove-button{outline:none;cursor:pointer;border:none;background:none;font-size:var(--luzmo-display-settings-font-size, var(--display-settings-font-size));color:var(--luzmo-display-settings-font-color, var(--luzmo-font-color))}.remove-button{display:block;width:var(--luzmo-display-settings-remove-button-size, var(--display-settings-remove-button-size));height:var(--luzmo-display-settings-remove-button-size, var(--display-settings-remove-button-size));border-radius:var(--luzmo-display-settings-remove-button-border-radius, 50%)}.remove-button:hover{background-color:var(--luzmo-display-settings-remove-button-background-color-hover, var(--luzmo-background-color-hover))}.remove-button:active,.remove-button:focus{background-color:var(--luzmo-display-settings-remove-button-background-color-down, var(--luzmo-background-color-down))}.remove-button:focus-visible{box-shadow:0 0 0 var(--luzmo-display-settings-remove-button-indicator-thickness, var(--display-settings-remove-button-indicator-thickness)) var(--highcontrast-remove-button-indicator-color, var(--luzmo-display-settings-remove-button-indicator-color, var(--display-settings-remove-button-indicator-color)))}.ids-container{display:flex;flex-direction:column;gap:var(--luzmo-display-settings-gap, var(--display-settings-gap));border-radius:50%}.id-label{text-transform:var(--luzmo-display-settings-id-label-text-transform, var(--display-settings-id-label-text-transform));font-size:var(--luzmo-display-settings-id-label-font-size, var(--display-settings-id-label-font-size));color:var(--luzmo-display-settings-id-label-color, var(--display-settings-id-label-color))}:host{--display-settings-font-family: var(--luzmo-font-family);--display-settings-id-label-text-transform: uppercase;--display-settings-id-label-color: var(--luzmo-secondary);--display-settings-remove-button-indicator-color: var(--luzmo-primary);--display-settings-remove-button-indicator-thickness: var( --luzmo-border-width )}:host{--display-settings-font-size: var(--luzmo-font-size);--display-settings-id-label-font-size: var(--luzmo-font-size-s);--display-settings-gap: var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-4);--display-settings-info-to-remove-icon-gap: var(--luzmo-spacing-5);--display-settings-remove-button-size: var(--luzmo-component-height)}:host([size=s]){--display-settings-id-label-font-size: var(--luzmo-font-size-s);--display-settings-font-size: var(--luzmo-font-size-s);--display-settings-gap: var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-3);--display-settings-info-to-remove-icon-gap: var(--luzmo-spacing-4);--display-settings-remove-button-size: var(--luzmo-component-height-s)}:host([size=l]){--display-settings-id-label-font-size: var(--luzmo-font-size);--display-settings-font-size: var(--luzmo-font-size-l);--display-settings-gap: var(--luzmo-spacing-4);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-5);--display-settings-info-to-remove-icon-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--display-settings-remove-button-size: var(--luzmo-component-height-l)}:host([size=xl]){--display-settings-id-label-font-size: var(--luzmo-font-size-l);--display-settings-font-size: var(--luzmo-font-size-xl);--display-settings-gap: var(--luzmo-spacing-5);--display-settings-ids-container-vertical-margin: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--display-settings-info-to-remove-icon-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--display-settings-remove-button-size: var(--luzmo-component-height-xl)}";var _=Object.defineProperty,o=(l,e,s,r)=>{for(var t=void 0,a=l.length-1,u;a>=0;a--)(u=l[a])&&(t=u(e,s,t)||t);return t&&_(e,s,t),t};class n extends c.SizedMixin(z.LuzmoElement,{validSizes:Object.values(c.ElementSizes)}){constructor(){super(...arguments),this._loadDisplaySettings=new v.h(this,{task:async([e,s,r])=>{const t=[];this.grandTotals&&t.push("grandTotals"),this.periodOverPeriod&&t.push("periodOverPeriod"),(s==="numeric"||s==="mixed"&&(e==null?void 0:e.type)==="numeric")&&t.push("numeric"),s!=="numeric"&&(e==null?void 0:e.type)==="datetime"&&t.push("datetime"),!["numeric","mixed"].includes(s??"")&&(e==null?void 0:e.type)==="numeric"&&!this.binningDisabled&&t.push("binning"),t.length>0&&!r&&(t.includes("numeric")&&!this._settingsTypeLoaded.numeric?(await Promise.resolve().then(()=>require("./display-settings-numeric/index.cjs")),this._settingsTypeLoaded.numeric=!0,t.includes("periodOverPeriod")&&!this._settingsTypeLoaded.periodOverPeriod&&(await Promise.resolve().then(()=>require("./display-settings-period-over-period/index.cjs")),this._settingsTypeLoaded.periodOverPeriod=!0)):t.includes("datetime")&&!this._settingsTypeLoaded.datetime?(await Promise.resolve().then(()=>require("./display-settings-datetime/index.cjs")),this._settingsTypeLoaded.datetime=!0):t.includes("binning")&&!this._settingsTypeLoaded.binning?(await Promise.resolve().then(()=>require("./display-settings-binning/index.cjs")),this._settingsTypeLoaded.binning=!0):t.includes("grandTotals")&&!this._settingsTypeLoaded.grandTotals&&(await Promise.resolve().then(()=>require("./display-settings-grand-totals/index.cjs")),this._settingsTypeLoaded.grandTotals=!0))},args:()=>[this.slotContent,this.slotType,this.hideDisplaySettings]}),this.language="en",this.contentLanguage="en",this.slotType="numeric",this.slotContent={},this._showIds=!1,this.measureColumns=[],this._settingsTypeLoaded={binning:!1,datetime:!1,numeric:!1,grandTotals:!1,periodOverPeriod:!1,hierarchy:!0},this._currentSlotContent={}}static get styles(){return[i.r(f)]}willUpdate(e){if(e.has("slotContent"))this._currentSlotContent=structuredClone(this.slotContent);else if(this._store){const s=this._store.activeContent;s&&s!==this._currentSlotContent&&(this._currentSlotContent=structuredClone(s))}}_onSlotContentChange(e){e.stopPropagation(),e.preventDefault(),this._currentSlotContent=structuredClone(e.detail.slotContent),this._sendEvent(),this.requestUpdate()}_onLabelChange(){this._currentSlotContent=structuredClone(this._currentSlotContent),this._currentSlotContent.label=this._multiLanguageFieldElement.value||{},this._sendEvent(),this.requestUpdate()}_sendEvent(){this.dispatchEvent(new CustomEvent("slot-content-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:{...this._currentSlotContent}}})),this._store&&this._store.updateContent({...this._currentSlotContent})}_removeEvent(){this.dispatchEvent(new CustomEvent("remove-slot-content",{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:this._currentSlotContent}}))}_toggleIds(){this._showIds=!this._showIds}_renderDisplaySettings(){return i.x`<div class="settings-container">
|
37
|
+
<div class="settings-row">
|
38
|
+
<div class="setting">
|
39
|
+
<div class="label-container">
|
40
|
+
<luzmo-field-label side-aligned="start" .size=${this.size}
|
41
|
+
>Label:</luzmo-field-label
|
42
|
+
>
|
43
|
+
<luzmo-multi-language-field
|
44
|
+
.language=${this.language}
|
45
|
+
.value=${this._currentSlotContent.label}
|
46
|
+
.size=${this.size}
|
47
|
+
debounce="200"
|
48
|
+
@change=${this._onLabelChange}
|
49
|
+
></luzmo-multi-language-field>
|
50
|
+
</div>
|
51
|
+
<div class="label-action-container">
|
52
|
+
<button class="id-button" @click=${this._toggleIds}>
|
53
|
+
${d.y3(d.p1)}
|
54
|
+
<luzmo-tooltip self-managed placement="top" size=${this.size}>
|
55
|
+
Show dataset and column id's
|
56
|
+
</luzmo-tooltip>
|
57
|
+
</button>
|
58
|
+
${this.showRemoveButton?i.x`<button
|
59
|
+
class="remove-button"
|
60
|
+
@click=${this._removeEvent}
|
61
|
+
>
|
62
|
+
${d.y3(d.C1)}
|
63
|
+
<luzmo-tooltip
|
64
|
+
self-managed
|
65
|
+
placement="top"
|
66
|
+
size=${this.size}
|
67
|
+
>
|
68
|
+
Remove
|
69
|
+
</luzmo-tooltip>
|
70
|
+
</button>`:""}
|
71
|
+
</div>
|
72
|
+
</div>
|
73
|
+
</div>
|
74
|
+
${this.grandTotals?i.x`<luzmo-display-settings-grand-totals
|
75
|
+
.language=${this.language}
|
76
|
+
.slotContent=${this._currentSlotContent}
|
77
|
+
.size=${this.size}
|
78
|
+
@slot-content-changed=${this._onSlotContentChange}
|
79
|
+
></luzmo-display-settings-grand-totals>`:""}
|
80
|
+
${this.slotType==="numeric"||this.slotType==="mixed"&&this.slotContent.type==="numeric"?i.x`<luzmo-display-settings-numeric
|
81
|
+
.language=${this.language}
|
82
|
+
.slotContent=${this._currentSlotContent}
|
83
|
+
.size=${this.size}
|
84
|
+
.measureColumns=${this.measureColumns}
|
85
|
+
@slot-content-changed=${this._onSlotContentChange}
|
86
|
+
></luzmo-display-settings-numeric>`:""}
|
87
|
+
${this.slotType!=="numeric"&&this.slotContent.type==="datetime"?i.x`<luzmo-display-settings-datetime
|
88
|
+
.language=${this.language}
|
89
|
+
.contentLanguage=${this.contentLanguage}
|
90
|
+
.slotContent=${this._currentSlotContent}
|
91
|
+
.size=${this.size}
|
92
|
+
@slot-content-changed=${this._onSlotContentChange}
|
93
|
+
></luzmo-display-settings-datetime>`:""}
|
94
|
+
${!["numeric","mixed"].includes(this.slotType??"")&&this.slotContent.type==="numeric"&&!this.binningDisabled?i.x`<luzmo-display-settings-binning
|
95
|
+
.language=${this.language}
|
96
|
+
.slotContent=${this._currentSlotContent}
|
97
|
+
.size=${this.size}
|
98
|
+
@slot-content-changed=${this._onSlotContentChange}
|
99
|
+
></luzmo-display-settings-binning>`:""}
|
100
|
+
${this.periodOverPeriod?i.x`<luzmo-display-settings-period-over-period
|
101
|
+
.language=${this.language}
|
102
|
+
.slotContent=${this._currentSlotContent}
|
103
|
+
.size=${this.size}
|
104
|
+
@slot-content-changed=${this._onSlotContentChange}
|
105
|
+
></luzmo-display-settings-period-over-period>`:""}
|
106
|
+
</div>
|
107
|
+
${this._showIds?i.x` <luzmo-divider></luzmo-divider>
|
108
|
+
<div class="ids-container">
|
109
|
+
<div>
|
110
|
+
<span class="id-label">Column: </span>
|
111
|
+
${this._currentSlotContent.columnId??this._currentSlotContent.column}
|
112
|
+
</div>
|
113
|
+
<div>
|
114
|
+
<span class="id-label">Dataset: </span>
|
115
|
+
${this._currentSlotContent.datasetId??this._currentSlotContent.set}
|
116
|
+
</div>
|
117
|
+
<div></div>
|
118
|
+
</div>`:""}`}render(){return this._loadDisplaySettings.render({pending:()=>i.x`<luzmo-progress-circle
|
119
|
+
indeterminate
|
120
|
+
.size=${this.size}
|
121
|
+
></luzmo-progress-circle>`,complete:()=>this._renderDisplaySettings(),error:()=>this._renderDisplaySettings()})}}o([i.n({type:String})],n.prototype,"language");o([i.n({type:String,attribute:"content-language"})],n.prototype,"contentLanguage");o([i.n({type:Boolean,attribute:"hide-display-settings"})],n.prototype,"hideDisplaySettings");o([i.n({type:Boolean,attribute:"binning-disabled"})],n.prototype,"binningDisabled");o([i.n({type:Boolean,attribute:"grand-totals"})],n.prototype,"grandTotals");o([i.n({type:Boolean,attribute:"period-over-period"})],n.prototype,"periodOverPeriod");o([i.n({type:Boolean,attribute:"show-remove-button"})],n.prototype,"showRemoveButton");o([i.n({type:String,attribute:"slot-type"})],n.prototype,"slotType");o([i.n()],n.prototype,"slotContent");o([b.r()],n.prototype,"_showIds");o([i.n({type:Array,reflect:!1})],n.prototype,"measureColumns");o([y.e("luzmo-multi-language-field")],n.prototype,"_multiLanguageFieldElement");o([h({context:m,subscribe:!0})],n.prototype,"_store");customElements.get("luzmo-display-settings")||customElements.define("luzmo-display-settings",n);exports.LuzmoDisplaySettings=n;exports.c=h;exports.s=p;exports.slotContext=m;
|
@@ -0,0 +1,304 @@
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
2
|
+
*
|
3
|
+
* Copyright © 2025 Luzmo
|
4
|
+
* All rights reserved.
|
5
|
+
* Luzmo web components (“Luzmo Web Components”)
|
6
|
+
* must be used according to the Luzmo Terms of Service.
|
7
|
+
* This license allows users with a current active Luzmo account
|
8
|
+
* to use the Luzmo Web Components. This license terminates
|
9
|
+
* automatically if a user no longer has an active Luzmo account.
|
10
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
11
|
+
*
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
* SOFTWARE.
|
19
|
+
* */
|
20
|
+
import { h as g } from "./task-CDsB8Kbr.js";
|
21
|
+
import "./index-CskV_bXp.js";
|
22
|
+
import "./index-CsDgk_sj.js";
|
23
|
+
import "./index-BC1LV3vH.js";
|
24
|
+
import "./index-CbuHBIDB.js";
|
25
|
+
import "./index-C3N6qTxJ.js";
|
26
|
+
import "./index-DE3d0E0P.js";
|
27
|
+
import "./index-BmshD32H.js";
|
28
|
+
import { r as m, x as l, n as r } from "./property-BFMfZY1k.js";
|
29
|
+
import { r as h } from "./state-BSTa7W6f.js";
|
30
|
+
import { e as v } from "./query-Ddbd72Um.js";
|
31
|
+
import { a7 as c, af as b, ab as y } from "./luzmo-icons-DnAqAQCX.js";
|
32
|
+
import { L as z } from "./focusable-Bhf_beoW.js";
|
33
|
+
import { S as f, E as _ } from "./sized-mixin-CkdMApAU.js";
|
34
|
+
/**
|
35
|
+
* @license
|
36
|
+
* Copyright 2021 Google LLC
|
37
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
38
|
+
*/
|
39
|
+
let C = class extends Event {
|
40
|
+
constructor(e, s, a, t) {
|
41
|
+
super("context-request", { bubbles: !0, composed: !0 }), this.context = e, this.contextTarget = s, this.callback = a, this.subscribe = t ?? !1;
|
42
|
+
}
|
43
|
+
};
|
44
|
+
/**
|
45
|
+
* @license
|
46
|
+
* Copyright 2021 Google LLC
|
47
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
48
|
+
*/
|
49
|
+
/**
|
50
|
+
* @license
|
51
|
+
* Copyright 2021 Google LLC
|
52
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
53
|
+
*/
|
54
|
+
class p {
|
55
|
+
constructor(e, s, a, t) {
|
56
|
+
if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, u) => {
|
57
|
+
this.unsubscribe && (this.unsubscribe !== u && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = o, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(o, u)), this.unsubscribe = u;
|
58
|
+
}, this.host = e, s.context !== void 0) {
|
59
|
+
const o = s;
|
60
|
+
this.context = o.context, this.callback = o.callback, this.subscribe = o.subscribe ?? !1;
|
61
|
+
} else this.context = s, this.callback = a, this.subscribe = t ?? !1;
|
62
|
+
this.host.addController(this);
|
63
|
+
}
|
64
|
+
hostConnected() {
|
65
|
+
this.dispatchRequest();
|
66
|
+
}
|
67
|
+
hostDisconnected() {
|
68
|
+
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
|
69
|
+
}
|
70
|
+
dispatchRequest() {
|
71
|
+
this.host.dispatchEvent(new C(this.context, this.host, this.t, this.subscribe));
|
72
|
+
}
|
73
|
+
}
|
74
|
+
/**
|
75
|
+
* @license
|
76
|
+
* Copyright 2022 Google LLC
|
77
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
78
|
+
*/
|
79
|
+
function $({ context: d, subscribe: e }) {
|
80
|
+
return (s, a) => {
|
81
|
+
typeof a == "object" ? a.addInitializer(function() {
|
82
|
+
new p(this, { context: d, callback: (t) => {
|
83
|
+
s.set.call(this, t);
|
84
|
+
}, subscribe: e });
|
85
|
+
}) : s.constructor.addInitializer((t) => {
|
86
|
+
new p(t, { context: d, callback: (o) => {
|
87
|
+
t[a] = o;
|
88
|
+
}, subscribe: e });
|
89
|
+
});
|
90
|
+
};
|
91
|
+
}
|
92
|
+
const S = Symbol("slot-store-context"), x = ":host{font-family:var(--luzmo-display-settings-font-family, var(--luzmo-font-family));font-size:var(--luzmo-display-settings-font-size, var(--display-settings-font-size));color:var(--luzmo-display-settings-font-color, var(--luzmo-font-color))}.settings-container{display:flex;flex-direction:column;gap:var(--luzmo-spacing-2)}.settings-row{display:flex;justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-gap, var(--display-settings-gap))}luzmo-divider{margin:var(--luzmo-display-settings-ids-container-vertical-margin, var(--display-settings-ids-container-vertical-margin)) 0}.setting{display:flex;align-items:center}.label-action-container{display:flex;align-items:center;justify-content:space-between;gap:var(--luzmo-display-settings-info-to-remove-icon-gap, var(--display-settings-info-to-remove-icon-gap))}.id-button,.remove-button{outline:none;cursor:pointer;border:none;background:none;font-size:var(--luzmo-display-settings-font-size, var(--display-settings-font-size));color:var(--luzmo-display-settings-font-color, var(--luzmo-font-color))}.remove-button{display:block;width:var(--luzmo-display-settings-remove-button-size, var(--display-settings-remove-button-size));height:var(--luzmo-display-settings-remove-button-size, var(--display-settings-remove-button-size));border-radius:var(--luzmo-display-settings-remove-button-border-radius, 50%)}.remove-button:hover{background-color:var(--luzmo-display-settings-remove-button-background-color-hover, var(--luzmo-background-color-hover))}.remove-button:active,.remove-button:focus{background-color:var(--luzmo-display-settings-remove-button-background-color-down, var(--luzmo-background-color-down))}.remove-button:focus-visible{box-shadow:0 0 0 var(--luzmo-display-settings-remove-button-indicator-thickness, var(--display-settings-remove-button-indicator-thickness)) var(--highcontrast-remove-button-indicator-color, var(--luzmo-display-settings-remove-button-indicator-color, var(--display-settings-remove-button-indicator-color)))}.ids-container{display:flex;flex-direction:column;gap:var(--luzmo-display-settings-gap, var(--display-settings-gap));border-radius:50%}.id-label{text-transform:var(--luzmo-display-settings-id-label-text-transform, var(--display-settings-id-label-text-transform));font-size:var(--luzmo-display-settings-id-label-font-size, var(--display-settings-id-label-font-size));color:var(--luzmo-display-settings-id-label-color, var(--display-settings-id-label-color))}:host{--display-settings-font-family: var(--luzmo-font-family);--display-settings-id-label-text-transform: uppercase;--display-settings-id-label-color: var(--luzmo-secondary);--display-settings-remove-button-indicator-color: var(--luzmo-primary);--display-settings-remove-button-indicator-thickness: var( --luzmo-border-width )}:host{--display-settings-font-size: var(--luzmo-font-size);--display-settings-id-label-font-size: var(--luzmo-font-size-s);--display-settings-gap: var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-4);--display-settings-info-to-remove-icon-gap: var(--luzmo-spacing-5);--display-settings-remove-button-size: var(--luzmo-component-height)}:host([size=s]){--display-settings-id-label-font-size: var(--luzmo-font-size-s);--display-settings-font-size: var(--luzmo-font-size-s);--display-settings-gap: var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-3);--display-settings-info-to-remove-icon-gap: var(--luzmo-spacing-4);--display-settings-remove-button-size: var(--luzmo-component-height-s)}:host([size=l]){--display-settings-id-label-font-size: var(--luzmo-font-size);--display-settings-font-size: var(--luzmo-font-size-l);--display-settings-gap: var(--luzmo-spacing-4);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-5);--display-settings-info-to-remove-icon-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--display-settings-remove-button-size: var(--luzmo-component-height-l)}:host([size=xl]){--display-settings-id-label-font-size: var(--luzmo-font-size-l);--display-settings-font-size: var(--luzmo-font-size-xl);--display-settings-gap: var(--luzmo-spacing-5);--display-settings-ids-container-vertical-margin: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--display-settings-info-to-remove-icon-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--display-settings-remove-button-size: var(--luzmo-component-height-xl)}";
|
93
|
+
var w = Object.defineProperty, n = (d, e, s, a) => {
|
94
|
+
for (var t = void 0, o = d.length - 1, u; o >= 0; o--)
|
95
|
+
(u = d[o]) && (t = u(e, s, t) || t);
|
96
|
+
return t && w(e, s, t), t;
|
97
|
+
};
|
98
|
+
class i extends f(z, {
|
99
|
+
validSizes: Object.values(_)
|
100
|
+
}) {
|
101
|
+
constructor() {
|
102
|
+
super(...arguments), this._loadDisplaySettings = new g(this, {
|
103
|
+
task: async ([e, s, a]) => {
|
104
|
+
const t = [];
|
105
|
+
this.grandTotals && t.push("grandTotals"), this.periodOverPeriod && t.push("periodOverPeriod"), (s === "numeric" || s === "mixed" && (e == null ? void 0 : e.type) === "numeric") && t.push("numeric"), s !== "numeric" && (e == null ? void 0 : e.type) === "datetime" && t.push("datetime"), !["numeric", "mixed"].includes(s ?? "") && (e == null ? void 0 : e.type) === "numeric" && !this.binningDisabled && t.push("binning"), t.length > 0 && !a && (t.includes("numeric") && !this._settingsTypeLoaded.numeric ? (await import("./display-settings-numeric/index.js"), this._settingsTypeLoaded.numeric = !0, t.includes("periodOverPeriod") && !this._settingsTypeLoaded.periodOverPeriod && (await import("./display-settings-period-over-period/index.js"), this._settingsTypeLoaded.periodOverPeriod = !0)) : t.includes("datetime") && !this._settingsTypeLoaded.datetime ? (await import("./display-settings-datetime/index.js"), this._settingsTypeLoaded.datetime = !0) : t.includes("binning") && !this._settingsTypeLoaded.binning ? (await import("./display-settings-binning/index.js"), this._settingsTypeLoaded.binning = !0) : t.includes("grandTotals") && !this._settingsTypeLoaded.grandTotals && (await import("./display-settings-grand-totals/index.js"), this._settingsTypeLoaded.grandTotals = !0));
|
106
|
+
},
|
107
|
+
args: () => [this.slotContent, this.slotType, this.hideDisplaySettings]
|
108
|
+
}), this.language = "en", this.contentLanguage = "en", this.slotType = "numeric", this.slotContent = {}, this._showIds = !1, this.measureColumns = [], this._settingsTypeLoaded = {
|
109
|
+
binning: !1,
|
110
|
+
datetime: !1,
|
111
|
+
numeric: !1,
|
112
|
+
grandTotals: !1,
|
113
|
+
periodOverPeriod: !1,
|
114
|
+
hierarchy: !0
|
115
|
+
}, this._currentSlotContent = {};
|
116
|
+
}
|
117
|
+
static get styles() {
|
118
|
+
return [m(x)];
|
119
|
+
}
|
120
|
+
willUpdate(e) {
|
121
|
+
if (e.has("slotContent"))
|
122
|
+
this._currentSlotContent = structuredClone(this.slotContent);
|
123
|
+
else if (this._store) {
|
124
|
+
const s = this._store.activeContent;
|
125
|
+
s && s !== this._currentSlotContent && (this._currentSlotContent = structuredClone(s));
|
126
|
+
}
|
127
|
+
}
|
128
|
+
_onSlotContentChange(e) {
|
129
|
+
e.stopPropagation(), e.preventDefault(), this._currentSlotContent = structuredClone(e.detail.slotContent), this._sendEvent(), this.requestUpdate();
|
130
|
+
}
|
131
|
+
_onLabelChange() {
|
132
|
+
this._currentSlotContent = structuredClone(this._currentSlotContent), this._currentSlotContent.label = this._multiLanguageFieldElement.value || {}, this._sendEvent(), this.requestUpdate();
|
133
|
+
}
|
134
|
+
_sendEvent() {
|
135
|
+
this.dispatchEvent(
|
136
|
+
new CustomEvent("slot-content-changed", {
|
137
|
+
bubbles: !0,
|
138
|
+
composed: !0,
|
139
|
+
cancelable: !0,
|
140
|
+
detail: {
|
141
|
+
slotContent: { ...this._currentSlotContent }
|
142
|
+
}
|
143
|
+
})
|
144
|
+
), this._store && this._store.updateContent({ ...this._currentSlotContent });
|
145
|
+
}
|
146
|
+
_removeEvent() {
|
147
|
+
this.dispatchEvent(
|
148
|
+
new CustomEvent("remove-slot-content", {
|
149
|
+
bubbles: !0,
|
150
|
+
composed: !0,
|
151
|
+
cancelable: !0,
|
152
|
+
detail: {
|
153
|
+
slotContent: this._currentSlotContent
|
154
|
+
}
|
155
|
+
})
|
156
|
+
);
|
157
|
+
}
|
158
|
+
_toggleIds() {
|
159
|
+
this._showIds = !this._showIds;
|
160
|
+
}
|
161
|
+
_renderDisplaySettings() {
|
162
|
+
return l`<div class="settings-container">
|
163
|
+
<div class="settings-row">
|
164
|
+
<div class="setting">
|
165
|
+
<div class="label-container">
|
166
|
+
<luzmo-field-label side-aligned="start" .size=${this.size}
|
167
|
+
>Label:</luzmo-field-label
|
168
|
+
>
|
169
|
+
<luzmo-multi-language-field
|
170
|
+
.language=${this.language}
|
171
|
+
.value=${this._currentSlotContent.label}
|
172
|
+
.size=${this.size}
|
173
|
+
debounce="200"
|
174
|
+
@change=${this._onLabelChange}
|
175
|
+
></luzmo-multi-language-field>
|
176
|
+
</div>
|
177
|
+
<div class="label-action-container">
|
178
|
+
<button class="id-button" @click=${this._toggleIds}>
|
179
|
+
${c(b)}
|
180
|
+
<luzmo-tooltip self-managed placement="top" size=${this.size}>
|
181
|
+
Show dataset and column id's
|
182
|
+
</luzmo-tooltip>
|
183
|
+
</button>
|
184
|
+
${this.showRemoveButton ? l`<button
|
185
|
+
class="remove-button"
|
186
|
+
@click=${this._removeEvent}
|
187
|
+
>
|
188
|
+
${c(y)}
|
189
|
+
<luzmo-tooltip
|
190
|
+
self-managed
|
191
|
+
placement="top"
|
192
|
+
size=${this.size}
|
193
|
+
>
|
194
|
+
Remove
|
195
|
+
</luzmo-tooltip>
|
196
|
+
</button>` : ""}
|
197
|
+
</div>
|
198
|
+
</div>
|
199
|
+
</div>
|
200
|
+
${this.grandTotals ? l`<luzmo-display-settings-grand-totals
|
201
|
+
.language=${this.language}
|
202
|
+
.slotContent=${this._currentSlotContent}
|
203
|
+
.size=${this.size}
|
204
|
+
@slot-content-changed=${this._onSlotContentChange}
|
205
|
+
></luzmo-display-settings-grand-totals>` : ""}
|
206
|
+
${this.slotType === "numeric" || this.slotType === "mixed" && this.slotContent.type === "numeric" ? l`<luzmo-display-settings-numeric
|
207
|
+
.language=${this.language}
|
208
|
+
.slotContent=${this._currentSlotContent}
|
209
|
+
.size=${this.size}
|
210
|
+
.measureColumns=${this.measureColumns}
|
211
|
+
@slot-content-changed=${this._onSlotContentChange}
|
212
|
+
></luzmo-display-settings-numeric>` : ""}
|
213
|
+
${this.slotType !== "numeric" && this.slotContent.type === "datetime" ? l`<luzmo-display-settings-datetime
|
214
|
+
.language=${this.language}
|
215
|
+
.contentLanguage=${this.contentLanguage}
|
216
|
+
.slotContent=${this._currentSlotContent}
|
217
|
+
.size=${this.size}
|
218
|
+
@slot-content-changed=${this._onSlotContentChange}
|
219
|
+
></luzmo-display-settings-datetime>` : ""}
|
220
|
+
${!["numeric", "mixed"].includes(this.slotType ?? "") && this.slotContent.type === "numeric" && !this.binningDisabled ? l`<luzmo-display-settings-binning
|
221
|
+
.language=${this.language}
|
222
|
+
.slotContent=${this._currentSlotContent}
|
223
|
+
.size=${this.size}
|
224
|
+
@slot-content-changed=${this._onSlotContentChange}
|
225
|
+
></luzmo-display-settings-binning>` : ""}
|
226
|
+
${this.periodOverPeriod ? l`<luzmo-display-settings-period-over-period
|
227
|
+
.language=${this.language}
|
228
|
+
.slotContent=${this._currentSlotContent}
|
229
|
+
.size=${this.size}
|
230
|
+
@slot-content-changed=${this._onSlotContentChange}
|
231
|
+
></luzmo-display-settings-period-over-period>` : ""}
|
232
|
+
</div>
|
233
|
+
${this._showIds ? l` <luzmo-divider></luzmo-divider>
|
234
|
+
<div class="ids-container">
|
235
|
+
<div>
|
236
|
+
<span class="id-label">Column: </span>
|
237
|
+
${this._currentSlotContent.columnId ?? // eslint-disable-next-line @typescript-eslint/no-deprecated
|
238
|
+
this._currentSlotContent.column}
|
239
|
+
</div>
|
240
|
+
<div>
|
241
|
+
<span class="id-label">Dataset: </span>
|
242
|
+
${this._currentSlotContent.datasetId ?? // eslint-disable-next-line @typescript-eslint/no-deprecated
|
243
|
+
this._currentSlotContent.set}
|
244
|
+
</div>
|
245
|
+
<div></div>
|
246
|
+
</div>` : ""}`;
|
247
|
+
}
|
248
|
+
render() {
|
249
|
+
return this._loadDisplaySettings.render({
|
250
|
+
pending: () => l`<luzmo-progress-circle
|
251
|
+
indeterminate
|
252
|
+
.size=${this.size}
|
253
|
+
></luzmo-progress-circle>`,
|
254
|
+
complete: () => this._renderDisplaySettings(),
|
255
|
+
error: () => this._renderDisplaySettings()
|
256
|
+
});
|
257
|
+
}
|
258
|
+
}
|
259
|
+
n([
|
260
|
+
r({ type: String })
|
261
|
+
], i.prototype, "language");
|
262
|
+
n([
|
263
|
+
r({ type: String, attribute: "content-language" })
|
264
|
+
], i.prototype, "contentLanguage");
|
265
|
+
n([
|
266
|
+
r({ type: Boolean, attribute: "hide-display-settings" })
|
267
|
+
], i.prototype, "hideDisplaySettings");
|
268
|
+
n([
|
269
|
+
r({ type: Boolean, attribute: "binning-disabled" })
|
270
|
+
], i.prototype, "binningDisabled");
|
271
|
+
n([
|
272
|
+
r({ type: Boolean, attribute: "grand-totals" })
|
273
|
+
], i.prototype, "grandTotals");
|
274
|
+
n([
|
275
|
+
r({ type: Boolean, attribute: "period-over-period" })
|
276
|
+
], i.prototype, "periodOverPeriod");
|
277
|
+
n([
|
278
|
+
r({ type: Boolean, attribute: "show-remove-button" })
|
279
|
+
], i.prototype, "showRemoveButton");
|
280
|
+
n([
|
281
|
+
r({ type: String, attribute: "slot-type" })
|
282
|
+
], i.prototype, "slotType");
|
283
|
+
n([
|
284
|
+
r()
|
285
|
+
], i.prototype, "slotContent");
|
286
|
+
n([
|
287
|
+
h()
|
288
|
+
], i.prototype, "_showIds");
|
289
|
+
n([
|
290
|
+
r({ type: Array, reflect: !1 })
|
291
|
+
], i.prototype, "measureColumns");
|
292
|
+
n([
|
293
|
+
v("luzmo-multi-language-field")
|
294
|
+
], i.prototype, "_multiLanguageFieldElement");
|
295
|
+
n([
|
296
|
+
$({ context: S, subscribe: !0 })
|
297
|
+
], i.prototype, "_store");
|
298
|
+
customElements.get("luzmo-display-settings") || customElements.define("luzmo-display-settings", i);
|
299
|
+
export {
|
300
|
+
i as L,
|
301
|
+
C as a,
|
302
|
+
$ as c,
|
303
|
+
S as s
|
304
|
+
};
|
@@ -17,10 +17,10 @@
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
18
|
* SOFTWARE.
|
19
19
|
* */
|
20
|
-
import { h as S } from "./task-
|
21
|
-
import { x as K, r as G, n as M } from "./property-
|
22
|
-
import { L as R } from "./focusable-
|
23
|
-
import { o as D } from "./if-defined-
|
20
|
+
import { h as S } from "./task-CDsB8Kbr.js";
|
21
|
+
import { x as K, r as G, n as M } from "./property-BFMfZY1k.js";
|
22
|
+
import { L as R } from "./focusable-Bhf_beoW.js";
|
23
|
+
import { o as D } from "./if-defined-Dg09naf2.js";
|
24
24
|
const N = (t, i, o) => {
|
25
25
|
const s = (e) => {
|
26
26
|
for (const n of e ?? []) {
|
@@ -17,7 +17,7 @@
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
18
|
* SOFTWARE.
|
19
19
|
* */
|
20
|
-
"use strict";require("./index-j8UKjHqY.cjs");require("./index-CHFwXYcm.cjs");require("./index-CNA9joKT.cjs");const a=require("./property-BCb4Kybn.cjs"),e=require("./set-locale-Cam8nRIW.cjs"),q=require("./localized-decorator-SOrjcPab.cjs"),h=require("./base-D76d76ww-tT6yr8eb.cjs");require("./focusable-BxtpnzWp-CkK9AeMt.cjs");const E=require("./state-BxZEcclm.cjs"),u=()=>[{id:"? = ?",key:"? = ?",expression:"? = ?",name:e.msg("equals",{desc:"Filter expression for equals comparison"}),description:e.msg("equals",{desc:"Filter expression for equals comparison"}),tiny:e.msg("eq",{desc:"Short form of equals comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? != ?",key:"? != ?",expression:"? != ?",name:e.msg("not equals",{desc:"Filter expression for not equals comparison"}),description:e.msg("not equals",{desc:"Filter expression for not equals comparison"}),tiny:e.msg("not eq",{desc:"Short form of not equals comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? in ?",key:"? in ?",expression:"? in ?",name:e.msg("is in",{desc:"Filter expression for in comparison"}),description:e.msg("is in",{desc:"Filter expression for in comparison"}),tiny:e.msg("is in",{desc:"Filter expression for in comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? not in ?",key:"? not in ?",expression:"? not in ?",name:e.msg("is not in",{desc:"Filter expression for not in comparison"}),description:e.msg("is not in",{desc:"Filter expression for not in comparison"}),tiny:e.msg("is not in",{desc:"Filter expression for not in comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? like ?",key:"? like ?",expression:"? like ?",name:e.msg("contains",{desc:"Filter expression for contains comparison"}),description:e.msg("contains",{desc:"Filter expression for contains comparison"}),tiny:e.msg("cont",{desc:"Short form of contains comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not like ?",key:"? not like ?",expression:"? not like ?",name:e.msg("does not contain",{desc:"Filter expression for does not contain comparison"}),description:e.msg("does not contain",{desc:"Filter expression for does not contain comparison"}),tiny:e.msg("not cont",{desc:"Short form of does not contain comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? starts with ?",key:"? starts with ?",expression:"? starts with ?",name:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),description:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),tiny:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not starts with ?",key:"? not starts with ?",expression:"? not starts with ?",name:e.msg("does not start with",{desc:"Filter expression for does not start with comparison"}),description:e.msg("does not start with",{desc:"Filter expression for does not start with comparison"}),tiny:e.msg("not starts with",{desc:"Short form of does not start with comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? ends with ?",key:"? ends with ?",expression:"? ends with ?",name:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),description:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),tiny:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not ends with ?",key:"? not ends with ?",expression:"? not ends with ?",name:e.msg("does not end with",{desc:"Filter expression for does not end with comparison"}),description:e.msg("does not end with",{desc:"Filter expression for does not end with comparison"}),tiny:e.msg("not ends with",{desc:"Short form of does not end with comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? < ?",key:"? < ?",expression:"? < ?",name:e.msg("less than",{desc:"Filter expression for less than comparison"}),description:e.msg("less than",{desc:"Filter expression for less than comparison"}),tiny:e.msg("less than",{desc:"Filter expression for less than comparison"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? <= ?",key:"? <= ?",expression:"? <= ?",name:e.msg("less than or equal",{desc:"Filter expression for less than or equal comparison"}),description:e.msg("less than or equal",{desc:"Filter expression for less than or equal comparison"}),tiny:e.msg("<=",{desc:"Short form of less than or equal comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? > ?",key:"? > ?",expression:"? > ?",name:e.msg("greater than",{desc:"Filter expression for greater than comparison"}),description:e.msg("greater than",{desc:"Filter expression for greater than comparison"}),tiny:e.msg(">",{desc:"Short form of greater than comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? >= ?",key:"? >= ?",expression:"? >= ?",name:e.msg("greater than or equal",{desc:"Filter expression for greater than or equal comparison"}),description:e.msg("greater than or equal",{desc:"Filter expression for greater than or equal comparison"}),tiny:e.msg(">=",{desc:"Short form of greater than or equal comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? between ?",key:"? between ?",expression:"? between ?",name:e.msg("is between",{desc:"Filter expression for between comparison"}),description:e.msg("is between",{desc:"Filter expression for between comparison"}),tiny:e.msg("between",{desc:"Short form of between comparison in filter expression"}),type:[],subtype:["ip_address"]},{id:"last_now",key:"last_now",expression:"last_now",name:e.msg("last (x) periods",{desc:"Filter expression for last (x) periods"}),description:e.msg("last (x) periods",{desc:"Filter expression for last (x) periods"}),tiny:e.msg("last",{desc:"Short form of last (x) periods in filter expression"}),type:["datetime"]},{id:"last_available",key:"last_available",expression:"last_available",name:e.msg("last (x) available periods",{desc:"Filter expression for last (x) available periods"}),description:e.msg("last (x) available periods",{desc:"Filter expression for last (x) available periods"}),tiny:e.msg("last available",{desc:"Short form of last (x) available periods in filter expression"}),type:["datetime"]},{id:"last_completed",key:"last_completed",expression:"last_completed",name:e.msg("last completed period",{desc:"Filter expression for last completed period"}),description:e.msg("last completed (period)",{desc:"Filter expression for last completed period"}),tiny:e.msg("last completed",{desc:"Short form of last completed period in filter expression"}),type:["datetime"]},{id:"next_now",key:"next_now",expression:"next_now",name:e.msg("next (x) periods",{desc:"Filter expression for next (x) periods"}),description:e.msg("next (x) periods",{desc:"Filter expression for next (x) periods"}),tiny:e.msg("next",{desc:"Short form of next (x) periods in filter expression"}),type:["datetime"]},{id:"next_full",key:"next_full",expression:"next_full",name:e.msg("next full (period)",{desc:"Filter expression for next full period"}),description:e.msg("next full (period)",{desc:"Filter expression for next full period"}),tiny:e.msg("next full",{desc:"Short form of next full period in filter expression"}),type:["datetime"]},{id:"WTD",key:"to_date",expression:"to_date",unit:4,name:e.msg("week to date",{desc:"Filter expression for week to date"}),description:e.msg("week to date",{desc:"Filter expression for week to date"}),tiny:e.msg("WTD",{desc:"Short form of week to date in filter expression"}),type:["datetime"]},{id:"MTD",key:"to_date",expression:"to_date",unit:3,name:e.msg("month to date",{desc:"Filter expression for month to date"}),description:e.msg("month to date",{desc:"Filter expression for month to date"}),tiny:e.msg("MTD",{desc:"Short form of month to date in filter expression"}),type:["datetime"]},{id:"QTD",key:"to_date",expression:"to_date",unit:2,name:e.msg("quarter to date",{desc:"Filter expression for quarter to date"}),description:e.msg("quarter to date",{desc:"Filter expression for quarter to date"}),tiny:e.msg("QTD",{desc:"Short form of quarter to date in filter expression"}),type:["datetime"]},{id:"YTD",key:"to_date",expression:"to_date",unit:1,name:e.msg("year to date",{desc:"Filter expression for year to date"}),description:e.msg("year to date",{desc:"Filter expression for year to date"}),tiny:e.msg("YTD",{desc:"Short form of year to date in filter expression"}),type:["datetime"]},{id:"? is null",key:"? is null",expression:"? is null",name:e.msg("is missing",{desc:"Filter expression for is missing"}),description:e.msg("is missing",{desc:"Filter expression for is missing"}),tiny:e.msg("missing",{desc:"Short form of is missing in filter expression"}),type:["numeric","datetime","hierarchy","spatial"],subtype:["ip_address"]},{id:"? is not null",key:"? is not null",expression:"? is not null",name:e.msg("is not missing",{desc:"Filter expression for is not missing"}),description:e.msg("is not missing",{desc:"Filter expression for is not missing"}),tiny:e.msg("not missing",{desc:"Short form of is not missing in filter expression"}),type:["numeric","datetime","hierarchy","spatial"],subtype:["ip_address"]}],f=(d,s,t)=>{const r=new Set(["? in ?","? not in ?"]);return!d&&!s?u():u().filter(i=>{var o;return(d&&i.type.includes(d)||s&&((o=i.subtype)==null?void 0:o.includes(s)))&&!(t&&r.has(i.key))})},S=":host{font-family:var(--luzmo-font-family)}:host{--var: blue}";var z=Object.defineProperty,v=Object.getOwnPropertyDescriptor,p=(d,s,t,r)=>{for(var i=r>1?void 0:r?v(s,t):s,o=d.length-1,n;o>=0;o--)(n=d[o])&&(i=(r?n(s,t,i):n(i))||i);return r&&i&&z(s,t,i),i};exports.LuzmoFilterExpressionPicker=class extends h.m(h.It,{validSizes:Object.values(h.d$1)}){constructor(){super(...arguments),this.language="en",this.hasLabel=!1,this.allowEmpty=!1,this.placeholder="",this.disabled=!1,this.invalid=!1,this.isFormula=!1,this._expressionConfigurations=u()}static get styles(){return[a.r(S)]}_sendChangeEvent(){var t,r,i,o,n,l,c;if(this.disabled)return;const s={expression:(t=this.filter)==null?void 0:t.expression};(o=(i=(r=this.filter)==null?void 0:r.parameters)==null?void 0:i[1])!=null&&o.unit&&(s.unit=(c=(l=(n=this.filter)==null?void 0:n.parameters)==null?void 0:l[1])==null?void 0:c.unit),this.dispatchEvent(new CustomEvent("expression-selected",{bubbles:!0,composed:!0,cancelable:!0,detail:s}))}setExpression(s){var i,o;this._richExpression=(o=(i=s==null?void 0:s.detail)==null?void 0:i.value)==null?void 0:o[0];const t=this._expressionConfigurations.find(n=>n.id===this._richExpression),r=structuredClone(this.filter);r.expression=t==null?void 0:t.expression,t!=null&&t.unit&&(this._unit=t.unit,r!=null&&r.parameters[0]&&(r.parameters[1]={unit:this._unit})),this.filter=r,this._sendChangeEvent()}willUpdate(s){var x,y,g,F,b,w,_;const t=s.has("language"),r=s.has("filter"),i=s.has("type"),o=s.has("subtype"),n=s.has("isFormula");t&&this.language!==e.getLocale()&&([...e.targetLocales].includes(this.language??"en")||this.language==="en")&&e.setLocale(this.language);const l=f(this.type,this.subtype,this.isFormula),c=["YTD","QTD","MTD","WTD"];if(((x=this.filter)==null?void 0:x.expression)==="to_date"){const m=((g=(y=this.filter)==null?void 0:y.parameters[1])==null?void 0:g.unit)??1;this._unit=m,this._richExpression=c[m-1]??"YTD"}else this._richExpression=(F=this.filter)==null?void 0:F.expression;(i||o||n||r)&&this.filter&&!this.disabled&&!(l!=null&&l.find(m=>{var k;return m.expression===((k=this.filter)==null?void 0:k.expression)}))?(this.invalid=!0,console.warn(`Warning: ${(b=this.filter)==null?void 0:b.expression} is not valid given the type: ${this.type} and subtype: ${this.subtype}`)):this.invalid=!1,!((w=this.filter)!=null&&w.expression)&&!this.allowEmpty&&(this._richExpression=(_=l==null?void 0:l[0])==null?void 0:_.id,this.filter={...this.filter,expression:this._richExpression},this._sendChangeEvent())}render(){var i,o;const s=(i=f(this.type,this.subtype,this.isFormula))==null?void 0:i.map(n=>({value:n.id,label:n.description,shortLabel:n.tiny})),t=this.disabled||!((o=this.filter)!=null&&o.expression)&&!this.allowEmpty,r=a.x`<luzmo-field-label
|
20
|
+
"use strict";require("./index-j8UKjHqY.cjs");require("./index-CHFwXYcm.cjs");require("./index-CNA9joKT.cjs");const a=require("./property-BV1QaY8E.cjs"),e=require("./set-locale-Cam8nRIW.cjs"),q=require("./localized-decorator-SOrjcPab.cjs"),h=require("./base-D76d76ww-tT6yr8eb.cjs");require("./focusable-BxtpnzWp-CkK9AeMt.cjs");const E=require("./state-CuE7TJCY.cjs"),u=()=>[{id:"? = ?",key:"? = ?",expression:"? = ?",name:e.msg("equals",{desc:"Filter expression for equals comparison"}),description:e.msg("equals",{desc:"Filter expression for equals comparison"}),tiny:e.msg("eq",{desc:"Short form of equals comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? != ?",key:"? != ?",expression:"? != ?",name:e.msg("not equals",{desc:"Filter expression for not equals comparison"}),description:e.msg("not equals",{desc:"Filter expression for not equals comparison"}),tiny:e.msg("not eq",{desc:"Short form of not equals comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? in ?",key:"? in ?",expression:"? in ?",name:e.msg("is in",{desc:"Filter expression for in comparison"}),description:e.msg("is in",{desc:"Filter expression for in comparison"}),tiny:e.msg("is in",{desc:"Filter expression for in comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? not in ?",key:"? not in ?",expression:"? not in ?",name:e.msg("is not in",{desc:"Filter expression for not in comparison"}),description:e.msg("is not in",{desc:"Filter expression for not in comparison"}),tiny:e.msg("is not in",{desc:"Filter expression for not in comparison"}),type:["numeric","hierarchy"],subtype:["ip_address"]},{id:"? like ?",key:"? like ?",expression:"? like ?",name:e.msg("contains",{desc:"Filter expression for contains comparison"}),description:e.msg("contains",{desc:"Filter expression for contains comparison"}),tiny:e.msg("cont",{desc:"Short form of contains comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not like ?",key:"? not like ?",expression:"? not like ?",name:e.msg("does not contain",{desc:"Filter expression for does not contain comparison"}),description:e.msg("does not contain",{desc:"Filter expression for does not contain comparison"}),tiny:e.msg("not cont",{desc:"Short form of does not contain comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? starts with ?",key:"? starts with ?",expression:"? starts with ?",name:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),description:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),tiny:e.msg("starts with",{desc:"Filter expression for starts with comparison"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not starts with ?",key:"? not starts with ?",expression:"? not starts with ?",name:e.msg("does not start with",{desc:"Filter expression for does not start with comparison"}),description:e.msg("does not start with",{desc:"Filter expression for does not start with comparison"}),tiny:e.msg("not starts with",{desc:"Short form of does not start with comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? ends with ?",key:"? ends with ?",expression:"? ends with ?",name:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),description:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),tiny:e.msg("ends with",{desc:"Filter expression for ends with comparison"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? not ends with ?",key:"? not ends with ?",expression:"? not ends with ?",name:e.msg("does not end with",{desc:"Filter expression for does not end with comparison"}),description:e.msg("does not end with",{desc:"Filter expression for does not end with comparison"}),tiny:e.msg("not ends with",{desc:"Short form of does not end with comparison in filter expression"}),type:["hierarchy"],subtype:["ip_address"]},{id:"? < ?",key:"? < ?",expression:"? < ?",name:e.msg("less than",{desc:"Filter expression for less than comparison"}),description:e.msg("less than",{desc:"Filter expression for less than comparison"}),tiny:e.msg("less than",{desc:"Filter expression for less than comparison"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? <= ?",key:"? <= ?",expression:"? <= ?",name:e.msg("less than or equal",{desc:"Filter expression for less than or equal comparison"}),description:e.msg("less than or equal",{desc:"Filter expression for less than or equal comparison"}),tiny:e.msg("<=",{desc:"Short form of less than or equal comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? > ?",key:"? > ?",expression:"? > ?",name:e.msg("greater than",{desc:"Filter expression for greater than comparison"}),description:e.msg("greater than",{desc:"Filter expression for greater than comparison"}),tiny:e.msg(">",{desc:"Short form of greater than comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? >= ?",key:"? >= ?",expression:"? >= ?",name:e.msg("greater than or equal",{desc:"Filter expression for greater than or equal comparison"}),description:e.msg("greater than or equal",{desc:"Filter expression for greater than or equal comparison"}),tiny:e.msg(">=",{desc:"Short form of greater than or equal comparison in filter expression"}),type:["numeric","datetime"],subtype:["ip_address"]},{id:"? between ?",key:"? between ?",expression:"? between ?",name:e.msg("is between",{desc:"Filter expression for between comparison"}),description:e.msg("is between",{desc:"Filter expression for between comparison"}),tiny:e.msg("between",{desc:"Short form of between comparison in filter expression"}),type:[],subtype:["ip_address"]},{id:"last_now",key:"last_now",expression:"last_now",name:e.msg("last (x) periods",{desc:"Filter expression for last (x) periods"}),description:e.msg("last (x) periods",{desc:"Filter expression for last (x) periods"}),tiny:e.msg("last",{desc:"Short form of last (x) periods in filter expression"}),type:["datetime"]},{id:"last_available",key:"last_available",expression:"last_available",name:e.msg("last (x) available periods",{desc:"Filter expression for last (x) available periods"}),description:e.msg("last (x) available periods",{desc:"Filter expression for last (x) available periods"}),tiny:e.msg("last available",{desc:"Short form of last (x) available periods in filter expression"}),type:["datetime"]},{id:"last_completed",key:"last_completed",expression:"last_completed",name:e.msg("last completed period",{desc:"Filter expression for last completed period"}),description:e.msg("last completed (period)",{desc:"Filter expression for last completed period"}),tiny:e.msg("last completed",{desc:"Short form of last completed period in filter expression"}),type:["datetime"]},{id:"next_now",key:"next_now",expression:"next_now",name:e.msg("next (x) periods",{desc:"Filter expression for next (x) periods"}),description:e.msg("next (x) periods",{desc:"Filter expression for next (x) periods"}),tiny:e.msg("next",{desc:"Short form of next (x) periods in filter expression"}),type:["datetime"]},{id:"next_full",key:"next_full",expression:"next_full",name:e.msg("next full (period)",{desc:"Filter expression for next full period"}),description:e.msg("next full (period)",{desc:"Filter expression for next full period"}),tiny:e.msg("next full",{desc:"Short form of next full period in filter expression"}),type:["datetime"]},{id:"WTD",key:"to_date",expression:"to_date",unit:4,name:e.msg("week to date",{desc:"Filter expression for week to date"}),description:e.msg("week to date",{desc:"Filter expression for week to date"}),tiny:e.msg("WTD",{desc:"Short form of week to date in filter expression"}),type:["datetime"]},{id:"MTD",key:"to_date",expression:"to_date",unit:3,name:e.msg("month to date",{desc:"Filter expression for month to date"}),description:e.msg("month to date",{desc:"Filter expression for month to date"}),tiny:e.msg("MTD",{desc:"Short form of month to date in filter expression"}),type:["datetime"]},{id:"QTD",key:"to_date",expression:"to_date",unit:2,name:e.msg("quarter to date",{desc:"Filter expression for quarter to date"}),description:e.msg("quarter to date",{desc:"Filter expression for quarter to date"}),tiny:e.msg("QTD",{desc:"Short form of quarter to date in filter expression"}),type:["datetime"]},{id:"YTD",key:"to_date",expression:"to_date",unit:1,name:e.msg("year to date",{desc:"Filter expression for year to date"}),description:e.msg("year to date",{desc:"Filter expression for year to date"}),tiny:e.msg("YTD",{desc:"Short form of year to date in filter expression"}),type:["datetime"]},{id:"? is null",key:"? is null",expression:"? is null",name:e.msg("is missing",{desc:"Filter expression for is missing"}),description:e.msg("is missing",{desc:"Filter expression for is missing"}),tiny:e.msg("missing",{desc:"Short form of is missing in filter expression"}),type:["numeric","datetime","hierarchy","spatial"],subtype:["ip_address"]},{id:"? is not null",key:"? is not null",expression:"? is not null",name:e.msg("is not missing",{desc:"Filter expression for is not missing"}),description:e.msg("is not missing",{desc:"Filter expression for is not missing"}),tiny:e.msg("not missing",{desc:"Short form of is not missing in filter expression"}),type:["numeric","datetime","hierarchy","spatial"],subtype:["ip_address"]}],f=(d,s,t)=>{const r=new Set(["? in ?","? not in ?"]);return!d&&!s?u():u().filter(i=>{var o;return(d&&i.type.includes(d)||s&&((o=i.subtype)==null?void 0:o.includes(s)))&&!(t&&r.has(i.key))})},S=":host{font-family:var(--luzmo-font-family)}:host{--var: blue}";var z=Object.defineProperty,v=Object.getOwnPropertyDescriptor,p=(d,s,t,r)=>{for(var i=r>1?void 0:r?v(s,t):s,o=d.length-1,n;o>=0;o--)(n=d[o])&&(i=(r?n(s,t,i):n(i))||i);return r&&i&&z(s,t,i),i};exports.LuzmoFilterExpressionPicker=class extends h.m(h.It,{validSizes:Object.values(h.d$1)}){constructor(){super(...arguments),this.language="en",this.hasLabel=!1,this.allowEmpty=!1,this.placeholder="",this.disabled=!1,this.invalid=!1,this.isFormula=!1,this._expressionConfigurations=u()}static get styles(){return[a.r(S)]}_sendChangeEvent(){var t,r,i,o,n,l,c;if(this.disabled)return;const s={expression:(t=this.filter)==null?void 0:t.expression};(o=(i=(r=this.filter)==null?void 0:r.parameters)==null?void 0:i[1])!=null&&o.unit&&(s.unit=(c=(l=(n=this.filter)==null?void 0:n.parameters)==null?void 0:l[1])==null?void 0:c.unit),this.dispatchEvent(new CustomEvent("expression-selected",{bubbles:!0,composed:!0,cancelable:!0,detail:s}))}setExpression(s){var i,o;this._richExpression=(o=(i=s==null?void 0:s.detail)==null?void 0:i.value)==null?void 0:o[0];const t=this._expressionConfigurations.find(n=>n.id===this._richExpression),r=structuredClone(this.filter);r.expression=t==null?void 0:t.expression,t!=null&&t.unit&&(this._unit=t.unit,r!=null&&r.parameters[0]&&(r.parameters[1]={unit:this._unit})),this.filter=r,this._sendChangeEvent()}willUpdate(s){var x,y,g,F,b,w,_;const t=s.has("language"),r=s.has("filter"),i=s.has("type"),o=s.has("subtype"),n=s.has("isFormula");t&&this.language!==e.getLocale()&&([...e.targetLocales].includes(this.language??"en")||this.language==="en")&&e.setLocale(this.language);const l=f(this.type,this.subtype,this.isFormula),c=["YTD","QTD","MTD","WTD"];if(((x=this.filter)==null?void 0:x.expression)==="to_date"){const m=((g=(y=this.filter)==null?void 0:y.parameters[1])==null?void 0:g.unit)??1;this._unit=m,this._richExpression=c[m-1]??"YTD"}else this._richExpression=(F=this.filter)==null?void 0:F.expression;(i||o||n||r)&&this.filter&&!this.disabled&&!(l!=null&&l.find(m=>{var k;return m.expression===((k=this.filter)==null?void 0:k.expression)}))?(this.invalid=!0,console.warn(`Warning: ${(b=this.filter)==null?void 0:b.expression} is not valid given the type: ${this.type} and subtype: ${this.subtype}`)):this.invalid=!1,!((w=this.filter)!=null&&w.expression)&&!this.allowEmpty&&(this._richExpression=(_=l==null?void 0:l[0])==null?void 0:_.id,this.filter={...this.filter,expression:this._richExpression},this._sendChangeEvent())}render(){var i,o;const s=(i=f(this.type,this.subtype,this.isFormula))==null?void 0:i.map(n=>({value:n.id,label:n.description,shortLabel:n.tiny})),t=this.disabled||!((o=this.filter)!=null&&o.expression)&&!this.allowEmpty,r=a.x`<luzmo-field-label
|
21
21
|
for="expression"
|
22
22
|
size=${this.size}
|
23
23
|
>${this.label??e.msg("Select an expression",{desc:"Label for expression picker"})}</luzmo-field-label
|