@luzmo/analytics-components-kit 1.2.1 → 1.4.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 (159) hide show
  1. package/README.md +8 -3
  2. package/angular/components/add-to-dashboard.ts +20 -6
  3. package/angular/components/data-fields-select.ts +5 -0
  4. package/angular/components/interactive-viz-item.ts +89 -24
  5. package/angular/components/item-grid-item-actions-menu.ts +5 -0
  6. package/angular/components/item-grid.ts +7 -0
  7. package/angular/components/item-option-color-picker.ts +28 -28
  8. package/angular/components/item-option-guidelines.ts +22 -1
  9. package/angular/components/item-option-multi-language-field.ts +7 -7
  10. package/angular/components/item-option-number-field.ts +14 -14
  11. package/angular/components/item-option-positions-number-field.ts +14 -14
  12. package/angular/components/item-option-radio-button-group.ts +7 -7
  13. package/angular/components/item-option-text-field.ts +7 -7
  14. package/angular/components/item-slot-picker-panel.ts +1 -1
  15. package/angular/components/item-slot-picker.ts +7 -7
  16. package/angular/esm/components/add-to-dashboard.d.ts +8 -4
  17. package/angular/esm/components/add-to-dashboard.js +23 -7
  18. package/angular/esm/components/data-fields-select.d.ts +2 -0
  19. package/angular/esm/components/data-fields-select.js +4 -0
  20. package/angular/esm/components/interactive-viz-item.d.ts +32 -11
  21. package/angular/esm/components/interactive-viz-item.js +99 -28
  22. package/angular/esm/components/item-grid-item-actions-menu.d.ts +2 -0
  23. package/angular/esm/components/item-grid-item-actions-menu.js +4 -0
  24. package/angular/esm/components/item-grid.d.ts +3 -1
  25. package/angular/esm/components/item-grid.js +9 -1
  26. package/angular/esm/components/item-option-color-picker.d.ts +10 -10
  27. package/angular/esm/components/item-option-color-picker.js +34 -34
  28. package/angular/esm/components/item-option-guidelines.d.ts +8 -2
  29. package/angular/esm/components/item-option-guidelines.js +26 -2
  30. package/angular/esm/components/item-option-multi-language-field.d.ts +3 -3
  31. package/angular/esm/components/item-option-multi-language-field.js +10 -10
  32. package/angular/esm/components/item-option-number-field.d.ts +5 -5
  33. package/angular/esm/components/item-option-number-field.js +18 -18
  34. package/angular/esm/components/item-option-positions-number-field.d.ts +5 -5
  35. package/angular/esm/components/item-option-positions-number-field.js +18 -18
  36. package/angular/esm/components/item-option-radio-button-group.d.ts +3 -3
  37. package/angular/esm/components/item-option-radio-button-group.js +10 -10
  38. package/angular/esm/components/item-option-text-field.d.ts +3 -3
  39. package/angular/esm/components/item-option-text-field.js +10 -10
  40. package/angular/esm/components/item-slot-picker-panel.d.ts +1 -1
  41. package/angular/esm/components/item-slot-picker-panel.js +1 -1
  42. package/angular/esm/components/item-slot-picker.d.ts +3 -3
  43. package/angular/esm/components/item-slot-picker.js +9 -9
  44. package/angular/package.json +2 -2
  45. package/components/add-to-dashboard/dashboard-actions.d.ts +2 -1
  46. package/components/add-to-dashboard/index.cjs +1 -1
  47. package/components/add-to-dashboard/index.js +1 -1
  48. package/components/{add-to-dashboard-NwsCPIlg.cjs → add-to-dashboard-BtzTZdjN.cjs} +1 -1
  49. package/components/{add-to-dashboard-NcVHlqrc.js → add-to-dashboard-Bu6S3qVz.js} +125 -120
  50. package/components/chart-helpers-BHxQbLBw.cjs +20 -0
  51. package/components/{chart-helpers-Dng_LGfq.js → chart-helpers-BKeMLhov.js} +53 -39
  52. package/components/filters/index.cjs +1 -1
  53. package/components/filters/index.js +1 -1
  54. package/components/{filters-CxIzuI5q.js → filters-DEpmh9Nj.js} +113 -102
  55. package/components/filters-LDXhe1Bp.cjs +187 -0
  56. package/components/index.cjs +1 -1
  57. package/components/index.js +6 -6
  58. package/components/interactive-viz-item/helpers/chart-helpers.d.ts +2 -1
  59. package/components/interactive-viz-item/index.cjs +1 -1
  60. package/components/interactive-viz-item/index.d.ts +1 -1
  61. package/components/interactive-viz-item/index.js +3 -3
  62. package/components/interactive-viz-item/interactive-viz-item.d.ts +47 -1
  63. package/components/interactive-viz-item/types.d.ts +4 -0
  64. package/components/interactive-viz-item-Cc3Ix95e.js +630 -0
  65. package/components/interactive-viz-item-SF12d97t.cjs +269 -0
  66. package/components/item-grid/item-grid.d.ts +1 -0
  67. package/components/item-slot-picker-panel/index.cjs +1 -1
  68. package/components/item-slot-picker-panel/index.js +1 -1
  69. package/components/item-slot-picker-panel/item-slot-picker-panel.d.ts +19 -1
  70. package/components/item-slot-picker-panel-Cw3UCK03.cjs +84 -0
  71. package/components/{item-slot-picker-panel-fJqEmxeD.js → item-slot-picker-panel-DprM9Rli.js} +64 -33
  72. package/custom-elements.json +3051 -2531
  73. package/grid-core/item-grid-base.d.ts +5 -4
  74. package/package.json +2 -2
  75. package/react/package.json +2 -2
  76. package/standalone/add-to-dashboard.js +40 -40
  77. package/standalone/chunks/{chart-helpers-DsIGsaDc.js → chart-helpers-DZsidiCl.js} +2 -2
  78. package/standalone/chunks/{choropleth-map-options.config-rUJsEJcm.js → choropleth-map-options.config-CDMjKnJD.js} +1 -1
  79. package/standalone/chunks/{color-range-utils-DxOtqAKB.js → color-range-utils-BVyHBRiq.js} +1 -1
  80. package/standalone/chunks/data-broker-DpSrH3IP.js +2 -0
  81. package/standalone/chunks/de-BkB0q1Eg.js +2 -0
  82. package/standalone/chunks/display-settings-binning-DhHlclWH.js +38 -0
  83. package/standalone/chunks/display-settings-datetime-C8xvOvi4.js +199 -0
  84. package/standalone/chunks/display-settings-grand-totals-CUpigDcs.js +26 -0
  85. package/standalone/chunks/display-settings-numeric-BLWF54Jx.js +172 -0
  86. package/standalone/chunks/display-settings-period-over-period-COd4tvUw.js +209 -0
  87. package/standalone/chunks/embed-Bv1ps-EM.js +260 -0
  88. package/standalone/chunks/en-DNsyAwgq.js +2 -0
  89. package/standalone/chunks/en-GB-Di3OzVdL.js +2 -0
  90. package/standalone/chunks/en-US-DNsyAwgq.js +2 -0
  91. package/standalone/chunks/es-Bo0jStZn.js +2 -0
  92. package/standalone/chunks/{filters-DKgJcQGP.js → filters-lhg_WVDK.js} +108 -108
  93. package/standalone/chunks/{formula-codemirror-BbyvNEVD.js → formula-codemirror-DZMzLE2I.js} +17 -17
  94. package/standalone/chunks/fr-Co_qVhhV.js +2 -0
  95. package/standalone/chunks/{heat-map-options.config-D93AeYFi.js → heat-map-options.config-DDQMD38W.js} +1 -1
  96. package/standalone/chunks/{heat-table-options.config-ZVML76FK.js → heat-table-options.config-B4K0Ygug.js} +1 -1
  97. package/standalone/chunks/{is-same-option-value-Di-A7Wmg.js → is-same-option-value-7kXNF4st.js} +1 -1
  98. package/standalone/chunks/item-option-action-button-group-Bl1HR1JK.js +35 -0
  99. package/standalone/chunks/item-option-base-DF24wTyv.js +38 -0
  100. package/standalone/chunks/item-option-color-palette-picker-MkIIn56p.js +22 -0
  101. package/standalone/chunks/item-option-color-picker-CxosMo_p.js +19 -0
  102. package/standalone/chunks/item-option-color-range-C7C70r4J.js +83 -0
  103. package/standalone/chunks/item-option-guidelines-iu8yWRzr.js +120 -0
  104. package/standalone/chunks/{item-option-multi-language-field-DPPpN2qg.js → item-option-multi-language-field-foanqCdr.js} +1 -1
  105. package/standalone/chunks/{item-option-number-field-CkqJjInE.js → item-option-number-field-ByVD4oq0.js} +1 -1
  106. package/standalone/chunks/item-option-panel-Bya-K7HH.js +316 -0
  107. package/standalone/chunks/{item-option-picker-BnwQPT9A.js → item-option-picker-CqNNVIML.js} +1 -1
  108. package/standalone/chunks/item-option-position-picker-BjCFVtDH.js +14 -0
  109. package/standalone/chunks/item-option-positions-number-field-BJJtXZL-.js +31 -0
  110. package/standalone/chunks/{item-option-radio-button-group-BkymJq3E.js → item-option-radio-button-group-C5bxsD85.js} +1 -1
  111. package/standalone/chunks/item-option-slider-DUXWz70B.js +18 -0
  112. package/standalone/chunks/item-option-switch-BHyJuOkP.js +12 -0
  113. package/standalone/chunks/{item-option-text-field-D7bkuhsv.js → item-option-text-field-rBZY9OX4.js} +1 -1
  114. package/standalone/chunks/{item-slot-picker-panel-D4BMxGs9.js → item-slot-picker-panel-BM82vSXi.js} +101 -99
  115. package/standalone/chunks/load-data-fields-for-datasets-DS9O1oyy.js +25 -0
  116. package/standalone/chunks/localize-DLl7tgQp.js +2 -0
  117. package/standalone/chunks/localized-decorator-DosMCCQo.js +2 -0
  118. package/standalone/chunks/{version-BW4Ixl63.js → localized-mixin-BWJj88bd.js} +1 -1
  119. package/standalone/chunks/nl-CQz2jrVx.js +2 -0
  120. package/standalone/chunks/{option-interaction-controller-BslAXAHF.js → option-interaction-controller-BuwRr21c.js} +1 -1
  121. package/standalone/chunks/{route-map-options.config-Dwy0JSVq.js → route-map-options.config-CGBkHnhM.js} +1 -1
  122. package/standalone/chunks/{spike-map-options.config-DFmuNxym.js → spike-map-options.config-CSenlJ_F.js} +1 -1
  123. package/standalone/interactive-viz-item.js +88 -84
  124. package/standalone/item-grid.js +10 -10
  125. package/standalone/manifest.json +46 -46
  126. package/types.d.ts +1 -1
  127. package/components/chart-helpers-ufZ6VbXs.cjs +0 -20
  128. package/components/filters-BPbPFOu5.cjs +0 -187
  129. package/components/interactive-viz-item-CwRRaCZB.js +0 -583
  130. package/components/interactive-viz-item-CxdrGRKc.cjs +0 -265
  131. package/components/item-slot-picker-panel-BhhN54IM.cjs +0 -82
  132. package/standalone/chunks/data-broker-DXDyIrj_.js +0 -2
  133. package/standalone/chunks/de-mdZT2W1G.js +0 -2
  134. package/standalone/chunks/display-settings-binning-Byffw2Kl.js +0 -38
  135. package/standalone/chunks/display-settings-datetime-CD52d6Sv.js +0 -199
  136. package/standalone/chunks/display-settings-grand-totals-Cky99LX9.js +0 -26
  137. package/standalone/chunks/display-settings-numeric-C9ea7Tgc.js +0 -172
  138. package/standalone/chunks/display-settings-period-over-period-BLSGumkD.js +0 -209
  139. package/standalone/chunks/embed-CBu7iQRx.js +0 -231
  140. package/standalone/chunks/en-CSboh17P.js +0 -2
  141. package/standalone/chunks/en-GB-HoXKQBOY.js +0 -2
  142. package/standalone/chunks/en-US-CSboh17P.js +0 -2
  143. package/standalone/chunks/es-Di5D8JFd.js +0 -2
  144. package/standalone/chunks/fr-DZku7iB9.js +0 -2
  145. package/standalone/chunks/item-option-action-button-group-BEAwPHVw.js +0 -35
  146. package/standalone/chunks/item-option-base-CRUxNhJQ.js +0 -38
  147. package/standalone/chunks/item-option-color-palette-picker-CBz61iZb.js +0 -22
  148. package/standalone/chunks/item-option-color-picker-lLvBPnKA.js +0 -19
  149. package/standalone/chunks/item-option-color-range-BqeatOei.js +0 -83
  150. package/standalone/chunks/item-option-guidelines-Cop8rM8y.js +0 -120
  151. package/standalone/chunks/item-option-panel-CzSKFCVl.js +0 -316
  152. package/standalone/chunks/item-option-position-picker-Bkc4JvJX.js +0 -14
  153. package/standalone/chunks/item-option-positions-number-field-Dr_315TE.js +0 -31
  154. package/standalone/chunks/item-option-slider-K_bsNci8.js +0 -18
  155. package/standalone/chunks/item-option-switch-DeihDHhM.js +0 -12
  156. package/standalone/chunks/load-data-fields-for-datasets-ClctSj6y.js +0 -25
  157. package/standalone/chunks/localize-DXRmGRe-.js +0 -2
  158. package/standalone/chunks/localized-decorator-DJVBmJVH.js +0 -2
  159. package/standalone/chunks/nl-CViTevL3.js +0 -2
