@luzmo/analytics-components-kit 1.0.1-alpha.32 → 1.0.1-alpha.34
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-numeric/display-settings-numeric.d.ts +1 -0
- package/components/display-settings-numeric/index.cjs +5 -5
- package/components/display-settings-numeric/index.js +40 -40
- package/components/edit-item/index.cjs +1 -1
- package/components/edit-item/index.js +2 -2
- package/package.json +1 -1
@@ -42,6 +42,7 @@ export declare class LuzmoDisplaySettingsNumeric extends LuzmoDisplaySettingsNum
|
|
42
42
|
private _maxDurationLevel?;
|
43
43
|
private _aggregationFunc?;
|
44
44
|
private _aggregationWeightColumn?;
|
45
|
+
private _isFormula?;
|
45
46
|
private _displayAsElement;
|
46
47
|
private _precisionElement;
|
47
48
|
private _aggregationElement;
|
@@ -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 s=require("../set-locale-5FFfQpVQ.cjs"),b=require("../localized-decorator-ClAOFk8M.cjs");require("../index-C2PPSv8E.cjs");require("../index-CnpJUw_z.cjs");require("../index-j8UKjHqY.cjs");require("../index-Bafc5poK.cjs");require("../index-CBOAQ3-E.cjs");require("../index-c2uKLWDt.cjs");require("../index-BoXbQm2o.cjs");const v=require("../decompose-numeric-format-B3rVVHpO.cjs"),o=require("../property-Dlf9S6Jz.cjs"),f=require("../luzmo-icons-Nyf1P71v.cjs"),S=require("../index-DF-s3cEL.cjs"),A=require("../state-CrfOw8Zp.cjs"),m=require("../query-D5qWDopr.cjs"),D=require("../focusable-_wp5pWO-.cjs"),y=require("../sized-mixin-ZTphZKLm.cjs"),F=":host .settings-container{display:flex;flex-direction:column;gap:var(--luzmo-spacing-2)}:host .settings-row{display:flex;justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-numeric-gap, var(--display-settings-numeric-gap))}.duration-angle-down-icon{margin-inline-start:var(--luzmo-numeric-duration-levels-dropdown-icon-margin-inline-start, var(--numeric-duration-levels-dropdown-icon-margin-inline-start))}:host{--display-settings-numeric-gap: var(--luzmo-spacing-3);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-2 )}:host([size=s]){--display-settings-numeric-gap: var(--luzmo-spacing-3);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-1 )}:host([size=l]){--display-settings-numeric-gap: var(--luzmo-spacing-4);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-3 )}:host([size=xl]){--display-settings-numeric-gap: var(--luzmo-spacing-5);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-4 )}",$={sum:()=>s.msg("Sum",{desc:"Numeric Aggregation option"}),cumulativesum:()=>s.msg("Cumulative sum",{desc:"Numeric Aggregation option"}),average:()=>s.msg("Average",{desc:"Numeric Aggregation option"}),weightedaverage:()=>s.msg("Weighted average",{desc:"Numeric Aggregation option"}),median:()=>s.msg("Median",{desc:"Numeric Aggregation option"}),count:()=>s.msg("Count",{desc:"Numeric Aggregation option"}),distinctcount:()=>s.msg("Distinct count",{desc:"Numeric Aggregation option"}),min:()=>s.msg("Minimum",{desc:"Numeric Aggregation option"}),max:()=>s.msg("Maximum",{desc:"Numeric Aggregation option"}),stddev:()=>s.msg("Standard deviation",{desc:"Numeric Aggregation option"}),rate:()=>s.msg("Rate",{desc:"Numeric Aggregation option"})},z={general:"123",percentage:"%",scientific:"SI"},L={time:()=>s.msg("Time",{desc:"Time format option"}),short:()=>s.msg("Short",{desc:"Short format option"}),long:()=>s.msg("Long",{desc:"Long format option"})},p={Auto:{auto:!0,label:()=>s.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:","}},N={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 C=Object.defineProperty,x=Object.getOwnPropertyDescriptor,r=(h,t,e,i)=>{for(var n=i>1?void 0:i?x(t,e):t,a=h.length-1,l;a>=0;a--)(l=h[a])&&(n=(i?l(t,e,n):l(n))||n);return i&&n&&C(t,e,n),n};exports.LuzmoDisplaySettingsNumeric=class extends y.SizedMixin(D.LuzmoElement,{validSizes:Object.values(y.ElementSizes)}){constructor(){super(...arguments),this.language="en",this.slotContent={},this.measureColumns=[],this._durationLevels=[],this._renderDurationLevelMenu=!1,this._sendEvent=()=>{const t={...this.slotContent};t.format=this._format,t.aggregationFunc=this._aggregationFunc,this._aggregationWeightColumn?t.aggregationWeight={...this._aggregationWeightColumn}:this._aggregationFunc==="rate"&&(t.aggregationFunc="average"),this._displayMode==="duration"?(t.duration=t.duration??{},t.duration.format=this._durationFormat,t.duration.levels=this._durationLevels):delete t.duration,this.dispatchEvent(new CustomEvent("slot-content-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:t}}))}}static get styles(){return[o.r(F)]}_parseSavedNumericFormatSettings(){var t,e,i,n,a,l,g,c,d,_;if(this._displayMode=((t=this.slotContent)==null?void 0:t.subtype)==="duration"?((n=(i=(e=this.slotContent)==null?void 0:e.duration)==null?void 0:i.levels)==null?void 0:n.length)===1?"numeric":"duration":"numeric",this._durationFormat=((l=(a=this.slotContent)==null?void 0:a.duration)==null?void 0:l.format)??"short",this._durationLevels=((c=(g=this.slotContent)==null?void 0:g.duration)==null?void 0:c.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 u=v.decomposeNumericFormat(this._format??".0f");this._isAuto=((_=u.typeFormat)==null?void 0:_.includes("a"))??!1,["%","a%","y","ay"].includes(u.typeFormat)?this._displayAs="percentage":["s","as","w","aw"].includes(u.typeFormat)?this._displayAs="scientific":this._displayAs="general",this._precision=u.precision?Number.parseInt(u.precision.replace(".",""),10):this._displayAs==="scientific"?1:0,this._commaDecimals=["z","az","y","ay","w","aw"].includes(u.typeFormat),this._thousandSeparator=u.comma===",",this._isAuto?this._numericFormatGroup="Auto":this._commaDecimals&&this._thousandSeparator?this._numericFormatGroup="1.000,00":!this._commaDecimals&&this._thousandSeparator?this._numericFormatGroup="1,000.00":this._commaDecimals&&!this._thousandSeparator?this._numericFormatGroup="1000,00":!this._commaDecimals&&!this._thousandSeparator&&(this._numericFormatGroup="1000.00")}}_setNumericDisplayAs(){var t,e;this._displayAs=((e=(t=this._displayAsElement)==null?void 0:t.selected)==null?void 0:e[0])??"general",this._displayAs==="scientific"&&(this._precision=Math.max(this._precision??0,1),this._thousandSeparator=!1),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setNumericSeparators(t){const e=p[(t==null?void 0:t.detail)??"Auto"];this._thousandSeparator=[",","."].includes((e==null?void 0:e.thousandSeparator)??""),this._commaDecimals=(e==null?void 0:e.decimalSeparator)===",",this._isAuto=e==null?void 0:e.auto,this._setNumericFormat(),this._sendEvent()}_setPrecision(){this._precision=this._precisionElement.value,this._setNumericFormat(),this._sendEvent()}_setNumericFormat(){var i;let t="f";const e=this.slotContent.subtype==="duration"?this._durationLevels&&((i=this._durationLevels)==null?void 0:i.length)===1?"numeric":"duration":"numeric";this._maxDurationLevel=Math.min(...this._durationLevels),e==="duration"?(!["time","short","long"].includes(this._durationFormat??"")||this._maxDurationLevel<6&&this._durationFormat==="time")&&(this._durationFormat="short"):(this._displayAs==="general"&&this._commaDecimals?t="z":this._displayAs==="percentage"&&this._commaDecimals?t="y":this._displayAs==="scientific"&&this._commaDecimals?t="w":this._displayAs==="percentage"?t="%":this._displayAs==="scientific"&&(t="s"),this._format=(this._thousandSeparator||this._isAuto?",":"")+"."+this._precision+(this._isAuto?"a":"")+t)}_setAggregationFunc(){const t=this._aggregationFunc,e=this.slotContent.format;if(this._aggregationElement.value!==t){if(this._aggregationFunc=this._aggregationElement.value,t==="rate"){const i=v.decomposeNumericFormat(e),n=["%","y","a%","ay"].includes(i.typeFormat);this.slotContent.subtype==="currency"&&n&&this._setNumericDisplayAs()}this._sendEvent(),(this._aggregationFunc==="rate"||t==="rate")&&this.requestUpdate()}}_setAggregationWeight(){const t=this._aggregationWeightElement.value;if(t==="none")this._aggregationWeightColumn=void 0;else{const e=this.measureColumns.find(i=>i.columnId===t);this._aggregationWeightColumn={column:e==null?void 0:e.columnId,set:e==null?void 0:e.datasetId,columnSubType:e==null?void 0:e.subtype}}this._sendEvent()}_setDurationLevels(){const t=this._durationLevels,e=this._durationLevelsElement.value.split(",").filter(i=>i!=="").map(i=>Number.parseInt(i,10));this._durationLevels=((e==null?void 0:e.length)??0)>=1?e:t,this._maxDurationLevel=Math.min(...this._durationLevels),this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setDurationFormat(){var t,e;this._durationFormat=(e=(t=this._durationFormatElement)==null?void 0:t.selected)==null?void 0:e[0],this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_fillTimeDurationLevels(){if(this._durationFormat==="time"){const t=this._durationLevels.sort().at(-1);if([7,8,9].includes(t)){const e={lev7:[6],lev8:[6,7],lev9:[6,7,8]};for(const i of e["lev"+t])this._durationLevels.includes(i)||this._durationLevels.push(i);this._durationLevels=[...this._durationLevels].sort()}}}willUpdate(t){var e,i,n;t.has("slotContent")&&(this._parseSavedNumericFormatSettings(),this._aggregationFunc=((e=this.slotContent)==null?void 0:e.aggregationFunc)??((i=this.slotContent)==null?void 0:i.type)==="numeric"?"sum":"count",this._aggregationWeightColumn=(n=this.slotContent)==null?void 0:n.aggregationWeight),t.has("language")&&this.language!==s.getLocale()&&([...s.targetLocales].includes(this.language??"en")||this.language==="en")&&s.setLocale(this.language)}firstUpdated(){var t;(t=this.slotContent)!=null&&t.duration&&this._durationLevelsOverlay.addEventListener("slottable-request",e=>{this._renderDurationLevelMenu=e.data!==S.a})}_renderDurationLevelsSettings(){const t=N.levels.map(e=>{let i=!1;return this._durationFormat==="time"&&e.level>=6&&this._durationLevels.includes(e.level)&&e.level!==Math.max(...this._durationLevels)&&(i=!0),this._durationLevels.length===1&&this._durationLevels.includes(e.level)&&(i=!0),o.x`<luzmo-menu-item
|
20
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../set-locale-5FFfQpVQ.cjs"),b=require("../localized-decorator-ClAOFk8M.cjs");require("../index-C2PPSv8E.cjs");require("../index-CnpJUw_z.cjs");require("../index-j8UKjHqY.cjs");require("../index-Bafc5poK.cjs");require("../index-CBOAQ3-E.cjs");require("../index-c2uKLWDt.cjs");require("../index-BoXbQm2o.cjs");const v=require("../decompose-numeric-format-B3rVVHpO.cjs"),o=require("../property-Dlf9S6Jz.cjs"),f=require("../luzmo-icons-Nyf1P71v.cjs"),S=require("../index-DF-s3cEL.cjs"),A=require("../state-CrfOw8Zp.cjs"),m=require("../query-D5qWDopr.cjs"),F=require("../focusable-_wp5pWO-.cjs"),y=require("../sized-mixin-ZTphZKLm.cjs"),D=":host .settings-container{display:flex;flex-direction:column;gap:var(--luzmo-spacing-2)}:host .settings-row{display:flex;justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-numeric-gap, var(--display-settings-numeric-gap))}.duration-angle-down-icon{margin-inline-start:var(--luzmo-numeric-duration-levels-dropdown-icon-margin-inline-start, var(--numeric-duration-levels-dropdown-icon-margin-inline-start))}:host{--display-settings-numeric-gap: var(--luzmo-spacing-3);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-2 )}:host([size=s]){--display-settings-numeric-gap: var(--luzmo-spacing-3);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-1 )}:host([size=l]){--display-settings-numeric-gap: var(--luzmo-spacing-4);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-3 )}:host([size=xl]){--display-settings-numeric-gap: var(--luzmo-spacing-5);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-4 )}",$={sum:()=>s.msg("Sum",{desc:"Numeric Aggregation option"}),cumulativesum:()=>s.msg("Cumulative sum",{desc:"Numeric Aggregation option"}),average:()=>s.msg("Average",{desc:"Numeric Aggregation option"}),weightedaverage:()=>s.msg("Weighted average",{desc:"Numeric Aggregation option"}),median:()=>s.msg("Median",{desc:"Numeric Aggregation option"}),count:()=>s.msg("Count",{desc:"Numeric Aggregation option"}),distinctcount:()=>s.msg("Distinct count",{desc:"Numeric Aggregation option"}),min:()=>s.msg("Minimum",{desc:"Numeric Aggregation option"}),max:()=>s.msg("Maximum",{desc:"Numeric Aggregation option"}),stddev:()=>s.msg("Standard deviation",{desc:"Numeric Aggregation option"}),rate:()=>s.msg("Rate",{desc:"Numeric Aggregation option"})},z={general:"123",percentage:"%",scientific:"SI"},L={time:()=>s.msg("Time",{desc:"Time format option"}),short:()=>s.msg("Short",{desc:"Short format option"}),long:()=>s.msg("Long",{desc:"Long format option"})},p={Auto:{auto:!0,label:()=>s.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:","}},N={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 C=Object.defineProperty,E=Object.getOwnPropertyDescriptor,l=(h,t,e,i)=>{for(var n=i>1?void 0:i?E(t,e):t,a=h.length-1,r;a>=0;a--)(r=h[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&C(t,e,n),n};exports.LuzmoDisplaySettingsNumeric=class extends y.SizedMixin(F.LuzmoElement,{validSizes:Object.values(y.ElementSizes)}){constructor(){super(...arguments),this.language="en",this.slotContent={},this.measureColumns=[],this._durationLevels=[],this._renderDurationLevelMenu=!1,this._sendEvent=()=>{const t={...this.slotContent};t.format=this._format,t.aggregationFunc=this._aggregationFunc,this._aggregationWeightColumn?t.aggregationWeight={...this._aggregationWeightColumn}:this._aggregationFunc==="rate"&&(t.aggregationFunc="average"),this._displayMode==="duration"?(t.duration=t.duration??{},t.duration.format=this._durationFormat,t.duration.levels=this._durationLevels):delete t.duration,this.dispatchEvent(new CustomEvent("slot-content-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:t}}))}}static get styles(){return[o.r(D)]}_parseSavedNumericFormatSettings(){var t,e,i,n,a,r,g,c,d,_;if(this._displayMode=((t=this.slotContent)==null?void 0:t.subtype)==="duration"?((n=(i=(e=this.slotContent)==null?void 0:e.duration)==null?void 0:i.levels)==null?void 0:n.length)===1?"numeric":"duration":"numeric",this._durationFormat=((r=(a=this.slotContent)==null?void 0:a.duration)==null?void 0:r.format)??"short",this._durationLevels=((c=(g=this.slotContent)==null?void 0:g.duration)==null?void 0:c.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 u=v.decomposeNumericFormat(this._format??".0f");this._isAuto=((_=u.typeFormat)==null?void 0:_.includes("a"))??!1,["%","a%","y","ay"].includes(u.typeFormat)?this._displayAs="percentage":["s","as","w","aw"].includes(u.typeFormat)?this._displayAs="scientific":this._displayAs="general",this._precision=u.precision?Number.parseInt(u.precision.replace(".",""),10):this._displayAs==="scientific"?1:0,this._commaDecimals=["z","az","y","ay","w","aw"].includes(u.typeFormat),this._thousandSeparator=u.comma===",",this._isAuto?this._numericFormatGroup="Auto":this._commaDecimals&&this._thousandSeparator?this._numericFormatGroup="1.000,00":!this._commaDecimals&&this._thousandSeparator?this._numericFormatGroup="1,000.00":this._commaDecimals&&!this._thousandSeparator?this._numericFormatGroup="1000,00":!this._commaDecimals&&!this._thousandSeparator&&(this._numericFormatGroup="1000.00")}}_setNumericDisplayAs(){var t,e;this._displayAs=((e=(t=this._displayAsElement)==null?void 0:t.selected)==null?void 0:e[0])??"general",this._displayAs==="scientific"&&(this._precision=Math.max(this._precision??0,1),this._thousandSeparator=!1),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setNumericSeparators(t){const e=p[(t==null?void 0:t.detail)??"Auto"];this._thousandSeparator=[",","."].includes((e==null?void 0:e.thousandSeparator)??""),this._commaDecimals=(e==null?void 0:e.decimalSeparator)===",",this._isAuto=e==null?void 0:e.auto,this._setNumericFormat(),this._sendEvent()}_setPrecision(){this._precision=this._precisionElement.value,this._setNumericFormat(),this._sendEvent()}_setNumericFormat(){var i;let t="f";const e=this.slotContent.subtype==="duration"?this._durationLevels&&((i=this._durationLevels)==null?void 0:i.length)===1?"numeric":"duration":"numeric";this._maxDurationLevel=Math.min(...this._durationLevels),e==="duration"?(!["time","short","long"].includes(this._durationFormat??"")||this._maxDurationLevel<6&&this._durationFormat==="time")&&(this._durationFormat="short"):(this._displayAs==="general"&&this._commaDecimals?t="z":this._displayAs==="percentage"&&this._commaDecimals?t="y":this._displayAs==="scientific"&&this._commaDecimals?t="w":this._displayAs==="percentage"?t="%":this._displayAs==="scientific"&&(t="s"),this._format=(this._thousandSeparator||this._isAuto?",":"")+"."+this._precision+(this._isAuto?"a":"")+t)}_setAggregationFunc(){const t=this._aggregationFunc,e=this.slotContent.format;if(this._aggregationElement.value!==t){if(this._aggregationFunc=this._aggregationElement.value,t==="rate"){const i=v.decomposeNumericFormat(e),n=["%","y","a%","ay"].includes(i.typeFormat);this.slotContent.subtype==="currency"&&n&&this._setNumericDisplayAs()}this._sendEvent(),(this._aggregationFunc==="rate"||t==="rate")&&this.requestUpdate()}}_setAggregationWeight(){const t=this._aggregationWeightElement.value;if(t==="none")this._aggregationWeightColumn=void 0;else{const e=this.measureColumns.find(i=>i.columnId===t);this._aggregationWeightColumn={column:e==null?void 0:e.columnId,set:e==null?void 0:e.datasetId,columnSubType:e==null?void 0:e.subtype}}this._sendEvent()}_setDurationLevels(){const t=this._durationLevels,e=this._durationLevelsElement.value.split(",").filter(i=>i!=="").map(i=>Number.parseInt(i,10));this._durationLevels=((e==null?void 0:e.length)??0)>=1?e:t,this._maxDurationLevel=Math.min(...this._durationLevels),this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setDurationFormat(){var t,e;this._durationFormat=(e=(t=this._durationFormatElement)==null?void 0:t.selected)==null?void 0:e[0],this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_fillTimeDurationLevels(){if(this._durationFormat==="time"){const t=this._durationLevels.sort().at(-1);if([7,8,9].includes(t)){const e={lev7:[6],lev8:[6,7],lev9:[6,7,8]};for(const i of e["lev"+t])this._durationLevels.includes(i)||this._durationLevels.push(i);this._durationLevels=[...this._durationLevels].sort()}}}willUpdate(t){var e,i,n,a,r;t.has("slotContent")&&(this._parseSavedNumericFormatSettings(),this._aggregationFunc=((e=this.slotContent)==null?void 0:e.aggregationFunc)??((i=this.slotContent)==null?void 0:i.type)==="numeric"?"sum":"count",this._aggregationWeightColumn=(n=this.slotContent)==null?void 0:n.aggregationWeight,this._isFormula=((a=this.slotContent)==null?void 0:a.formula)||((r=this.slotContent)==null?void 0:r.formulaId)),t.has("language")&&this.language!==s.getLocale()&&([...s.targetLocales].includes(this.language??"en")||this.language==="en")&&s.setLocale(this.language)}firstUpdated(){var t;(t=this.slotContent)!=null&&t.duration&&this._durationLevelsOverlay.addEventListener("slottable-request",e=>{this._renderDurationLevelMenu=e.data!==S.a})}_renderDurationLevelsSettings(){const t=N.levels.map(e=>{let i=!1;return this._durationFormat==="time"&&e.level>=6&&this._durationLevels.includes(e.level)&&e.level!==Math.max(...this._durationLevels)&&(i=!0),this._durationLevels.length===1&&this._durationLevels.includes(e.level)&&(i=!0),o.x`<luzmo-menu-item
|
21
21
|
value=${e.level}
|
22
22
|
?selected=${this._durationLevels.includes(e.level)}
|
23
23
|
?disabled=${i}
|
@@ -115,8 +115,8 @@
|
|
115
115
|
value=${this._precision??(this._displayAs==="scientific"?1:0)}
|
116
116
|
@change=${this._setPrecision}
|
117
117
|
></luzmo-number-field>
|
118
|
-
</div>`}_renderAggregationSettings(){var i,n;const t=Object.entries($).map(([a,
|
119
|
-
${
|
118
|
+
</div>`}_renderAggregationSettings(){var i,n;const t=Object.entries($).map(([a,r])=>o.x`<luzmo-menu-item value=${a}>${r()}</luzmo-menu-item>`),e=[o.x`<luzmo-menu-item value="none">No weight</luzmo-menu-item>`,...this.measureColumns.map(a=>{var g,c,d;const r=((g=a==null?void 0:a.label)==null?void 0:g[this.language??"en"])??((d=a==null?void 0:a.label)==null?void 0:d[(c=Object.keys(a==null?void 0:a.label))==null?void 0:c[0]])??"Untitled";return o.x`<luzmo-menu-item value=${a.id}>
|
119
|
+
${r}
|
120
120
|
</luzmo-menu-item>`})];return o.x`<div class="settings-row">
|
121
121
|
<div class="setting">
|
122
122
|
<luzmo-field-label for="aggregation">
|
@@ -151,6 +151,6 @@
|
|
151
151
|
${this._displayMode==="duration"?this._renderDurationLevelsSettings():this._renderNumericDisplayAsSettings()}
|
152
152
|
${((t=this._durationLevels)==null?void 0:t.length)>1?this._renderDurationFormatSettings():this._renderNumericFormatSettings()}
|
153
153
|
</div>
|
154
|
-
${this._renderAggregationSettings()}
|
154
|
+
${this._isFormula?o.E:this._renderAggregationSettings()}
|
155
155
|
</div>
|
156
|
-
</div>`}};
|
156
|
+
</div>`}};l([o.n({type:String,reflect:!0})],exports.LuzmoDisplaySettingsNumeric.prototype,"language",2);l([o.n({type:Object,reflect:!0})],exports.LuzmoDisplaySettingsNumeric.prototype,"slotContent",2);l([o.n({type:Array,reflect:!1})],exports.LuzmoDisplaySettingsNumeric.prototype,"measureColumns",2);l([m.e("#display-as")],exports.LuzmoDisplaySettingsNumeric.prototype,"_displayAsElement",2);l([m.e("#precision")],exports.LuzmoDisplaySettingsNumeric.prototype,"_precisionElement",2);l([m.e("#aggregation")],exports.LuzmoDisplaySettingsNumeric.prototype,"_aggregationElement",2);l([m.e("#weighting-column")],exports.LuzmoDisplaySettingsNumeric.prototype,"_aggregationWeightElement",2);l([m.e("#duration-levels")],exports.LuzmoDisplaySettingsNumeric.prototype,"_durationLevelsElement",2);l([m.e("#duration-format")],exports.LuzmoDisplaySettingsNumeric.prototype,"_durationFormatElement",2);l([m.e("#duration-levels-overlay")],exports.LuzmoDisplaySettingsNumeric.prototype,"_durationLevelsOverlay",2);l([A.r()],exports.LuzmoDisplaySettingsNumeric.prototype,"_renderDurationLevelMenu",2);exports.LuzmoDisplaySettingsNumeric=l([b.localized()],exports.LuzmoDisplaySettingsNumeric);customElements.get("luzmo-display-settings-numeric")||customElements.define("luzmo-display-settings-numeric",exports.LuzmoDisplaySettingsNumeric);
|
@@ -27,13 +27,13 @@ import "../index-Desl7GJ0.js";
|
|
27
27
|
import "../index-BwsEWpIS.js";
|
28
28
|
import "../index-CTVNGPeT.js";
|
29
29
|
import { d as v } from "../decompose-numeric-format-BuZcjH2k.js";
|
30
|
-
import { r as S, x as a, n as f } from "../property-CxtZroGf.js";
|
31
|
-
import { a3 as
|
32
|
-
import { a as
|
33
|
-
import { r as
|
30
|
+
import { r as S, x as a, E as $, n as f } from "../property-CxtZroGf.js";
|
31
|
+
import { a3 as D, a9 as w } from "../luzmo-icons-CPucBq6e.js";
|
32
|
+
import { a as C } from "../index-BCBLJ-ei.js";
|
33
|
+
import { r as N } from "../state-BVYsk_HZ.js";
|
34
34
|
import { e as d } from "../query-Ddbd72Um.js";
|
35
|
-
import { L as
|
36
|
-
import { S as
|
35
|
+
import { L as E } from "../focusable-DB6Uhr-C.js";
|
36
|
+
import { S as M, E as O } from "../sized-mixin-C7R5uRbF.js";
|
37
37
|
const y = () => {
|
38
38
|
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
39
39
|
const t = document.createElement("style");
|
@@ -41,7 +41,7 @@ const y = () => {
|
|
41
41
|
}
|
42
42
|
};
|
43
43
|
y();
|
44
|
-
const
|
44
|
+
const I = ":host .settings-container{display:flex;flex-direction:column;gap:var(--luzmo-spacing-2)}:host .settings-row{display:flex;justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-numeric-gap, var(--display-settings-numeric-gap))}.duration-angle-down-icon{margin-inline-start:var(--luzmo-numeric-duration-levels-dropdown-icon-margin-inline-start, var(--numeric-duration-levels-dropdown-icon-margin-inline-start))}:host{--display-settings-numeric-gap: var(--luzmo-spacing-3);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-2 )}:host([size=s]){--display-settings-numeric-gap: var(--luzmo-spacing-3);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-1 )}:host([size=l]){--display-settings-numeric-gap: var(--luzmo-spacing-4);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-3 )}:host([size=xl]){--display-settings-numeric-gap: var(--luzmo-spacing-5);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-4 )}", k = {
|
45
45
|
sum: () => s("Sum", { desc: "Numeric Aggregation option" }),
|
46
46
|
cumulativesum: () => s("Cumulative sum", { desc: "Numeric Aggregation option" }),
|
47
47
|
average: () => s("Average", { desc: "Numeric Aggregation option" }),
|
@@ -80,7 +80,7 @@ const O = ":host .settings-container{display:flex;flex-direction:column;gap:var(
|
|
80
80
|
},
|
81
81
|
"1000.00": { auto: !1, label: () => "1000.00", decimalSeparator: "." },
|
82
82
|
"1000,00": { auto: !1, label: () => "1000,00", decimalSeparator: "," }
|
83
|
-
},
|
83
|
+
}, T = {
|
84
84
|
levels: [
|
85
85
|
{ level: 1, label: "years" },
|
86
86
|
{ level: 2, label: "quarters" },
|
@@ -93,13 +93,13 @@ const O = ":host .settings-container{display:flex;flex-direction:column;gap:var(
|
|
93
93
|
{ level: 9, label: "milliseconds" }
|
94
94
|
]
|
95
95
|
};
|
96
|
-
var
|
97
|
-
for (var i = r > 1 ? void 0 : r ?
|
98
|
-
(m = t[
|
99
|
-
return r && i &&
|
96
|
+
var W = Object.defineProperty, U = Object.getOwnPropertyDescriptor, u = (t, e, o, r) => {
|
97
|
+
for (var i = r > 1 ? void 0 : r ? U(e, o) : e, n = t.length - 1, m; n >= 0; n--)
|
98
|
+
(m = t[n]) && (i = (r ? m(e, o, i) : m(i)) || i);
|
99
|
+
return r && i && W(e, o, i), i;
|
100
100
|
};
|
101
|
-
let l = class extends E
|
102
|
-
validSizes: Object.values(
|
101
|
+
let l = class extends M(E, {
|
102
|
+
validSizes: Object.values(O)
|
103
103
|
}) {
|
104
104
|
constructor() {
|
105
105
|
super(...arguments), this.language = "en", this.slotContent = {}, this.measureColumns = [], this._durationLevels = [], this._renderDurationLevelMenu = !1, this._sendEvent = () => {
|
@@ -117,11 +117,11 @@ let l = class extends E(N, {
|
|
117
117
|
};
|
118
118
|
}
|
119
119
|
static get styles() {
|
120
|
-
return [S(
|
120
|
+
return [S(I)];
|
121
121
|
}
|
122
122
|
_parseSavedNumericFormatSettings() {
|
123
|
-
var t, e, o, r, i,
|
124
|
-
if (this._displayMode = ((t = this.slotContent) == null ? void 0 : t.subtype) === "duration" ? ((r = (o = (e = this.slotContent) == null ? void 0 : e.duration) == null ? void 0 : o.levels) == null ? void 0 : r.length) === 1 ? "numeric" : "duration" : "numeric", this._durationFormat = ((
|
123
|
+
var t, e, o, r, i, n, m, g, h, z;
|
124
|
+
if (this._displayMode = ((t = this.slotContent) == null ? void 0 : t.subtype) === "duration" ? ((r = (o = (e = this.slotContent) == null ? void 0 : e.duration) == null ? void 0 : o.levels) == null ? void 0 : r.length) === 1 ? "numeric" : "duration" : "numeric", this._durationFormat = ((n = (i = this.slotContent) == null ? void 0 : i.duration) == null ? void 0 : n.format) ?? "short", this._durationLevels = ((g = (m = this.slotContent) == null ? void 0 : m.duration) == null ? void 0 : g.levels) ?? [1], this._displayMode === "duration")
|
125
125
|
this._precision = 2, this._commaDecimals = !1, this._thousandSeparator = !1;
|
126
126
|
else {
|
127
127
|
this._format = ((h = this.slotContent) == null ? void 0 : h.format) ?? ".0f";
|
@@ -238,20 +238,20 @@ let l = class extends E(N, {
|
|
238
238
|
}
|
239
239
|
} */
|
240
240
|
willUpdate(t) {
|
241
|
-
var e, o, r;
|
242
|
-
t.has("slotContent") && (this._parseSavedNumericFormatSettings(), this._aggregationFunc = ((e = this.slotContent) == null ? void 0 : e.aggregationFunc) ?? ((o = this.slotContent) == null ? void 0 : o.type) === "numeric" ? "sum" : "count", this._aggregationWeightColumn = (r = this.slotContent) == null ? void 0 : r.aggregationWeight), t.has("language") && this.language !== x() && ([...A].includes(this.language ?? "en") || this.language === "en") && L(this.language);
|
241
|
+
var e, o, r, i, n;
|
242
|
+
t.has("slotContent") && (this._parseSavedNumericFormatSettings(), this._aggregationFunc = ((e = this.slotContent) == null ? void 0 : e.aggregationFunc) ?? ((o = this.slotContent) == null ? void 0 : o.type) === "numeric" ? "sum" : "count", this._aggregationWeightColumn = (r = this.slotContent) == null ? void 0 : r.aggregationWeight, this._isFormula = ((i = this.slotContent) == null ? void 0 : i.formula) || ((n = this.slotContent) == null ? void 0 : n.formulaId)), t.has("language") && this.language !== x() && ([...A].includes(this.language ?? "en") || this.language === "en") && L(this.language);
|
243
243
|
}
|
244
244
|
firstUpdated() {
|
245
245
|
var t;
|
246
246
|
(t = this.slotContent) != null && t.duration && this._durationLevelsOverlay.addEventListener(
|
247
247
|
"slottable-request",
|
248
248
|
(e) => {
|
249
|
-
this._renderDurationLevelMenu = e.data !==
|
249
|
+
this._renderDurationLevelMenu = e.data !== C;
|
250
250
|
}
|
251
251
|
);
|
252
252
|
}
|
253
253
|
_renderDurationLevelsSettings() {
|
254
|
-
const t =
|
254
|
+
const t = T.levels.map((e) => {
|
255
255
|
let o = !1;
|
256
256
|
return this._durationFormat === "time" && e.level >= 6 && this._durationLevels.includes(e.level) && e.level !== Math.max(...this._durationLevels) && (o = !0), this._durationLevels.length === 1 && this._durationLevels.includes(e.level) && (o = !0), a`<luzmo-menu-item
|
257
257
|
value=${e.level}
|
@@ -269,7 +269,7 @@ let l = class extends E(N, {
|
|
269
269
|
${this._durationLevels.length}
|
270
270
|
${this._durationLevels.length === 1 ? "level" : "levels"} active
|
271
271
|
<span class="duration-angle-down-icon">
|
272
|
-
${
|
272
|
+
${D(w)}
|
273
273
|
</span>
|
274
274
|
</luzmo-action-button>
|
275
275
|
<luzmo-overlay
|
@@ -379,15 +379,15 @@ let l = class extends E(N, {
|
|
379
379
|
}
|
380
380
|
_renderAggregationSettings() {
|
381
381
|
var o, r;
|
382
|
-
const t = Object.entries(
|
383
|
-
([i,
|
382
|
+
const t = Object.entries(k).map(
|
383
|
+
([i, n]) => a`<luzmo-menu-item value=${i}>${n()}</luzmo-menu-item>`
|
384
384
|
), e = [
|
385
385
|
a`<luzmo-menu-item value="none">No weight</luzmo-menu-item>`,
|
386
386
|
...this.measureColumns.map((i) => {
|
387
387
|
var m, g, h;
|
388
|
-
const
|
388
|
+
const n = ((m = i == null ? void 0 : i.label) == null ? void 0 : m[this.language ?? "en"]) ?? ((h = i == null ? void 0 : i.label) == null ? void 0 : h[(g = Object.keys(i == null ? void 0 : i.label)) == null ? void 0 : g[0]]) ?? "Untitled";
|
389
389
|
return a`<luzmo-menu-item value=${i.id}>
|
390
|
-
${
|
390
|
+
${n}
|
391
391
|
</luzmo-menu-item>`;
|
392
392
|
})
|
393
393
|
];
|
@@ -429,45 +429,45 @@ let l = class extends E(N, {
|
|
429
429
|
${this._displayMode === "duration" ? this._renderDurationLevelsSettings() : this._renderNumericDisplayAsSettings()}
|
430
430
|
${((t = this._durationLevels) == null ? void 0 : t.length) > 1 ? this._renderDurationFormatSettings() : this._renderNumericFormatSettings()}
|
431
431
|
</div>
|
432
|
-
${this._renderAggregationSettings()}
|
432
|
+
${this._isFormula ? $ : this._renderAggregationSettings()}
|
433
433
|
</div>
|
434
434
|
</div>`;
|
435
435
|
}
|
436
436
|
};
|
437
|
-
|
437
|
+
u([
|
438
438
|
f({ type: String, reflect: !0 })
|
439
439
|
], l.prototype, "language", 2);
|
440
|
-
|
440
|
+
u([
|
441
441
|
f({ type: Object, reflect: !0 })
|
442
442
|
], l.prototype, "slotContent", 2);
|
443
|
-
|
443
|
+
u([
|
444
444
|
f({ type: Array, reflect: !1 })
|
445
445
|
], l.prototype, "measureColumns", 2);
|
446
|
-
|
446
|
+
u([
|
447
447
|
d("#display-as")
|
448
448
|
], l.prototype, "_displayAsElement", 2);
|
449
|
-
|
449
|
+
u([
|
450
450
|
d("#precision")
|
451
451
|
], l.prototype, "_precisionElement", 2);
|
452
|
-
|
452
|
+
u([
|
453
453
|
d("#aggregation")
|
454
454
|
], l.prototype, "_aggregationElement", 2);
|
455
|
-
|
455
|
+
u([
|
456
456
|
d("#weighting-column")
|
457
457
|
], l.prototype, "_aggregationWeightElement", 2);
|
458
|
-
|
458
|
+
u([
|
459
459
|
d("#duration-levels")
|
460
460
|
], l.prototype, "_durationLevelsElement", 2);
|
461
|
-
|
461
|
+
u([
|
462
462
|
d("#duration-format")
|
463
463
|
], l.prototype, "_durationFormatElement", 2);
|
464
|
-
|
464
|
+
u([
|
465
465
|
d("#duration-levels-overlay")
|
466
466
|
], l.prototype, "_durationLevelsOverlay", 2);
|
467
|
-
|
468
|
-
|
467
|
+
u([
|
468
|
+
N()
|
469
469
|
], l.prototype, "_renderDurationLevelMenu", 2);
|
470
|
-
l =
|
470
|
+
l = u([
|
471
471
|
F()
|
472
472
|
], l);
|
473
473
|
customElements.get("luzmo-display-settings-numeric") || customElements.define(
|
@@ -79,7 +79,7 @@
|
|
79
79
|
?open=${e.open}
|
80
80
|
>
|
81
81
|
${t(e.children)}
|
82
|
-
</luzmo-accordion-item>`},this.changedOptions=e=>{var r;const t=(r=e==null?void 0:e.detail)==null?void 0:r.options;e.preventDefault(),e.stopPropagation(),this.dispatchEvent(new CustomEvent("options-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{options:t}}))},this.renderOptionControl=e=>{var i,n;let t,r;return this._isCustomOptionsConfiguration&&(t=k.getControlByKey(e,this.customOptionsConfiguration,!0),r=(n=(i=this._translations)==null?void 0:i.options)==null?void 0:n[e]),s.x`<luzmo-edit-option
|
82
|
+
</luzmo-accordion-item>`},this.changedOptions=e=>{var r,i;const t=(r=e==null?void 0:e.detail)==null?void 0:r.options;this.options=(i=e==null?void 0:e.detail)==null?void 0:i.options,e.preventDefault(),e.stopPropagation(),this.dispatchEvent(new CustomEvent("options-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{options:t}}))},this.renderOptionControl=e=>{var i,n;let t,r;return this._isCustomOptionsConfiguration&&(t=k.getControlByKey(e,this.customOptionsConfiguration,!0),r=(n=(i=this._translations)==null?void 0:i.options)==null?void 0:n[e]),s.x`<luzmo-edit-option
|
83
83
|
class="control"
|
84
84
|
.itemType=${this.itemType}
|
85
85
|
.optionKey=${e}
|
@@ -569,9 +569,9 @@ const b = class b extends A {
|
|
569
569
|
${e(o.children)}
|
570
570
|
</luzmo-accordion-item>`;
|
571
571
|
}, this.changedOptions = (o) => {
|
572
|
-
var r;
|
572
|
+
var r, i;
|
573
573
|
const e = (r = o == null ? void 0 : o.detail) == null ? void 0 : r.options;
|
574
|
-
o.preventDefault(), o.stopPropagation(), this.dispatchEvent(
|
574
|
+
this.options = (i = o == null ? void 0 : o.detail) == null ? void 0 : i.options, o.preventDefault(), o.stopPropagation(), this.dispatchEvent(
|
575
575
|
new CustomEvent("options-changed", {
|
576
576
|
bubbles: !0,
|
577
577
|
composed: !0,
|