@bino-bi/bn-template-engine 1.0.0-alpha.13 → 1.0.0-alpha.15
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-637e3b8f.entry.js → p-19f49fbc.entry.js} +1 -1
- package/dist/bn-template-engine/p-209b3fd9.entry.js +1 -0
- package/dist/bn-template-engine/{p-67eae33e.entry.js → p-3465fcdc.entry.js} +1 -1
- package/dist/bn-template-engine/{p-82023539.entry.js → p-67746414.entry.js} +1 -1
- package/dist/bn-template-engine/p-BPDZcex5.js +1 -0
- package/dist/bn-template-engine/{p-DHheVOfP.js → p-Tx6omDWp.js} +1 -1
- package/dist/bn-template-engine/{p-52097456.entry.js → p-d724ab88.entry.js} +1 -1
- package/dist/bn-template-engine/p-efd3b67a.entry.js +1 -0
- package/dist/bn-template-engine/{p-46699464.entry.js → p-ff659485.entry.js} +1 -1
- package/dist/bn-template-engine/p-z9bPNFYF.js +1 -0
- package/dist/cjs/bn-asset_21.cjs.entry.js +348 -75
- package/dist/cjs/bn-grid.cjs.entry.js +2 -2
- package/dist/cjs/bn-image.cjs.entry.js +2 -2
- package/dist/cjs/bn-internationalization.cjs.entry.js +1 -1
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-text.cjs.entry.js +3 -3
- package/dist/cjs/bn-tree.cjs.entry.js +2 -2
- package/dist/cjs/{context-protocol-Op7uUwN3.js → context-protocol-Cn5PL928.js} +14 -0
- package/dist/cjs/editor-companion.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{scaling-57N4Cxb_.js → scaling-DM2UILdF.js} +58 -17
- package/dist/cjs/{withStyled-C2kmGAK3.js → withStyled-Dx3uRw9g.js} +72 -1
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +28 -10
- package/dist/collection/components/bn-chart-structure/utils/helper/ElementPositions.js +46 -4
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +39 -1
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +40 -10
- package/dist/collection/components/bn-dataset/bn-dataset.js +25 -13
- package/dist/collection/components/bn-datasource/bn-datasource.js +23 -12
- package/dist/collection/components/bn-layout-card/bn-layout-card.css +5 -0
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +6 -3
- package/dist/collection/components/bn-layout-page/bn-layout-page.css +5 -0
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +6 -3
- package/dist/collection/components/bn-table/bn-table.js +75 -7
- package/dist/collection/components/bn-table/ibcs-table.js +27 -0
- package/dist/collection/components/bn-table/utils/Table.js +2 -2
- package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +28 -5
- package/dist/collection/components/bn-table/utils/helper/DataQuery.js +46 -6
- package/dist/collection/components/bn-table/utils/model/TableAttribute.js +46 -0
- package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +5 -0
- package/dist/collection/context/scopedDb.js +14 -0
- package/dist/collection/utils/parentDimensions.js +57 -16
- package/dist/collection/utils/validate.js +23 -0
- package/dist/components/DateStringFactory.js +1 -1
- package/dist/components/Order.js +1 -1
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-dataset.js +1 -1
- package/dist/components/bn-datasource.js +1 -1
- package/dist/components/bn-layout-card.js +1 -1
- package/dist/components/bn-layout-page.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-title2.js +1 -1
- package/dist/components/context-protocol.js +1 -1
- package/dist/components/ibcs-chart-structure2.js +1 -1
- package/dist/components/ibcs-chart-time2.js +1 -1
- package/dist/components/ibcs-table2.js +1 -1
- package/dist/components/ibcs-title2.js +1 -1
- package/dist/components/scaling.js +1 -1
- package/dist/components/validate.js +1 -1
- package/dist/esm/bn-asset_21.entry.js +348 -75
- package/dist/esm/bn-grid.entry.js +2 -2
- package/dist/esm/bn-image.entry.js +2 -2
- package/dist/esm/bn-internationalization.entry.js +1 -1
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-text.entry.js +3 -3
- package/dist/esm/bn-tree.entry.js +2 -2
- package/dist/esm/{context-protocol-BDhzNbeD.js → context-protocol-BB-4Onmw.js} +14 -0
- package/dist/esm/editor-companion.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{scaling-La1Ow72h.js → scaling-h4KcBet3.js} +58 -17
- package/dist/esm/{withStyled-Bl9cSoRW.js → withStyled-BBvU2f-A.js} +71 -2
- package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +4 -0
- package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +16 -1
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +13 -0
- package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +4 -0
- package/dist/types/components/bn-dataset/bn-dataset.d.ts +15 -7
- package/dist/types/components/bn-datasource/bn-datasource.d.ts +13 -6
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +1 -0
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +1 -0
- package/dist/types/components/bn-table/bn-table.d.ts +13 -0
- package/dist/types/components/bn-table/ibcs-table.d.ts +2 -0
- package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +3 -1
- package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +11 -0
- package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +22 -0
- package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +3 -0
- package/dist/types/components.d.ts +45 -20
- package/dist/types/utils/validate.d.ts +6 -0
- package/package.json +1 -1
- package/dist/bn-template-engine/p-3c827826.entry.js +0 -1
- package/dist/bn-template-engine/p-BVFHvEXF.js +0 -1
- package/dist/bn-template-engine/p-CQnZV3JG.js +0 -1
- package/dist/bn-template-engine/p-ab3ea8cf.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as s,H as i,g as o}from"./p-B_d-jp99.js";import{w as
|
|
1
|
+
import{r as t,h as s,H as i,g as o}from"./p-B_d-jp99.js";import{w as n,a as r}from"./p-z9bPNFYF.js";import{w as e,a}from"./p-B4JfKvVT.js";import{g as l}from"./p-Tx6omDWp.js";const f=class{constructor(s){t(this,s),n(this),e(this),this.errors=a(this),this.componentStyle=r(this)}connectedCallback(){this.stores=l(this.element)}getFontStyles(){return this.componentStyle((t=>{var s,i,o,n;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(o=t.global)||void 0===o?void 0:o.fontColor)||"#000000","--bn-font-background":(null===(n=t.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}prepareAssetUrl(t){if(null==t||""===t)return"";const s=this.stores.assets.state;return t.startsWith("asset:")?s[t.substring(6)]:s[t]||t}render(){return s(i,{key:"656f301d5fb1a7650f4c7d0cbb3fe1ef15b8ae92",style:this.getFontStyles()},null!=this.source&&""!==this.source?s("img",{src:this.prepareAssetUrl(this.source)}):"")}get element(){return o(this)}};f.style=":host{display:inline-block;position:relative;overflow:hidden}img{max-width:100%;height:auto}";export{f as bn_image}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as o,H as e,g as i}from"./p-B_d-jp99.js";import{w as n,a as s,g as a,p as r}from"./p-BPDZcex5.js";import{w as l,a as d}from"./p-B4JfKvVT.js";import{w as c,a as h}from"./p-z9bPNFYF.js";import"./p-Tx6omDWp.js";const v=new Set(["br","b","i","strong","em","span","p","div","table","tr","td","th","thead","tbody","tfoot","ul","ol","li","h1","h2","h3","h4","h5","h6","sub","sup","small","hr","a","img"]),f=new Set(["class","style","colspan","rowspan","href","title","src","alt","width","height"]),u=/\b(__proto__|globalThis)\b|\.constructor\b/;function p(t){const o=document.createElement("div");return o.innerHTML=t,b(o),o.innerHTML}function b(t){for(const o of Array.from(t.childNodes)){if(o.nodeType!==Node.ELEMENT_NODE)continue;const e=o;if(v.has(e.tagName.toLowerCase())){for(const t of Array.from(e.attributes)){const o=t.name.toLowerCase();o.startsWith("on")||!f.has(o)?e.removeAttribute(t.name):"href"!==o&&"src"!==o||!/^\s*javascript:/i.test(t.value)?"style"===o&&/expression|javascript/i.test(t.value)&&e.removeAttribute(t.name):e.removeAttribute(t.name)}b(e)}else t.replaceChild(document.createTextNode(e.textContent||""),e)}}const m=class{constructor(o){t(this,o),this.data={},c(this),l(this),this.errors=d(this),this.t=n(this).t,s(this,((t,o)=>{this.data=Object.assign(Object.assign({},this.data),{[t]:o})})),this.componentStyle=h(this)}validateValue(t){"string"!=typeof t||""===t?this.errors.addOrReplace({id:"no_value",type:"warning",message:"Empty value"}):this.errors.remove("no_value")}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("ERR_scale");const o=Number(t);isNaN(o)||o<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}componentWillLoad(){this.validateValue(this.value),this.validateScaling(this.scale)}evalTemplate(t){if(!t)return"";if(u.test(t))return this.errors.addOrReplace({id:"ERR_value_eval",type:"error",message:"Template contains forbidden pattern"}),"";try{const o=new Proxy({data:this.data,t:this.t},{has:()=>!0,get:(t,o)=>o===Symbol.unscopables?void 0:t[o],set:()=>!0}),e=new Function("sandbox","with(sandbox){try{return`"+t+'`}catch(e){return""}}').call(o,o);return this.errors.remove("ERR_value_eval"),null!=e?String(e):""}catch(t){return this.errors.addOrReplace({id:"ERR_value_eval",type:"error",message:`Template evaluation failed: ${t instanceof Error?t.message:String(t)}`}),""}}prepareStyle(){return this.componentStyle((t=>{var o,e,i,n,s,a,r,l,d,c,h,v,f,u,p,b,m,g,y,w,_,$;return{fontStyles:{font:`${null!==(n=null!==(e=null===(o=t["bn-text"])||void 0===o?void 0:o.fontSizePx)&&void 0!==e?e:null===(i=t.global)||void 0===i?void 0:i.fontSizePx)&&void 0!==n?n:13.3333}px ${null!==(l=null!==(a=null===(s=t["bn-text"])||void 0===s?void 0:s.fontFamily)&&void 0!==a?a:null===(r=t.global)||void 0===r?void 0:r.fontFamily)&&void 0!==l?l:"'Noto Sans', sans-serif"}`,size:null!==(v=null!==(c=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==c?c:null===(h=t.global)||void 0===h?void 0:h.fontSizePx)&&void 0!==v?v:13.3333,color:null!==(b=null!==(u=null===(f=t["bn-text"])||void 0===f?void 0:f.fontColor)&&void 0!==u?u:null===(p=t.global)||void 0===p?void 0:p.fontColor)&&void 0!==b?b:"#000000",background:null!==(w=null!==(g=null===(m=t["bn-text"])||void 0===m?void 0:m.fontBackgroundColor)&&void 0!==g?g:null===(y=t.global)||void 0===y?void 0:y.fontBackgroundColor)&&void 0!==w?w:"#ffffff",leading:null!==($=null===(_=t["bn-text"])||void 0===_?void 0:_.leading)&&void 0!==$?$:1.8}}}))}applyScaling(t){const o=this.element,{mode:e,factor:i}=r(this.scale),{width:n,height:s}=a(o),l=o.scrollHeight>o.clientHeight+1?o.clientHeight:s,d=n,c=d>0&&o.scrollWidth>d+1,h=l>0&&o.scrollHeight>l+1,v=c||h;if(d<=0&&l<=0)return;if("none"===e){if(v){const t=[];c&&t.push(`w:${o.scrollWidth}>${Math.round(d)}`),h&&t.push(`h:${o.scrollHeight}>${Math.round(l)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows container (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}if("factor"===e){if(v){const t=[];c&&t.push(`w:${o.scrollWidth}>${Math.round(d)}`),h&&t.push(`h:${o.scrollHeight}>${Math.round(l)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows with factor ${i} (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}o.style.setProperty("--bn-font-size",`${t}px`);const f=o.scrollWidth,u=o.scrollHeight,p=o.clientHeight,b=u>p+1?p:s,m=d<=0||f<=d+1,g=b<=0||u<=b+1;if(m&&g)return void this.errors.remove("AUTO_scale");const y=Math.min(1,!m&&d>0?d/f:1,!g&&b>0?b/u:1);o.style.setProperty("--bn-font-size",t*y+"px"),"empty"===e?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled font by factor ${y.toFixed(3)}`}):this.errors.remove("AUTO_scale")}componentDidRender(){this.container.innerHTML=p(this.evalTemplate(this.value)),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:i,factor:n}=r(this.scale),s="factor"===i?t.size*n+"px":`${t.size}px`,a={"--bn-font-family":t.font.substring(t.font.indexOf("px ")+3),"--bn-font-size":s,"--bn-font-color":t.color,"--bn-font-background":t.background};return o(e,{key:"086c3caad1f7c502e26ebbd1bf7d9044782333ab",style:a},o("div",{key:"584938536bedd3de7a6390ce9d57fb568a69191b"},o("span",{key:"b545bd809b32d2d0cac2310bd1003dab39bebc8a",class:"container",ref:t=>{this.container=t}})))}get element(){return i(this)}static get watchers(){return{value:[{validateValue:0}],scale:[{validateScaling:0}]}}};m.style=':host{padding:0.5em;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);background-color:var(--bn-font-background, white)}span.container p{margin:0}';export{m as bn_text}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as s,F as r,g as e}from"./p-B_d-jp99.js";import{g as i,B as n}from"./p-
|
|
1
|
+
import{r as t,h as s,F as r,g as e}from"./p-B_d-jp99.js";import{g as i,B as n}from"./p-Tx6omDWp.js";const o=class{constructor(s){t(this,s),this.distinctCache=new Map}connectedCallback(){this.stores=i(this.element)}internationalizationKeys(){return Promise.resolve(n)}getDistinctFromDataSource(t,s){const r=`datasource:${t}:${s}`;if(this.distinctCache.has(r))return Promise.resolve(this.distinctCache.get(r));const e=this.distinct(this.queryRows(t),s);return this.distinctCache.set(r,e),Promise.resolve(e)}getDistinctFromDataset(t,s){const r=`dataset:${t}:${s}`;if(this.distinctCache.has(r))return Promise.resolve(this.distinctCache.get(r));const e=this.distinct(this.queryRows(t),s);return this.distinctCache.set(r,e),Promise.resolve(e)}render(){return s(r,{key:"d6eb8ea68a4d507142547f4014f1dd3db58dcfd4"})}queryRows(t){try{return this.stores.db.db.exec(`SELECT * FROM \`${t}\``)}catch(t){return[]}}distinct(t,s){return[...new Set(t.map((t=>t[s])))].filter((t=>null!=t))}get element(){return e(this)}};o.style="editor-companion{display:none}";export{o as editor_companion}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as t,f as e}from"./p-B_d-jp99.js";import{g as r,c as n,D as s}from"./p-Tx6omDWp.js";import{r as a}from"./p-B4JfKvVT.js";const i=t=>{if("object"==typeof t&&null!==t){if("function"==typeof Object.getPrototypeOf){const e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}return"[object Object]"===Object.prototype.toString.call(t)}return!1},o=(t,e)=>e,u=(t,e)=>[...new Set([...t,...e])],c=(t,e)=>{const r=(t=>{return{arrayMergeType:"combine",arrayMerge:(e=t?t.arrayMergeType:"combine","overwrite"===e?o:u),...t};var e})(e);return t.reduce(((t,e)=>(Object.keys(e).forEach((n=>{Array.isArray(t[n])&&Array.isArray(e[n])?r&&r.arrayMerge&&(t[n]=r.arrayMerge(t[n],e[n])):t[n]=i(t[n])&&i(e[n])?c([t[n],e[n]],r):e[n]})),t)),{})},l=s=>{let i,o,u,l;const f=()=>{const t=o.componentStyles.state;l=c([t._system||{},t._default||{},t[u]||{}])},d=new MutationObserver((r=>{r.forEach((r=>{"selected-style"===r.attributeName&&(u=t(s).getAttribute("selected-style"),f(),e(s))}))})),m=s.connectedCallback;s.connectedCallback=()=>{const n=t(s);o=r(n),l=o.componentStyles.state._system,d.observe(n,{attributes:!0,attributeFilter:["selected-style"]}),u=t(s).getAttribute("selected-style"),f(),i=o.componentStyles.on("set",(r=>{r===u&&(u=t(s).getAttribute("selected-style"),f(),e(t(s)))})),a(m,s)};const h=s.disconnectedCallback;return s.disconnectedCallback=()=>{d.disconnect(),a(i),n(t(s)),a(h,s)},t=>t(l)};var f,d,m,h,y,p,b,g;!function(t){t.ALL="all",t.META="meta"}(f||(f={})),function(t){t.CURRENCY="currency",t.VOLUME="volume"}(d||(d={})),function(t){t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4"}(m||(m={})),function(t){t.POS="pos",t.NEG="neg",t.NEU="neu"}(h||(h={})),function(t){t.DECIMAL="decimal",t.PERCENT="percent"}(y||(y={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(p||(p={})),function(t){t.INF="inf",t.W100="w100",t.W50="w50",t.W25="w25",t.W20="w20",t.W15="w15",t.W10="w10",t.W5="w5"}(b||(b={})),function(t){t.W5="w5",t.W10="w10",t.W15="w15",t.W20="w20",t.W25="w25",t.W30="w30",t.W40="w40",t.W60="w60",t.W80="w80",t.W100="w100"}(g||(g={}));const N={[g.W5]:5,[g.W10]:10,[g.W15]:15,[g.W20]:20,[g.W25]:25,[g.W30]:30,[g.W40]:40,[g.W60]:60,[g.W80]:80,[g.W100]:100};var v,w,S,D,O,T,k;!function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex"}(v||(v={})),function(t){t.SMART="smart",t.LONG="long",t.SHORT="short"}(w||(w={})),function(t){t.COLUMN="column",t.LINE="line",t.WATERFALL="waterfall"}(S||(S={})),function(t){t.BAR="bar",t.LINE="line",t.AUTO="auto"}(D||(D={})),function(t){t.SCENARIOS="scenarios",t.DIMENSIONS="dimensions"}(O||(O={})),function(t){t.ABSOLUTE="absolute",t.RELATIVE="relative",t.ABSOLUTE_RELATIVE="absolute-relative"}(T||(T={})),function(t){t.ASC="asc",t.DESC="desc",t.DATASET="dataset"}(k||(k={}));const A=/^\s*(set|first|last|min|max|avg|sum|lit)\(\s*(.*?)\s*\)\s*$/,J=/^[A-Za-z_][A-Za-z0-9_]*$/,M=["min","max","avg","sum"];class F{constructor(t,e,r,n){this.label=t,this.alias=e,this.fn=r,this.arg=n}get isNumeric(){return M.includes(this.fn)}}function j(t){if("string"!=typeof t)return!1;const e=A.exec(t);if(!e)return!1;const[,r,n]=e;return"lit"===r?n.length>0:J.test(n)}function E(t,e,r){if(!j(r))return null;const[,n,s]=A.exec(r);return new F(t,e,n,s)}var L,I,x,$;!function(t){t.YEAR="year",t.QUARTER="quarter",t.MONTH="month",t.WEEK="week",t.DAY="day",t.HOUR="hour",t.MINUTE="minute",t.SECOND="second",t.MILLISECOND="millisecond",t.NONE="fallback",t.AUTO="auto"}(L||(L={})),function(t){t.AVG="avg",t.INTERVAL="interval",t.START="start",t.END="end",t.YTD="ytd",t.YTG="ytg",t.CUM="cum",t.MAT="mat",t.NONE="none",t.AUTO="auto"}(I||(I={}));class q{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW yyyy",day:"dd.MM.yyyy",hour:"TT",minute:"TT",second:"TT",millisecond:"TT:SSS",fallback:"dd.MM.yyyy"},this._dateFormatShort={year:"yy",quarter:"q'Q'",month:"LLL",week:"'KW'WW",day:"dd",hour:"hh'h'",minute:"mm'm'",second:"ss's'",millisecond:"SSS'ms'",fallback:"dd.MM.yyyy"},this._dateLinkFormat={avg:"Ø[LINK]",interval:"[DATE]..[DATE2]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE2]",mat:"~[DATE]",none:"[DATE]"},this.locale="de",this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t}setDateFormatShort(t){this.dateFormatShort=t}setLocale(t){this.locale=t}getDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormat[e]||this.dateFormat.fallback)}getSmartDateString(t,e){switch(e){case L.DAY:return this.getFormatedDayDate(t);case L.MONTH:return this.getFormatedMonthDate(t);case L.QUARTER:return this.getFormatedQuarterDate(t);case L.WEEK:return this.getFormatedWeekDate(t);case L.HOUR:return this.getFormatedHourDate(t);case L.MINUTE:return this.getFormatedMinuteDate(t);case L.SECOND:return this.getFormatedSecondDate(t);case L.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,e)}}calculateDistanceType(t,e,r=32){if(null==e)return L.DAY;const n="number"==typeof t?s.fromMillis(t):t,a="number"==typeof e?s.fromMillis(e):e;return 0===a.diff(n).as("milliseconds")?L.DAY:a.diff(n).as("milliseconds")<r?L.MILLISECOND:a.diff(n).as("seconds")<r?L.SECOND:a.diff(n).as("minutes")<r?L.MINUTE:a.diff(n).as("hours")<r?L.HOUR:a.diff(n).as("days")<r?L.DAY:a.diff(n).as("weeks")<r?L.WEEK:a.diff(n).as("months")<r?L.MONTH:a.diff(n).as("quarters")<r?L.QUARTER:L.YEAR}datesBetween(t,e,r,n){const s=this.convertDateDistanceToMomentunitOfTime(r),a=t.startOf(s),i=e.endOf(s);let o=i.diff(a).as(s);const u=[];o>=n&&(o=n);let c=a;do{u.push(c),c=c.plus(this.createDiratonLike(s,1))}while(c<=i&&u.length<o);return u}getDateLinkString(t,e,r,n,a){if(null==t&&null==e)return"";if(null==t&&r!==I.END&&r!==I.YTD)return"";if(null==e&&(I.INTERVAL===r||I.CUM===r||I.END===r||I.YTD===r))return"";const i=t||s.now(),o=e;n===L.AUTO&&(n=this.calculateDistanceType(i,o,a));let u=this.getDateString(i,n),c="",l=I.NONE;return null!=o&&(c=this.getDateString(o,n),l=I.INTERVAL,u===c&&r===I.INTERVAL&&(r=I.NONE),u===c&&r===I.AVG&&(l=I.NONE),I.END!==r&&I.YTD!==r||(u=c),(r===I.INTERVAL||r===I.CUM||I.AVG)&&(n===L.QUARTER?i.quarter===o.quarter&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):n===L.MONTH?i.month===o.month&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):n===L.WEEK&&(i.weekNumber===o.weekNumber&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,""))))),this.dateLinkFormat[r].replace("[LINK]",this.dateLinkFormat[l]).replace("[DATE]",u).replace("[DATE2]",c)}getShortDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormatShort[e]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let e=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(e+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedMonthDate(t){let e=this.dateFormatShort.month;return this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedQuarterDate(t){let e=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedWeekDate(t){let e=this.dateFormatShort.week;return this.isFirstWeek(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedHourDate(t){let e=this.dateFormatShort.hour;return this.isFirstHour(t)&&(e+=" "+this.dateFormatShort.day),t.setLocale(this.locale).toFormat(e)}getFormatedMinuteDate(t){let e=this.dateFormatShort.minute;return this.isFirstMinute(t)&&(e=this.dateFormatShort.hour+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedSecondDate(t){let e=this.dateFormatShort.second;return this.isFirstSecond(t)&&(e=this.dateFormatShort.minute+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedMilliSecondDate(t){let e=this.dateFormatShort.millisecond;return this.isFirstMilliSecond(t)&&(e=this.dateFormatShort.second+":"+e),t.setLocale(this.locale).toFormat(e)}isFirstInMonth(t){return 1===t.day}isJanuary(t){return 1===t.month}isFirstQuarter(t){return 1===t.quarter}isFirstWeek(t){return 1===t.weekNumber}isFirstHour(t){return 0===t.hour}isFirstMinute(t){return 0===t.minute}isFirstSecond(t){return 0===t.second}isFirstMilliSecond(t){return 0===t.millisecond}convertDateDistanceToMomentunitOfTime(t){let e;switch(t){case L.YEAR:e="year";break;case L.MONTH:e="month";break;case L.QUARTER:e="quarter";break;case L.WEEK:e="week";break;case L.DAY:e="day";break;case L.HOUR:e="hour";break;case L.MINUTE:e="minute";break;case L.SECOND:e="second";break;case L.MILLISECOND:e="millisecond";break;default:e="day"}return e}createDiratonLike(t,e){switch(t){case"year":return{years:e};case"month":return{months:e};case"quarter":return{quarters:e};case"week":return{weeks:e};case"day":default:return{days:e};case"hour":return{hours:e};case"minute":return{minutes:e};case"second":return{seconds:e};case"millisecond":return{milliseconds:e}}}}class G{static isExisting(t){return null!=t}static isString(t){return"string"==typeof t}static isNumber(t){return"number"==typeof t&&!Number.isNaN(t)}static isBoolean(t){return"boolean"==typeof t}static isArray(t){return Array.isArray(t)}static isObject(t){return"object"==typeof t&&null!==t}static isOperator(t){return"+"===t||"-"===t}static isDate(t){return t instanceof s&&t.isValid}}class W{static adaptDefaultString(t){return G.isString(t)?t.trim():""}static adaptArray(t,e){const r=[];return G.isArray(t)&&t.forEach((t=>{r.push(e.adapt(t))})),r}}!function(t){t.ASC="asc",t.DESC="desc"}(x||(x={})),function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex",t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4"}($||($={}));class _{constructor(t=["category"],e=x.ASC){this.hierarchy=t,this.direction=e}}class C{constructor(t){this.stringAdapter=t}adapt(t){var e;const r=W.adaptArray(t.hierarchy,this.stringAdapter),n=x[null===(e=t.direction)||void 0===e?void 0:e.toUpperCase()]||x.ASC;return new _(r.map((t=>$[t.toUpperCase()]||$.CATEGORY)),n)}default(){return new _(["category"],x.ASC)}}function z(t){return null==t||""===t||"null"===t}function K(t){return z(t)||"auto"===t.trim().toLowerCase()?[]:B((null==t?void 0:t.split(",").filter((t=>!(t.toUpperCase().trim()in m)))).toString())}function B(t){return z(t)?[]:t.replace(";",",").split(",").filter((t=>{var e,r,n;const s=t.split("_"),a=null===(e=s[0])||void 0===e?void 0:e.replace(/^dr|^d/,"").toUpperCase().trim(),i=null===(r=s[1])||void 0===r?void 0:r.toUpperCase().trim(),o=null===(n=s[2])||void 0===n?void 0:n.toUpperCase().trim();return 3!==s.length||!(a in m)||!(i in m)||!(o in h)}))}function Q(t){return z(t)||"auto"===t.trim().toLowerCase()?[]:B(t.split(",").filter((t=>!(t.toUpperCase()in $))).toString())}function P(t){return!z(t)&&Number.isInteger(Number(t))}function H(t){return!z(t)&&!Number.isNaN(Number(t))}function Z(t){return!z(t)&&(null==t?void 0:t.toUpperCase())in x}function R(t){return"auto"===(null==t?void 0:t.toLowerCase())||(null==t?void 0:t.toUpperCase())in v}function V(t){if(z(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("name")&&t.hasOwnProperty("unit"))))}catch(t){console.error("validateMeasureList: failed to parse JSON",t)}return["Invalid JSON structure"]}function U(t){const e=Date.parse(t);return Number.isInteger(e)}function Y(t){return(null==t?void 0:t.toUpperCase())in I}function X(t){return(null==t?void 0:t.toUpperCase())in L}function tt(t){return(null==t?void 0:t.toUpperCase())in w}function et(t){return!z(t)&&(null==t?void 0:t.toUpperCase())in y}function rt(t){return!z(t)&&["true","false",!0,!1].some((e=>e===t))}function nt(t){return!z(t)&&(null==t?void 0:t.toUpperCase())in p}function st(t){if(z(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category")&&t.hasOwnProperty("subCategory"))))}catch(t){console.error("validateThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function at(t){if(z(t))return[];try{const e=JSON.parse(t);if(null!==e&&"object"==typeof e&&!(e instanceof Array))return Object.entries(e).filter((([,t])=>"string"!=typeof t||!j(t))).map((([t,e])=>`${t}: ${e}`))}catch(t){console.error("validateAttributesJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function it(t){if(z(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category"))))}catch(t){console.error("validatePartOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function ot(t){return(null==t?void 0:t.trim().toUpperCase())in d}function ut(t){return["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(null==t?void 0:t.trim())||["GREATEST","LEAST"].includes(null==t?void 0:t.trim().toUpperCase())}function ct(t){return(null==t?void 0:t.toUpperCase().trim())in b}function lt(t){return(null==t?void 0:t.toUpperCase().trim())in g}function ft(t){if(z(t))return[];try{return JSON.parse(t).filter((t=>!(t.hasOwnProperty("scenario")&&t.hasOwnProperty("name")&&t.hasOwnProperty("subGroups"))))}catch(t){console.error("validateColumnThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function dt(t){if(z(t))return[];try{const e=JSON.parse(t);if("object"!=typeof e||null===e||Array.isArray(e))return["stack: must be a JSON object"];const r=[];if(e.hasOwnProperty("by")){const t=["scenarios","dimensions"];t.includes(e.by)||r.push(`stack: 'by' must be one of: ${t.join(", ")}`)}else r.push("stack: 'by' is required");if(e.hasOwnProperty("mode")){const t=["absolute","relative","absolute-relative"];t.includes(e.mode)||r.push(`stack: 'mode' must be one of: ${t.join(", ")}`)}if(e.hasOwnProperty("order")){const t=["asc","desc","dataset"];t.includes(e.order)||r.push(`stack: 'order' must be one of: ${t.join(", ")}`)}return r}catch(t){return["stack: invalid JSON"]}}class mt{constructor(){this.cache=new Map,this.tag=mt.makeStyleTag()}static makeStyleTag(){const t=document.createElement("style");return t.type="text/css",t.setAttribute("data-bn-computed-style",""),t.append(document.createTextNode("")),(document.head||document.querySelector("head")).append(t),t}apply(t){t.forEach((t=>this.cache.set(t.className,t.style))),this.tag.innerHTML=Array.from(this.cache.values()).map((t=>t)).join("\n")}}const ht=new mt;function yt(t){for(var e,r=0,n=0,s=t.length;s>=4;++n,s-=4)e=1540483477*(65535&(e=255&t.charCodeAt(n)|(255&t.charCodeAt(++n))<<8|(255&t.charCodeAt(++n))<<16|(255&t.charCodeAt(++n))<<24))+(59797*(e>>>16)<<16),r=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(s){case 3:r^=(255&t.charCodeAt(n+2))<<16;case 2:r^=(255&t.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}const pt=t=>H(t)?`${t}px`:t,bt={width:{className:"w",cssName:"width",attrName:"width",transform:pt},height:{className:"h",cssName:"height",attrName:"height",transform:pt},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:pt},right:{className:"rgt",cssName:"right",attrName:"right",transform:pt},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:pt},left:{className:"lft",cssName:"left",attrName:"left",transform:pt},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:pt},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},gt=Object.keys(bt);function Nt(t,e){const r=function(t,e){const r=yt(e);return`bn-c-${t.className}_${r}`}(t,e),n=function(t,e,r){return`.${e} {${t.cssName}: ${r};}`}(t,r,e);return{className:r,style:n}}const vt=t=>{const e=new Map;return gt.forEach((r=>{const n=t.getAttribute(r);n&&(["top","left","right","bottom"].includes(r)&&e.set("position",Nt(bt.position,"absolute")),e.set(r,Nt(bt[r],(bt[r].transform||function(t){return t})(n))))})),e},wt=new MutationObserver((t=>{for(const r of t){const t=r.target,n=vt(t);ht.apply(n);const s=Array.from(n.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...s).join(" "),e(t)}})),St=e=>{const r=e.connectedCallback,n=e.disconnectedCallback;e.connectedCallback=()=>{const n=t(e);if(!n)throw new Error("Can't find element field in component undefined");(t=>{const e=vt(t);ht.apply(e);const r=Array.from(e.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...r).join(" "),wt.observe(t,{attributes:!0,attributeFilter:gt,childList:!1,subtree:!1})})(n),a(r,e)},e.disconnectedCallback=()=>{a(n,e)}};export{v as A,ct as B,D as C,L as D,ft as E,at as F,y as G,E as H,f as I,N as J,g as K,V as L,d as M,U as N,x as O,Y as P,I as Q,W as R,O as S,b as T,G as U,C as V,q as W,l as a,H as b,B as c,R as d,Q as e,Z as f,P as g,ut as h,rt as i,dt as j,z as k,$ as l,k as m,T as n,X as o,tt as p,w as q,yt as r,lt as s,et as t,nt as u,K as v,St as w,st as x,it as y,ot as z}
|