@@ -1,199 +0,0 @@
1
-
2
- import{i as e,n as t,r as n}from"./version-BW4Ixl63.js";import{t as r}from"./localized-decorator-DJVBmJVH.js";import{i,o as a,s as o}from"./load-data-fields-for-datasets-ClctSj6y.js";import{n as s,t as c}from"./luzmoCheckbox-BksyONqE.js";import{d as l,f as u,p as d}from"./chart-helpers-DsIGsaDc.js";import{t as f}from"./task-BlhDPTQS.js";import{g as p,m}from"./item-slot-picker-panel-D4BMxGs9.js";import{html as h,property as g,query as _,unsafeCSS as v}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/icon.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/progress-circle.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/action-group.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/number-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/picker.js";var y={"~":()=>e(`Auto`,{desc:`Automatic setting of the option`}),"/":()=>`/`,"-":()=>`-`,".":()=>`.`},b=`:host{font-family:var(--luzmo-display-settings-datetime-font-family,var(--luzmo-font-family))}:host .settings-container{gap:var(--luzmo-display-settings-vertical-gap,var(--luzmo-spacing-2));flex-direction:column;display:flex}:host .settings-row{justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-datetime-gap,var(--display-settings-datetime-gap));display:flex}:host{--display-settings-datetime-example-font-size:var(--luzmo-font-size-s);--display-settings-datetime-example-color:var(--luzmo-font-color);--display-settings-datetime-example-label-font-weight:bold;--display-settings-datetime-example-label-color:var(--luzmo-primary);--display-settings-datetime-example-language-color:var(--luzmo-primary);--display-settings-datetime-gap:var(--luzmo-spacing-3);--display-settings-datetime-example-height:var(--luzmo-component-height)}:host([size=s]){--display-settings-datetime-gap:var(--luzmo-spacing-3);--display-settings-datetime-example-height:var(--luzmo-component-height-s);--display-settings-datetime-example-font-size:var(--luzmo-font-size-s)}:host([size=l]){--display-settings-datetime-gap:var(--luzmo-spacing-4);--display-settings-datetime-example-height:var(--luzmo-component-height-l);--display-settings-datetime-example-font-size:var(--luzmo-font-size)}:host([size=xl]){--display-settings-datetime-gap:var(--luzmo-spacing-5);--display-settings-datetime-example-height:var(--luzmo-component-height-xl);--display-settings-datetime-example-font-size:var(--luzmo-font-size-l)}`,x=class extends t(u(d,{validSizes:Object.values(l)})){constructor(...e){super(...e),this._loadLocaleFormatsConfig=new f(this,{task:async([e])=>{if(e&&e!==this._contentLanguageLoaded){let t=/* #__PURE__ */ Object.assign({"../../utils/formatter/formats/cs.ts":()=>import(`./cs-DLnr3a23.js`),"../../utils/formatter/formats/da.ts":()=>import(`./da-BJgbo0uE.js`),"../../utils/formatter/formats/de.ts":()=>import(`./de-DPgYMyja.js`),"../../utils/formatter/formats/en-GB.ts":()=>import(`./en-GB-HoXKQBOY.js`),"../../utils/formatter/formats/en-US.ts":()=>import(`./en-US-CSboh17P.js`),"../../utils/formatter/formats/en.ts":()=>import(`./en-CSboh17P.js`),"../../utils/formatter/formats/es.ts":()=>import(`./es-Dp1UuDDz.js`),"../../utils/formatter/formats/fi.ts":()=>import(`./fi-CLQ6vC7V.js`),"../../utils/formatter/formats/fr.ts":()=>import(`./fr-D8xrUEX4.js`),"../../utils/formatter/formats/he.ts":()=>import(`./he-DHPb0VBo.js`),"../../utils/formatter/formats/hu.ts":()=>import(`./hu-BpaYooip.js`),"../../utils/formatter/formats/it.ts":()=>import(`./it-DWTvD2Xn.js`),"../../utils/formatter/formats/ja.ts":()=>import(`./ja-CtDlXHD1.js`),"../../utils/formatter/formats/ko.ts":()=>import(`./ko-CekuHU50.js`),"../../utils/formatter/formats/mk.ts":()=>import(`./mk-Dq3YK4jD.js`),"../../utils/formatter/formats/nl.ts":()=>import(`./nl-7csxtU-I.js`),"../../utils/formatter/formats/no.ts":()=>import(`./no-DJNRx8au.js`),"../../utils/formatter/formats/pl.ts":()=>import(`./pl-zDnuk9Gd.js`),"../../utils/formatter/formats/pt.ts":()=>import(`./pt-BEVAH5AJ.js`),"../../utils/formatter/formats/ru.ts":()=>import(`./ru-Ceji1Fqk.js`),"../../utils/formatter/formats/sv.ts":()=>import(`./sv-CgssnOqA.js`),"../../utils/formatter/formats/tr.ts":()=>import(`./tr-i3G2sFi4.js`),"../../utils/formatter/formats/zh-CN.ts":()=>import(`./zh-CN-NVnv57dz.js`),"../../utils/formatter/formats/zh-TW.ts":()=>import(`./zh-TW-NVnv57dz.js`)});if(t[`../../utils/formatter/formats/${e}.ts`]){let n=await t[`../../utils/formatter/formats/${e}.ts`]();this._localeFormats=n?.default??{}}return this._contentLanguageLoaded=e,this._localeFormats}},args:()=>[this.contentLanguage]}),this.contentLanguage=`en`,this.size=`m`,this.slotContent={},this._dateLevel=5,this._displayAs=`default`,this._weekStart=`monday`,this._weekDayAndMonthInYearFormat=`long`,this._dateFormat=`auto`,this._dateSeparator=`~`,this._sendEvent=()=>{this._calculateSlotContent(),this.dispatchEvent(new CustomEvent(`luzmo-slot-content-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:this._currentSlotContent}}))}}static get styles(){return[v(b)]}_parseSlotContent(){this._dateLevel=this.slotContent?.level??this.slotContent?.lowestLevel??5,this._displayAs=this.slotContent?.datetimeDisplayMode??`default`,this._displayAs===`weekday_number`&&(this._displayAs=`day_in_week`,this._weekDayAndMonthInYearFormat=`number`),this._displayAs===`weekday_name`&&(this._displayAs=`day_in_week`),this._displayAs===`month_number`&&(this._displayAs=`month_in_year`,this._weekDayAndMonthInYearFormat=`number`),this._displayAs===`month_name`&&(this._displayAs=`month_in_year`),this._parseSavedFormat()}_parseSavedFormat(){let e=this.slotContent?.format??`%d-%m-%Y`,t=e.match(/[./-]/);if(this._dateSeparator=e.includes(`~`)?`~`:t?.[0]??`~`,e.includes(`%amd`))this._dateFormat=`auto`;else{let t=e.indexOf(`%d`),n=e.indexOf(`%m`);t!==-1&&n!==-1&&(this._dateFormat=t<n?`ddmm`:`mmdd`)}this._24hFormat=e.includes(`%H`),this._monthName=/%B|%b/.test(e),this._weekDay=/%a|%A/.test(e),this._monthName&&(this._monthNameFormat=e.includes(`%b`)?`short`:`long`),this._weekDay&&(this._weekDayAndMonthInYearFormat=e.includes(`%a`)?`short`:`long`);let n=this._dateLevel===5&&this.slotContent?.weekDayNameFormat||this._dateLevel===3&&this.slotContent?.monthNameFormat;n&&(this._weekDayAndMonthInYearFormat=n)}_calculateFormat(){let e,t=this._localeFormats?.smartDateFormats??p;this._monthName?(e=t.filter(e=>e.monthType===`name`&&e.longText===(this._monthNameFormat===`long`)&&e.weekday===this._weekDay),e.length>0?this._format=e[0].key:(this._weekDayAndMonthInYearFormat=`short`,this._weekDay=!0,this._format=`%a %e %B %Y`)):(e=this._dateLevel&&this._dateLevel===4?t.filter(e=>e.monthType===`number`&&e.mmdd===(this._weekFormat===`mmdd`||this._weekFormat!==`ddmm`&&null)&&e.separator===this._dateSeparator):t.filter(e=>e.monthType===`number`&&e.mmdd===(this._dateFormat===`mmdd`||this._dateFormat!==`ddmm`&&null)&&e.separator===this._dateSeparator),this._dateFormat===`auto`&&this._dateLevel&&this._dateLevel!==4?this._format=`%amd`+this._dateSeparator+`%Y`:e.length>0?this._format=e[0].key:(this._dateFormat=`ddmm`,this._dateSeparator=`/`,this._format=`%d/%m/%Y`)),this._dateLevel&&this._dateLevel>5&&(this._format+=this._24hFormat?` %H:%M:%S.%L`:` %I:%M:%S.%L %p`)}_setWeekStartsOn(){this._weekStart=this._weekStartElement.value,this._sendEvent(),this.requestUpdate()}_setDisplayAs(){this._displayAs=this._displayAsElement.value,this._sendEvent(),this.requestUpdate()}_setWeekdayAndMonthInYearFormat(){this._weekDayAndMonthInYearFormat=this._weekDayAndMonthInYearFormatElement.selected?.[0]??`long`,this._sendEvent(),this.requestUpdate()}_setMonthNameFormat(){this._monthNameFormat=this._monthNameFormatElement.selected?.[0],this._sendEvent(),this.requestUpdate()}_setMonthName(){this._monthName=this._monthNameElement.selected,this._sendEvent(),this.requestUpdate()}_setWeekFormat(){this._weekFormat=this._weekFormatElement.selected?.[0],this._sendEvent(),this.requestUpdate()}_setDateFormat(){this._dateFormat=this._dateFormatElement.value,this._sendEvent(),this.requestUpdate()}_setDateSeparator(){this._dateSeparator=this._dateSeparatorElement.value,this._sendEvent(),this.requestUpdate()}_set24hFormat(){this._24hFormat=this._format24hElement.selected,this._sendEvent(),this.requestUpdate()}_setWeekday(){this._weekDay=this._weekDayElement.selected,this._sendEvent(),this.requestUpdate()}_calculateSlotContent(){this._currentSlotContent={...this.slotContent},this._calculateFormat(),this._currentSlotContent.format=this._format,this._displayAs==="default"?delete this._currentSlotContent.datetimeDisplayMode:(this._currentSlotContent.datetimeDisplayMode=this._displayAs,this._displayAs===`week_in_year`?this._currentSlotContent.datetimeDisplayMode=this._weekDayAndMonthInYearFormat===`number`?`week_number`:`week_name`:this._displayAs===`month_in_year`?this._currentSlotContent.datetimeDisplayMode=this._weekDayAndMonthInYearFormat===`number`?`month_number`:`month_name`:this._displayAs===`day_in_week`&&(this._currentSlotContent.datetimeDisplayMode=this._weekDayAndMonthInYearFormat===`number`?`weekday_number`:`weekday_name`,this._currentSlotContent.weekStart=this._weekStart),this._weekDayAndMonthInYearFormat&&(this._dateLevel===3?this._currentSlotContent.monthNameFormat=this._weekDayAndMonthInYearFormat:this._dateLevel===5&&(this._currentSlotContent.weekDayNameFormat=this._weekDayAndMonthInYearFormat)))}willUpdate(e){super.willUpdate(e),e.has(`slotContent`)&&(this._parseSlotContent(),this._calculateSlotContent())}_renderDisplaySettings(){let t=i?.[`level${this._dateLevel??0}`]?.map(e=>h`<luzmo-menu-item value=${e.key}>
3
- ${e.i18n()}
4
- </luzmo-menu-item>`);return h`<div class="setting">
5
- <luzmo-field-label .size=${this.size} for="display-as"
6
- >${e(`Display`,{desc:`Label for display setting`})}</luzmo-field-label
7
- >
8
- <luzmo-picker
9
- id="display-as"
10
- size=${this.size}
11
- variant="highlight"
12
- value=${this._displayAs??`default`}
13
- @change=${this._setDisplayAs}
14
- >
15
- ${t}
16
- </luzmo-picker>
17
- </div>`}_renderWeekDayAndMonthNameFormatSettings(){let t=Object.keys(a).map(e=>h`<luzmo-action-button value=${e}>
18
- ${a[e]()}
19
- </luzmo-action-button>`);return h` <div class="setting">
20
- <luzmo-field-label .size=${this.size} for="weekday-and-month-in-year-format"
21
- >${e(`Format`,{desc:`Label for format setting`})}</luzmo-field-label
22
- >
23
- <luzmo-action-group
24
- emphasized
25
- id="weekday-and-month-in-year-format"
26
- size=${this.size}
27
- compact
28
- .selected=${[this._weekDayAndMonthInYearFormat??`short`]}
29
- selects="single"
30
- @change=${this._setWeekdayAndMonthInYearFormat}
31
- >
32
- ${t}
33
- </luzmo-action-group>
34
- </div>`}_renderMonthNameFormatSettings(){return h` <div class="setting">
35
- <luzmo-field-label .size=${this.size} for="month-name-format"
36
- >${e(`Format`,{desc:`Label for format setting`})}</luzmo-field-label
37
- >
38
- <luzmo-action-group
39
- emphasized
40
- id="month-name-format"
41
- size=${this.size}
42
- compact
43
- .selected=${[this._monthNameFormat??`long`]}
44
- selects="single"
45
- @change=${this._setMonthNameFormat}
46
- >
47
- <luzmo-action-button value="short">
48
- ${e(`Short`,{desc:`Short format option`})}
49
- </luzmo-action-button>
50
- <luzmo-action-button value="long">
51
- ${e(`Long`,{desc:`Long format option`})}
52
- </luzmo-action-button>
53
- </luzmo-action-group>
54
- </div>`}_renderWeekFormatSettings(){let t=this._localeFormats?.smartDateFormats??p,n=t.find(e=>e.mmdd===!0&&e.separator===this._dateSeparator&&e.monthType===`number`),r=t.find(e=>e.mmdd===!1&&e.separator===this._dateSeparator&&e.monthType===`number`);return h` <div class="setting">
55
- <luzmo-field-label .size=${this.size} for="week-format"
56
- >${e(`Format`,{desc:`Label for format setting`})}</luzmo-field-label
57
- >
58
- <luzmo-action-group
59
- emphasized
60
- id="week-format"
61
- size=${this.size}
62
- compact
63
- .selected=${[this._weekFormat??`ddmm`]}
64
- selects="single"
65
- @change=${this._setWeekFormat}
66
- >
67
- <luzmo-action-button value="ddmm">
68
- ${m({...this._currentSlotContent,type:`datetime`,format:r?.key},{localFormats:this._localeFormats,level:this._dateLevel})(/* @__PURE__ */ new Date)}
69
- </luzmo-action-button>
70
- <luzmo-action-button value="mmdd"
71
- >${m({...this._currentSlotContent,type:`datetime`,format:n?.key},{localFormats:this._localeFormats,level:this._dateLevel})(/* @__PURE__ */ new Date)}</luzmo-action-button
72
- >
73
- </luzmo-action-group>
74
- </div>`}_renderWeekStartsOnSettings(){let t=Object.keys(o).map(e=>h`<luzmo-menu-item value=${e}>
75
- ${o[e]()}
76
- </luzmo-menu-item>`);return h`<div class="setting">
77
- <luzmo-field-label .size=${this.size} for="week-start"
78
- >${e(`Week starts on`,{desc:`Label for week start setting`})}</luzmo-field-label
79
- >
80
- <luzmo-picker
81
- id="week-start"
82
- size=${this.size}
83
- variant="highlight"
84
- value=${this._weekStart??`Auto`}
85
- @change=${this._setWeekStartsOn}
86
- >
87
- ${t}
88
- </luzmo-picker>
89
- </div>`}_renderMonthNameSettings(){return h`<div class="settings-">
90
- <luzmo-field-label .size=${this.size} for="month-name"
91
- >${e(`Month`,{desc:`Time unit`})}</luzmo-field-label
92
- >
93
- <luzmo-action-button
94
- id="month-name"
95
- emphasized
96
- toggles
97
- .size=${this.size}
98
- ?selected=${this._monthName}
99
- @change=${this._setMonthName}
100
- >
101
- <luzmo-icon
102
- slot="icon"
103
- .size=${this.size}
104
- .icon=${this._monthName?s:c}
105
- ></luzmo-icon>
106
- ${e(`Name`)}
107
- </luzmo-action-button>
108
- </div>`}_renderDateFormatSettings(){let t=this._dateSeparator===`~`?`/`:this._dateSeparator;return h`<div class="setting">
109
- <luzmo-field-label .size=${this.size} for="date-format"
110
- >${e(`Format`,{desc:`Label for format setting`})}</luzmo-field-label
111
- >
112
- <luzmo-picker
113
- id="date-format"
114
- size=${this.size}
115
- variant="highlight"
116
- value=${this._dateFormat??`Auto`}
117
- @change=${this._setDateFormat}
118
- >
119
- <luzmo-menu-item value="auto">
120
- ${e(`Auto`,{desc:`Automatic setting of the option`})}
121
- </luzmo-menu-item>
122
- <luzmo-menu-item value="mmdd">12${t}31</luzmo-menu-item>
123
- <luzmo-menu-item value="ddmm">31${t}12</luzmo-menu-item>
124
- </luzmo-picker>
125
- </div>`}_renderSeparatorSettings(){let t=Object.keys(y).map(e=>h`<luzmo-menu-item value=${e}>
126
- ${y[e]()}
127
- </luzmo-menu-item>`);return h`<div class="setting">
128
- <luzmo-field-label .size=${this.size} for="date-separator"
129
- >${e(`Separator`,{desc:`Label for date separator setting`})}</luzmo-field-label
130
- >
131
- <luzmo-picker
132
- id="date-separator"
133
- size=${this.size}
134
- variant="highlight"
135
- value=${this._dateSeparator??`~`}
136
- @change=${this._setDateSeparator}
137
- >
138
- ${t}
139
- </luzmo-picker>
140
- </div>`}_render24hFormatSettings(){return h`<div class="settings-">
141
- <luzmo-field-label .size=${this.size} for="format-24h"
142
- >${e(`24h`,{desc:`Label for 24h format setting`})}</luzmo-field-label
143
- >
144
- <luzmo-action-button
145
- id="format-24h"
146
- emphasized
147
- toggles
148
- .size=${this.size}
149
- .label=${e(`Show`)}
150
- ?selected=${this._24hFormat}
151
- @change=${this._set24hFormat}
152
- >
153
- <luzmo-icon
154
- slot="icon"
155
- .size=${this.size}
156
- .icon=${this._24hFormat?s:c}
157
- ></luzmo-icon>
158
- </luzmo-action-button>
159
- </div>`}_renderWeekdaySettings(){return h`<div class="settings-">
160
- <luzmo-field-label .size=${this.size} for="weekday"
161
- >${e(`Weekday`,{desc:`Label for weekday setting`})}</luzmo-field-label
162
- >
163
- <luzmo-action-button
164
- id="weekday"
165
- emphasized
166
- toggles
167
- .size=${this.size}
168
- ?selected=${this._weekDay}
169
- @change=${this._setWeekday}
170
- >
171
- <luzmo-icon
172
- slot="icon"
173
- .size=${this.size}
174
- .icon=${this._weekDay?s:c}
175
- ></luzmo-icon>
176
- ${e(`Show`)}
177
- </luzmo-action-button>
178
- </div>`}_renderAllSettings(){return h`<div class="settings-container">
179
- ${this._dateLevel&&![1,9].includes(this._dateLevel)?h` <div class="settings-row">
180
- ${this._renderDisplaySettings()}
181
- ${this._dateLevel&&this._dateLevel>=5&&this._displayAs===`day_in_week`?this._renderWeekStartsOnSettings():``}
182
- </div>`:``}
183
- ${[`month_in_year`,`day_in_week`].includes(this._displayAs??``)?h` <div class="settings-row">
184
- ${this._renderWeekDayAndMonthNameFormatSettings()}
185
- </div>`:``}
186
- ${this._dateLevel&&this._dateLevel>1&&this._displayAs==="default"?h` <div class="settings-row">
187
- ${this._dateLevel&&this._dateLevel!==4&&this._dateLevel!==2?this._renderMonthNameSettings():``}
188
- ${this._dateLevel&&this._dateLevel!==4&&this._dateLevel>2&&this._monthName?this._renderMonthNameFormatSettings():``}
189
- ${this._dateLevel&&this._dateLevel===4&&!this._monthName?this._renderWeekFormatSettings():``}
190
- ${this._dateLevel&&this._dateLevel>=5&&!this._monthName?this._renderDateFormatSettings():``}
191
- ${this._dateLevel&&this._dateLevel>1&&!this._monthName?this._renderSeparatorSettings():``}
192
- ${this._dateLevel&&this._dateLevel>=5&&this._monthName?this._renderWeekdaySettings():``}
193
- ${this._dateLevel&&this._dateLevel>5?this._render24hFormatSettings():``}
194
- </div>`:``}
195
- </div>`}render(){return this._loadLocaleFormatsConfig.render({pending:()=>h`<luzmo-progress-circle
196
- indeterminate
197
- .label=${e(`Loading`,{desc:`Loading spinner label`})}
198
- .size=${this.size}
199
- ></luzmo-progress-circle>`,complete:()=>this._renderAllSettings(),error:()=>this._renderAllSettings()})}};n([g({type:String})],x.prototype,`contentLanguage`,void 0),n([g({type:String})],x.prototype,`size`,void 0),n([g({type:Object,reflect:!1})],x.prototype,`slotContent`,void 0),n([_(`#display-as`)],x.prototype,`_displayAsElement`,void 0),n([_(`#week-start`)],x.prototype,`_weekStartElement`,void 0),n([_(`#weekday-and-month-in-year-format`)],x.prototype,`_weekDayAndMonthInYearFormatElement`,void 0),n([_(`#month-name-format`)],x.prototype,`_monthNameFormatElement`,void 0),n([_(`#month-name`)],x.prototype,`_monthNameElement`,void 0),n([_(`#week-format`)],x.prototype,`_weekFormatElement`,void 0),n([_(`#date-format`)],x.prototype,`_dateFormatElement`,void 0),n([_(`#date-separator`)],x.prototype,`_dateSeparatorElement`,void 0),n([_(`#weekday`)],x.prototype,`_weekDayElement`,void 0),n([_(`#format-24h`)],x.prototype,`_format24hElement`,void 0),x=n([r()],x),customElements.get(`luzmo-display-settings-datetime`)||customElements.define(`luzmo-display-settings-datetime`,x);
@@ -1,26 +0,0 @@
1
-
2
- import{i as e,n as t,r as n}from"./version-BW4Ixl63.js";import{t as r}from"./localized-decorator-DJVBmJVH.js";import{n as i,t as a}from"./luzmoCheckbox-BksyONqE.js";import{d as o,f as s,p as c}from"./chart-helpers-DsIGsaDc.js";import{html as l,ifDefined as u,property as d,state as f,unsafeCSS as p}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/icon.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/field-label.js";var m=`:host .settings-container{gap:var(--luzmo-display-settings-vertical-gap,var(--luzmo-spacing-2));flex-direction:column;display:flex}:host .settings-row{justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-grand-totals-gap,var(--display-settings-grand-totals-gap));display:flex}:host,: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)}`,h=class extends t(s(c,{validSizes:Object.values(o)})){constructor(...e){super(...e),this.slotContent={}}static get styles(){return[p(m)]}willUpdate(e){super.willUpdate(e),e.has(`slotContent`)&&(this._enabled=this.slotContent?.grandTotals?.enabled??!1)}toggleGrandTotals(){this._enabled=!this._enabled,this.sendEvent()}sendEvent(){let e={enabled:!!this._enabled};this.dispatchEvent(new CustomEvent(`luzmo-slot-content-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:{...this.slotContent,grandTotals:e}}}))}render(){return l`<div class="settings-container">
3
- <div class="settings-row">
4
- <div class="setting">
5
- <luzmo-field-label .size=${this.size} for="grand-totals"
6
- >${e(`Grand totals`,{desc:`Label for grand totals setting in a table`})}</luzmo-field-label
7
- >
8
- <luzmo-action-button
9
- id="grand-totals"
10
- toggles
11
- emphasized
12
- .size=${this.size}
13
- ?selected=${this._enabled}
14
- class=${u(this._enabled?`active`:`inactive`)}
15
- @click=${this.toggleGrandTotals}
16
- >
17
- <luzmo-icon
18
- slot="icon"
19
- .size=${this.size}
20
- .icon=${this._enabled?i:a}
21
- ></luzmo-icon>
22
- ${this._enabled?e(`Enabled`,{desc:`Option set to enabled`}):e(`Disabled`,{desc:`Option set to disabled`})}
23
- </luzmo-action-button>
24
- </div>
25
- </div>
26
- </div>`}};n([d()],h.prototype,`slotContent`,void 0),n([f()],h.prototype,`_enabled`,void 0),h=n([r()],h),customElements.get(`luzmo-display-settings-grand-totals`)||customElements.define(`luzmo-display-settings-grand-totals`,h);
@@ -1,172 +0,0 @@
1
-
2
- import{i as e,n as t,r as n}from"./version-BW4Ixl63.js";import{t as r}from"./localized-decorator-DJVBmJVH.js";import{t as i}from"./luzmoAngleDown-PNrItYzK.js";import{n as a,u as o}from"./load-data-fields-for-datasets-ClctSj6y.js";import{t as s}from"./luzmo-icon-markup-ByaNI6dg.js";import{d as c,f as l,p as u}from"./chart-helpers-DsIGsaDc.js";import{t as d}from"./localize-DXRmGRe-.js";import{v as f}from"./item-slot-picker-panel-D4BMxGs9.js";import{html as p,nothing as m,property as h,query as g,state as _,unsafeCSS as v}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/menu.js";import{removeSlottableRequest as y}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/overlay.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/popover.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/tooltip.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/action-group.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/number-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/picker.js";var b=`:host .settings-container{gap:var(--luzmo-display-settings-vertical-gap,var(--luzmo-spacing-2));flex-direction:column;display:flex}:host .settings-row{justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-numeric-gap,var(--display-settings-numeric-gap));display:flex}.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))}.dataset-header{white-space:nowrap;text-overflow:ellipsis;text-transform:uppercase;max-width:100%;color:var(--luzmo-font-color);white-space:nowrap;cursor:default;margin:.5rem 1rem;font-weight:600;overflow:hidden}.no-weight-label{margin-left:1rem}.with-secondary-icon{clip-path:polygon(0 0,60% 0,65% 60%,100% 65%,100% 100%,0 100%)}.secondary-icon{width:auto;font-size:.75em;line-height:1;position:absolute;bottom:45%;left:60%}.data-icon-type{text-align:center;width:1.5rem;display:inline-block;position:relative}: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)}`,x={sum:()=>e(`Sum`,{desc:`Aggregation label`}),cumulativesum:()=>e(`Cumulative sum`,{desc:`Aggregation label`}),average:()=>e(`Average`,{desc:`Aggregation label`}),median:()=>e(`Median`,{desc:`Aggregation label`}),count:()=>e(`Count rows`,{desc:`Aggregation label`}),distinctcount:()=>e(`Count distinct`,{desc:`Aggregation label`}),min:()=>e(`Minimum`,{desc:`Aggregation label`}),max:()=>e(`Maximum`,{desc:`Aggregation label`}),stddev:()=>e(`Standard deviation`,{desc:`Aggregation label`}),rate:()=>e(`Rate`,{desc:`Aggregation label`})},S={general:`123`,percentage:`%`,scientific:`SI`},C={time:()=>e(`Time`,{desc:`Time format option`}),short:()=>e(`Short`,{desc:`Short format option`}),long:()=>e(`Long`,{desc:`Long format option`})},w={Auto:{auto:!0,label:()=>e(`Auto`,{desc:`Automatic setting of the option`})},"1,000.00":{auto:!1,label:()=>`1,000.00`,thousandSeparator:`,`,decimalSeparator:`.`,hiddenFor:`scientific`},"1.000,00":{auto:!1,label:()=>`1.000,00`,thousandSeparator:`.`,decimalSeparator:`,`,hiddenFor:`scientific`},"1000.00":{auto:!1,label:()=>`1000.00`,decimalSeparator:`.`},"1000,00":{auto:!1,label:()=>`1000,00`,decimalSeparator:`,`}},T={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`}]},E=class extends t(l(u,{validSizes:Object.values(c)})){constructor(...e){super(...e),this.slotContent={},this.measureColumns=[],this._durationLevels=[],this._renderDurationLevelMenu=!1,this._handleSlottableRequest=e=>{this._renderDurationLevelMenu=e.data!==y},this._sendEvent=()=>{let e={...this.slotContent,format:this._format,aggregationFunc:this._aggregationFunc};this._aggregationWeightColumn?e.aggregationWeight={...this._aggregationWeightColumn}:delete e.aggregationWeight,this._displayMode===`duration`?(e.duration=e.duration??{},e.duration.format=this._durationFormat,e.duration.levels=this._durationLevels):delete e.duration,this.dispatchEvent(new CustomEvent(`luzmo-slot-content-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:e}}))}}static get styles(){return[v(b)]}_parseSavedNumericFormatSettings(){if(this._displayMode=this.slotContent?.subtype===`duration`?`duration`:`numeric`,this._durationFormat=this.slotContent?.duration?.format??`short`,this._durationLevels=this.slotContent?.duration?.levels??[1],this._displayMode===`duration`)this._precision=2,this._commaDecimals=!1,this._thousandSeparator=!1;else{this._format=this.slotContent?.format??`.0f`;let e=f(this._format??`.0f`);this._isAuto=e.typeFormat?.includes(`a`)??!1,this._displayAs=[`%`,`a%`,`y`,`ay`].includes(e.typeFormat)?`percentage`:[`s`,`as`,`w`,`aw`].includes(e.typeFormat)?`scientific`:`general`,this._precision=e.precision?Number.parseInt(e.precision.replace(`.`,``),10):+(this._displayAs===`scientific`),this._commaDecimals=[`z`,`az`,`y`,`ay`,`w`,`aw`].includes(e.typeFormat),this._thousandSeparator=e.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(){this._displayAs=this._displayAsElement?.selected?.[0]??`general`,this._displayAs===`scientific`&&(this._precision=Math.max(this._precision??0,1),this._thousandSeparator=!1),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setNumericSeparators(e){let t=w[e?.detail??`Auto`];this._thousandSeparator=[`,`,`.`].includes(t?.thousandSeparator??``),this._commaDecimals=t?.decimalSeparator===`,`,this._isAuto=t?.auto,this._setNumericFormat(),this._sendEvent()}_setPrecision(){Number.isNaN(this._precisionElement.value)&&(this._precisionElement.value=+(this._displayAs===`scientific`)),this._precision=this._precisionElement.value,this._setNumericFormat(),this._sendEvent()}_setNumericFormat(){let e=`f`,t=this.slotContent.subtype===`duration`?this._durationLevels&&this._durationLevels?.length===1?`numeric`:`duration`:`numeric`;if(this._maxDurationLevel=Math.min(...this._durationLevels),t===`duration`)(![`time`,`short`,`long`].includes(this._durationFormat??``)||this._maxDurationLevel<6&&this._durationFormat===`time`)&&(this._durationFormat=`short`);else{let t=this._displayAs??`general`;t===`general`&&this._commaDecimals?e=`z`:t===`percentage`&&this._commaDecimals?e=`y`:t===`scientific`&&this._commaDecimals?e=`w`:t===`percentage`?e=`%`:t===`scientific`&&(e=`s`),this._format=(this._thousandSeparator||this._isAuto?`,`:``)+`.`+this._precision+(this._isAuto?`a`:``)+e}}_setAggregationFunc(){let e=this._aggregationElement.value,t=this._aggregationFunc,n=this.slotContent.format;if(e!==(t===`weightedaverage`?`average`:t)){if(this._aggregationFunc=e===`average`&&this._aggregationWeightColumn?.column?`weightedaverage`:e,t===`rate`){let e=f(n),t=[`%`,`y`,`a%`,`ay`].includes(e.typeFormat);this.slotContent.subtype===`currency`&&t&&this._setNumericDisplayAs()}this._sendEvent(),(this._aggregationFunc===`rate`||t===`rate`)&&this.requestUpdate()}}_setAggregationWeight(){let e=this._aggregationWeightElement.value,t=this._aggregationFunc;if(e===`none`)this._aggregationWeightColumn=void 0,this._aggregationFunc===`weightedaverage`&&(this._aggregationFunc=`average`);else{let t,n;for(let r of this.measureColumns??[]){let i=r.columns?.find(t=>t.id===e);if(i){t=i,n=r.datasetId;break}}t&&(this._aggregationWeightColumn={column:t.id,set:n,columnSubType:t.subtype}),this._aggregationFunc===`average`&&(this._aggregationFunc=`weightedaverage`)}this._sendEvent(),this.requestUpdate(),(t===`weightedaverage`&&this._aggregationFunc===`average`||t===`average`&&this._aggregationFunc===`weightedaverage`)&&this.requestUpdate()}_setDurationLevels(){let e=this._durationLevels,t=this._durationLevelsElement.value.split(`,`).filter(e=>e!==``).map(e=>Number.parseInt(e,10));this._durationLevels=(t?.length??0)>=1?t:e,this._maxDurationLevel=Math.min(...this._durationLevels),this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setDurationFormat(){this._durationFormat=this._durationFormatElement?.selected?.[0],this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_fillTimeDurationLevels(){if(this._durationFormat===`time`){let e=this._durationLevels.sort().at(-1);if([7,8,9].includes(e)){for(let t of{lev7:[6],lev8:[6,7],lev9:[6,7,8]}[`lev`+e])this._durationLevels.includes(t)||this._durationLevels.push(t);this._durationLevels=[...this._durationLevels].sort()}}}willUpdate(e){super.willUpdate(e),e.has(`slotContent`)&&(this._parseSavedNumericFormatSettings(),this._aggregationFunc=this.slotContent?.aggregationFunc??(this.slotContent?.type===`numeric`?`sum`:`count`),this._aggregationWeightColumn=this.slotContent?.aggregationWeight,this._isFormula=this.slotContent?.formula||this.slotContent?.formulaId)}_renderDurationLevelsSettings(){let t=T.levels.map(e=>{let t=!1;return this._durationFormat===`time`&&e.level>=6&&this._durationLevels.includes(e.level)&&e.level!==Math.max(...this._durationLevels)&&(t=!0),this._durationLevels.length===1&&this._durationLevels.includes(e.level)&&(t=!0),p`<luzmo-menu-item
3
- value=${e.level}
4
- ?selected=${this._durationLevels.includes(e.level)}
5
- ?disabled=${t}
6
- >
7
- ${e.label}
8
- </luzmo-menu-item>`});return p` <div class="setting">
9
- <luzmo-field-label .size=${this.size} for="duration-levels">
10
- ${e(`Duration levels`,{desc:`Label for duration levels setting`})}
11
- </luzmo-field-label>
12
- <luzmo-action-button id="duration-levels-trigger" size=${this.size} aria-haspopup="true" aria-expanded=${this._renderDurationLevelMenu?`true`:`false`}>
13
- ${this._durationLevels.length}
14
- ${this._durationLevels.length===1?e(`level`,{desc:`Singular form of level for duration levels`}):e(`levels`,{desc:`Plural form of level for duration levels`})} ${e(`active`,{desc:`Active suffix for duration levels count`})}
15
- <span class="duration-angle-down-icon">
16
- ${s(i)}
17
- </span>
18
- </luzmo-action-button>
19
- <luzmo-overlay
20
- id="duration-levels-overlay"
21
- trigger="duration-levels-trigger@click"
22
- type="auto"
23
- placement="bottom-start"
24
- type="page"
25
- @slottable-request=${this._handleSlottableRequest}
26
- >
27
- <luzmo-popover style="position: relative">
28
- ${this._renderDurationLevelMenu?p` <luzmo-menu
29
- id="duration-levels"
30
- size=${this.size}
31
- selects="multiple"
32
- .value=${this._durationLevels.join(`,`)}
33
- @change=${this._setDurationLevels}
34
- >
35
- ${t}
36
- </luzmo-menu>`:``}
37
- </luzmo-popover>
38
- </luzmo-overlay>
39
- </div>`}_renderDurationFormatSettings(){let t=Object.keys(C).map(e=>e===`time`&&(this._maxDurationLevel??1)<6?``:p`<luzmo-action-button value=${e}>
40
- ${C[e]()}
41
- </luzmo-action-button>`);return p` <div class="setting">
42
- <luzmo-field-label .size=${this.size} for="duration-format">
43
- ${e(`Format`,{desc:`Label for format setting`})}
44
- </luzmo-field-label>
45
- <luzmo-action-group
46
- emphasized
47
- id="duration-format"
48
- size=${this.size}
49
- compact=""
50
- .selected=${[this._durationFormat??`short`]}
51
- selects="single"
52
- @change=${this._setDurationFormat}
53
- >
54
- ${t}
55
- </luzmo-action-group>
56
- </div>`}_renderNumericDisplayAsSettings(){let t=Object.keys(S).filter(e=>e!==`percentage`||(this.slotContent.subtype!==`currency`||this.slotContent.aggregationFunc===`rate`)&&this.slotContent.periodOverPeriod?.type!==`percentageChange`).map(e=>p`<luzmo-action-button value=${e}
57
- >${S[e]}</luzmo-action-button
58
- >`);return p`<div class="setting">
59
- <luzmo-field-label .size=${this.size} for="display-as">
60
- ${e(`Display as`,{desc:`Label for display as setting for the datetime field`})}
61
- </luzmo-field-label>
62
- <luzmo-action-group
63
- emphasized
64
- id="display-as"
65
- size=${this.size}
66
- compact=""
67
- .selected=${[this._displayAs]}
68
- selects="single"
69
- @change=${this._setNumericDisplayAs}
70
- >
71
- ${t}
72
- </luzmo-action-group>
73
- </div>`}_renderNumericFormatSettings(){let t=Object.entries(w).filter(([,{hiddenFor:e}])=>!e||e!==this._displayAs).map(([e,{label:t}])=>p`<luzmo-menu-item value=${e}>${t()}</luzmo-menu-item>`);return p` <div class="setting">
74
- <luzmo-field-label .size=${this.size} for="format">
75
- ${e(`Format`,{desc:`Label for format setting`})}
76
- </luzmo-field-label>
77
- <luzmo-picker
78
- id="format"
79
- size=${this.size}
80
- variant="highlight"
81
- value=${this._numericFormatGroup??`Auto`}
82
- @change=${this._setNumericSeparators}
83
- >
84
- ${t}
85
- </luzmo-picker>
86
- </div>
87
- <div class="setting">
88
- <luzmo-field-label .size=${this.size} for="precision" id="precision-label">
89
- ${this._displayAs===`scientific`?e(`Precision`,{desc:`Label for precision setting`}):e(`Decimals`,{desc:`Label for decimals setting`})}
90
- </luzmo-field-label>
91
- <luzmo-number-field
92
- id="precision"
93
- label=${this._displayAs===`scientific`?e(`Precision`,{desc:`Label for precision setting`}):e(`Decimals`,{desc:`Label for decimals setting`})}
94
- min=${+(this._displayAs===`scientific`)}
95
- max="22"
96
- size=${this.size}
97
- value=${this._precision??+(this._displayAs===`scientific`)}
98
- @change=${this._setPrecision}
99
- ></luzmo-number-field>
100
- </div>`}_renderAggregationSettings(){let t=Object.entries(x).filter(([e])=>[`count`,`distinctcount`].includes(e)||this.slotContent?.type===`numeric`).filter(([e])=>e!==`cumulativesum`||this.isCumulativeSumEnabled).map(([e,t])=>p`<luzmo-menu-item value=${e}>${t()}</luzmo-menu-item>`),n=[p`
101
- <luzmo-menu-item
102
- value="none"
103
- class="no-weight"
104
- >
105
- <span class="no-weight-label">${e(`No weight`,{desc:`Label for no weight option`})}</span>
106
- </luzmo-menu-item>
107
- `,...(this.measureColumns??[]).flatMap(e=>{let t=typeof e.datasetName==`object`?d(e.datasetName,this.language):e.datasetName;return[p`<div class="dataset-header" role="group" aria-label=${t}>
108
- ${t}
109
- <luzmo-tooltip self-managed placement="right" size=${this.size}>
110
- ${t}
111
- </luzmo-tooltip>
112
- </div>`,...(e.columns??[]).map(e=>{let t=typeof e.name==`object`?d(e.name,this.language):e.name,n=s(a(e,`s`)),r=e.expression?o:void 0,i=!!r,c=i?p`<span class="secondary-icon"
113
- >${s(r)}</span
114
- >`:m;return p`<luzmo-menu-item value=${e.id}>
115
- <span class="data-icon-type" slot="icon">
116
- <span class=${i?`with-secondary-icon`:``}
117
- >${n}</span
118
- >
119
- ${c}
120
- </span>
121
- <span class="column-label text-truncate">${t}</span>
122
- <luzmo-tooltip self-managed placement="right" size=${this.size}>
123
- ${t}
124
- </luzmo-tooltip>
125
- </luzmo-menu-item>`})]})];return p`<div class="settings-row">
126
- <div class="setting">
127
- <luzmo-field-label .size=${this.size} for="aggregation">
128
- ${e(`Aggregation`,{desc:`Label for aggregation setting`})}
129
- </luzmo-field-label>
130
- <luzmo-picker
131
- id="aggregation"
132
- size=${this.size}
133
- variant="highlight"
134
- value=${(()=>{let e=this.slotContent?.type===`numeric`?`sum`:`count`;return this._aggregationFunc===`weightedaverage`?`average`:this._aggregationFunc??e})()}
135
- @change=${this._setAggregationFunc}
136
- >
137
- ${t}
138
- </luzmo-picker>
139
- </div>
140
- ${[`rate`,`average`,`weightedaverage`].includes(this._aggregationFunc??``)?p`<div class="setting">
141
- <luzmo-field-label .size=${this.size} for="weighting-column">
142
- ${this._aggregationFunc===`rate`?e(`Denominator`,{desc:`Label for denominator field`}):e(`Weight`,{desc:`Label for weight field`})}
143
- </luzmo-field-label>
144
- ${this.measureColumns.length>0?p`
145
- <luzmo-picker
146
- id="weighting-column"
147
- size=${this.size}
148
- variant="highlight"
149
- icons="none"
150
- value=${this._aggregationWeightColumn?.column??`none`}
151
- @change=${this._setAggregationWeight}
152
- >
153
- ${n}
154
- </luzmo-picker>
155
- `:p`<luzmo-picker
156
- id="weighting-column"
157
- size=${this.size}
158
- variant="highlight"
159
- icons="none"
160
- value="none"
161
- >
162
- <luzmo-menu-item value="none">${e(`No weight`,{desc:`Label for no weight option`})}</luzmo-menu-item>
163
- </luzmo-picker>`}
164
- </div>`:``}
165
- </div>`}render(){return p`<div class="settings-container">
166
- <div class="settings-row">
167
- ${this._displayMode===`duration`?this._renderDurationLevelsSettings():this._renderNumericDisplayAsSettings()}
168
- ${this._durationLevels?.length>1?this._renderDurationFormatSettings():this._renderNumericFormatSettings()}
169
- </div>
170
- ${this._isFormula||this.isAggregationDisabled?m:this._renderAggregationSettings()}
171
- </div>
172
- </div>`}};n([h({type:Object,attribute:!1})],E.prototype,`slotContent`,void 0),n([h({type:Array,reflect:!1})],E.prototype,`measureColumns`,void 0),n([h({type:Boolean})],E.prototype,`isAggregationDisabled`,void 0),n([h({type:Boolean})],E.prototype,`isCumulativeSumEnabled`,void 0),n([g(`#display-as`)],E.prototype,`_displayAsElement`,void 0),n([g(`#precision`)],E.prototype,`_precisionElement`,void 0),n([g(`#aggregation`)],E.prototype,`_aggregationElement`,void 0),n([g(`#weighting-column`)],E.prototype,`_aggregationWeightElement`,void 0),n([g(`#duration-levels`)],E.prototype,`_durationLevelsElement`,void 0),n([g(`#duration-format`)],E.prototype,`_durationFormatElement`,void 0),n([_()],E.prototype,`_renderDurationLevelMenu`,void 0),E=n([r()],E),customElements.get(`luzmo-display-settings-numeric`)||customElements.define(`luzmo-display-settings-numeric`,E);