@luzmo/analytics-components-kit 1.0.1-alpha.50 → 1.0.1-alpha.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/display-settings/display-settings.d.ts +1 -0
- package/components/display-settings/index.cjs +1 -1
- package/components/display-settings/index.js +1 -1
- package/components/display-settings-numeric/helpers/constants.d.ts +1 -0
- package/components/display-settings-numeric/index.cjs +16 -10
- package/components/display-settings-numeric/index.js +52 -34
- package/components/draggable-data-item/draggable-data-item.d.ts +0 -1
- package/components/draggable-data-item/index.cjs +5 -8
- package/components/draggable-data-item/index.js +32 -38
- package/components/draggable-data-item-level/draggable-data-item-level.d.ts +1 -1
- package/components/draggable-data-item-level/index.cjs +6 -6
- package/components/draggable-data-item-level/index.js +106 -113
- package/components/droppable-slot/droppable-slot.d.ts +6 -1
- package/components/droppable-slot/index.cjs +14 -12
- package/components/droppable-slot/index.js +186 -160
- package/components/filter-item/index.cjs +1 -1
- package/components/filter-item/index.js +1 -1
- package/components/filter-value-picker-hierarchy/index.cjs +1 -1
- package/components/filter-value-picker-hierarchy/index.js +1 -1
- package/components/filter-value-picker-numeric/index.cjs +1 -1
- package/components/filter-value-picker-numeric/index.js +1 -1
- package/components/{index-DAoFunRy.cjs → index-3X8Iuo7y.cjs} +11 -11
- package/components/{index-Delpl7qa.js → index-Cyo2hwg7.js} +1 -1
- package/components/{index-eBsINoH9.cjs → index-DpHum3lw.cjs} +1 -1
- package/components/{index-Ct7UvUif.js → index-fmbD10nN.js} +123 -109
- package/components/index.cjs +1 -1
- package/components/index.js +1 -1
- package/components/slot-contents-picker/index.cjs +1 -1
- package/components/slot-contents-picker/index.js +1 -1
- package/components/slot-menu/index.cjs +11 -11
- package/components/slot-menu/index.js +186 -171
- package/components/slot-menu/slot-menu.d.ts +5 -1
- package/components/slot-menu-list/index.cjs +1 -1
- package/components/slot-menu-list/index.js +19 -16
- package/components/slot-menu-list/slot-menu-list.d.ts +1 -0
- package/custom-elements.json +29 -43
- package/item-definitions/box-plot/box-plot-options.config.d.ts +1 -1
- package/item-definitions/choropleth-map/choropleth-map-options.config.d.ts +1 -1
- package/item-definitions/hexbin-map/hexbin-map-options.config.d.ts +1 -1
- package/item-definitions/route-map/route-map-options.config.d.ts +1 -1
- package/item-definitions/spike-map/spike-map-options.config.d.ts +1 -1
- package/package.json +1 -1
- package/utils/data-broker/index.d.ts +1 -1
@@ -17,4 +17,4 @@
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
18
|
* SOFTWARE.
|
19
19
|
* */
|
20
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-
|
20
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-3X8Iuo7y.cjs");exports.LuzmoDisplaySettings=e.LuzmoDisplaySettings;
|
@@ -17,7 +17,7 @@
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
18
|
* SOFTWARE.
|
19
19
|
* */
|
20
|
-
import { L as u } from "../index-
|
20
|
+
import { L as u } from "../index-fmbD10nN.js";
|
21
21
|
const l = () => {
|
22
22
|
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
23
23
|
const o = document.createElement("style");
|
@@ -17,7 +17,7 @@
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
18
|
* SOFTWARE.
|
19
19
|
* */
|
20
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../set-locale-DCPlazsZ.cjs"),A=require("../localized-decorator-DIXYZ3RL.cjs");require("../index-Dy_5M3M5.cjs");require("../index-CnP-Q5Bw.cjs");require("../index-j8UKjHqY.cjs");require("../index-tXl_aMnZ.cjs");require("../index-MPM_B4re.cjs");require("../index-Ck5VRoXN.cjs");require("../index-BoXbQm2o.cjs");const y=require("../decompose-numeric-format-B3rVVHpO.cjs"),o=require("../property-Cu4Q1hS4.cjs"),p=require("../luzmo-icons-DonyjSXg.cjs"),D=require("../index-CUvucmA0.cjs");require("../index-CYeQkVeJ.cjs");const z=require("../calculate-data-item-icon-Dn-9Kd0U.cjs"),b=require("../localize-r7ALOUy_.cjs"),N=require("../state-fyl3IYMu.cjs"),g=require("../query-D5qWDopr.cjs"),w=require("../focusable-DAGGGYyz.cjs"),L=require("../sized-mixin-j_7aJM4b.cjs"),x=":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))}.dataset-header{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;font-weight:600;text-transform:uppercase;margin-bottom:.5rem;margin-top:.5rem;margin-left:1rem}.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{position:absolute;bottom:45%;left:60%;width:auto;font-size:.75em;line-height:1}.data-icon-type{width:1.5rem;text-align:center;position:relative;display:inline-block}: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 )}",C={sum:()=>n.msg("Sum",{desc:"Numeric Aggregation option"}),cumulativesum:()=>n.msg("Cumulative sum",{desc:"Numeric Aggregation option"}),average:()=>n.msg("Average",{desc:"Numeric Aggregation option"}),median:()=>n.msg("Median",{desc:"Numeric Aggregation option"}),count:()=>n.msg("Count",{desc:"Numeric Aggregation option"}),distinctcount:()=>n.msg("Distinct count",{desc:"Numeric Aggregation option"}),min:()=>n.msg("Minimum",{desc:"Numeric Aggregation option"}),max:()=>n.msg("Maximum",{desc:"Numeric Aggregation option"}),stddev:()=>n.msg("Standard deviation",{desc:"Numeric Aggregation option"}),rate:()=>n.msg("Rate",{desc:"Numeric Aggregation option"})},S={general:"123",percentage:"%",scientific:"SI"},F={time:()=>n.msg("Time",{desc:"Time format option"}),short:()=>n.msg("Short",{desc:"Short format option"}),long:()=>n.msg("Long",{desc:"Long format option"})},_={Auto:{auto:!0,label:()=>n.msg("Auto",{desc:"Automatic setting of the option"})},"1,000.00":{auto:!1,label:()=>"1,000.00",thousandSeparator:",",decimalSeparator:"."},"1.000,00":{auto:!1,label:()=>"1.000,00",thousandSeparator:".",decimalSeparator:","},"1000.00":{auto:!1,label:()=>"1000.00",decimalSeparator:"."},"1000,00":{auto:!1,label:()=>"1000,00",decimalSeparator:","}},E={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 q=Object.defineProperty,I=Object.getOwnPropertyDescriptor,l=(v,e,t,i)=>{for(var s=i>1?void 0:i?I(e,t):e,a=v.length-1,r;a>=0;a--)(r=v[a])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&q(e,t,s),s};exports.LuzmoDisplaySettingsNumeric=class extends L.SizedMixin(w.LuzmoElement,{validSizes:Object.values(L.ElementSizes)}){constructor(){super(...arguments),this.language="en",this.slotContent={},this.measureColumns=[],this._durationLevels=[],this._renderDurationLevelMenu=!1,this._sendEvent=()=>{const e={...this.slotContent};e.format=this._format,e.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("slot-content-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:e}}))}}static get styles(){return[o.r(x)]}_parseSavedNumericFormatSettings(){var e,t,i,s,a,r,c,u,d,h;if(this._displayMode=((e=this.slotContent)==null?void 0:e.subtype)==="duration"?((s=(i=(t=this.slotContent)==null?void 0:t.duration)==null?void 0:i.levels)==null?void 0:s.length)===1?"numeric":"duration":"numeric",this._durationFormat=((r=(a=this.slotContent)==null?void 0:a.duration)==null?void 0:r.format)??"short",this._durationLevels=((u=(c=this.slotContent)==null?void 0:c.duration)==null?void 0:u.levels)??[1],this._displayMode==="duration")this._precision=2,this._commaDecimals=!1,this._thousandSeparator=!1;else{this._format=((d=this.slotContent)==null?void 0:d.format)??".0f";const m=y.decomposeNumericFormat(this._format??".0f");this._isAuto=((h=m.typeFormat)==null?void 0:h.includes("a"))??!1,["%","a%","y","ay"].includes(m.typeFormat)?this._displayAs="percentage":["s","as","w","aw"].includes(m.typeFormat)?this._displayAs="scientific":this._displayAs="general",this._precision=m.precision?Number.parseInt(m.precision.replace(".",""),10):this._displayAs==="scientific"?1:0,this._commaDecimals=["z","az","y","ay","w","aw"].includes(m.typeFormat),this._thousandSeparator=m.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 e,t;this._displayAs=((t=(e=this._displayAsElement)==null?void 0:e.selected)==null?void 0:t[0])??"general",this._displayAs==="scientific"&&(this._precision=Math.max(this._precision??0,1),this._thousandSeparator=!1),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setNumericSeparators(e){const t=_[(e==null?void 0:e.detail)??"Auto"];this._thousandSeparator=[",","."].includes((t==null?void 0:t.thousandSeparator)??""),this._commaDecimals=(t==null?void 0:t.decimalSeparator)===",",this._isAuto=t==null?void 0:t.auto,this._setNumericFormat(),this._sendEvent()}_setPrecision(){this._precision=this._precisionElement.value,this._setNumericFormat(),this._sendEvent()}_setNumericFormat(){var i;let e="f";const t=this.slotContent.subtype==="duration"?this._durationLevels&&((i=this._durationLevels)==null?void 0:i.length)===1?"numeric":"duration":"numeric";this._maxDurationLevel=Math.min(...this._durationLevels),t==="duration"?(!["time","short","long"].includes(this._durationFormat??"")||this._maxDurationLevel<6&&this._durationFormat==="time")&&(this._durationFormat="short"):(this._displayAs==="general"&&this._commaDecimals?e="z":this._displayAs==="percentage"&&this._commaDecimals?e="y":this._displayAs==="scientific"&&this._commaDecimals?e="w":this._displayAs==="percentage"?e="%":this._displayAs==="scientific"&&(e="s"),this._format=(this._thousandSeparator||this._isAuto?",":"")+"."+this._precision+(this._isAuto?"a":"")+e)}_setAggregationFunc(){var a;const e=this._aggregationElement.value,t=this._aggregationFunc,i=this.slotContent.format;if(e!==(t==="weightedaverage"?"average":t)){if(this._aggregationFunc=e==="average"&&((a=this._aggregationWeightColumn)!=null&&a.column)?"weightedaverage":e,t==="rate"){const r=y.decomposeNumericFormat(i),c=["%","y","a%","ay"].includes(r.typeFormat);this.slotContent.subtype==="currency"&&c&&this._setNumericDisplayAs()}this._sendEvent(),(this._aggregationFunc==="rate"||t==="rate")&&this.requestUpdate()}}_setAggregationWeight(){var i;const e=this._aggregationWeightElement.value,t=this._aggregationFunc;if(e==="none")this._aggregationWeightColumn=void 0,this._aggregationFunc==="weightedaverage"&&(this._aggregationFunc="average");else{let s,a;for(const r of this.measureColumns??[]){const c=(i=r.columns)==null?void 0:i.find(u=>u.id===e);if(c){s=c,a=r.datasetId;break}}s&&(this._aggregationWeightColumn={column:s.id,set:a,columnSubType:s.subtype}),this._aggregationFunc==="average"&&(this._aggregationFunc="weightedaverage")}this._sendEvent(),this.requestUpdate(),(t==="weightedaverage"&&this._aggregationFunc==="average"||t==="average"&&this._aggregationFunc==="weightedaverage")&&this.requestUpdate()}_setDurationLevels(){const e=this._durationLevels,t=this._durationLevelsElement.value.split(",").filter(i=>i!=="").map(i=>Number.parseInt(i,10));this._durationLevels=((t==null?void 0:t.length)??0)>=1?t:e,this._maxDurationLevel=Math.min(...this._durationLevels),this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setDurationFormat(){var e,t;this._durationFormat=(t=(e=this._durationFormatElement)==null?void 0:e.selected)==null?void 0:t[0],this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_fillTimeDurationLevels(){if(this._durationFormat==="time"){const e=this._durationLevels.sort().at(-1);if([7,8,9].includes(e)){const t={lev7:[6],lev8:[6,7],lev9:[6,7,8]};for(const i of t["lev"+e])this._durationLevels.includes(i)||this._durationLevels.push(i);this._durationLevels=[...this._durationLevels].sort()}}}willUpdate(e){var t,i,s,a,r;e.has("slotContent")&&(this._parseSavedNumericFormatSettings(),this._aggregationFunc=((t=this.slotContent)==null?void 0:t.aggregationFunc)??(((i=this.slotContent)==null?void 0:i.type)==="numeric"?"sum":"count"),this._aggregationWeightColumn=(s=this.slotContent)==null?void 0:s.aggregationWeight,this._isFormula=((a=this.slotContent)==null?void 0:a.formula)||((r=this.slotContent)==null?void 0:r.formulaId)),e.has("language")&&this.language!==n.getLocale()&&([...n.targetLocales].includes(this.language??"en")||this.language==="en")&&n.setLocale(this.language)}firstUpdated(){var e;(e=this.slotContent)!=null&&e.duration&&this._durationLevelsOverlay.addEventListener("slottable-request",t=>{this._renderDurationLevelMenu=t.data!==D.a})}_renderDurationLevelsSettings(){const e=E.levels.map(t=>{let i=!1;return this._durationFormat==="time"&&t.level>=6&&this._durationLevels.includes(t.level)&&t.level!==Math.max(...this._durationLevels)&&(i=!0),this._durationLevels.length===1&&this._durationLevels.includes(t.level)&&(i=!0),o.x`<luzmo-menu-item
|
20
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../set-locale-DCPlazsZ.cjs"),A=require("../localized-decorator-DIXYZ3RL.cjs");require("../index-Dy_5M3M5.cjs");require("../index-CnP-Q5Bw.cjs");require("../index-j8UKjHqY.cjs");require("../index-tXl_aMnZ.cjs");require("../index-MPM_B4re.cjs");require("../index-Ck5VRoXN.cjs");require("../index-BoXbQm2o.cjs");const f=require("../decompose-numeric-format-B3rVVHpO.cjs"),o=require("../property-Cu4Q1hS4.cjs"),p=require("../luzmo-icons-DonyjSXg.cjs"),D=require("../index-CUvucmA0.cjs");require("../index-CYeQkVeJ.cjs");const y=require("../calculate-data-item-icon-Dn-9Kd0U.cjs"),z=require("../localize-r7ALOUy_.cjs"),N=require("../state-fyl3IYMu.cjs"),g=require("../query-D5qWDopr.cjs"),w=require("../focusable-DAGGGYyz.cjs"),b=require("../sized-mixin-j_7aJM4b.cjs"),x=":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))}.dataset-header{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;font-weight:600;text-transform:uppercase;margin:.5rem 1rem}.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{position:absolute;bottom:45%;left:60%;width:auto;font-size:.75em;line-height:1}.data-icon-type{width:1.5rem;text-align:center;position:relative;display:inline-block}: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 )}",C={sum:()=>n.msg("Sum",{desc:"Numeric Aggregation option"}),cumulativesum:()=>n.msg("Cumulative sum",{desc:"Numeric Aggregation option"}),average:()=>n.msg("Average",{desc:"Numeric Aggregation option"}),median:()=>n.msg("Median",{desc:"Numeric Aggregation option"}),count:()=>n.msg("Count",{desc:"Numeric Aggregation option"}),distinctcount:()=>n.msg("Distinct count",{desc:"Numeric Aggregation option"}),min:()=>n.msg("Minimum",{desc:"Numeric Aggregation option"}),max:()=>n.msg("Maximum",{desc:"Numeric Aggregation option"}),stddev:()=>n.msg("Standard deviation",{desc:"Numeric Aggregation option"}),rate:()=>n.msg("Rate",{desc:"Numeric Aggregation option"})},L={general:"123",percentage:"%",scientific:"SI"},F={time:()=>n.msg("Time",{desc:"Time format option"}),short:()=>n.msg("Short",{desc:"Short format option"}),long:()=>n.msg("Long",{desc:"Long format option"})},S={Auto:{auto:!0,label:()=>n.msg("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:","}},E={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 q=Object.defineProperty,I=Object.getOwnPropertyDescriptor,l=(v,e,t,i)=>{for(var s=i>1?void 0:i?I(e,t):e,a=v.length-1,r;a>=0;a--)(r=v[a])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&q(e,t,s),s};exports.LuzmoDisplaySettingsNumeric=class extends b.SizedMixin(w.LuzmoElement,{validSizes:Object.values(b.ElementSizes)}){constructor(){super(...arguments),this.language="en",this.slotContent={},this.measureColumns=[],this._durationLevels=[],this._renderDurationLevelMenu=!1,this._sendEvent=()=>{const e={...this.slotContent};e.format=this._format,e.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("slot-content-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:e}}))}}static get styles(){return[o.r(x)]}_parseSavedNumericFormatSettings(){var e,t,i,s,a,r,c,u,d,h;if(this._displayMode=((e=this.slotContent)==null?void 0:e.subtype)==="duration"?((s=(i=(t=this.slotContent)==null?void 0:t.duration)==null?void 0:i.levels)==null?void 0:s.length)===1?"numeric":"duration":"numeric",this._durationFormat=((r=(a=this.slotContent)==null?void 0:a.duration)==null?void 0:r.format)??"short",this._durationLevels=((u=(c=this.slotContent)==null?void 0:c.duration)==null?void 0:u.levels)??[1],this._displayMode==="duration")this._precision=2,this._commaDecimals=!1,this._thousandSeparator=!1;else{this._format=((d=this.slotContent)==null?void 0:d.format)??".0f";const m=f.decomposeNumericFormat(this._format??".0f");this._isAuto=((h=m.typeFormat)==null?void 0:h.includes("a"))??!1,["%","a%","y","ay"].includes(m.typeFormat)?this._displayAs="percentage":["s","as","w","aw"].includes(m.typeFormat)?this._displayAs="scientific":this._displayAs="general",this._precision=m.precision?Number.parseInt(m.precision.replace(".",""),10):this._displayAs==="scientific"?1:0,this._commaDecimals=["z","az","y","ay","w","aw"].includes(m.typeFormat),this._thousandSeparator=m.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 e,t;this._displayAs=((t=(e=this._displayAsElement)==null?void 0:e.selected)==null?void 0:t[0])??"general",this._displayAs==="scientific"&&(this._precision=Math.max(this._precision??0,1),this._thousandSeparator=!1),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setNumericSeparators(e){const t=S[(e==null?void 0:e.detail)??"Auto"];this._thousandSeparator=[",","."].includes((t==null?void 0:t.thousandSeparator)??""),this._commaDecimals=(t==null?void 0:t.decimalSeparator)===",",this._isAuto=t==null?void 0:t.auto,this._setNumericFormat(),this._sendEvent()}_setPrecision(){this._precision=this._precisionElement.value,this._setNumericFormat(),this._sendEvent()}_setNumericFormat(){var i;let e="f";const t=this.slotContent.subtype==="duration"?this._durationLevels&&((i=this._durationLevels)==null?void 0:i.length)===1?"numeric":"duration":"numeric";this._maxDurationLevel=Math.min(...this._durationLevels),t==="duration"?(!["time","short","long"].includes(this._durationFormat??"")||this._maxDurationLevel<6&&this._durationFormat==="time")&&(this._durationFormat="short"):(this._displayAs==="general"&&this._commaDecimals?e="z":this._displayAs==="percentage"&&this._commaDecimals?e="y":this._displayAs==="scientific"&&this._commaDecimals?e="w":this._displayAs==="percentage"?e="%":this._displayAs==="scientific"&&(e="s"),this._format=(this._thousandSeparator||this._isAuto?",":"")+"."+this._precision+(this._isAuto?"a":"")+e)}_setAggregationFunc(){var a;const e=this._aggregationElement.value,t=this._aggregationFunc,i=this.slotContent.format;if(e!==(t==="weightedaverage"?"average":t)){if(this._aggregationFunc=e==="average"&&((a=this._aggregationWeightColumn)!=null&&a.column)?"weightedaverage":e,t==="rate"){const r=f.decomposeNumericFormat(i),c=["%","y","a%","ay"].includes(r.typeFormat);this.slotContent.subtype==="currency"&&c&&this._setNumericDisplayAs()}this._sendEvent(),(this._aggregationFunc==="rate"||t==="rate")&&this.requestUpdate()}}_setAggregationWeight(){var i;const e=this._aggregationWeightElement.value,t=this._aggregationFunc;if(e==="none")this._aggregationWeightColumn=void 0,this._aggregationFunc==="weightedaverage"&&(this._aggregationFunc="average");else{let s,a;for(const r of this.measureColumns??[]){const c=(i=r.columns)==null?void 0:i.find(u=>u.id===e);if(c){s=c,a=r.datasetId;break}}s&&(this._aggregationWeightColumn={column:s.id,set:a,columnSubType:s.subtype}),this._aggregationFunc==="average"&&(this._aggregationFunc="weightedaverage")}this._sendEvent(),this.requestUpdate(),(t==="weightedaverage"&&this._aggregationFunc==="average"||t==="average"&&this._aggregationFunc==="weightedaverage")&&this.requestUpdate()}_setDurationLevels(){const e=this._durationLevels,t=this._durationLevelsElement.value.split(",").filter(i=>i!=="").map(i=>Number.parseInt(i,10));this._durationLevels=((t==null?void 0:t.length)??0)>=1?t:e,this._maxDurationLevel=Math.min(...this._durationLevels),this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setDurationFormat(){var e,t;this._durationFormat=(t=(e=this._durationFormatElement)==null?void 0:e.selected)==null?void 0:t[0],this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_fillTimeDurationLevels(){if(this._durationFormat==="time"){const e=this._durationLevels.sort().at(-1);if([7,8,9].includes(e)){const t={lev7:[6],lev8:[6,7],lev9:[6,7,8]};for(const i of t["lev"+e])this._durationLevels.includes(i)||this._durationLevels.push(i);this._durationLevels=[...this._durationLevels].sort()}}}willUpdate(e){var t,i,s,a,r;e.has("slotContent")&&(this._parseSavedNumericFormatSettings(),this._aggregationFunc=((t=this.slotContent)==null?void 0:t.aggregationFunc)??(((i=this.slotContent)==null?void 0:i.type)==="numeric"?"sum":"count"),this._aggregationWeightColumn=(s=this.slotContent)==null?void 0:s.aggregationWeight,this._isFormula=((a=this.slotContent)==null?void 0:a.formula)||((r=this.slotContent)==null?void 0:r.formulaId)),e.has("language")&&this.language!==n.getLocale()&&([...n.targetLocales].includes(this.language??"en")||this.language==="en")&&n.setLocale(this.language)}firstUpdated(){var e;(e=this.slotContent)!=null&&e.duration&&this._durationLevelsOverlay.addEventListener("slottable-request",t=>{this._renderDurationLevelMenu=t.data!==D.a})}_renderDurationLevelsSettings(){const e=E.levels.map(t=>{let i=!1;return this._durationFormat==="time"&&t.level>=6&&this._durationLevels.includes(t.level)&&t.level!==Math.max(...this._durationLevels)&&(i=!0),this._durationLevels.length===1&&this._durationLevels.includes(t.level)&&(i=!0),o.x`<luzmo-menu-item
|
21
21
|
value=${t.level}
|
22
22
|
?selected=${this._durationLevels.includes(t.level)}
|
23
23
|
?disabled=${i}
|
@@ -70,8 +70,8 @@
|
|
70
70
|
>
|
71
71
|
${e}
|
72
72
|
</luzmo-action-group>
|
73
|
-
</div>`}_renderNumericDisplayAsSettings(){const e=Object.keys(
|
74
|
-
>${
|
73
|
+
</div>`}_renderNumericDisplayAsSettings(){const e=Object.keys(L).map(t=>o.x`<luzmo-action-button value=${t}
|
74
|
+
>${L[t]}</luzmo-action-button
|
75
75
|
>`);return o.x`<div class="setting">
|
76
76
|
<luzmo-field-label for="display-as">
|
77
77
|
${n.msg("Display as",{desc:"Label for display as setting for the datetime field"})}
|
@@ -87,9 +87,7 @@
|
|
87
87
|
>
|
88
88
|
${e}
|
89
89
|
</luzmo-action-group>
|
90
|
-
</div>`}_renderNumericFormatSettings(){const e=Object.
|
91
|
-
${_[t].label()}
|
92
|
-
</luzmo-menu-item>`);return o.x` <div class="setting">
|
90
|
+
</div>`}_renderNumericFormatSettings(){const e=Object.entries(S).filter(([,{hiddenFor:t}])=>!t||t!==this._displayAs).map(([t,{label:i}])=>o.x`<luzmo-menu-item value=${t}>${i()}</luzmo-menu-item>`);return o.x` <div class="setting">
|
93
91
|
<luzmo-field-label for="format">
|
94
92
|
${n.msg("Format",{desc:"Label for format setting"})}
|
95
93
|
</luzmo-field-label>
|
@@ -117,16 +115,16 @@
|
|
117
115
|
></luzmo-number-field>
|
118
116
|
</div>`}_renderAggregationSettings(){var i;const e=Object.entries(C).filter(([s])=>{var a;return["count","distinctcount"].includes(s)||((a=this.slotContent)==null?void 0:a.type)==="numeric"}).map(([s,a])=>o.x`<luzmo-menu-item value=${s}>${a()}</luzmo-menu-item>`),t=[o.x`<luzmo-menu-item value="none" class="no-weight">
|
119
117
|
<span class="no-weight-label">No weight</span>
|
120
|
-
</luzmo-menu-item>`,...(this.measureColumns??[]).flatMap(s=>{const a=typeof s.datasetName=="object"?
|
118
|
+
</luzmo-menu-item>`,...(this.measureColumns??[]).flatMap(s=>{const a=typeof s.datasetName=="object"?z.localize(s.datasetName,this.language):s.datasetName,r=o.x`<div class="dataset-header">
|
121
119
|
${a}
|
122
120
|
<luzmo-tooltip self-managed placement="right" size=${this.size}>
|
123
121
|
${a}
|
124
122
|
</luzmo-tooltip>
|
125
|
-
</div>`,c=(s.columns??[]).map(u=>{const d=typeof u.name=="object"?
|
123
|
+
</div>`,c=(s.columns??[]).map(u=>{const d=typeof u.name=="object"?z.localize(u.name,this.language):u.name,h=p.y3(y.calculateDataItemIcon(u,"s")),m=u.expression?y.calculateDataItemSecondaryIcon("derived","s"):void 0,_=!!m,$=_?o.x`<span class="secondary-icon"
|
126
124
|
>${p.y3(m)}</span
|
127
125
|
>`:o.E;return o.x`<luzmo-menu-item value=${u.id}>
|
128
126
|
<span class="data-icon-type" slot="icon">
|
129
|
-
<span class=${
|
127
|
+
<span class=${_?"with-secondary-icon":""}
|
130
128
|
>${h}</span
|
131
129
|
>
|
132
130
|
${$}
|
@@ -165,7 +163,15 @@
|
|
165
163
|
>
|
166
164
|
${t}
|
167
165
|
</luzmo-picker>
|
168
|
-
`:o.
|
166
|
+
`:o.x`<luzmo-picker
|
167
|
+
id="weighting-column"
|
168
|
+
size=${this.size}
|
169
|
+
variant="highlight"
|
170
|
+
icons="none"
|
171
|
+
value="none"
|
172
|
+
>
|
173
|
+
<luzmo-menu-item value="none">No weight</luzmo-menu-item>
|
174
|
+
</luzmo-picker>`}
|
169
175
|
</div>`:""}
|
170
176
|
</div>`}render(){var e;return o.x`<div class="settings-container">
|
171
177
|
<div class="settings-row">
|
@@ -26,13 +26,13 @@ import "../index-BssHAgUU.js";
|
|
26
26
|
import "../index-DsP81c4M.js";
|
27
27
|
import "../index-B2ngKWOI.js";
|
28
28
|
import "../index-CTVNGPeT.js";
|
29
|
-
import { d as
|
30
|
-
import { r as N, x as r, E as
|
31
|
-
import { a8 as
|
29
|
+
import { d as _ } from "../decompose-numeric-format-BuZcjH2k.js";
|
30
|
+
import { r as N, x as r, E as b, n as z } from "../property-DCzt3DR1.js";
|
31
|
+
import { a8 as f, ac as E } from "../luzmo-icons-CVeTZ59u.js";
|
32
32
|
import { a as I } from "../index-DUF6bALI.js";
|
33
33
|
import "../index-BmshD32H.js";
|
34
34
|
import { c as M, a as O } from "../calculate-data-item-icon-Dpvf1aLI.js";
|
35
|
-
import { l as
|
35
|
+
import { l as y } from "../localize-BX7q0S0M.js";
|
36
36
|
import { r as k } from "../state-nDsQPund.js";
|
37
37
|
import { e as g } from "../query-Ddbd72Um.js";
|
38
38
|
import { L as W } from "../focusable-BbymtxWI.js";
|
@@ -44,7 +44,7 @@ const L = () => {
|
|
44
44
|
}
|
45
45
|
};
|
46
46
|
L();
|
47
|
-
const j = ":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))}.dataset-header{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;font-weight:600;text-transform:uppercase;margin
|
47
|
+
const j = ":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))}.dataset-header{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;font-weight:600;text-transform:uppercase;margin:.5rem 1rem}.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{position:absolute;bottom:45%;left:60%;width:auto;font-size:.75em;line-height:1}.data-icon-type{width:1.5rem;text-align:center;position:relative;display:inline-block}: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 )}", P = {
|
48
48
|
sum: () => a("Sum", { desc: "Numeric Aggregation option" }),
|
49
49
|
cumulativesum: () => a("Cumulative sum", { desc: "Numeric Aggregation option" }),
|
50
50
|
average: () => a("Average", { desc: "Numeric Aggregation option" }),
|
@@ -55,15 +55,15 @@ const j = ":host .settings-container{display:flex;flex-direction:column;gap:var(
|
|
55
55
|
max: () => a("Maximum", { desc: "Numeric Aggregation option" }),
|
56
56
|
stddev: () => a("Standard deviation", { desc: "Numeric Aggregation option" }),
|
57
57
|
rate: () => a("Rate", { desc: "Numeric Aggregation option" })
|
58
|
-
},
|
58
|
+
}, x = {
|
59
59
|
general: "123",
|
60
60
|
percentage: "%",
|
61
61
|
scientific: "SI"
|
62
|
-
},
|
62
|
+
}, A = {
|
63
63
|
time: () => a("Time", { desc: "Time format option" }),
|
64
64
|
short: () => a("Short", { desc: "Short format option" }),
|
65
65
|
long: () => a("Long", { desc: "Long format option" })
|
66
|
-
},
|
66
|
+
}, $ = {
|
67
67
|
Auto: {
|
68
68
|
auto: !0,
|
69
69
|
label: () => a("Auto", { desc: "Automatic setting of the option" })
|
@@ -72,16 +72,26 @@ const j = ":host .settings-container{display:flex;flex-direction:column;gap:var(
|
|
72
72
|
auto: !1,
|
73
73
|
label: () => "1,000.00",
|
74
74
|
thousandSeparator: ",",
|
75
|
-
decimalSeparator: "."
|
75
|
+
decimalSeparator: ".",
|
76
|
+
hiddenFor: "scientific"
|
76
77
|
},
|
77
78
|
"1.000,00": {
|
78
79
|
auto: !1,
|
79
80
|
label: () => "1.000,00",
|
80
81
|
thousandSeparator: ".",
|
81
|
-
decimalSeparator: ","
|
82
|
+
decimalSeparator: ",",
|
83
|
+
hiddenFor: "scientific"
|
82
84
|
},
|
83
|
-
"1000.00": {
|
84
|
-
|
85
|
+
"1000.00": {
|
86
|
+
auto: !1,
|
87
|
+
label: () => "1000.00",
|
88
|
+
decimalSeparator: "."
|
89
|
+
},
|
90
|
+
"1000,00": {
|
91
|
+
auto: !1,
|
92
|
+
label: () => "1000,00",
|
93
|
+
decimalSeparator: ","
|
94
|
+
}
|
85
95
|
}, G = {
|
86
96
|
levels: [
|
87
97
|
{ level: 1, label: "years" },
|
@@ -127,7 +137,7 @@ let n = class extends T(W, {
|
|
127
137
|
this._precision = 2, this._commaDecimals = !1, this._thousandSeparator = !1;
|
128
138
|
else {
|
129
139
|
this._format = ((h = this.slotContent) == null ? void 0 : h.format) ?? ".0f";
|
130
|
-
const d =
|
140
|
+
const d = _(this._format ?? ".0f");
|
131
141
|
this._isAuto = ((p = d.typeFormat) == null ? void 0 : p.includes("a")) ?? !1, ["%", "a%", "y", "ay"].includes(d.typeFormat) ? this._displayAs = "percentage" : ["s", "as", "w", "aw"].includes(d.typeFormat) ? this._displayAs = "scientific" : this._displayAs = "general", this._precision = d.precision ? Number.parseInt(d.precision.replace(".", ""), 10) : this._displayAs === "scientific" ? 1 : 0, this._commaDecimals = ["z", "az", "y", "ay", "w", "aw"].includes(
|
132
142
|
d.typeFormat
|
133
143
|
), this._thousandSeparator = d.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");
|
@@ -138,7 +148,7 @@ let n = class extends T(W, {
|
|
138
148
|
this._displayAs = ((t = (e = this._displayAsElement) == null ? void 0 : e.selected) == null ? void 0 : t[0]) ?? "general", this._displayAs === "scientific" && (this._precision = Math.max(this._precision ?? 0, 1), this._thousandSeparator = !1), this._setNumericFormat(), this._sendEvent(), this.requestUpdate();
|
139
149
|
}
|
140
150
|
_setNumericSeparators(e) {
|
141
|
-
const t =
|
151
|
+
const t = $[(e == null ? void 0 : e.detail) ?? "Auto"];
|
142
152
|
this._thousandSeparator = [",", "."].includes(
|
143
153
|
(t == null ? void 0 : t.thousandSeparator) ?? ""
|
144
154
|
), this._commaDecimals = (t == null ? void 0 : t.decimalSeparator) === ",", this._isAuto = t == null ? void 0 : t.auto, this._setNumericFormat(), this._sendEvent();
|
@@ -157,7 +167,7 @@ let n = class extends T(W, {
|
|
157
167
|
const e = this._aggregationElement.value, t = this._aggregationFunc, o = this.slotContent.format;
|
158
168
|
if (e !== (t === "weightedaverage" ? "average" : t)) {
|
159
169
|
if (this._aggregationFunc = e === "average" && ((i = this._aggregationWeightColumn) != null && i.column) ? "weightedaverage" : e, t === "rate") {
|
160
|
-
const l =
|
170
|
+
const l = _(o), u = ["%", "y", "a%", "ay"].includes(
|
161
171
|
l.typeFormat
|
162
172
|
);
|
163
173
|
this.slotContent.subtype === "currency" && u && this._setNumericDisplayAs();
|
@@ -278,7 +288,7 @@ let n = class extends T(W, {
|
|
278
288
|
${this._durationLevels.length}
|
279
289
|
${this._durationLevels.length === 1 ? "level" : "levels"} active
|
280
290
|
<span class="duration-angle-down-icon">
|
281
|
-
${
|
291
|
+
${f(E)}
|
282
292
|
</span>
|
283
293
|
</luzmo-action-button>
|
284
294
|
<luzmo-overlay
|
@@ -303,8 +313,8 @@ let n = class extends T(W, {
|
|
303
313
|
</div>`;
|
304
314
|
}
|
305
315
|
_renderDurationFormatSettings() {
|
306
|
-
const e = Object.keys(
|
307
|
-
${
|
316
|
+
const e = Object.keys(A).map((t) => t === "time" && (this._maxDurationLevel ?? 1) < 6 ? "" : r`<luzmo-action-button value=${t}>
|
317
|
+
${A[t]()}
|
308
318
|
</luzmo-action-button>`);
|
309
319
|
return r` <div class="setting">
|
310
320
|
<luzmo-field-label for="duration-format">
|
@@ -324,9 +334,9 @@ let n = class extends T(W, {
|
|
324
334
|
</div>`;
|
325
335
|
}
|
326
336
|
_renderNumericDisplayAsSettings() {
|
327
|
-
const e = Object.keys(
|
337
|
+
const e = Object.keys(x).map(
|
328
338
|
(t) => r`<luzmo-action-button value=${t}
|
329
|
-
>${
|
339
|
+
>${x[t]}</luzmo-action-button
|
330
340
|
>`
|
331
341
|
);
|
332
342
|
return r`<div class="setting">
|
@@ -349,10 +359,10 @@ let n = class extends T(W, {
|
|
349
359
|
</div>`;
|
350
360
|
}
|
351
361
|
_renderNumericFormatSettings() {
|
352
|
-
const e = Object.
|
353
|
-
(t) =>
|
354
|
-
|
355
|
-
|
362
|
+
const e = Object.entries($).filter(
|
363
|
+
([, { hiddenFor: t }]) => !t || t !== this._displayAs
|
364
|
+
).map(
|
365
|
+
([t, { label: o }]) => r`<luzmo-menu-item value=${t}>${o()}</luzmo-menu-item>`
|
356
366
|
);
|
357
367
|
return r` <div class="setting">
|
358
368
|
<luzmo-field-label for="format">
|
@@ -400,7 +410,7 @@ let n = class extends T(W, {
|
|
400
410
|
<span class="no-weight-label">No weight</span>
|
401
411
|
</luzmo-menu-item>`,
|
402
412
|
...(this.measureColumns ?? []).flatMap((s) => {
|
403
|
-
const i = typeof s.datasetName == "object" ?
|
413
|
+
const i = typeof s.datasetName == "object" ? y(
|
404
414
|
s.datasetName,
|
405
415
|
this.language
|
406
416
|
) : s.datasetName, l = r`<div class="dataset-header">
|
@@ -409,12 +419,12 @@ let n = class extends T(W, {
|
|
409
419
|
${i}
|
410
420
|
</luzmo-tooltip>
|
411
421
|
</div>`, u = (s.columns ?? []).map((c) => {
|
412
|
-
const h = typeof c.name == "object" ?
|
413
|
-
>${
|
414
|
-
>` :
|
422
|
+
const h = typeof c.name == "object" ? y(c.name, this.language) : c.name, p = f(M(c, "s")), d = c.expression ? O("derived", "s") : void 0, v = !!d, F = v ? r`<span class="secondary-icon"
|
423
|
+
>${f(d)}</span
|
424
|
+
>` : b;
|
415
425
|
return r`<luzmo-menu-item value=${c.id}>
|
416
426
|
<span class="data-icon-type" slot="icon">
|
417
|
-
<span class=${
|
427
|
+
<span class=${v ? "with-secondary-icon" : ""}
|
418
428
|
>${p}</span
|
419
429
|
>
|
420
430
|
${F}
|
@@ -464,7 +474,15 @@ let n = class extends T(W, {
|
|
464
474
|
>
|
465
475
|
${t}
|
466
476
|
</luzmo-picker>
|
467
|
-
` :
|
477
|
+
` : r`<luzmo-picker
|
478
|
+
id="weighting-column"
|
479
|
+
size=${this.size}
|
480
|
+
variant="highlight"
|
481
|
+
icons="none"
|
482
|
+
value="none"
|
483
|
+
>
|
484
|
+
<luzmo-menu-item value="none">No weight</luzmo-menu-item>
|
485
|
+
</luzmo-picker>`}
|
468
486
|
</div>` : ""}
|
469
487
|
</div>`;
|
470
488
|
}
|
@@ -475,19 +493,19 @@ let n = class extends T(W, {
|
|
475
493
|
${this._displayMode === "duration" ? this._renderDurationLevelsSettings() : this._renderNumericDisplayAsSettings()}
|
476
494
|
${((e = this._durationLevels) == null ? void 0 : e.length) > 1 ? this._renderDurationFormatSettings() : this._renderNumericFormatSettings()}
|
477
495
|
</div>
|
478
|
-
${this._isFormula ?
|
496
|
+
${this._isFormula ? b : this._renderAggregationSettings()}
|
479
497
|
</div>
|
480
498
|
</div>`;
|
481
499
|
}
|
482
500
|
};
|
483
501
|
m([
|
484
|
-
|
502
|
+
z({ type: String, reflect: !0 })
|
485
503
|
], n.prototype, "language", 2);
|
486
504
|
m([
|
487
|
-
|
505
|
+
z({ type: Object, reflect: !0 })
|
488
506
|
], n.prototype, "slotContent", 2);
|
489
507
|
m([
|
490
|
-
|
508
|
+
z({ type: Array, reflect: !1 })
|
491
509
|
], n.prototype, "measureColumns", 2);
|
492
510
|
m([
|
493
511
|
g("#display-as")
|
@@ -21,7 +21,6 @@ export declare class LuzmoDraggableDataItem extends LuzmoDraggableDataItem_base
|
|
21
21
|
label: string;
|
22
22
|
description: string;
|
23
23
|
data: any;
|
24
|
-
linkedDatasetsIds: string[];
|
25
24
|
protected willUpdate(changedProperties: PropertyValues): void;
|
26
25
|
private renderSublevels;
|
27
26
|
protected render(): TemplateResult;
|
@@ -17,24 +17,22 @@
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
18
|
* SOFTWARE.
|
19
19
|
* */
|
20
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../localized-decorator-DIXYZ3RL.cjs"),m=require("../set-locale-DCPlazsZ.cjs"),
|
20
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../localized-decorator-DIXYZ3RL.cjs"),m=require("../set-locale-DCPlazsZ.cjs"),v=require("../periods.const-7sXlqgEo.cjs"),e=require("../property-Cu4Q1hS4.cjs"),p=require("../focusable-DAGGGYyz.cjs"),h=require("../sized-mixin-j_7aJM4b.cjs");require("../draggable-data-item-level/index.cjs");const y=":host{--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-1);--draggable-data-item-sublevels-gap: 0}:host([size=s]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-1)}:host([size=l]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-2)}:host([size=xl]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-3)}.draggable-data-item-sublevels{display:flex;flex-direction:column;gap:var(--luzmo-draggable-data-item-sublevels-gap, var(--draggable-data-item-sublevels-gap));margin:var(--luzmo-draggable-data-item-sublevels-margin-vertical, var(--draggable-data-item-sublevels-margin-vertical)) 0}:host{box-sizing:border-box}";var z=Object.defineProperty,D=Object.getOwnPropertyDescriptor,t=(n,l,s,i)=>{for(var a=i>1?void 0:i?D(l,s):l,g=n.length-1,o;g>=0;g--)(o=n[g])&&(a=(i?o(l,s,a):o(a))||a);return i&&a&&z(l,s,a),a};exports.LuzmoDraggableDataItem=class extends h.SizedMixin(p.LuzmoElement,{validSizes:["s","m","l","xl"],noDefaultSize:!0}){constructor(){super(...arguments),this.language="en",this.data={}}willUpdate(l){l.has("language")&&this.language!==m.getLocale()&&([...m.targetLocales].includes(this.language??"en")||this.language==="en")&&m.setLocale(this.language)}renderSublevels(){var s,i,a,g,o;let l;if(((s=this.data)==null?void 0:s.type)==="datetime")return l=((i=this.data)==null?void 0:i.subtype)==="date"?this.data.lowestLevel??5:this.data.lowestLevel??9,e.x`
|
21
21
|
<div class="draggable-data-item-sublevels">
|
22
|
-
${Array.from({length:l},(b,
|
22
|
+
${Array.from({length:l},(b,r)=>{const d=v.DATETIME_LEVELS[r].i18n(),u={...this.data,level:r+1};return e.x`<luzmo-draggable-data-item-level
|
23
23
|
sublevel
|
24
24
|
.data=${u}
|
25
|
-
.linkedDatasetsIds=${this.linkedDatasetsIds}
|
26
25
|
.language=${this.language}
|
27
26
|
.size=${this.size}
|
28
27
|
.variant=${this.variant}
|
29
28
|
.disabled=${this.disabled}
|
30
|
-
.label=${
|
29
|
+
.label=${d}
|
31
30
|
?hide-type-icon=${this.hideTypeIcon}
|
32
31
|
></luzmo-draggable-data-item-level>`})}
|
33
32
|
</div>
|
34
|
-
`;if(((
|
33
|
+
`;if(((a=this.data)==null?void 0:a.type)==="hierarchy"&&((o=(g=this.data)==null?void 0:g.hierarchyLevels)==null?void 0:o.length)>2){const b=this.data.hierarchyLevels.filter(r=>(r==null?void 0:r.level)>=1).map((r,d)=>{const u={...this.data,level:d,label:r.label};return e.x`<luzmo-draggable-data-item-level
|
35
34
|
sublevel
|
36
35
|
.data=${u}
|
37
|
-
.linkedDatasetsIds=${this.linkedDatasetsIds}
|
38
36
|
.language=${this.language}
|
39
37
|
.size=${this.size}
|
40
38
|
.variant=${this.variant}
|
@@ -45,7 +43,6 @@
|
|
45
43
|
`}return e.x``}render(){return e.x`
|
46
44
|
<luzmo-draggable-data-item-level
|
47
45
|
.data=${this.data}
|
48
|
-
.linkedDatasetsIds=${this.linkedDatasetsIds}
|
49
46
|
.language=${this.language}
|
50
47
|
.size=${this.size}
|
51
48
|
.variant=${this.variant}
|
@@ -56,4 +53,4 @@
|
|
56
53
|
?hide-type-icon=${this.hideTypeIcon}
|
57
54
|
></luzmo-draggable-data-item-level>
|
58
55
|
${this.hideSublevels?"":this.renderSublevels()}
|
59
|
-
`}};exports.LuzmoDraggableDataItem.styles=e.r(y);
|
56
|
+
`}};exports.LuzmoDraggableDataItem.styles=e.r(y);t([e.n({type:String,reflect:!0})],exports.LuzmoDraggableDataItem.prototype,"variant",2);t([e.n({type:String,reflect:!0})],exports.LuzmoDraggableDataItem.prototype,"language",2);t([e.n({type:Boolean,reflect:!0})],exports.LuzmoDraggableDataItem.prototype,"disabled",2);t([e.n({type:Boolean,reflect:!0,attribute:"hide-sublevels"})],exports.LuzmoDraggableDataItem.prototype,"hideSublevels",2);t([e.n({type:Boolean,reflect:!0,attribute:"hide-type-icon"})],exports.LuzmoDraggableDataItem.prototype,"hideTypeIcon",2);t([e.n({type:String,reflect:!0,attribute:"secondary-icon-type"})],exports.LuzmoDraggableDataItem.prototype,"secondaryIconType",2);t([e.n({type:String,reflect:!0})],exports.LuzmoDraggableDataItem.prototype,"label",2);t([e.n({type:String,reflect:!0})],exports.LuzmoDraggableDataItem.prototype,"description",2);t([e.n({type:Object})],exports.LuzmoDraggableDataItem.prototype,"data",2);exports.LuzmoDraggableDataItem=t([c.localized()],exports.LuzmoDraggableDataItem);customElements.get("luzmo-draggable-data-item")||customElements.define("luzmo-draggable-data-item",exports.LuzmoDraggableDataItem);
|
@@ -20,7 +20,7 @@
|
|
20
20
|
import { l as b } from "../localized-decorator-Bl5gcI6n.js";
|
21
21
|
import { g as p, t as h, s as f } from "../set-locale-GI34z_M7.js";
|
22
22
|
import { D as v } from "../periods.const-B7FKokcH.js";
|
23
|
-
import { x as n, r as y, n as
|
23
|
+
import { x as n, r as y, n as a } from "../property-DCzt3DR1.js";
|
24
24
|
import { L as x } from "../focusable-BbymtxWI.js";
|
25
25
|
import { S as $ } from "../sized-mixin-BGzkX2g1.js";
|
26
26
|
import "../draggable-data-item-level/index.js";
|
@@ -32,33 +32,32 @@ const z = () => {
|
|
32
32
|
};
|
33
33
|
z();
|
34
34
|
const w = ":host{--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-1);--draggable-data-item-sublevels-gap: 0}:host([size=s]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-1)}:host([size=l]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-2)}:host([size=xl]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-3)}.draggable-data-item-sublevels{display:flex;flex-direction:column;gap:var(--luzmo-draggable-data-item-sublevels-gap, var(--draggable-data-item-sublevels-gap));margin:var(--luzmo-draggable-data-item-sublevels-margin-vertical, var(--draggable-data-item-sublevels-margin-vertical)) 0}:host{box-sizing:border-box}";
|
35
|
-
var S = Object.defineProperty,
|
36
|
-
for (var
|
37
|
-
(
|
38
|
-
return s &&
|
35
|
+
var S = Object.defineProperty, L = Object.getOwnPropertyDescriptor, r = (o, i, u, s) => {
|
36
|
+
for (var l = s > 1 ? void 0 : s ? L(i, u) : i, m = o.length - 1, d; m >= 0; m--)
|
37
|
+
(d = o[m]) && (l = (s ? d(i, u, l) : d(l)) || l);
|
38
|
+
return s && l && S(i, u, l), l;
|
39
39
|
};
|
40
40
|
let e = class extends $(x, {
|
41
41
|
validSizes: ["s", "m", "l", "xl"],
|
42
42
|
noDefaultSize: !0
|
43
43
|
}) {
|
44
44
|
constructor() {
|
45
|
-
super(...arguments), this.language = "en", this.data = {}
|
45
|
+
super(...arguments), this.language = "en", this.data = {};
|
46
46
|
}
|
47
47
|
willUpdate(o) {
|
48
48
|
o.has("language") && this.language !== p() && ([...h].includes(this.language ?? "en") || this.language === "en") && f(this.language);
|
49
49
|
}
|
50
50
|
renderSublevels() {
|
51
|
-
var i, u, s,
|
51
|
+
var i, u, s, l, m;
|
52
52
|
let o;
|
53
53
|
if (((i = this.data) == null ? void 0 : i.type) === "datetime")
|
54
54
|
return o = ((u = this.data) == null ? void 0 : u.subtype) === "date" ? this.data.lowestLevel ?? 5 : this.data.lowestLevel ?? 9, n`
|
55
55
|
<div class="draggable-data-item-sublevels">
|
56
|
-
${Array.from({ length: o }, (
|
57
|
-
const c = v[
|
56
|
+
${Array.from({ length: o }, (d, t) => {
|
57
|
+
const c = v[t].i18n(), g = { ...this.data, level: t + 1 };
|
58
58
|
return n`<luzmo-draggable-data-item-level
|
59
59
|
sublevel
|
60
60
|
.data=${g}
|
61
|
-
.linkedDatasetsIds=${this.linkedDatasetsIds}
|
62
61
|
.language=${this.language}
|
63
62
|
.size=${this.size}
|
64
63
|
.variant=${this.variant}
|
@@ -69,13 +68,12 @@ let e = class extends $(x, {
|
|
69
68
|
})}
|
70
69
|
</div>
|
71
70
|
`;
|
72
|
-
if (((s = this.data) == null ? void 0 : s.type) === "hierarchy" && ((
|
73
|
-
const
|
74
|
-
const g = { ...this.data, level: c, label:
|
71
|
+
if (((s = this.data) == null ? void 0 : s.type) === "hierarchy" && ((m = (l = this.data) == null ? void 0 : l.hierarchyLevels) == null ? void 0 : m.length) > 2) {
|
72
|
+
const d = this.data.hierarchyLevels.filter((t) => (t == null ? void 0 : t.level) >= 1).map((t, c) => {
|
73
|
+
const g = { ...this.data, level: c, label: t.label };
|
75
74
|
return n`<luzmo-draggable-data-item-level
|
76
75
|
sublevel
|
77
76
|
.data=${g}
|
78
|
-
.linkedDatasetsIds=${this.linkedDatasetsIds}
|
79
77
|
.language=${this.language}
|
80
78
|
.size=${this.size}
|
81
79
|
.variant=${this.variant}
|
@@ -84,7 +82,7 @@ let e = class extends $(x, {
|
|
84
82
|
></luzmo-draggable-data-item-level>`;
|
85
83
|
});
|
86
84
|
return n`
|
87
|
-
<div class="draggable-data-item-sublevels">${
|
85
|
+
<div class="draggable-data-item-sublevels">${d}</div>
|
88
86
|
`;
|
89
87
|
}
|
90
88
|
return n``;
|
@@ -93,7 +91,6 @@ let e = class extends $(x, {
|
|
93
91
|
return n`
|
94
92
|
<luzmo-draggable-data-item-level
|
95
93
|
.data=${this.data}
|
96
|
-
.linkedDatasetsIds=${this.linkedDatasetsIds}
|
97
94
|
.language=${this.language}
|
98
95
|
.size=${this.size}
|
99
96
|
.variant=${this.variant}
|
@@ -108,37 +105,34 @@ let e = class extends $(x, {
|
|
108
105
|
}
|
109
106
|
};
|
110
107
|
e.styles = y(w);
|
111
|
-
|
112
|
-
|
108
|
+
r([
|
109
|
+
a({ type: String, reflect: !0 })
|
113
110
|
], e.prototype, "variant", 2);
|
114
|
-
|
115
|
-
|
111
|
+
r([
|
112
|
+
a({ type: String, reflect: !0 })
|
116
113
|
], e.prototype, "language", 2);
|
117
|
-
|
118
|
-
|
114
|
+
r([
|
115
|
+
a({ type: Boolean, reflect: !0 })
|
119
116
|
], e.prototype, "disabled", 2);
|
120
|
-
|
121
|
-
|
117
|
+
r([
|
118
|
+
a({ type: Boolean, reflect: !0, attribute: "hide-sublevels" })
|
122
119
|
], e.prototype, "hideSublevels", 2);
|
123
|
-
|
124
|
-
|
120
|
+
r([
|
121
|
+
a({ type: Boolean, reflect: !0, attribute: "hide-type-icon" })
|
125
122
|
], e.prototype, "hideTypeIcon", 2);
|
126
|
-
|
127
|
-
|
123
|
+
r([
|
124
|
+
a({ type: String, reflect: !0, attribute: "secondary-icon-type" })
|
128
125
|
], e.prototype, "secondaryIconType", 2);
|
129
|
-
|
130
|
-
|
126
|
+
r([
|
127
|
+
a({ type: String, reflect: !0 })
|
131
128
|
], e.prototype, "label", 2);
|
132
|
-
|
133
|
-
|
129
|
+
r([
|
130
|
+
a({ type: String, reflect: !0 })
|
134
131
|
], e.prototype, "description", 2);
|
135
|
-
|
136
|
-
|
132
|
+
r([
|
133
|
+
a({ type: Object })
|
137
134
|
], e.prototype, "data", 2);
|
138
|
-
|
139
|
-
t({ type: Array, attribute: "linked-datasets-ids" })
|
140
|
-
], e.prototype, "linkedDatasetsIds", 2);
|
141
|
-
e = l([
|
135
|
+
e = r([
|
142
136
|
b()
|
143
137
|
], e);
|
144
138
|
customElements.get("luzmo-draggable-data-item") || customElements.define("luzmo-draggable-data-item", e);
|
@@ -22,8 +22,8 @@ export declare class LuzmoDraggableDataItemLevel extends LuzmoDraggableDataItemL
|
|
22
22
|
description: string;
|
23
23
|
secondaryIconType?: 'derived' | 'formula';
|
24
24
|
data: any;
|
25
|
-
linkedDatasetsIds: string[];
|
26
25
|
private _cleanupDraggable;
|
26
|
+
private _isCurrentlyHighlighted;
|
27
27
|
private _handleHighlight;
|
28
28
|
private _clearHighlight;
|
29
29
|
disconnectedCallback(): void;
|