@bino-bi/bn-template-engine 1.0.0-next.19 → 1.0.0-next.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/{p-7bdc0e28.entry.js → p-28d5c266.entry.js} +1 -1
  3. package/dist/bn-template-engine/{p-2e6dc267.entry.js → p-2d3ea756.entry.js} +1 -1
  4. package/dist/bn-template-engine/{p-9879c9b2.entry.js → p-2fba7c99.entry.js} +1 -1
  5. package/dist/bn-template-engine/{p-eca8e2e2.entry.js → p-6077155f.entry.js} +1 -1
  6. package/dist/bn-template-engine/{p-74c5a95d.entry.js → p-687032d5.entry.js} +1 -1
  7. package/dist/bn-template-engine/{p-22d0fb7a.entry.js → p-6c7f0076.entry.js} +1 -1
  8. package/dist/bn-template-engine/{p-Dg9OcXAO.js → p-6lOdN-fB.js} +1 -1
  9. package/dist/bn-template-engine/{p-83c71b16.entry.js → p-7e9dbc93.entry.js} +1 -1
  10. package/dist/bn-template-engine/{p-b25455a7.entry.js → p-99477a27.entry.js} +1 -1
  11. package/dist/bn-template-engine/p-A8xyE4b1.js +1 -0
  12. package/dist/bn-template-engine/p-BgIpdpfH.js +1 -0
  13. package/dist/bn-template-engine/p-BpWWgN6k.js +1 -0
  14. package/dist/bn-template-engine/{p-Bdfxd_Ke.js → p-C5uvAEKI.js} +1 -1
  15. package/dist/bn-template-engine/p-C8Q0lsaU.js +1 -0
  16. package/dist/bn-template-engine/{p-DY7YYmpa.js → p-C9i1Xsib.js} +1 -1
  17. package/dist/bn-template-engine/{p-BWKdb9ym.js → p-CJThzFZm.js} +1 -1
  18. package/dist/bn-template-engine/{p-rdqTC0_5.js → p-CYE0I1Mx.js} +1 -1
  19. package/dist/bn-template-engine/{p-X6CxL6W-.js → p-DwYUTvvI.js} +1 -1
  20. package/dist/bn-template-engine/{p-19bbac66.entry.js → p-a1380d7c.entry.js} +1 -1
  21. package/dist/bn-template-engine/{p-485d23d7.entry.js → p-a4ea9a79.entry.js} +1 -1
  22. package/dist/bn-template-engine/p-b5274369.entry.js +1 -0
  23. package/dist/bn-template-engine/{p-e96da91f.entry.js → p-b9e94127.entry.js} +1 -1
  24. package/dist/bn-template-engine/p-ba912130.entry.js +1 -0
  25. package/dist/bn-template-engine/{p-f9dfd120.entry.js → p-de29986f.entry.js} +1 -1
  26. package/dist/bn-template-engine/{p-BZV1b5VH.js → p-eEfqksk-.js} +1 -1
  27. package/dist/bn-template-engine/{p-aakBGfzL.js → p-fFtEvsY-.js} +1 -1
  28. package/dist/cjs/{AxisConfig-VnVelfSV.js → AxisConfig-D7CAyPLO.js} +1 -1
  29. package/dist/cjs/{LabelCollisionManager-nfD5P__k.js → LabelCollisionManager-DkdQ9Xdg.js} +2 -2
  30. package/dist/cjs/{Order-DobBozQC.js → Order-IPfAP0q8.js} +1 -1
  31. package/dist/cjs/{SVGStyle-BQOmGWLX.js → SVGStyle-BD8jApd4.js} +2 -2
  32. package/dist/cjs/{SVGVariancesStyleGroup-DCGfHrqh.js → SVGVariancesStyleGroup-BaWzR951.js} +1 -1
  33. package/dist/cjs/{VarianceMeasure-NY9yhiNV.js → VarianceMeasure-BBWTgv2e.js} +1 -1
  34. package/dist/cjs/{XYChartDataRow-B7OKrAcC.js → XYChartDataRow-BoR0CTfl.js} +4 -4
  35. package/dist/cjs/bn-asset_21.cjs.entry.js +93 -35
  36. package/dist/cjs/bn-chart-bubble.cjs.entry.js +8 -8
  37. package/dist/cjs/bn-chart-bullet.cjs.entry.js +7 -7
  38. package/dist/cjs/bn-chart-scatter.cjs.entry.js +7 -7
  39. package/dist/cjs/bn-grid.cjs.entry.js +5 -5
  40. package/dist/cjs/bn-image.cjs.entry.js +4 -4
  41. package/dist/cjs/bn-internationalization.cjs.entry.js +1 -1
  42. package/dist/cjs/bn-ruleset.cjs.entry.js +1 -1
  43. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  44. package/dist/cjs/bn-text.cjs.entry.js +5 -5
  45. package/dist/cjs/bn-tree.cjs.entry.js +4 -4
  46. package/dist/cjs/{context-protocol-BDrMkhc4.js → context-protocol-BBhT9B52.js} +9 -3
  47. package/dist/cjs/editor-companion.cjs.entry.js +1 -1
  48. package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +5 -5
  49. package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +5 -5
  50. package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +5 -5
  51. package/dist/cjs/{layoutObserver-o03YUfn_.js → layoutObserver-DUYYkDMQ.js} +3 -3
  52. package/dist/cjs/loader.cjs.js +1 -1
  53. package/dist/cjs/{scaling-DKZyjWj5.js → scaling-BIJQ2NV1.js} +4 -2
  54. package/dist/cjs/{withScalingGroup-BmcRlWBs.js → withScalingGroup-D5clRvRe.js} +1 -1
  55. package/dist/cjs/{withStyled-CRiC9fzc.js → withStyled-Cm9dWQhu.js} +34 -3
  56. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +2 -2
  57. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +1 -1
  58. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +19 -2
  59. package/dist/collection/components/bn-chart-time/bn-chart-time.js +2 -2
  60. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +3 -1
  61. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +19 -1
  62. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +5 -0
  63. package/dist/collection/components/bn-context/bn-context.js +20 -1
  64. package/dist/collection/components/bn-grid/bn-grid.js +20 -1
  65. package/dist/collection/components/bn-layout-card/bn-layout-card.js +3 -3
  66. package/dist/collection/components/bn-layout-page/bn-layout-page.js +3 -3
  67. package/dist/collection/components/bn-table/bn-table.js +2 -2
  68. package/dist/collection/components/bn-table/ibcs-table.js +1 -1
  69. package/dist/collection/components/bn-table/utils/Table.js +0 -1
  70. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +3 -1
  71. package/dist/collection/components/bn-title/bn-title.js +5 -1
  72. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +25 -2
  73. package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +4 -4
  74. package/dist/collection/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.js +6 -2
  75. package/dist/collection/components/bn-title/ibcs-title/utils/model/TitleConfig.js +5 -0
  76. package/dist/collection/components/bn-tree/bn-tree.js +19 -0
  77. package/dist/collection/stores/internationalization.js +9 -3
  78. package/dist/collection/utils/DateStringFactory.js +31 -0
  79. package/dist/collection/utils/withTranslation.js +3 -1
  80. package/dist/components/DateStringFactory.js +1 -1
  81. package/dist/components/bn-chart-structure.js +1 -1
  82. package/dist/components/bn-chart-time.js +1 -1
  83. package/dist/components/bn-context.js +1 -1
  84. package/dist/components/bn-grid.js +1 -1
  85. package/dist/components/bn-layout-card.js +1 -1
  86. package/dist/components/bn-layout-page.js +1 -1
  87. package/dist/components/bn-table.js +1 -1
  88. package/dist/components/bn-title2.js +1 -1
  89. package/dist/components/bn-tree.js +1 -1
  90. package/dist/components/context-protocol.js +1 -1
  91. package/dist/components/ibcs-chart-structure2.js +1 -1
  92. package/dist/components/ibcs-chart-time2.js +1 -1
  93. package/dist/components/ibcs-table2.js +1 -1
  94. package/dist/components/ibcs-title2.js +1 -1
  95. package/dist/esm/{AxisConfig-C_zWCKlL.js → AxisConfig-ByIP5J-9.js} +1 -1
  96. package/dist/esm/{LabelCollisionManager-8swVQHKA.js → LabelCollisionManager-DaNiDiM9.js} +2 -2
  97. package/dist/esm/{Order-BPeWfygb.js → Order-BQeJE_yi.js} +1 -1
  98. package/dist/esm/{SVGStyle-BxEDw9zh.js → SVGStyle-BwBlY3Km.js} +2 -2
  99. package/dist/esm/{SVGVariancesStyleGroup-DRQYvSDD.js → SVGVariancesStyleGroup-BpGW4CvN.js} +1 -1
  100. package/dist/esm/{VarianceMeasure-DnwNKspZ.js → VarianceMeasure-CE3N8Bea.js} +1 -1
  101. package/dist/esm/{XYChartDataRow-DeV4r-Wm.js → XYChartDataRow-DeMI1JKU.js} +4 -4
  102. package/dist/esm/bn-asset_21.entry.js +93 -35
  103. package/dist/esm/bn-chart-bubble.entry.js +8 -8
  104. package/dist/esm/bn-chart-bullet.entry.js +7 -7
  105. package/dist/esm/bn-chart-scatter.entry.js +7 -7
  106. package/dist/esm/bn-grid.entry.js +5 -5
  107. package/dist/esm/bn-image.entry.js +4 -4
  108. package/dist/esm/bn-internationalization.entry.js +1 -1
  109. package/dist/esm/bn-ruleset.entry.js +1 -1
  110. package/dist/esm/bn-template-engine.js +1 -1
  111. package/dist/esm/bn-text.entry.js +5 -5
  112. package/dist/esm/bn-tree.entry.js +4 -4
  113. package/dist/esm/{context-protocol-1Yj1uKvh.js → context-protocol-d8MHrEo8.js} +9 -3
  114. package/dist/esm/editor-companion.entry.js +1 -1
  115. package/dist/esm/ibcs-chart-bubble.entry.js +5 -5
  116. package/dist/esm/ibcs-chart-bullet.entry.js +5 -5
  117. package/dist/esm/ibcs-chart-scatter.entry.js +5 -5
  118. package/dist/esm/{layoutObserver-BG5dOBYH.js → layoutObserver-BJBEyhNf.js} +3 -3
  119. package/dist/esm/loader.js +1 -1
  120. package/dist/esm/{scaling-CeSRcRl1.js → scaling-BGnpSN1j.js} +4 -2
  121. package/dist/esm/{withScalingGroup-Br70pAv9.js → withScalingGroup-CC3UcvC5.js} +1 -1
  122. package/dist/esm/{withStyled-Br2DGTPs.js → withStyled-2l5Tx3cf.js} +34 -3
  123. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +5 -0
  124. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +5 -0
  125. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +2 -0
  126. package/dist/types/components/bn-context/bn-context.d.ts +8 -0
  127. package/dist/types/components/bn-grid/bn-grid.d.ts +8 -0
  128. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +4 -0
  129. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +4 -0
  130. package/dist/types/components/bn-title/bn-title.d.ts +1 -0
  131. package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +2 -0
  132. package/dist/types/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.d.ts +3 -1
  133. package/dist/types/components/bn-title/ibcs-title/utils/model/TitleConfig.d.ts +2 -0
  134. package/dist/types/components/bn-tree/bn-tree.d.ts +8 -0
  135. package/dist/types/components.d.ts +42 -4
  136. package/dist/types/utils/DateStringFactory.d.ts +19 -0
  137. package/dist/types/utils/withTranslation.d.ts +3 -1
  138. package/package.json +1 -1
  139. package/dist/bn-template-engine/p-209351c9.entry.js +0 -1
  140. package/dist/bn-template-engine/p-90806e7a.entry.js +0 -1
  141. package/dist/bn-template-engine/p-BqhIhYr1.js +0 -1
  142. package/dist/bn-template-engine/p-C0Pwqx-O.js +0 -1
  143. package/dist/bn-template-engine/p-CiudZRQr.js +0 -1
  144. package/dist/bn-template-engine/p-DTuaq8Pj.js +0 -1
