@luzmo/analytics-components-kit 1.1.1 → 1.2.1
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 +8 -2
- package/angular/components/interactive-viz-item.ts +40 -3
- 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 +13 -4
- package/angular/esm/components/interactive-viz-item.js +29 -3
- 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/{base-store-SgJsjLap.cjs → base-store-D3whjduR.cjs} +1 -1
- package/components/{base-store-g0dt7ru7.js → base-store-DQYj8A1W.js} +3 -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 +7 -7
- 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 +1 -1
- package/components/interactive-viz-item/interactive-viz-item.d.ts +31 -1
- package/components/interactive-viz-item/types.d.ts +13 -0
- package/components/{interactive-viz-item-CofUkpP6.js → interactive-viz-item-CwRRaCZB.js} +144 -84
- package/components/interactive-viz-item-CxdrGRKc.cjs +265 -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 +409 -103
- package/package.json +1 -1
- 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/chunks/{choropleth-map-options.config-Cs4Kvr9h.js → choropleth-map-options.config-rUJsEJcm.js} +1 -1
- package/standalone/chunks/{color-range-utils-CKDpd3gZ.js → color-range-utils-DxOtqAKB.js} +1 -1
- package/standalone/chunks/embed-CBu7iQRx.js +231 -0
- package/standalone/chunks/{heat-map-options.config-DF5kjOOe.js → heat-map-options.config-D93AeYFi.js} +1 -1
- package/standalone/chunks/{heat-table-options.config-DaePzfHG.js → heat-table-options.config-ZVML76FK.js} +1 -1
- package/standalone/chunks/is-same-option-value-Di-A7Wmg.js +2 -0
- package/standalone/chunks/item-option-color-picker-lLvBPnKA.js +19 -0
- package/standalone/chunks/{item-option-color-range-CyJd1LZ_.js → item-option-color-range-BqeatOei.js} +18 -15
- package/standalone/chunks/item-option-guidelines-Cop8rM8y.js +120 -0
- package/standalone/chunks/item-option-panel-CzSKFCVl.js +316 -0
- package/standalone/chunks/item-option-slider-K_bsNci8.js +18 -0
- package/standalone/chunks/option-interaction-controller-BslAXAHF.js +2 -0
- package/standalone/chunks/{route-map-options.config-D7FfzIiU.js → route-map-options.config-Dwy0JSVq.js} +1 -1
- package/standalone/chunks/{spike-map-options.config-CZiFzDm9.js → spike-map-options.config-DFmuNxym.js} +1 -1
- package/standalone/interactive-viz-item.js +24 -20
- package/standalone/item-grid.js +1 -1
- package/standalone/manifest.json +14 -13
- 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/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/embed-BfHBKhIe.js +0 -231
- package/standalone/chunks/item-option-color-picker-Cr7ujQNO.js +0 -16
- 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-slider-l9wt7_0c.js +0 -15
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
-
*
|
|
3
|
-
* Copyright © 2026 Luzmo
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Luzmo web components (“Luzmo Web Components”)
|
|
6
|
-
* must be used according to the Luzmo Terms of Service.
|
|
7
|
-
* This license allows users with a current active Luzmo account
|
|
8
|
-
* to use the Luzmo Web Components. This license terminates
|
|
9
|
-
* automatically if a user no longer has an active Luzmo account.
|
|
10
|
-
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
11
|
-
*
|
|
12
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
-
* SOFTWARE.
|
|
19
|
-
* */
|
|
20
|
-
import "./tokens-6HmQYnEP.js";
|
|
21
|
-
import { t as e } from "./decorate-B2TzfnLZ.js";
|
|
22
|
-
import { t } from "./color-CQcCK-_O.js";
|
|
23
|
-
import { t as n } from "./item-option-base-BfHciede.js";
|
|
24
|
-
import { t as r } from "./superPropGet-CUPN9Fvv.js";
|
|
25
|
-
import { luzmoTrashOutline as i } from "@luzmo/icons";
|
|
26
|
-
import "@luzmo/lucero/action-button";
|
|
27
|
-
import "@luzmo/lucero/icon";
|
|
28
|
-
import { html as a, unsafeCSS as o } from "lit";
|
|
29
|
-
import { property as s, queryAll as c, state as l } from "lit/decorators.js";
|
|
30
|
-
import { msg as u } from "@lit/localize";
|
|
31
|
-
import "@luzmo/lucero/number-field";
|
|
32
|
-
import "@luzmo/lucero/text-field";
|
|
33
|
-
import "@luzmo/lucero/color-picker";
|
|
34
|
-
import "@luzmo/lucero/color-field";
|
|
35
|
-
// src/utils/color/extrapolate-color.ts
|
|
36
|
-
var d = (e, n = .1) => {
|
|
37
|
-
if (e.length < 2) return "#AAAAAA";
|
|
38
|
-
let r = e.length, i = new t(e[r - 2]).to("oklab"), a = new t(e[r - 1]).to("oklab"), o = i.coords[0], s = a.coords[0], c = Math.min(1, Math.max(0, s + (s > o ? 1 : -1) * n));
|
|
39
|
-
return new t("oklab", [
|
|
40
|
-
c,
|
|
41
|
-
a.coords[1],
|
|
42
|
-
a.coords[2]
|
|
43
|
-
], a.alpha).to("srgb").toString({
|
|
44
|
-
format: "hex",
|
|
45
|
-
precision: 0
|
|
46
|
-
});
|
|
47
|
-
}, f = ":host{--luzmo-swatch-size:14px}.luzmo-item-option{align-items:start;height:-moz-fit-content;height:fit-content}.control-container{flex-grow:1;align-items:start}.color-range-line{align-items:center;display:flex}luzmo-color-field,luzmo-number-field{flex-grow:1}.color-range-lines-container,.color-range-lines{gap:var(--luzmo-item-option-color-range-ranges-gap,var(--color-ranges-gap));flex-direction:column;flex-grow:1;display:flex}.color-range-lines{width:100%}.extra-label{height:var(--item-option-component-height);align-items:center;display:flex}.color-range-percentage-value{padding-inline-start:var(--luzmo-item-option-color-range-color-swatch-to-percentage,var(--color-swatch-to-percentage));padding-inline-end:var(--luzmo-item-option-color-range-percentage-to-input-field,var(--percentage-to-input-field))}luzmo-color-picker{position:relative}luzmo-color-picker:not(:has(+.color-range-percentage-value)){padding-inline-end:var(--luzmo-item-option-color-range-color-swatch-to-input-field,var(--color-swatch-to-input-field))}luzmo-number-field:has(+luzmo-action-button){padding-inline-end:var(--luzmo-item-option-color-range-input-field-to-button,var(--input-field-to-button))}luzmo-color-field:has(+luzmo-action-button){padding-inline-end:var(--luzmo-item-option-color-range-input-field-to-button,var(--input-field-to-button))}luzmo-color-picker:before{box-sizing:border-box;content:\"\";top:var(--color-range-connector-top);left:var(--color-range-connector-left);height:var(--color-range-connector-height);width:var(--color-range-connector-width);background:var(--range-color);border:var(--luzmo-item-option-color-range-connector-border-width,var(--luzmo-border-width)) solid var(--luzmo-item-option-color-range-connector-border-color,var(--luzmo-border-color));z-index:-1;border-top:0;border-bottom:0;position:absolute}:host([reverse]) luzmo-color-picker:before{top:var(--color-range-reverse-connector-top)}.color-range-lines:not(.edit-range-size) .color-range-line:last-child luzmo-color-picker:before{display:none}.color-range-add-value-container{height:var(--color-range-input-field-height);justify-content:start;align-items:center;display:flex}.color-range-add-value{box-sizing:border-box;width:var(--luzmo-item-option-color-range-add-value-width,var(--luzmo-swatch-size));height:var(--luzmo-item-option-color-range-add-value-height,var(--luzmo-swatch-size));border-width:var(--luzmo-item-option-color-range-add-value-border-width,var(--luzmo-border-width));border-style:solid;border-color:var(--luzmo-item-option-color-range-add-value-border-color,var(--luzmo-primary));border-radius:var(--luzmo-item-option-color-range-add-value-border-radius,50%);background-color:var(--luzmo-item-option-color-range-add-value-background-color,var(--luzmo-background-color));cursor:pointer;color:var(--luzmo-item-option-color-range-add-value-color,var(--luzmo-primary));justify-content:center;align-items:center;display:flex;position:relative}.color-range-add-value .plus-sign{width:100%;height:100%;position:absolute;top:0;left:0}.color-range-add-value .plus-sign:before{content:\" \";background-color:var(--luzmo-item-option-color-range-add-value-color,var(--luzmo-primary));height:var(--add-color-range-plus-size);width:var(--luzmo-item-option-color-range-add-color-range-plus-sign-border-width,var(--add-color-range-plus-sign-border-width));top:calc((var(--luzmo-item-option-color-range-add-color-range-size,var(--add-color-range-size)) - var(--add-color-range-plus-size)) / 2 - var(--luzmo-item-option-color-range-add-value-border-width,var(--luzmo-border-width)));left:calc((var(--luzmo-item-option-color-range-add-color-range-size,var(--add-color-range-size)) - var(--luzmo-item-option-color-range-add-color-range-plus-sign-border-width,var(--add-color-range-plus-sign-border-width))) / 2 - var(--luzmo-item-option-color-range-add-value-border-width,var(--luzmo-border-width)));z-index:1;display:block;position:absolute}.color-range-add-value .plus-sign:after{content:\" \";background-color:var(--luzmo-item-option-color-range-add-value-color,var(--luzmo-primary));width:var(--add-color-range-plus-size);height:var(--luzmo-item-option-color-range-add-color-range-plus-sign-border-width,var(--add-color-range-plus-sign-border-width));left:calc((var(--luzmo-item-option-color-range-add-color-range-size,var(--add-color-range-size)) - var(--add-color-range-plus-size)) / 2 - var(--luzmo-item-option-color-range-add-value-border-width,var(--luzmo-border-width)));top:calc((var(--luzmo-item-option-color-range-add-color-range-size,var(--add-color-range-size)) - var(--luzmo-item-option-color-range-add-color-range-plus-sign-border-width,var(--add-color-range-plus-sign-border-width))) / 2 - var(--luzmo-item-option-color-range-add-value-border-width,var(--luzmo-border-width)));z-index:1;display:block;position:absolute}.color-range-add-value:hover{background-color:var(--luzmo-item-option-color-range-add-value-background-color-hover,var(--luzmo-background-color-hover));color:var(--luzmo-item-option-color-range-add-value-color-hover,var(--luzmo-primary-hover))}.color-range-add-value[focused]{background-color:var(--luzmo-item-option-color-range-add-value-background-color-focus,var(--luzmo-background-color-focus));color:var(--luzmo-item-option-color-range-add-value-color-focus,var(--luzmo-primary-focus));outline:none}.color-range-add-value:focus-visible{background-color:var(--luzmo-item-option-color-range-add-value-background-color-focus,var(--luzmo-background-color-focus));color:var(--luzmo-item-option-color-range-add-value-color-focus,var(--luzmo-primary-focus));outline:none}.color-range-add-value[focused]:after{content:\"\";inset:calc(var(--luzmo-item-option-color-range-add-value-focus-indicator-gap,var(--add-value-focus-indicator-gap)) * -2);background-color:var(--luzmo-item-option-color-range-add-value-focus-indicator-background-color,var(--luzmo-background-color));border-width:var(--luzmo-item-option-color-range-add-value-focus-indicator-width,var(--add-value-focus-indicator-width));border-style:solid;border-color:var(--highcontrast-swatch-focus-indicator-color,var(--luzmo-item-option-color-range-add-value-focus-indicator-color,var(--add-value-focus-indicator-color)));border-radius:var(--luzmo-item-option-color-range-add-value-focus-indicator-border-radius,var(--add-value-focus-indicator-border-radius));transition:opacity var(--luzmo-animation-duration) ease-in-out;z-index:-1;position:absolute}.color-range-add-value:focus-visible:after{content:\"\";inset:calc(var(--luzmo-item-option-color-range-add-value-focus-indicator-gap,var(--add-value-focus-indicator-gap)) * -2);background-color:var(--luzmo-item-option-color-range-add-value-focus-indicator-background-color,var(--luzmo-background-color));border-width:var(--luzmo-item-option-color-range-add-value-focus-indicator-width,var(--add-value-focus-indicator-width));border-style:solid;border-color:var(--highcontrast-swatch-focus-indicator-color,var(--luzmo-item-option-color-range-add-value-focus-indicator-color,var(--add-value-focus-indicator-color)));border-radius:var(--luzmo-item-option-color-range-add-value-focus-indicator-border-radius,var(--add-value-focus-indicator-border-radius));transition:opacity var(--luzmo-animation-duration) ease-in-out;z-index:-1;position:absolute}:host{--luzmo-swatch-size:var(--color-range-swatch-size);--color-range-swatch-size:16px;--color-ranges-gap:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--color-range-connector-width:.25rem;--color-range-connector-height:calc(var(--color-range-input-field-height) + var(--color-ranges-gap) - var(--color-range-swatch-size) + var(--color-range-connector-width));--color-range-connector-top:calc(var(--color-range-swatch-size) - (var(--color-range-connector-width) / 2));--color-range-reverse-connector-top:calc(-1 * var(--color-range-connector-height) + (var(--color-range-connector-width) / 2));--color-range-connector-left:calc((var(--color-range-swatch-size) - var(--color-range-connector-width)) / 2);--color-range-input-field-height:var(--luzmo-component-height);--add-color-range-size:var(--color-range-swatch-size);--add-color-range-plus-size:8px;--add-color-range-plus-sign-border-width:2px;--add-value-focus-indicator-border-radius:50%;--add-value-focus-indicator-gap:3px;--add-value-focus-indicator-width:1px;--add-value-focus-indicator-color:var(--luzmo-primary);--color-swatch-to-percentage:var(--luzmo-spacing-4);--color-swatch-to-input-field:var(--luzmo-spacing-4);--percentage-to-input-field:var(--luzmo-spacing-4);--input-field-to-button:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1))}:host([size=s]){--color-range-swatch-size:14px;--color-range-input-field-height:var(--luzmo-component-height-s);--color-ranges-gap:var(--luzmo-spacing-2);--add-color-range-plus-size:6px;--add-color-range-plus-sign-border-width:2px;--color-swatch-to-percentage:var(--luzmo-spacing-3);--color-swatch-to-input-field:var(--luzmo-spacing-3);--percentage-to-input-field:var(--luzmo-spacing-3);--input-field-to-button:var(--luzmo-spacing-2)}:host([size=l]){--color-range-swatch-size:18px;--color-range-input-field-height:var(--luzmo-component-height-l);--color-ranges-gap:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--add-color-range-plus-size:10px;--color-swatch-to-percentage:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--color-swatch-to-input-field:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--percentage-to-input-field:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--input-field-to-button:var(--luzmo-spacing-3)}:host([size=xl]){--color-range-swatch-size:20px;--color-range-input-field-height:var(--luzmo-component-height-xl);--color-ranges-gap:var(--luzmo-spacing-3);--add-color-range-plus-size:10px;--color-swatch-to-percentage:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--color-swatch-to-input-field:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--percentage-to-input-field:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--input-field-to-button:var(--luzmo-spacing-4)}", p, m = class extends n {
|
|
48
|
-
constructor(...e) {
|
|
49
|
-
super(...e), this.disabled = !1, this.percentage = !1, this.noAlphaChannel = !1, this.editRangeSize = !1, this.noValues = !1, this.minimumRangeSize = 2, this.negativeInfinityValue = !1, this.readOnlyColorPicker = !1, this.reverse = !1, this.debounce = 100, this._ranges = [];
|
|
50
|
-
}
|
|
51
|
-
willUpdate(e) {
|
|
52
|
-
super.willUpdate(e), e.has("value") && (this._ranges = typeof this.parseValue == "function" ? this.parseValue(this.value ?? this.default ?? []) : this.value ?? this.default ?? []), this.negativeInfinityValue && (this._ranges = [{
|
|
53
|
-
color: this._ranges[0].color,
|
|
54
|
-
value: -Infinity
|
|
55
|
-
}, ...this._ranges.slice(1)]);
|
|
56
|
-
}
|
|
57
|
-
_handleChangeEvent() {
|
|
58
|
-
this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(() => {
|
|
59
|
-
this.dispatchEvent(new CustomEvent("luzmo-option-changed", {
|
|
60
|
-
bubbles: !0,
|
|
61
|
-
composed: !0,
|
|
62
|
-
cancelable: !0,
|
|
63
|
-
detail: { value: typeof this.toValue == "function" ? this.toValue(this._ranges) : this._ranges }
|
|
64
|
-
}));
|
|
65
|
-
}, this.debounce ?? 200);
|
|
66
|
-
}
|
|
67
|
-
_getIndex(e) {
|
|
68
|
-
let t = [...this.colorRangeLines].indexOf((e?.target)?.closest(".color-range-line"));
|
|
69
|
-
return this.reverse && (t = (this._ranges?.length ?? 0) - 1 - t), t;
|
|
70
|
-
}
|
|
71
|
-
_extrapolateNewValue(e) {
|
|
72
|
-
if (e.length < 2) return 0;
|
|
73
|
-
let t = e.at(-1), n = e.at(-2), r = (t ?? 0) - (n ?? 0);
|
|
74
|
-
return (t ?? 0) + r;
|
|
75
|
-
}
|
|
76
|
-
_setColor(e) {
|
|
77
|
-
let t = this._getIndex(e), n = e.target.color ?? e.target.value;
|
|
78
|
-
this._ranges?.[t] && (this._ranges[t].color = String(n)), this._ranges = structuredClone(this._ranges), this._handleChangeEvent();
|
|
79
|
-
}
|
|
80
|
-
_setNumber(e) {
|
|
81
|
-
let t = this._getIndex(e), n = e.target.value;
|
|
82
|
-
this._ranges?.[t] && (this._ranges[t].value = n), this._ranges = structuredClone(this._ranges.sort((e, t) => (e?.value ?? 0) - (t?.value ?? 0))), this._handleChangeEvent();
|
|
83
|
-
}
|
|
84
|
-
_removeRangeValue(e) {
|
|
85
|
-
let t = this._getIndex(e);
|
|
86
|
-
this._ranges?.splice(t, 1), this._ranges = structuredClone(this._ranges), this._handleChangeEvent();
|
|
87
|
-
}
|
|
88
|
-
_addRangeValue() {
|
|
89
|
-
let e = d(this._ranges?.map((e) => e.color) ?? []), t = this._extrapolateNewValue(this._ranges?.map((e) => e.value ?? 0) ?? []);
|
|
90
|
-
this._ranges?.push({
|
|
91
|
-
color: e,
|
|
92
|
-
value: t
|
|
93
|
-
}), this._ranges = structuredClone(this._ranges), this._handleChangeEvent();
|
|
94
|
-
}
|
|
95
|
-
renderRangeValues() {
|
|
96
|
-
let e = (e, t, n, r) => a`
|
|
97
|
-
<div class="color-range-line" style="--range-color: ${e}">
|
|
98
|
-
<luzmo-color-picker
|
|
99
|
-
.color=${e}
|
|
100
|
-
.debounce=${this.debounce}
|
|
101
|
-
?disabled=${this.disabled}
|
|
102
|
-
?no-alpha-channel=${this.noAlphaChannel}
|
|
103
|
-
?read-only=${this.readOnlyColorPicker}
|
|
104
|
-
@change=${this._setColor}
|
|
105
|
-
></luzmo-color-picker>
|
|
106
|
-
${this.percentage ? a`
|
|
107
|
-
<div class="color-range-percentage-value">%</div>
|
|
108
|
-
` : a`
|
|
109
|
-
|
|
110
|
-
`}
|
|
111
|
-
${this.noValues ? a` <luzmo-color-field
|
|
112
|
-
.value=${e}
|
|
113
|
-
.size=${this.size}
|
|
114
|
-
.debounce=${this.debounce}
|
|
115
|
-
?no-alpha-channel=${this.noAlphaChannel}
|
|
116
|
-
?disabled=${this.disabled}
|
|
117
|
-
@change=${this._setColor}
|
|
118
|
-
></luzmo-color-field>` : n ? a` <luzmo-text-field
|
|
119
|
-
.value=${"< " + (r ?? 0)}
|
|
120
|
-
.size=${this.size}
|
|
121
|
-
readonly
|
|
122
|
-
></luzmo-text-field>` : a` <luzmo-number-field
|
|
123
|
-
.value=${t ?? 0}
|
|
124
|
-
.size=${this.size}
|
|
125
|
-
.debounce=${this.debounce}
|
|
126
|
-
?disabled=${this.disabled}
|
|
127
|
-
@change=${this._setNumber}
|
|
128
|
-
></luzmo-number-field>`}
|
|
129
|
-
${this.editRangeSize && !this.disabled && !n && (this._ranges?.length ?? 0) > this.minimumRangeSize ? a`<luzmo-action-button
|
|
130
|
-
quiet
|
|
131
|
-
.size=${this.size}
|
|
132
|
-
.label=${u("Remove color stop", { desc: "Aria label for remove color stop button" })}
|
|
133
|
-
@click=${this._removeRangeValue}
|
|
134
|
-
>
|
|
135
|
-
<luzmo-icon
|
|
136
|
-
slot="icon"
|
|
137
|
-
.size=${this.size}
|
|
138
|
-
.icon=${i}
|
|
139
|
-
></luzmo-icon>
|
|
140
|
-
</luzmo-action-button>` : a`
|
|
141
|
-
|
|
142
|
-
`}
|
|
143
|
-
</div>
|
|
144
|
-
`, t = this._ranges ?? this.default ?? [];
|
|
145
|
-
this.reverse && (t = [...t].reverse());
|
|
146
|
-
let n = t.map(({ color: n, value: r }, i) => e(n, r, i === 0 && this.negativeInfinityValue, i === 0 && this.negativeInfinityValue ? t[1]?.value : void 0));
|
|
147
|
-
return a`
|
|
148
|
-
<div id="luzmo-item-option-control" class="color-range-lines-container" role="group" aria-label=${this.label || u("Color range", { desc: "Accessible label for color range control" })}>
|
|
149
|
-
${this.editRangeSize && !this.disabled && this.reverse ? a`<div class="color-range-add-value-container">
|
|
150
|
-
<button
|
|
151
|
-
class="color-range-add-value"
|
|
152
|
-
aria-label=${u("Add color stop", { desc: "Aria label for add color stop button" })}
|
|
153
|
-
@click=${this._addRangeValue}
|
|
154
|
-
>
|
|
155
|
-
<div class="plus-sign"></div>
|
|
156
|
-
</button>
|
|
157
|
-
</div>` : a`
|
|
158
|
-
|
|
159
|
-
`}
|
|
160
|
-
<div
|
|
161
|
-
class="color-range-lines ${this.editRangeSize && !this.disabled ? "edit-range-size" : ""}"
|
|
162
|
-
>
|
|
163
|
-
${n}
|
|
164
|
-
</div>
|
|
165
|
-
${this.editRangeSize && !this.disabled && !this.reverse ? a`<div class="color-range-add-value-container">
|
|
166
|
-
<button
|
|
167
|
-
class="color-range-add-value"
|
|
168
|
-
aria-label=${u("Add color stop", { desc: "Aria label for add color stop button" })}
|
|
169
|
-
@click=${this._addRangeValue}
|
|
170
|
-
>
|
|
171
|
-
<div class="plus-sign"></div>
|
|
172
|
-
</button>
|
|
173
|
-
</div>` : a`
|
|
174
|
-
|
|
175
|
-
`}
|
|
176
|
-
</div>
|
|
177
|
-
`;
|
|
178
|
-
}
|
|
179
|
-
renderController() {
|
|
180
|
-
return this.renderRangeValues();
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
// src/components/item-option-color-range/index.ts
|
|
184
|
-
p = m, p.styles = [r(p, "styles", p), o(f)], e([s({
|
|
185
|
-
type: Array,
|
|
186
|
-
reflect: !0
|
|
187
|
-
})], m.prototype, "value", void 0), e([s({
|
|
188
|
-
type: Array,
|
|
189
|
-
reflect: !0
|
|
190
|
-
})], m.prototype, "default", void 0), e([s({
|
|
191
|
-
type: Boolean,
|
|
192
|
-
reflect: !0
|
|
193
|
-
})], m.prototype, "disabled", void 0), e([s({ type: Boolean })], m.prototype, "percentage", void 0), e([s({
|
|
194
|
-
type: Boolean,
|
|
195
|
-
attribute: "no-alpha-channel"
|
|
196
|
-
})], m.prototype, "noAlphaChannel", void 0), e([s({
|
|
197
|
-
type: Boolean,
|
|
198
|
-
attribute: "edit-range-size"
|
|
199
|
-
})], m.prototype, "editRangeSize", void 0), e([s({
|
|
200
|
-
type: Boolean,
|
|
201
|
-
attribute: "no-values"
|
|
202
|
-
})], m.prototype, "noValues", void 0), e([s({
|
|
203
|
-
type: Number,
|
|
204
|
-
reflect: !0,
|
|
205
|
-
attribute: "minimum-range-size"
|
|
206
|
-
})], m.prototype, "minimumRangeSize", void 0), e([s({
|
|
207
|
-
type: Boolean,
|
|
208
|
-
reflect: !0,
|
|
209
|
-
attribute: "negative-infinity-value"
|
|
210
|
-
})], m.prototype, "negativeInfinityValue", void 0), e([s({
|
|
211
|
-
type: Boolean,
|
|
212
|
-
attribute: "read-only-color-picker"
|
|
213
|
-
})], m.prototype, "readOnlyColorPicker", void 0), e([s({ type: Boolean })], m.prototype, "reverse", void 0), e([s({
|
|
214
|
-
type: Number,
|
|
215
|
-
reflect: !0
|
|
216
|
-
})], m.prototype, "debounce", void 0), e([s()], m.prototype, "parseValue", void 0), e([s()], m.prototype, "toValue", void 0), e([c(".color-range-line")], m.prototype, "colorRangeLines", void 0), e([l()], m.prototype, "_ranges", void 0), customElements.get("luzmo-item-option-color-range") || customElements.define("luzmo-item-option-color-range", m);
|
|
217
|
-
export { m as t };
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
-
*
|
|
3
|
-
* Copyright © 2026 Luzmo
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Luzmo web components (“Luzmo Web Components”)
|
|
6
|
-
* must be used according to the Luzmo Terms of Service.
|
|
7
|
-
* This license allows users with a current active Luzmo account
|
|
8
|
-
* to use the Luzmo Web Components. This license terminates
|
|
9
|
-
* automatically if a user no longer has an active Luzmo account.
|
|
10
|
-
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
11
|
-
*
|
|
12
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
-
* SOFTWARE.
|
|
19
|
-
* */
|
|
20
|
-
require("./tokens-BWMfo_w4.cjs"),require("./base-CGDNY_7v.cjs");const e=require("./decorate-DCJt-2rt.cjs"),t=require("./localized-mixin-EoNvtTBG.cjs"),n=require("./types-pVa6ut_v.cjs"),r=require("./item-option-base-BMy6dWbc.cjs");let i=require("@luzmo/icons");require("@luzmo/lucero/action-button"),require("@luzmo/lucero/button"),require("@luzmo/lucero/icon");let a=require("lit"),o=require("lit/decorators.js"),s=require("@lit/localize"),c=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 l=new Set(n.s),u=new Set(n.c),d=new Set(n.l),f={solid:`0`,dotted:`1,2`,dashed:`3,3`},p=e=>typeof e==`object`&&!!e&&!Array.isArray(e),m=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}},h=e=>typeof e==`string`&&l.has(e),g=e=>{let t=(e??[]).filter(h);return t.length>0?t:[...n.t]},_=e=>e===`dark-edit`?n.n:n.r,v=e=>structuredClone(e),y=e=>{if(!p(e))return{...n.a};let t=typeof e.type==`string`?e.type.trim().toLowerCase():``,r=u.has(t)?t:f[t]??n.a.type,i=(typeof e.width==`number`?String(e.width):typeof e.width==`string`?e.width.trim():``).replace(/px$/i,``);return{type:r,width:d.has(i)?i:n.a.width}},b=e=>{if(!p(e))return;let t=typeof e.type==`string`?e.type.trim().toLowerCase():``;if(!h(t))return;let r=typeof e.color==`string`&&e.color.trim()!==``?e.color.trim():n.r;return t===`value`?{type:t,color:r,value:m(e.value)??0}:{type:t,color:r}},x=e=>{let t=Array.isArray(e)?{lines:e}:e;if(!p(t)||!(Array.isArray(t.lines)||p(t.lines)))return;let n=Array.isArray(t.lines)?t.lines:[t.lines],r=n.map(b).filter(e=>e!==void 0);if(!(n.length>0&&r.length===0))return{lines:r,style:y(t.style)}},S=(e,t)=>e===`value`?{type:e,color:t,value:0}:{type:e,color:t},C=(e,t,r)=>{let i=g(t)[0],a=S(i,r);if(!e)return{lines:[a],style:{...n.a}};let o=v(e);return o.lines.push(a),o},w=(e,t)=>{let n=v(e);return n.lines.splice(t,1),n},T=(e,t,n)=>{let r=v(e),i=r.lines[t];return i&&(r.lines[t]=S(n,i.color)),r},E=(e,t,n)=>{let r=v(e);return r.lines[t]&&(r.lines[t].color=n),r},D=(e,t,n)=>{let r=v(e);return r.lines[t]&&(r.lines[t].value=n),r},O=(e,t)=>{let n=v(e);return n.style.type=t,n},k=(e,t)=>{let n=v(e);return n.style.width=t,n},A=`: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)}`,j=0,M=6,N=10**-6,P={maximumFractionDigits:M},F=t.t(r.t),I=class extends F{constructor(...e){super(...e),this.lineTypes=[],this.lineTypeLabels={},this.defaultColor=_(),this.debounce=200,this._lineIds=[],this._lineIdCounter=0,this._styleLabelId=`luzmo-item-option-guidelines-style-${++j}`,this._widthLabelId=`luzmo-item-option-guidelines-width-${j}`}static get styles(){return[...super.styles,(0,a.unsafeCSS)(A)]}willUpdate(e){super.willUpdate(e),e.has(`value`)&&(this._clearDebounce(),this._guidelines=x(this.value),this._lineIds=(this._guidelines?.lines??[]).map((e,t)=>this._lineIds[t]??this._createLineId()))}disconnectedCallback(){super.disconnectedCallback(),this._clearDebounce()}_createLineId(){return`${this._styleLabelId}-line-${++this._lineIdCounter}`}_clearDebounce(){clearTimeout(this._debounceTimeout),this._debounceTimeout=void 0}_emit(e,t=!1){let n=()=>{this._debounceTimeout=void 0,this.dispatchEvent(new CustomEvent(`luzmo-option-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{value:e}}))};this._clearDebounce(),t||this.debounce<=0?n():this._debounceTimeout=setTimeout(n,this.debounce)}_commit(e,t=!1){this._guidelines=e,this._emit(e,t)}_allowedTypes(){return g(this.lineTypes)}_typeLabel(e){if(this.lineTypeLabels[e])return this.lineTypeLabels[e];switch(e){case`value`:return(0,s.msg)(`Value`,{id:`item-option-guidelines-type-value`,desc:`Guideline type: manual numeric value`});case`average`:return(0,s.msg)(`Average`,{id:`item-option-guidelines-type-average`,desc:`Guideline type: average of the plotted data`});case`median`:return(0,s.msg)(`Median`,{id:`item-option-guidelines-type-median`,desc:`Guideline type: median of the plotted data`});case`average open`:return(0,s.msg)(`Average open`,{id:`item-option-guidelines-type-average-open`,desc:`Guideline type: average of open values`});case`average close`:return(0,s.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,s.msg)(`Thin`,{id:`item-option-guidelines-width-thin`,desc:`Guideline width: thin`}),2:(0,s.msg)(`Medium`,{id:`item-option-guidelines-width-medium`,desc:`Guideline width: medium`}),3:(0,s.msg)(`Thick`,{id:`item-option-guidelines-width-thick`,desc:`Guideline width: thick`})}}_styleOptions(){return[{key:`0`,icon:i.luzmoBorderSolid,label:(0,s.msg)(`Solid`,{id:`item-option-guidelines-style-solid`,desc:`Guideline line style: solid`})},{key:`1,2`,icon:i.luzmoBorderDotted,label:(0,s.msg)(`Dotted`,{id:`item-option-guidelines-style-dotted`,desc:`Guideline line style: dotted`})},{key:`3,3`,icon:i.luzmoBorderDashed,label:(0,s.msg)(`Dashed`,{id:`item-option-guidelines-style-dashed`,desc:`Guideline line style: dashed`})}]}_handleAdd(){this.disabled||(this._lineIds=[...this._lineIds,this._createLineId()],this._commit(C(this._guidelines,this.lineTypes,this.defaultColor),!0))}_handleRemove(e){!this.disabled&&this._guidelines&&(this._lineIds=this._lineIds.filter((t,n)=>n!==e),this._commit(w(this._guidelines,e),!0))}_handleTypeChange(e,t){!this.disabled&&this._guidelines&&h(t.detail)&&this._commit(T(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(E(this._guidelines,e,n))}_handleValueChange(e,t){if(this.disabled||!this._guidelines)return;let n=t.target.value;typeof n==`number`&&Number.isFinite(n)&&this._commit(D(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(O(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(k(this._guidelines,r),!0)}_lineKey(e){return this._lineIds[e]}_renderLine(e,t){let n=t+1,r=(0,s.msg)(s.str`Guideline ${n} color`,{id:`item-option-guidelines-color`,desc:`Accessible name for one guideline color picker`}),o=(0,s.msg)(s.str`Guideline ${n} type`,{id:`item-option-guidelines-type`,desc:`Accessible name for one guideline type picker`}),c=(0,s.msg)(s.str`Guideline ${n} value`,{id:`item-option-guidelines-value`,desc:`Accessible name for one manual guideline value`}),l=(0,s.msg)(s.str`Remove guideline ${n}`,{id:`item-option-guidelines-remove`,desc:`Aria label for removing one guideline row`});return a.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-color-picker>
|
|
32
|
-
<luzmo-picker
|
|
33
|
-
class="guideline-type"
|
|
34
|
-
.label=${o}
|
|
35
|
-
.value=${e.type}
|
|
36
|
-
.size=${this.size}
|
|
37
|
-
variant="highlight"
|
|
38
|
-
?disabled=${this.disabled}
|
|
39
|
-
@change=${e=>this._handleTypeChange(t,e)}
|
|
40
|
-
>
|
|
41
|
-
${Object.entries(this._typeValues()).map(([e,t])=>a.html`
|
|
42
|
-
<luzmo-menu-item value=${e}>${t}</luzmo-menu-item>
|
|
43
|
-
`)}
|
|
44
|
-
</luzmo-picker>
|
|
45
|
-
${e.type===`value`?a.html`
|
|
46
|
-
<luzmo-number-field
|
|
47
|
-
class="guideline-value"
|
|
48
|
-
.value=${e.value??0}
|
|
49
|
-
.size=${this.size}
|
|
50
|
-
.step=${N}
|
|
51
|
-
.formatOptions=${P}
|
|
52
|
-
.label=${c}
|
|
53
|
-
?disabled=${this.disabled}
|
|
54
|
-
@change=${e=>this._handleValueChange(t,e)}
|
|
55
|
-
></luzmo-number-field>
|
|
56
|
-
`:a.html`
|
|
57
|
-
<div class="guideline-value-spacer"></div>
|
|
58
|
-
`}
|
|
59
|
-
<luzmo-action-button
|
|
60
|
-
class="guideline-remove"
|
|
61
|
-
quiet
|
|
62
|
-
.size=${this.size}
|
|
63
|
-
.label=${l}
|
|
64
|
-
?disabled=${this.disabled}
|
|
65
|
-
@click=${()=>this._handleRemove(t)}
|
|
66
|
-
>
|
|
67
|
-
<luzmo-icon slot="icon" .size=${this.size} .icon=${i.luzmoTrashOutline}></luzmo-icon>
|
|
68
|
-
</luzmo-action-button>
|
|
69
|
-
</div>
|
|
70
|
-
`}_renderSharedStyle(e){return a.html`
|
|
71
|
-
<div class="guideline-shared">
|
|
72
|
-
<div class="guideline-shared-row">
|
|
73
|
-
<span class="guideline-shared-label" id=${this._styleLabelId}>
|
|
74
|
-
${(0,s.msg)(`Style`,{id:`item-option-guidelines-style-label`,desc:`Label for shared guideline dash style`})}
|
|
75
|
-
</span>
|
|
76
|
-
<luzmo-action-group
|
|
77
|
-
class="guideline-style"
|
|
78
|
-
compact
|
|
79
|
-
quiet
|
|
80
|
-
emphasized
|
|
81
|
-
selects="single"
|
|
82
|
-
.size=${this.size}
|
|
83
|
-
.selected=${[e.style.type]}
|
|
84
|
-
aria-labelledby=${this._styleLabelId}
|
|
85
|
-
?disabled=${this.disabled}
|
|
86
|
-
@change=${this._handleStyleChange}
|
|
87
|
-
>
|
|
88
|
-
${this._styleOptions().map(e=>a.html`
|
|
89
|
-
<luzmo-action-button value=${e.key} ?disabled=${this.disabled} .label=${e.label}>
|
|
90
|
-
<luzmo-icon slot="icon" .size=${this.size} .icon=${e.icon}></luzmo-icon>
|
|
91
|
-
</luzmo-action-button>
|
|
92
|
-
`)}
|
|
93
|
-
</luzmo-action-group>
|
|
94
|
-
</div>
|
|
95
|
-
<div class="guideline-shared-row">
|
|
96
|
-
<span class="guideline-shared-label" id=${this._widthLabelId}>
|
|
97
|
-
${(0,s.msg)(`Width`,{id:`item-option-guidelines-width-label`,desc:`Label for shared guideline width`})}
|
|
98
|
-
</span>
|
|
99
|
-
<luzmo-picker
|
|
100
|
-
class="guideline-width"
|
|
101
|
-
aria-labelledby=${this._widthLabelId}
|
|
102
|
-
.value=${e.style.width}
|
|
103
|
-
.size=${this.size}
|
|
104
|
-
variant="highlight"
|
|
105
|
-
?disabled=${this.disabled}
|
|
106
|
-
@change=${this._handleWidthChange}
|
|
107
|
-
>
|
|
108
|
-
${Object.entries(this._widthValues()).map(([e,t])=>a.html`
|
|
109
|
-
<luzmo-menu-item value=${e}>${t}</luzmo-menu-item>
|
|
110
|
-
`)}
|
|
111
|
-
</luzmo-picker>
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
`}renderController(){let e=this._guidelines?.lines??[],t=this.label||(0,s.msg)(`Guidelines`,{id:`item-option-guidelines-group`,desc:`Accessible name for the guidelines editor`});return a.html`
|
|
115
|
-
<div id="luzmo-item-option-control" class="guidelines" role="group" aria-label=${t}>
|
|
116
|
-
${e.length>0?a.html`
|
|
117
|
-
<div class="guideline-rows">
|
|
118
|
-
${(0,c.repeat)(e,(e,t)=>this._lineKey(t),(e,t)=>this._renderLine(e,t))}
|
|
119
|
-
</div>
|
|
120
|
-
`:a.nothing}
|
|
121
|
-
<div class="guidelines-add">
|
|
122
|
-
<luzmo-button
|
|
123
|
-
class="add-guideline"
|
|
124
|
-
treatment="outline"
|
|
125
|
-
.size=${this.size}
|
|
126
|
-
?disabled=${this.disabled}
|
|
127
|
-
@click=${this._handleAdd}
|
|
128
|
-
>
|
|
129
|
-
<luzmo-icon slot="icon" .icon=${i.luzmoPlus} .size=${this.size}></luzmo-icon>
|
|
130
|
-
${(0,s.msg)(`Add guideline`,{id:`item-option-guidelines-add`,desc:`Button that adds a chart guideline`})}
|
|
131
|
-
</luzmo-button>
|
|
132
|
-
</div>
|
|
133
|
-
${this._guidelines&&e.length>0?this._renderSharedStyle(this._guidelines):a.nothing}
|
|
134
|
-
</div>
|
|
135
|
-
`}};e.t([(0,o.property)({attribute:!1})],I.prototype,`value`,void 0),e.t([(0,o.property)({attribute:!1})],I.prototype,`lineTypes`,void 0),e.t([(0,o.property)({attribute:!1})],I.prototype,`lineTypeLabels`,void 0),e.t([(0,o.property)({type:String,reflect:!0,attribute:`default-color`})],I.prototype,`defaultColor`,void 0),e.t([(0,o.property)({type:Number,reflect:!0})],I.prototype,`debounce`,void 0),e.t([(0,o.state)()],I.prototype,`_guidelines`,void 0),I=e.t([(0,s.localized)()],I),typeof customElements<`u`&&!customElements.get(`luzmo-item-option-guidelines`)&&customElements.define(`luzmo-item-option-guidelines`,I),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return I}});
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
-
*
|
|
3
|
-
* Copyright © 2026 Luzmo
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Luzmo web components (“Luzmo Web Components”)
|
|
6
|
-
* must be used according to the Luzmo Terms of Service.
|
|
7
|
-
* This license allows users with a current active Luzmo account
|
|
8
|
-
* to use the Luzmo Web Components. This license terminates
|
|
9
|
-
* automatically if a user no longer has an active Luzmo account.
|
|
10
|
-
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
11
|
-
*
|
|
12
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
-
* SOFTWARE.
|
|
19
|
-
* */
|
|
20
|
-
import "./tokens-6HmQYnEP.js";
|
|
21
|
-
import { t as e } from "./decorate-B2TzfnLZ.js";
|
|
22
|
-
import { t } from "./item-option-base-BfHciede.js";
|
|
23
|
-
import { html as n, unsafeCSS as r } from "lit";
|
|
24
|
-
import { property as i, query as a } from "lit/decorators.js";
|
|
25
|
-
import "@luzmo/lucero/slider";
|
|
26
|
-
// src/components/item-option-slider/item-option-slider.module.scss?inline
|
|
27
|
-
var o = ":host{overflow:visible}luzmo-slider{contain:layout}", s = class extends t {
|
|
28
|
-
constructor(...e) {
|
|
29
|
-
super(...e), this.value = 0, this.default = 0, this.min = 0, this.max = 100, this.step = 100, this.debounce = 200, this._debounceTimeout = null;
|
|
30
|
-
}
|
|
31
|
-
static get styles() {
|
|
32
|
-
return [...super.styles, r(o)];
|
|
33
|
-
}
|
|
34
|
-
disconnectedCallback() {
|
|
35
|
-
super.disconnectedCallback(), this._debounceTimeout &&= (clearTimeout(this._debounceTimeout), null);
|
|
36
|
-
}
|
|
37
|
-
_emitOptionChanged(e) {
|
|
38
|
-
this._lastEmittedSliderValue = e, this.dispatchEvent(new CustomEvent("luzmo-option-changed", {
|
|
39
|
-
bubbles: !0,
|
|
40
|
-
composed: !0,
|
|
41
|
-
cancelable: !0,
|
|
42
|
-
detail: { value: typeof this.toValue == "function" ? this.toValue(e) : e }
|
|
43
|
-
}));
|
|
44
|
-
}
|
|
45
|
-
_handleEvent(e) {
|
|
46
|
-
let t = this._slider.value;
|
|
47
|
-
(e.type !== "change" || this._debounceTimeout || !Object.is(t, this._lastEmittedSliderValue)) && (this._debounceTimeout &&= (clearTimeout(this._debounceTimeout), null), this.debounce > 0 ? this._debounceTimeout = setTimeout(() => {
|
|
48
|
-
this._debounceTimeout = null, this._emitOptionChanged(t);
|
|
49
|
-
}, this.debounce) : this._emitOptionChanged(t));
|
|
50
|
-
}
|
|
51
|
-
renderController() {
|
|
52
|
-
let e = typeof this.parseValue == "function" ? this.parseValue(this.value) : this.value, t = typeof this.parseValue == "function" ? this.parseValue(this.default) : this.default;
|
|
53
|
-
return n`
|
|
54
|
-
<luzmo-slider
|
|
55
|
-
id="luzmo-item-option-control"
|
|
56
|
-
.label=${this.label}
|
|
57
|
-
.min=${this.min}
|
|
58
|
-
.max=${this.max}
|
|
59
|
-
.value=${e ?? t}
|
|
60
|
-
.step=${this.step}
|
|
61
|
-
.size=${this.size}
|
|
62
|
-
.disabled=${this.disabled}
|
|
63
|
-
@input=${this._handleEvent}
|
|
64
|
-
@change=${this._handleEvent}
|
|
65
|
-
></luzmo-slider>
|
|
66
|
-
`;
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
// src/components/item-option-slider/index.ts
|
|
70
|
-
e([i({
|
|
71
|
-
type: Number,
|
|
72
|
-
reflect: !0
|
|
73
|
-
})], s.prototype, "value", void 0), e([i({
|
|
74
|
-
type: Number,
|
|
75
|
-
reflect: !0
|
|
76
|
-
})], s.prototype, "default", void 0), e([i({
|
|
77
|
-
type: Number,
|
|
78
|
-
reflect: !0
|
|
79
|
-
})], s.prototype, "min", void 0), e([i({
|
|
80
|
-
type: Number,
|
|
81
|
-
reflect: !0
|
|
82
|
-
})], s.prototype, "max", void 0), e([i({
|
|
83
|
-
type: Number,
|
|
84
|
-
reflect: !0
|
|
85
|
-
})], s.prototype, "step", void 0), e([i({
|
|
86
|
-
type: Number,
|
|
87
|
-
reflect: !0
|
|
88
|
-
})], s.prototype, "debounce", void 0), e([i()], s.prototype, "parseValue", void 0), e([i()], s.prototype, "toValue", void 0), e([a("luzmo-slider")], s.prototype, "_slider", void 0), customElements.get("luzmo-item-option-slider") || customElements.define("luzmo-item-option-slider", s);
|
|
89
|
-
export { s as t };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
-
*
|
|
3
|
-
* Copyright © 2026 Luzmo
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Luzmo web components (“Luzmo Web Components”)
|
|
6
|
-
* must be used according to the Luzmo Terms of Service.
|
|
7
|
-
* This license allows users with a current active Luzmo account
|
|
8
|
-
* to use the Luzmo Web Components. This license terminates
|
|
9
|
-
* automatically if a user no longer has an active Luzmo account.
|
|
10
|
-
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
11
|
-
*
|
|
12
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
-
* SOFTWARE.
|
|
19
|
-
* */
|
|
20
|
-
require("./tokens-BWMfo_w4.cjs");const e=require("./decorate-DCJt-2rt.cjs"),t=require("./item-option-base-BMy6dWbc.cjs");let n=require("lit"),r=require("lit/decorators.js");require("@luzmo/lucero/slider");var i=`:host{overflow:visible}luzmo-slider{contain:layout}`,a=class extends t.t{constructor(...e){super(...e),this.value=0,this.default=0,this.min=0,this.max=100,this.step=100,this.debounce=200,this._debounceTimeout=null}static get styles(){return[...super.styles,(0,n.unsafeCSS)(i)]}disconnectedCallback(){super.disconnectedCallback(),this._debounceTimeout&&=(clearTimeout(this._debounceTimeout),null)}_emitOptionChanged(e){this._lastEmittedSliderValue=e,this.dispatchEvent(new CustomEvent(`luzmo-option-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{value:typeof this.toValue==`function`?this.toValue(e):e}}))}_handleEvent(e){let t=this._slider.value;(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 n.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-slider>
|
|
33
|
-
`}};e.t([(0,r.property)({type:Number,reflect:!0})],a.prototype,`value`,void 0),e.t([(0,r.property)({type:Number,reflect:!0})],a.prototype,`default`,void 0),e.t([(0,r.property)({type:Number,reflect:!0})],a.prototype,`min`,void 0),e.t([(0,r.property)({type:Number,reflect:!0})],a.prototype,`max`,void 0),e.t([(0,r.property)({type:Number,reflect:!0})],a.prototype,`step`,void 0),e.t([(0,r.property)({type:Number,reflect:!0})],a.prototype,`debounce`,void 0),e.t([(0,r.property)()],a.prototype,`parseValue`,void 0),e.t([(0,r.property)()],a.prototype,`toValue`,void 0),e.t([(0,r.query)(`luzmo-slider`)],a.prototype,`_slider`,void 0),customElements.get(`luzmo-item-option-slider`)||customElements.define(`luzmo-item-option-slider`,a),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
|