@bino-bi/bn-template-engine 1.0.0-next.40 → 1.0.0-next.41
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/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/{p-aa0fd797.entry.js → p-2dd69cb9.entry.js} +1 -1
- package/dist/cjs/bn-annotation-layer_30.cjs.entry.js +1 -1
- package/dist/collection/components/bn-table/bn-table-renderer/bn-table-renderer.css +5 -2
- package/dist/components/bn-table-renderer.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/{p-BC4MwlnX.js → p-CGySoYRH.js} +1 -1
- package/dist/esm/bn-annotation-layer_30.entry.js +1 -1
- package/package.json +1 -1
|
@@ -31780,7 +31780,7 @@ class TableDrillGroupAdapter {
|
|
|
31780
31780
|
}
|
|
31781
31781
|
}
|
|
31782
31782
|
|
|
31783
|
-
const bnTableRendererCss = () => `:host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{position:relative;display:inline-block}table{background-color:var(--bn-font-background, white);font-size:var(--bn-font-size, 1em);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);border-spacing:0.3em 0}thead{border-style:none}tr:first-child td{border-top:none;padding-top:0.5em}td.ac1,td.ac2,td.ac3,td.ac4,td.pp1,td.pp2,td.pp3,td.pp4,td.pl1,td.pl2,td.pl3,td.pl4,td.fc1,td.fc2,td.fc3,td.fc4,td.share,td.variance,td.pos_pos,td.pos_neg,td.neg_pos,td.neg_neg,td.pos_neutral,td.neg_neutral,td.zero{text-align:right}.category-w100{min-width:100em;max-width:100em}.category-w50{min-width:50em;max-width:50em}.category-w25{min-width:25em;max-width:25em}.category-w20{min-width:20em;max-width:20em}.category-w15{min-width:15em;max-width:15em}.category-w10{min-width:10em;max-width:10em}.category-w5{min-width:5em;max-width:5em}.prefix-second{color:transparent;font-style:normal}.prefix-first{font-style:normal}th{border-bottom:0.1em solid black;text-align:right;font-weight:normal;vertical-align:text-top}td.columnGroup,th.columnGroup{font-size:0.6em}td.columnSubGroup,th.columnSubGroup{font-size:0.6em;border-spacing:0em 0;font-style:italic}td.base,th.base{font-style:normal}th.ofit,td.ofit,tr.ofit,th.partof,td.partof,tr.partof{font-size:0.6em;font-style:italic}td.ofit,td.partof{font-size:0.6em;font-style:italic}th.ofit td,tr.ofit td,th.partof td,tr.partof td{border-top:0em solid black;padding-left:1em}th.ofit share,th.partof share,tr.share td{border-top:0em solid black}th.share,tr.share,td.share{font-size:0.6em;font-style:italic}th.filler{border-bottom:0em solid black;text-align:right}td.filler{border-top:0em none !important;border-bottom:0em none;text-align:right}th.group{text-align:center;border-spacing:1em 0}th.headerlabel{border-bottom:0em none black;padding-bottom:0em}th.intervalGroup{border-bottom:0.1em solid black;text-align:center;font-weight:bold}td.variance:after{content:"%"}td.relative_variance{font-style:italic}td.percent{font-style:italic;text-align:right}td.decimal,td.percentpoint{text-align:right}td.pos_pos{color:#008f96}td.neg_pos{color:#ff0000}td.pos_neg{color:#ff0000}td.neg_neg{color:#008f96}td.pos_pos:before{content:"+"}td.pos_neg:before{content:"+"}td.pos_neu:before{content:"+"}th.ac1,th.ac2,th.ac3,th.ac4{padding-top:0em;border-bottom:0.3em solid black}th.pp1,th.pp2,th.pp3,th.pp4{padding-top:0em;border-bottom:0.3em solid grey}th.pl1,th.pl2,th.pl3,th.pl4{padding-top:0em;border-bottom:0.3em double black}th.fc1,th.fc2,th.fc3,th.fc4{border-bottom:0.3em solid;border-image:repeating-linear-gradient(-45deg, white, white, black, white, white 0.3em) 2}td.colsum{font-weight:bold}th.colsum{padding-top:0em;font-weight:bold}tr.sum td{border-top:0.1em solid black;font-weight:bold;padding-bottom:0.5em}tr.ofit-above td[class^=category]{padding-left:1em}tr.ofit-sum td{border-top:0.1em solid black;font-weight:bold}tr.groupheader td{border-top:0em dotted #ddd;padding-top:0.5em;font-weight:bold;font-style:italic}tr.begingroup td{border-top:0em dotted #ddd;padding-top:0.5em}th.begin-group{padding-left:0.75em}th.end-group{padding-left:0.75em}td{box-sizing:border-box;-webkit-box-sizing:border-box;border-top:0.1em dashed #ddd;padding-left:0.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.table-footer{font-size:0.6em}.cell-bar-chart{display:inline-block;vertical-align:middle}.bar-chart-empty{color:#999}td:has(.variance-waterfall){overflow:visible}td:has(.cell-bar-chart){padding:0 0.25em;vertical-align:middle}tr.ofit td:has(.
|
|
31783
|
+
const bnTableRendererCss = () => `:host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{position:relative;display:inline-block}table{background-color:var(--bn-font-background, white);font-size:var(--bn-font-size, 1em);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);border-spacing:0.3em 0}thead{border-style:none}tr:first-child td{border-top:none;padding-top:0.5em}td.ac1,td.ac2,td.ac3,td.ac4,td.pp1,td.pp2,td.pp3,td.pp4,td.pl1,td.pl2,td.pl3,td.pl4,td.fc1,td.fc2,td.fc3,td.fc4,td.share,td.variance,td.pos_pos,td.pos_neg,td.neg_pos,td.neg_neg,td.pos_neutral,td.neg_neutral,td.zero{text-align:right}.category-w100{min-width:100em;max-width:100em}.category-w50{min-width:50em;max-width:50em}.category-w25{min-width:25em;max-width:25em}.category-w20{min-width:20em;max-width:20em}.category-w15{min-width:15em;max-width:15em}.category-w10{min-width:10em;max-width:10em}.category-w5{min-width:5em;max-width:5em}.prefix-second{color:transparent;font-style:normal}.prefix-first{font-style:normal}th{border-bottom:0.1em solid black;text-align:right;font-weight:normal;vertical-align:text-top}td.columnGroup,th.columnGroup{font-size:0.6em}td.columnSubGroup,th.columnSubGroup{font-size:0.6em;border-spacing:0em 0;font-style:italic}td.base,th.base{font-style:normal}th.ofit,td.ofit,tr.ofit,th.partof,td.partof,tr.partof{font-size:0.6em;font-style:italic}td.ofit,td.partof{font-size:0.6em;font-style:italic}th.ofit td,tr.ofit td,th.partof td,tr.partof td{border-top:0em solid black;padding-left:1em}th.ofit share,th.partof share,tr.share td{border-top:0em solid black}th.share,tr.share,td.share{font-size:0.6em;font-style:italic}th.filler{border-bottom:0em solid black;text-align:right}td.filler{border-top:0em none !important;border-bottom:0em none;text-align:right}th.group{text-align:center;border-spacing:1em 0}th.headerlabel{border-bottom:0em none black;padding-bottom:0em}th.intervalGroup{border-bottom:0.1em solid black;text-align:center;font-weight:bold}td.variance:after{content:"%"}td.relative_variance{font-style:italic}td.percent{font-style:italic;text-align:right}td.decimal,td.percentpoint{text-align:right}td.pos_pos{color:#008f96}td.neg_pos{color:#ff0000}td.pos_neg{color:#ff0000}td.neg_neg{color:#008f96}td.pos_pos:before{content:"+"}td.pos_neg:before{content:"+"}td.pos_neu:before{content:"+"}th.ac1,th.ac2,th.ac3,th.ac4{padding-top:0em;border-bottom:0.3em solid black}th.pp1,th.pp2,th.pp3,th.pp4{padding-top:0em;border-bottom:0.3em solid grey}th.pl1,th.pl2,th.pl3,th.pl4{padding-top:0em;border-bottom:0.3em double black}th.fc1,th.fc2,th.fc3,th.fc4{border-bottom:0.3em solid;border-image:repeating-linear-gradient(-45deg, white, white, black, white, white 0.3em) 2}td.colsum{font-weight:bold}th.colsum{padding-top:0em;font-weight:bold}tr.sum td{border-top:0.1em solid black;font-weight:bold;padding-bottom:0.5em}tr.ofit-above td[class^=category]{padding-left:1em}tr.ofit-sum td{border-top:0.1em solid black;font-weight:bold}tr.groupheader td{border-top:0em dotted #ddd;padding-top:0.5em;font-weight:bold;font-style:italic}tr.begingroup td{border-top:0em dotted #ddd;padding-top:0.5em}th.begin-group{padding-left:0.75em}th.end-group{padding-left:0.75em}td{box-sizing:border-box;-webkit-box-sizing:border-box;border-top:0.1em dashed #ddd;padding-left:0.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.table-footer{font-size:0.6em}.cell-bar-chart{display:inline-block;vertical-align:middle}.bar-chart-empty{color:#999}td:has(.variance-waterfall){overflow:visible}td:has(.cell-bar-chart){padding:0 0.25em;vertical-align:middle}tr.ofit td:has(.cell-bar-chart),tr.partof td:has(.cell-bar-chart),tr.share td:has(.cell-bar-chart){padding:0 0.4166666667em}td:has(.cell-bar-chart).pos_pos:before,td:has(.cell-bar-chart).pos_neg:before,td:has(.cell-bar-chart).pos_neu:before{content:none}td:has(.cell-bar-chart).variance:after{content:none}`;
|
|
31784
31784
|
|
|
31785
31785
|
const BnTableRenderer = class {
|
|
31786
31786
|
constructor(hostRef) {
|
|
@@ -375,8 +375,11 @@ td:has(.cell-bar-chart) {
|
|
|
375
375
|
vertical-align: middle;
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
-
/* a thereof row has a smaller em and its own left padding: both would move
|
|
379
|
-
|
|
378
|
+
/* a thereof, partof or share row has a smaller em and its own left padding: both would move
|
|
379
|
+
its bars, axis and waterfall off the rows around it */
|
|
380
|
+
tr.ofit td:has(.cell-bar-chart),
|
|
381
|
+
tr.partof td:has(.cell-bar-chart),
|
|
382
|
+
tr.share td:has(.cell-bar-chart) {
|
|
380
383
|
padding: 0 0.4166666667em;
|
|
381
384
|
}
|
|
382
385
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as o,d as s}from"./p-
|
|
1
|
+
import{B as o,d as s}from"./p-CGySoYRH.js";const p=o,r=s;export{p as BnTableRenderer,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as i,w as e,h as a,a as s,t as r,f as n}from"./p-D6YGOYV1.js";import{h as o,a as l}from"./p-DDvWTgk1.js";import{v as h,a as d,i as p,p as u,q as c,r as v,s as m,h as g,t as f,u as y,w as b,x as S,c as w,y as O,l as A,z as D,A as T,f as N,B as W}from"./p-BiSytXUy.js";import{w as _}from"./p-DJUffGeB.js";import{w as C}from"./p-Dq9dG0Kr.js";import{w as P}from"./p-DQl2K2Xl.js";import{w as M,a as F,i as R}from"./p-xIWChKGS.js";import{w as x}from"./p-DwuXVo2h.js";import{w as I}from"./p-DjPWZfry.js";import{r as j}from"./p-CniN8ALm.js";import{w as U}from"./p-D40Am1Ap.js";import{w as k,r as B}from"./p-4vVbchX2.js";import{g as G}from"./p-DD1zlev_.js";import{f as L,r as E,p as $}from"./p-Xb6Ilq8u.js";import{o as z}from"./p-B6kka9sT.js";import{D as J,I as X,d as V,M as Y,B as Z,T as q}from"./p-B5tixDPM.js";import{T as K,a as Q,p as H}from"./p-BZXiWkDS.js";import{I as tt,a as it,d as et,c as at}from"./p-BC4MwlnX.js";import{a as st,n as rt}from"./p-16rjcQ0t.js";import{LAYOUT_STATE_VERSION as nt}from"./index.js";import{o as ot,m as lt}from"./p-DaOm9YwQ.js";import{r as ht,a as dt}from"./p-CckAR27O.js";import{b as pt}from"./p-XFZYX7DZ.js";import{s as ut}from"./p-DakXa7Dp.js";const ct=t(class extends i{validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("WARN_scale");const i=Number(t);isNaN(i)||i<=0?this.errors.addOrReplace({id:"WARN_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("WARN_scale")}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.layoutObserver=null,this._lastScaledParentWidth=0,this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.hasBlankSetnames=!1,this.hasSetnameIndexWithoutSetname=!1,this.sumTitle="",this.filter="",this.measureUnit="",this.barColumnWidth="w10",this.unitScaling="100",this.percentageScaling="2",this.pixelPerUnitGroupMap=new Map,this.dataFormat="decimal",this.grouped=!1,this.showMeasureScale=!1,this.showGroupTitle=!0,this.runningSum=!1,this.varianceWaterfall=!1,this.type="list",this.limit=0,this.thereof="[]",this.thereofPosition="below",this.partof="[]",this.order="category",this.orderDirection="asc",this.measureType="volume",this.measureScale="greatest",this.dataFormatDigitsDecimal=1,this.dataFormatDigitsPercent=2,this.categoryWidth="w15",this.columnthereof=null,this.interval="none",this.categoryIntervalPosition=0,this.tableAttributes="",this._autoScaleGuard=!1,this.autoUnitWarningActive=!1,this.autoPctWarningActive=!1,this.handleAutoScalingReport=t=>{var i,e,a,s;this.lastAutoScalingReport={unit:null!==(i=t.unit)&&void 0!==i?i:null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.unit,percentage:null!==(a=t.percentage)&&void 0!==a?a:null===(s=this.lastAutoScalingReport)||void 0===s?void 0:s.percentage};const r=(t,i)=>void 0===i||Math.abs(t-i)>.001*Math.abs(t);if(void 0!==t.unit&&t.unit>0&&this.autoUnitWarningActive){const i=1/t.unit;r(i,this.lastReportedUnitsPerEm)&&(this.lastReportedUnitsPerEm=i,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${this.unitScaling}" - auto-fitted to 1 em ≈ ${L(i)} units.`}))}if(void 0!==t.percentage&&t.percentage>0&&this.autoPctWarningActive){const i=1/t.percentage;r(i,this.lastReportedPpPerEm)&&(this.lastReportedPpPerEm=i,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${this.percentageScaling}" - auto-fitted to 1 em ≈ ${L(i)} percentage points.`}))}},x(this),C(this),this.errors=k(this),P(this),this.componentStyle=I(this),this.ruleSetConfig=U(this),_(this,((t,i)=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1,this.hasBlankSetnames=Array.isArray(i)&&i.some((t=>{var i;return p(null!==(i=null==t?void 0:t.setname)&&void 0!==i?i:null==t?void 0:t.setName)})),this.hasSetnameIndexWithoutSetname=Array.isArray(i)&&i.some((t=>{var i,e;return void 0!==at(null!==(i=null==t?void 0:t.setnameIndex)&&void 0!==i?i:null==t?void 0:t.setNameIndex)&&p(null!==(e=null==t?void 0:t.setname)&&void 0!==e?e:null==t?void 0:t.setName)}))}),((t,i)=>{this.datasetMeta=i})),this.t=M(this).t,this.resolveInherited=F(this,[{propName:"scenarios",ancestorAttr:"title-scenarios"},{propName:"variances",ancestorAttr:"title-variances"},{propName:"order",ancestorAttr:"title-order"},{propName:"orderDirection",ancestorAttr:"title-order-direction"}],this.errors)}validateFilter(t){const i="ERR_filter";o(t)?this.errors.addOrReplace({id:i,type:"error",message:"filter: double backticks are not allowed."}):this.errors.remove(i)}validateScenario(t){const i="WARN_scenarios";if(R(t))return void this.errors.remove(i);const e=h(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"scenarios: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."}):this.errors.remove(i)}validateVariances(t){const i="WARN_variances";if(R(t))return void this.errors.remove(i);const e=d(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumns(t){const i="WARN_barColumns";if(p(t))return void this.errors.remove(i);const e=u(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"barColumns: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumnWidth(t){const i="WARN_barColumnWidth";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"barColumnWidth: invalid value '"+t+"' is not supported."})}validateUnitScaling(t){const i="WARN_unitScaling";"invalid"===E(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validatePercentageScaling(t){const i="WARN_percentageScaling";"invalid"===E(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validateDataFormat(t){const i="WARN_dataFormat";v(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormat: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateType(t){const i="WARN_type";m(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"type: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateLimit(t){const i="WARN_limit";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateThereOf(t){const i="WARN_thereof",e=f(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"ThereOf: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateThereofPosition(t){const i="WARN_thereofPosition";p(t)||y(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"thereofPosition: invalid value '"+t+"' is not supported."})}validatePartOf(t){const i="WARN_partof",e=b(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"partof: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderList(t){const i="WARN_order";if(R(t))return void this.errors.remove(i);const e=S(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(t){const i="WARN_orderDirection";R(t)||w(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureType(t){const i="WARN_measureType";O(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureType: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureScale(t){const i="WARN_measureScale";A(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureScale: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateDataFormatDigitsDecimal(t){const i="WARN_dataFormatDigitsDecimal";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsDecimal: invalid value(s) '"+t+"' are not supported."})}validateDateFormatDigitsPercent(t){const i="WARN_dataFormatDigitsPercent";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsPercent: invalid value(s) '"+t+"' are not supported."})}validateCategoryWidth(t){const i="WARN_categoryWidth";D(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"categoryWidth: invalid value(s) '"+t+"' are not supported."})}validateColumnThereOf(t){const i=T(t),e="WARN_columnthereof";i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"columnthereof: invalid value(s) '"+JSON.stringify(i)+"' are not supported."}):this.errors.remove(e)}validateInterval(t){const i="WARN_interval",e=null==t?void 0:t.trim().toLowerCase();p(t)||e===tt||e===it||N(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"interval: invalid value '"+t+"' is not supported."})}validateCategoryIntervalPosition(t){const i="WARN_categoryIntervalPosition";p(t)||g(t)&&Number(t)>=0?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"categoryIntervalPosition: invalid value '"+t+"' is not supported."})}validateTableAttributes(t){const i="WARN_attributes",e=W(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"attributes: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}componentWillLoad(){this.validateFilter(this.filter),this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateDataFormat(this.dataFormat),this.validateType(this.type),this.validateLimit(this.limit),this.validateThereOf(this.thereof),this.validateThereofPosition(this.thereofPosition),this.validatePartOf(this.partof),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal),this.validateDateFormatDigitsPercent(this.dataFormatDigitsPercent),this.validateCategoryWidth(this.categoryWidth),this.validateMeasureType(this.measureType),this.validateMeasureScale(this.measureScale),this.validateColumnThereOf(this.columnthereof),this.validateInterval(this.interval),this.validateCategoryIntervalPosition(this.categoryIntervalPosition),this.validateTableAttributes(this.tableAttributes),this.validateBarColumns(this.barColumns),this.validateBarColumnWidth(this.barColumnWidth),this.validateUnitScaling(this.unitScaling),this.validatePercentageScaling(this.percentageScaling),this.validateScaling(this.scale)}componentDidLoad(){this.layoutObserver=z(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=G(this.element);t>0&&Math.abs(t-this._lastScaledParentWidth)>2&&(this._lastScaledParentWidth=t,n(this))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}componentDidRender(){ut(this.element,"bn-table-renderer");const{mode:t}=$(this.scale);if("auto"!==t&&"empty"!==t)return this._autoScaleGuard=!1,void this.checkOverflow();if(this._autoScaleGuard)return this._autoScaleGuard=!1,void this.checkOverflow();const i=this.element,{width:a}=G(i);if(a<=0)return void this.checkOverflow();this._lastScaledParentWidth=a;const s=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),r=i.scrollWidth,n=this.appliedScaleFactor;if(r<=a+1)return this.errors.remove("AUTO_scale"),void this.checkOverflow();const o=Math.max(.3,n*(a-1)/r);Math.abs(o-n)<.001||(i.style.setProperty("--bn-font-size",s*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled table by factor "+o.toFixed(3)}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,e((()=>{this.appliedScaleFactor=o}))),this.checkOverflow()}checkOverflow(){const t=G(this.element),i=this.element.scrollWidth,e=this.element.scrollHeight,a=t.width>0&&i>t.width+1,s=t.height>0&&e>t.height+1;if(!a&&!s)return void B(this.errors,null);const{mode:r}=$(this.scale),n="auto"!==r&&"empty"!==r,o=[];a&&o.push(`width (${Math.round(i)}px > ${Math.round(t.width)}px)`),s&&o.push(`height (${Math.round(e)}px > ${Math.round(t.height)}px)`),B(this.errors,`Table exceeds available ${o.join(" and ")}. Give the component more space, reduce rows (e.g. limit), or set a smaller scale.`,n)}prepareDataFormat(){var t;return J[null===(t=this.dataFormat)||void 0===t?void 0:t.toUpperCase()]}prepareGrouped(){return this.grouped}prepareShowGroupTitle(){return this.showGroupTitle}prepareThereofPosition(){var t;return(null===(t=this.thereofPosition)||void 0===t?void 0:t.toLowerCase())===K.ABOVE?K.ABOVE:K.BELOW}prepareTableType(){var t;return Q[null===(t=this.type)||void 0===t?void 0:t.toUpperCase()]}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareThereOf(){if(null==this.thereof||""===this.thereof.trim())return[];try{return JSON.parse(this.thereof)}catch(t){return[]}}preparePartOf(){if(null==this.partof||""===this.partof.trim())return[];try{return JSON.parse(this.partof)}catch(t){return[]}}prepareOrder(){var t;const i=this.resolveInherited("order",this.order,"category").value,e=this.resolveInherited("orderDirection",this.orderDirection,"asc").value,a="auto"===(null==i?void 0:i.trim().toLowerCase());let s=i;return a&&(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedOrder)&&(s=this.datasetMeta.suggestedOrder),{hierarchy:s.split(",").map((t=>rt(t))),direction:st[null==e?void 0:e.toUpperCase()]}}prepareI18nMode(){return X.META}prepareI18n(){const t=l,i=new Map(["in","category","operation","thereof","part_of","SUM_TOTAL","no-data","REST"].map((t=>[t,this.t(".".concat(t))]))),e=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...e.entries(),...i.entries(),...j(this.ruleSetConfig("user"))])}prepareDataFormatDigits(){return{percent:this.dataFormatDigitsPercent,decimal:this.dataFormatDigitsDecimal}}prepareScenarios(){var t,i,e,a,s,r,n,o,l,h,d;const u=this.resolveInherited("scenarios",this.scenarios),c=this.resolveInherited("variances",this.variances);if(u.inherited||c.inherited){this.errors.remove("AUTO_scenarios");let a=[];return p(u.value)?u.unresolved&&(a=a.concat(null!==(i=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)&&void 0!==i?i:[])):a=a.concat(u.value.split(",")),(null===(e=c.value)||void 0===e?void 0:e.trim().length)>0&&(a=a.concat(c.value.split(","))),a.map((t=>t.trim()))}const v="auto"===(null===(a=u.value)||void 0===a?void 0:a.trim().toLowerCase()),m=v||u.unresolved;if((p(u.value)||v)&&p(c.value))return(null===(r=null===(s=this.datasetMeta)||void 0===s?void 0:s.availableScenarios)||void 0===r?void 0:r.length)>0?(m?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),this.datasetMeta.availableScenarios):[];let g=[];return v||p(u.value)?(null===(o=null===(n=this.datasetMeta)||void 0===n?void 0:n.availableScenarios)||void 0===o?void 0:o.length)>0&&(m?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),g=g.concat(this.datasetMeta.availableScenarios)):(this.errors.remove("AUTO_scenarios"),g=g.concat(null===(l=u.value)||void 0===l?void 0:l.split(","))),(null===(h=c.value)||void 0===h?void 0:h.trim().length)>0&&(g=g.concat(null===(d=c.value)||void 0===d?void 0:d.split(","))),g.map((t=>t.trim()))}prepareCategoryWidth(){var t;return p(this.categoryWidth)?V.INF:V[null===(t=this.categoryWidth)||void 0===t?void 0:t.toUpperCase()]}prepareMeasureScale(){return p(this.measureScale)?"GREATEST":["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(this.measureScale.trim())||"LEAST"===this.measureScale.trim().toUpperCase()?this.measureScale.trim():"GREATEST"}prepareMeasureType(){var t;return p(this.measureType)?Y.VOLUME:Y[null===(t=this.measureType)||void 0===t?void 0:t.toUpperCase()]}prepareColumnThereOf(){if(null==this.columnthereof||""===this.columnthereof.trim())return new Map;const t=new Map;try{const i=JSON.parse(this.columnthereof);for(const[e,a]of Object.entries(i))!1===t.has(a.scenario)&&t.set(a.scenario,[]),t.get(a.scenario).push(a)}catch(t){return new Map}return t}prepareInterval(){var t;const i="WARN_intervalConflict",e="WARN_intervalNoDate",a="WARN_intervalSetname",s="WARN_intervalSetnameIndex",r=p(this.interval)?tt:this.interval.trim().toLowerCase();return r!==tt&&r!==it&&!N(r)||r===tt?(this.errors.remove(i),this.errors.remove(e),this.errors.remove(a),this.errors.remove(s),tt):null!=this.columnthereof&&""!==this.columnthereof.trim()?(this.errors.addOrReplace({id:i,type:"warning",message:"interval: cannot be combined with columnthereof, interval is ignored."}),this.errors.remove(e),this.errors.remove(a),this.errors.remove(s),tt):(this.errors.remove(i),r===it?(this.hasBlankSetnames?this.errors.addOrReplace({id:a,type:"warning",message:"interval: rows with blank setname found, they are grouped under '-'."}):this.errors.remove(a),this.hasSetnameIndexWithoutSetname?this.errors.addOrReplace({id:s,type:"warning",message:"interval: rows with setnameIndex but blank setname found, setnameIndex needs setname."}):this.errors.remove(s),this.errors.remove(e),it):(this.errors.remove(a),this.errors.remove(s),this.datasetMeta&&!(null===(t=this.datasetMeta.dateRange)||void 0===t?void 0:t.hasData)?(this.errors.addOrReplace({id:e,type:"warning",message:"interval: dataset has no date values, interval is ignored."}),tt):(this.errors.remove(e),r)))}prepareCategoryIntervalPosition(){const t=Number(this.categoryIntervalPosition);return Number.isInteger(t)&&t>0?t:0}prepareAttributes(){if(null==this.tableAttributes||""===this.tableAttributes.trim())return[];try{const t=JSON.parse(this.tableAttributes);return null===t||"object"!=typeof t||t instanceof Array?[]:Object.entries(t).map((([t,i],e)=>"string"==typeof i?H(t,"attr_"+e,i):null)).filter((t=>null!==t))}catch(t){return[]}}prepareSumTitle(){return""===this.sumTitle||null==this.sumTitle?"SUM_TOTAL":this.sumTitle}prepareShowMeasureScale(){return this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}prepareFilter(){return 0===this.filter.length?"":this.filter}prepareBarColumnWidth(){var t;const i=null===(t=this.barColumnWidth)||void 0===t?void 0:t.toUpperCase(),e=q[i];return e?Z[e]:Z[q.W10]}prepareBarColumns(){return p(this.barColumns)?[]:this.barColumns.split(",").map((t=>t.trim()))}prepareUnitScaling(){const t=E(this.unitScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,0):(this.autoUnitWarningActive=!0,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${t.raw}" - auto-fitting to the bar column width.`}),0)}preparePercentageScaling(){const t=E(this.percentageScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,0):(this.autoPctWarningActive=!0,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${t.raw}" - auto-fitting to the pin area.`}),0)}getDataStructure(){return{ITableDataRow:{setName:{type:"string",isOptional:!1,description:""},setNameIndex:{type:"number",isOptional:!0,description:""},date:{type:"string",isOptional:!1,description:""},operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!1,description:""},rowGroupIndex:{type:"number",isOptional:!1,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!1,description:""},subCategoryIndex:{type:"number",isOptional:!1,description:""},columnGroup:{type:"string",isOptional:!1,description:""},columnGroupIndex:{type:"number",isOptional:!1,description:""},columnSubGroup:{type:"string",isOptional:!1,description:""},columnSubGroupIndex:{type:"number",isOptional:!1,description:""},ac1:{type:"number",isOptional:!1,description:""},ac2:{type:"number",isOptional:!1,description:""},ac3:{type:"number",isOptional:!1,description:""},ac4:{type:"number",isOptional:!1,description:""},pp1:{type:"number",isOptional:!1,description:""},pp2:{type:"number",isOptional:!1,description:""},pp3:{type:"number",isOptional:!1,description:""},pp4:{type:"number",isOptional:!1,description:""},fc1:{type:"number",isOptional:!1,description:""},fc2:{type:"number",isOptional:!1,description:""},fc3:{type:"number",isOptional:!1,description:""},fc4:{type:"number",isOptional:!1,description:""},pl1:{type:"number",isOptional:!1,description:""},pl2:{type:"number",isOptional:!1,description:""},pl3:{type:"number",isOptional:!1,description:""},pl4:{type:"number",isOptional:!1,description:""}}}}async getBaseline(){return this.readBaseline()}readBaseline(){var t,i,e;const a=null===(e=null===(i=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelector("bn-table-renderer"))||void 0===i?void 0:i.shadowRoot)||void 0===e?void 0:e.querySelector("table");return pt(a,this.element)}async getLayoutState(t){var i,e,a,s;const r=null!==(i=null==t?void 0:t.detail)&&void 0!==i?i:"summary",n=ot(this.element),o=this.getEffectiveScaleFactor(),l=Number.isFinite(o)&&o>0?o:1,h=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}))*l,d={version:nt,tag:this.element.localName,id:dt(this.element),slot:null!==(e=this.element.getAttribute("slot"))&&void 0!==e?e:void 0,rect:lt(this.element,n),em:{fontSizePx:h,appliedScaleFactor:l},regions:[],metadata:{},diagnostics:ht(this.element),scaling:this.resolveScalingInfo(h),baseline:this.readBaseline()},p=null===(a=this.element.shadowRoot)||void 0===a?void 0:a.querySelector("bn-table-renderer");if(p){const t=null!==(s=p.scenarios)&&void 0!==s?s:[];if(d.metadata.scenarios=t.filter((t=>!t.startsWith("d"))),d.metadata.variances=t.filter((t=>t.startsWith("d"))),"function"==typeof p.getLayoutDetail){const t=await p.getLayoutDetail(n,r);d.regions=t.regions,d.metadata=Object.assign(Object.assign({},d.metadata),t.metadata),d.diagnostics=[...d.diagnostics,...t.diagnostics],t.elements&&(d.elements=t.elements),t.table&&(d.table=t.table)}}return d}resolveScalingInfo(t){var i,e;const a={},s=E(this.unitScaling,this.pixelPerUnitGroupMap);if("value"===s.kind)a.unitMode="fixed",a.unitsPerEm=s.value,a.unitPxPerUnit=t/s.value;else{a.unitMode="auto";const e=null===(i=this.lastAutoScalingReport)||void 0===i?void 0:i.unit;void 0!==e&&e>0&&(a.unitsPerEm=1/e,a.unitPxPerUnit=e*t)}const r=E(this.percentageScaling,this.pixelPerUnitGroupMap);if("value"===r.kind)a.percentageMode="fixed",a.percentagePointsPerEm=r.value,a.percentagePxPerPoint=t/r.value;else{a.percentageMode="auto";const i=null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.percentage;void 0!==i&&i>0&&(a.percentagePointsPerEm=1/i,a.percentagePxPerPoint=i*t)}return a}getEffectiveScaleFactor(){const{mode:t,factor:i}=$(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,a,s,r;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(a=i.global)||void 0===a?void 0:a.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(s=i.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(r=i.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles(),i=this.getEffectiveScaleFactor();return a(s,{key:"2af1b7f31952cd0ba32e0a069ce143d3402b4a77",style:t},a("div",{key:"b78ad13abb48a43c1da0aec4727372a482c39701"},a("bn-table-renderer",{key:"ab0132a3b57953379f6d8f5f19a18f95a14cc326",tableName:this.datasetName,dataVersion:this.dataVersion,sumTitle:this.prepareSumTitle(),scenarios:this.prepareScenarios(),scenariosDataFormat:this.prepareDataFormat(),grouped:this.prepareGrouped(),limit:this.prepareLimit(),showGroupTitle:this.prepareShowGroupTitle(),runningSum:this.runningSum,varianceWaterfall:this.varianceWaterfall,thereof:this.prepareThereOf(),thereofPosition:this.prepareThereofPosition(),partof:this.preparePartOf(),order:this.prepareOrder(),categorythereof:this.prepareColumnThereOf(),attributeColumns:this.prepareAttributes(),type:this.prepareTableType(),categoryWidth:this.prepareCategoryWidth(),dataFormatDigits:this.prepareDataFormatDigits(),i18n:this.prepareI18n(),i18nMode:this.prepareI18nMode(),measureScale:this.prepareMeasureScale(),measureType:this.prepareMeasureType(),measureUnit:this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(),filter:this.prepareFilter(),barColumns:this.prepareBarColumns(),interval:this.prepareInterval(),categoryIntervalPosition:this.prepareCategoryIntervalPosition(),barColumnMaxWidth:this.prepareBarColumnWidth(),unitScaling:this.prepareUnitScaling(),percentageScaling:this.preparePercentageScaling(),reportAutoScaling:this.handleAutoScalingReport,errors:this.errors,scaleFactor:i,ruleSetConfig:this.ruleSetConfig(),selectedStyle:this.selectedStyle})))}get element(){return this}static get watchers(){return{scale:[{validateScaling:0}],filter:[{validateFilter:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],thereofPosition:[{validateThereofPosition:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],categoryIntervalPosition:[{validateCategoryIntervalPosition:0}],tableAttributes:[{validateTableAttributes:0}]}}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}'}},[1,"bn-table",{datasets:[513],i18nNamespace:[513,"i18n-namespace"],scale:[1],ruleset:[513],selectedStyle:[513,"selected-style"],sumTitle:[1,"sum-title"],filter:[1],measureUnit:[1,"measure-unit"],scenarios:[1],variances:[1],barColumns:[1,"bar-columns"],barColumnWidth:[1,"bar-column-width"],unitScaling:[8,"unit-scaling"],percentageScaling:[8,"percentage-scaling"],dataFormat:[1,"data-format"],grouped:[4],showMeasureScale:[4,"show-measure-scale"],showGroupTitle:[4,"show-group-title"],runningSum:[4,"running-sum"],varianceWaterfall:[4,"variance-waterfall"],type:[1],limit:[2],thereof:[1],thereofPosition:[1,"thereof-position"],partof:[1],order:[1],orderDirection:[1,"order-direction"],measureType:[1,"measure-type"],measureScale:[1,"measure-scale"],dataFormatDigitsDecimal:[2,"data-format-digits-decimal"],dataFormatDigitsPercent:[2,"data-format-digits-percent"],categoryWidth:[1,"category-width"],columnthereof:[1],interval:[1],categoryIntervalPosition:[2,"category-interval-position"],tableAttributes:[1,"attributes"],datasetName:[32],dataVersion:[32],datasetMeta:[32],appliedScaleFactor:[32],hasBlankSetnames:[32],hasSetnameIndexWithoutSetname:[32],getBaseline:[64],getLayoutState:[64]},void 0,{scale:[{validateScaling:0}],filter:[{validateFilter:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],thereofPosition:[{validateThereofPosition:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],categoryIntervalPosition:[{validateCategoryIntervalPosition:0}],tableAttributes:[{validateTableAttributes:0}]}]),vt=ct,mt=function(){"undefined"!=typeof customElements&&["bn-table","bn-table-renderer"].forEach((t=>{switch(t){case"bn-table":customElements.get(r(t))||customElements.define(r(t),ct);break;case"bn-table-renderer":customElements.get(r(t))||et()}}))};export{vt as BnTable,mt as defineCustomElement}
|
|
1
|
+
import{p as t,H as i,w as e,h as a,a as s,t as r,f as n}from"./p-D6YGOYV1.js";import{h as o,a as l}from"./p-DDvWTgk1.js";import{v as h,a as d,i as p,p as u,q as c,r as v,s as m,h as g,t as f,u as y,w as b,x as S,c as w,y as O,l as A,z as D,A as T,f as N,B as W}from"./p-BiSytXUy.js";import{w as _}from"./p-DJUffGeB.js";import{w as C}from"./p-Dq9dG0Kr.js";import{w as P}from"./p-DQl2K2Xl.js";import{w as R,a as F,i as M}from"./p-xIWChKGS.js";import{w as x}from"./p-DwuXVo2h.js";import{w as I}from"./p-DjPWZfry.js";import{r as j}from"./p-CniN8ALm.js";import{w as U}from"./p-D40Am1Ap.js";import{w as k,r as B}from"./p-4vVbchX2.js";import{g as G}from"./p-DD1zlev_.js";import{f as L,r as E,p as $}from"./p-Xb6Ilq8u.js";import{o as z}from"./p-B6kka9sT.js";import{D as J,I as X,d as V,M as Y,B as Z,T as q}from"./p-B5tixDPM.js";import{T as K,a as Q,p as H}from"./p-BZXiWkDS.js";import{I as tt,a as it,d as et,c as at}from"./p-CGySoYRH.js";import{a as st,n as rt}from"./p-16rjcQ0t.js";import{LAYOUT_STATE_VERSION as nt}from"./index.js";import{o as ot,m as lt}from"./p-DaOm9YwQ.js";import{r as ht,a as dt}from"./p-CckAR27O.js";import{b as pt}from"./p-XFZYX7DZ.js";import{s as ut}from"./p-DakXa7Dp.js";const ct=t(class extends i{validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("WARN_scale");const i=Number(t);isNaN(i)||i<=0?this.errors.addOrReplace({id:"WARN_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("WARN_scale")}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.layoutObserver=null,this._lastScaledParentWidth=0,this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.hasBlankSetnames=!1,this.hasSetnameIndexWithoutSetname=!1,this.sumTitle="",this.filter="",this.measureUnit="",this.barColumnWidth="w10",this.unitScaling="100",this.percentageScaling="2",this.pixelPerUnitGroupMap=new Map,this.dataFormat="decimal",this.grouped=!1,this.showMeasureScale=!1,this.showGroupTitle=!0,this.runningSum=!1,this.varianceWaterfall=!1,this.type="list",this.limit=0,this.thereof="[]",this.thereofPosition="below",this.partof="[]",this.order="category",this.orderDirection="asc",this.measureType="volume",this.measureScale="greatest",this.dataFormatDigitsDecimal=1,this.dataFormatDigitsPercent=2,this.categoryWidth="w15",this.columnthereof=null,this.interval="none",this.categoryIntervalPosition=0,this.tableAttributes="",this._autoScaleGuard=!1,this.autoUnitWarningActive=!1,this.autoPctWarningActive=!1,this.handleAutoScalingReport=t=>{var i,e,a,s;this.lastAutoScalingReport={unit:null!==(i=t.unit)&&void 0!==i?i:null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.unit,percentage:null!==(a=t.percentage)&&void 0!==a?a:null===(s=this.lastAutoScalingReport)||void 0===s?void 0:s.percentage};const r=(t,i)=>void 0===i||Math.abs(t-i)>.001*Math.abs(t);if(void 0!==t.unit&&t.unit>0&&this.autoUnitWarningActive){const i=1/t.unit;r(i,this.lastReportedUnitsPerEm)&&(this.lastReportedUnitsPerEm=i,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${this.unitScaling}" - auto-fitted to 1 em ≈ ${L(i)} units.`}))}if(void 0!==t.percentage&&t.percentage>0&&this.autoPctWarningActive){const i=1/t.percentage;r(i,this.lastReportedPpPerEm)&&(this.lastReportedPpPerEm=i,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${this.percentageScaling}" - auto-fitted to 1 em ≈ ${L(i)} percentage points.`}))}},x(this),C(this),this.errors=k(this),P(this),this.componentStyle=I(this),this.ruleSetConfig=U(this),_(this,((t,i)=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1,this.hasBlankSetnames=Array.isArray(i)&&i.some((t=>{var i;return p(null!==(i=null==t?void 0:t.setname)&&void 0!==i?i:null==t?void 0:t.setName)})),this.hasSetnameIndexWithoutSetname=Array.isArray(i)&&i.some((t=>{var i,e;return void 0!==at(null!==(i=null==t?void 0:t.setnameIndex)&&void 0!==i?i:null==t?void 0:t.setNameIndex)&&p(null!==(e=null==t?void 0:t.setname)&&void 0!==e?e:null==t?void 0:t.setName)}))}),((t,i)=>{this.datasetMeta=i})),this.t=R(this).t,this.resolveInherited=F(this,[{propName:"scenarios",ancestorAttr:"title-scenarios"},{propName:"variances",ancestorAttr:"title-variances"},{propName:"order",ancestorAttr:"title-order"},{propName:"orderDirection",ancestorAttr:"title-order-direction"}],this.errors)}validateFilter(t){const i="ERR_filter";o(t)?this.errors.addOrReplace({id:i,type:"error",message:"filter: double backticks are not allowed."}):this.errors.remove(i)}validateScenario(t){const i="WARN_scenarios";if(M(t))return void this.errors.remove(i);const e=h(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"scenarios: invalid value(s) '"+(null==e?void 0:""+e)+"' are not supported."}):this.errors.remove(i)}validateVariances(t){const i="WARN_variances";if(M(t))return void this.errors.remove(i);const e=d(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumns(t){const i="WARN_barColumns";if(p(t))return void this.errors.remove(i);const e=u(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"barColumns: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateBarColumnWidth(t){const i="WARN_barColumnWidth";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"barColumnWidth: invalid value '"+t+"' is not supported."})}validateUnitScaling(t){const i="WARN_unitScaling";"invalid"===E(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validatePercentageScaling(t){const i="WARN_percentageScaling";"invalid"===E(t,this.pixelPerUnitGroupMap).kind?this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value '"+t+"' is not supported."}):this.errors.remove(i)}validateDataFormat(t){const i="WARN_dataFormat";v(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormat: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateType(t){const i="WARN_type";m(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"type: invalid value(s) '"+(null==t?void 0:""+t)+"' are not supported."})}validateLimit(t){const i="WARN_limit";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateThereOf(t){const i="WARN_thereof",e=f(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"ThereOf: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateThereofPosition(t){const i="WARN_thereofPosition";p(t)||y(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"thereofPosition: invalid value '"+t+"' is not supported."})}validatePartOf(t){const i="WARN_partof",e=b(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"partof: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderList(t){const i="WARN_order";if(M(t))return void this.errors.remove(i);const e=S(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}validateOrderDirection(t){const i="WARN_orderDirection";M(t)||w(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureType(t){const i="WARN_measureType";O(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureType: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateMeasureScale(t){const i="WARN_measureScale";A(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureScale: invalid value '"+(null==t?void 0:""+t)+"' is not supported."})}validateDataFormatDigitsDecimal(t){const i="WARN_dataFormatDigitsDecimal";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsDecimal: invalid value(s) '"+t+"' are not supported."})}validateDateFormatDigitsPercent(t){const i="WARN_dataFormatDigitsPercent";g(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"dataFormatDigitsPercent: invalid value(s) '"+t+"' are not supported."})}validateCategoryWidth(t){const i="WARN_categoryWidth";D(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"categoryWidth: invalid value(s) '"+t+"' are not supported."})}validateColumnThereOf(t){const i=T(t),e="WARN_columnthereof";i.length>0?this.errors.addOrReplace({id:e,type:"warning",message:"columnthereof: invalid value(s) '"+JSON.stringify(i)+"' are not supported."}):this.errors.remove(e)}validateInterval(t){const i="WARN_interval",e=null==t?void 0:t.trim().toLowerCase();p(t)||e===tt||e===it||N(e)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"interval: invalid value '"+t+"' is not supported."})}validateCategoryIntervalPosition(t){const i="WARN_categoryIntervalPosition";p(t)||g(t)&&Number(t)>=0?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"categoryIntervalPosition: invalid value '"+t+"' is not supported."})}validateTableAttributes(t){const i="WARN_attributes",e=W(t);e.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"attributes: invalid value(s) '"+JSON.stringify(e)+"' are not supported."}):this.errors.remove(i)}componentWillLoad(){this.validateFilter(this.filter),this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateDataFormat(this.dataFormat),this.validateType(this.type),this.validateLimit(this.limit),this.validateThereOf(this.thereof),this.validateThereofPosition(this.thereofPosition),this.validatePartOf(this.partof),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal),this.validateDateFormatDigitsPercent(this.dataFormatDigitsPercent),this.validateCategoryWidth(this.categoryWidth),this.validateMeasureType(this.measureType),this.validateMeasureScale(this.measureScale),this.validateColumnThereOf(this.columnthereof),this.validateInterval(this.interval),this.validateCategoryIntervalPosition(this.categoryIntervalPosition),this.validateTableAttributes(this.tableAttributes),this.validateBarColumns(this.barColumns),this.validateBarColumnWidth(this.barColumnWidth),this.validateUnitScaling(this.unitScaling),this.validatePercentageScaling(this.percentageScaling),this.validateScaling(this.scale)}componentDidLoad(){this.layoutObserver=z(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=G(this.element);t>0&&Math.abs(t-this._lastScaledParentWidth)>2&&(this._lastScaledParentWidth=t,n(this))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}componentDidRender(){ut(this.element,"bn-table-renderer");const{mode:t}=$(this.scale);if("auto"!==t&&"empty"!==t)return this._autoScaleGuard=!1,void this.checkOverflow();if(this._autoScaleGuard)return this._autoScaleGuard=!1,void this.checkOverflow();const i=this.element,{width:a}=G(i);if(a<=0)return void this.checkOverflow();this._lastScaledParentWidth=a;const s=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),r=i.scrollWidth,n=this.appliedScaleFactor;if(r<=a+1)return this.errors.remove("AUTO_scale"),void this.checkOverflow();const o=Math.max(.3,n*(a-1)/r);Math.abs(o-n)<.001||(i.style.setProperty("--bn-font-size",s*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:"Auto-scaled table by factor "+o.toFixed(3)}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,e((()=>{this.appliedScaleFactor=o}))),this.checkOverflow()}checkOverflow(){const t=G(this.element),i=this.element.scrollWidth,e=this.element.scrollHeight,a=t.width>0&&i>t.width+1,s=t.height>0&&e>t.height+1;if(!a&&!s)return void B(this.errors,null);const{mode:r}=$(this.scale),n="auto"!==r&&"empty"!==r,o=[];a&&o.push(`width (${Math.round(i)}px > ${Math.round(t.width)}px)`),s&&o.push(`height (${Math.round(e)}px > ${Math.round(t.height)}px)`),B(this.errors,`Table exceeds available ${o.join(" and ")}. Give the component more space, reduce rows (e.g. limit), or set a smaller scale.`,n)}prepareDataFormat(){var t;return J[null===(t=this.dataFormat)||void 0===t?void 0:t.toUpperCase()]}prepareGrouped(){return this.grouped}prepareShowGroupTitle(){return this.showGroupTitle}prepareThereofPosition(){var t;return(null===(t=this.thereofPosition)||void 0===t?void 0:t.toLowerCase())===K.ABOVE?K.ABOVE:K.BELOW}prepareTableType(){var t;return Q[null===(t=this.type)||void 0===t?void 0:t.toUpperCase()]}prepareLimit(){return Math.floor(Number(this.limit)||0)}prepareThereOf(){if(null==this.thereof||""===this.thereof.trim())return[];try{return JSON.parse(this.thereof)}catch(t){return[]}}preparePartOf(){if(null==this.partof||""===this.partof.trim())return[];try{return JSON.parse(this.partof)}catch(t){return[]}}prepareOrder(){var t;const i=this.resolveInherited("order",this.order,"category").value,e=this.resolveInherited("orderDirection",this.orderDirection,"asc").value,a="auto"===(null==i?void 0:i.trim().toLowerCase());let s=i;return a&&(null===(t=this.datasetMeta)||void 0===t?void 0:t.suggestedOrder)&&(s=this.datasetMeta.suggestedOrder),{hierarchy:s.split(",").map((t=>rt(t))),direction:st[null==e?void 0:e.toUpperCase()]}}prepareI18nMode(){return X.META}prepareI18n(){const t=l,i=new Map(["in","category","operation","thereof","part_of","SUM_TOTAL","no-data","REST"].map((t=>[t,this.t(".".concat(t))]))),e=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...e.entries(),...i.entries(),...j(this.ruleSetConfig("user"))])}prepareDataFormatDigits(){return{percent:this.dataFormatDigitsPercent,decimal:this.dataFormatDigitsDecimal}}prepareScenarios(){var t,i,e,a,s,r,n,o,l,h,d;const u=this.resolveInherited("scenarios",this.scenarios),c=this.resolveInherited("variances",this.variances);if(u.inherited||c.inherited){this.errors.remove("AUTO_scenarios");let a=[];return p(u.value)?u.unresolved&&(a=a.concat(null!==(i=null===(t=this.datasetMeta)||void 0===t?void 0:t.availableScenarios)&&void 0!==i?i:[])):a=a.concat(u.value.split(",")),(null===(e=c.value)||void 0===e?void 0:e.trim().length)>0&&(a=a.concat(c.value.split(","))),a.map((t=>t.trim()))}const v="auto"===(null===(a=u.value)||void 0===a?void 0:a.trim().toLowerCase()),m=v||u.unresolved;if((p(u.value)||v)&&p(c.value))return(null===(r=null===(s=this.datasetMeta)||void 0===s?void 0:s.availableScenarios)||void 0===r?void 0:r.length)>0?(m?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),this.datasetMeta.availableScenarios):[];let g=[];return v||p(u.value)?(null===(o=null===(n=this.datasetMeta)||void 0===n?void 0:n.availableScenarios)||void 0===o?void 0:o.length)>0&&(m?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:"scenarios: not set, auto-detected: "+this.datasetMeta.availableScenarios.join(",")}),g=g.concat(this.datasetMeta.availableScenarios)):(this.errors.remove("AUTO_scenarios"),g=g.concat(null===(l=u.value)||void 0===l?void 0:l.split(","))),(null===(h=c.value)||void 0===h?void 0:h.trim().length)>0&&(g=g.concat(null===(d=c.value)||void 0===d?void 0:d.split(","))),g.map((t=>t.trim()))}prepareCategoryWidth(){var t;return p(this.categoryWidth)?V.INF:V[null===(t=this.categoryWidth)||void 0===t?void 0:t.toUpperCase()]}prepareMeasureScale(){return p(this.measureScale)?"GREATEST":["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(this.measureScale.trim())||"LEAST"===this.measureScale.trim().toUpperCase()?this.measureScale.trim():"GREATEST"}prepareMeasureType(){var t;return p(this.measureType)?Y.VOLUME:Y[null===(t=this.measureType)||void 0===t?void 0:t.toUpperCase()]}prepareColumnThereOf(){if(null==this.columnthereof||""===this.columnthereof.trim())return new Map;const t=new Map;try{const i=JSON.parse(this.columnthereof);for(const[e,a]of Object.entries(i))!1===t.has(a.scenario)&&t.set(a.scenario,[]),t.get(a.scenario).push(a)}catch(t){return new Map}return t}prepareInterval(){var t;const i="WARN_intervalConflict",e="WARN_intervalNoDate",a="WARN_intervalSetname",s="WARN_intervalSetnameIndex",r=p(this.interval)?tt:this.interval.trim().toLowerCase();return r!==tt&&r!==it&&!N(r)||r===tt?(this.errors.remove(i),this.errors.remove(e),this.errors.remove(a),this.errors.remove(s),tt):null!=this.columnthereof&&""!==this.columnthereof.trim()?(this.errors.addOrReplace({id:i,type:"warning",message:"interval: cannot be combined with columnthereof, interval is ignored."}),this.errors.remove(e),this.errors.remove(a),this.errors.remove(s),tt):(this.errors.remove(i),r===it?(this.hasBlankSetnames?this.errors.addOrReplace({id:a,type:"warning",message:"interval: rows with blank setname found, they are grouped under '-'."}):this.errors.remove(a),this.hasSetnameIndexWithoutSetname?this.errors.addOrReplace({id:s,type:"warning",message:"interval: rows with setnameIndex but blank setname found, setnameIndex needs setname."}):this.errors.remove(s),this.errors.remove(e),it):(this.errors.remove(a),this.errors.remove(s),this.datasetMeta&&!(null===(t=this.datasetMeta.dateRange)||void 0===t?void 0:t.hasData)?(this.errors.addOrReplace({id:e,type:"warning",message:"interval: dataset has no date values, interval is ignored."}),tt):(this.errors.remove(e),r)))}prepareCategoryIntervalPosition(){const t=Number(this.categoryIntervalPosition);return Number.isInteger(t)&&t>0?t:0}prepareAttributes(){if(null==this.tableAttributes||""===this.tableAttributes.trim())return[];try{const t=JSON.parse(this.tableAttributes);return null===t||"object"!=typeof t||t instanceof Array?[]:Object.entries(t).map((([t,i],e)=>"string"==typeof i?H(t,"attr_"+e,i):null)).filter((t=>null!==t))}catch(t){return[]}}prepareSumTitle(){return""===this.sumTitle||null==this.sumTitle?"SUM_TOTAL":this.sumTitle}prepareShowMeasureScale(){return this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}prepareFilter(){return 0===this.filter.length?"":this.filter}prepareBarColumnWidth(){var t;const i=null===(t=this.barColumnWidth)||void 0===t?void 0:t.toUpperCase(),e=q[i];return e?Z[e]:Z[q.W10]}prepareBarColumns(){return p(this.barColumns)?[]:this.barColumns.split(",").map((t=>t.trim()))}prepareUnitScaling(){const t=E(this.unitScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_unitScaling"),this.autoUnitWarningActive=!1,this.lastReportedUnitsPerEm=void 0,0):(this.autoUnitWarningActive=!0,this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:`unit-scaling: invalid value "${t.raw}" - auto-fitting to the bar column width.`}),0)}preparePercentageScaling(){const t=E(this.percentageScaling,this.pixelPerUnitGroupMap);return"value"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,1/t.value):"auto"===t.kind?(this.errors.remove("AUTO_percentageScaling"),this.autoPctWarningActive=!1,this.lastReportedPpPerEm=void 0,0):(this.autoPctWarningActive=!0,this.errors.addOrReplace({id:"AUTO_percentageScaling",type:"warning",message:`percentage-scaling: invalid value "${t.raw}" - auto-fitting to the pin area.`}),0)}getDataStructure(){return{ITableDataRow:{setName:{type:"string",isOptional:!1,description:""},setNameIndex:{type:"number",isOptional:!0,description:""},date:{type:"string",isOptional:!1,description:""},operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!1,description:""},rowGroupIndex:{type:"number",isOptional:!1,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!1,description:""},subCategoryIndex:{type:"number",isOptional:!1,description:""},columnGroup:{type:"string",isOptional:!1,description:""},columnGroupIndex:{type:"number",isOptional:!1,description:""},columnSubGroup:{type:"string",isOptional:!1,description:""},columnSubGroupIndex:{type:"number",isOptional:!1,description:""},ac1:{type:"number",isOptional:!1,description:""},ac2:{type:"number",isOptional:!1,description:""},ac3:{type:"number",isOptional:!1,description:""},ac4:{type:"number",isOptional:!1,description:""},pp1:{type:"number",isOptional:!1,description:""},pp2:{type:"number",isOptional:!1,description:""},pp3:{type:"number",isOptional:!1,description:""},pp4:{type:"number",isOptional:!1,description:""},fc1:{type:"number",isOptional:!1,description:""},fc2:{type:"number",isOptional:!1,description:""},fc3:{type:"number",isOptional:!1,description:""},fc4:{type:"number",isOptional:!1,description:""},pl1:{type:"number",isOptional:!1,description:""},pl2:{type:"number",isOptional:!1,description:""},pl3:{type:"number",isOptional:!1,description:""},pl4:{type:"number",isOptional:!1,description:""}}}}async getBaseline(){return this.readBaseline()}readBaseline(){var t,i,e;const a=null===(e=null===(i=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelector("bn-table-renderer"))||void 0===i?void 0:i.shadowRoot)||void 0===e?void 0:e.querySelector("table");return pt(a,this.element)}async getLayoutState(t){var i,e,a,s;const r=null!==(i=null==t?void 0:t.detail)&&void 0!==i?i:"summary",n=ot(this.element),o=this.getEffectiveScaleFactor(),l=Number.isFinite(o)&&o>0?o:1,h=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}))*l,d={version:nt,tag:this.element.localName,id:dt(this.element),slot:null!==(e=this.element.getAttribute("slot"))&&void 0!==e?e:void 0,rect:lt(this.element,n),em:{fontSizePx:h,appliedScaleFactor:l},regions:[],metadata:{},diagnostics:ht(this.element),scaling:this.resolveScalingInfo(h),baseline:this.readBaseline()},p=null===(a=this.element.shadowRoot)||void 0===a?void 0:a.querySelector("bn-table-renderer");if(p){const t=null!==(s=p.scenarios)&&void 0!==s?s:[];if(d.metadata.scenarios=t.filter((t=>!t.startsWith("d"))),d.metadata.variances=t.filter((t=>t.startsWith("d"))),"function"==typeof p.getLayoutDetail){const t=await p.getLayoutDetail(n,r);d.regions=t.regions,d.metadata=Object.assign(Object.assign({},d.metadata),t.metadata),d.diagnostics=[...d.diagnostics,...t.diagnostics],t.elements&&(d.elements=t.elements),t.table&&(d.table=t.table)}}return d}resolveScalingInfo(t){var i,e;const a={},s=E(this.unitScaling,this.pixelPerUnitGroupMap);if("value"===s.kind)a.unitMode="fixed",a.unitsPerEm=s.value,a.unitPxPerUnit=t/s.value;else{a.unitMode="auto";const e=null===(i=this.lastAutoScalingReport)||void 0===i?void 0:i.unit;void 0!==e&&e>0&&(a.unitsPerEm=1/e,a.unitPxPerUnit=e*t)}const r=E(this.percentageScaling,this.pixelPerUnitGroupMap);if("value"===r.kind)a.percentageMode="fixed",a.percentagePointsPerEm=r.value,a.percentagePxPerPoint=t/r.value;else{a.percentageMode="auto";const i=null===(e=this.lastAutoScalingReport)||void 0===e?void 0:e.percentage;void 0!==i&&i>0&&(a.percentagePointsPerEm=1/i,a.percentagePxPerPoint=i*t)}return a}getEffectiveScaleFactor(){const{mode:t,factor:i}=$(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,a,s,r;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(a=i.global)||void 0===a?void 0:a.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(s=i.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(r=i.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles(),i=this.getEffectiveScaleFactor();return a(s,{key:"2af1b7f31952cd0ba32e0a069ce143d3402b4a77",style:t},a("div",{key:"b78ad13abb48a43c1da0aec4727372a482c39701"},a("bn-table-renderer",{key:"ab0132a3b57953379f6d8f5f19a18f95a14cc326",tableName:this.datasetName,dataVersion:this.dataVersion,sumTitle:this.prepareSumTitle(),scenarios:this.prepareScenarios(),scenariosDataFormat:this.prepareDataFormat(),grouped:this.prepareGrouped(),limit:this.prepareLimit(),showGroupTitle:this.prepareShowGroupTitle(),runningSum:this.runningSum,varianceWaterfall:this.varianceWaterfall,thereof:this.prepareThereOf(),thereofPosition:this.prepareThereofPosition(),partof:this.preparePartOf(),order:this.prepareOrder(),categorythereof:this.prepareColumnThereOf(),attributeColumns:this.prepareAttributes(),type:this.prepareTableType(),categoryWidth:this.prepareCategoryWidth(),dataFormatDigits:this.prepareDataFormatDigits(),i18n:this.prepareI18n(),i18nMode:this.prepareI18nMode(),measureScale:this.prepareMeasureScale(),measureType:this.prepareMeasureType(),measureUnit:this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(),filter:this.prepareFilter(),barColumns:this.prepareBarColumns(),interval:this.prepareInterval(),categoryIntervalPosition:this.prepareCategoryIntervalPosition(),barColumnMaxWidth:this.prepareBarColumnWidth(),unitScaling:this.prepareUnitScaling(),percentageScaling:this.preparePercentageScaling(),reportAutoScaling:this.handleAutoScalingReport,errors:this.errors,scaleFactor:i,ruleSetConfig:this.ruleSetConfig(),selectedStyle:this.selectedStyle})))}get element(){return this}static get watchers(){return{scale:[{validateScaling:0}],filter:[{validateFilter:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],thereofPosition:[{validateThereofPosition:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],categoryIntervalPosition:[{validateCategoryIntervalPosition:0}],tableAttributes:[{validateTableAttributes:0}]}}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}'}},[1,"bn-table",{datasets:[513],i18nNamespace:[513,"i18n-namespace"],scale:[1],ruleset:[513],selectedStyle:[513,"selected-style"],sumTitle:[1,"sum-title"],filter:[1],measureUnit:[1,"measure-unit"],scenarios:[1],variances:[1],barColumns:[1,"bar-columns"],barColumnWidth:[1,"bar-column-width"],unitScaling:[8,"unit-scaling"],percentageScaling:[8,"percentage-scaling"],dataFormat:[1,"data-format"],grouped:[4],showMeasureScale:[4,"show-measure-scale"],showGroupTitle:[4,"show-group-title"],runningSum:[4,"running-sum"],varianceWaterfall:[4,"variance-waterfall"],type:[1],limit:[2],thereof:[1],thereofPosition:[1,"thereof-position"],partof:[1],order:[1],orderDirection:[1,"order-direction"],measureType:[1,"measure-type"],measureScale:[1,"measure-scale"],dataFormatDigitsDecimal:[2,"data-format-digits-decimal"],dataFormatDigitsPercent:[2,"data-format-digits-percent"],categoryWidth:[1,"category-width"],columnthereof:[1],interval:[1],categoryIntervalPosition:[2,"category-interval-position"],tableAttributes:[1,"attributes"],datasetName:[32],dataVersion:[32],datasetMeta:[32],appliedScaleFactor:[32],hasBlankSetnames:[32],hasSetnameIndexWithoutSetname:[32],getBaseline:[64],getLayoutState:[64]},void 0,{scale:[{validateScaling:0}],filter:[{validateFilter:0}],scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],barColumns:[{validateBarColumns:0}],barColumnWidth:[{validateBarColumnWidth:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],dataFormat:[{validateDataFormat:0}],type:[{validateType:0}],limit:[{validateLimit:0}],thereof:[{validateThereOf:0}],thereofPosition:[{validateThereofPosition:0}],partof:[{validatePartOf:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],measureType:[{validateMeasureType:0}],measureScale:[{validateMeasureScale:0}],dataFormatDigitsDecimal:[{validateDataFormatDigitsDecimal:0}],dataFormatDigitsPercent:[{validateDateFormatDigitsPercent:0}],categoryWidth:[{validateCategoryWidth:0}],columnthereof:[{validateColumnThereOf:0}],interval:[{validateInterval:0}],categoryIntervalPosition:[{validateCategoryIntervalPosition:0}],tableAttributes:[{validateTableAttributes:0}]}]),vt=ct,mt=function(){"undefined"!=typeof customElements&&["bn-table","bn-table-renderer"].forEach((t=>{switch(t){case"bn-table":customElements.get(r(t))||customElements.define(r(t),ct);break;case"bn-table-renderer":customElements.get(r(t))||et()}}))};export{vt as BnTable,mt as defineCustomElement}
|