@@ -1 +1 @@
1
- import{r as t,d as s,f as i,h as e,H as a,g as r}from"./p-B_d-jp99.js";import{a as n}from"./p-BqhIhYr1.js";import{w as o,a as l,g as h,p as u}from"./p-DY7YYmpa.js";import{w as c,o as d}from"./p-DTuaq8Pj.js";import{i as p,a as v,w as f,b as m,c as g}from"./p-C0Pwqx-O.js";import{w as y,a as b}from"./p-B4JfKvVT.js";import{r as x,s as w}from"./p-BZV1b5VH.js";import{f as _,c as $,d as R,e as L,p as E,t as S}from"./p-Dg9OcXAO.js";import"./p-Bdfxd_Ke.js";const A={rowGroup:0,category:1,subCategory:2},j=class{validateX(t){this.validateAxisSpec("x",t)}validateY(t){this.validateAxisSpec("y",t)}validateIso(t){this.validateObjectSpec("iso",t,null,(t=>_(t)))}validateLevel(t){const s="ERR_level",i=["auto","category","subcategory"];p(t)||i.includes(t.trim().toLowerCase())?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`level: invalid value '${t}' — expected ${i.join("/")}; using 'auto'.`})}validateSeriesLevel(t){const s="ERR_seriesLevel",i=["auto","rowgroup","category","none"];p(t)||i.includes(t.trim().toLowerCase())?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`series-level: invalid value '${t}' — expected ${i.join("/")}; using 'auto'.`})}validateFacet(t){this.validateObjectSpec("facet",t,null,(t=>$(t)))}validateLabels(t){this.validateObjectSpec("labels",t,null,(t=>R(t,this.labelDefaults())))}validateLegend(t){this.validateObjectSpec("legend",t,null,(t=>L(t)))}validateAspect(t){const s="ERR_aspect";p(t)||null!==this.parseAspect(t)?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`aspect: invalid value '${t}' — expected "w:h" (e.g. "16:9"); using the default.`})}validateLimit(t){const s="ERR_limit";v(t)&&Number(t)>=0?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`limit: invalid value '${t}' — expected a non-negative integer; using 0.`})}validateScale(t){const s="ERR_scale";if(p(t))return void this.errors.remove(s);const{mode:i,factor:e}=u(t);"factor"===i&&(void 0===e||e<=0)?this.errors.addOrReplace({id:s,type:"warning",message:`scale: invalid value '${t}' — expected none/auto or a positive number.`}):this.errors.remove(s)}constructor(s){t(this,s),this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.layoutObserver=null,this.activeErrors=new Set,this.chartTitle="",this.filter="",this.iso="",this.level="auto",this.seriesLevel="auto",this.facet="",this.labels="",this.legend="",this.aspect="16:9",this.limit=0,this._autoScaleGuard=!1,this._lastObservedWidth=0,this.translateForInner=(t,s)=>this.t(t,s),f(this),y(this),o(this,(t=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1}),((t,s)=>{this.datasetMeta=s})),this.errors=b(this),this.componentStyle=m(this),this.ruleSetConfig=c(this),this.t=l(this).t}componentWillLoad(){this.validateX(this.x),this.validateY(this.y),this.validateIso(this.iso),this.validateLevel(this.level),this.validateSeriesLevel(this.seriesLevel),this.validateFacet(this.facet),this.validateLabels(this.labels),this.validateLegend(this.legend),this.validateAspect(this.aspect),this.validateLimit(this.limit),this.validateScale(this.scale)}componentDidRender(){const{mode:t}=u(this.scale);if("auto"!==t&&"empty"!==t){this._autoScaleGuard=!1;const t=h(this.element),s="WARN_overflow";return void(t.width>0&&this.element.scrollWidth>t.width+1?this.errors.addOrReplace({id:s,type:"warning",message:"Chart exceeds available space and will be cut off. Check the scale value."}):this.errors.remove(s))}if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const i=this.element,{width:e}=h(i);if(e<=0)return;this._lastObservedWidth=e;const a=this.componentStyle((t=>{var s;return(null===(s=t.global)||void 0===s?void 0:s.fontSizePx)||13.3333})),r=i.scrollWidth,n=this.appliedScaleFactor;if(!Number.isFinite(r)||r<=e+1)return void this.errors.remove("AUTO_scale");const o=Math.max(.3,n*(e-1)/r);Math.abs(o-n)<.01||(i.style.setProperty("--bn-font-size",a*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled chart by factor ${o.toFixed(3)}`}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,s((()=>{this.appliedScaleFactor=o})))}componentDidLoad(){this.layoutObserver=d(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=h(this.element);t>0&&Math.abs(t-this._lastObservedWidth)>2&&(this._lastObservedWidth=t,i(this))})),requestAnimationFrame((()=>{requestAnimationFrame((()=>{if(this._autoScaleGuard)return;const{width:t}=h(this.element);this._lastObservedWidth=t,i(this)}))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}labelDefaults(){return{points:"auto",values:!1,max:12}}setBlockingError(t,s){null===s?(this.errors.remove(t),this.activeErrors.delete(t)):(this.errors.addOrReplace({id:t,type:"error",message:s}),this.activeErrors.add(t))}hasBlockingErrors(){return this.activeErrors.size>0}validateAxisSpec(t,s){var i;const e=`ERR_xy_json_${t}`,a=`ERR_xy_measure_${t}`,r=`WARN_xy_fields_${t}`,n="x"===t||"y"===t||"size"===t,{data:o,parseError:l}=E(s,"measure");if(l)return this.setBlockingError(e,this.t(".xy-prop-json",{prop:t})),this.setBlockingError(a,null),void this.errors.remove(r);if(this.setBlockingError(e,null),null===o)return this.setBlockingError(a,n?this.t(".xy-measure-invalid",{prop:t,measure:""}):null),void this.errors.remove(r);const h="share"===t?null:S(o),u=null!==(i=o.measure)&&void 0!==i?i:"";g(u)?this.setBlockingError(a,null):this.setBlockingError(a,this.t(".xy-measure-invalid",{prop:t,measure:u})),this.reportSpecIssues(r,t,h)}validateObjectSpec(t,s,i,e){const a=`ERR_xy_json_${t}`,r=`WARN_xy_fields_${t}`,{data:n,parseError:o}=E(s,i);if(o)return this.setBlockingError(a,this.t(".xy-prop-json",{prop:t})),void this.errors.remove(r);this.setBlockingError(a,null),null!==n?this.reportSpecIssues(r,t,e(n)):this.errors.remove(r)}reportSpecIssues(t,s,i){const e=[];null!==i&&i.invalidFields.length>0&&e.push(`invalid: ${i.invalidFields.join(", ")}`),null!==i&&i.unknownKeys.length>0&&e.push(`unknown: ${i.unknownKeys.join(", ")}`),e.length>0?this.errors.addOrReplace({id:t,type:"warning",message:`${s}: ignored sub-fields (${e.join("; ")}).`}):this.errors.remove(t)}prepareAxis(t,s){const{data:i,parseError:e}=E(s,"measure");if(e||null===i)return null;const{config:a}=S(i);return null!==a&&g(a.measure)?(void 0!==a.min&&void 0!==a.max&&a.min>=a.max?(this.errors.addOrReplace({id:`WARN_xy_domain_${t}`,type:"warning",message:`${t}: min must be smaller than max; the override is ignored.`}),a.min=void 0,a.max=void 0):this.errors.remove(`WARN_xy_domain_${t}`),a):null}prepareIso(){const{data:t,parseError:s}=E(this.iso,null);return s||null===t?null:_(t).config}prepareLabels(){const t=this.labelDefaults(),{data:s,parseError:i}=E(this.labels,null);return i||null===s?{points:t.points,values:t.values,max:t.max}:R(s,t).config}prepareLegend(){const{data:t,parseError:s}=E(this.legend,null);return s||null===t?{show:!0,position:"right"}:L(t).config}prepareFacet(){const{data:t,parseError:s}=E(this.facet,null);return s||null===t?null:$(t).config}preparePointLevel(){var t,s;const i=null===(t=this.level)||void 0===t?void 0:t.trim().toLowerCase();if("category"===i)return"category";if("subcategory"===i)return"subCategory";const e=null===(s=this.datasetMeta)||void 0===s?void 0:s.suggestedLevel;return"rowGroup"===e||"category"===e||"subCategory"===e?e:"category"}prepareSeriesLevel(t){var s;const i=null===(s=this.seriesLevel)||void 0===s?void 0:s.trim().toLowerCase();return"none"===i?null:"rowgroup"===i?"rowGroup":"category"===i||"subCategory"===t?"category":"category"===t?"rowGroup":null}validateCrossProp(t,s){const i=new Set;for(const s of t){if(void 0===s)continue;const t=x(s);null!==t&&"scenario"===t.kind&&i.add(w(t.slot))}this.setBlockingError("ERR_xy_family",i.size>1?this.t(".xy-family-mixed",{families:[...i].join(", ")}):null);const e=this.preparePointLevel(),a=this.prepareSeriesLevel(e),r=null!==s?"rowgroup"===s.level?"rowGroup":"category":null;let n=null;if(null!==a&&A[a]>=A[e]&&(n=`series '${a}' vs point '${e}'`),null!==r){const t=null!=a?a:e;A[r]>=A[t]&&(n=`facet '${r}' vs '${t}'`)}this.setBlockingError("ERR_xy_level_order",null!==n?this.t(".xy-level-order",{detail:n}):null)}parseAspect(t){const s=/^\s*(\d+(?:\.\d+)?)\s*:\s*(\d+(?:\.\d+)?)\s*$/.exec(null!=t?t:"");if(null===s)return null;const i=Number(s[1]),e=Number(s[2]);return i<=0||e<=0?null:i/e}prepareAspect(){var t;return null!==(t=this.parseAspect(this.aspect))&&void 0!==t?t:16/9}prepareLimit(){const t=Math.floor(Number(this.limit)||0);return t>0?t:0}i18nLocalKeys(){return["no-data","axis.in","legend.title"]}prepareI18n(){const t=new Map(this.i18nLocalKeys().map((t=>[t,this.t(".".concat(t))]))),s=new Map(n.map((t=>[t,this.t("global.".concat(t))])));return new Map([...s.entries(),...t.entries()])}prepareStyle(){const t=this.getEffectiveScaleFactor(),s=this.element.localName;return this.componentStyle((i=>{const e=i.global.fontSizePx*t;return{scaleFactors:i[s].scaleFactors,fontStyles:{font:`${e}px ${i.global.fontFamily}`,size:e,color:i.global.fontColor,background:i.global.fontBackgroundColor,leading:1.8},axisStyles:i[s].axisStyles,seriesColors:i[s].seriesColors,padding:i[s].padding}}))}getEffectiveScaleFactor(){const{mode:t,factor:s}=u(this.scale);return"factor"===t?s:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((s=>{var i,e,a,r;const n=(null===(i=s.global)||void 0===i?void 0:i.fontSizePx)||13.3333;return{"--bn-font-family":(null===(e=s.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(a=s.global)||void 0===a?void 0:a.fontColor)||"#000000","--bn-font-background":(null===(r=s.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}getDataStructure(){const t={};for(const s of["ac","pp","fc","pl"])for(const i of[1,2,3,4])t[`${s}${i}`]={type:"number",isOptional:!0,description:""};for(const[s,i]of Object.entries(this.mappedAxes())){if(null===i)continue;const e=x(i.measure);null!==e&&("scenario"===e.kind?t[e.slot].description=`${s}: ${"label"in i&&void 0!==i.label?i.label:i.measure}`:(t[e.measure.base].description=`${s}: ${i.measure} (base)`,t[e.measure.delta].description=`${s}: ${i.measure} (delta)`))}return{[this.dataStructureName()]:Object.assign({operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!0,description:""},rowGroupIndex:{type:"number",isOptional:!0,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!0,description:""},subCategoryIndex:{type:"number",isOptional:!0,description:""}},t)}}mappedAxes(){return{x:this.prepareAxis("x",this.x),y:this.prepareAxis("y",this.y)}}dataStructureName(){return"IScatterChartDataRow"}chartTemplate(){const t=this.prepareAxis("x",this.x),s=this.prepareAxis("y",this.y),i=this.prepareFacet();if(this.validateCrossProp([null==t?void 0:t.measure,null==s?void 0:s.measure],i),this.hasBlockingErrors()||null===t||null===s)return null;const a=this.preparePointLevel(),r=this.prepareI18n(),n=this.prepareStyle(),o=h(this.element).width;return e("ibcs-chart-scatter",{tableName:this.datasetName,dataVersion:this.dataVersion,chartTitle:this.chartTitle,x:t,y:s,iso:this.prepareIso(),labels:this.prepareLabels(),legend:this.prepareLegend(),facet:i,pointLevel:a,seriesLevel:this.prepareSeriesLevel(a),aspect:this.prepareAspect(),limit:this.prepareLimit(),filter:this.filter,styles:n,i18n:r,containerWidth:o,ruleSetConfig:this.ruleSetConfig(),errors:this.errors,translate:this.translateForInner})}render(){return e(a,{key:"ed677e73aa37e238651a64cff1ca8d59b5d73f06",style:this.getFontStyles()},e("div",{key:"575065fb76228cc3d5a7a45af7009ea590437fa1",class:"container"},this.chartTemplate()))}get element(){return r(this)}static get watchers(){return{x:[{validateX:0}],y:[{validateY:0}],iso:[{validateIso:0}],level:[{validateLevel:0}],seriesLevel:[{validateSeriesLevel:0}],facet:[{validateFacet:0}],labels:[{validateLabels:0}],legend:[{validateLegend:0}],aspect:[{validateAspect:0}],limit:[{validateLimit:0}],scale:[{validateScale:0}]}}};j.style=":host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:column}";export{j as bn_chart_scatter}
1
+ import{r as t,d as s,f as i,h as e,H as a,g as r}from"./p-B_d-jp99.js";import{a as n}from"./p-BgIpdpfH.js";import{w as o,a as l,g as h,p as u}from"./p-C9i1Xsib.js";import{w as c,o as d}from"./p-A8xyE4b1.js";import{i as p,a as v,w as f,b as m,c as g}from"./p-BpWWgN6k.js";import{w as y,a as b}from"./p-B4JfKvVT.js";import{r as x,s as w}from"./p-eEfqksk-.js";import{f as _,c as $,d as R,e as E,p as L,t as A}from"./p-6lOdN-fB.js";import"./p-C5uvAEKI.js";const S={rowGroup:0,category:1,subCategory:2},j=class{validateX(t){this.validateAxisSpec("x",t)}validateY(t){this.validateAxisSpec("y",t)}validateIso(t){this.validateObjectSpec("iso",t,null,(t=>_(t)))}validateLevel(t){const s="ERR_level",i=["auto","category","subcategory"];p(t)||i.includes(t.trim().toLowerCase())?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`level: invalid value '${t}' — expected ${i.join("/")}; using 'auto'.`})}validateSeriesLevel(t){const s="ERR_seriesLevel",i=["auto","rowgroup","category","none"];p(t)||i.includes(t.trim().toLowerCase())?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`series-level: invalid value '${t}' — expected ${i.join("/")}; using 'auto'.`})}validateFacet(t){this.validateObjectSpec("facet",t,null,(t=>$(t)))}validateLabels(t){this.validateObjectSpec("labels",t,null,(t=>R(t,this.labelDefaults())))}validateLegend(t){this.validateObjectSpec("legend",t,null,(t=>E(t)))}validateAspect(t){const s="ERR_aspect";p(t)||null!==this.parseAspect(t)?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`aspect: invalid value '${t}' — expected "w:h" (e.g. "16:9"); using the default.`})}validateLimit(t){const s="ERR_limit";v(t)&&Number(t)>=0?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`limit: invalid value '${t}' — expected a non-negative integer; using 0.`})}validateScale(t){const s="ERR_scale";if(p(t))return void this.errors.remove(s);const{mode:i,factor:e}=u(t);"factor"===i&&(void 0===e||e<=0)?this.errors.addOrReplace({id:s,type:"warning",message:`scale: invalid value '${t}' — expected none/auto or a positive number.`}):this.errors.remove(s)}constructor(s){t(this,s),this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.layoutObserver=null,this.activeErrors=new Set,this.chartTitle="",this.filter="",this.iso="",this.level="auto",this.seriesLevel="auto",this.facet="",this.labels="",this.legend="",this.aspect="16:9",this.limit=0,this._autoScaleGuard=!1,this._lastObservedWidth=0,this.translateForInner=(t,s)=>this.t(t,s),f(this),y(this),o(this,(t=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1}),((t,s)=>{this.datasetMeta=s})),this.errors=b(this),this.componentStyle=m(this),this.ruleSetConfig=c(this),this.t=l(this).t}componentWillLoad(){this.validateX(this.x),this.validateY(this.y),this.validateIso(this.iso),this.validateLevel(this.level),this.validateSeriesLevel(this.seriesLevel),this.validateFacet(this.facet),this.validateLabels(this.labels),this.validateLegend(this.legend),this.validateAspect(this.aspect),this.validateLimit(this.limit),this.validateScale(this.scale)}componentDidRender(){const{mode:t}=u(this.scale);if("auto"!==t&&"empty"!==t){this._autoScaleGuard=!1;const t=h(this.element),s="WARN_overflow";return void(t.width>0&&this.element.scrollWidth>t.width+1?this.errors.addOrReplace({id:s,type:"warning",message:"Chart exceeds available space and will be cut off. Check the scale value."}):this.errors.remove(s))}if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const i=this.element,{width:e}=h(i);if(e<=0)return;this._lastObservedWidth=e;const a=this.componentStyle((t=>{var s;return(null===(s=t.global)||void 0===s?void 0:s.fontSizePx)||13.3333})),r=i.scrollWidth,n=this.appliedScaleFactor;if(!Number.isFinite(r)||r<=e+1)return void this.errors.remove("AUTO_scale");const o=Math.max(.3,n*(e-1)/r);Math.abs(o-n)<.01||(i.style.setProperty("--bn-font-size",a*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled chart by factor ${o.toFixed(3)}`}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,s((()=>{this.appliedScaleFactor=o})))}componentDidLoad(){this.layoutObserver=d(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=h(this.element);t>0&&Math.abs(t-this._lastObservedWidth)>2&&(this._lastObservedWidth=t,i(this))})),requestAnimationFrame((()=>{requestAnimationFrame((()=>{if(this._autoScaleGuard)return;const{width:t}=h(this.element);this._lastObservedWidth=t,i(this)}))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}labelDefaults(){return{points:"auto",values:!1,max:12}}setBlockingError(t,s){null===s?(this.errors.remove(t),this.activeErrors.delete(t)):(this.errors.addOrReplace({id:t,type:"error",message:s}),this.activeErrors.add(t))}hasBlockingErrors(){return this.activeErrors.size>0}validateAxisSpec(t,s){var i;const e=`ERR_xy_json_${t}`,a=`ERR_xy_measure_${t}`,r=`WARN_xy_fields_${t}`,n="x"===t||"y"===t||"size"===t,{data:o,parseError:l}=L(s,"measure");if(l)return this.setBlockingError(e,this.t(".xy-prop-json",{prop:t})),this.setBlockingError(a,null),void this.errors.remove(r);if(this.setBlockingError(e,null),null===o)return this.setBlockingError(a,n?this.t(".xy-measure-invalid",{prop:t,measure:""}):null),void this.errors.remove(r);const h="share"===t?null:A(o),u=null!==(i=o.measure)&&void 0!==i?i:"";g(u)?this.setBlockingError(a,null):this.setBlockingError(a,this.t(".xy-measure-invalid",{prop:t,measure:u})),this.reportSpecIssues(r,t,h)}validateObjectSpec(t,s,i,e){const a=`ERR_xy_json_${t}`,r=`WARN_xy_fields_${t}`,{data:n,parseError:o}=L(s,i);if(o)return this.setBlockingError(a,this.t(".xy-prop-json",{prop:t})),void this.errors.remove(r);this.setBlockingError(a,null),null!==n?this.reportSpecIssues(r,t,e(n)):this.errors.remove(r)}reportSpecIssues(t,s,i){const e=[];null!==i&&i.invalidFields.length>0&&e.push(`invalid: ${i.invalidFields.join(", ")}`),null!==i&&i.unknownKeys.length>0&&e.push(`unknown: ${i.unknownKeys.join(", ")}`),e.length>0?this.errors.addOrReplace({id:t,type:"warning",message:`${s}: ignored sub-fields (${e.join("; ")}).`}):this.errors.remove(t)}prepareAxis(t,s){const{data:i,parseError:e}=L(s,"measure");if(e||null===i)return null;const{config:a}=A(i);return null!==a&&g(a.measure)?(void 0!==a.min&&void 0!==a.max&&a.min>=a.max?(this.errors.addOrReplace({id:`WARN_xy_domain_${t}`,type:"warning",message:`${t}: min must be smaller than max; the override is ignored.`}),a.min=void 0,a.max=void 0):this.errors.remove(`WARN_xy_domain_${t}`),a):null}prepareIso(){const{data:t,parseError:s}=L(this.iso,null);return s||null===t?null:_(t).config}prepareLabels(){const t=this.labelDefaults(),{data:s,parseError:i}=L(this.labels,null);return i||null===s?{points:t.points,values:t.values,max:t.max}:R(s,t).config}prepareLegend(){const{data:t,parseError:s}=L(this.legend,null);return s||null===t?{show:!0,position:"right"}:E(t).config}prepareFacet(){const{data:t,parseError:s}=L(this.facet,null);return s||null===t?null:$(t).config}preparePointLevel(){var t,s;const i=null===(t=this.level)||void 0===t?void 0:t.trim().toLowerCase();if("category"===i)return"category";if("subcategory"===i)return"subCategory";const e=null===(s=this.datasetMeta)||void 0===s?void 0:s.suggestedLevel;return"rowGroup"===e||"category"===e||"subCategory"===e?e:"category"}prepareSeriesLevel(t){var s;const i=null===(s=this.seriesLevel)||void 0===s?void 0:s.trim().toLowerCase();return"none"===i?null:"rowgroup"===i?"rowGroup":"category"===i||"subCategory"===t?"category":"category"===t?"rowGroup":null}validateCrossProp(t,s){const i=new Set;for(const s of t){if(void 0===s)continue;const t=x(s);null!==t&&"scenario"===t.kind&&i.add(w(t.slot))}this.setBlockingError("ERR_xy_family",i.size>1?this.t(".xy-family-mixed",{families:[...i].join(", ")}):null);const e=this.preparePointLevel(),a=this.prepareSeriesLevel(e),r=null!==s?"rowgroup"===s.level?"rowGroup":"category":null;let n=null;if(null!==a&&S[a]>=S[e]&&(n=`series '${a}' vs point '${e}'`),null!==r){const t=null!=a?a:e;S[r]>=S[t]&&(n=`facet '${r}' vs '${t}'`)}this.setBlockingError("ERR_xy_level_order",null!==n?this.t(".xy-level-order",{detail:n}):null)}parseAspect(t){const s=/^\s*(\d+(?:\.\d+)?)\s*:\s*(\d+(?:\.\d+)?)\s*$/.exec(null!=t?t:"");if(null===s)return null;const i=Number(s[1]),e=Number(s[2]);return i<=0||e<=0?null:i/e}prepareAspect(){var t;return null!==(t=this.parseAspect(this.aspect))&&void 0!==t?t:16/9}prepareLimit(){const t=Math.floor(Number(this.limit)||0);return t>0?t:0}i18nLocalKeys(){return["no-data","axis.in","legend.title"]}prepareI18n(){const t=new Map(this.i18nLocalKeys().map((t=>[t,this.t(".".concat(t))]))),s=new Map(n.map((t=>[t,this.t("global.".concat(t))])));return new Map([...s.entries(),...t.entries()])}prepareStyle(){const t=this.getEffectiveScaleFactor(),s=this.element.localName;return this.componentStyle((i=>{const e=i.global.fontSizePx*t;return{scaleFactors:i[s].scaleFactors,fontStyles:{font:`${e}px ${i.global.fontFamily}`,size:e,color:i.global.fontColor,background:i.global.fontBackgroundColor,leading:1.8},axisStyles:i[s].axisStyles,seriesColors:i[s].seriesColors,padding:i[s].padding}}))}getEffectiveScaleFactor(){const{mode:t,factor:s}=u(this.scale);return"factor"===t?s:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((s=>{var i,e,a,r;const n=(null===(i=s.global)||void 0===i?void 0:i.fontSizePx)||13.3333;return{"--bn-font-family":(null===(e=s.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(a=s.global)||void 0===a?void 0:a.fontColor)||"#000000","--bn-font-background":(null===(r=s.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}getDataStructure(){const t={};for(const s of["ac","pp","fc","pl"])for(const i of[1,2,3,4])t[`${s}${i}`]={type:"number",isOptional:!0,description:""};for(const[s,i]of Object.entries(this.mappedAxes())){if(null===i)continue;const e=x(i.measure);null!==e&&("scenario"===e.kind?t[e.slot].description=`${s}: ${"label"in i&&void 0!==i.label?i.label:i.measure}`:(t[e.measure.base].description=`${s}: ${i.measure} (base)`,t[e.measure.delta].description=`${s}: ${i.measure} (delta)`))}return{[this.dataStructureName()]:Object.assign({operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!0,description:""},rowGroupIndex:{type:"number",isOptional:!0,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!0,description:""},subCategoryIndex:{type:"number",isOptional:!0,description:""}},t)}}mappedAxes(){return{x:this.prepareAxis("x",this.x),y:this.prepareAxis("y",this.y)}}dataStructureName(){return"IScatterChartDataRow"}chartTemplate(){const t=this.prepareAxis("x",this.x),s=this.prepareAxis("y",this.y),i=this.prepareFacet();if(this.validateCrossProp([null==t?void 0:t.measure,null==s?void 0:s.measure],i),this.hasBlockingErrors()||null===t||null===s)return null;const a=this.preparePointLevel(),r=this.prepareI18n(),n=this.prepareStyle(),o=h(this.element).width;return e("ibcs-chart-scatter",{tableName:this.datasetName,dataVersion:this.dataVersion,chartTitle:this.chartTitle,x:t,y:s,iso:this.prepareIso(),labels:this.prepareLabels(),legend:this.prepareLegend(),facet:i,pointLevel:a,seriesLevel:this.prepareSeriesLevel(a),aspect:this.prepareAspect(),limit:this.prepareLimit(),filter:this.filter,styles:n,i18n:r,containerWidth:o,ruleSetConfig:this.ruleSetConfig(),errors:this.errors,translate:this.translateForInner})}render(){return e(a,{key:"ed677e73aa37e238651a64cff1ca8d59b5d73f06",style:this.getFontStyles()},e("div",{key:"575065fb76228cc3d5a7a45af7009ea590437fa1",class:"container"},this.chartTemplate()))}get element(){return r(this)}static get watchers(){return{x:[{validateX:0}],y:[{validateY:0}],iso:[{validateIso:0}],level:[{validateLevel:0}],seriesLevel:[{validateSeriesLevel:0}],facet:[{validateFacet:0}],labels:[{validateLabels:0}],legend:[{validateLegend:0}],aspect:[{validateAspect:0}],limit:[{validateLimit:0}],scale:[{validateScale:0}]}}};j.style=":host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:column}";export{j as bn_chart_scatter}
@@ -0,0 +1 @@
1
+ import{f as t,g as e}from"./p-B_d-jp99.js";import{g as s,c as r}from"./p-BgIpdpfH.js";import{r as n}from"./p-B4JfKvVT.js";import{i as o,f as l}from"./p-C9i1Xsib.js";import{m as i}from"./p-eEfqksk-.js";const u=u=>{let a,c,f,m,p=null;const v=()=>{const t=c.ruleSets.state;m=i([t._system||{},t._default||{},t[f]||{}])},d=()=>{const s=e(u),r=s.getAttribute("ruleset");if(p&&(p.disconnect(),p=null),r&&o(r)){const e=l(s,r);f=null==e?void 0:e.getAttribute("ruleset"),e&&(p=new MutationObserver((()=>{f=e.getAttribute("ruleset"),v(),t(u)})),p.observe(e,{attributes:!0,attributeFilter:["ruleset"]}))}else f=r},b=new MutationObserver((e=>{e.forEach((e=>{"ruleset"===e.attributeName&&(d(),v(),t(u))}))})),j=u.connectedCallback;u.connectedCallback=()=>{const r=e(u);c=s(r),m=c.ruleSets.state._system,b.observe(r,{attributes:!0,attributeFilter:["ruleset"]}),d(),v(),a=c.ruleSets.on("set",(s=>{s!==f&&"_default"!==s||(d(),v(),t(e(u)))})),n(j,u)};const w=u.disconnectedCallback;return u.disconnectedCallback=()=>{b.disconnect(),p&&(p.disconnect(),p=null),n(a),r(e(u)),n(w,u)},()=>m};function a(t,e,s=80){let r=null,n=!1,o=-1,l=-1;const i=function(t){var e;const s=t.parentElement;return(null===(e=null==s?void 0:s.assignedSlot)||void 0===e?void 0:e.parentElement)?s.assignedSlot.parentElement:s}(t);if(!i)return{disconnect(){}};const u=new ResizeObserver((t=>{var u;if(n)return;let a,c;const f=t[0];if(null===(u=null==f?void 0:f.contentBoxSize)||void 0===u?void 0:u.length){const t=f.contentBoxSize[0];a=t.inlineSize,c=t.blockSize}else a=i.clientWidth,c=i.clientHeight;Math.abs(a-o)<=2&&Math.abs(c-l)<=2||(o=a,l=c,null!=r&&clearTimeout(r),r=setTimeout((()=>{n||e()}),s))}));return u.observe(i),{disconnect(){n=!0,null!=r&&clearTimeout(r),u.disconnect()}}}export{a as o,u as w}