@luzmo/analytics-components-kit 1.0.1-alpha.2 → 1.0.1-alpha.4

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 (151) hide show
  1. package/LICENSE +18 -0
  2. package/custom-elements.json +1550 -0
  3. package/lib/area-chart-slots.config-BLxiYX05.cjs +20 -0
  4. package/lib/area-chart-slots.config-C0c2ZzBh.js +52 -0
  5. package/lib/async-directive-CPjMHOPu.cjs +24 -0
  6. package/lib/async-directive-SCUUQ3Mh.js +114 -0
  7. package/lib/bar-chart-slots.config-GSSL7XVA.js +47 -0
  8. package/lib/bar-chart-slots.config-Jx1PveTM.cjs +20 -0
  9. package/lib/bar-chart.config-B57geUzJ.cjs +20 -0
  10. package/lib/bar-chart.config-CQ6HAvs2.js +153 -0
  11. package/lib/bar-chart.en-BqYbiHO3.cjs +20 -0
  12. package/lib/bar-chart.en-FwT00qdU.js +69 -0
  13. package/lib/bar-chart.fr-DGx9smEh.cjs +20 -0
  14. package/lib/bar-chart.fr-DbxKiM0j.js +44 -0
  15. package/lib/bar-chart.nl-BYzVExsz.cjs +20 -0
  16. package/lib/bar-chart.nl-ahX1ARpH.js +44 -0
  17. package/lib/button-base-B4PdJFVe.cjs +27 -0
  18. package/lib/button-base-CtfPWS-P.js +142 -0
  19. package/lib/column-chart.config-B57geUzJ.cjs +20 -0
  20. package/lib/column-chart.config-C9hP0kX7.js +153 -0
  21. package/lib/cs-DVZ0Tapy.js +89 -0
  22. package/lib/cs-I9E81keK.cjs +20 -0
  23. package/lib/da-DHy05oSR.js +97 -0
  24. package/lib/da-QkdvupDg.cjs +20 -0
  25. package/lib/de-Dn5mUzha.cjs +20 -0
  26. package/lib/de-iM39JlAt.js +109 -0
  27. package/lib/decompose-numeric-format-B3rVVHpO.cjs +20 -0
  28. package/lib/decompose-numeric-format-BuZcjH2k.js +39 -0
  29. package/lib/directive-helpers-BSB0tfc9.cjs +32 -0
  30. package/lib/directive-helpers-eY1rHtyn.js +154 -0
  31. package/lib/divider.module-BW8qaMVq.js +211 -0
  32. package/lib/divider.module-DEy88Ieh.cjs +20 -0
  33. package/lib/donut-chart-slots.config-BEwhfq27.js +39 -0
  34. package/lib/donut-chart-slots.config-DIp-24lO.cjs +20 -0
  35. package/lib/donut-chart.config-3DhKiSSM.js +177 -0
  36. package/lib/donut-chart.config-DLWJUlHx.cjs +20 -0
  37. package/lib/donut-chart.en-Blb9oSdU.cjs +20 -0
  38. package/lib/donut-chart.en-CzjT4-XN.js +85 -0
  39. package/lib/donut-chart.fr-BeTVa2wh.cjs +20 -0
  40. package/lib/donut-chart.fr-DftPrKbG.js +39 -0
  41. package/lib/donut-chart.nl-D9YGbOce.cjs +20 -0
  42. package/lib/donut-chart.nl-NMatXfhK.js +39 -0
  43. package/lib/draggable-data-item/index.cjs +20 -0
  44. package/lib/draggable-data-item/index.js +30 -0
  45. package/lib/droppable-slot/index.cjs +20 -0
  46. package/lib/droppable-slot/index.js +30 -0
  47. package/lib/en-BDBzmAXX.cjs +202 -0
  48. package/lib/en-CIeY2T5K.js +1980 -0
  49. package/lib/en-GB-BqYHIX1v.cjs +20 -0
  50. package/lib/en-GB-CYx--4nh.js +28 -0
  51. package/lib/es-CwyPlN5d.cjs +20 -0
  52. package/lib/es-KhTq4jX8.js +305 -0
  53. package/lib/fi-Dh_ebgpe.js +97 -0
  54. package/lib/fi-rijeZE5V.cjs +20 -0
  55. package/lib/fr-BcgE-6S_.cjs +20 -0
  56. package/lib/fr-CU727YF1.js +305 -0
  57. package/lib/get-css-variable-BHHQ0SnL.js +1444 -0
  58. package/lib/get-css-variable-D439CdH9.cjs +24 -0
  59. package/lib/he-Au3xg6lR.js +89 -0
  60. package/lib/he-O6Ih8Bqh.cjs +20 -0
  61. package/lib/hu-BnZ8y3xQ.cjs +20 -0
  62. package/lib/hu-DNJ-P_MW.js +97 -0
  63. package/lib/if-defined-BbzmSG-O.js +757 -0
  64. package/lib/if-defined-V7yEJWI3.cjs +54 -0
  65. package/lib/imageobject.config-B7ld9bj3.cjs +20 -0
  66. package/lib/imageobject.config-DZLp9Elq.js +127 -0
  67. package/lib/index-0314DjEl.cjs +20 -0
  68. package/lib/index-B9h2L_hV.js +3048 -0
  69. package/lib/index-BDXFsKUM.cjs +146 -0
  70. package/lib/index-Bd4cKS9O.js +155 -0
  71. package/lib/index-BmAD29P2.js +106 -0
  72. package/lib/index-Bo1DpZ-1.cjs +58 -0
  73. package/lib/index-C4ePDYEC.cjs +41 -0
  74. package/lib/index-C9xEN5Ji.js +82 -0
  75. package/lib/index-CBCm4_7S.js +869 -0
  76. package/lib/index-CM80_HQw.js +442 -0
  77. package/lib/index-CcF-9wyF.cjs +71 -0
  78. package/lib/index-CfEm5P0J.cjs +196 -0
  79. package/lib/index-CrWoFMZ3.cjs +22 -0
  80. package/lib/index-CtEJZdT0.js +1627 -0
  81. package/lib/index-CvX-HLY1.cjs +322 -0
  82. package/lib/index-D37RwuEH.js +1584 -0
  83. package/lib/index-D5puKlcm.cjs +96 -0
  84. package/lib/index-DGz6jCKo.cjs +26 -0
  85. package/lib/index-DJp_9h0l.js +327 -0
  86. package/lib/index-DSbgZduE.js +501 -0
  87. package/lib/index-D_KYpfBM.js +24 -0
  88. package/lib/index-DdtjeKYI.js +928 -0
  89. package/lib/index-Dj7PF4Q9.cjs +63 -0
  90. package/lib/index-Dq3HAOaM.js +127 -0
  91. package/lib/index-DrIA0eFE.js +392 -0
  92. package/lib/index-jt6FL_uE.cjs +20 -0
  93. package/lib/index-kJR406YZ.cjs +112 -0
  94. package/lib/index-v8ZTprPO.cjs +51 -0
  95. package/lib/index.cjs +875 -0
  96. package/lib/index.js +6411 -0
  97. package/lib/it-Bh5U73z6.js +305 -0
  98. package/lib/it-PshtLMkq.cjs +20 -0
  99. package/lib/ja-CCcHUL61.js +89 -0
  100. package/lib/ja-KIS2HdaG.cjs +20 -0
  101. package/lib/ko--l4qmjLV.cjs +20 -0
  102. package/lib/ko-DhapsZMM.js +89 -0
  103. package/lib/line-chart.config-BZcvfO2c.cjs +20 -0
  104. package/lib/line-chart.config-CIVN6uLI.js +115 -0
  105. package/lib/mk-B9HPSuKa.js +97 -0
  106. package/lib/mk-DZlj-edb.cjs +20 -0
  107. package/lib/nl-BKlDqOXb.cjs +20 -0
  108. package/lib/nl-BwSt5Bf4.js +109 -0
  109. package/lib/no-D-DofYnx.js +109 -0
  110. package/lib/no-D_SzxhTu.cjs +20 -0
  111. package/lib/observe-slot-text-DOYmGOZe.js +181 -0
  112. package/lib/observe-slot-text-oJ0a2KY9.cjs +42 -0
  113. package/lib/picker/index.cjs +20 -0
  114. package/lib/picker/index.js +32 -0
  115. package/lib/pl-D_L_0Boq.js +97 -0
  116. package/lib/pl-PIK23rK_.cjs +20 -0
  117. package/lib/popover-Bwnkg-5-.js +67 -0
  118. package/lib/popover-CQGN8nbX.cjs +32 -0
  119. package/lib/progress-circle/index.cjs +35 -0
  120. package/lib/progress-circle/index.js +104 -0
  121. package/lib/pt-B0BBS5VB.js +89 -0
  122. package/lib/pt-Dqlu4MS5.cjs +20 -0
  123. package/lib/ru-Vo-m3O_2.js +108 -0
  124. package/lib/ru-zyNDTB04.cjs +20 -0
  125. package/lib/sv-1DPTltNQ.cjs +20 -0
  126. package/lib/sv-CiozMaev.js +89 -0
  127. package/lib/textobject.config-C8opcGG4.js +52 -0
  128. package/lib/textobject.config-DbAajFz8.cjs +20 -0
  129. package/lib/tr-BkmWvOG2.cjs +20 -0
  130. package/lib/tr-D_D4i5iv.js +109 -0
  131. package/lib/zh-CN-DTZ4OmdP.cjs +20 -0
  132. package/lib/zh-CN-wsl7eFSd.js +89 -0
  133. package/lib/zh-TW-DTZ4OmdP.cjs +20 -0
  134. package/lib/zh-TW-wsl7eFSd.js +89 -0
  135. package/package.json +19 -24
  136. package/37.js +0 -1
  137. package/729.js +0 -1
  138. package/common-31743c5a.js +0 -13
  139. package/common-b02547a0.js +0 -1
  140. package/common-b49d9a9d.js +0 -1
  141. package/common-b5232813.js +0 -56
  142. package/common-cefd4f4c.js +0 -1
  143. package/common-d6cb565f.js +0 -1
  144. package/common-fd868059.js +0 -1
  145. package/common-fedaf338.js +0 -32
  146. package/edit-option-picker/index.js +0 -314
  147. package/edit-option-slider/index.js +0 -102
  148. package/edit-option-toggle/index.js +0 -114
  149. package/index.js +0 -346
  150. package/vendors-93cc3efa.js +0 -1
  151. package/vendors-bb3d84b5.js +0 -1
