@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.
Files changed (220) hide show
  1. package/README.md +10 -2
  2. package/angular/components/interactive-viz-item.ts +41 -4
  3. package/angular/components/item-option-color-picker.ts +30 -3
  4. package/angular/components/item-option-color-range.ts +30 -3
  5. package/angular/components/item-option-guidelines.ts +31 -4
  6. package/angular/components/item-option-panel.ts +41 -4
  7. package/angular/components/item-option-slider.ts +41 -4
  8. package/angular/components/item-option.ts +41 -4
  9. package/angular/esm/components/interactive-viz-item.d.ts +14 -5
  10. package/angular/esm/components/interactive-viz-item.js +30 -4
  11. package/angular/esm/components/item-option-color-picker.d.ts +11 -4
  12. package/angular/esm/components/item-option-color-picker.js +23 -3
  13. package/angular/esm/components/item-option-color-range.d.ts +11 -4
  14. package/angular/esm/components/item-option-color-range.js +23 -3
  15. package/angular/esm/components/item-option-guidelines.d.ts +11 -4
  16. package/angular/esm/components/item-option-guidelines.js +24 -4
  17. package/angular/esm/components/item-option-panel.d.ts +13 -4
  18. package/angular/esm/components/item-option-panel.js +30 -4
  19. package/angular/esm/components/item-option-slider.d.ts +13 -4
  20. package/angular/esm/components/item-option-slider.js +30 -4
  21. package/angular/esm/components/item-option.d.ts +13 -4
  22. package/angular/esm/components/item-option.js +30 -4
  23. package/angular/package.json +2 -2
  24. package/angular/utils/option-interaction/index.d.ts +2 -0
  25. package/angular/utils/option-interaction/is-same-option-value.d.ts +10 -0
  26. package/angular/utils/option-interaction/option-interaction-controller.d.ts +54 -0
  27. package/angular/utils/option-interaction/tests/option-interaction-controller.test.d.ts +1 -0
  28. package/angular/utils/store/base-store.d.ts +9 -0
  29. package/angular/utils/store/tests/store-base-history.test.d.ts +1 -0
  30. package/components/add-to-dashboard/index.cjs +1 -1
  31. package/components/add-to-dashboard/index.js +1 -1
  32. package/components/{add-to-dashboard-NwsCPIlg.cjs → add-to-dashboard-CzIuDtAq.cjs} +1 -1
  33. package/components/{add-to-dashboard-NcVHlqrc.js → add-to-dashboard-DGC0_hRB.js} +1 -1
  34. package/components/{base-store-SgJsjLap.cjs → base-store-D3whjduR.cjs} +1 -1
  35. package/components/{base-store-g0dt7ru7.js → base-store-DQYj8A1W.js} +3 -0
  36. package/components/{chart-helpers-Dng_LGfq.js → chart-helpers-Cbl3sRra.js} +3 -2
  37. package/components/chart-helpers-fMnqHRzC.cjs +20 -0
  38. package/components/{choropleth-map-options.config-D9-u-NwX.js → choropleth-map-options.config-Blu0Z2tR.js} +1 -1
  39. package/components/{choropleth-map-options.config-CXDGMiSJ.cjs → choropleth-map-options.config-DwFJ00CS.cjs} +1 -1
  40. package/components/{color-range-utils-CUCTsRXM.js → color-range-utils-CgwRGUkg.js} +18 -18
  41. package/components/{color-range-utils-BCFQAeY1.cjs → color-range-utils-D8uygiMe.cjs} +1 -1
  42. package/components/{heat-map-options.config-ChZeslEy.js → heat-map-options.config-BQkhkLPb.js} +16 -16
  43. package/components/{heat-map-options.config-DiNa8NnG.cjs → heat-map-options.config-DjQkB039.cjs} +1 -1
  44. package/components/{heat-table-options.config-BPCszrFn.js → heat-table-options.config-CMWWTeyo.js} +1 -1
  45. package/components/{heat-table-options.config-BvE6coaV.cjs → heat-table-options.config-D21xtaIk.cjs} +1 -1
  46. package/components/index.cjs +1 -1
  47. package/components/index.js +9 -9
  48. package/components/interactive-viz-item/index.cjs +1 -1
  49. package/components/interactive-viz-item/index.d.ts +2 -1
  50. package/components/interactive-viz-item/index.js +2 -2
  51. package/components/interactive-viz-item/interactive-viz-item.d.ts +34 -2
  52. package/components/interactive-viz-item/types.d.ts +17 -0
  53. package/components/{interactive-viz-item-CofUkpP6.js → interactive-viz-item-BKLOmawA.js} +166 -100
  54. package/components/interactive-viz-item-ojdH1uk0.cjs +268 -0
  55. package/components/is-same-option-value-B2oyvEqT.js +42 -0
  56. package/components/is-same-option-value-Cf6BQcs7.cjs +20 -0
  57. package/components/item-option/helpers/control-markup.d.ts +7 -0
  58. package/components/item-option/index.cjs +1 -1
  59. package/components/item-option/index.d.ts +1 -1
  60. package/components/item-option/index.js +1 -1
  61. package/components/item-option/item-option.d.ts +23 -2
  62. package/components/item-option/types.d.ts +19 -0
  63. package/components/{item-option-Cgx3c08E.js → item-option-DKLRnicU.js} +182 -136
  64. package/components/item-option-DpLdospV.cjs +285 -0
  65. package/components/item-option-color-picker/index.cjs +1 -1
  66. package/components/item-option-color-picker/index.d.ts +1 -1
  67. package/components/item-option-color-picker/index.js +1 -1
  68. package/components/item-option-color-picker/item-option-color-picker.d.ts +17 -1
  69. package/components/item-option-color-picker-CNW7GsCO.cjs +37 -0
  70. package/components/item-option-color-picker-DDvsY7hV.js +129 -0
  71. package/components/item-option-color-range/index.cjs +1 -1
  72. package/components/item-option-color-range/index.d.ts +1 -1
  73. package/components/item-option-color-range/index.js +1 -1
  74. package/components/item-option-color-range/item-option-color-range.d.ts +20 -1
  75. package/components/item-option-color-range-BqSbuSZh.cjs +101 -0
  76. package/components/item-option-color-range-FQduqtz3.js +265 -0
  77. package/components/item-option-guidelines/index.cjs +1 -1
  78. package/components/item-option-guidelines/index.d.ts +1 -1
  79. package/components/item-option-guidelines/index.js +1 -1
  80. package/components/item-option-guidelines/item-option-guidelines.d.ts +16 -1
  81. package/components/{item-option-guidelines-DNJevmVD.js → item-option-guidelines-k5DwMONo.js} +132 -104
  82. package/components/item-option-guidelines-z9BsGR-l.cjs +138 -0
  83. package/components/item-option-panel/index.cjs +1 -1
  84. package/components/item-option-panel/index.d.ts +1 -1
  85. package/components/item-option-panel/index.js +1 -1
  86. package/components/item-option-panel/item-option-panel.d.ts +12 -1
  87. package/components/{item-option-panel-DHdnisRb.js → item-option-panel-BLXWIbjX.js} +18 -6
  88. package/components/{item-option-panel-Dl3aYBNe.cjs → item-option-panel-CU51qvgV.cjs} +6 -4
  89. package/components/item-option-slider/index.cjs +1 -1
  90. package/components/item-option-slider/index.d.ts +1 -1
  91. package/components/item-option-slider/index.js +1 -1
  92. package/components/item-option-slider/item-option-slider.d.ts +15 -2
  93. package/components/item-option-slider-BKtJfL3D.js +119 -0
  94. package/components/item-option-slider-Kz2eFBql.cjs +36 -0
  95. package/components/item-options-configs.cjs +1 -1
  96. package/components/item-options-configs.js +5 -5
  97. package/components/option-interaction-controller-B8S1N_Oo.js +90 -0
  98. package/components/option-interaction-controller-D0U-CTpZ.cjs +20 -0
  99. package/components/{route-map-options.config-DdCaVtIF.cjs → route-map-options.config-DER6ENky.cjs} +1 -1
  100. package/components/{route-map-options.config-B7vT6KG_.js → route-map-options.config-DTcS47fW.js} +1 -1
  101. package/components/{spike-map-options.config-DkmRZ1JZ.js → spike-map-options.config-CPYfKWoF.js} +1 -1
  102. package/components/{spike-map-options.config-B3hDh2qU.cjs → spike-map-options.config-DeF1Whq5.cjs} +1 -1
  103. package/components/utils/store.cjs +1 -1
  104. package/components/utils/store.js +1 -1
  105. package/custom-elements.json +418 -104
  106. package/package.json +2 -2
  107. package/react/components/interactive-viz-item.component.ts +11 -2
  108. package/react/components/item-option-color-picker.component.ts +9 -3
  109. package/react/components/item-option-color-range.component.ts +9 -3
  110. package/react/components/item-option-guidelines.component.ts +9 -3
  111. package/react/components/item-option-panel.component.ts +12 -3
  112. package/react/components/item-option-slider.component.ts +12 -3
  113. package/react/components/item-option.component.ts +12 -3
  114. package/react/esm/components/interactive-viz-item.component.d.ts +8 -2
  115. package/react/esm/components/interactive-viz-item.component.js +7 -1
  116. package/react/esm/components/item-option-color-picker.component.d.ts +6 -2
  117. package/react/esm/components/item-option-color-picker.component.js +6 -2
  118. package/react/esm/components/item-option-color-range.component.d.ts +6 -2
  119. package/react/esm/components/item-option-color-range.component.js +6 -2
  120. package/react/esm/components/item-option-guidelines.component.d.ts +6 -2
  121. package/react/esm/components/item-option-guidelines.component.js +6 -2
  122. package/react/esm/components/item-option-panel.component.d.ts +8 -2
  123. package/react/esm/components/item-option-panel.component.js +8 -2
  124. package/react/esm/components/item-option-slider.component.d.ts +8 -2
  125. package/react/esm/components/item-option-slider.component.js +8 -2
  126. package/react/esm/components/item-option.component.d.ts +8 -2
  127. package/react/esm/components/item-option.component.js +8 -2
  128. package/react/luzmo-stub.d.ts +7 -0
  129. package/react/package.json +2 -2
  130. package/standalone/add-to-dashboard.js +40 -40
  131. package/standalone/chunks/{chart-helpers-DsIGsaDc.js → chart-helpers-CR-EUEPf.js} +2 -2
  132. package/standalone/chunks/{choropleth-map-options.config-Cs4Kvr9h.js → choropleth-map-options.config-CDMjKnJD.js} +1 -1
  133. package/standalone/chunks/{color-range-utils-CKDpd3gZ.js → color-range-utils-BVyHBRiq.js} +1 -1
  134. package/standalone/chunks/de-BkB0q1Eg.js +2 -0
  135. package/standalone/chunks/display-settings-binning-BeLLxd3i.js +38 -0
  136. package/standalone/chunks/display-settings-datetime-BkeiKIVV.js +199 -0
  137. package/standalone/chunks/display-settings-grand-totals-BuhpQKJ6.js +26 -0
  138. package/standalone/chunks/display-settings-numeric-m30IYI7I.js +172 -0
  139. package/standalone/chunks/display-settings-period-over-period-CqDlOSRn.js +209 -0
  140. package/standalone/chunks/embed-Bv1ps-EM.js +260 -0
  141. package/standalone/chunks/en-63f7j4v7.js +2 -0
  142. package/standalone/chunks/en-GB-QAmXQf8W.js +2 -0
  143. package/standalone/chunks/en-US-63f7j4v7.js +2 -0
  144. package/standalone/chunks/es-Bo0jStZn.js +2 -0
  145. package/standalone/chunks/{filters-DKgJcQGP.js → filters-CxgBXUF1.js} +61 -61
  146. package/standalone/chunks/{formula-codemirror-BbyvNEVD.js → formula-codemirror-Cq94j3-f.js} +17 -17
  147. package/standalone/chunks/fr-Co_qVhhV.js +2 -0
  148. package/standalone/chunks/{heat-map-options.config-DF5kjOOe.js → heat-map-options.config-DDQMD38W.js} +1 -1
  149. package/standalone/chunks/{heat-table-options.config-DaePzfHG.js → heat-table-options.config-B4K0Ygug.js} +1 -1
  150. package/standalone/chunks/is-same-option-value-7kXNF4st.js +2 -0
  151. package/standalone/chunks/item-option-action-button-group-BoyqF9vt.js +35 -0
  152. package/standalone/chunks/item-option-base-CBcDT8MX.js +38 -0
  153. package/standalone/chunks/item-option-color-palette-picker-C9PGAv4V.js +22 -0
  154. package/standalone/chunks/item-option-color-picker-D4fVJlqF.js +19 -0
  155. package/standalone/chunks/item-option-color-range-BlAdTguE.js +83 -0
  156. package/standalone/chunks/item-option-guidelines-DMsYsHDu.js +120 -0
  157. package/standalone/chunks/{item-option-multi-language-field-DPPpN2qg.js → item-option-multi-language-field-NUbm1drg.js} +1 -1
  158. package/standalone/chunks/{item-option-number-field-CkqJjInE.js → item-option-number-field-DRp7kbHL.js} +1 -1
  159. package/standalone/chunks/item-option-panel-cXrRclzM.js +316 -0
  160. package/standalone/chunks/{item-option-picker-BnwQPT9A.js → item-option-picker-Ba09L4Cs.js} +1 -1
  161. package/standalone/chunks/item-option-position-picker-GEGTnhjw.js +14 -0
  162. package/standalone/chunks/item-option-positions-number-field-n44s1k5v.js +31 -0
  163. package/standalone/chunks/{item-option-radio-button-group-BkymJq3E.js → item-option-radio-button-group-3s_b1NvR.js} +1 -1
  164. package/standalone/chunks/item-option-slider-DtY65Gxk.js +18 -0
  165. package/standalone/chunks/item-option-switch-4sJaI0mx.js +12 -0
  166. package/standalone/chunks/{item-option-text-field-D7bkuhsv.js → item-option-text-field-Bt6Lj6kh.js} +1 -1
  167. package/standalone/chunks/{item-slot-picker-panel-D4BMxGs9.js → item-slot-picker-panel-BOSVFBIy.js} +43 -43
  168. package/standalone/chunks/load-data-fields-for-datasets-CDlut-6S.js +25 -0
  169. package/standalone/chunks/localized-decorator-DosMCCQo.js +2 -0
  170. package/standalone/chunks/{version-BW4Ixl63.js → localized-mixin-BWJj88bd.js} +1 -1
  171. package/standalone/chunks/nl-CQz2jrVx.js +2 -0
  172. package/standalone/chunks/option-interaction-controller-BuwRr21c.js +2 -0
  173. package/standalone/chunks/{route-map-options.config-D7FfzIiU.js → route-map-options.config-CGBkHnhM.js} +1 -1
  174. package/standalone/chunks/{spike-map-options.config-CZiFzDm9.js → spike-map-options.config-CSenlJ_F.js} +1 -1
  175. package/standalone/interactive-viz-item.js +62 -55
  176. package/standalone/item-grid.js +10 -10
  177. package/standalone/manifest.json +44 -43
  178. package/utils/option-interaction/index.d.ts +2 -0
  179. package/utils/option-interaction/is-same-option-value.d.ts +10 -0
  180. package/utils/option-interaction/option-interaction-controller.d.ts +54 -0
  181. package/utils/option-interaction/tests/option-interaction-controller.test.d.ts +1 -0
  182. package/utils/store/base-store.d.ts +9 -0
  183. package/utils/store/tests/store-base-history.test.d.ts +1 -0
  184. package/components/chart-helpers-ufZ6VbXs.cjs +0 -20
  185. package/components/interactive-viz-item-D537mo3l.cjs +0 -261
  186. package/components/item-option-CqGDFdPj.cjs +0 -269
  187. package/components/item-option-color-picker-BpPoOO2b.cjs +0 -34
  188. package/components/item-option-color-picker-cojuCvu5.js +0 -84
  189. package/components/item-option-color-range-CMBEx1fi.cjs +0 -98
  190. package/components/item-option-color-range-Dt7Bv06p.js +0 -217
  191. package/components/item-option-guidelines-Beh0DlG0.cjs +0 -135
  192. package/components/item-option-slider-Bo5vs6nr.js +0 -89
  193. package/components/item-option-slider-CyWKWr5D.cjs +0 -33
  194. package/standalone/chunks/color-7IgCGZKz.js +0 -2
  195. package/standalone/chunks/de-mdZT2W1G.js +0 -2
  196. package/standalone/chunks/display-settings-binning-Byffw2Kl.js +0 -38
  197. package/standalone/chunks/display-settings-datetime-CD52d6Sv.js +0 -199
  198. package/standalone/chunks/display-settings-grand-totals-Cky99LX9.js +0 -26
  199. package/standalone/chunks/display-settings-numeric-C9ea7Tgc.js +0 -172
  200. package/standalone/chunks/display-settings-period-over-period-BLSGumkD.js +0 -209
  201. package/standalone/chunks/embed-BfHBKhIe.js +0 -231
  202. package/standalone/chunks/en-CSboh17P.js +0 -2
  203. package/standalone/chunks/en-GB-HoXKQBOY.js +0 -2
  204. package/standalone/chunks/en-US-CSboh17P.js +0 -2
  205. package/standalone/chunks/es-Di5D8JFd.js +0 -2
  206. package/standalone/chunks/fr-DZku7iB9.js +0 -2
  207. package/standalone/chunks/item-option-action-button-group-BEAwPHVw.js +0 -35
  208. package/standalone/chunks/item-option-base-CRUxNhJQ.js +0 -38
  209. package/standalone/chunks/item-option-color-palette-picker-CBz61iZb.js +0 -22
  210. package/standalone/chunks/item-option-color-picker-Cr7ujQNO.js +0 -16
  211. package/standalone/chunks/item-option-color-range-CyJd1LZ_.js +0 -80
  212. package/standalone/chunks/item-option-guidelines-6NjpzS6b.js +0 -117
  213. package/standalone/chunks/item-option-panel-VxvWU56c.js +0 -298
  214. package/standalone/chunks/item-option-position-picker-Bkc4JvJX.js +0 -14
  215. package/standalone/chunks/item-option-positions-number-field-Dr_315TE.js +0 -31
  216. package/standalone/chunks/item-option-slider-l9wt7_0c.js +0 -15
  217. package/standalone/chunks/item-option-switch-DeihDHhM.js +0 -12
  218. package/standalone/chunks/load-data-fields-for-datasets-ClctSj6y.js +0 -25
  219. package/standalone/chunks/localized-decorator-DJVBmJVH.js +0 -2
  220. package/standalone/chunks/nl-CViTevL3.js +0 -2
@@ -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}});