@luzmo/analytics-components-kit 1.1.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -2
- package/angular/components/interactive-viz-item.ts +41 -4
- package/angular/components/item-option-color-picker.ts +30 -3
- package/angular/components/item-option-color-range.ts +30 -3
- package/angular/components/item-option-guidelines.ts +31 -4
- package/angular/components/item-option-panel.ts +41 -4
- package/angular/components/item-option-slider.ts +41 -4
- package/angular/components/item-option.ts +41 -4
- package/angular/esm/components/interactive-viz-item.d.ts +14 -5
- package/angular/esm/components/interactive-viz-item.js +30 -4
- package/angular/esm/components/item-option-color-picker.d.ts +11 -4
- package/angular/esm/components/item-option-color-picker.js +23 -3
- package/angular/esm/components/item-option-color-range.d.ts +11 -4
- package/angular/esm/components/item-option-color-range.js +23 -3
- package/angular/esm/components/item-option-guidelines.d.ts +11 -4
- package/angular/esm/components/item-option-guidelines.js +24 -4
- package/angular/esm/components/item-option-panel.d.ts +13 -4
- package/angular/esm/components/item-option-panel.js +30 -4
- package/angular/esm/components/item-option-slider.d.ts +13 -4
- package/angular/esm/components/item-option-slider.js +30 -4
- package/angular/esm/components/item-option.d.ts +13 -4
- package/angular/esm/components/item-option.js +30 -4
- package/angular/package.json +2 -2
- package/angular/utils/option-interaction/index.d.ts +2 -0
- package/angular/utils/option-interaction/is-same-option-value.d.ts +10 -0
- package/angular/utils/option-interaction/option-interaction-controller.d.ts +54 -0
- package/angular/utils/option-interaction/tests/option-interaction-controller.test.d.ts +1 -0
- package/angular/utils/store/base-store.d.ts +9 -0
- package/angular/utils/store/tests/store-base-history.test.d.ts +1 -0
- package/components/add-to-dashboard/index.cjs +1 -1
- package/components/add-to-dashboard/index.js +1 -1
- package/components/{add-to-dashboard-NwsCPIlg.cjs → add-to-dashboard-CzIuDtAq.cjs} +1 -1
- package/components/{add-to-dashboard-NcVHlqrc.js → add-to-dashboard-DGC0_hRB.js} +1 -1
- package/components/{base-store-SgJsjLap.cjs → base-store-D3whjduR.cjs} +1 -1
- package/components/{base-store-g0dt7ru7.js → base-store-DQYj8A1W.js} +3 -0
- package/components/{chart-helpers-Dng_LGfq.js → chart-helpers-Cbl3sRra.js} +3 -2
- package/components/chart-helpers-fMnqHRzC.cjs +20 -0
- package/components/{choropleth-map-options.config-D9-u-NwX.js → choropleth-map-options.config-Blu0Z2tR.js} +1 -1
- package/components/{choropleth-map-options.config-CXDGMiSJ.cjs → choropleth-map-options.config-DwFJ00CS.cjs} +1 -1
- package/components/{color-range-utils-CUCTsRXM.js → color-range-utils-CgwRGUkg.js} +18 -18
- package/components/{color-range-utils-BCFQAeY1.cjs → color-range-utils-D8uygiMe.cjs} +1 -1
- package/components/{heat-map-options.config-ChZeslEy.js → heat-map-options.config-BQkhkLPb.js} +16 -16
- package/components/{heat-map-options.config-DiNa8NnG.cjs → heat-map-options.config-DjQkB039.cjs} +1 -1
- package/components/{heat-table-options.config-BPCszrFn.js → heat-table-options.config-CMWWTeyo.js} +1 -1
- package/components/{heat-table-options.config-BvE6coaV.cjs → heat-table-options.config-D21xtaIk.cjs} +1 -1
- package/components/index.cjs +1 -1
- package/components/index.js +9 -9
- package/components/interactive-viz-item/index.cjs +1 -1
- package/components/interactive-viz-item/index.d.ts +2 -1
- package/components/interactive-viz-item/index.js +2 -2
- package/components/interactive-viz-item/interactive-viz-item.d.ts +34 -2
- package/components/interactive-viz-item/types.d.ts +17 -0
- package/components/{interactive-viz-item-CofUkpP6.js → interactive-viz-item-BKLOmawA.js} +166 -100
- package/components/interactive-viz-item-ojdH1uk0.cjs +268 -0
- package/components/is-same-option-value-B2oyvEqT.js +42 -0
- package/components/is-same-option-value-Cf6BQcs7.cjs +20 -0
- package/components/item-option/helpers/control-markup.d.ts +7 -0
- package/components/item-option/index.cjs +1 -1
- package/components/item-option/index.d.ts +1 -1
- package/components/item-option/index.js +1 -1
- package/components/item-option/item-option.d.ts +23 -2
- package/components/item-option/types.d.ts +19 -0
- package/components/{item-option-Cgx3c08E.js → item-option-DKLRnicU.js} +182 -136
- package/components/item-option-DpLdospV.cjs +285 -0
- package/components/item-option-color-picker/index.cjs +1 -1
- package/components/item-option-color-picker/index.d.ts +1 -1
- package/components/item-option-color-picker/index.js +1 -1
- package/components/item-option-color-picker/item-option-color-picker.d.ts +17 -1
- package/components/item-option-color-picker-CNW7GsCO.cjs +37 -0
- package/components/item-option-color-picker-DDvsY7hV.js +129 -0
- package/components/item-option-color-range/index.cjs +1 -1
- package/components/item-option-color-range/index.d.ts +1 -1
- package/components/item-option-color-range/index.js +1 -1
- package/components/item-option-color-range/item-option-color-range.d.ts +20 -1
- package/components/item-option-color-range-BqSbuSZh.cjs +101 -0
- package/components/item-option-color-range-FQduqtz3.js +265 -0
- package/components/item-option-guidelines/index.cjs +1 -1
- package/components/item-option-guidelines/index.d.ts +1 -1
- package/components/item-option-guidelines/index.js +1 -1
- package/components/item-option-guidelines/item-option-guidelines.d.ts +16 -1
- package/components/{item-option-guidelines-DNJevmVD.js → item-option-guidelines-k5DwMONo.js} +132 -104
- package/components/item-option-guidelines-z9BsGR-l.cjs +138 -0
- package/components/item-option-panel/index.cjs +1 -1
- package/components/item-option-panel/index.d.ts +1 -1
- package/components/item-option-panel/index.js +1 -1
- package/components/item-option-panel/item-option-panel.d.ts +12 -1
- package/components/{item-option-panel-DHdnisRb.js → item-option-panel-BLXWIbjX.js} +18 -6
- package/components/{item-option-panel-Dl3aYBNe.cjs → item-option-panel-CU51qvgV.cjs} +6 -4
- package/components/item-option-slider/index.cjs +1 -1
- package/components/item-option-slider/index.d.ts +1 -1
- package/components/item-option-slider/index.js +1 -1
- package/components/item-option-slider/item-option-slider.d.ts +15 -2
- package/components/item-option-slider-BKtJfL3D.js +119 -0
- package/components/item-option-slider-Kz2eFBql.cjs +36 -0
- package/components/item-options-configs.cjs +1 -1
- package/components/item-options-configs.js +5 -5
- package/components/option-interaction-controller-B8S1N_Oo.js +90 -0
- package/components/option-interaction-controller-D0U-CTpZ.cjs +20 -0
- package/components/{route-map-options.config-DdCaVtIF.cjs → route-map-options.config-DER6ENky.cjs} +1 -1
- package/components/{route-map-options.config-B7vT6KG_.js → route-map-options.config-DTcS47fW.js} +1 -1
- package/components/{spike-map-options.config-DkmRZ1JZ.js → spike-map-options.config-CPYfKWoF.js} +1 -1
- package/components/{spike-map-options.config-B3hDh2qU.cjs → spike-map-options.config-DeF1Whq5.cjs} +1 -1
- package/components/utils/store.cjs +1 -1
- package/components/utils/store.js +1 -1
- package/custom-elements.json +418 -104
- package/package.json +2 -2
- package/react/components/interactive-viz-item.component.ts +11 -2
- package/react/components/item-option-color-picker.component.ts +9 -3
- package/react/components/item-option-color-range.component.ts +9 -3
- package/react/components/item-option-guidelines.component.ts +9 -3
- package/react/components/item-option-panel.component.ts +12 -3
- package/react/components/item-option-slider.component.ts +12 -3
- package/react/components/item-option.component.ts +12 -3
- package/react/esm/components/interactive-viz-item.component.d.ts +8 -2
- package/react/esm/components/interactive-viz-item.component.js +7 -1
- package/react/esm/components/item-option-color-picker.component.d.ts +6 -2
- package/react/esm/components/item-option-color-picker.component.js +6 -2
- package/react/esm/components/item-option-color-range.component.d.ts +6 -2
- package/react/esm/components/item-option-color-range.component.js +6 -2
- package/react/esm/components/item-option-guidelines.component.d.ts +6 -2
- package/react/esm/components/item-option-guidelines.component.js +6 -2
- package/react/esm/components/item-option-panel.component.d.ts +8 -2
- package/react/esm/components/item-option-panel.component.js +8 -2
- package/react/esm/components/item-option-slider.component.d.ts +8 -2
- package/react/esm/components/item-option-slider.component.js +8 -2
- package/react/esm/components/item-option.component.d.ts +8 -2
- package/react/esm/components/item-option.component.js +8 -2
- package/react/luzmo-stub.d.ts +7 -0
- package/react/package.json +2 -2
- package/standalone/add-to-dashboard.js +40 -40
- package/standalone/chunks/{chart-helpers-DsIGsaDc.js → chart-helpers-CR-EUEPf.js} +2 -2
- package/standalone/chunks/{choropleth-map-options.config-Cs4Kvr9h.js → choropleth-map-options.config-CDMjKnJD.js} +1 -1
- package/standalone/chunks/{color-range-utils-CKDpd3gZ.js → color-range-utils-BVyHBRiq.js} +1 -1
- package/standalone/chunks/de-BkB0q1Eg.js +2 -0
- package/standalone/chunks/display-settings-binning-BeLLxd3i.js +38 -0
- package/standalone/chunks/display-settings-datetime-BkeiKIVV.js +199 -0
- package/standalone/chunks/display-settings-grand-totals-BuhpQKJ6.js +26 -0
- package/standalone/chunks/display-settings-numeric-m30IYI7I.js +172 -0
- package/standalone/chunks/display-settings-period-over-period-CqDlOSRn.js +209 -0
- package/standalone/chunks/embed-Bv1ps-EM.js +260 -0
- package/standalone/chunks/en-63f7j4v7.js +2 -0
- package/standalone/chunks/en-GB-QAmXQf8W.js +2 -0
- package/standalone/chunks/en-US-63f7j4v7.js +2 -0
- package/standalone/chunks/es-Bo0jStZn.js +2 -0
- package/standalone/chunks/{filters-DKgJcQGP.js → filters-CxgBXUF1.js} +61 -61
- package/standalone/chunks/{formula-codemirror-BbyvNEVD.js → formula-codemirror-Cq94j3-f.js} +17 -17
- package/standalone/chunks/fr-Co_qVhhV.js +2 -0
- package/standalone/chunks/{heat-map-options.config-DF5kjOOe.js → heat-map-options.config-DDQMD38W.js} +1 -1
- package/standalone/chunks/{heat-table-options.config-DaePzfHG.js → heat-table-options.config-B4K0Ygug.js} +1 -1
- package/standalone/chunks/is-same-option-value-7kXNF4st.js +2 -0
- package/standalone/chunks/item-option-action-button-group-BoyqF9vt.js +35 -0
- package/standalone/chunks/item-option-base-CBcDT8MX.js +38 -0
- package/standalone/chunks/item-option-color-palette-picker-C9PGAv4V.js +22 -0
- package/standalone/chunks/item-option-color-picker-D4fVJlqF.js +19 -0
- package/standalone/chunks/item-option-color-range-BlAdTguE.js +83 -0
- package/standalone/chunks/item-option-guidelines-DMsYsHDu.js +120 -0
- package/standalone/chunks/{item-option-multi-language-field-DPPpN2qg.js → item-option-multi-language-field-NUbm1drg.js} +1 -1
- package/standalone/chunks/{item-option-number-field-CkqJjInE.js → item-option-number-field-DRp7kbHL.js} +1 -1
- package/standalone/chunks/item-option-panel-cXrRclzM.js +316 -0
- package/standalone/chunks/{item-option-picker-BnwQPT9A.js → item-option-picker-Ba09L4Cs.js} +1 -1
- package/standalone/chunks/item-option-position-picker-GEGTnhjw.js +14 -0
- package/standalone/chunks/item-option-positions-number-field-n44s1k5v.js +31 -0
- package/standalone/chunks/{item-option-radio-button-group-BkymJq3E.js → item-option-radio-button-group-3s_b1NvR.js} +1 -1
- package/standalone/chunks/item-option-slider-DtY65Gxk.js +18 -0
- package/standalone/chunks/item-option-switch-4sJaI0mx.js +12 -0
- package/standalone/chunks/{item-option-text-field-D7bkuhsv.js → item-option-text-field-Bt6Lj6kh.js} +1 -1
- package/standalone/chunks/{item-slot-picker-panel-D4BMxGs9.js → item-slot-picker-panel-BOSVFBIy.js} +43 -43
- package/standalone/chunks/load-data-fields-for-datasets-CDlut-6S.js +25 -0
- package/standalone/chunks/localized-decorator-DosMCCQo.js +2 -0
- package/standalone/chunks/{version-BW4Ixl63.js → localized-mixin-BWJj88bd.js} +1 -1
- package/standalone/chunks/nl-CQz2jrVx.js +2 -0
- package/standalone/chunks/option-interaction-controller-BuwRr21c.js +2 -0
- package/standalone/chunks/{route-map-options.config-D7FfzIiU.js → route-map-options.config-CGBkHnhM.js} +1 -1
- package/standalone/chunks/{spike-map-options.config-CZiFzDm9.js → spike-map-options.config-CSenlJ_F.js} +1 -1
- package/standalone/interactive-viz-item.js +62 -55
- package/standalone/item-grid.js +10 -10
- package/standalone/manifest.json +44 -43
- package/utils/option-interaction/index.d.ts +2 -0
- package/utils/option-interaction/is-same-option-value.d.ts +10 -0
- package/utils/option-interaction/option-interaction-controller.d.ts +54 -0
- package/utils/option-interaction/tests/option-interaction-controller.test.d.ts +1 -0
- package/utils/store/base-store.d.ts +9 -0
- package/utils/store/tests/store-base-history.test.d.ts +1 -0
- package/components/chart-helpers-ufZ6VbXs.cjs +0 -20
- package/components/interactive-viz-item-D537mo3l.cjs +0 -261
- package/components/item-option-CqGDFdPj.cjs +0 -269
- package/components/item-option-color-picker-BpPoOO2b.cjs +0 -34
- package/components/item-option-color-picker-cojuCvu5.js +0 -84
- package/components/item-option-color-range-CMBEx1fi.cjs +0 -98
- package/components/item-option-color-range-Dt7Bv06p.js +0 -217
- package/components/item-option-guidelines-Beh0DlG0.cjs +0 -135
- package/components/item-option-slider-Bo5vs6nr.js +0 -89
- package/components/item-option-slider-CyWKWr5D.cjs +0 -33
- package/standalone/chunks/color-7IgCGZKz.js +0 -2
- package/standalone/chunks/de-mdZT2W1G.js +0 -2
- package/standalone/chunks/display-settings-binning-Byffw2Kl.js +0 -38
- package/standalone/chunks/display-settings-datetime-CD52d6Sv.js +0 -199
- package/standalone/chunks/display-settings-grand-totals-Cky99LX9.js +0 -26
- package/standalone/chunks/display-settings-numeric-C9ea7Tgc.js +0 -172
- package/standalone/chunks/display-settings-period-over-period-BLSGumkD.js +0 -209
- package/standalone/chunks/embed-BfHBKhIe.js +0 -231
- package/standalone/chunks/en-CSboh17P.js +0 -2
- package/standalone/chunks/en-GB-HoXKQBOY.js +0 -2
- package/standalone/chunks/en-US-CSboh17P.js +0 -2
- package/standalone/chunks/es-Di5D8JFd.js +0 -2
- package/standalone/chunks/fr-DZku7iB9.js +0 -2
- package/standalone/chunks/item-option-action-button-group-BEAwPHVw.js +0 -35
- package/standalone/chunks/item-option-base-CRUxNhJQ.js +0 -38
- package/standalone/chunks/item-option-color-palette-picker-CBz61iZb.js +0 -22
- package/standalone/chunks/item-option-color-picker-Cr7ujQNO.js +0 -16
- package/standalone/chunks/item-option-color-range-CyJd1LZ_.js +0 -80
- package/standalone/chunks/item-option-guidelines-6NjpzS6b.js +0 -117
- package/standalone/chunks/item-option-panel-VxvWU56c.js +0 -298
- package/standalone/chunks/item-option-position-picker-Bkc4JvJX.js +0 -14
- package/standalone/chunks/item-option-positions-number-field-Dr_315TE.js +0 -31
- package/standalone/chunks/item-option-slider-l9wt7_0c.js +0 -15
- package/standalone/chunks/item-option-switch-DeihDHhM.js +0 -12
- package/standalone/chunks/load-data-fields-for-datasets-ClctSj6y.js +0 -25
- package/standalone/chunks/localized-decorator-DJVBmJVH.js +0 -2
- package/standalone/chunks/nl-CViTevL3.js +0 -2
|
@@ -0,0 +1,138 @@
|
|
|
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"),require("./base-CGDNY_7v.cjs");const e=require("./decorate-DCJt-2rt.cjs"),t=require("./localized-mixin-EoNvtTBG.cjs"),n=require("./is-same-option-value-Cf6BQcs7.cjs"),r=require("./option-interaction-controller-D0U-CTpZ.cjs"),i=require("./types-pVa6ut_v.cjs"),a=require("./item-option-base-BMy6dWbc.cjs");let o=require("@luzmo/icons");require("@luzmo/lucero/action-button"),require("@luzmo/lucero/button"),require("@luzmo/lucero/icon");let s=require("lit"),c=require("lit/decorators.js"),l=require("@lit/localize"),u=require("lit/directives/repeat.js");require("@luzmo/lucero/action-group"),require("@luzmo/lucero/number-field"),require("@luzmo/lucero/picker"),require("@luzmo/lucero/menu"),require("@luzmo/lucero/color-picker");var d=new Set(i.s),f=new Set(i.c),p=new Set(i.l),m={solid:`0`,dotted:`1,2`,dashed:`3,3`},h=e=>typeof e==`object`&&!!e&&!Array.isArray(e),g=e=>{if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e==`string`&&e.trim()!==``){let t=Number(e);return Number.isFinite(t)?t:void 0}},_=e=>typeof e==`string`&&d.has(e),v=e=>{let t=(e??[]).filter(_);return t.length>0?t:[...i.t]},y=e=>e===`dark-edit`?i.n:i.r,b=e=>structuredClone(e),x=e=>{if(!h(e))return{...i.a};let t=typeof e.type==`string`?e.type.trim().toLowerCase():``,n=f.has(t)?t:m[t]??i.a.type,r=(typeof e.width==`number`?String(e.width):typeof e.width==`string`?e.width.trim():``).replace(/px$/i,``);return{type:n,width:p.has(r)?r:i.a.width}},S=e=>{if(!h(e))return;let t=typeof e.type==`string`?e.type.trim().toLowerCase():``;if(!_(t))return;let n=typeof e.color==`string`&&e.color.trim()!==``?e.color.trim():i.r;return t===`value`?{type:t,color:n,value:g(e.value)??0}:{type:t,color:n}},C=e=>{let t=Array.isArray(e)?{lines:e}:e;if(!h(t)||!(Array.isArray(t.lines)||h(t.lines)))return;let n=Array.isArray(t.lines)?t.lines:[t.lines],r=n.map(S).filter(e=>e!==void 0);if(!(n.length>0&&r.length===0))return{lines:r,style:x(t.style)}},w=(e,t)=>e===`value`?{type:e,color:t,value:0}:{type:e,color:t},T=(e,t,n)=>{let r=v(t)[0],a=w(r,n);if(!e)return{lines:[a],style:{...i.a}};let o=b(e);return o.lines.push(a),o},E=(e,t)=>{let n=b(e);return n.lines.splice(t,1),n},D=(e,t,n)=>{let r=b(e),i=r.lines[t];return i&&(r.lines[t]=w(n,i.color)),r},O=(e,t,n)=>{let r=b(e);return r.lines[t]&&(r.lines[t].color=n),r},k=(e,t,n)=>{let r=b(e);return r.lines[t]&&(r.lines[t].value=n),r},A=(e,t)=>{let n=b(e);return n.style.type=t,n},j=(e,t)=>{let n=b(e);return n.style.width=t,n},M=`:host{display:block;container-type:inline-size}.luzmo-item-option{align-items:start;height:-moz-fit-content;height:fit-content}.control-container{flex-grow:1;align-items:start}.guidelines{gap:var(--luzmo-item-option-guidelines-shared-gap,var(--item-option-guidelines-shared-gap));flex-direction:column;inline-size:100%;display:flex}.guideline-rows{gap:var(--luzmo-item-option-guidelines-rows-gap,var(--item-option-guidelines-rows-gap));flex-direction:column;display:flex}.guideline-row{align-items:center;gap:var(--luzmo-item-option-guidelines-row-gap,var(--item-option-guidelines-row-gap));grid-template-columns:auto minmax(0,max-content) minmax(6rem,1fr) auto;display:grid}.guideline-value{inline-size:100%}@container (width<=20rem){.guideline-row{grid-template-columns:auto minmax(0,1fr) auto}.guideline-value{grid-column:2}.guideline-value-spacer{display:none}}.guideline-value-spacer{min-inline-size:0;min-block-size:var(--luzmo-component-height)}.guidelines-add{justify-content:flex-end;display:flex}.guideline-shared{gap:var(--luzmo-item-option-guidelines-rows-gap,var(--item-option-guidelines-rows-gap));border-block-start:var(--luzmo-border-width) solid var(--luzmo-border-color);flex-direction:column;padding-block-start:var(--luzmo-item-option-guidelines-shared-gap,var(--item-option-guidelines-shared-gap));display:flex}.guideline-shared-row{justify-content:space-between;align-items:center;gap:var(--luzmo-item-option-guidelines-row-gap,var(--item-option-guidelines-row-gap));flex-wrap:wrap;display:flex}.guideline-shared-label{flex-shrink:0}.guideline-width{min-inline-size:8rem}:host{--item-option-guidelines-rows-gap:var(--luzmo-spacing-2);--item-option-guidelines-row-gap:var(--luzmo-spacing-2);--item-option-guidelines-shared-gap:var(--luzmo-spacing-3)}:host([size=s]){--item-option-guidelines-rows-gap:var(--luzmo-spacing-1);--item-option-guidelines-row-gap:var(--luzmo-spacing-1);--item-option-guidelines-shared-gap:var(--luzmo-spacing-2)}:host([size=l]){--item-option-guidelines-rows-gap:var(--luzmo-spacing-3);--item-option-guidelines-row-gap:var(--luzmo-spacing-3);--item-option-guidelines-shared-gap:var(--luzmo-spacing-4)}:host([size=xl]){--item-option-guidelines-rows-gap:var(--luzmo-spacing-4);--item-option-guidelines-row-gap:var(--luzmo-spacing-3);--item-option-guidelines-shared-gap:var(--luzmo-spacing-4)}`,N=0,P=6,F=10**-6,I={maximumFractionDigits:P},L=t.t(a.t),R=class extends L{constructor(...e){super(...e),this.lineTypes=[],this.lineTypeLabels={},this.defaultColor=y(),this.debounce=200,this.liveInteractions=!1,this._interaction=new r.t(this,n.t),this._lineIds=[],this._lineIdCounter=0,this._styleLabelId=`luzmo-item-option-guidelines-style-${++N}`,this._widthLabelId=`luzmo-item-option-guidelines-width-${N}`}static get styles(){return[...super.styles,(0,s.unsafeCSS)(M)]}willUpdate(e){super.willUpdate(e),e.has(`value`)&&(this._clearDebounce(),this._guidelines=C(this.value),this._lineIds=(this._guidelines?.lines??[]).map((e,t)=>this._lineIds[t]??this._createLineId())),e.has(`liveInteractions`)&&(this.liveInteractions?this._clearDebounce():this.endInteraction())}disconnectedCallback(){super.disconnectedCallback(),this._clearDebounce()}_createLineId(){return`${this._styleLabelId}-line-${++this._lineIdCounter}`}_clearDebounce(){clearTimeout(this._debounceTimeout),this._debounceTimeout=void 0}endInteraction(){for(let e of this._colorPickers??[])e.endInteraction?.();this._interaction.endAll()}_handleInteractionStart(e,t){this.liveInteractions&&this._interaction.start(t.currentTarget,t.detail,this._guidelines?.lines[e]?.color)}_finalizeBeforeStructureChange(){this.liveInteractions&&this.endInteraction()}_handleInteractionEnd(e){this._interaction.end(e.currentTarget,e.detail)}_handleInteractionCancel(e){this._interaction.cancel(e.currentTarget,e.detail)}_emit(e,t=!1,n=this,r){let i=t=>{this._debounceTimeout=void 0,this.dispatchEvent(new CustomEvent(`luzmo-option-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:t?{value:e,interaction:t}:{value:e}}))};this._clearDebounce(),this.liveInteractions?this._interaction.update(n,e,i,r):t||this.debounce<=0?i():this._debounceTimeout=setTimeout(i,this.debounce)}_commit(e,t=!1,n,r){this._guidelines=e,this._emit(e,t,n,r)}_allowedTypes(){return v(this.lineTypes)}_typeLabel(e){if(this.lineTypeLabels[e])return this.lineTypeLabels[e];switch(e){case`value`:return(0,l.msg)(`Value`,{id:`item-option-guidelines-type-value`,desc:`Guideline type: manual numeric value`});case`average`:return(0,l.msg)(`Average`,{id:`item-option-guidelines-type-average`,desc:`Guideline type: average of the plotted data`});case`median`:return(0,l.msg)(`Median`,{id:`item-option-guidelines-type-median`,desc:`Guideline type: median of the plotted data`});case`average open`:return(0,l.msg)(`Average open`,{id:`item-option-guidelines-type-average-open`,desc:`Guideline type: average of open values`});case`average close`:return(0,l.msg)(`Average close`,{id:`item-option-guidelines-type-average-close`,desc:`Guideline type: average of close values`})}}_typeValues(){return Object.fromEntries(this._allowedTypes().map(e=>[e,this._typeLabel(e)]))}_widthValues(){return{1:(0,l.msg)(`Thin`,{id:`item-option-guidelines-width-thin`,desc:`Guideline width: thin`}),2:(0,l.msg)(`Medium`,{id:`item-option-guidelines-width-medium`,desc:`Guideline width: medium`}),3:(0,l.msg)(`Thick`,{id:`item-option-guidelines-width-thick`,desc:`Guideline width: thick`})}}_styleOptions(){return[{key:`0`,icon:o.luzmoBorderSolid,label:(0,l.msg)(`Solid`,{id:`item-option-guidelines-style-solid`,desc:`Guideline line style: solid`})},{key:`1,2`,icon:o.luzmoBorderDotted,label:(0,l.msg)(`Dotted`,{id:`item-option-guidelines-style-dotted`,desc:`Guideline line style: dotted`})},{key:`3,3`,icon:o.luzmoBorderDashed,label:(0,l.msg)(`Dashed`,{id:`item-option-guidelines-style-dashed`,desc:`Guideline line style: dashed`})}]}_handleAdd(){this.disabled||(this._finalizeBeforeStructureChange(),this._lineIds=[...this._lineIds,this._createLineId()],this._commit(T(this._guidelines,this.lineTypes,this.defaultColor),!0))}_handleRemove(e){!this.disabled&&this._guidelines&&(this._finalizeBeforeStructureChange(),this._lineIds=this._lineIds.filter((t,n)=>n!==e),this._commit(E(this._guidelines,e),!0))}_handleTypeChange(e,t){!this.disabled&&this._guidelines&&_(t.detail)&&this._commit(D(this._guidelines,e,t.detail),!0)}_handleColorChange(e,t){if(this.disabled||!this._guidelines)return;let n=t.target.color;typeof n==`string`&&this._commit(O(this._guidelines,e,n),!1,t.currentTarget??void 0,n)}_handleValueChange(e,t){if(this.disabled||!this._guidelines)return;let n=t.target.value;typeof n==`number`&&Number.isFinite(n)&&this._commit(k(this._guidelines,e,n))}_handleStyleChange(e){if(this.disabled||!this._guidelines)return;let t=e.target.selected?.[0];(t===`0`||t===`1,2`||t===`3,3`)&&this._commit(A(this._guidelines,t),!0)}_handleWidthChange(e){if(this.disabled||!this._guidelines)return;let t=e.detail,n=e.target.value,r=t===`1`||t===`2`||t===`3`?t:n;(r===`1`||r===`2`||r===`3`)&&this._commit(j(this._guidelines,r),!0)}_lineKey(e){return this._lineIds[e]}_renderLine(e,t){let n=t+1,r=(0,l.msg)(l.str`Guideline ${n} color`,{id:`item-option-guidelines-color`,desc:`Accessible name for one guideline color picker`}),i=(0,l.msg)(l.str`Guideline ${n} type`,{id:`item-option-guidelines-type`,desc:`Accessible name for one guideline type picker`}),a=(0,l.msg)(l.str`Guideline ${n} value`,{id:`item-option-guidelines-value`,desc:`Accessible name for one manual guideline value`}),c=(0,l.msg)(l.str`Remove guideline ${n}`,{id:`item-option-guidelines-remove`,desc:`Aria label for removing one guideline row`});return s.html`
|
|
21
|
+
<div class="guideline-row">
|
|
22
|
+
<luzmo-color-picker
|
|
23
|
+
class="guideline-color"
|
|
24
|
+
.color=${e.color}
|
|
25
|
+
.size=${this.size}
|
|
26
|
+
rounding="full"
|
|
27
|
+
shape="circle"
|
|
28
|
+
.label=${r}
|
|
29
|
+
?disabled=${this.disabled}
|
|
30
|
+
@change=${e=>this._handleColorChange(t,e)}
|
|
31
|
+
@luzmo-interaction-start=${e=>this._handleInteractionStart(t,e)}
|
|
32
|
+
@luzmo-interaction-end=${this._handleInteractionEnd}
|
|
33
|
+
@luzmo-interaction-cancel=${this._handleInteractionCancel}
|
|
34
|
+
></luzmo-color-picker>
|
|
35
|
+
<luzmo-picker
|
|
36
|
+
class="guideline-type"
|
|
37
|
+
.label=${i}
|
|
38
|
+
.value=${e.type}
|
|
39
|
+
.size=${this.size}
|
|
40
|
+
variant="highlight"
|
|
41
|
+
?disabled=${this.disabled}
|
|
42
|
+
@change=${e=>this._handleTypeChange(t,e)}
|
|
43
|
+
>
|
|
44
|
+
${Object.entries(this._typeValues()).map(([e,t])=>s.html`
|
|
45
|
+
<luzmo-menu-item value=${e}>${t}</luzmo-menu-item>
|
|
46
|
+
`)}
|
|
47
|
+
</luzmo-picker>
|
|
48
|
+
${e.type===`value`?s.html`
|
|
49
|
+
<luzmo-number-field
|
|
50
|
+
class="guideline-value"
|
|
51
|
+
.value=${e.value??0}
|
|
52
|
+
.size=${this.size}
|
|
53
|
+
.step=${F}
|
|
54
|
+
.formatOptions=${I}
|
|
55
|
+
.label=${a}
|
|
56
|
+
?disabled=${this.disabled}
|
|
57
|
+
@change=${e=>this._handleValueChange(t,e)}
|
|
58
|
+
></luzmo-number-field>
|
|
59
|
+
`:s.html`
|
|
60
|
+
<div class="guideline-value-spacer"></div>
|
|
61
|
+
`}
|
|
62
|
+
<luzmo-action-button
|
|
63
|
+
class="guideline-remove"
|
|
64
|
+
quiet
|
|
65
|
+
.size=${this.size}
|
|
66
|
+
.label=${c}
|
|
67
|
+
?disabled=${this.disabled}
|
|
68
|
+
@click=${()=>this._handleRemove(t)}
|
|
69
|
+
>
|
|
70
|
+
<luzmo-icon slot="icon" .size=${this.size} .icon=${o.luzmoTrashOutline}></luzmo-icon>
|
|
71
|
+
</luzmo-action-button>
|
|
72
|
+
</div>
|
|
73
|
+
`}_renderSharedStyle(e){return s.html`
|
|
74
|
+
<div class="guideline-shared">
|
|
75
|
+
<div class="guideline-shared-row">
|
|
76
|
+
<span class="guideline-shared-label" id=${this._styleLabelId}>
|
|
77
|
+
${(0,l.msg)(`Style`,{id:`item-option-guidelines-style-label`,desc:`Label for shared guideline dash style`})}
|
|
78
|
+
</span>
|
|
79
|
+
<luzmo-action-group
|
|
80
|
+
class="guideline-style"
|
|
81
|
+
compact
|
|
82
|
+
quiet
|
|
83
|
+
emphasized
|
|
84
|
+
selects="single"
|
|
85
|
+
.size=${this.size}
|
|
86
|
+
.selected=${[e.style.type]}
|
|
87
|
+
aria-labelledby=${this._styleLabelId}
|
|
88
|
+
?disabled=${this.disabled}
|
|
89
|
+
@change=${this._handleStyleChange}
|
|
90
|
+
>
|
|
91
|
+
${this._styleOptions().map(e=>s.html`
|
|
92
|
+
<luzmo-action-button value=${e.key} ?disabled=${this.disabled} .label=${e.label}>
|
|
93
|
+
<luzmo-icon slot="icon" .size=${this.size} .icon=${e.icon}></luzmo-icon>
|
|
94
|
+
</luzmo-action-button>
|
|
95
|
+
`)}
|
|
96
|
+
</luzmo-action-group>
|
|
97
|
+
</div>
|
|
98
|
+
<div class="guideline-shared-row">
|
|
99
|
+
<span class="guideline-shared-label" id=${this._widthLabelId}>
|
|
100
|
+
${(0,l.msg)(`Width`,{id:`item-option-guidelines-width-label`,desc:`Label for shared guideline width`})}
|
|
101
|
+
</span>
|
|
102
|
+
<luzmo-picker
|
|
103
|
+
class="guideline-width"
|
|
104
|
+
aria-labelledby=${this._widthLabelId}
|
|
105
|
+
.value=${e.style.width}
|
|
106
|
+
.size=${this.size}
|
|
107
|
+
variant="highlight"
|
|
108
|
+
?disabled=${this.disabled}
|
|
109
|
+
@change=${this._handleWidthChange}
|
|
110
|
+
>
|
|
111
|
+
${Object.entries(this._widthValues()).map(([e,t])=>s.html`
|
|
112
|
+
<luzmo-menu-item value=${e}>${t}</luzmo-menu-item>
|
|
113
|
+
`)}
|
|
114
|
+
</luzmo-picker>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
`}renderController(){let e=this._guidelines?.lines??[],t=this.label||(0,l.msg)(`Guidelines`,{id:`item-option-guidelines-group`,desc:`Accessible name for the guidelines editor`});return s.html`
|
|
118
|
+
<div id="luzmo-item-option-control" class="guidelines" role="group" aria-label=${t}>
|
|
119
|
+
${e.length>0?s.html`
|
|
120
|
+
<div class="guideline-rows">
|
|
121
|
+
${(0,u.repeat)(e,(e,t)=>this._lineKey(t),(e,t)=>this._renderLine(e,t))}
|
|
122
|
+
</div>
|
|
123
|
+
`:s.nothing}
|
|
124
|
+
<div class="guidelines-add">
|
|
125
|
+
<luzmo-button
|
|
126
|
+
class="add-guideline"
|
|
127
|
+
treatment="outline"
|
|
128
|
+
.size=${this.size}
|
|
129
|
+
?disabled=${this.disabled}
|
|
130
|
+
@click=${this._handleAdd}
|
|
131
|
+
>
|
|
132
|
+
<luzmo-icon slot="icon" .icon=${o.luzmoPlus} .size=${this.size}></luzmo-icon>
|
|
133
|
+
${(0,l.msg)(`Add guideline`,{id:`item-option-guidelines-add`,desc:`Button that adds a chart guideline`})}
|
|
134
|
+
</luzmo-button>
|
|
135
|
+
</div>
|
|
136
|
+
${this._guidelines&&e.length>0?this._renderSharedStyle(this._guidelines):s.nothing}
|
|
137
|
+
</div>
|
|
138
|
+
`}};e.t([(0,c.property)({attribute:!1})],R.prototype,`value`,void 0),e.t([(0,c.property)({attribute:!1})],R.prototype,`lineTypes`,void 0),e.t([(0,c.property)({attribute:!1})],R.prototype,`lineTypeLabels`,void 0),e.t([(0,c.property)({type:String,reflect:!0,attribute:`default-color`})],R.prototype,`defaultColor`,void 0),e.t([(0,c.property)({type:Number,reflect:!0})],R.prototype,`debounce`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0,attribute:`live-interactions`})],R.prototype,`liveInteractions`,void 0),e.t([(0,c.queryAll)(`luzmo-color-picker`)],R.prototype,`_colorPickers`,void 0),e.t([(0,c.state)()],R.prototype,`_guidelines`,void 0),R=e.t([(0,l.localized)()],R),typeof customElements<`u`&&!customElements.get(`luzmo-item-option-guidelines`)&&customElements.define(`luzmo-item-option-guidelines`,R),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return R}});
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../item-option-panel-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../item-option-panel-CU51qvgV.cjs");exports.LuzmoItemOptionPanel=e.t;
|
|
@@ -5,4 +5,4 @@ declare global {
|
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
export { LuzmoItemOptionPanel } from './item-option-panel';
|
|
8
|
-
export type { ItemOptionsChangedEventDetail } from '../item-option/types';
|
|
8
|
+
export type { ItemOptionInteraction, ItemOptionInteractionEventDetail, ItemOptionsChangedEventDetail } from '../item-option/types';
|
|
@@ -6,7 +6,10 @@ import { ElementSize, LuzmoElement } from '../../utils/base';
|
|
|
6
6
|
import './../item-option';
|
|
7
7
|
/**
|
|
8
8
|
* @customElement luzmo-item-option-panel
|
|
9
|
-
* @fires {CustomEvent<ItemOptionsChangedEventDetail>} luzmo-options-changed - Announces that the `options` of the element have changed
|
|
9
|
+
* @fires {CustomEvent<ItemOptionsChangedEventDetail>} luzmo-options-changed - Announces that the `options` of the element have changed. With `live-interactions`, updates inside a gesture carry `interaction`.
|
|
10
|
+
* @fires {CustomEvent<ItemOptionInteractionEventDetail>} luzmo-option-interaction-start - With `live-interactions`: bubbles from the option whose drag or held key first changed its value, right before that options update; `detail.optionKey` names it.
|
|
11
|
+
* @fires {CustomEvent<ItemOptionInteractionEventDetail>} luzmo-option-interaction-end - With `live-interactions`: bubbles from the option whose gesture ended, after its last options update.
|
|
12
|
+
* @fires {CustomEvent<ItemOptionInteractionEventDetail>} luzmo-option-interaction-cancel - With `live-interactions`: bubbles from the option whose gesture was cancelled and reverted.
|
|
10
13
|
*/
|
|
11
14
|
export declare class LuzmoItemOptionPanel extends LuzmoElement {
|
|
12
15
|
static styles: import("lit").CSSResult;
|
|
@@ -57,6 +60,11 @@ export declare class LuzmoItemOptionPanel extends LuzmoElement {
|
|
|
57
60
|
* The auth token of the databroker
|
|
58
61
|
*/
|
|
59
62
|
authToken?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Emits options updates live, without the controls' debounce, plus `luzmo-option-interaction-*` events
|
|
65
|
+
* around drags and held keys. Off by default.
|
|
66
|
+
*/
|
|
67
|
+
liveInteractions: boolean;
|
|
60
68
|
private _itemTypeLoaded?;
|
|
61
69
|
private _languageLoaded?;
|
|
62
70
|
private _optionsConfiguration;
|
|
@@ -67,6 +75,9 @@ export declare class LuzmoItemOptionPanel extends LuzmoElement {
|
|
|
67
75
|
private _isCustomOptionsConfiguration;
|
|
68
76
|
private renderAllGroups;
|
|
69
77
|
private renderGroup;
|
|
78
|
+
/** Ends the open gestures of every option now, keeping their values. Call before removing or rebinding the panel. */
|
|
79
|
+
endInteraction(): void;
|
|
80
|
+
private _getLatestOptions;
|
|
70
81
|
private changedOptions;
|
|
71
82
|
private renderOptionControl;
|
|
72
83
|
private renderDivider;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import "./tokens-6HmQYnEP.js";
|
|
21
21
|
import { i as e } from "./base-rAte-QzM.js";
|
|
22
22
|
import { t } from "./decorate-B2TzfnLZ.js";
|
|
23
|
-
import { i as n, n as r, r as i } from "./item-option-
|
|
23
|
+
import { i as n, n as r, r as i } from "./item-option-DKLRnicU.js";
|
|
24
24
|
import { html as a, unsafeCSS as o } from "lit";
|
|
25
25
|
import { property as s } from "lit/decorators.js";
|
|
26
26
|
import "@luzmo/lucero/divider";
|
|
@@ -50,7 +50,7 @@ var l = ":host{font-size:var(--luzmo-item-option-panel-font-size,var(--luzmo-fon
|
|
|
50
50
|
this.customOptionsConfiguration,
|
|
51
51
|
this.customTranslations
|
|
52
52
|
]
|
|
53
|
-
}), this.language = "en", this.options = {}, this.slots = [], this.size = "m", this._optionsConfiguration = [], this._translations = {}, this._hasCustomTranslationsFile = !1, this.renderAllGroups = (e) => {
|
|
53
|
+
}), this.language = "en", this.options = {}, this.slots = [], this.size = "m", this.liveInteractions = !1, this._optionsConfiguration = [], this._translations = {}, this._hasCustomTranslationsFile = !1, this.renderAllGroups = (e) => {
|
|
54
54
|
if (!Array.isArray(e)) return a`
|
|
55
55
|
|
|
56
56
|
`;
|
|
@@ -99,13 +99,16 @@ var l = ":host{font-size:var(--luzmo-item-option-panel-font-size,var(--luzmo-fon
|
|
|
99
99
|
return a`<luzmo-accordion-item label=${n} ?open=${e.open}>
|
|
100
100
|
${t(e.children)}
|
|
101
101
|
</luzmo-accordion-item>`;
|
|
102
|
-
}, this.changedOptions = (e) => {
|
|
103
|
-
let t = e?.detail?.options;
|
|
102
|
+
}, this._getLatestOptions = () => this.options ?? {}, this.changedOptions = (e) => {
|
|
103
|
+
let t = e?.detail?.options, n = e?.detail?.interaction;
|
|
104
104
|
this.options = e?.detail?.options, e.preventDefault(), e.stopPropagation(), this.dispatchEvent(new CustomEvent("luzmo-options-changed", {
|
|
105
105
|
bubbles: !0,
|
|
106
106
|
composed: !0,
|
|
107
107
|
cancelable: !0,
|
|
108
|
-
detail:
|
|
108
|
+
detail: n ? {
|
|
109
|
+
options: t,
|
|
110
|
+
interaction: n
|
|
111
|
+
} : { options: t }
|
|
109
112
|
}));
|
|
110
113
|
}, this.renderOptionControl = (e) => {
|
|
111
114
|
let t = this._isCustomOptionsConfiguration, n = t ? r(e, this.customOptionsConfiguration ?? [], !0) : void 0, i = t ? this._getOptionTranslation(e) : this._translationOverrides;
|
|
@@ -114,6 +117,7 @@ var l = ":host{font-size:var(--luzmo-item-option-panel-font-size,var(--luzmo-fon
|
|
|
114
117
|
.itemType=${t ? void 0 : this.itemType}
|
|
115
118
|
.optionKey=${e}
|
|
116
119
|
.options=${this.options}
|
|
120
|
+
.latestOptions=${this._getLatestOptions}
|
|
117
121
|
.customOptionConfiguration=${n}
|
|
118
122
|
.customTranslations=${i}
|
|
119
123
|
.slots=${this.slots}
|
|
@@ -123,12 +127,16 @@ var l = ":host{font-size:var(--luzmo-item-option-panel-font-size,var(--luzmo-fon
|
|
|
123
127
|
.apiUrl=${this.apiUrl}
|
|
124
128
|
.authKey=${this.authKey}
|
|
125
129
|
.authToken=${this.authToken}
|
|
130
|
+
?live-interactions=${this.liveInteractions}
|
|
126
131
|
@luzmo-options-changed=${this.changedOptions}
|
|
127
132
|
></luzmo-item-option>`;
|
|
128
133
|
}, this.renderDivider = () => a`
|
|
129
134
|
<luzmo-divider></luzmo-divider>
|
|
130
135
|
`;
|
|
131
136
|
}
|
|
137
|
+
endInteraction() {
|
|
138
|
+
for (let e of this.renderRoot?.querySelectorAll("luzmo-item-option") ?? []) e.endInteraction?.();
|
|
139
|
+
}
|
|
132
140
|
render() {
|
|
133
141
|
return this._loadItemConfig.render({
|
|
134
142
|
pending: () => a`
|
|
@@ -179,5 +187,9 @@ u = d, u.styles = o(l), t([s({
|
|
|
179
187
|
type: String,
|
|
180
188
|
attribute: "auth-token",
|
|
181
189
|
reflect: !0
|
|
182
|
-
})], d.prototype, "authToken", void 0),
|
|
190
|
+
})], d.prototype, "authToken", void 0), t([s({
|
|
191
|
+
type: Boolean,
|
|
192
|
+
reflect: !0,
|
|
193
|
+
attribute: "live-interactions"
|
|
194
|
+
})], d.prototype, "liveInteractions", void 0), customElements.get("luzmo-item-option-panel") || customElements.define("luzmo-item-option-panel", d);
|
|
183
195
|
export { d as t };
|
|
@@ -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
|
-
require("./tokens-BWMfo_w4.cjs");const e=require("./base-CGDNY_7v.cjs"),t=require("./decorate-DCJt-2rt.cjs"),n=require("./item-option-
|
|
20
|
+
require("./tokens-BWMfo_w4.cjs");const e=require("./base-CGDNY_7v.cjs"),t=require("./decorate-DCJt-2rt.cjs"),n=require("./item-option-DpLdospV.cjs");let r=require("lit"),i=require("lit/decorators.js");require("@luzmo/lucero/divider");let a=require("@lit/task");require("@luzmo/lucero/accordion");var o=`:host{font-size:var(--luzmo-item-option-panel-font-size,var(--luzmo-font-size))}:host luzmo-divider{margin:var(--luzmo-item-option-panel-divider-vertical-margin,calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-2))) 0;display:block}:host luzmo-item-option{margin:var(--luzmo-item-option-divider-vertical-margin,var(--luzmo-spacing-4)) 0;display:block}:host([size=s]){font-size:var(--luzmo-item-option-panel-font-size-s,var(--luzmo-font-size-s))}:host([size=l]){font-size:var(--luzmo-item-option-panel-font-size-l,var(--luzmo-font-size-l))}:host([size=xl]){font-size:var(--luzmo-item-option-panel-font-size-xl,var(--luzmo-font-size-xl))}`,s,c=class extends e.i{constructor(...e){super(...e),this._loadItemConfig=new a.Task(this,{task:async([e,t,r,i])=>{let a=this._getTranslationOverrides(i),o=this._getTranslationsFile(i),s=this._hasCustomTranslationsFile;if(this._translationOverrides=a??o?.options,this._groupTranslationOverrides=a,this._hasCustomTranslationsFile=!!o,r)return this._isCustomOptionsConfiguration=!0,this._optionsConfiguration=r,this._translations=o??{},this._itemTypeLoaded=void 0,this._languageLoaded=void 0,{config:this._optionsConfiguration};if(e){let r=e!==this._itemTypeLoaded,i=e!==this._itemTypeLoaded||t!==this._languageLoaded||!o&&s;if(r&&(this._optionsConfiguration=await n.r(e)??[],this._itemTypeLoaded=e),o)this._translations=o,this._languageLoaded=t;else if(i){let r=t??`en`;this._translations=await n.i(e,r,!0)??{},this._languageLoaded=t}this._isCustomOptionsConfiguration=!1}else this._optionsConfiguration=[],this._translations=o??{};return{config:this._optionsConfiguration}},args:()=>[this.itemType,this.language,this.customOptionsConfiguration,this.customTranslations]}),this.language=`en`,this.options={},this.slots=[],this.size=`m`,this.liveInteractions=!1,this._optionsConfiguration=[],this._translations={},this._hasCustomTranslationsFile=!1,this.renderAllGroups=e=>{if(!Array.isArray(e))return r.html`
|
|
21
21
|
|
|
22
22
|
`;let t=e?.map(e=>{if(e?.children)return this.renderGroup(e)});return e&&e.length>0?r.html`<luzmo-accordion
|
|
23
23
|
variant="highlight"
|
|
@@ -43,11 +43,12 @@ require("./tokens-BWMfo_w4.cjs");const e=require("./base-CGDNY_7v.cjs"),t=requir
|
|
|
43
43
|
>${this.renderGroup(e)}</luzmo-accordion
|
|
44
44
|
>`}),n=e.key?this._groupTranslationOverrides?.[e.key]?.label??this._translations.groups?.[e.key]?.label??e.label??e.key:e.label??``;return r.html`<luzmo-accordion-item label=${n} ?open=${e.open}>
|
|
45
45
|
${t(e.children)}
|
|
46
|
-
</luzmo-accordion-item>`},this.changedOptions=e=>{let t=e?.detail?.options;this.options=e?.detail?.options,e.preventDefault(),e.stopPropagation(),this.dispatchEvent(new CustomEvent(`luzmo-options-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{options:t}}))},this.renderOptionControl=e=>{let t=this._isCustomOptionsConfiguration,i=t?n.n(e,this.customOptionsConfiguration??[],!0):void 0,a=t?this._getOptionTranslation(e):this._translationOverrides;return r.html`<luzmo-item-option
|
|
46
|
+
</luzmo-accordion-item>`},this._getLatestOptions=()=>this.options??{},this.changedOptions=e=>{let t=e?.detail?.options,n=e?.detail?.interaction;this.options=e?.detail?.options,e.preventDefault(),e.stopPropagation(),this.dispatchEvent(new CustomEvent(`luzmo-options-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:n?{options:t,interaction:n}:{options:t}}))},this.renderOptionControl=e=>{let t=this._isCustomOptionsConfiguration,i=t?n.n(e,this.customOptionsConfiguration??[],!0):void 0,a=t?this._getOptionTranslation(e):this._translationOverrides;return r.html`<luzmo-item-option
|
|
47
47
|
class="control"
|
|
48
48
|
.itemType=${t?void 0:this.itemType}
|
|
49
49
|
.optionKey=${e}
|
|
50
50
|
.options=${this.options}
|
|
51
|
+
.latestOptions=${this._getLatestOptions}
|
|
51
52
|
.customOptionConfiguration=${i}
|
|
52
53
|
.customTranslations=${a}
|
|
53
54
|
.slots=${this.slots}
|
|
@@ -57,11 +58,12 @@ require("./tokens-BWMfo_w4.cjs");const e=require("./base-CGDNY_7v.cjs"),t=requir
|
|
|
57
58
|
.apiUrl=${this.apiUrl}
|
|
58
59
|
.authKey=${this.authKey}
|
|
59
60
|
.authToken=${this.authToken}
|
|
61
|
+
?live-interactions=${this.liveInteractions}
|
|
60
62
|
@luzmo-options-changed=${this.changedOptions}
|
|
61
63
|
></luzmo-item-option>`},this.renderDivider=()=>r.html`
|
|
62
64
|
<luzmo-divider></luzmo-divider>
|
|
63
|
-
`}render(){return this._loadItemConfig.render({pending:()=>r.html`
|
|
65
|
+
`}endInteraction(){for(let e of this.renderRoot?.querySelectorAll(`luzmo-item-option`)??[])e.endInteraction?.()}render(){return this._loadItemConfig.render({pending:()=>r.html`
|
|
64
66
|
<p role="status">Loading...</p>
|
|
65
67
|
`,complete:e=>this.renderAllGroups(e.config),error:e=>(console.error(e),r.html`
|
|
66
68
|
|
|
67
|
-
`)})}_getOptionTranslation(e){return this._translationOverrides?.[e]??this._translations.options?.[e]}_getTranslationsFile(e){if(e&&typeof e==`object`&&(`groups`in e||`options`in e))return e}_getTranslationOverrides(e){if(e&&typeof e==`object`&&!(`groups`in e||`options`in e))return e}};s=c,s.styles=(0,r.unsafeCSS)(o),t.t([(0,i.property)({type:String,reflect:!0})],c.prototype,`language`,void 0),t.t([(0,i.property)({type:String,reflect:!0,attribute:`item-type`})],c.prototype,`itemType`,void 0),t.t([(0,i.property)({type:Object})],c.prototype,`options`,void 0),t.t([(0,i.property)({type:Object})],c.prototype,`slots`,void 0),t.t([(0,i.property)({type:Object,reflect:!1})],c.prototype,`customOptionsConfiguration`,void 0),t.t([(0,i.property)({type:Object,reflect:!1})],c.prototype,`customTranslations`,void 0),t.t([(0,i.property)({type:Object})],c.prototype,`theme`,void 0),t.t([(0,i.property)({type:String,reflect:!0})],c.prototype,`size`,void 0),t.t([(0,i.property)({type:String,attribute:`api-url`,reflect:!0})],c.prototype,`apiUrl`,void 0),t.t([(0,i.property)({type:String,attribute:`auth-key`,reflect:!0})],c.prototype,`authKey`,void 0),t.t([(0,i.property)({type:String,attribute:`auth-token`,reflect:!0})],c.prototype,`authToken`,void 0),customElements.get(`luzmo-item-option-panel`)||customElements.define(`luzmo-item-option-panel`,c),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|
|
69
|
+
`)})}_getOptionTranslation(e){return this._translationOverrides?.[e]??this._translations.options?.[e]}_getTranslationsFile(e){if(e&&typeof e==`object`&&(`groups`in e||`options`in e))return e}_getTranslationOverrides(e){if(e&&typeof e==`object`&&!(`groups`in e||`options`in e))return e}};s=c,s.styles=(0,r.unsafeCSS)(o),t.t([(0,i.property)({type:String,reflect:!0})],c.prototype,`language`,void 0),t.t([(0,i.property)({type:String,reflect:!0,attribute:`item-type`})],c.prototype,`itemType`,void 0),t.t([(0,i.property)({type:Object})],c.prototype,`options`,void 0),t.t([(0,i.property)({type:Object})],c.prototype,`slots`,void 0),t.t([(0,i.property)({type:Object,reflect:!1})],c.prototype,`customOptionsConfiguration`,void 0),t.t([(0,i.property)({type:Object,reflect:!1})],c.prototype,`customTranslations`,void 0),t.t([(0,i.property)({type:Object})],c.prototype,`theme`,void 0),t.t([(0,i.property)({type:String,reflect:!0})],c.prototype,`size`,void 0),t.t([(0,i.property)({type:String,attribute:`api-url`,reflect:!0})],c.prototype,`apiUrl`,void 0),t.t([(0,i.property)({type:String,attribute:`auth-key`,reflect:!0})],c.prototype,`authKey`,void 0),t.t([(0,i.property)({type:String,attribute:`auth-token`,reflect:!0})],c.prototype,`authToken`,void 0),t.t([(0,i.property)({type:Boolean,reflect:!0,attribute:`live-interactions`})],c.prototype,`liveInteractions`,void 0),customElements.get(`luzmo-item-option-panel`)||customElements.define(`luzmo-item-option-panel`,c),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../item-option-slider-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../item-option-slider-Kz2eFBql.cjs");exports.LuzmoItemOptionSlider=e.t;
|
|
@@ -5,4 +5,4 @@ declare global {
|
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
export { LuzmoItemOptionSlider } from './item-option-slider';
|
|
8
|
-
export type { ItemOptionChangedEventDetail } from '../item-option/types';
|
|
8
|
+
export type { ItemOptionChangedEventDetail, ItemOptionInteraction, ItemOptionInteractionEventDetail } from '../item-option/types';
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
|
-
export { t as LuzmoItemOptionSlider } from "../item-option-slider-
|
|
20
|
+
export { t as LuzmoItemOptionSlider } from "../item-option-slider-BKtJfL3D.js";
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import '@luzmo/lucero/slider';
|
|
2
|
-
import { type CSSResultArray } from 'lit';
|
|
2
|
+
import { type CSSResultArray, type PropertyValues } from 'lit';
|
|
3
3
|
import { LuzmoItemOptionBase } from '../item-option-base/item-option-base';
|
|
4
4
|
/**
|
|
5
5
|
* @customElement luzmo-item-option-slider
|
|
6
|
-
* @fires {CustomEvent<ItemOptionChangedEventDetail>} luzmo-option-changed - Emitted when the option value changes.
|
|
6
|
+
* @fires {CustomEvent<ItemOptionChangedEventDetail>} luzmo-option-changed - Emitted when the option value changes. With `live-interactions`, emitted on every drag or key step and carries `interaction` inside a gesture.
|
|
7
|
+
* @fires {CustomEvent<ItemOptionInteractionEventDetail>} luzmo-option-interaction-start - With `live-interactions`: a drag or held key first changed the value, right before that value update. A press that never changes the value emits no lifecycle.
|
|
8
|
+
* @fires {CustomEvent<ItemOptionInteractionEventDetail>} luzmo-option-interaction-end - With `live-interactions`: the gesture ended, after its last value update. `changed` is false when the value is back at its start.
|
|
9
|
+
* @fires {CustomEvent<ItemOptionInteractionEventDetail>} luzmo-option-interaction-cancel - With `live-interactions`: the pointer was cancelled and the slider reverted to its start value.
|
|
7
10
|
*/
|
|
8
11
|
export declare class LuzmoItemOptionSlider extends LuzmoItemOptionBase {
|
|
9
12
|
static get styles(): CSSResultArray;
|
|
@@ -19,15 +22,25 @@ export declare class LuzmoItemOptionSlider extends LuzmoItemOptionBase {
|
|
|
19
22
|
step: number;
|
|
20
23
|
/** Delay in milliseconds before the change event is emitted after the user stops interacting. */
|
|
21
24
|
debounce: number;
|
|
25
|
+
/** Emits value updates live, without `debounce`, plus interaction lifecycle events for drags and held keys. */
|
|
26
|
+
liveInteractions: boolean;
|
|
22
27
|
/** Optional transform applied to the stored value before it is displayed in the control. */
|
|
23
28
|
parseValue?: (value?: string | number | any) => number;
|
|
24
29
|
/** Optional transform applied to the control's value before it is emitted in the change event. */
|
|
25
30
|
toValue?: (value?: number) => string | number | any;
|
|
26
31
|
private _slider;
|
|
32
|
+
private readonly _interaction;
|
|
27
33
|
private _debounceTimeout;
|
|
28
34
|
private _lastEmittedSliderValue?;
|
|
35
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
29
36
|
disconnectedCallback(): void;
|
|
37
|
+
private _clearDebounce;
|
|
38
|
+
/** Ends an open drag or held-key gesture now, keeping its value. Call before removing the element. */
|
|
39
|
+
endInteraction(): void;
|
|
30
40
|
private _emitOptionChanged;
|
|
41
|
+
private _handleInteractionStart;
|
|
42
|
+
private _handleInteractionEnd;
|
|
43
|
+
private _handleInteractionCancel;
|
|
31
44
|
private _handleEvent;
|
|
32
45
|
protected renderController(): import("lit-html").TemplateResult<1>;
|
|
33
46
|
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2026 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Luzmo web components (“Luzmo Web Components”)
|
|
6
|
+
* must be used according to the Luzmo Terms of Service.
|
|
7
|
+
* This license allows users with a current active Luzmo account
|
|
8
|
+
* to use the Luzmo Web Components. This license terminates
|
|
9
|
+
* automatically if a user no longer has an active Luzmo account.
|
|
10
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
11
|
+
*
|
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
+
* SOFTWARE.
|
|
19
|
+
* */
|
|
20
|
+
import "./tokens-6HmQYnEP.js";
|
|
21
|
+
import { t as e } from "./decorate-B2TzfnLZ.js";
|
|
22
|
+
import { t } from "./option-interaction-controller-B8S1N_Oo.js";
|
|
23
|
+
import { t as n } from "./item-option-base-BfHciede.js";
|
|
24
|
+
import { html as r, unsafeCSS as i } from "lit";
|
|
25
|
+
import { property as a, query as o } from "lit/decorators.js";
|
|
26
|
+
import "@luzmo/lucero/slider";
|
|
27
|
+
// src/components/item-option-slider/item-option-slider.module.scss?inline
|
|
28
|
+
var s = ":host{overflow:visible}luzmo-slider{contain:layout}", c = class extends n {
|
|
29
|
+
constructor(...e) {
|
|
30
|
+
super(...e), this.value = 0, this.default = 0, this.min = 0, this.max = 100, this.step = 100, this.debounce = 200, this.liveInteractions = !1, this._interaction = new t(this), this._debounceTimeout = null;
|
|
31
|
+
}
|
|
32
|
+
static get styles() {
|
|
33
|
+
return [...super.styles, i(s)];
|
|
34
|
+
}
|
|
35
|
+
willUpdate(e) {
|
|
36
|
+
super.willUpdate(e), e.has("liveInteractions") && (this.liveInteractions ? this._clearDebounce() : this.endInteraction());
|
|
37
|
+
}
|
|
38
|
+
disconnectedCallback() {
|
|
39
|
+
super.disconnectedCallback(), this._clearDebounce();
|
|
40
|
+
}
|
|
41
|
+
_clearDebounce() {
|
|
42
|
+
this._debounceTimeout &&= (clearTimeout(this._debounceTimeout), null);
|
|
43
|
+
}
|
|
44
|
+
endInteraction() {
|
|
45
|
+
this._slider?.endInteraction?.(), this._interaction.endAll();
|
|
46
|
+
}
|
|
47
|
+
_emitOptionChanged(e, t) {
|
|
48
|
+
let n = typeof this.toValue == "function" ? this.toValue(e) : e;
|
|
49
|
+
this._lastEmittedSliderValue = e, this.dispatchEvent(new CustomEvent("luzmo-option-changed", {
|
|
50
|
+
bubbles: !0,
|
|
51
|
+
composed: !0,
|
|
52
|
+
cancelable: !0,
|
|
53
|
+
detail: t ? {
|
|
54
|
+
value: n,
|
|
55
|
+
interaction: t
|
|
56
|
+
} : { value: n }
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
_handleInteractionStart(e) {
|
|
60
|
+
this.liveInteractions && this._interaction.start(e.currentTarget, e.detail, this._slider.value);
|
|
61
|
+
}
|
|
62
|
+
_handleInteractionEnd(e) {
|
|
63
|
+
this._interaction.end(e.currentTarget, e.detail);
|
|
64
|
+
}
|
|
65
|
+
_handleInteractionCancel(e) {
|
|
66
|
+
this._interaction.cancel(e.currentTarget, e.detail);
|
|
67
|
+
}
|
|
68
|
+
_handleEvent(e) {
|
|
69
|
+
let t = this._slider.value;
|
|
70
|
+
this.liveInteractions ? this._interaction.update(e.currentTarget, t, (e) => this._emitOptionChanged(t, e)) : (e.type !== "change" || this._debounceTimeout || !Object.is(t, this._lastEmittedSliderValue)) && (this._debounceTimeout &&= (clearTimeout(this._debounceTimeout), null), this.debounce > 0 ? this._debounceTimeout = setTimeout(() => {
|
|
71
|
+
this._debounceTimeout = null, this._emitOptionChanged(t);
|
|
72
|
+
}, this.debounce) : this._emitOptionChanged(t));
|
|
73
|
+
}
|
|
74
|
+
renderController() {
|
|
75
|
+
let e = typeof this.parseValue == "function" ? this.parseValue(this.value) : this.value, t = typeof this.parseValue == "function" ? this.parseValue(this.default) : this.default;
|
|
76
|
+
return r`
|
|
77
|
+
<luzmo-slider
|
|
78
|
+
id="luzmo-item-option-control"
|
|
79
|
+
.label=${this.label}
|
|
80
|
+
.min=${this.min}
|
|
81
|
+
.max=${this.max}
|
|
82
|
+
.value=${e ?? t}
|
|
83
|
+
.step=${this.step}
|
|
84
|
+
.size=${this.size}
|
|
85
|
+
.disabled=${this.disabled}
|
|
86
|
+
@input=${this._handleEvent}
|
|
87
|
+
@change=${this._handleEvent}
|
|
88
|
+
@luzmo-interaction-start=${this._handleInteractionStart}
|
|
89
|
+
@luzmo-interaction-end=${this._handleInteractionEnd}
|
|
90
|
+
@luzmo-interaction-cancel=${this._handleInteractionCancel}
|
|
91
|
+
></luzmo-slider>
|
|
92
|
+
`;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
// src/components/item-option-slider/index.ts
|
|
96
|
+
e([a({
|
|
97
|
+
type: Number,
|
|
98
|
+
reflect: !0
|
|
99
|
+
})], c.prototype, "value", void 0), e([a({
|
|
100
|
+
type: Number,
|
|
101
|
+
reflect: !0
|
|
102
|
+
})], c.prototype, "default", void 0), e([a({
|
|
103
|
+
type: Number,
|
|
104
|
+
reflect: !0
|
|
105
|
+
})], c.prototype, "min", void 0), e([a({
|
|
106
|
+
type: Number,
|
|
107
|
+
reflect: !0
|
|
108
|
+
})], c.prototype, "max", void 0), e([a({
|
|
109
|
+
type: Number,
|
|
110
|
+
reflect: !0
|
|
111
|
+
})], c.prototype, "step", void 0), e([a({
|
|
112
|
+
type: Number,
|
|
113
|
+
reflect: !0
|
|
114
|
+
})], c.prototype, "debounce", void 0), e([a({
|
|
115
|
+
type: Boolean,
|
|
116
|
+
reflect: !0,
|
|
117
|
+
attribute: "live-interactions"
|
|
118
|
+
})], c.prototype, "liveInteractions", void 0), e([a()], c.prototype, "parseValue", void 0), e([a()], c.prototype, "toValue", void 0), e([o("luzmo-slider")], c.prototype, "_slider", void 0), customElements.get("luzmo-item-option-slider") || customElements.define("luzmo-item-option-slider", c);
|
|
119
|
+
export { c as t };
|
|
@@ -0,0 +1,36 @@
|
|
|
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("./option-interaction-controller-D0U-CTpZ.cjs"),n=require("./item-option-base-BMy6dWbc.cjs");let r=require("lit"),i=require("lit/decorators.js");require("@luzmo/lucero/slider");var a=`:host{overflow:visible}luzmo-slider{contain:layout}`,o=class extends n.t{constructor(...e){super(...e),this.value=0,this.default=0,this.min=0,this.max=100,this.step=100,this.debounce=200,this.liveInteractions=!1,this._interaction=new t.t(this),this._debounceTimeout=null}static get styles(){return[...super.styles,(0,r.unsafeCSS)(a)]}willUpdate(e){super.willUpdate(e),e.has(`liveInteractions`)&&(this.liveInteractions?this._clearDebounce():this.endInteraction())}disconnectedCallback(){super.disconnectedCallback(),this._clearDebounce()}_clearDebounce(){this._debounceTimeout&&=(clearTimeout(this._debounceTimeout),null)}endInteraction(){this._slider?.endInteraction?.(),this._interaction.endAll()}_emitOptionChanged(e,t){let n=typeof this.toValue==`function`?this.toValue(e):e;this._lastEmittedSliderValue=e,this.dispatchEvent(new CustomEvent(`luzmo-option-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:t?{value:n,interaction:t}:{value:n}}))}_handleInteractionStart(e){this.liveInteractions&&this._interaction.start(e.currentTarget,e.detail,this._slider.value)}_handleInteractionEnd(e){this._interaction.end(e.currentTarget,e.detail)}_handleInteractionCancel(e){this._interaction.cancel(e.currentTarget,e.detail)}_handleEvent(e){let t=this._slider.value;this.liveInteractions?this._interaction.update(e.currentTarget,t,e=>this._emitOptionChanged(t,e)):(e.type!==`change`||this._debounceTimeout||!Object.is(t,this._lastEmittedSliderValue))&&(this._debounceTimeout&&=(clearTimeout(this._debounceTimeout),null),this.debounce>0?this._debounceTimeout=setTimeout(()=>{this._debounceTimeout=null,this._emitOptionChanged(t)},this.debounce):this._emitOptionChanged(t))}renderController(){let e=typeof this.parseValue==`function`?this.parseValue(this.value):this.value,t=typeof this.parseValue==`function`?this.parseValue(this.default):this.default;return r.html`
|
|
21
|
+
<luzmo-slider
|
|
22
|
+
id="luzmo-item-option-control"
|
|
23
|
+
.label=${this.label}
|
|
24
|
+
.min=${this.min}
|
|
25
|
+
.max=${this.max}
|
|
26
|
+
.value=${e??t}
|
|
27
|
+
.step=${this.step}
|
|
28
|
+
.size=${this.size}
|
|
29
|
+
.disabled=${this.disabled}
|
|
30
|
+
@input=${this._handleEvent}
|
|
31
|
+
@change=${this._handleEvent}
|
|
32
|
+
@luzmo-interaction-start=${this._handleInteractionStart}
|
|
33
|
+
@luzmo-interaction-end=${this._handleInteractionEnd}
|
|
34
|
+
@luzmo-interaction-cancel=${this._handleInteractionCancel}
|
|
35
|
+
></luzmo-slider>
|
|
36
|
+
`}};e.t([(0,i.property)({type:Number,reflect:!0})],o.prototype,`value`,void 0),e.t([(0,i.property)({type:Number,reflect:!0})],o.prototype,`default`,void 0),e.t([(0,i.property)({type:Number,reflect:!0})],o.prototype,`min`,void 0),e.t([(0,i.property)({type:Number,reflect:!0})],o.prototype,`max`,void 0),e.t([(0,i.property)({type:Number,reflect:!0})],o.prototype,`step`,void 0),e.t([(0,i.property)({type:Number,reflect:!0})],o.prototype,`debounce`,void 0),e.t([(0,i.property)({type:Boolean,reflect:!0,attribute:`live-interactions`})],o.prototype,`liveInteractions`,void 0),e.t([(0,i.property)()],o.prototype,`parseValue`,void 0),e.t([(0,i.property)()],o.prototype,`toValue`,void 0),e.t([(0,i.query)(`luzmo-slider`)],o.prototype,`_slider`,void 0),customElements.get(`luzmo-item-option-slider`)||customElements.define(`luzmo-item-option-slider`,o),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./area-chart-options.config-D99tvt_H.cjs"),t=require("./bar-chart-options.config-BQ-PbucR.cjs"),n=require("./box-plot-options.config-BcGisybi.cjs"),r=require("./bubble-chart-options.config-DMk8Yjfk.cjs"),i=require("./bullet-chart-options.config-DUAnmPGW.cjs"),a=require("./choropleth-map-options.config-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./area-chart-options.config-D99tvt_H.cjs"),t=require("./bar-chart-options.config-BQ-PbucR.cjs"),n=require("./box-plot-options.config-BcGisybi.cjs"),r=require("./bubble-chart-options.config-DMk8Yjfk.cjs"),i=require("./bullet-chart-options.config-DUAnmPGW.cjs"),a=require("./choropleth-map-options.config-DwFJ00CS.cjs"),o=require("./circle-pack-chart-options.config-DMNMYWZX.cjs"),s=require("./circular-gauge-options.config-B4Hk-AXi.cjs"),c=require("./column-chart-options.config-CyD8V7j4.cjs"),l=require("./combination-chart-options.config-Cg3ZEKMe.cjs"),u=require("./conditional-number-options.config-CsEhIU-T.cjs"),d=require("./date-comparison-filter-options.config-vCXOhzkp.cjs"),f=require("./date-filter-options.config-D_SMC4NH.cjs"),p=require("./donut-chart-options.config-DX-spmaZ.cjs"),m=require("./dropdown-filter-options.config-FjrC4F1D.cjs"),h=require("./evolution-number-options.config-B5qxlpwU.cjs"),g=require("./funnel-chart-options.config-CKp94nx7.cjs"),_=require("./heat-map-options.config-DjQkB039.cjs"),v=require("./heat-table-options.config-D21xtaIk.cjs"),y=require("./hexbin-map-options.config-DZLLOr7D.cjs"),b=require("./image-options.config-Dc8N_USB.cjs"),x=require("./line-chart-options.config-DOGbeJhy.cjs"),S=require("./marker-map-options.config-DxcxzLu_.cjs"),C=require("./ohlc-chart-options.config-CvlHm6hy.cjs"),w=require("./parallel-coordinates-plot-options.config-UHrCS9q5.cjs"),T=require("./pivot-table-options.config-5pYvqc35.cjs"),E=require("./pyramid-chart-options.config-CAC6cMmt.cjs"),D=require("./radar-chart-options.config-C1gfNkE6.cjs"),O=require("./regular-table-options.config-BCth1USK.cjs"),k=require("./route-map-options.config-DER6ENky.cjs"),A=require("./sankey-diagram-options.config-B8aHKfFt.cjs"),j=require("./scatter-plot-options.config-DhOGahRc.cjs"),M=require("./search-filter-options.config-DcPuNHyG.cjs"),N=require("./slicer-filter-options.config-DqI9WtAi.cjs"),P=require("./slider-filter-options.config-CgMb9Xmz.cjs"),F=require("./speedometer-chart-options.config-C3o5xpCj.cjs"),I=require("./spike-map-options.config-DeF1Whq5.cjs"),L=require("./strip-plot-options.config-CoiMZRzM.cjs"),R=require("./sunburst-chart-options.config-CZdd6qx0.cjs"),z=require("./symbol-map-options.config-C3RTDsGN.cjs"),B=require("./text-options.config-D9EkimNf.cjs"),V=require("./treemap-chart-options.config-DLEY6YuI.cjs"),H=require("./venn-diagram-options.config-BsxzLI46.cjs"),U=require("./video-options.config-BACuLmHj.cjs"),W=require("./wordcloud-chart-options.config-DiyF596X.cjs");exports.areaChartOptionsConfig=e.n,exports.barChartOptionsConfig=t.n,exports.boxPlotOptionsConfig=n.n,exports.bubbleChartOptionsConfig=r.n,exports.bulletChartOptionsConfig=i.n,exports.choroplethMapOptionsConfig=a.n,exports.circlePackChartOptionsConfig=o.n,exports.circularGaugeOptionsConfig=s.n,exports.columnChartOptionsConfig=c.n,exports.combinationChartOptionsConfig=l.n,exports.conditionalNumberOptionsConfig=u.n,exports.dateComparisonFilterOptionsConfig=d.n,exports.dateFilterOptionsConfig=f.n,exports.donutChartOptionsConfig=p.n,exports.dropdownFilterOptionsConfig=m.n,exports.evolutionNumberOptionsConfig=h.t,exports.funnelChartOptionsConfig=g.n,exports.heatMapOptionsConfig=_.t,exports.heatTableOptionsConfig=v.n,exports.hexbinMapOptionsConfig=y.n,exports.imageOptionsConfig=b.t,exports.lineChartOptionsConfig=x.t,exports.markerMapOptionsConfig=S.n,exports.ohlcChartOptionsConfig=C.t,exports.parallelCoordinatesPlotOptionsConfig=w.t,exports.pivotTableOptionsConfig=T.n,exports.pyramidChartOptionsConfig=E.n,exports.radarChartOptionsConfig=D.n,exports.regularTableOptionsConfig=O.t,exports.routeMapOptionsConfig=k.t,exports.sankeyDiagramOptionsConfig=A.t,exports.scatterPlotOptionsConfig=j.t,exports.searchFilterOptionsConfig=M.t,exports.slicerFilterOptionsConfig=N.t,exports.sliderFilterOptionsConfig=P.t,exports.speedometerChartOptionsConfig=F.t,exports.spikeMapOptionsConfig=I.t,exports.stripPlotOptionsConfig=L.n,exports.sunburstChartOptionsConfig=R.t,exports.symbolMapOptionsConfig=z.t,exports.textOptionsConfig=B.t,exports.treemapChartOptionsConfig=V.t,exports.vennDiagramOptionsConfig=H.t,exports.videoOptionsConfig=U.t,exports.wordcloudChartOptionsConfig=W.t;
|
|
@@ -22,7 +22,7 @@ import { n as t } from "./bar-chart-options.config-DHO8grQN.js";
|
|
|
22
22
|
import { n } from "./box-plot-options.config-BgiiwSrU.js";
|
|
23
23
|
import { n as r } from "./bubble-chart-options.config-UM9w5tBs.js";
|
|
24
24
|
import { n as i } from "./bullet-chart-options.config-D9HklLUI.js";
|
|
25
|
-
import { n as a } from "./choropleth-map-options.config-
|
|
25
|
+
import { n as a } from "./choropleth-map-options.config-Blu0Z2tR.js";
|
|
26
26
|
import { n as o } from "./circle-pack-chart-options.config-DQs-uitJ.js";
|
|
27
27
|
import { n as s } from "./circular-gauge-options.config-CnWE16oE.js";
|
|
28
28
|
import { n as c } from "./column-chart-options.config-BYDJTVx6.js";
|
|
@@ -34,8 +34,8 @@ import { n as p } from "./donut-chart-options.config-B2vxfMyh.js";
|
|
|
34
34
|
import { n as m } from "./dropdown-filter-options.config-B2S5I7IG.js";
|
|
35
35
|
import { t as h } from "./evolution-number-options.config-BBWPkY_K.js";
|
|
36
36
|
import { n as g } from "./funnel-chart-options.config-W83a8ukL.js";
|
|
37
|
-
import { t as _ } from "./heat-map-options.config-
|
|
38
|
-
import { n as v } from "./heat-table-options.config-
|
|
37
|
+
import { t as _ } from "./heat-map-options.config-BQkhkLPb.js";
|
|
38
|
+
import { n as v } from "./heat-table-options.config-CMWWTeyo.js";
|
|
39
39
|
import { n as y } from "./hexbin-map-options.config-DUbhSv0B.js";
|
|
40
40
|
import { t as b } from "./image-options.config-D_QOqkE_.js";
|
|
41
41
|
import { t as x } from "./line-chart-options.config-Opoz2jPk.js";
|
|
@@ -46,14 +46,14 @@ import { n as T } from "./pivot-table-options.config-BlrguysB.js";
|
|
|
46
46
|
import { n as E } from "./pyramid-chart-options.config-0Qf1naIx.js";
|
|
47
47
|
import { n as D } from "./radar-chart-options.config-Dd6SMpMz.js";
|
|
48
48
|
import { t as O } from "./regular-table-options.config-TXfzXF_Y.js";
|
|
49
|
-
import { t as k } from "./route-map-options.config-
|
|
49
|
+
import { t as k } from "./route-map-options.config-DTcS47fW.js";
|
|
50
50
|
import { t as A } from "./sankey-diagram-options.config-Y6jRK3wk.js";
|
|
51
51
|
import { t as j } from "./scatter-plot-options.config-DvGofFzR.js";
|
|
52
52
|
import { t as M } from "./search-filter-options.config-JvAotvWb.js";
|
|
53
53
|
import { t as N } from "./slicer-filter-options.config-Bc38dVoU.js";
|
|
54
54
|
import { t as P } from "./slider-filter-options.config-BaoIKTFj.js";
|
|
55
55
|
import { t as F } from "./speedometer-chart-options.config-CIZKRvbg.js";
|
|
56
|
-
import { t as I } from "./spike-map-options.config-
|
|
56
|
+
import { t as I } from "./spike-map-options.config-CPYfKWoF.js";
|
|
57
57
|
import { n as L } from "./strip-plot-options.config-D1h3YBHj.js";
|
|
58
58
|
import { t as R } from "./sunburst-chart-options.config-DVETeZFc.js";
|
|
59
59
|
import { t as z } from "./symbol-map-options.config-BwZ7_S4w.js";
|