@@ -0,0 +1,146 @@
1
+ /*! * A kit of modern Luzmo Web Components for analytics in your web application.
2
+ *
3
+ * Copyright © 2024 Luzmo
4
+ * All rights reserved.
5
+ * Luzmo web components (“Luzmo Web Components”)
6
+ * must be used according to the Luzmo Terms of Service.
7
+ * This license allows users with a current active Luzmo account
8
+ * to use the Luzmo Web Components. This license terminates
9
+ * automatically if a user no longer has an active Luzmo account.
10
+ * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ * SOFTWARE.
19
+ * */
20
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./decompose-numeric-format-B3rVVHpO.cjs"),s=require("./if-defined-V7yEJWI3.cjs");require("./index-DGz6jCKo.cjs");require("./index-CrWoFMZ3.cjs");require("./index-CvX-HLY1.cjs");require("./index-CfEm5P0J.cjs");require("./index-Dj7PF4Q9.cjs");require("./index-0314DjEl.cjs");const _=require("./index-Bo1DpZ-1.cjs"),z=require("./directive-helpers-BSB0tfc9.cjs"),b=require("./index-kJR406YZ.cjs"),F=":host .settings-container{display:flex;flex-direction:column;gap:var(--luzmo-spacing-2)}:host .settings-row{display:flex;justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-numeric-gap, var(--display-settings-numeric-gap))}.duration-angle-down-icon{margin-inline-start:var(--luzmo-numeric-duration-levels-dropdown-icon-margin-inline-start, var(--numeric-duration-levels-dropdown-icon-margin-inline-start))}:host{--display-settings-numeric-gap: var(--luzmo-spacing-3);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-2 )}:host([size=s]){--display-settings-numeric-gap: var(--luzmo-spacing-3);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-1 )}:host([size=l]){--display-settings-numeric-gap: var(--luzmo-spacing-4);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-3 )}:host([size=xl]){--display-settings-numeric-gap: var(--luzmo-spacing-5);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-4 )}",S={sum:"Sum",cumulativesum:"Cumulative sum",average:"Average",weightedaverage:"Weighted average",median:"Median",count:"Count",distinctcount:"Distinct count",min:"Minimum",max:"Maximum",stddev:"Standard deviation",rate:"Rate"},v={general:"123",percentage:"%",scientific:"SI"},f={time:"Time",short:"Short",long:"Long"},y={Auto:{auto:!0},"1,000.00":{auto:!1,thousandSeparator:",",decimalSeparator:"."},"1.000,00":{auto:!1,thousandSeparator:".",decimalSeparator:","},"1000.00":{auto:!1,decimalSeparator:"."},"1000,00":{auto:!1,decimalSeparator:","}},A={levels:[{level:1,label:"years"},{level:2,label:"quarters"},{level:3,label:"months"},{level:4,label:"weeks"},{level:5,label:"days"},{level:6,label:"hours"},{level:7,label:"minutes"},{level:8,label:"seconds"},{level:9,label:"milliseconds"}]};var L=Object.defineProperty,r=(h,t,e,i)=>{for(var n=void 0,a=h.length-1,l;a>=0;a--)(l=h[a])&&(n=l(t,e,n)||n);return n&&L(t,e,n),n};class o extends s.SizedMixin(s.LuzmoElement,{validSizes:Object.values(s.ElementSizes)}){constructor(){super(...arguments),this.slotContent={},this.measureColumns=[],this._durationLevels=[],this._renderDurationLevelMenu=!1,this._sendEvent=()=>{const t={...this.slotContent};t.format=this._format,t.aggregationFunc=this._aggregationFunc,this._aggregationWeightColumn?t.aggregationWeight={...this._aggregationWeightColumn}:this._aggregationFunc==="rate"&&(t.aggregationFunc="average"),this._displayMode==="duration"?(t.duration=t.duration??{},t.duration.format=this._durationFormat,t.duration.levels=this._durationLevels):delete t.duration,this.dispatchEvent(new CustomEvent("slot-content-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:t}}))}}static get styles(){return[s.r(F)]}_parseSavedNumericFormatSettings(){var t,e,i,n,a,l,m,d,c,g;if(this._displayMode=((t=this.slotContent)==null?void 0:t.subtype)==="duration"?((n=(i=(e=this.slotContent)==null?void 0:e.duration)==null?void 0:i.levels)==null?void 0:n.length)===1?"numeric":"duration":"numeric",this._durationFormat=((l=(a=this.slotContent)==null?void 0:a.duration)==null?void 0:l.format)??"short",this._durationLevels=((d=(m=this.slotContent)==null?void 0:m.duration)==null?void 0:d.levels)??[1],this._displayMode==="duration")this._precision=2,this._commaDecimals=!1,this._thousandSeparator=!1;else{this._format=((c=this.slotContent)==null?void 0:c.format)??".0f";const u=p.decomposeNumericFormat(this._format??".0f");this._isAuto=((g=u.typeFormat)==null?void 0:g.includes("a"))??!1,["%","a%","y","ay"].includes(u.typeFormat)?this._displayAs="percentage":["s","as","w","aw"].includes(u.typeFormat)?this._displayAs="scientific":this._displayAs="general",this._precision=u.precision?Number.parseInt(u.precision.replace(".",""),10):this._displayAs==="scientific"?1:0,this._commaDecimals=["z","az","y","ay","w","aw"].includes(u.typeFormat),this._thousandSeparator=u.comma===",",this._isAuto?this._numericFormatGroup="Auto":this._commaDecimals&&this._thousandSeparator?this._numericFormatGroup="1.000,00":!this._commaDecimals&&this._thousandSeparator?this._numericFormatGroup="1,000.00":this._commaDecimals&&!this._thousandSeparator?this._numericFormatGroup="1000,00":!this._commaDecimals&&!this._thousandSeparator&&(this._numericFormatGroup="1000.00")}}_setNumericDisplayAs(){var t,e;this._displayAs=((e=(t=this._displayAsElement)==null?void 0:t.selected)==null?void 0:e[0])??"general",this._displayAs==="scientific"&&(this._precision=Math.max(this._precision??0,1),this._thousandSeparator=!1),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setNumericSeparators(t){const e=y[(t==null?void 0:t.detail)??"Auto"];this._thousandSeparator=[",","."].includes((e==null?void 0:e.thousandSeparator)??""),this._commaDecimals=(e==null?void 0:e.decimalSeparator)===",",this._isAuto=e==null?void 0:e.auto,this._setNumericFormat(),this._sendEvent()}_setPrecision(){this._precision=this._precisionElement.value,this._setNumericFormat(),this._sendEvent()}_setNumericFormat(){var i;let t="f";const e=this.slotContent.subtype==="duration"?this._durationLevels&&((i=this._durationLevels)==null?void 0:i.length)===1?"numeric":"duration":"numeric";this._maxDurationLevel=Math.min(...this._durationLevels),e==="duration"?(!["time","short","long"].includes(this._durationFormat??"")||this._maxDurationLevel<6&&this._durationFormat==="time")&&(this._durationFormat="short"):(this._displayAs==="general"&&this._commaDecimals?t="z":this._displayAs==="percentage"&&this._commaDecimals?t="y":this._displayAs==="scientific"&&this._commaDecimals?t="w":this._displayAs==="percentage"?t="%":this._displayAs==="scientific"&&(t="s"),this._format=(this._thousandSeparator||this._isAuto?",":"")+"."+this._precision+(this._isAuto?"a":"")+t)}_setAggregationFunc(){const t=this._aggregationFunc,e=this.slotContent.format;if(this._aggregationElement.value!==t){if(this._aggregationFunc=this._aggregationElement.value,t==="rate"){const i=p.decomposeNumericFormat(e),n=["%","y","a%","ay"].includes(i.typeFormat);this.slotContent.subtype==="currency"&&n&&this._setNumericDisplayAs()}this._sendEvent(),(this._aggregationFunc==="rate"||t==="rate")&&this.requestUpdate()}}_setAggregationWeight(){const t=this._aggregationWeightElement.value;if(t==="none")this._aggregationWeightColumn=void 0;else{const e=this.measureColumns.find(i=>i.columnId===t);this._aggregationWeightColumn={column:e==null?void 0:e.columnId,set:e==null?void 0:e.datasetId,columnSubType:e==null?void 0:e.subtype}}this._sendEvent()}_setDurationLevels(){const t=this._durationLevels,e=this._durationLevelsElement.value.split(",").filter(i=>i!=="").map(i=>Number.parseInt(i,10));this._durationLevels=((e==null?void 0:e.length)??0)>=1?e:t,this._maxDurationLevel=Math.min(...this._durationLevels),this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setDurationFormat(){var t,e;this._durationFormat=(e=(t=this._durationFormatElement)==null?void 0:t.selected)==null?void 0:e[0],this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_fillTimeDurationLevels(){if(this._durationFormat==="time"){const t=this._durationLevels.sort().at(-1);if([7,8,9].includes(t)){const e={lev7:[6],lev8:[6,7],lev9:[6,7,8]};for(const i of e["lev"+t])this._durationLevels.includes(i)||this._durationLevels.push(i);this._durationLevels=[...this._durationLevels].sort()}}}willUpdate(t){var e,i,n;t.has("slotContent")&&(this._parseSavedNumericFormatSettings(),this._aggregationFunc=((e=this.slotContent)==null?void 0:e.aggregationFunc)??((i=this.slotContent)==null?void 0:i.type)==="numeric"?"sum":"count",this._aggregationWeightColumn=(n=this.slotContent)==null?void 0:n.aggregationWeight)}firstUpdated(t){var e;(e=this.slotContent)!=null&&e.duration&&this._durationLevelsOverlay.addEventListener("slottable-request",i=>{this._renderDurationLevelMenu=i.data!==b.removeSlottableRequest})}_renderDurationLevelsSettings(){const t=A.levels.map(e=>{let i=!1;return this._durationFormat==="time"&&e.level>=6&&this._durationLevels.includes(e.level)&&e.level!==Math.max(...this._durationLevels)&&(i=!0),this._durationLevels.length===1&&this._durationLevels.includes(e.level)&&(i=!0),s.x`<luzmo-menu-item
21
+ value=${e.level}
22
+ ?selected=${this._durationLevels.includes(e.level)}
23
+ ?disabled=${i}
24
+ >
25
+ ${e.label}
26
+ </luzmo-menu-item>`});return s.x` <div class="setting">
27
+ <luzmo-field-label for="duration-levels">
28
+ Duration levels
29
+ </luzmo-field-label>
30
+ <luzmo-action-button id="trigger" size=${this.size}>
31
+ ${this._durationLevels.length}
32
+ ${this._durationLevels.length===1?"level":"levels"} active
33
+ <span class="duration-angle-down-icon">
34
+ ${_.O2(_.T)}
35
+ </span>
36
+ </luzmo-action-button>
37
+ <luzmo-overlay
38
+ id="duration-levels-overlay"
39
+ trigger="trigger@click"
40
+ type="auto"
41
+ placement="bottom-start"
42
+ type="page"
43
+ >
44
+ <luzmo-popover style="position: relative">
45
+ ${this._renderDurationLevelMenu?s.x` <luzmo-menu
46
+ id="duration-levels"
47
+ size=${this.size}
48
+ selects="multiple"
49
+ .value=${this._durationLevels.join(",")}
50
+ @change=${this._setDurationLevels}
51
+ >
52
+ ${t}
53
+ </luzmo-menu>`:""}
54
+ </luzmo-popover>
55
+ </luzmo-overlay>
56
+ </div>`}_renderDurationFormatSettings(){const t=Object.keys(f).map(e=>e==="time"&&(this._maxDurationLevel??1)<6?"":s.x`<luzmo-action-button value=${e}>
57
+ ${f[e]}
58
+ </luzmo-action-button>`);return s.x` <div class="setting">
59
+ <luzmo-field-label for="duration-format">Format</luzmo-field-label>
60
+ <luzmo-action-group
61
+ emphasized
62
+ id="duration-format"
63
+ size=${this.size}
64
+ compact=""
65
+ .selected=${[this._durationFormat??"short"]}
66
+ selects="single"
67
+ @change=${this._setDurationFormat}
68
+ >
69
+ ${t}
70
+ </luzmo-action-group>
71
+ </div>`}_renderNumericDisplayAsSettings(){const t=Object.keys(v).map(e=>s.x`<luzmo-action-button value=${e}
72
+ >${v[e]}</luzmo-action-button
73
+ >`);return s.x`<div class="setting">
74
+ <luzmo-field-label for="display-as">Display as</luzmo-field-label>
75
+ <luzmo-action-group
76
+ emphasized
77
+ id="display-as"
78
+ size=${this.size}
79
+ compact=""
80
+ .selected=${[this._displayAs]}
81
+ selects="single"
82
+ @change=${this._setNumericDisplayAs}
83
+ >
84
+ ${t}
85
+ </luzmo-action-group>
86
+ </div>`}_renderNumericFormatSettings(){const t=Object.keys(y).map(e=>s.x`<luzmo-menu-item value=${e}>${e}</luzmo-menu-item>`);return s.x` <div class="setting">
87
+ <luzmo-field-label for="format">Format</luzmo-field-label>
88
+ <luzmo-picker
89
+ id="format"
90
+ size=${this.size}
91
+ variant="highlight"
92
+ value=${this._numericFormatGroup??"Auto"}
93
+ @change=${this._setNumericSeparators}
94
+ >
95
+ ${t}
96
+ </luzmo-picker>
97
+ </div>
98
+ <div class="setting">
99
+ <luzmo-field-label for="precision" id="precision-label"
100
+ >${this._displayAs==="scientific"?"Precision":"Decimals"}</luzmo-field-label
101
+ >
102
+ <luzmo-number-field
103
+ id="precision"
104
+ min=${this._displayAs==="scientific"?1:0}
105
+ max="22"
106
+ size=${this.size}
107
+ value=${this._precision??(this._displayAs==="scientific"?1:0)}
108
+ @change=${this._setPrecision}
109
+ ></luzmo-number-field>
110
+ </div>`}_renderAggregationSettings(){var i,n;const t=Object.entries(S).map(([a,l])=>s.x`<luzmo-menu-item value=${a}>${l}</luzmo-menu-item>`),e=[s.x`<luzmo-menu-item value="none">No weight</luzmo-menu-item>`,...this.measureColumns.map(a=>{var m,d,c;const l=((m=a==null?void 0:a.label)==null?void 0:m[this.language??"en"])??((c=a==null?void 0:a.label)==null?void 0:c[(d=Object.keys(a==null?void 0:a.label))==null?void 0:d[0]])??"Untitled";return s.x`<luzmo-menu-item value=${a.id}>
111
+ ${l}
112
+ </luzmo-menu-item>`})];return s.x`<div class="settings-row">
113
+ <div class="setting">
114
+ <luzmo-field-label for="aggregation">Aggregation</luzmo-field-label>
115
+ <luzmo-picker
116
+ id="aggregation"
117
+ size=${this.size}
118
+ variant="highlight"
119
+ value=${this._aggregationFunc??(((i=this.slotContent)==null?void 0:i.type)==="numeric"?"sum":"count")}
120
+ @change=${this._setAggregationFunc}
121
+ >
122
+ ${t}
123
+ </luzmo-picker>
124
+ </div>
125
+ ${this._aggregationFunc==="rate"?s.x`<div class="setting">
126
+ <luzmo-field-label for="weighting-column">
127
+ Denominator
128
+ </luzmo-field-label>
129
+ <luzmo-picker
130
+ id="weighting-column"
131
+ size=${this.size}
132
+ variant="highlight"
133
+ value=${((n=this._aggregationWeightColumn)==null?void 0:n.column)??"none"}
134
+ @change=${this._setAggregationWeight}
135
+ >
136
+ ${e}
137
+ </luzmo-picker>
138
+ </div>`:""}
139
+ </div>`}render(){var t;return s.x`<div class="settings-container">
140
+ <div class="settings-row">
141
+ ${this._displayMode==="duration"?this._renderDurationLevelsSettings():this._renderNumericDisplayAsSettings()}
142
+ ${((t=this._durationLevels)==null?void 0:t.length)>1?this._renderDurationFormatSettings():this._renderNumericFormatSettings()}
143
+ </div>
144
+ ${this._renderAggregationSettings()}
145
+ </div>
146
+ </div>`}}r([s.n({type:String,reflect:!0})],o.prototype,"language");r([s.n({type:Object,reflect:!0})],o.prototype,"slotContent");r([s.n({type:Array,reflect:!1})],o.prototype,"measureColumns");r([s.e("#display-as")],o.prototype,"_displayAsElement");r([s.e("#precision")],o.prototype,"_precisionElement");r([s.e("#aggregation")],o.prototype,"_aggregationElement");r([s.e("#weighting-column")],o.prototype,"_aggregationWeightElement");r([s.e("#duration-levels")],o.prototype,"_durationLevelsElement");r([s.e("#duration-format")],o.prototype,"_durationFormatElement");r([s.e("#duration-levels-overlay")],o.prototype,"_durationLevelsOverlay");r([z.r()],o.prototype,"_renderDurationLevelMenu");customElements.get("luzmo-display-settings-numeric")||customElements.define("luzmo-display-settings-numeric",o);exports.LuzmoDisplaySettingsNumeric=o;
@@ -0,0 +1,155 @@
1
+ /*! * A kit of modern Luzmo Web Components for analytics in your web application.
2
+ *
3
+ * Copyright © 2024 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 { O as d, d as s } from "./index-DdtjeKYI.js";
21
+ import { S as v, r as h, x as g, n as r } from "./if-defined-BbzmSG-O.js";
22
+ import { B as m } from "./button-base-CtfPWS-P.js";
23
+ const z = ':host{cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;font-family:var(--luzmo-button-font-family, var(--luzmo-sans-font-family-stack, var(--luzmo-font-family)));-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:var(--luzmo-button-line-height, var(--luzmo-line-height-100, var(--line-height-100)));text-transform:none;vertical-align:top;-webkit-appearance:button;transition:background var(--luzmo-button-animation-duration, var(--luzmo-animation-duration-100, var(--animation-duration-100))) ease-out,border-color var(--luzmo-button-animation-duration, var(--luzmo-animation-duration-100, var(--animation-duration-100))) ease-out,color var(--luzmo-button-animation-duration, var(--luzmo-animation-duration-100, var(--animation-duration-100))) ease-out,box-shadow var(--luzmo-button-animation-duration, var(--luzmo-animation-duration-100, var(--animation-duration-100))) ease-out;border-style:solid;justify-content:center;align-items:center;margin:0;-webkit-text-decoration:none;text-decoration:none;display:inline-flex;overflow:visible}:host(:focus){outline:none}:host([disabled]){cursor:default}::slotted([slot=icon]){max-block-size:100%;flex-shrink:0}#label{text-align:center;place-self:center}#label:empty{display:none}@media (forced-colors: active){:host{--highcontrast-action-button-focus-indicator-color: ButtonText}:host:after{forced-color-adjust:none}:host([selected]){--highcontrast-action-button-background-color-default: Highlight;--highcontrast-action-button-background-color-hover: Highlight;--highcontrast-action-button-background-color-focus: Highlight;--highcontrast-action-button-background-color-down: Highlight;--highcontrast-action-button-background-color-disabled: ButtonFace;--highcontrast-action-button-border-color-default: HighlightText;--highcontrast-action-button-border-color-hover: HighlightText;--highcontrast-action-button-border-color-focus: HighlightText;--highcontrast-action-button-border-color-down: HighlightText;--highcontrast-action-button-border-color-disabled: GrayText;--highcontrast-action-button-content-color-default: HighlightText;--highcontrast-action-button-content-color-hover: HighlightText;--highcontrast-action-button-content-color-focus: HighlightText;--highcontrast-action-button-content-color-down: HighlightText;--highcontrast-action-button-content-color-disabled: GrayText}:host([selected]) .hold-affordance,:host([selected]) ::slotted([slot=icon]),:host([selected]) #label{forced-color-adjust:none}}:host{--action-button-focus-indicator-border-radius: calc( var(--action-button-border-radius) + var(--action-button-focus-indicator-gap) );--action-button-edge-to-visual: calc( var(--action-button-edge-to-visual-size) - var(--action-button-border-width) );--action-button-edge-to-text: calc( var(--action-button-edge-to-text-size) - var(--action-button-border-width) );--action-button-edge-to-visual-only: calc( var(--action-button-edge-to-visual-only-size) - var( --action-button-border-width ) );min-inline-size:var(--luzmo-action-button-min-width, var(--action-button-min-width));block-size:var(--luzmo-action-button-height, var(--action-button-height));border-radius:var(--luzmo-action-button-border-radius, var(--action-button-border-radius));border-width:var(--luzmo-action-button-border-width, var(--action-button-border-width));gap:calc(var(--luzmo-action-button-text-to-visual, var(--action-button-text-to-visual)) + var(--luzmo-action-button-edge-to-text, var(--action-button-edge-to-text)) - var(--luzmo-action-button-edge-to-visual-only, var(--action-button-edge-to-visual-only)));padding-inline:var(--luzmo-action-button-edge-to-text, var(--action-button-edge-to-text));background-color:var(--highcontrast-action-button-background-color-default, var(--luzmo-action-button-background-color-default, var(--action-button-background-color-default)));border-color:var(--highcontrast-action-button-border-color-default, var(--luzmo-action-button-border-color-default, var(--action-button-border-color-default)));color:var(--highcontrast-action-button-content-color-default, var(--luzmo-action-button-content-color-default, var(--action-button-content-color-default)));position:relative}:host:dir(rtl),:host([dir=rtl]){--logical-rotation: matrix(-1, 0, 0, 1, 0, 0)}@media (hover: hover){:host(:hover){background-color:var(--highcontrast-action-button-background-color-hover, var(--luzmo-action-button-background-color-hover, var(--action-button-background-color-hover)));border-color:var(--highcontrast-action-button-border-color-hover, var(--luzmo-action-button-border-color-hover, var(--action-button-border-color-hover)));color:var(--highcontrast-action-button-content-color-hover, var(--luzmo-action-button-content-color-hover, var(--action-button-content-color-hover)))}}:host(:focus-visible){background-color:var(--highcontrast-action-button-background-color-focus, var(--luzmo-action-button-background-color-focus, var(--action-button-background-color-focus)));border-color:var(--highcontrast-action-button-border-color-focus, var(--luzmo-action-button-border-color-focus, var(--action-button-border-color-focus)));color:var(--highcontrast-action-button-content-color-focus, var(--luzmo-action-button-content-color-focus, var(--action-button-content-color-focus)))}:host(:is(:active,[active])){background-color:var(--highcontrast-action-button-background-color-down, var(--luzmo-action-button-background-color-down, var(--action-button-background-color-down)));border-color:var(--highcontrast-action-button-border-color-down, var(--luzmo-action-button-border-color-down, var(--action-button-border-color-down)));color:var(--highcontrast-action-button-content-color-down, var(--luzmo-action-button-content-color-down, var(--action-button-content-color-down)))}:host([disabled]){background-color:var(--highcontrast-action-button-background-color-disabled, var(--luzmo-action-button-background-color-disabled, var(--action-button-background-color-disabled)));border-color:var(--highcontrast-action-button-border-color-disabled, var(--luzmo-action-button-border-color-disabled, var(--action-button-border-color-disabled)));color:var(--highcontrast-action-button-content-color-disabled, var(--luzmo-action-button-content-color-disabled, var(--action-button-content-color-disabled)))}:host([selected]){--luzmo-action-button-background-color-default: var( --luzmo-action-button-background-color-default-selected );--luzmo-action-button-background-color-hover: var( --luzmo-action-button-background-color-hover-selected );--luzmo-action-button-background-color-down: var( --luzmo-action-button-background-color-down-selected );--luzmo-action-button-background-color-focus: var( --luzmo-action-button-background-color-focus-selected );--luzmo-action-button-content-color-default: var( --luzmo-action-button-content-color-default-selected );--luzmo-action-button-content-color-hover: var( --luzmo-action-button-content-color-hover-selected );--luzmo-action-button-content-color-down: var( --luzmo-action-button-content-color-down-selected );--luzmo-action-button-content-color-focus: var( --luzmo-action-button-content-color-focus-selected )}:host([selected][emphasized]){--luzmo-action-button-background-color-default: var( --luzmo-action-button-background-color-default-selected-emphasized );--luzmo-action-button-background-color-hover: var( --luzmo-action-button-background-color-hover-selected-emphasized );--luzmo-action-button-background-color-down: var( --luzmo-action-button-background-color-down-selected-emphasized );--luzmo-action-button-background-color-focus: var( --luzmo-action-button-background-color-focus-selected-emphasized );--luzmo-action-button-content-color-default: var( --luzmo-action-button-content-color-default-selected-emphasized );--luzmo-action-button-content-color-hover: var( --luzmo-action-button-content-color-hover-selected-emphasized );--luzmo-action-button-content-color-down: var( --luzmo-action-button-content-color-down-selected-emphasized );--luzmo-action-button-content-color-focus: var( --luzmo-action-button-content-color-focus-selected-emphasized )}:host([selected][static-color=black]),:host([selected][static-color=white]){--luzmo-action-button-content-color-default: var( --luzmo-action-button-static-content-color );--luzmo-action-button-content-color-hover: var( --luzmo-action-button-static-content-color );--luzmo-action-button-content-color-down: var( --luzmo-action-button-static-content-color );--luzmo-action-button-content-color-focus: var( --luzmo-action-button-static-content-color )}::slotted([slot=icon]){inline-size:var(--luzmo-action-button-icon-size, var(--action-button-icon-size));color:inherit;margin-inline-start:calc(var(--luzmo-action-button-edge-to-visual, var(--action-button-edge-to-visual)) - var(--luzmo-action-button-edge-to-text, var(--action-button-edge-to-text)));margin-inline-end:calc(var(--luzmo-action-button-edge-to-visual, var(--action-button-edge-to-visual)) - var(--luzmo-action-button-edge-to-text, var(--action-button-edge-to-text)))}.hold-affordance+::slotted([slot=icon]){margin-inline-start:calc(var(--luzmo-action-button-edge-to-visual, var(--action-button-edge-to-visual)) - var(--luzmo-action-button-edge-to-text, var(--action-button-edge-to-text)));margin-inline-end:calc(var(--luzmo-action-button-edge-to-visual-only, var(--action-button-edge-to-visual-only)) - var(--luzmo-action-button-edge-to-text, var(--action-button-edge-to-text)))}.hold-affordance+[icon-only]::slotted([slot=icon]),[icon-only]::slotted([slot=icon]){margin-inline-start:calc(var(--luzmo-action-button-edge-to-visual-only, var(--action-button-edge-to-visual-only)) - var(--luzmo-action-button-edge-to-text, var(--action-button-edge-to-text)));margin-inline-end:calc(var(--luzmo-action-button-edge-to-visual-only, var(--action-button-edge-to-visual-only)) - var(--luzmo-action-button-edge-to-text, var(--action-button-edge-to-text)))}#label{pointer-events:none;font-size:var(--luzmo-action-button-font-size, var(--action-button-font-size));white-space:nowrap;color:inherit;color:var(--luzmo-action-button-label-color, inherit);text-overflow:ellipsis;overflow:hidden}.hold-affordance{color:inherit;transform:var(--logical-rotation);position:absolute;font-size:var(--action-button-corner-triangle-size);inset-block-end:calc(var(--luzmo-action-button-edge-to-hold-icon, var(--action-button-edge-to-hold-icon)) - var(--luzmo-action-button-border-width, var(--action-button-border-width)));inset-inline-end:calc(var(--luzmo-action-button-edge-to-hold-icon, var(--action-button-edge-to-hold-icon)) - var(--luzmo-action-button-border-width, var(--action-button-border-width)))}:host{transition:border-color var(--luzmo-action-button-animation-duration, var(--action-button-animation-duration)) ease-in-out}:host:after{margin:calc((var(--luzmo-action-button-focus-indicator-gap, var(--action-button-focus-indicator-gap)) + var(--luzmo-action-button-border-width, var(--action-button-border-width))) * -1);border-radius:var(--luzmo-action-button-focus-indicator-border-radius, var(--action-button-focus-indicator-border-radius));transition:box-shadow var(--luzmo-action-button-animation-duration, var(--action-button-animation-duration)) ease-in-out;pointer-events:none;content:"";position:absolute;top:0;right:0;bottom:0;left:0}:host(:focus-visible){box-shadow:none;outline:none}:host(:focus-visible):after{box-shadow:0 0 0 var(--luzmo-action-button-focus-indicator-thickness, var(--action-button-focus-indicator-thickness)) var(--highcontrast-action-button-focus-indicator-color, var(--luzmo-action-button-focus-indicator-color, var(--action-button-focus-indicator-color)))}:host{--action-button-animation-duration: var(--luzmo-animation-duration);--action-button-border-radius: var(--luzmo-border-radius);--action-button-border-width: var(--luzmo-border-width);--action-button-content-color-default: var(--luzmo-font-color);--action-button-content-color-hover: var(--luzmo-font-color-hover);--action-button-content-color-down: var(--luzmo-font-color-down);--action-button-content-color-focus: var(--luzmo-font-color-focus);--action-button-focus-indicator-gap: var(--luzmo-indicator-gap);--action-button-focus-indicator-thickness: var(--luzmo-indicator-width);--action-button-focus-indicator-color: var(--luzmo-indicator-color);--action-button-background-color-default: var(--luzmo-background-color);--action-button-background-color-hover: var(--luzmo-background-color-hover);--action-button-background-color-down: var(--luzmo-background-color-down);--action-button-background-color-focus: var(--luzmo-background-color-focus);--action-button-border-color-default: var(--luzmo-border-color);--action-button-border-color-hover: var(--luzmo-border-color-hover);--action-button-border-color-down: var(--luzmo-border-color-down);--action-button-border-color-focus: var(--luzmo-border-color-focus);--action-button-background-color-disabled: var(--luzmo-background-color);--action-button-border-color-disabled: var(--luzmo-border-color-disabled);--action-button-content-color-disabled: var(--luzmo-font-color-disabled)}:host([quiet]){--action-button-background-color-default: transparent;--action-button-background-color-hover: var(--luzmo-background-color-hover);--action-button-background-color-down: var(--luzmo-background-color-down);--action-button-background-color-focus: var(--luzmo-background-color-focus);--action-button-background-color-disabled: transparent;--action-button-border-color-default: transparent;--action-button-border-color-hover: transparent;--action-button-border-color-down: transparent;--action-button-border-color-focus: transparent;--action-button-border-color-disabled: transparent}:host([selected]){--action-button-background-color-default: var(--luzmo-font-color);--action-button-background-color-hover: var(--luzmo-font-color-hover);--action-button-background-color-down: var(--luzmo-font-color-down);--action-button-background-color-focus: var(--luzmo-font-color-focus);--action-button-content-color-default: var(--luzmo-background-color);--action-button-content-color-hover: var(--luzmo-background-color);--action-button-content-color-down: var(--luzmo-background-color);--action-button-content-color-focus: var(--luzmo-background-color);--action-button-border-color-default: transparent;--action-button-border-color-hover: transparent;--action-button-border-color-down: transparent;--action-button-border-color-focus: transparent;--action-button-border-color-disabled: transparent;--action-button-background-color-disabled: var( --luzmo-background-color-disabled )}:host([selected][emphasized]){--action-button-background-color-default: var(--luzmo-primary);--action-button-background-color-hover: var(--luzmo-primary-hover);--action-button-background-color-down: var(--luzmo-primary-down);--action-button-background-color-focus: var(--luzmo-primary-focus);--action-button-content-color-default: var(--luzmo-primary-inverse-color);--action-button-content-color-hover: var(--luzmo-primary-inverse-color);--action-button-content-color-down: var(--luzmo-primary-inverse-color);--action-button-content-color-focus: var(--luzmo-primary-inverse-color)}:host([static-color=black][quiet]),:host([static-color=white][quiet]){--action-button-border-color-default: transparent;--action-button-border-color-hover: transparent;--action-button-border-color-down: transparent;--action-button-border-color-focus: transparent;--action-button-border-color-disabled: transparent}:host([static-color=black]){--action-button-background-color-default: transparent;--action-button-background-color-hover: rgba(0, 0, 0, .25);--action-button-background-color-down: rgba(0, 0, 0, .4);--action-button-background-color-focus: rgba(0, 0, 0, .25);--action-button-background-color-disabled: transparent;--action-button-border-color-default: rgba(0, 0, 0, .4);--action-button-border-color-hover: rgba(0, 0, 0, .55);--action-button-border-color-down: rgba(0, 0, 0, .7);--action-button-border-color-focus: rgba(0, 0, 0, .25);--action-button-border-color-disabled: transparent;--action-button-content-color-default: rgb(0, 0, 0);--action-button-content-color-hover: rgb(0, 0, 0);--action-button-content-color-down: rgb(0, 0, 0);--action-button-content-color-focus: rgb(0, 0, 0);--action-button-content-color-disabled: rgba(0, 0, 0, .55);--action-button-focus-indicator-color: rgb(0, 0, 0)}:host([static-color=black][selected]){--action-button-background-color-default: rgba(0, 0, 0, .9);--action-button-background-color-hover: rgb(0, 0, 0);--action-button-background-color-down: rgb(0, 0, 0);--action-button-background-color-focus: rgb(0, 0, 0);--action-button-background-color-disabled: rgba(0, 0, 0, .1);--action-button-border-color-disabled: transparent;--action-button-content-color-default: rgb(255, 255, 255);--action-button-content-color-hover: rgb(255, 255, 255);--action-button-content-color-down: rgb(255, 255, 255);--action-button-content-color-focus: rgb(255, 255, 255)}:host([static-color=black][selected][emphasized]){--action-button-background-color-default: rgba(0, 0, 0, .9);--action-button-background-color-hover: rgb(0, 0, 0);--action-button-background-color-down: rgb(0, 0, 0);--action-button-background-color-focus: rgb(0, 0, 0);--action-button-content-color-default: rgb(255, 255, 255);--action-button-content-color-hover: rgb(255, 255, 255);--action-button-content-color-down: rgb(255, 255, 255);--action-button-content-color-focus: rgb(255, 255, 255)}:host([static-color=white]){--action-button-background-color-default: transparent;--action-button-background-color-hover: rgba(255, 255, 255, .25);--action-button-background-color-down: rgba(255, 255, 255, .4);--action-button-background-color-focus: rgba(255, 255, 255, .25);--action-button-background-color-disabled: transparent;--action-button-border-color-default: rgba(255, 255, 255, .4);--action-button-border-color-hover: rgba(255, 255, 255, .55);--action-button-border-color-down: rgba(255, 255, 255, .7);--action-button-border-color-focus: rgba(255, 255, 255, .55);--action-button-border-color-disabled: rgba(255, 255, 255, .25);--action-button-content-color-default: rgb(255, 255, 255);--action-button-content-color-hover: rgb(255, 255, 255);--action-button-content-color-down: rgb(255, 255, 255);--action-button-content-color-focus: rgb(255, 255, 255);--action-button-content-color-disabled: rgba(255, 255, 255, .55);--action-button-focus-indicator-color: rgb(255, 255, 255)}:host([static-color=white][selected]){--action-button-background-color-default: rgba(255, 255, 255, .9);--action-button-background-color-hover: rgb(255, 255, 255);--action-button-background-color-down: rgb(255, 255, 255);--action-button-background-color-focus: rgb(255, 255, 255);--action-button-background-color-disabled: rgba(255, 255, 255, .1);--action-button-border-color-disabled: transparent;--action-button-content-color-default: rgb(0, 0, 0);--action-button-content-color-hover: rgb(0, 0, 0);--action-button-content-color-down: rgb(0, 0, 0);--action-button-content-color-focus: rgb(0, 0, 0)}:host([static-color=white][selected][emphasized]){--action-button-background-color-default: rgba(255, 255, 255, .9);--action-button-background-color-hover: rgb(255, 255, 255);--action-button-background-color-down: rgb(255, 255, 255);--action-button-background-color-focus: rgb(255, 255, 255);--action-button-content-color-default: rgb(0, 0, 0)}:host{--action-button-min-width: var(--luzmo-component-height);--action-button-height: var(--luzmo-component-height);--action-button-icon-size: var(--luzmo-font-size-l);--action-button-font-size: var(--luzmo-font-size);--action-button-text-to-visual: var(--luzmo-spacing-2);--action-button-edge-to-hold-icon: var(--luzmo-spacing-2);--action-button-edge-to-visual-size: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--action-button-edge-to-visual-only-size: var(--luzmo-spacing-3);--action-button-edge-to-text-size: 12px;--action-button-corner-triangle-size: calc( var(--luzmo-spacing-2) + var(--luzmo-spacing-1) )}:host([size=xs]){--action-button-min-width: var(--luzmo-component-height-xs);--action-button-height: var(--luzmo-component-height-xs);--action-button-icon-size: var(--luzmo-font-size-s);--action-button-font-size: var(--luzmo-font-size-xs);--action-button-text-to-visual: calc( var(--luzmo-spacing-2) + var(--luzmo-spacing-1) );--action-button-edge-to-hold-icon: var(--luzmo-spacing-2);--action-button-edge-to-visual-size: calc( var(--luzmo-spacing-2) + var(--luzmo-spacing-1) );--action-button-edge-to-visual-only-size: var(--luzmo-spacing-2);--action-button-edge-to-text-size: var(--luzmo-spacing-2);--action-button-corner-triangle-size: var(--luzmo-spacing-2)}:host([size=s]){--action-button-min-width: var(--luzmo-component-height-s);--action-button-height: var(--luzmo-component-height-s);--action-button-icon-size: var(--luzmo-font-size);--action-button-font-size: var(--luzmo-font-size-s);--action-button-text-to-visual: var(--luzmo-spacing-3);--action-button-edge-to-hold-icon: var(--luzmo-spacing-2);--action-button-edge-to-visual-size: var(--luzmo-spacing-3);--action-button-edge-to-visual-only-size: var(--luzmo-spacing-2);--action-button-edge-to-text-size: var(--luzmo-spacing-3);--action-button-corner-triangle-size: var(--luzmo-spacing-2)}:host([size=l]){--action-button-min-width: var(--luzmo-component-height-l);--action-button-height: var(--luzmo-component-height-l);--action-button-icon-size: var(--luzmo-font-size-xl);--action-button-font-size: var(--luzmo-font-size-l);--action-button-text-to-visual: var(--luzmo-spacing-3);--action-button-edge-to-hold-icon: var(--luzmo-spacing-2);--action-button-edge-to-visual-size: var(--luzmo-spacing-4);--action-button-edge-to-visual-only-size: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--action-button-edge-to-text-size: var(--luzmo-spacing-5);--action-button-corner-triangle-size: var(--luzmo-spacing-3)}:host([size=xl]){--action-button-min-width: var(--luzmo-component-height-xl);--action-button-height: var(--luzmo-component-height-xl);--action-button-icon-size: var(--luzmo-font-size-xxl);--action-button-font-size: var(--luzmo-font-size-xl);--action-button-text-to-visual: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--action-button-edge-to-hold-icon: calc( var(--luzmo-spacing-2) + var(--luzmo-spacing-1) );--action-button-edge-to-visual-size: var(--luzmo-spacing-5);--action-button-edge-to-visual-only-size: var(--luzmo-spacing-4);--action-button-edge-to-text-size: var(--luzmo-spacing-5);--action-button-corner-triangle-size: var(--luzmo-spacing-3)}::slotted([slot=icon]){flex-shrink:0}#label{flex-grow:var(--action-button-label-flex-grow);text-align:var(--action-button-label-text-align);pointer-events:none!important}:host([size=xs]){min-width:var(--action-button-height, 0);--action-button-edge-to-visual-only: calc( var(--luzmo-spacing-2) - var(--action-button-border-width) )}:host([size=s]){--action-button-edge-to-visual-only: calc( var(--luzmo-spacing-2) - var(--action-button-border-width) )}:host([size=m]){--action-button-edge-to-visual-only: calc( var(--luzmo-spacing-2) + var(--luzmo-spacing-1) - var(--action-button-border-width) )}:host([size=l]){--action-button-edge-to-visual-only: calc( var(--luzmo-spacing-3) - var(--action-button-border-width) )}:host([size=xl]){--action-button-edge-to-visual-only: calc( var(--luzmo-spacing-4) - var(--action-button-border-width) )}@media (forced-colors: active){:host{--highcontrast-action-button-border-color-disabled: GrayText;--highcontrast-action-button-content-color-disabled: GrayText}}';
24
+ var f = Object.defineProperty, p = Object.getOwnPropertyDescriptor, c = (i, o, t, n) => {
25
+ for (var e = n > 1 ? void 0 : n ? p(o, t) : o, u = i.length - 1, l; u >= 0; u--)
26
+ (l = i[u]) && (e = (n ? l(o, t, e) : l(e)) || e);
27
+ return n && e && f(o, t, e), e;
28
+ };
29
+ const k = 300;
30
+ let b;
31
+ class a extends v(m, {
32
+ validSizes: ["xs", "s", "m", "l", "xl"],
33
+ noDefaultSize: !0
34
+ }) {
35
+ constructor() {
36
+ super(), this.emphasized = !1, this.holdAffordance = !1, this.quiet = !1, this.role = "button", this.selected = !1, this.toggles = !1, this._value = "", this.onClick = () => {
37
+ if (!this.toggles)
38
+ return;
39
+ this.selected = !this.selected, this.dispatchEvent(
40
+ new Event("change", {
41
+ cancelable: !0,
42
+ bubbles: !0,
43
+ composed: !0
44
+ })
45
+ ) || (this.selected = !this.selected);
46
+ }, this.addEventListener("click", this.onClick);
47
+ }
48
+ static get styles() {
49
+ return [...super.styles, h(z)];
50
+ }
51
+ get value() {
52
+ return this._value || this.itemText;
53
+ }
54
+ set value(o) {
55
+ o !== this._value && (this._value = o || "", this._value ? this.setAttribute("value", this._value) : this.removeAttribute("value"));
56
+ }
57
+ /**
58
+ * @private
59
+ */
60
+ get itemText() {
61
+ return (this.textContent || /* c8 ignore next */
62
+ "").trim();
63
+ }
64
+ handlePointerdownHoldAffordance(o) {
65
+ o.button === 0 && (this.addEventListener("pointerup", this.handlePointerupHoldAffordance), this.addEventListener("pointercancel", this.handlePointerupHoldAffordance), b = setTimeout(() => {
66
+ this.dispatchEvent(
67
+ new CustomEvent("longpress", {
68
+ bubbles: !0,
69
+ composed: !0,
70
+ detail: {
71
+ source: "pointer"
72
+ }
73
+ })
74
+ );
75
+ }, k));
76
+ }
77
+ handlePointerupHoldAffordance() {
78
+ clearTimeout(b), this.removeEventListener("pointerup", this.handlePointerupHoldAffordance), this.removeEventListener(
79
+ "pointercancel",
80
+ this.handlePointerupHoldAffordance
81
+ );
82
+ }
83
+ /**
84
+ * @private
85
+ */
86
+ handleKeydown(o) {
87
+ if (!this.holdAffordance)
88
+ return super.handleKeydown(o);
89
+ const { code: t, altKey: n } = o;
90
+ (t === "Space" || n && t === "ArrowDown") && (o.preventDefault(), t === "ArrowDown" && (o.stopPropagation(), o.stopImmediatePropagation()), this.addEventListener("keyup", this.handleKeyup), this.active = !0);
91
+ }
92
+ handleKeyup(o) {
93
+ if (!this.holdAffordance)
94
+ return super.handleKeyup(o);
95
+ const { code: t, altKey: n } = o;
96
+ (t === "Space" || n && t === "ArrowDown") && (o.stopPropagation(), this.dispatchEvent(
97
+ new CustomEvent("longpress", {
98
+ bubbles: !0,
99
+ composed: !0,
100
+ detail: {
101
+ source: "keyboard"
102
+ }
103
+ })
104
+ ), this.active = !1);
105
+ }
106
+ get buttonContent() {
107
+ const o = super.buttonContent;
108
+ return this.holdAffordance && o.unshift(g`
109
+ <div
110
+ class="hold-affordance corner-triangle-${this.size}"
111
+ >
112
+ ${d(s)}
113
+ </div>
114
+ `), o;
115
+ }
116
+ updated(o) {
117
+ super.updated(o);
118
+ const t = this.role === "button", n = t && (this.selected || this.toggles) && !(this.hasAttribute("aria-haspopup") && this.hasAttribute("aria-expanded"));
119
+ (o.has("selected") || o.has("role")) && (n ? this.setAttribute("aria-pressed", this.selected ? "true" : "false") : (this.removeAttribute("aria-pressed"), t && this.toggles && this.hasAttribute("aria-expanded") && this.setAttribute("aria-expanded", this.selected ? "true" : "false"))), o.has("holdAffordance") && (this.holdAffordance ? this.addEventListener(
120
+ "pointerdown",
121
+ this.handlePointerdownHoldAffordance
122
+ ) : (this.removeEventListener(
123
+ "pointerdown",
124
+ this.handlePointerdownHoldAffordance
125
+ ), this.handlePointerupHoldAffordance()));
126
+ }
127
+ }
128
+ c([
129
+ r({ type: Boolean, reflect: !0 })
130
+ ], a.prototype, "emphasized", 2);
131
+ c([
132
+ r({ type: Boolean, reflect: !0, attribute: "hold-affordance" })
133
+ ], a.prototype, "holdAffordance", 2);
134
+ c([
135
+ r({ type: Boolean, reflect: !0 })
136
+ ], a.prototype, "quiet", 2);
137
+ c([
138
+ r({ reflect: !0 })
139
+ ], a.prototype, "role", 2);
140
+ c([
141
+ r({ type: Boolean, reflect: !0 })
142
+ ], a.prototype, "selected", 2);
143
+ c([
144
+ r({ type: Boolean, reflect: !0 })
145
+ ], a.prototype, "toggles", 2);
146
+ c([
147
+ r({ reflect: !0, attribute: "static-color" })
148
+ ], a.prototype, "staticColor", 2);
149
+ c([
150
+ r({ type: String })
151
+ ], a.prototype, "value", 1);
152
+ customElements.get("luzmo-action-button") || customElements.define("luzmo-action-button", a);
153
+ export {
154
+ a as L
155
+ };
@@ -0,0 +1,106 @@
1
+ /*! * A kit of modern Luzmo Web Components for analytics in your web application.
2
+ *
3
+ * Copyright © 2024 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 { S as d, a as g, L as p, r as c, o as m, x as u, n as r } from "./if-defined-BbzmSG-O.js";
21
+ import "./index-Bd4cKS9O.js";
22
+ import "./index-CtEJZdT0.js";
23
+ import "./index-C9xEN5Ji.js";
24
+ import { C as h, h as v } from "./index-DdtjeKYI.js";
25
+ import { r as z } from "./directive-helpers-eY1rHtyn.js";
26
+ const b = ":host .settings-container{display:flex;flex-direction:column;gap:var(--luzmo-spacing-2)}:host .settings-row{display:flex;justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-grand-totals-gap, var(--display-settings-grand-totals-gap))}:host{--display-settings-grand-totals-gap: var(--luzmo-spacing-3)}:host([size=s]){--display-settings-grand-totals-gap: var(--luzmo-spacing-3)}:host([size=l]){--display-settings-grand-totals-gap: var(--luzmo-spacing-4)}:host([size=xl]){--display-settings-grand-totals-gap: var(--luzmo-spacing-5)}";
27
+ var f = Object.defineProperty, o = (n, t, e, y) => {
28
+ for (var s = void 0, l = n.length - 1, i; l >= 0; l--)
29
+ (i = n[l]) && (s = i(t, e, s) || s);
30
+ return s && f(t, e, s), s;
31
+ };
32
+ class a extends d(p, {
33
+ validSizes: Object.values(g)
34
+ }) {
35
+ constructor() {
36
+ super(...arguments), this.slotContent = {};
37
+ }
38
+ static get styles() {
39
+ return [c(b)];
40
+ }
41
+ willUpdate(t) {
42
+ var e;
43
+ t.has("slotContent") && (this._enabled = ((e = this.slotContent) == null ? void 0 : e.grandTotals) ?? !1);
44
+ }
45
+ toggleGrandTotals() {
46
+ this._enabled = !this._enabled, this.sendEvent();
47
+ }
48
+ sendEvent() {
49
+ const t = {
50
+ enabled: !!this._enabled
51
+ };
52
+ this.dispatchEvent(
53
+ new CustomEvent("slot-content-changed", {
54
+ bubbles: !0,
55
+ composed: !0,
56
+ cancelable: !0,
57
+ detail: {
58
+ slotContent: {
59
+ ...this.slotContent,
60
+ grandTotals: t
61
+ }
62
+ }
63
+ })
64
+ );
65
+ }
66
+ render() {
67
+ return u`<div class="settings-container">
68
+ <div class="settings-row">
69
+ <div class="setting">
70
+ <luzmo-field-label for="grand-totals">Grand totals</luzmo-field-label>
71
+ <luzmo-action-button
72
+ id="grand-totals"
73
+ toggles
74
+ emphasized
75
+ .size=${this.size}
76
+ ?selected=${this._enabled}
77
+ class=${m(this._enabled ? "active" : "inactive")}
78
+ @click=${this.toggleGrandTotals}
79
+ >
80
+ <luzmo-icon
81
+ slot="icon"
82
+ .icon=${this._enabled ? h : v}
83
+ ></luzmo-icon>
84
+ ${this._enabled ? "Enabled" : "Disabled"}
85
+ </luzmo-action-button>
86
+ </div>
87
+ </div>
88
+ </div>`;
89
+ }
90
+ }
91
+ o([
92
+ r({ type: String, reflect: !0 })
93
+ ], a.prototype, "language");
94
+ o([
95
+ r()
96
+ ], a.prototype, "slotContent");
97
+ o([
98
+ z()
99
+ ], a.prototype, "_enabled");
100
+ customElements.get("luzmo-display-settings-grand-totals") || customElements.define(
101
+ "luzmo-display-settings-grand-totals",
102
+ a
103
+ );
104
+ export {
105
+ a as LuzmoDisplaySettingsGrandTotals
106
+ };