@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
package/components/{item-option-guidelines-DNJevmVD.js → item-option-guidelines-k5DwMONo.js}
RENAMED
|
@@ -21,105 +21,107 @@ import "./tokens-6HmQYnEP.js";
|
|
|
21
21
|
import "./base-rAte-QzM.js";
|
|
22
22
|
import { t as e } from "./decorate-B2TzfnLZ.js";
|
|
23
23
|
import { t } from "./localized-mixin-FPDNaZhb.js";
|
|
24
|
-
import {
|
|
25
|
-
import { t as
|
|
26
|
-
import {
|
|
24
|
+
import { t as n } from "./is-same-option-value-B2oyvEqT.js";
|
|
25
|
+
import { t as r } from "./option-interaction-controller-B8S1N_Oo.js";
|
|
26
|
+
import { a as i, c as a, l as o, n as s, r as c, s as l, t as u } from "./types-DJuS9IwG.js";
|
|
27
|
+
import { t as d } from "./item-option-base-BfHciede.js";
|
|
28
|
+
import { luzmoBorderDashed as f, luzmoBorderDotted as p, luzmoBorderSolid as m, luzmoPlus as h, luzmoTrashOutline as g } from "@luzmo/icons";
|
|
27
29
|
import "@luzmo/lucero/action-button";
|
|
28
30
|
import "@luzmo/lucero/button";
|
|
29
31
|
import "@luzmo/lucero/icon";
|
|
30
|
-
import { html as
|
|
31
|
-
import { property as
|
|
32
|
-
import { localized as
|
|
33
|
-
import { repeat as
|
|
32
|
+
import { html as _, nothing as v, unsafeCSS as y } from "lit";
|
|
33
|
+
import { property as b, queryAll as x, state as S } from "lit/decorators.js";
|
|
34
|
+
import { localized as C, msg as w, str as T } from "@lit/localize";
|
|
35
|
+
import { repeat as E } from "lit/directives/repeat.js";
|
|
34
36
|
import "@luzmo/lucero/action-group";
|
|
35
37
|
import "@luzmo/lucero/number-field";
|
|
36
38
|
import "@luzmo/lucero/picker";
|
|
37
39
|
import "@luzmo/lucero/menu";
|
|
38
40
|
import "@luzmo/lucero/color-picker";
|
|
39
41
|
// src/components/item-option-guidelines/helpers/guidelines-value.ts
|
|
40
|
-
var
|
|
42
|
+
var D = new Set(l), O = new Set(a), k = new Set(o), A = {
|
|
41
43
|
solid: "0",
|
|
42
44
|
dotted: "1,2",
|
|
43
45
|
dashed: "3,3"
|
|
44
|
-
},
|
|
46
|
+
}, j = (e) => typeof e == "object" && !!e && !Array.isArray(e), M = (e) => {
|
|
45
47
|
if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
46
48
|
if (typeof e == "string" && e.trim() !== "") {
|
|
47
49
|
let t = Number(e);
|
|
48
50
|
return Number.isFinite(t) ? t : void 0;
|
|
49
51
|
}
|
|
50
|
-
},
|
|
51
|
-
let t = (e ?? []).filter(
|
|
52
|
-
return t.length > 0 ? t : [...
|
|
53
|
-
},
|
|
54
|
-
if (!
|
|
55
|
-
let t = typeof e.type == "string" ? e.type.trim().toLowerCase() : "",
|
|
52
|
+
}, N = (e) => typeof e == "string" && D.has(e), P = (e) => {
|
|
53
|
+
let t = (e ?? []).filter(N);
|
|
54
|
+
return t.length > 0 ? t : [...u];
|
|
55
|
+
}, F = (e) => e === "dark-edit" ? s : c, I = (e) => structuredClone(e), ee = (e) => {
|
|
56
|
+
if (!j(e)) return { ...i };
|
|
57
|
+
let t = typeof e.type == "string" ? e.type.trim().toLowerCase() : "", n = O.has(t) ? t : A[t] ?? i.type, r = (typeof e.width == "number" ? String(e.width) : typeof e.width == "string" ? e.width.trim() : "").replace(/px$/i, "");
|
|
56
58
|
return {
|
|
57
|
-
type:
|
|
58
|
-
width:
|
|
59
|
+
type: n,
|
|
60
|
+
width: k.has(r) ? r : i.width
|
|
59
61
|
};
|
|
60
|
-
},
|
|
61
|
-
if (!
|
|
62
|
+
}, L = (e) => {
|
|
63
|
+
if (!j(e)) return;
|
|
62
64
|
let t = typeof e.type == "string" ? e.type.trim().toLowerCase() : "";
|
|
63
|
-
if (!
|
|
64
|
-
let n = typeof e.color == "string" && e.color.trim() !== "" ? e.color.trim() :
|
|
65
|
+
if (!N(t)) return;
|
|
66
|
+
let n = typeof e.color == "string" && e.color.trim() !== "" ? e.color.trim() : c;
|
|
65
67
|
return t === "value" ? {
|
|
66
68
|
type: t,
|
|
67
69
|
color: n,
|
|
68
|
-
value:
|
|
70
|
+
value: M(e.value) ?? 0
|
|
69
71
|
} : {
|
|
70
72
|
type: t,
|
|
71
73
|
color: n
|
|
72
74
|
};
|
|
73
|
-
},
|
|
75
|
+
}, R = (e) => {
|
|
74
76
|
let t = Array.isArray(e) ? { lines: e } : e;
|
|
75
|
-
if (!
|
|
76
|
-
let n = Array.isArray(t.lines) ? t.lines : [t.lines], r = n.map(
|
|
77
|
+
if (!j(t) || !(Array.isArray(t.lines) || j(t.lines))) return;
|
|
78
|
+
let n = Array.isArray(t.lines) ? t.lines : [t.lines], r = n.map(L).filter((e) => e !== void 0);
|
|
77
79
|
if (!(n.length > 0 && r.length === 0)) return {
|
|
78
80
|
lines: r,
|
|
79
|
-
style:
|
|
81
|
+
style: ee(t.style)
|
|
80
82
|
};
|
|
81
|
-
},
|
|
83
|
+
}, z = (e, t) => e === "value" ? {
|
|
82
84
|
type: e,
|
|
83
85
|
color: t,
|
|
84
86
|
value: 0
|
|
85
87
|
} : {
|
|
86
88
|
type: e,
|
|
87
89
|
color: t
|
|
88
|
-
},
|
|
89
|
-
let
|
|
90
|
+
}, B = (e, t, n) => {
|
|
91
|
+
let r = P(t)[0], a = z(r, n);
|
|
90
92
|
if (!e) return {
|
|
91
93
|
lines: [a],
|
|
92
|
-
style: { ...
|
|
94
|
+
style: { ...i }
|
|
93
95
|
};
|
|
94
|
-
let o =
|
|
96
|
+
let o = I(e);
|
|
95
97
|
return o.lines.push(a), o;
|
|
96
|
-
},
|
|
97
|
-
let n =
|
|
98
|
+
}, V = (e, t) => {
|
|
99
|
+
let n = I(e);
|
|
98
100
|
return n.lines.splice(t, 1), n;
|
|
99
|
-
}, B = (e, t, n) => {
|
|
100
|
-
let r = N(e), i = r.lines[t];
|
|
101
|
-
return i && (r.lines[t] = L(n, i.color)), r;
|
|
102
|
-
}, V = (e, t, n) => {
|
|
103
|
-
let r = N(e);
|
|
104
|
-
return r.lines[t] && (r.lines[t].color = n), r;
|
|
105
101
|
}, H = (e, t, n) => {
|
|
106
|
-
let r =
|
|
102
|
+
let r = I(e), i = r.lines[t];
|
|
103
|
+
return i && (r.lines[t] = z(n, i.color)), r;
|
|
104
|
+
}, U = (e, t, n) => {
|
|
105
|
+
let r = I(e);
|
|
106
|
+
return r.lines[t] && (r.lines[t].color = n), r;
|
|
107
|
+
}, W = (e, t, n) => {
|
|
108
|
+
let r = I(e);
|
|
107
109
|
return r.lines[t] && (r.lines[t].value = n), r;
|
|
108
|
-
},
|
|
109
|
-
let n =
|
|
110
|
+
}, G = (e, t) => {
|
|
111
|
+
let n = I(e);
|
|
110
112
|
return n.style.type = t, n;
|
|
111
|
-
},
|
|
112
|
-
let n =
|
|
113
|
+
}, K = (e, t) => {
|
|
114
|
+
let n = I(e);
|
|
113
115
|
return n.style.width = t, n;
|
|
114
|
-
},
|
|
116
|
+
}, q = ":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, Y = 6, X = 10 ** -6, Z = { maximumFractionDigits: Y }, Q = t(d), $ = class extends Q {
|
|
115
117
|
constructor(...e) {
|
|
116
|
-
super(...e), this.lineTypes = [], this.lineTypeLabels = {}, this.defaultColor =
|
|
118
|
+
super(...e), this.lineTypes = [], this.lineTypeLabels = {}, this.defaultColor = F(), this.debounce = 200, this.liveInteractions = !1, this._interaction = new r(this, n), this._lineIds = [], this._lineIdCounter = 0, this._styleLabelId = `luzmo-item-option-guidelines-style-${++J}`, this._widthLabelId = `luzmo-item-option-guidelines-width-${J}`;
|
|
117
119
|
}
|
|
118
120
|
static get styles() {
|
|
119
|
-
return [...super.styles,
|
|
121
|
+
return [...super.styles, y(q)];
|
|
120
122
|
}
|
|
121
123
|
willUpdate(e) {
|
|
122
|
-
super.willUpdate(e), e.has("value") && (this._clearDebounce(), this._guidelines =
|
|
124
|
+
super.willUpdate(e), e.has("value") && (this._clearDebounce(), this._guidelines = R(this.value), this._lineIds = (this._guidelines?.lines ?? []).map((e, t) => this._lineIds[t] ?? this._createLineId())), e.has("liveInteractions") && (this.liveInteractions ? this._clearDebounce() : this.endInteraction());
|
|
123
125
|
}
|
|
124
126
|
disconnectedCallback() {
|
|
125
127
|
super.disconnectedCallback(), this._clearDebounce();
|
|
@@ -130,43 +132,62 @@ var w = new Set(s), T = new Set(r), E = new Set(i), D = {
|
|
|
130
132
|
_clearDebounce() {
|
|
131
133
|
clearTimeout(this._debounceTimeout), this._debounceTimeout = void 0;
|
|
132
134
|
}
|
|
133
|
-
|
|
134
|
-
let
|
|
135
|
+
endInteraction() {
|
|
136
|
+
for (let e of this._colorPickers ?? []) e.endInteraction?.();
|
|
137
|
+
this._interaction.endAll();
|
|
138
|
+
}
|
|
139
|
+
_handleInteractionStart(e, t) {
|
|
140
|
+
this.liveInteractions && this._interaction.start(t.currentTarget, t.detail, this._guidelines?.lines[e]?.color);
|
|
141
|
+
}
|
|
142
|
+
_finalizeBeforeStructureChange() {
|
|
143
|
+
this.liveInteractions && this.endInteraction();
|
|
144
|
+
}
|
|
145
|
+
_handleInteractionEnd(e) {
|
|
146
|
+
this._interaction.end(e.currentTarget, e.detail);
|
|
147
|
+
}
|
|
148
|
+
_handleInteractionCancel(e) {
|
|
149
|
+
this._interaction.cancel(e.currentTarget, e.detail);
|
|
150
|
+
}
|
|
151
|
+
_emit(e, t = !1, n = this, r) {
|
|
152
|
+
let i = (t) => {
|
|
135
153
|
this._debounceTimeout = void 0, this.dispatchEvent(new CustomEvent("luzmo-option-changed", {
|
|
136
154
|
bubbles: !0,
|
|
137
155
|
composed: !0,
|
|
138
156
|
cancelable: !0,
|
|
139
|
-
detail:
|
|
157
|
+
detail: t ? {
|
|
158
|
+
value: e,
|
|
159
|
+
interaction: t
|
|
160
|
+
} : { value: e }
|
|
140
161
|
}));
|
|
141
162
|
};
|
|
142
|
-
this._clearDebounce(), t || this.debounce <= 0 ?
|
|
163
|
+
this._clearDebounce(), this.liveInteractions ? this._interaction.update(n, e, i, r) : t || this.debounce <= 0 ? i() : this._debounceTimeout = setTimeout(i, this.debounce);
|
|
143
164
|
}
|
|
144
|
-
_commit(e, t = !1) {
|
|
145
|
-
this._guidelines = e, this._emit(e, t);
|
|
165
|
+
_commit(e, t = !1, n, r) {
|
|
166
|
+
this._guidelines = e, this._emit(e, t, n, r);
|
|
146
167
|
}
|
|
147
168
|
_allowedTypes() {
|
|
148
|
-
return
|
|
169
|
+
return P(this.lineTypes);
|
|
149
170
|
}
|
|
150
171
|
_typeLabel(e) {
|
|
151
172
|
if (this.lineTypeLabels[e]) return this.lineTypeLabels[e];
|
|
152
173
|
switch (e) {
|
|
153
|
-
case "value": return
|
|
174
|
+
case "value": return w("Value", {
|
|
154
175
|
id: "item-option-guidelines-type-value",
|
|
155
176
|
desc: "Guideline type: manual numeric value"
|
|
156
177
|
});
|
|
157
|
-
case "average": return
|
|
178
|
+
case "average": return w("Average", {
|
|
158
179
|
id: "item-option-guidelines-type-average",
|
|
159
180
|
desc: "Guideline type: average of the plotted data"
|
|
160
181
|
});
|
|
161
|
-
case "median": return
|
|
182
|
+
case "median": return w("Median", {
|
|
162
183
|
id: "item-option-guidelines-type-median",
|
|
163
184
|
desc: "Guideline type: median of the plotted data"
|
|
164
185
|
});
|
|
165
|
-
case "average open": return
|
|
186
|
+
case "average open": return w("Average open", {
|
|
166
187
|
id: "item-option-guidelines-type-average-open",
|
|
167
188
|
desc: "Guideline type: average of open values"
|
|
168
189
|
});
|
|
169
|
-
case "average close": return
|
|
190
|
+
case "average close": return w("Average close", {
|
|
170
191
|
id: "item-option-guidelines-type-average-close",
|
|
171
192
|
desc: "Guideline type: average of close values"
|
|
172
193
|
});
|
|
@@ -177,15 +198,15 @@ var w = new Set(s), T = new Set(r), E = new Set(i), D = {
|
|
|
177
198
|
}
|
|
178
199
|
_widthValues() {
|
|
179
200
|
return {
|
|
180
|
-
1:
|
|
201
|
+
1: w("Thin", {
|
|
181
202
|
id: "item-option-guidelines-width-thin",
|
|
182
203
|
desc: "Guideline width: thin"
|
|
183
204
|
}),
|
|
184
|
-
2:
|
|
205
|
+
2: w("Medium", {
|
|
185
206
|
id: "item-option-guidelines-width-medium",
|
|
186
207
|
desc: "Guideline width: medium"
|
|
187
208
|
}),
|
|
188
|
-
3:
|
|
209
|
+
3: w("Thick", {
|
|
189
210
|
id: "item-option-guidelines-width-thick",
|
|
190
211
|
desc: "Guideline width: thick"
|
|
191
212
|
})
|
|
@@ -195,24 +216,24 @@ var w = new Set(s), T = new Set(r), E = new Set(i), D = {
|
|
|
195
216
|
return [
|
|
196
217
|
{
|
|
197
218
|
key: "0",
|
|
198
|
-
icon:
|
|
199
|
-
label:
|
|
219
|
+
icon: m,
|
|
220
|
+
label: w("Solid", {
|
|
200
221
|
id: "item-option-guidelines-style-solid",
|
|
201
222
|
desc: "Guideline line style: solid"
|
|
202
223
|
})
|
|
203
224
|
},
|
|
204
225
|
{
|
|
205
226
|
key: "1,2",
|
|
206
|
-
icon:
|
|
207
|
-
label:
|
|
227
|
+
icon: p,
|
|
228
|
+
label: w("Dotted", {
|
|
208
229
|
id: "item-option-guidelines-style-dotted",
|
|
209
230
|
desc: "Guideline line style: dotted"
|
|
210
231
|
})
|
|
211
232
|
},
|
|
212
233
|
{
|
|
213
234
|
key: "3,3",
|
|
214
|
-
icon:
|
|
215
|
-
label:
|
|
235
|
+
icon: f,
|
|
236
|
+
label: w("Dashed", {
|
|
216
237
|
id: "item-option-guidelines-style-dashed",
|
|
217
238
|
desc: "Guideline line style: dashed"
|
|
218
239
|
})
|
|
@@ -220,52 +241,52 @@ var w = new Set(s), T = new Set(r), E = new Set(i), D = {
|
|
|
220
241
|
];
|
|
221
242
|
}
|
|
222
243
|
_handleAdd() {
|
|
223
|
-
this.disabled || (this._lineIds = [...this._lineIds, this._createLineId()], this._commit(
|
|
244
|
+
this.disabled || (this._finalizeBeforeStructureChange(), this._lineIds = [...this._lineIds, this._createLineId()], this._commit(B(this._guidelines, this.lineTypes, this.defaultColor), !0));
|
|
224
245
|
}
|
|
225
246
|
_handleRemove(e) {
|
|
226
|
-
!this.disabled && this._guidelines && (this._lineIds = this._lineIds.filter((t, n) => n !== e), this._commit(
|
|
247
|
+
!this.disabled && this._guidelines && (this._finalizeBeforeStructureChange(), this._lineIds = this._lineIds.filter((t, n) => n !== e), this._commit(V(this._guidelines, e), !0));
|
|
227
248
|
}
|
|
228
249
|
_handleTypeChange(e, t) {
|
|
229
|
-
!this.disabled && this._guidelines &&
|
|
250
|
+
!this.disabled && this._guidelines && N(t.detail) && this._commit(H(this._guidelines, e, t.detail), !0);
|
|
230
251
|
}
|
|
231
252
|
_handleColorChange(e, t) {
|
|
232
253
|
if (this.disabled || !this._guidelines) return;
|
|
233
254
|
let n = t.target.color;
|
|
234
|
-
typeof n == "string" && this._commit(
|
|
255
|
+
typeof n == "string" && this._commit(U(this._guidelines, e, n), !1, t.currentTarget ?? void 0, n);
|
|
235
256
|
}
|
|
236
257
|
_handleValueChange(e, t) {
|
|
237
258
|
if (this.disabled || !this._guidelines) return;
|
|
238
259
|
let n = t.target.value;
|
|
239
|
-
typeof n == "number" && Number.isFinite(n) && this._commit(
|
|
260
|
+
typeof n == "number" && Number.isFinite(n) && this._commit(W(this._guidelines, e, n));
|
|
240
261
|
}
|
|
241
262
|
_handleStyleChange(e) {
|
|
242
263
|
if (this.disabled || !this._guidelines) return;
|
|
243
264
|
let t = e.target.selected?.[0];
|
|
244
|
-
(t === "0" || t === "1,2" || t === "3,3") && this._commit(
|
|
265
|
+
(t === "0" || t === "1,2" || t === "3,3") && this._commit(G(this._guidelines, t), !0);
|
|
245
266
|
}
|
|
246
267
|
_handleWidthChange(e) {
|
|
247
268
|
if (this.disabled || !this._guidelines) return;
|
|
248
269
|
let t = e.detail, n = e.target.value, r = t === "1" || t === "2" || t === "3" ? t : n;
|
|
249
|
-
(r === "1" || r === "2" || r === "3") && this._commit(
|
|
270
|
+
(r === "1" || r === "2" || r === "3") && this._commit(K(this._guidelines, r), !0);
|
|
250
271
|
}
|
|
251
272
|
_lineKey(e) {
|
|
252
273
|
return this._lineIds[e];
|
|
253
274
|
}
|
|
254
275
|
_renderLine(e, t) {
|
|
255
|
-
let n = t + 1, r =
|
|
276
|
+
let n = t + 1, r = w(T`Guideline ${n} color`, {
|
|
256
277
|
id: "item-option-guidelines-color",
|
|
257
278
|
desc: "Accessible name for one guideline color picker"
|
|
258
|
-
}), i =
|
|
279
|
+
}), i = w(T`Guideline ${n} type`, {
|
|
259
280
|
id: "item-option-guidelines-type",
|
|
260
281
|
desc: "Accessible name for one guideline type picker"
|
|
261
|
-
}), a =
|
|
282
|
+
}), a = w(T`Guideline ${n} value`, {
|
|
262
283
|
id: "item-option-guidelines-value",
|
|
263
284
|
desc: "Accessible name for one manual guideline value"
|
|
264
|
-
}), o =
|
|
285
|
+
}), o = w(T`Remove guideline ${n}`, {
|
|
265
286
|
id: "item-option-guidelines-remove",
|
|
266
287
|
desc: "Aria label for removing one guideline row"
|
|
267
288
|
});
|
|
268
|
-
return
|
|
289
|
+
return _`
|
|
269
290
|
<div class="guideline-row">
|
|
270
291
|
<luzmo-color-picker
|
|
271
292
|
class="guideline-color"
|
|
@@ -276,6 +297,9 @@ var w = new Set(s), T = new Set(r), E = new Set(i), D = {
|
|
|
276
297
|
.label=${r}
|
|
277
298
|
?disabled=${this.disabled}
|
|
278
299
|
@change=${(e) => this._handleColorChange(t, e)}
|
|
300
|
+
@luzmo-interaction-start=${(e) => this._handleInteractionStart(t, e)}
|
|
301
|
+
@luzmo-interaction-end=${this._handleInteractionEnd}
|
|
302
|
+
@luzmo-interaction-cancel=${this._handleInteractionCancel}
|
|
279
303
|
></luzmo-color-picker>
|
|
280
304
|
<luzmo-picker
|
|
281
305
|
class="guideline-type"
|
|
@@ -286,22 +310,22 @@ var w = new Set(s), T = new Set(r), E = new Set(i), D = {
|
|
|
286
310
|
?disabled=${this.disabled}
|
|
287
311
|
@change=${(e) => this._handleTypeChange(t, e)}
|
|
288
312
|
>
|
|
289
|
-
${Object.entries(this._typeValues()).map(([e, t]) =>
|
|
313
|
+
${Object.entries(this._typeValues()).map(([e, t]) => _`
|
|
290
314
|
<luzmo-menu-item value=${e}>${t}</luzmo-menu-item>
|
|
291
315
|
`)}
|
|
292
316
|
</luzmo-picker>
|
|
293
|
-
${e.type === "value" ?
|
|
317
|
+
${e.type === "value" ? _`
|
|
294
318
|
<luzmo-number-field
|
|
295
319
|
class="guideline-value"
|
|
296
320
|
.value=${e.value ?? 0}
|
|
297
321
|
.size=${this.size}
|
|
298
|
-
.step=${
|
|
299
|
-
.formatOptions=${
|
|
322
|
+
.step=${X}
|
|
323
|
+
.formatOptions=${Z}
|
|
300
324
|
.label=${a}
|
|
301
325
|
?disabled=${this.disabled}
|
|
302
326
|
@change=${(e) => this._handleValueChange(t, e)}
|
|
303
327
|
></luzmo-number-field>
|
|
304
|
-
` :
|
|
328
|
+
` : _`
|
|
305
329
|
<div class="guideline-value-spacer"></div>
|
|
306
330
|
`}
|
|
307
331
|
<luzmo-action-button
|
|
@@ -312,17 +336,17 @@ var w = new Set(s), T = new Set(r), E = new Set(i), D = {
|
|
|
312
336
|
?disabled=${this.disabled}
|
|
313
337
|
@click=${() => this._handleRemove(t)}
|
|
314
338
|
>
|
|
315
|
-
<luzmo-icon slot="icon" .size=${this.size} .icon=${
|
|
339
|
+
<luzmo-icon slot="icon" .size=${this.size} .icon=${g}></luzmo-icon>
|
|
316
340
|
</luzmo-action-button>
|
|
317
341
|
</div>
|
|
318
342
|
`;
|
|
319
343
|
}
|
|
320
344
|
_renderSharedStyle(e) {
|
|
321
|
-
return
|
|
345
|
+
return _`
|
|
322
346
|
<div class="guideline-shared">
|
|
323
347
|
<div class="guideline-shared-row">
|
|
324
348
|
<span class="guideline-shared-label" id=${this._styleLabelId}>
|
|
325
|
-
${
|
|
349
|
+
${w("Style", {
|
|
326
350
|
id: "item-option-guidelines-style-label",
|
|
327
351
|
desc: "Label for shared guideline dash style"
|
|
328
352
|
})}
|
|
@@ -339,7 +363,7 @@ var w = new Set(s), T = new Set(r), E = new Set(i), D = {
|
|
|
339
363
|
?disabled=${this.disabled}
|
|
340
364
|
@change=${this._handleStyleChange}
|
|
341
365
|
>
|
|
342
|
-
${this._styleOptions().map((e) =>
|
|
366
|
+
${this._styleOptions().map((e) => _`
|
|
343
367
|
<luzmo-action-button value=${e.key} ?disabled=${this.disabled} .label=${e.label}>
|
|
344
368
|
<luzmo-icon slot="icon" .size=${this.size} .icon=${e.icon}></luzmo-icon>
|
|
345
369
|
</luzmo-action-button>
|
|
@@ -348,7 +372,7 @@ var w = new Set(s), T = new Set(r), E = new Set(i), D = {
|
|
|
348
372
|
</div>
|
|
349
373
|
<div class="guideline-shared-row">
|
|
350
374
|
<span class="guideline-shared-label" id=${this._widthLabelId}>
|
|
351
|
-
${
|
|
375
|
+
${w("Width", {
|
|
352
376
|
id: "item-option-guidelines-width-label",
|
|
353
377
|
desc: "Label for shared guideline width"
|
|
354
378
|
})}
|
|
@@ -362,7 +386,7 @@ var w = new Set(s), T = new Set(r), E = new Set(i), D = {
|
|
|
362
386
|
?disabled=${this.disabled}
|
|
363
387
|
@change=${this._handleWidthChange}
|
|
364
388
|
>
|
|
365
|
-
${Object.entries(this._widthValues()).map(([e, t]) =>
|
|
389
|
+
${Object.entries(this._widthValues()).map(([e, t]) => _`
|
|
366
390
|
<luzmo-menu-item value=${e}>${t}</luzmo-menu-item>
|
|
367
391
|
`)}
|
|
368
392
|
</luzmo-picker>
|
|
@@ -371,17 +395,17 @@ var w = new Set(s), T = new Set(r), E = new Set(i), D = {
|
|
|
371
395
|
`;
|
|
372
396
|
}
|
|
373
397
|
renderController() {
|
|
374
|
-
let e = this._guidelines?.lines ?? [], t = this.label ||
|
|
398
|
+
let e = this._guidelines?.lines ?? [], t = this.label || w("Guidelines", {
|
|
375
399
|
id: "item-option-guidelines-group",
|
|
376
400
|
desc: "Accessible name for the guidelines editor"
|
|
377
401
|
});
|
|
378
|
-
return
|
|
402
|
+
return _`
|
|
379
403
|
<div id="luzmo-item-option-control" class="guidelines" role="group" aria-label=${t}>
|
|
380
|
-
${e.length > 0 ?
|
|
404
|
+
${e.length > 0 ? _`
|
|
381
405
|
<div class="guideline-rows">
|
|
382
|
-
${
|
|
406
|
+
${E(e, (e, t) => this._lineKey(t), (e, t) => this._renderLine(e, t))}
|
|
383
407
|
</div>
|
|
384
|
-
` :
|
|
408
|
+
` : v}
|
|
385
409
|
<div class="guidelines-add">
|
|
386
410
|
<luzmo-button
|
|
387
411
|
class="add-guideline"
|
|
@@ -390,25 +414,29 @@ var w = new Set(s), T = new Set(r), E = new Set(i), D = {
|
|
|
390
414
|
?disabled=${this.disabled}
|
|
391
415
|
@click=${this._handleAdd}
|
|
392
416
|
>
|
|
393
|
-
<luzmo-icon slot="icon" .icon=${
|
|
394
|
-
${
|
|
417
|
+
<luzmo-icon slot="icon" .icon=${h} .size=${this.size}></luzmo-icon>
|
|
418
|
+
${w("Add guideline", {
|
|
395
419
|
id: "item-option-guidelines-add",
|
|
396
420
|
desc: "Button that adds a chart guideline"
|
|
397
421
|
})}
|
|
398
422
|
</luzmo-button>
|
|
399
423
|
</div>
|
|
400
|
-
${this._guidelines && e.length > 0 ? this._renderSharedStyle(this._guidelines) :
|
|
424
|
+
${this._guidelines && e.length > 0 ? this._renderSharedStyle(this._guidelines) : v}
|
|
401
425
|
</div>
|
|
402
426
|
`;
|
|
403
427
|
}
|
|
404
428
|
};
|
|
405
429
|
// src/components/item-option-guidelines/index.ts
|
|
406
|
-
e([
|
|
430
|
+
e([b({ attribute: !1 })], $.prototype, "value", void 0), e([b({ attribute: !1 })], $.prototype, "lineTypes", void 0), e([b({ attribute: !1 })], $.prototype, "lineTypeLabels", void 0), e([b({
|
|
407
431
|
type: String,
|
|
408
432
|
reflect: !0,
|
|
409
433
|
attribute: "default-color"
|
|
410
|
-
})],
|
|
434
|
+
})], $.prototype, "defaultColor", void 0), e([b({
|
|
411
435
|
type: Number,
|
|
412
436
|
reflect: !0
|
|
413
|
-
})],
|
|
414
|
-
|
|
437
|
+
})], $.prototype, "debounce", void 0), e([b({
|
|
438
|
+
type: Boolean,
|
|
439
|
+
reflect: !0,
|
|
440
|
+
attribute: "live-interactions"
|
|
441
|
+
})], $.prototype, "liveInteractions", void 0), e([x("luzmo-color-picker")], $.prototype, "_colorPickers", void 0), e([S()], $.prototype, "_guidelines", void 0), $ = e([C()], $), typeof customElements < "u" && !customElements.get("luzmo-item-option-guidelines") && customElements.define("luzmo-item-option-guidelines", $);
|
|
442
|
+
export { $ as t };
|