@sme.up/ketchup 8.2.0 → 8.2.1

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 (120) hide show
  1. package/dist/cjs/{f-button-797c8e7f.js → f-button-76a75669.js} +2 -2
  2. package/dist/cjs/{f-cell-9c8ed48b.js → f-cell-a440d744.js} +7 -7
  3. package/dist/cjs/{f-checkbox-cff77b2c.js → f-checkbox-aa34efd5.js} +1 -1
  4. package/dist/cjs/{f-chip-318863df.js → f-chip-fe9cffed.js} +3 -3
  5. package/dist/cjs/{f-image-f10144e9.js → f-image-47976ad7.js} +2 -2
  6. package/dist/cjs/{f-paginator-utils-8c44a37b.js → f-paginator-utils-f13f036f.js} +3 -3
  7. package/dist/cjs/{f-text-field-9610c198.js → f-text-field-3868b623.js} +3 -3
  8. package/dist/cjs/{index-a9a3b467.js → index-dd9f2b9b.js} +0 -3
  9. package/dist/cjs/ketchup.cjs.js +2 -2
  10. package/dist/cjs/kup-accordion.cjs.entry.js +3 -3
  11. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +13 -10
  12. package/dist/cjs/kup-box.cjs.entry.js +10 -10
  13. package/dist/cjs/kup-calendar.cjs.entry.js +5 -5
  14. package/dist/cjs/kup-cell.cjs.entry.js +7 -7
  15. package/dist/cjs/kup-dash-list.cjs.entry.js +2 -2
  16. package/dist/cjs/kup-dash_2.cjs.entry.js +2 -2
  17. package/dist/cjs/kup-dashboard.cjs.entry.js +6 -6
  18. package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
  19. package/dist/cjs/kup-echart.cjs.entry.js +57 -17
  20. package/dist/cjs/kup-family-tree.cjs.entry.js +4 -4
  21. package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
  22. package/dist/cjs/kup-image-list.cjs.entry.js +8 -8
  23. package/dist/cjs/kup-lazy.cjs.entry.js +2 -2
  24. package/dist/cjs/kup-magic-box.cjs.entry.js +3 -3
  25. package/dist/cjs/{kup-manager-7747decd.js → kup-manager-695bbbe3.js} +1 -1
  26. package/dist/cjs/kup-nav-bar.cjs.entry.js +2 -2
  27. package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
  28. package/dist/cjs/kup-photo-frame.cjs.entry.js +2 -2
  29. package/dist/cjs/kup-planner.cjs.entry.js +3 -3
  30. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  31. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  32. package/dist/cjs/kup-snackbar.cjs.entry.js +4 -4
  33. package/dist/cjs/loader.cjs.js +2 -2
  34. package/dist/collection/assets/data-table.js +0 -44
  35. package/dist/collection/assets/echart.js +146 -4
  36. package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
  37. package/dist/collection/components/kup-echart/kup-echart-declarations.js +1 -0
  38. package/dist/collection/components/kup-echart/kup-echart.js +54 -15
  39. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
  40. package/dist/collection/components/kup-text-field/kup-text-field.js +23 -0
  41. package/dist/collection/f-components/f-cell/f-cell.js +1 -1
  42. package/dist/collection/f-components/f-text-field/f-text-field.js +1 -1
  43. package/dist/components/kup-autocomplete2.js +7 -3
  44. package/dist/components/kup-echart2.js +55 -15
  45. package/dist/esm/{f-button-e0e6f65f.js → f-button-c5b36ae1.js} +2 -2
  46. package/dist/esm/{f-cell-359dfe28.js → f-cell-d48502f1.js} +7 -7
  47. package/dist/esm/{f-checkbox-91358c27.js → f-checkbox-11b32f83.js} +1 -1
  48. package/dist/esm/{f-chip-0fd043b4.js → f-chip-038e9404.js} +3 -3
  49. package/dist/esm/{f-image-b853b0cc.js → f-image-c356f4c5.js} +2 -2
  50. package/dist/esm/{f-paginator-utils-124c146a.js → f-paginator-utils-58466d55.js} +3 -3
  51. package/dist/esm/{f-text-field-92bb3a1f.js → f-text-field-7e2b397b.js} +3 -3
  52. package/dist/esm/{index-bb15ce14.js → index-b45996ce.js} +1 -3
  53. package/dist/esm/ketchup.js +3 -3
  54. package/dist/esm/kup-accordion.entry.js +3 -3
  55. package/dist/esm/kup-autocomplete_27.entry.js +13 -10
  56. package/dist/esm/kup-box.entry.js +10 -10
  57. package/dist/esm/kup-calendar.entry.js +5 -5
  58. package/dist/esm/kup-cell.entry.js +7 -7
  59. package/dist/esm/kup-dash-list.entry.js +2 -2
  60. package/dist/esm/kup-dash_2.entry.js +2 -2
  61. package/dist/esm/kup-dashboard.entry.js +6 -6
  62. package/dist/esm/kup-drawer.entry.js +2 -2
  63. package/dist/esm/kup-echart.entry.js +57 -17
  64. package/dist/esm/kup-family-tree.entry.js +4 -4
  65. package/dist/esm/kup-iframe.entry.js +2 -2
  66. package/dist/esm/kup-image-list.entry.js +8 -8
  67. package/dist/esm/kup-lazy.entry.js +2 -2
  68. package/dist/esm/kup-magic-box.entry.js +3 -3
  69. package/dist/esm/{kup-manager-1e6ea451.js → kup-manager-74e46edc.js} +1 -1
  70. package/dist/esm/kup-nav-bar.entry.js +2 -2
  71. package/dist/esm/kup-numeric-picker.entry.js +3 -3
  72. package/dist/esm/kup-photo-frame.entry.js +2 -2
  73. package/dist/esm/kup-planner.entry.js +3 -3
  74. package/dist/esm/kup-probe.entry.js +2 -2
  75. package/dist/esm/kup-qlik.entry.js +2 -2
  76. package/dist/esm/kup-snackbar.entry.js +4 -4
  77. package/dist/esm/loader.js +3 -3
  78. package/dist/ketchup/ketchup.esm.js +1 -1
  79. package/dist/ketchup/{p-b73b3b52.entry.js → p-008cde2a.entry.js} +1 -1
  80. package/dist/ketchup/{p-c1b10c9c.entry.js → p-0d533d24.entry.js} +1 -1
  81. package/dist/ketchup/{p-adad6804.entry.js → p-1f5eb8e6.entry.js} +1 -1
  82. package/dist/ketchup/{p-cf24193b.entry.js → p-26765429.entry.js} +1 -1
  83. package/dist/ketchup/{p-e646523d.js → p-279eab92.js} +1 -1
  84. package/dist/ketchup/{p-41c00681.entry.js → p-2ac7d95a.entry.js} +1 -1
  85. package/dist/ketchup/{p-b5deb573.js → p-3da7e4c6.js} +2 -2
  86. package/dist/ketchup/{p-6d46cbb0.js → p-46daf529.js} +1 -1
  87. package/dist/ketchup/{p-6837f725.entry.js → p-59919641.entry.js} +1 -1
  88. package/dist/ketchup/{p-c28be862.entry.js → p-70a6ab77.entry.js} +1 -1
  89. package/dist/ketchup/p-71f202aa.entry.js +1 -0
  90. package/dist/ketchup/{p-ad919f87.entry.js → p-73ab15cd.entry.js} +1 -1
  91. package/dist/ketchup/{p-fb29ba2a.js → p-78eaa526.js} +1 -1
  92. package/dist/ketchup/{p-6e79b764.entry.js → p-8d992de0.entry.js} +1 -1
  93. package/dist/ketchup/{p-fd1323da.js → p-90576709.js} +1 -1
  94. package/dist/ketchup/p-9c7b9ff2.js +1 -0
  95. package/dist/ketchup/p-9cc4dd44.js +1 -0
  96. package/dist/ketchup/{p-ba0c4019.entry.js → p-a015c95b.entry.js} +1 -1
  97. package/dist/ketchup/{p-1cd5785e.entry.js → p-ad9b5c06.entry.js} +2 -2
  98. package/dist/ketchup/{p-81e20baa.entry.js → p-afbd769b.entry.js} +1 -1
  99. package/dist/ketchup/{p-818a4a09.entry.js → p-b813af24.entry.js} +1 -1
  100. package/dist/ketchup/{p-85d6bb1f.entry.js → p-bb93aa7e.entry.js} +1 -1
  101. package/dist/ketchup/{p-8c1804d7.entry.js → p-c1c49123.entry.js} +1 -1
  102. package/dist/ketchup/{p-adebe276.entry.js → p-cd1f9e76.entry.js} +1 -1
  103. package/dist/ketchup/{p-349d4715.js → p-d5491e4f.js} +1 -1
  104. package/dist/ketchup/{p-5dbd4402.entry.js → p-da0db0a5.entry.js} +1 -1
  105. package/dist/ketchup/{p-620faa59.entry.js → p-dfab37a3.entry.js} +1 -1
  106. package/dist/ketchup/{p-c010483d.entry.js → p-e28a3dfb.entry.js} +1 -1
  107. package/dist/ketchup/{p-c6088459.entry.js → p-e9d2a964.entry.js} +2 -2
  108. package/dist/ketchup/{p-374f867e.entry.js → p-f023195c.entry.js} +1 -1
  109. package/dist/ketchup/{p-1ca9aece.js → p-ffbd77d5.js} +1 -1
  110. package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
  111. package/dist/types/components/kup-echart/kup-echart-declarations.d.ts +2 -1
  112. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +1 -0
  113. package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
  114. package/dist/types/components.d.ts +10 -0
  115. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
  116. package/dist/types/managers/kup-data/kup-data-declarations.d.ts +1 -0
  117. package/package.json +1 -1
  118. package/dist/ketchup/p-0143e942.js +0 -1
  119. package/dist/ketchup/p-2ac2c05e.js +0 -1
  120. package/dist/ketchup/p-e8977116.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as i,f as s,h as e,H as o,g as h}from"./p-b5deb573.js";import{k as n,g as r,s as a,c as d}from"./p-6d46cbb0.js";var c;!function(t){t.buttonData="Props of the button (when isButton is set to true).",t.isButton="The component will be rendered as a button, which opens the link associated to the iframe in another tab when clicked.",t.src="The address the iframe should be referencing to."}(c||(c={}));const p=class{constructor(s){t(this,s),this.kupIframeError=i(this,"kup-iframe-error",6),this.kupIframeLoad=i(this,"kup-iframe-load",6),this.kupManager=n(),this.buttonData={},this.isButton=!1,this.src=void 0}onKupIframeError(){this.kupIframeError.emit({comp:this,id:this.rootElement.id})}onKupIframeLoad(){this.kupIframeLoad.emit({comp:this,id:this.rootElement.id})}async getProps(t){return r(this,c,t)}async refresh(){s(this)}async setProps(t){a(this,c,t)}openInNew(){window.open(this.src,"_blank")}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){if(null!=this.src&&""!==this.src)return this.buttonData.icon||(this.buttonData.icon="open_in_new"),this.buttonData.label||(this.buttonData.label="Open in new tab"),this.isButton?e(o,{"is-button":!0},e("kup-button",Object.assign({},this.buttonData,{"onkup-button-click":()=>this.openInNew()}))):e(o,{"is-iframe":!0},e("iframe",{onError:this.onKupIframeError.bind(this),onLoad:this.onKupIframeLoad.bind(this),src:this.src}));this.kupManager.debug.logMessage(this,"Resource undefined, not rendering!",d.WARNING)}get rootElement(){return h(this)}};p.style="iframe{box-sizing:border-box;height:100%;width:100%}:host([is-iframe]){box-sizing:border-box;display:block;height:100%;width:100%}";export{p as kup_iframe}
1
+ import{r as t,c as i,f as s,h as e,H as o,g as h}from"./p-3da7e4c6.js";import{k as n,g as r,s as a,c as d}from"./p-46daf529.js";var c;!function(t){t.buttonData="Props of the button (when isButton is set to true).",t.isButton="The component will be rendered as a button, which opens the link associated to the iframe in another tab when clicked.",t.src="The address the iframe should be referencing to."}(c||(c={}));const p=class{constructor(s){t(this,s),this.kupIframeError=i(this,"kup-iframe-error",6),this.kupIframeLoad=i(this,"kup-iframe-load",6),this.kupManager=n(),this.buttonData={},this.isButton=!1,this.src=void 0}onKupIframeError(){this.kupIframeError.emit({comp:this,id:this.rootElement.id})}onKupIframeLoad(){this.kupIframeLoad.emit({comp:this,id:this.rootElement.id})}async getProps(t){return r(this,c,t)}async refresh(){s(this)}async setProps(t){a(this,c,t)}openInNew(){window.open(this.src,"_blank")}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){if(null!=this.src&&""!==this.src)return this.buttonData.icon||(this.buttonData.icon="open_in_new"),this.buttonData.label||(this.buttonData.label="Open in new tab"),this.isButton?e(o,{"is-button":!0},e("kup-button",Object.assign({},this.buttonData,{"onkup-button-click":()=>this.openInNew()}))):e(o,{"is-iframe":!0},e("iframe",{onError:this.onKupIframeError.bind(this),onLoad:this.onKupIframeLoad.bind(this),src:this.src}));this.kupManager.debug.logMessage(this,"Resource undefined, not rendering!",d.WARNING)}get rootElement(){return h(this)}};p.style="iframe{box-sizing:border-box;height:100%;width:100%}:host([is-iframe]){box-sizing:border-box;display:block;height:100%;width:100%}";export{p as kup_iframe}
@@ -1 +1 @@
1
- import{r as t,f as s,h as i,H as e,g as h}from"./p-b5deb573.js";import{k as o,d as n,g as r,s as l,V as a,m as c}from"./p-6d46cbb0.js";import{c as d}from"./p-ad2e21d2.js";import{F as p}from"./p-e646523d.js";import"./p-fd1323da.js";import"./p-0143e942.js";import"./p-2ac2c05e.js";import"./p-349d4715.js";var m;!function(t){t.customStyle="Custom style of the component.",t.data="The data of the cell.",t.density="The density of the cell, defaults at 'dense' and can be also set to 'wide' or 'medium'.",t.dragEnabled="When set to true, the component is draggable."}(m||(m={}));const u=class{constructor(s){t(this,s),this.kupManager=o(),this.customStyle="",this.data=null,this.density=n.NONE,this.dragEnabled=!1}async addCssClasses(t){if(this.data.cssClass||(this.data.cssClass=""),t)for(let s=0;s<t.length;s++){const i=t[s];this.data.cssClass.indexOf(i)<0&&(this.data.cssClass+=` ${i}`)}this.refresh()}async getProps(t){return r(this,m,t)}async refresh(){s(this)}async removeCssClasses(t){if(this.data.cssClass){if(t)for(let s=0;s<t.length;s++){const i=t[s];this.data.cssClass.indexOf(i)>0&&(this.data.cssClass=this.data.cssClass.replace(new RegExp(i,"g"),""))}this.refresh()}}async setProps(t){l(this,m,t)}didRenderInteractables(){if(this.dragEnabled){const t=()=>({cell:this.data,column:this.generateColumn(),id:this.rootElement.id,multiple:!1,row:this.generateRow()});this.kupManager.interact.draggable(this.rootElement.shadowRoot.querySelector("#"+d),{cursorChecker:()=>null},{callback:t},a.BADGE)}}generateColumn(){return{name:this.data&&this.data.obj&&this.data.obj.t?this.data.obj.t+";"+this.data.obj.p:"KUPCELL",title:this.data&&this.data.obj&&this.data.obj.t?this.data.obj.t+";"+this.data.obj.p:this.kupManager.language.translate(c.EMPTY_OBJECT)}}generateRow(){const t=this.generateColumn(),s={cells:{}};return s.cells[t.name]=this.data,s}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.didRenderInteractables(),this.kupManager.debug.logRender(this,!0)}render(){const t={cell:this.data,column:this.generateColumn(),component:this,density:this.density,editable:this.data.isEditable,renderKup:!0,row:this.generateRow()};return i(e,null,i("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),i("div",{id:d},i(p,Object.assign({},t))))}disconnectedCallback(){this.kupManager.dates.unregister(this),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return h(this)}};u.style=":host{display:block;height:100%;width:100%}#kup-component{height:100%;width:100%}";export{u as kup_cell}
1
+ import{r as t,f as s,h as i,H as e,g as h}from"./p-3da7e4c6.js";import{k as o,d as n,g as r,s as a,V as l,m as c}from"./p-46daf529.js";import{c as d}from"./p-ad2e21d2.js";import{F as p}from"./p-279eab92.js";import"./p-90576709.js";import"./p-9cc4dd44.js";import"./p-9c7b9ff2.js";import"./p-d5491e4f.js";var m;!function(t){t.customStyle="Custom style of the component.",t.data="The data of the cell.",t.density="The density of the cell, defaults at 'dense' and can be also set to 'wide' or 'medium'.",t.dragEnabled="When set to true, the component is draggable."}(m||(m={}));const u=class{constructor(s){t(this,s),this.kupManager=o(),this.customStyle="",this.data=null,this.density=n.NONE,this.dragEnabled=!1}async addCssClasses(t){if(this.data.cssClass||(this.data.cssClass=""),t)for(let s=0;s<t.length;s++){const i=t[s];this.data.cssClass.indexOf(i)<0&&(this.data.cssClass+=` ${i}`)}this.refresh()}async getProps(t){return r(this,m,t)}async refresh(){s(this)}async removeCssClasses(t){if(this.data.cssClass){if(t)for(let s=0;s<t.length;s++){const i=t[s];this.data.cssClass.indexOf(i)>0&&(this.data.cssClass=this.data.cssClass.replace(new RegExp(i,"g"),""))}this.refresh()}}async setProps(t){a(this,m,t)}didRenderInteractables(){if(this.dragEnabled){const t=()=>({cell:this.data,column:this.generateColumn(),id:this.rootElement.id,multiple:!1,row:this.generateRow()});this.kupManager.interact.draggable(this.rootElement.shadowRoot.querySelector("#"+d),{cursorChecker:()=>null},{callback:t},l.BADGE)}}generateColumn(){return{name:this.data&&this.data.obj&&this.data.obj.t?this.data.obj.t+";"+this.data.obj.p:"KUPCELL",title:this.data&&this.data.obj&&this.data.obj.t?this.data.obj.t+";"+this.data.obj.p:this.kupManager.language.translate(c.EMPTY_OBJECT)}}generateRow(){const t=this.generateColumn(),s={cells:{}};return s.cells[t.name]=this.data,s}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.didRenderInteractables(),this.kupManager.debug.logRender(this,!0)}render(){const t={cell:this.data,column:this.generateColumn(),component:this,density:this.density,editable:this.data.isEditable,renderKup:!0,row:this.generateRow()};return i(e,null,i("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),i("div",{id:d},i(p,Object.assign({},t))))}disconnectedCallback(){this.kupManager.dates.unregister(this),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return h(this)}};u.style=":host{display:block;height:100%;width:100%}#kup-component{height:100%;width:100%}";export{u as kup_cell}
@@ -0,0 +1 @@
1
+ import{r as t,c as o,f as i,h as e,H as s,g as r}from"./p-3da7e4c6.js";import{k as n,A as a,g as l,s as h,v as c,m as p,K as b,c as d,Q as u,V as x,W as f,X as g,I as w,a2 as m}from"./p-46daf529.js";import{f as k,p as v,s as y,d as _,r as j,h as C,b as P}from"./p-78eaa526.js";import{F as A}from"./p-9c7b9ff2.js";import{a as R}from"./p-d5491e4f.js";import{c as z}from"./p-ad2e21d2.js";import{F as I}from"./p-279eab92.js";import{F as E}from"./p-fb03f2f5.js";import"./p-ffbd77d5.js";import"./p-0fd98ab4.js";import"./p-90576709.js";import"./p-9cc4dd44.js";import"./p-6507e9eb.js";var M;!function(t){t.cardData="Data of the card linked to the box when the latter's layout must be a premade template.",t.columns="Number of columns.",t.customStyle="Custom style of the component.",t.data="Actual data of the box.",t.dragEnabled="Enable dragging.",t.dropEnabled="Enable dropping.",t.dropOnSection="Drop can be done in section.",t.enableRowActions="If enabled, a button to load / display the row actions will be displayed on the right of every box.",t.globalFilter="When set to true it activates the global filter.",t.globalFilterValue="The value of the global filter.",t.kanban="Displays the boxlist as a Kanban.",t.layout="How the field will be displayed. If not present, a default one will be created.",t.lazyLoadRows="When set to true, extra rows will be automatically loaded once the last row enters the viewport.",t.multiSelection="Enable multi selection.",t.pageSelected="Current page number.",t.pagination="Enables pagination.",t.rowsPerPage="Number of current rows per page.",t.scrollOnHover="Activates the scroll on hover function.",t.selectBox="Automatically selects the box at the specified index.",t.selectedRowsState="Multiple selection.",t.showSelection="If enabled, highlights the selected box/boxes.",t.sortBy="If sorting is enabled, specifies which column to sort.",t.sortEnabled="Enable sorting.",t.stateId="",t.store="",t.swipeDisabled="Disable swipe."}(M||(M={}));class O{constructor(){this.globalFilterValue="",this.sortBy="",this.selectedRowsState="",this.pageSelected=1,this.rowsPerPage=0,this.load=!1}toDebugString(){return"box state"}}var S,B,D,W,$,T,L=function(t,o,i,e){if("a"===i&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof o?t!==o||!e:!o.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?e:"a"===i?e.call(t):e?e.value:o.get(t)},F=function(t,o,i,e,s){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof o?t!==o||!s:!o.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?s.call(t,i):s?s.value=i:o.set(t,i),i};const H=class{constructor(i){t(this,i),this.kupBoxClick=o(this,"kup-box-click",6),this.kupBoxSelected=o(this,"kup-box-selected",6),this.kupAutoBoxSelect=o(this,"kup-box-autoselect",6),this.kupRowActionMenuClick=o(this,"kup-box-rowactionmenuclick",6),this.kupRowActionClick=o(this,"kup-box-rowactionclick",6),this.kupDidLoad=o(this,"kup-box-didload",6),this.kupDidUnload=o(this,"kup-box-didunload",6),this.kupBoxContextMenu=o(this,"kup-box-contextmenu",6),S.add(this),this.state=new O,this.kupManager=n(),this.visibleColumns=[],this.rows=[],this.filteredRows=[],this.sectionRef=null,this.rowsRefs=[],this.hold=!1,this.interactableDrag=[],this.interactableDrop=[],this.interactableTouch=[],B.set(this,void 0),D.set(this,[]),W.set(this,0),this.collapsedSection={},this.selectedRows=[],this.rowActionMenuOpened=void 0,this.currentPage=1,this.currentRowsPerPage=10,this.cardData=null,this.columns=1,this.customStyle="",this.data=null,this.dragEnabled=!1,this.dropEnabled=!1,this.dropOnSection=!1,this.editableData=!1,this.enableRowActions=!1,this.globalFilter=!1,this.globalFilterValue="",this.kanban=null,this.layout=void 0,this.lazyLoadRows=!1,this.multiSelection=!1,this.pageSelected=1,this.pagination=!1,this.rowsPerPage=void 0,this.scrollOnHover=!1,this.selectBox=void 0,this.selectedRowsState=void 0,this.showSelection=!0,this.sortBy=void 0,this.sortEnabled=!1,this.stateId="",this.store=void 0,this.swipeDisabled=!1}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);null!=t&&(this.kupManager.debug.logMessage(this,"Initialize with state for stateId "+this.stateId+": "+t),this.sortBy=this.state.sortBy,this.globalFilterValue=this.state.globalFilterValue,this.selectedRowsState=this.state.selectedRowsState,this.pageSelected=this.state.pageSelected,this.rowsPerPage=this.state.rowsPerPage)}}persistState(){if(this.store&&this.stateId){let t=!1;this.kupManager.objects.deepEqual(this.state.sortBy,this.sortBy)||(this.state.sortBy=this.sortBy,t=!0),this.kupManager.objects.deepEqual(this.state.globalFilterValue,this.globalFilterValue)||(this.state.globalFilterValue=this.globalFilterValue,t=!0),this.kupManager.objects.deepEqual(this.state.pageSelected,this.currentPage)||(this.state.pageSelected=this.currentPage,t=!0),this.kupManager.objects.deepEqual(this.state.rowsPerPage,this.currentRowsPerPage)||(this.state.rowsPerPage=this.currentRowsPerPage,t=!0);const o=this.selectedRows.reduce(((t,o,i)=>t+(i>0?";":"")+o.id),"");if(this.kupManager.objects.deepEqual(this.state.selectedRowsState,o)||(this.state.selectedRowsState=o,t=!0),!this.state.load)return void(this.state.load=!0);t&&(this.kupManager.debug.logMessage(this,"Persisting state for stateId "+this.stateId+": "+this.state),this.store.persistState(this.stateId,this.state))}}rowsPerPageHandler(t){this.currentRowsPerPage=t}recalculateRows(){this.initRows()}onDataChanged(){a(this.getRows()),this.initVisibleColumns(),this.initRows(),this.checkLayout()}onLayoutChanged(){this.checkLayout()}onSelectBoxChanged(){this.handleAutomaticBoxSelection()}async getProps(t){return l(this,M,t)}async loadRowActions(t,o){t.actions=o,this.rowActionMenuOpened=t}async refresh(){i(this)}async setProps(t){h(this,M,t)}getColumns(){return this.data&&this.data.columns?this.data.columns:[{title:"",name:"",size:void 0}]}initVisibleColumns(){this.visibleColumns=this.getColumns().filter((t=>!t.hasOwnProperty("visible")||t.visible))}getRows(){return this.data&&this.data.rows?this.data.rows:[]}initRows(){this.filteredRows=this.getRows(),this.globalFilter&&this.globalFilterValue&&(this.filteredRows=k(this.filteredRows,null,this.globalFilterValue,this.visibleColumns)),this.rows=this.sortRows(this.filteredRows),this.pagination&&(this.rows=v(this.rows,this.currentPage,this.currentRowsPerPage,!1))}sortRows(t){let o=t;return this.sortBy&&(o=y(o,[{column:this.sortBy,sortMode:m.A}])),o}checkScrollOnHover(){this.kupManager.scrollOnHover.isRegistered(this.boxContainer)?this.scrollOnHover||this.kupManager.scrollOnHover.unregister(this.boxContainer):this.scrollOnHover&&this.kupManager.scrollOnHover.register(this.boxContainer)}checkLayout(){if(this.layout)return void(this.boxLayout=this.layout);const t={horizontal:!1,sections:[]},o=this.visibleColumns;let i=o.length,e=[],s=0;for(;i-- >0;)e.push({column:o[s++].name});t.content=e,this.boxLayout={sections:[t]}}onSortChange(t){let o=c(this.visibleColumns,t.detail.value);this.sortBy=o.name}onGlobalFilterChange({detail:t}){let o="";t&&t.value&&(o=t.value),this.globalFilterValue=o}isSectionExpanded(t,o){return!(!t.id||!o.id)&&this.collapsedSection[o.id]&&this.collapsedSection[o.id][t.id]}handleAutomaticBoxSelection(){if(this.selectBox&&this.selectBox>0&&this.selectBox<=this.data.rows.length){this.selectedRows=[];for(let t of this.data.rows)if(t.id===(this.selectBox-1).toString()){this.selectedRows.push(t);break}this.kupAutoBoxSelect.emit({comp:this,id:this.rootElement.id,row:this.selectedRows[0]})}}getEventDetails(t,o){let i=null,e=null,s=null,r=null;if(t&&(i=t.closest(".box-object")||t.querySelector(".box-object")||t.closest(".f-cell")),i)if(i.classList.contains("f-cell")){const t=i["kup-get-cell-props"]();e=t.cell,r=t.column,s=t.row}else e=i["data-cell"],s=i["data-row"],r=c(this.visibleColumns,i.dataset.column);return{boxObject:i||null,column:r||null,cell:e||null,originalEvent:o,row:s||null}}contextMenuHandler(t){return this.getEventDetails(t.target,t)}checkIfElementIsActionMenuIcon(t){return!(!t.tagName||!t.parentElement)&&"svg"===t.tagName&&t.parentElement.classList.contains("row-actions-toggler")}onBoxClick({target:t},o){if(!(t instanceof HTMLElement))return;let i=t,e=i.classList;for(;!e.contains("box-object")&&!e.contains("box-section")&&!e.contains("box")&&(i=i.parentElement,null!==i);)e=i.classList;let s=null;e.contains("box-object")&&(s=i.dataset.column),this.kupBoxClick.emit({comp:this,id:this.rootElement.id,row:o,column:s}),this.multiSelection?this.onSelectionCheckChange(o):this.selectedRows=[o]}onSelectionCheckChange(t){var o=-1;for(let i=0;i<this.selectedRows.length;i++)if(this.selectedRows[i].id===t.id){o=i;break}o>=0?(this.selectedRows.splice(o,1),this.selectedRows=[...this.selectedRows]):this.selectedRows=[...this.selectedRows,t],this.kupBoxSelected.emit({comp:this,id:this.rootElement.id,rows:this.selectedRows})}toggleSectionExpand(t,o){if(o.id)if(t.id){if(this.collapsedSection[o.id]){const i=this.collapsedSection[o.id];i[t.id]=!i[t.id]||!i[t.id]}else this.collapsedSection[o.id]={},this.collapsedSection[o.id][t.id]=!0;this.collapsedSection=Object.assign({},this.collapsedSection)}else console.error("cannot expand / collapse a section of a row without ad id");else console.error("cannot expand / collapse a section withoun an ID")}onRowAction(t){t&&(t!==this.rowActionMenuOpened?t.actions?this.rowActionMenuOpened=t:this.kupRowActionMenuClick.emit({comp:this,id:this.rootElement.id,row:t}):this.rowActionMenuOpened=null)}onRowActionClick(t,o,i){this.kupRowActionClick.emit({comp:this,id:this.rootElement.id,row:t,action:o,index:i})}clickFunction(t){try{const o=t.composedPath();for(let t of o)if(this.checkIfElementIsActionMenuIcon(t))return}catch(o){if(this.checkIfElementIsActionMenuIcon(t.target))return}this.rowActionMenuOpened=null}handlePageChange(t){const o=_(t,this.filteredRows.length,this.currentRowsPerPage);o&&(this.currentPage=o)}handleRowsPerPageChange(t){const o=j(t,this.filteredRows.length);o&&(this.currentRowsPerPage=o,this.adjustPaginator())}adjustPaginator(){const t=Math.ceil(this.rows.length/this.currentRowsPerPage);this.currentPage>t&&(this.currentPage=1)}renderSectionAsCard(t){let o=!1;const i={button:[],cell:[],columns:[],image:[],progressbar:[],text:[]};for(let o=0;o<this.data.columns.length;o++){const e=this.data.columns[o];!1!==e.visible&&(i.cell.push(t.cells[e.name]),i.columns.push(e))}for(const o in t.cells)if(t.cells.hasOwnProperty(o)){const e=t.cells[o];if(void 0!==e.cardID&&e.obj)switch(e.obj.p){case"BTN":do{i.button.push({})}while(i.button.length<e.cardID);i.button[e.cardID]={label:e.value};break;case"IMG":do{i.image.push({})}while(i.image.length<e.cardID);i.image[e.cardID]={resource:e.value};break;case"PGB":do{i.progressbar.push({})}while(i.progressbar.length<e.cardID);i.progressbar[e.cardID]={value:e.value};break;default:do{i.text.push("")}while(i.text.length<e.cardID);i.text[e.cardID]=e.value}}for(const e in t.cells)if(t.cells.hasOwnProperty(e)){const s=t.cells[e];if(void 0===s.cardID&&s.obj)switch(o=!1,s.obj.p){case"BTN":for(let t=0;t<i.button.length;t++)if(!Object.keys(i.button[t]).length){i.button[t]={label:s.value},o=!0;break}o||i.button.push({label:s.value});break;case"IMG":for(let t=0;t<i.image.length;t++)if(!Object.keys(i.image[t]).length){i.image[t]={resource:s.value},o=!0;break}o||i.image.push({resource:s.value});break;case"PGB":for(let t=0;t<i.progressbar.length;t++)if(!Object.keys(i.progressbar[t]).length){i.progressbar[t]={value:s.value},o=!0;break}o||i.progressbar.push({value:s.value});break;default:for(let t=0;t<i.text.length;t++)if(""===i.text[t]){i.text[t]=s.value,o=!0;break}o||i.text.push(s.value)}}return e("kup-card",Object.assign({data:i},this.cardData))}renderRow(t){const o=[...this.visibleColumns];let i=null,s=t.layout;s||(s=this.boxLayout);let r=!1;if(s){s.horizontal&&(r=!0);const e=s.sections;let n=e.length,a=0;n>0&&(i=[]);const l={horizontal:r};for(;n-- >0;)i.push(null!=this.cardData&&"object"==typeof this.cardData?this.renderSectionAsCard(t):this.renderSection(e[a++],l,t,o))}var n=!1;for(let o of this.selectedRows)o.id===t.id&&(n=!0);let a=null;this.multiSelection&&(a=e("div",{class:"box-selection"},e("kup-checkbox",{checked:n})));let l=null;if(this.enableRowActions&&!this.swipeDisabled){const o={"row-action-menu":!0,open:t===this.rowActionMenuOpened};let i=null;if(t.actions){const o=t.actions.map(((o,i)=>e("li",{tabindex:"0",onClick:()=>this.onRowActionClick(t,o,i)},e("div",{class:`icon ${o.icon}`}),e("div",{class:"text"},o.text))));i=e("ul",null,o)}l=e("div",{class:"row-actions-wrapper"},e("div",{class:"row-actions-toggler"},e("svg",{version:"1.1",width:"24",height:"24",viewBox:"0 0 24 24",onClick:()=>this.onRowAction(t)},e("path",{d:"M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z"})),e("div",{class:o},i)))}let h=null;return t.badgeData&&t.badgeData.length>0&&(h=t.badgeData.map((t=>e("kup-badge",{text:t.text,class:t.className?`centered ${t.className}`:"centered",imageData:t.imageData})))),e("div",{class:"box-wrapper",style:t.style||{},ref:t=>L(this,D,"f").push(t)},e("div",{class:{box:!0,draggable:this.dragEnabled,selected:this.showSelection&&n,column:!r},onClick:o=>this.onBoxClick(o,t),ref:t=>this.rowsRefs.push(t)},a,i,h),l)}renderSection(t,o,i,s){let r=null;if(t.sections&&t.sections.length>0){const o=t.sections;let e=o.length,n=0;for(e>0&&(r=[]);e-- >0;)r.push(this.renderSection(o[n++],t,i,s))}else if(t.content){const o=t.content;let e=o.length,n=0;for(e>0&&(r=[]);e-- >0;)r.push(this.renderBoxObject({boxObject:o[n++],row:i,visibleColumns:s},!0))}else s.length>0&&(r=this.renderBoxObject({boxObject:{column:s[0].name},row:i,visibleColumns:s}));const n=this.isSectionExpanded(i,t),a=!!t.columns,l={"box-section":!0,open:n,column:!a&&!t.horizontal,grid:a,titled:!!t.title,"last-child":!t.sections||0===t.sections.length},h=t.style||{};t.dim&&o&&(h.flex=`0 0 ${t.dim}`,h.overflow="hidden",o.horizontal?h.maxWidth=t.dim:h.maxHeight=t.dim),a&&(h["grid-template-columns"]=`repeat(${t.columns}, 1fr)`);let c=null;if(t.collapsible){l["collapse-section"]=!0;const o={content:!0};let s="";s=t.title?t.title:this.kupManager.language.translate(n?p.COLLAPSE:p.EXPAND),c=e("div",{class:l,style:h},e("div",{class:o},r),e("div",{class:"header",role:"button",onClick:o=>{o.stopPropagation(),this.toggleSectionExpand(i,t)}},e("div",{class:"header-content"},e("span",null,s),e(A,{resource:`${b.DROPDOWN}`,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:n?"toggled":""}))))}else{const o=t.title?e("h3",null,t.title):null;c=e("div",{class:l,style:h},o,r)}return c}renderBoxObject({boxObject:t,row:o,visibleColumns:i},s){const r={"box-object":!0};let n=null,a=-1;for(let o=0;o<i.length;o++)if(i[o].name===t.column){a=o;break}a>=0?(n=i[a],i.splice(a,1)):s&&(n=this.data.columns.find((o=>o.name===t.column)));const l=o.cells[t.column];let h;return l&&!this.kupManager.objects.isEmptyKupObj(l.obj)&&(r["is-obj"]=!0,this.kupManager.debug.isDebug()&&(h=l.obj.t+"; "+l.obj.p+"; "+l.obj.k+";")),e("div",{"data-cell":l,"data-row":o,"data-column":t.column,class:r,style:{},title:h},l&&n?e(I,Object.assign({},{cell:l,column:n,component:this,editable:this.editableData,renderKup:!0,row:o,setSizes:!0,shape:t.shape})):e("span",null,t.value))}kanbanMode(){if(!this.kanban.columns||0===this.kanban.columns.length)return this.kupManager.debug.logMessage(this,"No columns to group by detected.",d.ERROR),{jsx:e("div",{id:"empty-data-message",class:"box-wrapper"},e("div",{ref:t=>this.rowsRefs.push(t)}),this.kupManager.language.translate(p.EMPTY_DATA)),style:{"grid-template-columns":"repeat(1, 1fr)"}};const t=[];if(this.kanban.labels)for(let o=0;o<this.kanban.labels.length;o++)t.push({labels:this.kanban.labels[o],nodes:[]});for(let o=0;o<this.rows.length;o++){let i=[];for(let t=0;t<this.kanban.columns.length;t++)try{i.push(this.rows[o].cells[this.kanban.columns[t]].value)}catch(t){this.kupManager.debug.logMessage(this,t,d.WARNING)}const e={found:!1,index:null};for(let o=0;o<t.length;o++){let s=t[o].labels,r=!0;for(let t=0;t<s.length;t++)if(i[t]!==s[t]){r=!1;break}if(r){e.found=!0,e.index=o;break}}e.found?t[e.index].nodes.push(this.renderRow(this.rows[o])):t.push({labels:i,nodes:[this.renderRow(this.rows[o])]})}const o=[];for(let i=0;i<t.length;i++){const s=t[i].labels,r={data:[]};for(let t=0;t<s.length;t++)r.data.push({value:s[t],id:s[t]});o.push(e("div",{class:"kanban-section"},e(R,Object.assign({},r)),t[i].nodes))}return{jsx:o,style:{"grid-template-columns":this.kanban.isStacked?"repeat(1fr)":this.kanban.size?`repeat(${Object.keys(t).length}, ${this.kanban.size})`:`repeat(${Object.keys(t).length}, 1fr)`}}}didLoadInteractables(){this.interactableTouch.push(this.boxContainer),this.kupManager.interact.on(this.boxContainer,u.TAP,(t=>{this.hold?this.hold=!1:2===t.button&&this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)})})),this.kupManager.interact.on(this.boxContainer,u.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||(this.hold=!0,this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)}))}))}didRenderInteractables(){if(this.dragEnabled)for(let t=0;t<this.rowsRefs.length;t++){const o=this.rowsRefs[t],i=()=>{const t=this.rootElement.shadowRoot.querySelector(".box-object:hover");return{cell:t["data-cell"],column:c(this.visibleColumns,t.dataset.column),id:this.rootElement.id,multiple:this.multiSelection,row:t["data-row"],selectedRows:this.selectedRows}};o&&!this.interactableDrag.includes(o)&&(this.interactableDrag.push(o),this.kupManager.interact.draggable(o,{allowFrom:".box-object",cursorChecker:()=>null},{callback:i},x.BADGE))}if(this.dropEnabled){const t=()=>{const t=this.getEventDetails(this.rootElement.shadowRoot.querySelector(".box:hover"));return{cell:t.cell,column:t.column,id:this.rootElement.id,row:t.row}};this.interactableDrop.includes(this.sectionRef)||(this.interactableDrop.push(this.sectionRef),this.kupManager.interact.dropzone(this.sectionRef,{accept:`[${f}]`},{dispatcher:this.rootElement,type:g.BOX}));for(let o=0;o<this.rowsRefs.length;o++){const i=this.rowsRefs[o];i&&!this.interactableDrop.includes(i)&&(this.interactableDrop.push(i),this.kupManager.interact.dropzone(i,{accept:`[${f}]`},{callback:t,dispatcher:this.rootElement,type:g.BOX}))}}}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.rowsPerPage&&(this.currentRowsPerPage=this.rowsPerPage),this.data&&this.data.rows&&this.currentRowsPerPage>this.data.rows.length&&(this.currentRowsPerPage=this.data.rows.length),this.kupManager.language.register(this),this.kupManager.theme.register(this),this.onDataChanged(),this.adjustPaginator(),document.querySelector(".header")?F(this,W,document.querySelector(".header").clientHeight,"f"):F(this,W,0,"f"),document.querySelector(".topbar")&&F(this,W,L(this,W,"f")+document.querySelector(".topbar").clientHeight,"f"),L(this,S,"m",T).call(this)}componentDidLoad(){if(this.handleAutomaticBoxSelection(),document.addEventListener("click",this.clickFunction.bind(this)),this.currentPage=this.pageSelected,this.multiSelection&&this.selectedRowsState){this.selectedRows=[];let t=this.selectedRowsState.split(";");this.selectedRows=this.data.rows.filter((o=>t.indexOf(o.id)>=0))}this.didLoadInteractables(),this.kupDidLoad.emit({comp:this,id:this.rootElement.id}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const o=t.querySelectorAll(".f-text-field");for(let t=0;t<o.length;t++)E(o[t])}this.checkScrollOnHover(),this.persistState(),this.didRenderInteractables(),L(this,S,"m",$).call(this),this.kupManager.debug.logRender(this,!0)}render(){const t=!("object"!=typeof this.kanban||null===this.kanban);let o=null;if(this.sortEnabled){const t=[{value:"",id:""},...this.visibleColumns.map((t=>({value:t.title,id:t.name,selected:t.name===this.sortBy})))];let i={label:this.kupManager.language.translate(p.SORT_BY),trailingIcon:!0};o=e("div",{id:"sort-panel"},e("kup-combobox",{data:{"kup-text-field":i,"kup-list":{data:t,selectable:!0}},initialValue:this.sortBy,"onkup-combobox-itemclick":t=>this.onSortChange(t)}))}let i=null;this.globalFilter&&(i=e("div",{id:"global-filter"},e("kup-text-field",{fullWidth:!0,label:this.kupManager.language.translate(w.SEARCH),icon:b.SEARCH,initialValue:this.globalFilterValue,"onkup-textfield-input":t=>{window.clearTimeout(this.globalFilterTimeout),this.globalFilterTimeout=window.setTimeout((()=>this.onGlobalFilterChange(t)),600)}})));let r=null;this.pagination&&(r=e(P,{id:top?"top-paginator":"bottom-paginator",currentPage:this.currentPage,max:this.filteredRows.length,mode:C.SIMPLE,perPage:this.currentRowsPerPage?this.currentRowsPerPage:this.rowsPerPage,onPageChange:t=>this.handlePageChange(t.detail.value),onRowsChange:t=>this.handleRowsPerPageChange(t.detail.value)}));let n=null,a={};if(0===this.rows.length)n=e("div",{id:"empty-data-message",class:"box-wrapper"},e("div",{class:"box",ref:t=>this.rowsRefs.push(t)},this.kupManager.language.translate(p.EMPTY_DATA))),a={"grid-template-columns":"repeat(1, 1fr)"};else if(t){const t=this.kanbanMode();n=t.jsx,a=t.style}else{a={"grid-template-columns":`repeat(${this.columns}, 1fr)`};const t=this.rows;let o=t.length,i=0;for(n=[];o-- >0;)n.push(this.renderRow(t[i++]))}return e(s,null,e("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{id:z},e("div",{class:"box-component",ref:t=>this.sectionRef=t},o,i,r,e("div",{class:t?"is-kanban":"",id:"box-container",style:a,onContextMenu:t=>{t.preventDefault()},ref:t=>this.boxContainer=t},n))))}disconnectedCallback(){this.kupManager.interact.unregister(this.interactableDrag.concat(this.interactableDrop)),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this),this.scrollOnHover&&this.kupManager.scrollOnHover.unregister(this.boxContainer),document.removeEventListener("click",this.clickFunction.bind(this)),this.kupDidUnload.emit({comp:this,id:this.rootElement.id})}get rootElement(){return r(this)}static get watchers(){return{rowsPerPage:["rowsPerPageHandler","recalculateRows"],globalFilterValue:["recalculateRows"],sortBy:["recalculateRows"],pagination:["recalculateRows"],currentPage:["recalculateRows"],currentRowsPerPage:["recalculateRows"],data:["onDataChanged"],layout:["onLayoutChanged"],selectBox:["onSelectBoxChanged"]}}};B=new WeakMap,D=new WeakMap,W=new WeakMap,S=new WeakSet,$=function(){this.lazyLoadRows&&this.currentRowsPerPage<this.data.rows.length&&L(this,B,"f").observe(L(this,D,"f")[L(this,D,"f").length-1])},T=function(){const t={threshold:0,rootMargin:"-"+L(this,W,"f")+"px 0px 0px 0px"};F(this,B,new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){this.kupManager.debug.logMessage(this,"Last row entering the viewport, loading more elements.");const o=this.data.rows.length-this.currentRowsPerPage;this.currentRowsPerPage+=o<10?o:10,t.target.classList.remove("last-row"),L(this,B,"f").unobserve(t.target)}}))}),t),"f")},H.style=":host{--kup_box_background_color:var(\n --kup-box-background-color,\n var(--kup-background-color)\n );--kup_box_color:var(--kup-box-color, var(--kup-text-color));--kup_box_font_family:var(--kup-box-font-family, var(--kup-font-family));--kup_box_font_size:var(--kup-box-font-size, var(--kup-font-size));--kup_box_grid_gap:var(--kup-box-grid-gap, 1em);--kup_box_hover_box_shadow:var(\n --kup-box-hover-box-shadow,\n 0px 0px 7.5px 0px rgba(128, 128, 128, 0.5)\n );--kup_box_primary_color_rgb:var(\n --kup-box-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_box_transition:var(--kup-box-transition, 0.25s);display:block;font-family:var(--kup_box_font_family);font-size:var(--kup_box_font_size)}.box-component{background:var(--kup_box_background_color);transition:border var(--kup_box_transition) ease}.box-component[kup-drag-over]{position:relative;border:3px dashed var(--kup-border-color)}#box-container{display:grid;grid-gap:var(--kup_box_grid_gap);color:var(--kup_box_color);overflow:auto}#box-container.is-kanban .kanban-section{overflow:auto}#box-container.is-kanban .box-wrapper{padding-top:1em}#box-container.is-kanban .box-wrapper .box{overflow:auto}#box-container *{box-sizing:border-box}#box-container .box-wrapper{display:flex;align-items:center}#box-container .box-wrapper .box{flex-grow:1;cursor:pointer;position:relative;display:flex;transition:background-color var(--kup_box_transition) ease, box-shadow var(--kup_box_transition) ease, border var(--kup_box_transition) ease}#box-container .box-wrapper .box.draggable{touch-action:none;user-select:none}#box-container .box-wrapper .box.column{flex-direction:column}#box-container .box-wrapper .box:hover{box-shadow:var(--kup_box_hover_box_shadow)}#box-container .box-wrapper .box.selected{background-color:rgba(var(--kup_box_primary_color_rgb), 0.175)}#box-container .box-wrapper .box.selected .box-section.titled>h3{background-color:transparent}#box-container .box-wrapper .box[kup-draggable]{opacity:0.5}#box-container .box-wrapper .box[kup-drag-over]{border:3px dashed var(--kup-border-color);position:relative;z-index:2}#box-container .box-wrapper .box .box-section{display:flex;flex-direction:row;flex:1 1 1%;flex-wrap:wrap}#box-container .box-wrapper .box .box-section.column{flex-direction:column;justify-content:center;flex-wrap:unset}#box-container .box-wrapper .box .box-section.column>.box-section{flex:0 0 auto}#box-container .box-wrapper .box .box-section.grid{display:grid}#box-container .box-wrapper .box .box-section .box-object{min-height:16px}#box-container .box-wrapper .box .box-section .box-object img{height:auto}#box-container .box-wrapper .box .box-section.collapse-section .header{border-top:1px solid var(--kup-border-color);color:rgba(var(--kup-text-color-rgb), 0.75);display:flex;justify-content:space-around;width:100%}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content{margin:0.5em;display:flex;align-items:center}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image{transition:transform 0.15s}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image.toggled{transform:rotate(-180deg)}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .kup-icon.kup-dropdown-icon{margin:0;-webkit-mask:var(--kup-dropdown-icon);mask:var(--kup-dropdown-icon)}#box-container .box-wrapper .box .box-section.collapse-section .content{display:none;width:100%}#box-container .box-wrapper .box .box-section.collapse-section.open .content{display:block}#box-container .box-wrapper .box .box-section.titled{border:1px solid var(--kup-border-color);padding-top:5px;position:relative;margin:10px}#box-container .box-wrapper .box .box-section.titled>h3{background:var(--kup-background-color);font-size:calc(var(--kup-font-size) * 1.15);position:absolute;margin:0px;padding:0 8px;top:-11px;left:5px;transition:background-color 0.25s ease}#box-container .box-wrapper .box .box-selection{position:absolute;top:0.5em;right:0.5em;z-index:1}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler{position:relative;width:24px;height:24px;margin-left:3px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler svg{cursor:pointer;opacity:0;fill:var(--kup-text-color);transition:opacity 500ms ease-out}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu{background:var(--kup-background-color);border:1px solid var(--kup-border-color);box-shadow:0px 0px 7.5px 0px rgba(128, 128, 128, 0.5);position:absolute;top:0;right:24px;display:none;z-index:10}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul{list-style-type:none;margin:0;padding:0}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li{cursor:pointer;white-space:nowrap;padding:0 12px;display:flex;align-items:center;line-height:30px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li:not(:last-child){border-bottom:1px solid var(--kup-border-color)}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu.open{display:block}#box-container .box-wrapper:hover .row-actions-wrapper .row-actions-toggler svg{opacity:1}#sort-panel,#global-filter{margin-bottom:1em}:host(.kup-center-aligned) #kup-component .box-section{text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell img{margin:auto}:host(.kup-right-aligned) #kup-component .box-section{text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell img{margin-left:auto;margin-right:0}:host(.kup-top-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-start}:host(.kup-bottom-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-end}:host(:not(.kup-borderless)) .box{border:1px solid var(--kup-border-color)}:host(.kup-flat-on-hover) #box-container .box-wrapper .box:hover{box-shadow:none}:host(.kup-shaped) .box{border-radius:10px}:host(.kup-round) .box{border-radius:25px}:host(.kup-dashed-sections) .box-section{border:2px dashed var(--kup-text-color)}:host(:not(.kup-paddingless)) #box-container .box{padding:3px}:host(:not(.kup-paddingless)) #box-container .box .box-section .box-object{padding:1px 4px}:host(:not(.kup-paddingless)) #box-container .box .box-section.last-child{margin:3px 4px}:host(.kup-danger){--kup-box-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-box-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-box-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-box-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-box-primary-color-rgb:var(--kup-warning-color-rgb)}";export{H as kup_box}
@@ -1 +1 @@
1
- import{r as t,c as e,f as i,h as o,H as s,g as r}from"./p-b5deb573.js";import{k as h,g as a,s as n}from"./p-6d46cbb0.js";import{c as p}from"./p-ad2e21d2.js";var l;!function(t){t.customStyle="Custom style of the component.",t.placeholderAttrs="Html attributes of the picture before the component enters the viewport.",t.resourceAttrs="Html attributes of the picture after the component enters the viewport."}(l||(l={}));var f,d,c,u,m,w,b=function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)},v=function(t,e,i,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(t,i):s?s.value=i:e.set(t,i),i};const k=class{constructor(i){t(this,i),this.kupPhotoFramePlaceholderLoad=e(this,"kup-photoframe-placeholderload",6),this.kupPhotoFrameResourceLoad=e(this,"kup-photoframe-resourceload",6),f.set(this,null),d.set(this,h()),c.set(this,null),u.set(this,null),m.set(this,!1),w.set(this,null),this.isInViewport=!1,this.customStyle="",this.placeholderAttrs={},this.resourceAttrs={},this.threshold=.25}async getProps(t){return a(this,l,t)}async refresh(){i(this)}async setProps(t){n(this,l,t)}setObserver(){v(this,f,new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.isInViewport=!0,b(this,f,"f").unobserve(this.rootElement))}))}),{threshold:this.threshold}),"f")}componentWillLoad(){b(this,d,"f").debug.logLoad(this,!1),b(this,d,"f").theme.register(this),this.setObserver()}componentDidLoad(){b(this,d,"f").debug.logLoad(this,!0)}componentWillRender(){b(this,d,"f").debug.logRender(this,!1)}componentDidRender(){b(this,d,"f").debug.logRender(this,!0)}render(){return this.isInViewport&&!b(this,m,"f")&&v(this,m,!0,"f"),o(s,null,o("style",null,b(this,d,"f").theme.setKupStyle(this.rootElement)),o("div",{id:p,ref:t=>{v(this,w,t,"f")}},o("img",Object.assign({},this.placeholderAttrs,{class:"placeholder",ref:t=>v(this,c,t,"f"),onLoad:()=>{b(this,c,"f").naturalWidth>b(this,c,"f").naturalHeight?b(this,w,"f").classList.add("horizontal"):b(this,w,"f").classList.add("vertical"),b(this,f,"f").observe(this.rootElement),b(this,c,"f").classList.add("placeholder--loaded"),this.kupPhotoFramePlaceholderLoad.emit({comp:this,id:this.rootElement.id})}})),b(this,m,"f")?o("img",Object.assign({},this.resourceAttrs,{class:"resource",ref:t=>v(this,u,t,"f"),onLoad:()=>{b(this,c,"f").classList.add("placeholder--fade-out"),b(this,u,"f").classList.add("resource--fade-in"),this.kupPhotoFrameResourceLoad.emit({comp:this,id:this.rootElement.id})}})):null))}disconnectedCallback(){var t;b(this,d,"f").theme.unregister(this),null===(t=b(this,f,"f"))||void 0===t||t.unobserve(this.rootElement)}get rootElement(){return r(this)}};f=new WeakMap,d=new WeakMap,c=new WeakMap,u=new WeakMap,m=new WeakMap,w=new WeakMap,k.style=":host{--kup_photoframe_border:var(\n --kup-photoframe-border,\n 1px inset var(--kup-border-color)\n );--kup_photoframe_fade_out_time:var(--kup-photoframe-fade-out-time, 2000ms);border:var(--kup_photoframe_border);display:block;height:100%;position:relative;width:100%}#kup-component{position:relative;height:100%;width:100%}img{max-height:100%;max-width:100%}.horizontal img{width:100%}.vertical img{height:100%}.placeholder{display:none;transition:opacity var(--kup_photoframe_fade_out_time) ease-out;will-change:opacity;z-index:1}.placeholder--loaded{display:block}.placeholder--fade-out{opacity:0;position:absolute}.resource{display:none;left:0;position:absolute;top:0;z-index:0}.resource--fade-in{display:block;position:relative}:host(.kup-fit) img{height:100%;object-fit:cover;width:100%}";export{k as kup_photo_frame}
1
+ import{r as t,c as e,f as i,h as o,H as s,g as r}from"./p-3da7e4c6.js";import{k as a,g as h,s as n}from"./p-46daf529.js";import{c as p}from"./p-ad2e21d2.js";var l;!function(t){t.customStyle="Custom style of the component.",t.placeholderAttrs="Html attributes of the picture before the component enters the viewport.",t.resourceAttrs="Html attributes of the picture after the component enters the viewport."}(l||(l={}));var f,d,c,u,m,w,v=function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)},b=function(t,e,i,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(t,i):s?s.value=i:e.set(t,i),i};const k=class{constructor(i){t(this,i),this.kupPhotoFramePlaceholderLoad=e(this,"kup-photoframe-placeholderload",6),this.kupPhotoFrameResourceLoad=e(this,"kup-photoframe-resourceload",6),f.set(this,null),d.set(this,a()),c.set(this,null),u.set(this,null),m.set(this,!1),w.set(this,null),this.isInViewport=!1,this.customStyle="",this.placeholderAttrs={},this.resourceAttrs={},this.threshold=.25}async getProps(t){return h(this,l,t)}async refresh(){i(this)}async setProps(t){n(this,l,t)}setObserver(){b(this,f,new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.isInViewport=!0,v(this,f,"f").unobserve(this.rootElement))}))}),{threshold:this.threshold}),"f")}componentWillLoad(){v(this,d,"f").debug.logLoad(this,!1),v(this,d,"f").theme.register(this),this.setObserver()}componentDidLoad(){v(this,d,"f").debug.logLoad(this,!0)}componentWillRender(){v(this,d,"f").debug.logRender(this,!1)}componentDidRender(){v(this,d,"f").debug.logRender(this,!0)}render(){return this.isInViewport&&!v(this,m,"f")&&b(this,m,!0,"f"),o(s,null,o("style",null,v(this,d,"f").theme.setKupStyle(this.rootElement)),o("div",{id:p,ref:t=>{b(this,w,t,"f")}},o("img",Object.assign({},this.placeholderAttrs,{class:"placeholder",ref:t=>b(this,c,t,"f"),onLoad:()=>{v(this,c,"f").naturalWidth>v(this,c,"f").naturalHeight?v(this,w,"f").classList.add("horizontal"):v(this,w,"f").classList.add("vertical"),v(this,f,"f").observe(this.rootElement),v(this,c,"f").classList.add("placeholder--loaded"),this.kupPhotoFramePlaceholderLoad.emit({comp:this,id:this.rootElement.id})}})),v(this,m,"f")?o("img",Object.assign({},this.resourceAttrs,{class:"resource",ref:t=>b(this,u,t,"f"),onLoad:()=>{v(this,c,"f").classList.add("placeholder--fade-out"),v(this,u,"f").classList.add("resource--fade-in"),this.kupPhotoFrameResourceLoad.emit({comp:this,id:this.rootElement.id})}})):null))}disconnectedCallback(){var t;v(this,d,"f").theme.unregister(this),null===(t=v(this,f,"f"))||void 0===t||t.unobserve(this.rootElement)}get rootElement(){return r(this)}};f=new WeakMap,d=new WeakMap,c=new WeakMap,u=new WeakMap,m=new WeakMap,w=new WeakMap,k.style=":host{--kup_photoframe_border:var(\n --kup-photoframe-border,\n 1px inset var(--kup-border-color)\n );--kup_photoframe_fade_out_time:var(--kup-photoframe-fade-out-time, 2000ms);border:var(--kup_photoframe_border);display:block;height:100%;position:relative;width:100%}#kup-component{position:relative;height:100%;width:100%}img{max-height:100%;max-width:100%}.horizontal img{width:100%}.vertical img{height:100%}.placeholder{display:none;transition:opacity var(--kup_photoframe_fade_out_time) ease-out;will-change:opacity;z-index:1}.placeholder--loaded{display:block}.placeholder--fade-out{opacity:0;position:absolute}.resource{display:none;left:0;position:absolute;top:0;z-index:0}.resource--fade-in{display:block;position:relative}:host(.kup-fit) img{height:100%;object-fit:cover;width:100%}";export{k as kup_photo_frame}
@@ -1 +1 @@
1
- import{E as e,J as t,H as l,D as n,af as r,v as i,z as o,ah as s,ai as a,N as u,h as c,a2 as f,aj as h,r as d,m as p}from"./p-6d46cbb0.js";import{h as b}from"./p-b5deb573.js";import{F as m}from"./p-1ca9aece.js";import{F as v}from"./p-0fd98ab4.js";class F extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,l){let n="";if(null==e)return n;let r=e[t];return null==r||(n=l?r.textFieldTmp:r.textField),n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,l){if(!t)return!1;let n=this._getTextFilterValue(e,t.name,l);if(null!=n&&""!=n.trim())return!0;if(this._hasIntervalTextFieldFilterValues(e,t,l))return!0;let r=this.getCheckBoxFilterValues(e,t.name);return!(null==r||r.length<1)}getCheckBoxFilterValues(e={},t){let l=[];if(null==e)return l;let n=e[t];return null==n||null==n.checkBoxes||(l=n.checkBoxes),l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!1)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!0)}_hasIntervalTextFieldFilterValues(e={},l,n){if(null==l)return!1;if(!this.isColumnFiltrableByInterval(l))return!1;let r=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(null!=r&&""!=r.trim())return!0;let i=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);return null!=i&&""!=i.trim()}addCheckboxFilter(t={},l,n){if(null==t)return;let r=t[l];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},t[l]=r),null==r.checkBoxes&&(r.checkBoxes=[]),null==n||null==n.value?r.checkBoxes=[]:e.valuesArrayContainsValue(r.checkBoxes,n.value)||(r.checkBoxes[r.checkBoxes.length]=n)}removeCheckboxFilter(t={},l,n){if(null==t||null==n)return;let r=t[l];if(null==r)return;null==r.checkBoxes&&(r.checkBoxes=[]);let i=e.indexOfValueInValuesArray(r.checkBoxes,n);if(i>=0){let e=[];for(let t=0;t<r.checkBoxes.length;t++)t!=i&&(e[e.length]=r.checkBoxes[t]);r.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!1)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!0)}_getIntervalTextFieldFilterValues(e={},l,n){return this._hasIntervalTextFieldFilterValues(e,l,n)?[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)]:["",""]}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!1)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!0)}_getIntervalTextFieldFilterValue(e={},t,l,n){let r="";if(null==e)return r;let i=e[t];return null==i||n&&null==i.intervalTmp?r:n||null!=i.interval?(r=n?i.intervalTmp[l]:i.interval[l],r):r}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,!0)}_setTextFieldFilterValue(e={},t,l,n){if(null==e)return;let r=e[t];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=r),n?r.textFieldTmp=null!=l?l.trim():l:r.textField=null!=l?l.trim():l}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,!0)}_setIntervalTextFieldFilterValue(e={},t,l,n,r){if(null==e)return;let i=e[t];null==i&&(i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=i),null==i.interval&&(i.interval=[],i.interval.push("","")),null==i.intervalTmp&&(i.intervalTmp=[],i.intervalTmp.push("","")),r?i.intervalTmp[n]=null!=l?l.trim():l:i.interval[n]=null!=l?l.trim():l}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,!1)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,!0)}getFilterValueForTooltip(e={},r){let i=this.getTextFilterValue(e,r.name),o=this.getIntervalTextFieldFilterValues(e,r),s=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=o[t.FROM]&&(u+=a+"(>= "+l(o[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=o[t.TO]&&(u+=a+"(<= "+l(o[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return s.forEach((e=>{c+=a+n(e,r),a=" OR "})),""!=c&&(c="("+c+")",""!=u&&(c=" AND "+c)),c=u+c,c}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var x;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.removableColumns="Sets the possibility to remove the selected column.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(x||(x={}));const w="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const k=document.documentElement,T=k.ketchup?k.ketchup.objects:new o,y=k.ketchup?k.ketchup.data:new s;class j extends e{isFilterCompliantForCell(e,t,l){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=!1,r=[],i){return this.areCellsCompliant(e.cells,t,l,n,r,i)}areCellsCompliant(e,t={},l="",n=!1,o=[],s){if(n){let t=!0;if(o&&null!=o&&o.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<o.length;i++){if(0==o[i].visible)continue;const s=e[o[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,l);let a=r(o[i],s);if(a!=s.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==s&&(s=new F),!this.hasFilters(t,o,s))return!0;let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const r=e[n];if(!r)return!1;let u=s.getTextFilterValue(t,n),c=s.getIntervalTextFieldFilterValues(t,i(o,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(T.isNumber(r.obj)||T.isDate(r.obj)||T.isTime(r.obj)||T.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let p=s.getCheckBoxFilterValues(t,n);if(0==p.length)continue;let b=!1;for(let e=0;e<p.length;e++){let t=p[e];if(null!=t&&null!=t.value){if(null!=r.value&&r.value.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}}}if(!b)return!1}return!0}hasFilters(e={},t,l){if(null==e)return!1;let n=Object.keys(e);if(null==n||n.length<1)return!1;null==l&&(l=new F);for(let r=0;r<n.length;r++){let o=n[r],s=null;if(s=o===w?{name:w,title:""}:i(t,o),l.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},l="",n=[],r){if(!e||null==e)return[];let i=[];const o=!(!l||!n);if(this.hasFilters(t,n,r)||o)for(let s=0;s<e.length;s++){let a=e[s];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,o,n,r))&&(i[i.length]=a)}else i=[...e];return i}getColumnValues(t,n,r,i){let o=new Array;null==i&&(i=new F);let s=i.getTextFilterValueTmp(t.filters,n.name),a=i.getIntervalTextFieldFilterValuesTmp(t.filters,n),u=i.getCheckBoxFilterValues(t.filters,n.name);if(null!=n.valuesForFilter&&n.valuesForFilter.length>0)return n.valuesForFilter.forEach((t=>{let r=t;(e.valuesArrayContainsValue(u,r)||""==s||i.isFilterCompliantForSimpleValue(r,n.obj,s,a))&&o.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),o;let c=Object.assign({},t.filters);c[n.name]={textField:s,textFieldTmp:s,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)o.push(u[e]);return y.cell.getUnivocalValue({rows:f},n,!0)}}const C=document.documentElement;function V(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const l=e[0].group.column;let n=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let l of t)if(l.column===e)return l;return null}(l,t);return n||(n={column:l,sortMode:f.A}),e.sort(((e,t)=>a({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},n.sortMode))),e.forEach((e=>{e.group.children=V(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const r=O(e,n,t[l]);if(0!==r)return r}return 0}return O(e,n,t[0])}))}function O(e,t,l){const n=e.cells[l.column],r=t.cells[l.column];return n||r?n?r?a(n,r,l.sortMode):-1:1:0}function I(e=[],t={},l="",n=[],r,i){return null==i&&(i=new j),i.filterRows(e,t,l,n,r)}function M(e=[],t=[],l=[],n={}){if(!t)return[];if(!l||0===l.length||!e||0===e.length)return t;const o={},s=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return o[l]=n,!0;return!1}));if(0===s.length)return t;const a=[];let c={};return t.forEach((t=>{const l=s[0].column,f=t.cells[l];if(f){const h=i(e,l),d=r(h,f),p=f.value;let b=null;for(let e of a)if(e.group.label===d){b=e;break}null===b&&(b={group:{id:p,parent:null,column:l,columnLabel:o[l],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},a.push(b));for(let l=1;l<s.length;l++){const n=s[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(t,a),s=a.value;let u=null;for(let e=0;e<b.group.children.length;e++){const t=b.group.children[e];if(t.group.label===l){u=t;break}}u||(u={cells:{},group:{id:s,parent:b,column:n.column,columnLabel:o[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},D(u),b.group.children.push(u)),b=u}}b.group.children.push(t),function(e,t,l,n){if(!e||!t)return;const r=Object.keys(t);0!==r.length&&r.forEach((r=>{const i=C.ketchup.math.numberify(e.group.totals[r]||0),o=l.cells[r];if(o){let l=C.ketchup.objects.isNumber(o.obj);const s=t[r];switch(s){case u.COUNT:e.group.totals[r]=i+1;let t=e.group.parent;for(;null!=t;)t.group.totals[r]=(t.group.totals[r]||0)+1,t=t.group.parent;break;case u.DISTINCT:let a;if(a=l?C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value)):o.value,n[e.group.id]){let t=n[e.group.id][r];t?t.push(a):(n[e.group.id][r]=[],n[e.group.id][r].push(a))}else n[e.group.id]={},n[e.group.id][r]=[],n[e.group.id][r].push(a);let c=e.group.parent;for(;null!=c;){if(n[c.group.id]){let e=n[c.group.id][r];e?e.push(a):(n[c.group.id][r]=[],n[c.group.id][r].push(a))}else n[c.group.id]={},n[c.group.id][r]=[],n[c.group.id][r].push(a);c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(l){const t=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t+i;let l=e.group.parent;for(;null!=l;){const e=C.ketchup.math.numberify(l.group.totals[r]||0);l.group.totals[r]=t+e,l=l.group.parent}}break;case u.MIN:if(l){const t=e.group.totals[r],l=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t?Math.min(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.min(e,l):l,n=n.group.parent}}else if(C.ketchup.objects.isDate(o.obj)){const t=o.obj?C.ketchup.objects.parseDate(o.obj):C.ketchup.dates.toDayjs(o.value);if(C.ketchup.dates.isValid(t)){const l=C.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(C.ketchup.dates.format(n)),e.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.min(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(C.ketchup.dates.format(e)),i.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.min(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;case u.MAX:if(l){const t=e.group.totals[r],l=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t?Math.max(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.max(e,l):l,n=n.group.parent}}else if(C.ketchup.objects.isDate(o.obj)){const t=o.obj?C.ketchup.objects.parseDate(o.obj):C.ketchup.dates.toDayjs(o.value);if(C.ketchup.dates.isValid(t)){const l=C.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(C.ketchup.dates.format(n)),e.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.max(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(C.ketchup.dates.format(e)),i.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.max(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;default:0!=s.indexOf(u.MATH)&&console.warn(`invalid total mode: ${s}`)}}}))}(b,n,t,c)}})),function(e,t,l){if(!e||!t)return;const n=Object.keys(t);if(0===e.length||!e[0].group||0===n.length)return;let r=n.filter((e=>u.DISTINCT===t[e]));r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>N(e,r,l)))}(a,n,c),_(a,u.AVERAGE,n),_(a,u.MATH,n),a}function _(e,t,l){if(!e||!l)return;const n=Object.keys(l);if(0===e.length||!e[0].group||0===n.length)return;let r;t==u.AVERAGE&&(r=n.filter((e=>u.AVERAGE===l[e]))),t==u.MATH&&(r=n.filter((e=>0==l[e].indexOf(u.MATH)))),r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>W(e,t,r,l)))}function N(e,t,l){const n=e.group.children;0!==n.length&&(n[0].group&&n.forEach((e=>{N(e,t,l)})),t.forEach((t=>{e.group.totals[t]=new Set(l[e.group.id][t]).size})))}function W(e,t,l,n){const r=e.group.children;if(0===r.length)return 0;let i=0;return r[0].group?r.forEach((e=>{i+=W(e,t,l,n)})):i=r.length,l.forEach((l=>{if(t==u.AVERAGE&&(e.group.totals[l]=C.ketchup.math.numberify(e.group.totals[l])/i),t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=C.ketchup.math.formulas.custom(t,e.group.totals)}})),i}function A(e,t){if(t){const l=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const l=t.cells[e.name];l&&e.obj&&!l.obj&&(l.obj={t:e.obj.t,p:e.obj.p,k:l.value})}}))})),l}}function B(e=[],t={}){if(C.ketchup.objects.isEmptyJsObject(e)||C.ketchup.objects.isEmptyJsObject(t))return{};const l=Object.keys(t),n={},r=new Array;if(0===l.length||l.every((e=>t[e]===u.COUNT)))l.forEach((t=>n[t]=e.length));else{let i={};e.forEach(((e,o,s)=>{l.filter((e=>u.COUNT!==t[e]&&0!=t[e].indexOf(u.MATH))).forEach((l=>{const a=e.cells[l];if(a)if(t[l]===u.DISTINCT){let e;e=C.ketchup.objects.isNumber(a.obj)?C.ketchup.math.numberify(C.ketchup.math.numberifySafe(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(C.ketchup.objects.isNumber(a.obj)){const e=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(a.value));let r=n[l];switch(!0){case t[l]===u.MIN:n[l]=r?Math.min(r,e):e;break;case t[l]===u.MAX:n[l]=r?Math.max(r,e):e;break;default:r=n[l]||0,n[l]=e+C.ketchup.math.numberify(r)}}else if(C.ketchup.objects.isDate(a.obj)){-1==r.indexOf(l)&&r.push(l);const e=C.ketchup.dates.toDayjs(a.value);if(C.ketchup.dates.isValid(e)){const r=C.ketchup.dates.toDate(e),i=n[l]?C.ketchup.dates.toDate(C.ketchup.dates.toDayjs(n[l])):null;switch(!0){case t[l]===u.MIN:if(i){let e=[];e.push(r),e.push(i),n[l]=C.ketchup.dates.format(C.ketchup.dates.min(e),c.ISO_DATE)}else n[l]=C.ketchup.dates.format(r,c.ISO_DATE);break;case t[l]===u.MAX:if(i){let e=[];e.push(r),e.push(i),n[l]=C.ketchup.dates.format(C.ketchup.dates.max(e),c.ISO_DATE)}else n[l]=C.ketchup.dates.format(r,c.ISO_DATE)}}}o===s.length-1&&t[l]===u.DISTINCT&&(n[l]=new Set(i[l]).size,i[l]=[])}))}))}for(let i of l){switch(!0){case t[i]===u.AVERAGE:const l=n[i];l&&e.length>0&&(n[i]=l/e.length);break;case t[i]===u.COUNT:n[i]=e.length;break;case 0==t[i].indexOf(u.MATH):n[i]=C.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=C.ketchup.dates.format(n[i]):C.ketchup.math.isNumber(n[i])&&(n[i]=+n[i].toFixed(2)))}return n}function D(e){if(!e.group)return;let t=e.group.id,l=e.group.parent;for(;null!==l;)t=`${l.group.id};${t}`,l=l.group.parent;e.group.id=t}function $(e,t,l,n){const r=t*l-l,i=r+Number(l);if(0==n)return e.slice(r,i);let o=[];return E(e,o,r,Number(l),0),o}function E(e,t,l,n,r){let i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=L(e[o]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=E(s.group.children,a.group.children,l,n,r);r=e.ci,i=e.added,1==i&&(t[t.length]=a)}else r>=l&&(t[t.length]=a,i=!0),r++;if(r>=l+n)break}return{ci:r,added:i}}function L(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:R(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function S(e){if(null==e)return null;let t=[];for(let l=0;l<e.length;l++)t[t.length]=L(e[l]);return t}function R(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:S(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}var z;!function(e){e.SIMPLE="simple",e.FULL="full"}(z||(z={}));const q=document.documentElement,H=e=>{const t=Math.ceil(e.max/e.perPage),l=function(e,t){const l=[];for(let n=1;n<=t;n++){const t=n==e.currentPage;l.push({id:n.toString(),selected:t,value:n.toString()})}return l}(e,t),n=function(e){const t=[];let l=e.perPage;if(0===l)return t;for(;l<e.max;){const n=l==e.perPage;t.push({id:l.toString(),selected:n,value:l.toString()}),l*=2}const n=e.max==e.perPage;return t.push({id:e.max.toString(),selected:n,value:e.max.toString()}),t}(e),r={"kup-list":{data:l},"kup-text-field":{label:q.ketchup.language.translate(h.PAGE),helper:q.ketchup.language.translate(h.TOTAL)+`: ${t}`,helperWhenFocused:!0,inputType:"number",max:t,min:1}},i={"kup-list":{data:n},"kup-text-field":{label:q.ketchup.language.translate(d.ROWS)+" / "+q.ketchup.language.translate(h.PAGE),helper:q.ketchup.language.translate(d.TOTAL)+`: ${e.max}`,helperWhenFocused:!0,inputType:"number",max:e.max,min:1}};return b("div",Object.assign({class:`f-paginator ${e.mode?e.mode:""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),e.mode!==z.SIMPLE?b(m,{icon:"chevron_left",disabled:K(e),onClick:e.onPrevPage,wrapperClass:"prev-page"}):null,b("kup-combobox",{class:"page-selector",data:r,initialValue:e.currentPage.toString(),"onkup-combobox-change":e.onPageChange}),e.mode!==z.SIMPLE?b(m,{icon:"chevron_right",disabled:J(e),onClick:e.onNextPage,wrapperClass:"next-page"}):null,b("kup-combobox",{class:"rows-selector",data:i,initialValue:e.perPage.toString(),"onkup-combobox-change":e.onRowsChange}),e.onLoadMore?b(m,{icon:"plus",onClick:e.onLoadMore,label:q.ketchup.language.translate(p.LOAD_MORE),styling:v.FLAT,wrapperClass:"load-more-button"}):null)};function J(e){return e.currentPage*e.perPage>=e.max}function K(e){return 1==e.currentPage}const U=document.documentElement;function G(e,t,l){if(U.ketchup.math.isNumber(e)){const n=Math.ceil(t/l);let r=e;return r>n&&(r=n),r<1&&(r=1),r}return null}function P(e,t){if(U.ketchup.math.isNumber(e)){let l=e;return l>t&&(l=t),l<1&&(l=1),l}return null}export{F,g as K,j as a,H as b,B as c,G as d,x as e,I as f,M as g,z as h,A as n,$ as p,P as r,V as s,w as t}
1
+ import{E as e,J as t,H as l,D as n,af as r,v as i,z as o,ah as s,ai as a,N as u,h as c,a2 as f,aj as h,r as d,m as p}from"./p-46daf529.js";import{h as b}from"./p-3da7e4c6.js";import{F as m}from"./p-ffbd77d5.js";import{F as v}from"./p-0fd98ab4.js";class F extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,l){let n="";if(null==e)return n;let r=e[t];return null==r||(n=l?r.textFieldTmp:r.textField),n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,l){if(!t)return!1;let n=this._getTextFilterValue(e,t.name,l);if(null!=n&&""!=n.trim())return!0;if(this._hasIntervalTextFieldFilterValues(e,t,l))return!0;let r=this.getCheckBoxFilterValues(e,t.name);return!(null==r||r.length<1)}getCheckBoxFilterValues(e={},t){let l=[];if(null==e)return l;let n=e[t];return null==n||null==n.checkBoxes||(l=n.checkBoxes),l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!1)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!0)}_hasIntervalTextFieldFilterValues(e={},l,n){if(null==l)return!1;if(!this.isColumnFiltrableByInterval(l))return!1;let r=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(null!=r&&""!=r.trim())return!0;let i=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);return null!=i&&""!=i.trim()}addCheckboxFilter(t={},l,n){if(null==t)return;let r=t[l];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},t[l]=r),null==r.checkBoxes&&(r.checkBoxes=[]),null==n||null==n.value?r.checkBoxes=[]:e.valuesArrayContainsValue(r.checkBoxes,n.value)||(r.checkBoxes[r.checkBoxes.length]=n)}removeCheckboxFilter(t={},l,n){if(null==t||null==n)return;let r=t[l];if(null==r)return;null==r.checkBoxes&&(r.checkBoxes=[]);let i=e.indexOfValueInValuesArray(r.checkBoxes,n);if(i>=0){let e=[];for(let t=0;t<r.checkBoxes.length;t++)t!=i&&(e[e.length]=r.checkBoxes[t]);r.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!1)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!0)}_getIntervalTextFieldFilterValues(e={},l,n){return this._hasIntervalTextFieldFilterValues(e,l,n)?[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)]:["",""]}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!1)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!0)}_getIntervalTextFieldFilterValue(e={},t,l,n){let r="";if(null==e)return r;let i=e[t];return null==i||n&&null==i.intervalTmp?r:n||null!=i.interval?(r=n?i.intervalTmp[l]:i.interval[l],r):r}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,!0)}_setTextFieldFilterValue(e={},t,l,n){if(null==e)return;let r=e[t];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=r),n?r.textFieldTmp=null!=l?l.trim():l:r.textField=null!=l?l.trim():l}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,!0)}_setIntervalTextFieldFilterValue(e={},t,l,n,r){if(null==e)return;let i=e[t];null==i&&(i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=i),null==i.interval&&(i.interval=[],i.interval.push("","")),null==i.intervalTmp&&(i.intervalTmp=[],i.intervalTmp.push("","")),r?i.intervalTmp[n]=null!=l?l.trim():l:i.interval[n]=null!=l?l.trim():l}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,!1)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,!0)}getFilterValueForTooltip(e={},r){let i=this.getTextFilterValue(e,r.name),o=this.getIntervalTextFieldFilterValues(e,r),s=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=o[t.FROM]&&(u+=a+"(>= "+l(o[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=o[t.TO]&&(u+=a+"(<= "+l(o[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return s.forEach((e=>{c+=a+n(e,r),a=" OR "})),""!=c&&(c="("+c+")",""!=u&&(c=" AND "+c)),c=u+c,c}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var x;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.removableColumns="Sets the possibility to remove the selected column.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(x||(x={}));const w="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const k=document.documentElement,T=k.ketchup?k.ketchup.objects:new o,y=k.ketchup?k.ketchup.data:new s;class j extends e{isFilterCompliantForCell(e,t,l){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=!1,r=[],i){return this.areCellsCompliant(e.cells,t,l,n,r,i)}areCellsCompliant(e,t={},l="",n=!1,o=[],s){if(n){let t=!0;if(o&&null!=o&&o.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<o.length;i++){if(0==o[i].visible)continue;const s=e[o[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,l);let a=r(o[i],s);if(a!=s.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==s&&(s=new F),!this.hasFilters(t,o,s))return!0;let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const r=e[n];if(!r)return!1;let u=s.getTextFilterValue(t,n),c=s.getIntervalTextFieldFilterValues(t,i(o,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(T.isNumber(r.obj)||T.isDate(r.obj)||T.isTime(r.obj)||T.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let p=s.getCheckBoxFilterValues(t,n);if(0==p.length)continue;let b=!1;for(let e=0;e<p.length;e++){let t=p[e];if(null!=t&&null!=t.value){if(null!=r.value&&r.value.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}}}if(!b)return!1}return!0}hasFilters(e={},t,l){if(null==e)return!1;let n=Object.keys(e);if(null==n||n.length<1)return!1;null==l&&(l=new F);for(let r=0;r<n.length;r++){let o=n[r],s=null;if(s=o===w?{name:w,title:""}:i(t,o),l.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},l="",n=[],r){if(!e||null==e)return[];let i=[];const o=!(!l||!n);if(this.hasFilters(t,n,r)||o)for(let s=0;s<e.length;s++){let a=e[s];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,o,n,r))&&(i[i.length]=a)}else i=[...e];return i}getColumnValues(t,n,r,i){let o=new Array;null==i&&(i=new F);let s=i.getTextFilterValueTmp(t.filters,n.name),a=i.getIntervalTextFieldFilterValuesTmp(t.filters,n),u=i.getCheckBoxFilterValues(t.filters,n.name);if(null!=n.valuesForFilter&&n.valuesForFilter.length>0)return n.valuesForFilter.forEach((t=>{let r=t;(e.valuesArrayContainsValue(u,r)||""==s||i.isFilterCompliantForSimpleValue(r,n.obj,s,a))&&o.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),o;let c=Object.assign({},t.filters);c[n.name]={textField:s,textFieldTmp:s,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)o.push(u[e]);return y.cell.getUnivocalValue({rows:f},n,!0)}}const C=document.documentElement;function V(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const l=e[0].group.column;let n=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let l of t)if(l.column===e)return l;return null}(l,t);return n||(n={column:l,sortMode:f.A}),e.sort(((e,t)=>a({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},n.sortMode))),e.forEach((e=>{e.group.children=V(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const r=O(e,n,t[l]);if(0!==r)return r}return 0}return O(e,n,t[0])}))}function O(e,t,l){const n=e.cells[l.column],r=t.cells[l.column];return n||r?n?r?a(n,r,l.sortMode):-1:1:0}function I(e=[],t={},l="",n=[],r,i){return null==i&&(i=new j),i.filterRows(e,t,l,n,r)}function M(e=[],t=[],l=[],n={}){if(!t)return[];if(!l||0===l.length||!e||0===e.length)return t;const o={},s=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return o[l]=n,!0;return!1}));if(0===s.length)return t;const a=[];let c={};return t.forEach((t=>{const l=s[0].column,f=t.cells[l];if(f){const h=i(e,l),d=r(h,f),p=f.value;let b=null;for(let e of a)if(e.group.label===d){b=e;break}null===b&&(b={group:{id:p,parent:null,column:l,columnLabel:o[l],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},a.push(b));for(let l=1;l<s.length;l++){const n=s[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(t,a),s=a.value;let u=null;for(let e=0;e<b.group.children.length;e++){const t=b.group.children[e];if(t.group.label===l){u=t;break}}u||(u={cells:{},group:{id:s,parent:b,column:n.column,columnLabel:o[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},D(u),b.group.children.push(u)),b=u}}b.group.children.push(t),function(e,t,l,n){if(!e||!t)return;const r=Object.keys(t);0!==r.length&&r.forEach((r=>{const i=C.ketchup.math.numberify(e.group.totals[r]||0),o=l.cells[r];if(o){let l=C.ketchup.objects.isNumber(o.obj);const s=t[r];switch(s){case u.COUNT:e.group.totals[r]=i+1;let t=e.group.parent;for(;null!=t;)t.group.totals[r]=(t.group.totals[r]||0)+1,t=t.group.parent;break;case u.DISTINCT:let a;if(a=l?C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value)):o.value,n[e.group.id]){let t=n[e.group.id][r];t?t.push(a):(n[e.group.id][r]=[],n[e.group.id][r].push(a))}else n[e.group.id]={},n[e.group.id][r]=[],n[e.group.id][r].push(a);let c=e.group.parent;for(;null!=c;){if(n[c.group.id]){let e=n[c.group.id][r];e?e.push(a):(n[c.group.id][r]=[],n[c.group.id][r].push(a))}else n[c.group.id]={},n[c.group.id][r]=[],n[c.group.id][r].push(a);c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(l){const t=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t+i;let l=e.group.parent;for(;null!=l;){const e=C.ketchup.math.numberify(l.group.totals[r]||0);l.group.totals[r]=t+e,l=l.group.parent}}break;case u.MIN:if(l){const t=e.group.totals[r],l=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t?Math.min(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.min(e,l):l,n=n.group.parent}}else if(C.ketchup.objects.isDate(o.obj)){const t=o.obj?C.ketchup.objects.parseDate(o.obj):C.ketchup.dates.toDayjs(o.value);if(C.ketchup.dates.isValid(t)){const l=C.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(C.ketchup.dates.format(n)),e.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.min(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(C.ketchup.dates.format(e)),i.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.min(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;case u.MAX:if(l){const t=e.group.totals[r],l=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t?Math.max(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.max(e,l):l,n=n.group.parent}}else if(C.ketchup.objects.isDate(o.obj)){const t=o.obj?C.ketchup.objects.parseDate(o.obj):C.ketchup.dates.toDayjs(o.value);if(C.ketchup.dates.isValid(t)){const l=C.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(C.ketchup.dates.format(n)),e.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.max(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(C.ketchup.dates.format(e)),i.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.max(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;default:0!=s.indexOf(u.MATH)&&console.warn(`invalid total mode: ${s}`)}}}))}(b,n,t,c)}})),function(e,t,l){if(!e||!t)return;const n=Object.keys(t);if(0===e.length||!e[0].group||0===n.length)return;let r=n.filter((e=>u.DISTINCT===t[e]));r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>N(e,r,l)))}(a,n,c),_(a,u.AVERAGE,n),_(a,u.MATH,n),a}function _(e,t,l){if(!e||!l)return;const n=Object.keys(l);if(0===e.length||!e[0].group||0===n.length)return;let r;t==u.AVERAGE&&(r=n.filter((e=>u.AVERAGE===l[e]))),t==u.MATH&&(r=n.filter((e=>0==l[e].indexOf(u.MATH)))),r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>W(e,t,r,l)))}function N(e,t,l){const n=e.group.children;0!==n.length&&(n[0].group&&n.forEach((e=>{N(e,t,l)})),t.forEach((t=>{e.group.totals[t]=new Set(l[e.group.id][t]).size})))}function W(e,t,l,n){const r=e.group.children;if(0===r.length)return 0;let i=0;return r[0].group?r.forEach((e=>{i+=W(e,t,l,n)})):i=r.length,l.forEach((l=>{if(t==u.AVERAGE&&(e.group.totals[l]=C.ketchup.math.numberify(e.group.totals[l])/i),t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=C.ketchup.math.formulas.custom(t,e.group.totals)}})),i}function A(e,t){if(t){const l=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const l=t.cells[e.name];l&&e.obj&&!l.obj&&(l.obj={t:e.obj.t,p:e.obj.p,k:l.value})}}))})),l}}function B(e=[],t={}){if(C.ketchup.objects.isEmptyJsObject(e)||C.ketchup.objects.isEmptyJsObject(t))return{};const l=Object.keys(t),n={},r=new Array;if(0===l.length||l.every((e=>t[e]===u.COUNT)))l.forEach((t=>n[t]=e.length));else{let i={};e.forEach(((e,o,s)=>{l.filter((e=>u.COUNT!==t[e]&&0!=t[e].indexOf(u.MATH))).forEach((l=>{const a=e.cells[l];if(a)if(t[l]===u.DISTINCT){let e;e=C.ketchup.objects.isNumber(a.obj)?C.ketchup.math.numberify(C.ketchup.math.numberifySafe(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(C.ketchup.objects.isNumber(a.obj)){const e=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(a.value));let r=n[l];switch(!0){case t[l]===u.MIN:n[l]=r?Math.min(r,e):e;break;case t[l]===u.MAX:n[l]=r?Math.max(r,e):e;break;default:r=n[l]||0,n[l]=e+C.ketchup.math.numberify(r)}}else if(C.ketchup.objects.isDate(a.obj)){-1==r.indexOf(l)&&r.push(l);const e=C.ketchup.dates.toDayjs(a.value);if(C.ketchup.dates.isValid(e)){const r=C.ketchup.dates.toDate(e),i=n[l]?C.ketchup.dates.toDate(C.ketchup.dates.toDayjs(n[l])):null;switch(!0){case t[l]===u.MIN:if(i){let e=[];e.push(r),e.push(i),n[l]=C.ketchup.dates.format(C.ketchup.dates.min(e),c.ISO_DATE)}else n[l]=C.ketchup.dates.format(r,c.ISO_DATE);break;case t[l]===u.MAX:if(i){let e=[];e.push(r),e.push(i),n[l]=C.ketchup.dates.format(C.ketchup.dates.max(e),c.ISO_DATE)}else n[l]=C.ketchup.dates.format(r,c.ISO_DATE)}}}o===s.length-1&&t[l]===u.DISTINCT&&(n[l]=new Set(i[l]).size,i[l]=[])}))}))}for(let i of l){switch(!0){case t[i]===u.AVERAGE:const l=n[i];l&&e.length>0&&(n[i]=l/e.length);break;case t[i]===u.COUNT:n[i]=e.length;break;case 0==t[i].indexOf(u.MATH):n[i]=C.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=C.ketchup.dates.format(n[i]):C.ketchup.math.isNumber(n[i])&&(n[i]=+n[i].toFixed(2)))}return n}function D(e){if(!e.group)return;let t=e.group.id,l=e.group.parent;for(;null!==l;)t=`${l.group.id};${t}`,l=l.group.parent;e.group.id=t}function $(e,t,l,n){const r=t*l-l,i=r+Number(l);if(0==n)return e.slice(r,i);let o=[];return E(e,o,r,Number(l),0),o}function E(e,t,l,n,r){let i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=L(e[o]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=E(s.group.children,a.group.children,l,n,r);r=e.ci,i=e.added,1==i&&(t[t.length]=a)}else r>=l&&(t[t.length]=a,i=!0),r++;if(r>=l+n)break}return{ci:r,added:i}}function L(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:R(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function S(e){if(null==e)return null;let t=[];for(let l=0;l<e.length;l++)t[t.length]=L(e[l]);return t}function R(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:S(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}var z;!function(e){e.SIMPLE="simple",e.FULL="full"}(z||(z={}));const q=document.documentElement,H=e=>{const t=Math.ceil(e.max/e.perPage),l=function(e,t){const l=[];for(let n=1;n<=t;n++){const t=n==e.currentPage;l.push({id:n.toString(),selected:t,value:n.toString()})}return l}(e,t),n=function(e){const t=[];let l=e.perPage;if(0===l)return t;for(;l<e.max;){const n=l==e.perPage;t.push({id:l.toString(),selected:n,value:l.toString()}),l*=2}const n=e.max==e.perPage;return t.push({id:e.max.toString(),selected:n,value:e.max.toString()}),t}(e),r={"kup-list":{data:l},"kup-text-field":{label:q.ketchup.language.translate(h.PAGE),helper:q.ketchup.language.translate(h.TOTAL)+`: ${t}`,helperWhenFocused:!0,inputType:"number",max:t,min:1}},i={"kup-list":{data:n},"kup-text-field":{label:q.ketchup.language.translate(d.ROWS)+" / "+q.ketchup.language.translate(h.PAGE),helper:q.ketchup.language.translate(d.TOTAL)+`: ${e.max}`,helperWhenFocused:!0,inputType:"number",max:e.max,min:1}};return b("div",Object.assign({class:`f-paginator ${e.mode?e.mode:""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),e.mode!==z.SIMPLE?b(m,{icon:"chevron_left",disabled:K(e),onClick:e.onPrevPage,wrapperClass:"prev-page"}):null,b("kup-combobox",{class:"page-selector",data:r,initialValue:e.currentPage.toString(),"onkup-combobox-change":e.onPageChange}),e.mode!==z.SIMPLE?b(m,{icon:"chevron_right",disabled:J(e),onClick:e.onNextPage,wrapperClass:"next-page"}):null,b("kup-combobox",{class:"rows-selector",data:i,initialValue:e.perPage.toString(),"onkup-combobox-change":e.onRowsChange}),e.onLoadMore?b(m,{icon:"plus",onClick:e.onLoadMore,label:q.ketchup.language.translate(p.LOAD_MORE),styling:v.FLAT,wrapperClass:"load-more-button"}):null)};function J(e){return e.currentPage*e.perPage>=e.max}function K(e){return 1==e.currentPage}const U=document.documentElement;function G(e,t,l){if(U.ketchup.math.isNumber(e)){const n=Math.ceil(t/l);let r=e;return r>n&&(r=n),r<1&&(r=1),r}return null}function P(e,t){if(U.ketchup.math.isNumber(e)){let l=e;return l>t&&(l=t),l<1&&(l=1),l}return null}export{F,g as K,j as a,H as b,B as c,G as d,x as e,I as f,M as g,z as h,A as n,$ as p,P as r,V as s,w as t}
@@ -1 +1 @@
1
- import{r as t,c as e,f as i,h as r,H as a,g as l}from"./p-b5deb573.js";import{F as o}from"./p-1ca9aece.js";import{F as s}from"./p-0fd98ab4.js";import{F as _}from"./p-2ac2c05e.js";import{k as n,g as m,s as f,m as h,Q as c}from"./p-6d46cbb0.js";import{c as u}from"./p-ad2e21d2.js";var p;!function(t){t.autofitOnExpand="The component will autofit everytime a node is expanded.",t.autofitOnLoad="The component's initial render will fit the container by invoking the runAutofit method.",t.cardData="Used to render the family tree boxes as kup-cards (through kup-box).",t.collapsible="Nodes can be expanded/collapsed.",t.customStyle="Custom style of the component.",t.data="Actual data of the component",t.layout="Layout of the boxes.",t.stackedLeaves="Child nodes that have no children are arranged vertically."}(p||(p={}));var d,y,k,v,g,b,x,w,j,C,E,T,W,M,S,z,D,L,O,P,A,F,R,X,Y,H=function(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)},$=function(t,e,i,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(t,i):a?a.value=i:e.set(t,i),i};const B=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),k.set(this,!1),v.set(this,0),g.set(this,0),b.set(this,[]),x.set(this,n()),w.set(this,(t=>{const e=t.clientX-H(this,v,"f"),i=t.clientY-H(this,g,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,v,t.clientX,"f"),$(this,g,t.clientY,"f")})),j.set(this,!1),C.set(this,null),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1}async collapseAll(t=this.data.rows){H(this,x,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){H(this,x,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return m(this,p,t)}async refresh(){i(this)}async runAutofit(){const t=H(this,C,"f").clientWidth,e=H(this,C,"f").children[0].clientWidth,i=.01,r=.85*t,a=.95*t;let l=1,o=2e3,s=e;for(;(s<r||s>a)&&o>0&&l>i;)o--,s<r?l+=i:s>a?l-=i:o=0,s=e*l;H(this,C,"f").style.setProperty("--kup_familytree_scale",l<=1?l.toFixed(2):"1")}async setProps(t){f(this,p,t)}componentWillLoad(){H(this,x,"f").debug.logLoad(this,!1),H(this,x,"f").language.register(this),H(this,x,"f").theme.register(this)}componentDidLoad(){H(this,d,"m",X).call(this),this.autofitOnLoad&&this.runAutofit(),H(this,x,"f").debug.logLoad(this,!0)}componentWillRender(){H(this,x,"f").debug.logRender(this,!1)}componentDidRender(){H(this,j,"f")&&($(this,j,!1,"f"),this.runAutofit()),H(this,x,"f").debug.logRender(this,!0)}render(){return r(a,{onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),H(this,d,"m",O).call(this,t)},onWheel:t=>{H(this,d,"m",Y).call(this,t)}},r("style",null,H(this,x,"f").theme.setKupStyle(this.rootElement)),r("div",{id:u},H(this,d,"m",D).call(this)))}disconnectedCallback(){H(this,x,"f").language.unregister(this),H(this,x,"f").theme.unregister(this)}get rootElement(){return l(this)}};y=new WeakMap,k=new WeakMap,v=new WeakMap,g=new WeakMap,b=new WeakMap,x=new WeakMap,w=new WeakMap,j=new WeakMap,C=new WeakMap,d=new WeakSet,E=function(t,e,i,a){const l=[];return l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},r("div",{class:"family-tree__line--placeholder"}))),l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||a&&!e}},r("div",{class:"family-tree__line--placeholder"}))),l},T=function t(e){var i;let a=null,l=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(l||(l=[]),l.push(t)):(a||(a=[]),a.push(t))})));const _=this.stackedLeaves&&a&&a.every((t=>!t.children||0==t.children.length)),n=a?2*a.length:1,m={"family-tree__line":!0,"family-tree__line--placeholder":!(!a&&!l),"family-tree__line--vertical":!(!a&&!l)},f={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},c=e.layout||this.layout||1,u={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:s.OUTLINED,title:`${H(this,x,"f").language.translate(h.EXPAND)}/${H(this,x,"f").language.translate(h.COLLAPSE)} (CTRL + Click)`,onClick:t=>{t.ctrlKey&&e.children&&e.children.length>0&&(e.isExpanded?this.collapseAll(e.children):this.expandAll(e.children)),e.isExpanded=!e.isExpanded,this.autofitOnExpand&&$(this,j,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let p=null;H(this,d,"m",L).call(this,c)&&(p=r("kup-box",{class:"kup-borderless kup-paddingless",customStyle:"#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }",data:f,cardData:this.cardData,layout:this.cardData?null:c,showSelection:!1}));const y=r("div",{class:"family-tree__item"},r("div",{class:"family-tree__item__wrapper"},H(this,d,"m",L).call(this,c)?p:H(this,d,"m",W).call(this,e,c),this.collapsible&&e.children&&e.children.length>0?r(o,Object.assign({},u)):void 0)),k={"--kup_familytree_staffchildren":(null==l?void 0:l.length.toString())||"0"};return r("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},r("tr",null,r("td",{"data-row":e,colSpan:n},y)),r("tr",null,r("td",{colSpan:n},r("div",{class:m}))),l?[r("tr",null,r("td",{colSpan:n},r("div",{class:Object.assign(Object.assign({},m),{"family-tree__line--staff":!0}),style:k}),r("div",{class:"family-tree__node__staff",style:k},l.map((e=>[r("div",{class:"family-tree__node__staff__item"},H(this,d,"m",t).call(this,e))])))))]:null,l&&a?[r("tr",null,r("td",{colSpan:n},r("div",{class:m})))]:null,a?[r("tr",null,_?r("td",{colSpan:n},r("div",{class:m})):a.map((t=>H(this,d,"m",E).call(this,0==a.indexOf(t),a.indexOf(t)==a.length-1,1==a.length,a.length>2)))),r("tr",null,_?r("td",{colSpan:n},a.map((e=>H(this,d,"m",t).call(this,e)))):a.map((e=>r("td",{colSpan:2},H(this,d,"m",t).call(this,e)))))]:void 0)},W=function(t,e){return 2===e?H(this,d,"m",S).call(this,t):H(this,d,"m",M).call(this,t)},M=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--1"},r("div",{class:"family-tree__item__layout__text__title"},t.value))},S=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--2"},r("div",{class:"family-tree__item__layout__color"}),r("div",{class:"family-tree__item__layout__image"},r(_,{resource:t.icon,sizeX:"48px",sizeY:"48px"})),r("div",{class:"family-tree__item__layout__text"},r("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?r("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},z=function(t){return t.map((t=>H(this,d,"m",T).call(this,t)))},D=function(){return r("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,C,t,"f")},this.data&&this.data.rows&&this.data.rows.length?H(this,d,"m",z).call(this,this.data.rows):r("div",null,H(this,x,"f").language.translate(h.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){$(this,v,t.clientX,"f"),$(this,g,t.clientY,"f"),H(this,C,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",H(this,w,"f")),document.removeEventListener("pointerup",e),H(this,C,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",H(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t,e){let i,r;if(t)for(let e=t.length-1;e>=0;e--){const a=t[e];a.tagName&&(a.classList.contains("family-tree__item__expand")&&(i=a),"TD"===a.tagName.toUpperCase())&&(r=a)}let a=null,l=null,o=null;return r&&(a=r["data-cell"],l=r["data-column"],o=r["data-row"]),{cell:a||null,column:l||null,expandButton:i||null,originalEvent:e,row:o||null,td:r||null}},A=function(t){return H(this,d,"m",P).call(this,H(this,x,"f").getEventPath(t.target,this.rootElement),t)},F=function(t){return H(this,d,"m",P).call(this,H(this,x,"f").getEventPath(t.target,this.rootElement),t)},R=function(t){return H(this,d,"m",P).call(this,H(this,x,"f").getEventPath(t.target,this.rootElement),t)},X=function(){H(this,b,"f").push(this.rootElement),H(this,x,"f").interact.on(this.rootElement,c.TAP,(t=>{if(H(this,k,"f"))$(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];H(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)})}})),H(this,x,"f").interact.on(this.rootElement,c.DOUBLETAP,(t=>{if(0===t.button){for(let t=0;t<H(this,y,"f").length;t++)clearTimeout(H(this,y,"f")[t]),H(this,x,"f").debug.logMessage(this,"Cleared clickHandler timeout("+H(this,y,"f")[t]+").");$(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",R).call(this,t)})}})),H(this,x,"f").interact.on(this.rootElement,c.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||($(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)}))}))},Y=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(H(this,C,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let r=t.deltaY>0?e-i:e+i;r<i&&(r=i),H(this,C,"f").style.setProperty("--kup_familytree_scale",r.toFixed(2))}},B.style=':host{--kup_familytree_item_background_color:var(\n --kup-familytree-item-background-color,\n var(--kup-background-color)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 80px);--kup_familytree_item_h_padding:var(--kup-familytree-item-h-padding, 8px);--kup_familytree_item_v_padding:var(--kup-familytree-item-v-padding, 10px);--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-color)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc((var(--kup_familytree_item_width) + var(--kup_familytree_item_h_padding) * 2) / 2)) translateY(calc(0px - (var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:"";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc(var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);border:1px solid var(--kup_familytree_lines_color);border-radius:8px;box-sizing:border-box;display:flex;height:var(--kup_familytree_item_height);margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup-secondary-color);border-bottom-left-radius:8px;border-top-left-radius:8px;height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto 10px}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';export{B as kup_family_tree}
1
+ import{r as t,c as e,f as i,h as r,H as a,g as l}from"./p-3da7e4c6.js";import{F as o}from"./p-ffbd77d5.js";import{F as s}from"./p-0fd98ab4.js";import{F as _}from"./p-9c7b9ff2.js";import{k as n,g as m,s as f,m as h,Q as c}from"./p-46daf529.js";import{c as u}from"./p-ad2e21d2.js";var p;!function(t){t.autofitOnExpand="The component will autofit everytime a node is expanded.",t.autofitOnLoad="The component's initial render will fit the container by invoking the runAutofit method.",t.cardData="Used to render the family tree boxes as kup-cards (through kup-box).",t.collapsible="Nodes can be expanded/collapsed.",t.customStyle="Custom style of the component.",t.data="Actual data of the component",t.layout="Layout of the boxes.",t.stackedLeaves="Child nodes that have no children are arranged vertically."}(p||(p={}));var d,y,k,v,g,x,b,w,j,C,E,T,W,M,S,z,D,L,O,P,A,F,R,X,Y,H=function(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)},$=function(t,e,i,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(t,i):a?a.value=i:e.set(t,i),i};const B=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),k.set(this,!1),v.set(this,0),g.set(this,0),x.set(this,[]),b.set(this,n()),w.set(this,(t=>{const e=t.clientX-H(this,v,"f"),i=t.clientY-H(this,g,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,v,t.clientX,"f"),$(this,g,t.clientY,"f")})),j.set(this,!1),C.set(this,null),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1}async collapseAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return m(this,p,t)}async refresh(){i(this)}async runAutofit(){const t=H(this,C,"f").clientWidth,e=H(this,C,"f").children[0].clientWidth,i=.01,r=.85*t,a=.95*t;let l=1,o=2e3,s=e;for(;(s<r||s>a)&&o>0&&l>i;)o--,s<r?l+=i:s>a?l-=i:o=0,s=e*l;H(this,C,"f").style.setProperty("--kup_familytree_scale",l<=1?l.toFixed(2):"1")}async setProps(t){f(this,p,t)}componentWillLoad(){H(this,b,"f").debug.logLoad(this,!1),H(this,b,"f").language.register(this),H(this,b,"f").theme.register(this)}componentDidLoad(){H(this,d,"m",X).call(this),this.autofitOnLoad&&this.runAutofit(),H(this,b,"f").debug.logLoad(this,!0)}componentWillRender(){H(this,b,"f").debug.logRender(this,!1)}componentDidRender(){H(this,j,"f")&&($(this,j,!1,"f"),this.runAutofit()),H(this,b,"f").debug.logRender(this,!0)}render(){return r(a,{onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),H(this,d,"m",O).call(this,t)},onWheel:t=>{H(this,d,"m",Y).call(this,t)}},r("style",null,H(this,b,"f").theme.setKupStyle(this.rootElement)),r("div",{id:u},H(this,d,"m",D).call(this)))}disconnectedCallback(){H(this,b,"f").language.unregister(this),H(this,b,"f").theme.unregister(this)}get rootElement(){return l(this)}};y=new WeakMap,k=new WeakMap,v=new WeakMap,g=new WeakMap,x=new WeakMap,b=new WeakMap,w=new WeakMap,j=new WeakMap,C=new WeakMap,d=new WeakSet,E=function(t,e,i,a){const l=[];return l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},r("div",{class:"family-tree__line--placeholder"}))),l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||a&&!e}},r("div",{class:"family-tree__line--placeholder"}))),l},T=function t(e){var i;let a=null,l=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(l||(l=[]),l.push(t)):(a||(a=[]),a.push(t))})));const _=this.stackedLeaves&&a&&a.every((t=>!t.children||0==t.children.length)),n=a?2*a.length:1,m={"family-tree__line":!0,"family-tree__line--placeholder":!(!a&&!l),"family-tree__line--vertical":!(!a&&!l)},f={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},c=e.layout||this.layout||1,u={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:s.OUTLINED,title:`${H(this,b,"f").language.translate(h.EXPAND)}/${H(this,b,"f").language.translate(h.COLLAPSE)} (CTRL + Click)`,onClick:t=>{t.ctrlKey&&e.children&&e.children.length>0&&(e.isExpanded?this.collapseAll(e.children):this.expandAll(e.children)),e.isExpanded=!e.isExpanded,this.autofitOnExpand&&$(this,j,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let p=null;H(this,d,"m",L).call(this,c)&&(p=r("kup-box",{class:"kup-borderless kup-paddingless",customStyle:"#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }",data:f,cardData:this.cardData,layout:this.cardData?null:c,showSelection:!1}));const y=r("div",{class:"family-tree__item"},r("div",{class:"family-tree__item__wrapper"},H(this,d,"m",L).call(this,c)?p:H(this,d,"m",W).call(this,e,c),this.collapsible&&e.children&&e.children.length>0?r(o,Object.assign({},u)):void 0)),k={"--kup_familytree_staffchildren":(null==l?void 0:l.length.toString())||"0"};return r("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},r("tr",null,r("td",{"data-row":e,colSpan:n},y)),r("tr",null,r("td",{colSpan:n},r("div",{class:m}))),l?[r("tr",null,r("td",{colSpan:n},r("div",{class:Object.assign(Object.assign({},m),{"family-tree__line--staff":!0}),style:k}),r("div",{class:"family-tree__node__staff",style:k},l.map((e=>[r("div",{class:"family-tree__node__staff__item"},H(this,d,"m",t).call(this,e))])))))]:null,l&&a?[r("tr",null,r("td",{colSpan:n},r("div",{class:m})))]:null,a?[r("tr",null,_?r("td",{colSpan:n},r("div",{class:m})):a.map((t=>H(this,d,"m",E).call(this,0==a.indexOf(t),a.indexOf(t)==a.length-1,1==a.length,a.length>2)))),r("tr",null,_?r("td",{colSpan:n},a.map((e=>H(this,d,"m",t).call(this,e)))):a.map((e=>r("td",{colSpan:2},H(this,d,"m",t).call(this,e)))))]:void 0)},W=function(t,e){return 2===e?H(this,d,"m",S).call(this,t):H(this,d,"m",M).call(this,t)},M=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--1"},r("div",{class:"family-tree__item__layout__text__title"},t.value))},S=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--2"},r("div",{class:"family-tree__item__layout__color"}),r("div",{class:"family-tree__item__layout__image"},r(_,{resource:t.icon,sizeX:"48px",sizeY:"48px"})),r("div",{class:"family-tree__item__layout__text"},r("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?r("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},z=function(t){return t.map((t=>H(this,d,"m",T).call(this,t)))},D=function(){return r("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,C,t,"f")},this.data&&this.data.rows&&this.data.rows.length?H(this,d,"m",z).call(this,this.data.rows):r("div",null,H(this,b,"f").language.translate(h.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){$(this,v,t.clientX,"f"),$(this,g,t.clientY,"f"),H(this,C,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",H(this,w,"f")),document.removeEventListener("pointerup",e),H(this,C,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",H(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t,e){let i,r;if(t)for(let e=t.length-1;e>=0;e--){const a=t[e];a.tagName&&(a.classList.contains("family-tree__item__expand")&&(i=a),"TD"===a.tagName.toUpperCase())&&(r=a)}let a=null,l=null,o=null;return r&&(a=r["data-cell"],l=r["data-column"],o=r["data-row"]),{cell:a||null,column:l||null,expandButton:i||null,originalEvent:e,row:o||null,td:r||null}},A=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},F=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},R=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},X=function(){H(this,x,"f").push(this.rootElement),H(this,b,"f").interact.on(this.rootElement,c.TAP,(t=>{if(H(this,k,"f"))$(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];H(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,c.DOUBLETAP,(t=>{if(0===t.button){for(let t=0;t<H(this,y,"f").length;t++)clearTimeout(H(this,y,"f")[t]),H(this,b,"f").debug.logMessage(this,"Cleared clickHandler timeout("+H(this,y,"f")[t]+").");$(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",R).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,c.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||($(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)}))}))},Y=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(H(this,C,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let r=t.deltaY>0?e-i:e+i;r<i&&(r=i),H(this,C,"f").style.setProperty("--kup_familytree_scale",r.toFixed(2))}},B.style=':host{--kup_familytree_item_background_color:var(\n --kup-familytree-item-background-color,\n var(--kup-background-color)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 80px);--kup_familytree_item_h_padding:var(--kup-familytree-item-h-padding, 8px);--kup_familytree_item_v_padding:var(--kup-familytree-item-v-padding, 10px);--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-color)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc((var(--kup_familytree_item_width) + var(--kup_familytree_item_h_padding) * 2) / 2)) translateY(calc(0px - (var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:"";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc(var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);border:1px solid var(--kup_familytree_lines_color);border-radius:8px;box-sizing:border-box;display:flex;height:var(--kup_familytree_item_height);margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup-secondary-color);border-bottom-left-radius:8px;border-top-left-radius:8px;height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto 10px}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';export{B as kup_family_tree}
@@ -1 +1 @@
1
- import{h as c}from"./p-b5deb573.js";const e=e=>{const o={"data-indeterminate":!!e.indeterminate},a={checkbox:!0,"checkbox--checked":!(!e.checked||e.indeterminate),"checkbox--disabled":!!e.disabled,"checkbox--indeterminate":!!e.indeterminate};return c("div",Object.assign({class:`f-checkbox ${e.danger?"kup-danger":""} ${e.info?"kup-info":""} ${e.secondary?"kup-secondary":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),c("div",{class:"form-field "+(e.leadingLabel?"form-field--align-end":"")},c("div",{class:a},c("input",Object.assign({type:"checkbox",class:"checkbox__native-control",checked:e.checked,disabled:e.disabled,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus},o,{value:e.checked?"on":"off"})),c("div",{class:"checkbox__background",onClick:e.onChange},c("svg",{class:"checkbox__checkmark",viewBox:"0 0 24 24"},c("path",{class:"checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),c("div",{class:"checkbox__mixedmark"}))),e.label?c("label",null,e.label):void 0))};export{e as F}
1
+ import{h as c}from"./p-3da7e4c6.js";const e=e=>{const o={"data-indeterminate":!!e.indeterminate},a={checkbox:!0,"checkbox--checked":!(!e.checked||e.indeterminate),"checkbox--disabled":!!e.disabled,"checkbox--indeterminate":!!e.indeterminate};return c("div",Object.assign({class:`f-checkbox ${e.danger?"kup-danger":""} ${e.info?"kup-info":""} ${e.secondary?"kup-secondary":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),c("div",{class:"form-field "+(e.leadingLabel?"form-field--align-end":"")},c("div",{class:a},c("input",Object.assign({type:"checkbox",class:"checkbox__native-control",checked:e.checked,disabled:e.disabled,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus},o,{value:e.checked?"on":"off"})),c("div",{class:"checkbox__background",onClick:e.onChange},c("svg",{class:"checkbox__checkmark",viewBox:"0 0 24 24"},c("path",{class:"checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),c("div",{class:"checkbox__mixedmark"}))),e.label?c("label",null,e.label):void 0))};export{e as F}
@@ -0,0 +1 @@
1
+ import{h as t,a as e}from"./p-3da7e4c6.js";import{b as s}from"./p-46daf529.js";var a;!function(t){t.BAR="bar"}(a||(a={}));const i=i=>{let n,o;i.resource?i.resource.indexOf(".")>-1||i.resource.indexOf("/")>-1||i.resource.indexOf("\\")>-1?(o={"--kup_image_height":i.sizeY?i.sizeY:"auto","--kup_image_width":i.sizeX?i.sizeX:"100%"},n=function(e){return t("img",{onLoad:e.onLoad,src:e.resource})}(i)):(o={"--kup_image_height":i.sizeY?i.sizeY:"100%","--kup_image_width":i.sizeX?i.sizeX:"100%"},n=function(a){const i={"f-image__icon":!0},n={background:a.color?a.color:`var(${s.ICON})`};if(a.resource.indexOf("--kup")>-1){let t=a.resource.replace("--","");i["kup-icon"]=!0,i[t]=!0}else{const t=e(`./assets/svg/${a.resource}.svg`);n.mask=`url('${t}') no-repeat center`,n.webkitMask=`url('${t}') no-repeat center`}return t("div",{class:i,style:n})}(i)):i.data&&(o={"--kup_image_height":i.sizeY?i.sizeY:"100%","--kup_image_width":i.sizeX?i.sizeX:"100%"},n=function(e){const s=[];let i=0;for(let n=0;n<e.length;n++){let o;e[n].shape||(e[n].shape=a.BAR),e[n].color||(e[n].color="transparent"),e[n].height||(e[n].height="100%"),e[n].width||(e[n].width="100%");const r="step-"+n,c="css-step bottom-aligned",l={backgroundColor:e[n].color,left:i+"%",height:e[n].height,width:e[n].width};i+=parseFloat(e[n].width),o=t("span",{id:r,class:c,style:l}),s.push(o)}return t("div",{class:"f-image__css"},s)}(i.data));const r=[];if(i.badgeData)for(let e=0;e<i.badgeData.length;e++)r.push(t("kup-badge",Object.assign({},i.badgeData[e])));return t("div",Object.assign({class:`f-image ${i.wrapperClass?i.wrapperClass:""} ${i.fit?"kup-fit":""}`},i.dataSet,{id:i.id,style:o,title:i.title,onClick:i.onClick}),n,...r)};export{i as F}
@@ -0,0 +1 @@
1
+ import{h as e,a as t}from"./p-3da7e4c6.js";import{K as l}from"./p-46daf529.js";const i=document.documentElement,d=(t,l)=>e("div",Object.assign({class:`f-text-field ${t.danger?"kup-danger":""} ${t.fullHeight?"kup-full-height":""} ${t.fullWidth?"kup-full-width":""} ${t.info?"kup-info":""} ${t.secondary?"kup-secondary":""} ${t.shaped?"kup-shaped":""} ${t.success?"kup-success":""} ${t.warning?"kup-warning":""} ${t.wrapperClass?t.wrapperClass:""}`},t.dataSet,{id:t.id,title:t.title}),t.leadingLabel||t.trailingLabel?e("div",{class:"mdc-form-field "+(t.leadingLabel?"mdc-form-field--align-end":"")},[n(t),c(t),e("label",null,t.label)]):[n(t),c(t)],l);function n(d){var n,c;const o=d.textArea||d.outlined;let s,r;if(!d.label||d.leadingLabel||d.trailingLabel||(s=e("label",{class:"mdc-floating-label",htmlFor:"kup-input"},d.label)),d.icon){let i,n="";if(Object.values(l).indexOf(d.icon)>-1)n=d.icon.replace("--","");else{let e=`url('${t(`./assets/svg/${d.icon}.svg`)}') no-repeat center`;i={mask:e,webkitMask:e}}r=e("span",{style:i,onClick:d.onIconClick,class:`mdc-text-field__icon kup-icon action ${n}`})}const u={"is-clearable":d.isClearable,"mdc-text-field":!0,"mdc-text-field--disabled":d.disabled,"mdc-text-field--filled":!d.fullWidth&&!o,"mdc-text-field--no-label":!d.label,"mdc-text-field--fullwidth":d.fullWidth,"mdc-text-field--outlined":o,"mdc-text-field--textarea":d.textArea,"mdc-text-field--with-leading-icon":d.icon&&!d.trailingIcon,"mdc-text-field--with-trailing-icon":d.icon&&d.trailingIcon};let f=d.value,m=null!==(n=d.inputType)&&void 0!==n?n:"text",p=!1;if("number"===d.inputType&&d.decimals&&d.decimals>0&&(m="text",p=!0),"number"===d.inputType){const e={allowNegative:null===(c=d.allowNegative)||void 0===c||c,decimal:d.decimals,group:d.group,integer:d.integers};f=a(f,e,!1)}return e("div",{class:u},d.textArea&&d.maxLength?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",d.maxLength):void 0,d.trailingIcon?void 0:r,d.textArea?e("span",{class:"mdc-text-field__resizer"},e("textarea",{class:"mdc-text-field__input",disabled:d.disabled,readOnly:d.readOnly,maxlength:d.maxLength,value:f,onBlur:d.onBlur,onClick:d.onClick,onChange:d.onChange,onFocus:d.onFocus,onInput:d.onInput,onKeyDown:d.onKeyDown})):e("input",{inputmode:d.inputMode?d.inputMode:void 0,type:m,step:d.step,min:d.min,max:d.max,name:d.name,class:"mdc-text-field__input",disabled:d.disabled,readOnly:d.readOnly,placeholder:d.fullWidth&&!d.outlined?d.label:void 0,maxlength:d.maxLength,size:d.size,value:f,onBlur:e=>{var t;if(p){const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};e.target.value=a(e.target.value,l,!0)}d.onBlur&&d.onBlur(e)},onChange:e=>{var t;if(p){const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};e.target.value=a(e.target.value,l,!0)}d.onChange&&d.onChange(e)},onClick:d.onClick,onFocus:d.onFocus,onInput:d.onInput,onKeyDown:d.onKeyDown,onKeyPress:e=>{var t;if(!p)return;if(e.ctrlKey)return;if(e.key.length>1)return;const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};let n=e.target,c=n.value,a=c.substring(0,n.selectionStart),o=c.substring(n.selectionEnd,n.selectionEnd+c.length-1);i.ketchup.math.matchNumericValueWithOptions(a+e.key+o,l)||e.preventDefault()}}),d.isClearable?e("span",{class:`mdc-text-field__icon kup-icon ${l.CLEAR.replace("--","")}`,onClick:d.onClearIconClick}):void 0,d.trailingIcon?r:void 0,d.fullWidth||o?void 0:s,o?e("div",{class:"mdc-notched-outline"},e("div",{class:"mdc-notched-outline__leading"}),e("div",{class:"mdc-notched-outline__notch"},s),e("div",{class:"mdc-notched-outline__trailing"})):e("span",{class:"mdc-line-ripple"}))}function c(t){if(!1!==t.helperEnabled){if(t.helper)return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:{"mdc-text-field-helper-text":!0,"mdc-text-field-helper-text--persistent":!t.helperWhenFocused}},t.helper),t.maxLength&&!t.textArea?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",t.maxLength.toString()):void 0);if(t.maxLength&&!t.textArea)return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",t.maxLength))}}const a=function(e,t,l){let d=e;return d?"-"==d?"":i.ketchup.math.format(d,i.ketchup.math.createFormatPattern(t.group,t.decimal),l):d};export{d as F}
@@ -1 +1 @@
1
- import{r as t,c as n,h as i,g as a,f as e,H as l}from"./p-b5deb573.js";import{k as s,g as o,s as d,c as r}from"./p-6d46cbb0.js";import{c}from"./p-ad2e21d2.js";const u=class{constructor(i){t(this,i),this.dashClick=n(this,"kup-dash-click",6),this.kupManager=s(),this.active=!1,this.fontsize="",this.layout="1",this.index=0}onDshClickHandler(){this.dashClick.emit({id:this.index})}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){let t=null;switch(this.layout){case"2":t=i("div",null,i("div",{class:"icon"},i("slot",{name:"icon"})),i("div",{class:"value-int"},i("slot",{name:"value-int"})),i("div",{class:"value-dec"},i("slot",{name:"value-dec"})),i("div",{class:"unit"},i("slot",{name:"unit"})));break;case"3":t=i("div",null,i("div",{class:"value"},i("slot",{name:"value"})),i("div",{class:"descr"},i("slot",{name:"descr"})));break;case"4":t=i("div",null,i("div",{class:"icon"},i("slot",{name:"icon"})),i("div",{class:"value-and-unit"},i("div",{class:"value-int"},i("slot",{name:"value-int"})),i("div",{class:"value-dec"},i("slot",{name:"value-dec"})),i("div",{class:"unit"},i("slot",{name:"unit"}))),i("div",null),i("div",{class:"descr"},i("slot",{name:"descr"})));break;case"5":t=i("div",null,i("div",null,i("div",{class:"descr"},i("slot",{name:"descr"})),i("div",{class:"value"},i("slot",{name:"value"}))),i("div",{class:"icon"},i("slot",{name:"icon"})));break;case"6":t=i("div",null,i("div",{class:"icon"},i("slot",{name:"icon"})),i("div",null,i("div",{class:"value"},i("slot",{name:"value"})),i("div",{class:"descr"},i("slot",{name:"descr"}))));break;case"7":t=i("div",null,i("div",null,i("div",{class:"value"},i("slot",{name:"value"})),i("div",{class:"descr"},i("slot",{name:"descr"}))),i("div",{class:"icon"},i("slot",{name:"icon"})));break;case"8":t=i("div",null,i("div",{class:"icon"},i("slot",{name:"icon"})),i("div",{class:"value"},i("slot",{name:"value"})),i("div",{class:"descr"},i("slot",{name:"descr"})));break;default:t=i("div",null,i("div",{class:"descr"},i("slot",{name:"descr"})),i("div",{class:"value"},i("slot",{name:"value"})))}return i("div",{id:"dash",class:this.active?"with-dyn":"",style:{fontSize:this.fontsize},onClick:()=>this.onDshClickHandler()},i("div",{id:"content",class:`layout-${this.layout} `},t))}get rootElement(){return a(this)}};var g;u.style="#dash{color:var(--kup-text-color);font-size:2vw;display:flex;align-items:center;justify-content:center;position:relative;text-align:center;position:relative;word-break:normal}#dash.with-dyn{cursor:pointer}#dash #content .icon{margin:auto;font-size:90%}#dash #content.layout-1,#dash #content.layout-3{text-align:center}#dash #content.layout-1 .descr,#dash #content.layout-3 .descr{font-size:70%;width:100%}#dash #content.layout-1 .value,#dash #content.layout-3 .value{font-size:220%}#dash #content.layout-2>div{display:flex}#dash #content.layout-2>div .icon{margin:auto;font-size:150%;margin-right:5%}#dash #content.layout-2>div .value-int{font-size:250%}#dash #content.layout-2>div .value-dec,#dash #content.layout-2>div .unit{font-size:130%;margin-top:auto;margin-bottom:7%}#dash #content.layout-2>div .value-dec{margin-left:2%}#dash #content.layout-2>div .unit{margin-left:4%}#dash #content.layout-4>div{display:grid;grid-template-columns:2fr 5fr}#dash #content.layout-4>div .icon{margin:auto;font-size:150%;margin-right:5%}#dash #content.layout-4>div .value-and-unit{display:flex}#dash #content.layout-4>div .value-and-unit .value-int{font-size:250%}#dash #content.layout-4>div .value-and-unit .value-dec,#dash #content.layout-4>div .value-and-unit .unit{font-size:130%;margin-top:auto;margin-bottom:7%}#dash #content.layout-4>div .value-and-unit .value-dec{margin-left:2%}#dash #content.layout-4>div .value-and-unit .unit{margin-left:4%}#dash #content.layout-4>div .descr{margin-left:4%;text-align:left;font-size:80%;width:100%;min-width:max-content}#dash #content.layout-5>div,#dash #content.layout-7>div{display:flex}#dash #content.layout-5>div .icon,#dash #content.layout-7>div .icon{font-size:150%;margin:auto;margin-left:10%}#dash #content.layout-5>div .value,#dash #content.layout-7>div .value{font-size:200%}#dash #content.layout-5>div .descr,#dash #content.layout-7>div .descr{text-align:right;font-size:65%;width:100%;min-width:max-content}#dash #content.layout-6>div{display:flex;justify-content:space-between}#dash #content.layout-6>div .icon{font-size:150%;margin-right:10%}#dash #content.layout-6>div .value{font-size:220%;text-align:right}#dash #content.layout-6>div .descr{font-size:80%;text-align:right;width:100%;min-width:max-content}#dash #content.layout-8>div{display:flex;align-items:center}#dash #content.layout-8>div .icon{margin-right:4%;font-size:75%}#dash #content.layout-8>div .value{margin:0 10%;font-size:250%}#dash #content.layout-8>div .descr{font-size:60%;text-align:left}",function(t){t.columns="The number of columns displayed by the grid, the default behavior is 12.",t.customStyle="Custom style of the component. For more information: https://ketchup.smeup.com/ketchup-showcase/#/customization",t.singleLine="When set to true, forces the content on a single line."}(g||(g={}));const p=class{constructor(n){t(this,n),this.kupManager=s(),this.columns=12,this.customStyle="",this.singleLine=!1}async getProps(t){return o(this,g,t)}async refresh(){e(this)}async setProps(t){d(this,g,t)}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){const t=this.rootElement.children;if(!t||0===t.length)return void this.kupManager.debug.logMessage(this,"Missing slots, not rendering!",r.WARNING);const n=[];for(let a=0;a<t.length;a++){let e=null;if(this.singleLine)e=i("slot",{name:`${a}`});else{const n=t[a].span||t[a].getAttribute("span")||1;e=i("div",{class:`layout-grid__cell layout-grid__cell--span-${n}`},i("slot",{name:`${a}`}))}n.push(e)}const a={};return this.columns&&12!==this.columns&&(a["--kup_grid_columns"]=this.columns),i(l,{style:a},i("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),i("div",{id:c},i("div",{class:this.singleLine?"flex-layout":"layout-grid"},i("div",{class:this.singleLine?"flex-layout__inner":"layout-grid__inner"},n))))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return a(this)}};p.style=":host{--kup_grid_font_size:var(--kup-grid-font-size, var(--kup-font-size));--kup_grid_gap:var(--kup-grid-gap, 24px);--kup_grid_gap_mobile:var(--kup-grid-gap-mobile, 16px);--kup_grid_padding:var(--kup-grid-padding, 24px);font-size:var(--kup_grid_font_size);height:100%;width:100%}#kup-component{height:100%;width:100%}.layout-grid{box-sizing:border-box;margin:0px auto;padding:var(--kup_grid_padding)}.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap);grid-template-columns:repeat(var(--kup_grid_columns, 12), minmax(0px, 1fr))}.layout-grid .layout-grid__inner .layout-grid__cell{box-sizing:border-box;display:flex;justify-content:center;margin:0px;width:auto}.layout-grid__cell--span-1{grid-column-end:span 1}.layout-grid__cell--span-2{grid-column-end:span 2}.layout-grid__cell--span-3{grid-column-end:span 3}.layout-grid__cell--span-4{grid-column-end:span 4}.layout-grid__cell--span-5{grid-column-end:span 5}.layout-grid__cell--span-6{grid-column-end:span 6}.layout-grid__cell--span-7{grid-column-end:span 7}.layout-grid__cell--span-8{grid-column-end:span 8}.layout-grid__cell--span-9{grid-column-end:span 9}.layout-grid__cell--span-10{grid-column-end:span 10}.layout-grid__cell--span-11{grid-column-end:span 11}.layout-grid__cell--span-12{grid-column-end:span 12}.layout-grid__cell--span-13{grid-column-end:span 13}.layout-grid__cell--span-14{grid-column-end:span 14}.layout-grid__cell--span-15{grid-column-end:span 15}.layout-grid__cell--span-16{grid-column-end:span 16}.layout-grid__cell--span-17{grid-column-end:span 17}.layout-grid__cell--span-18{grid-column-end:span 18}.layout-grid__cell--span-19{grid-column-end:span 19}.layout-grid__cell--span-20{grid-column-end:span 20}.layout-grid__cell--span-21{grid-column-end:span 21}.layout-grid__cell--span-22{grid-column-end:span 22}.layout-grid__cell--span-23{grid-column-end:span 23}.layout-grid__cell--span-24{grid-column-end:span 24}.flex-layout,.flex-layout__inner{height:100%;align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap}.flex-layout__inner{width:auto}.flex-layout__inner *{display:block;margin:0 1.5em}.flex-layout__inner .flex-layout__cell{display:flex}.flex-layout__inner .flex-layout__cell *{justify-content:center;margin:auto}@media (min-width: 600px) and (max-width: 839px){.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap_mobile);grid-template-columns:repeat(var(--kup_grid_columns, 8), minmax(0px, 1fr))}}@media (max-width: 599px){.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap_mobile);grid-template-columns:repeat(var(--kup_grid_columns, 4), minmax(0px, 1fr))}}:host(.kup-full-width) .flex-layout__inner{width:100%}:host(.kup-full-width) .flex-layout__inner *{margin:auto}";export{u as kup_dash,p as kup_grid}
1
+ import{r as t,c as n,h as i,g as a,f as e,H as l}from"./p-3da7e4c6.js";import{k as s,g as o,s as d,c as r}from"./p-46daf529.js";import{c}from"./p-ad2e21d2.js";const u=class{constructor(i){t(this,i),this.dashClick=n(this,"kup-dash-click",6),this.kupManager=s(),this.active=!1,this.fontsize="",this.layout="1",this.index=0}onDshClickHandler(){this.dashClick.emit({id:this.index})}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){let t=null;switch(this.layout){case"2":t=i("div",null,i("div",{class:"icon"},i("slot",{name:"icon"})),i("div",{class:"value-int"},i("slot",{name:"value-int"})),i("div",{class:"value-dec"},i("slot",{name:"value-dec"})),i("div",{class:"unit"},i("slot",{name:"unit"})));break;case"3":t=i("div",null,i("div",{class:"value"},i("slot",{name:"value"})),i("div",{class:"descr"},i("slot",{name:"descr"})));break;case"4":t=i("div",null,i("div",{class:"icon"},i("slot",{name:"icon"})),i("div",{class:"value-and-unit"},i("div",{class:"value-int"},i("slot",{name:"value-int"})),i("div",{class:"value-dec"},i("slot",{name:"value-dec"})),i("div",{class:"unit"},i("slot",{name:"unit"}))),i("div",null),i("div",{class:"descr"},i("slot",{name:"descr"})));break;case"5":t=i("div",null,i("div",null,i("div",{class:"descr"},i("slot",{name:"descr"})),i("div",{class:"value"},i("slot",{name:"value"}))),i("div",{class:"icon"},i("slot",{name:"icon"})));break;case"6":t=i("div",null,i("div",{class:"icon"},i("slot",{name:"icon"})),i("div",null,i("div",{class:"value"},i("slot",{name:"value"})),i("div",{class:"descr"},i("slot",{name:"descr"}))));break;case"7":t=i("div",null,i("div",null,i("div",{class:"value"},i("slot",{name:"value"})),i("div",{class:"descr"},i("slot",{name:"descr"}))),i("div",{class:"icon"},i("slot",{name:"icon"})));break;case"8":t=i("div",null,i("div",{class:"icon"},i("slot",{name:"icon"})),i("div",{class:"value"},i("slot",{name:"value"})),i("div",{class:"descr"},i("slot",{name:"descr"})));break;default:t=i("div",null,i("div",{class:"descr"},i("slot",{name:"descr"})),i("div",{class:"value"},i("slot",{name:"value"})))}return i("div",{id:"dash",class:this.active?"with-dyn":"",style:{fontSize:this.fontsize},onClick:()=>this.onDshClickHandler()},i("div",{id:"content",class:`layout-${this.layout} `},t))}get rootElement(){return a(this)}};var g;u.style="#dash{color:var(--kup-text-color);font-size:2vw;display:flex;align-items:center;justify-content:center;position:relative;text-align:center;position:relative;word-break:normal}#dash.with-dyn{cursor:pointer}#dash #content .icon{margin:auto;font-size:90%}#dash #content.layout-1,#dash #content.layout-3{text-align:center}#dash #content.layout-1 .descr,#dash #content.layout-3 .descr{font-size:70%;width:100%}#dash #content.layout-1 .value,#dash #content.layout-3 .value{font-size:220%}#dash #content.layout-2>div{display:flex}#dash #content.layout-2>div .icon{margin:auto;font-size:150%;margin-right:5%}#dash #content.layout-2>div .value-int{font-size:250%}#dash #content.layout-2>div .value-dec,#dash #content.layout-2>div .unit{font-size:130%;margin-top:auto;margin-bottom:7%}#dash #content.layout-2>div .value-dec{margin-left:2%}#dash #content.layout-2>div .unit{margin-left:4%}#dash #content.layout-4>div{display:grid;grid-template-columns:2fr 5fr}#dash #content.layout-4>div .icon{margin:auto;font-size:150%;margin-right:5%}#dash #content.layout-4>div .value-and-unit{display:flex}#dash #content.layout-4>div .value-and-unit .value-int{font-size:250%}#dash #content.layout-4>div .value-and-unit .value-dec,#dash #content.layout-4>div .value-and-unit .unit{font-size:130%;margin-top:auto;margin-bottom:7%}#dash #content.layout-4>div .value-and-unit .value-dec{margin-left:2%}#dash #content.layout-4>div .value-and-unit .unit{margin-left:4%}#dash #content.layout-4>div .descr{margin-left:4%;text-align:left;font-size:80%;width:100%;min-width:max-content}#dash #content.layout-5>div,#dash #content.layout-7>div{display:flex}#dash #content.layout-5>div .icon,#dash #content.layout-7>div .icon{font-size:150%;margin:auto;margin-left:10%}#dash #content.layout-5>div .value,#dash #content.layout-7>div .value{font-size:200%}#dash #content.layout-5>div .descr,#dash #content.layout-7>div .descr{text-align:right;font-size:65%;width:100%;min-width:max-content}#dash #content.layout-6>div{display:flex;justify-content:space-between}#dash #content.layout-6>div .icon{font-size:150%;margin-right:10%}#dash #content.layout-6>div .value{font-size:220%;text-align:right}#dash #content.layout-6>div .descr{font-size:80%;text-align:right;width:100%;min-width:max-content}#dash #content.layout-8>div{display:flex;align-items:center}#dash #content.layout-8>div .icon{margin-right:4%;font-size:75%}#dash #content.layout-8>div .value{margin:0 10%;font-size:250%}#dash #content.layout-8>div .descr{font-size:60%;text-align:left}",function(t){t.columns="The number of columns displayed by the grid, the default behavior is 12.",t.customStyle="Custom style of the component. For more information: https://ketchup.smeup.com/ketchup-showcase/#/customization",t.singleLine="When set to true, forces the content on a single line."}(g||(g={}));const p=class{constructor(n){t(this,n),this.kupManager=s(),this.columns=12,this.customStyle="",this.singleLine=!1}async getProps(t){return o(this,g,t)}async refresh(){e(this)}async setProps(t){d(this,g,t)}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){const t=this.rootElement.children;if(!t||0===t.length)return void this.kupManager.debug.logMessage(this,"Missing slots, not rendering!",r.WARNING);const n=[];for(let a=0;a<t.length;a++){let e=null;if(this.singleLine)e=i("slot",{name:`${a}`});else{const n=t[a].span||t[a].getAttribute("span")||1;e=i("div",{class:`layout-grid__cell layout-grid__cell--span-${n}`},i("slot",{name:`${a}`}))}n.push(e)}const a={};return this.columns&&12!==this.columns&&(a["--kup_grid_columns"]=this.columns),i(l,{style:a},i("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),i("div",{id:c},i("div",{class:this.singleLine?"flex-layout":"layout-grid"},i("div",{class:this.singleLine?"flex-layout__inner":"layout-grid__inner"},n))))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return a(this)}};p.style=":host{--kup_grid_font_size:var(--kup-grid-font-size, var(--kup-font-size));--kup_grid_gap:var(--kup-grid-gap, 24px);--kup_grid_gap_mobile:var(--kup-grid-gap-mobile, 16px);--kup_grid_padding:var(--kup-grid-padding, 24px);font-size:var(--kup_grid_font_size);height:100%;width:100%}#kup-component{height:100%;width:100%}.layout-grid{box-sizing:border-box;margin:0px auto;padding:var(--kup_grid_padding)}.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap);grid-template-columns:repeat(var(--kup_grid_columns, 12), minmax(0px, 1fr))}.layout-grid .layout-grid__inner .layout-grid__cell{box-sizing:border-box;display:flex;justify-content:center;margin:0px;width:auto}.layout-grid__cell--span-1{grid-column-end:span 1}.layout-grid__cell--span-2{grid-column-end:span 2}.layout-grid__cell--span-3{grid-column-end:span 3}.layout-grid__cell--span-4{grid-column-end:span 4}.layout-grid__cell--span-5{grid-column-end:span 5}.layout-grid__cell--span-6{grid-column-end:span 6}.layout-grid__cell--span-7{grid-column-end:span 7}.layout-grid__cell--span-8{grid-column-end:span 8}.layout-grid__cell--span-9{grid-column-end:span 9}.layout-grid__cell--span-10{grid-column-end:span 10}.layout-grid__cell--span-11{grid-column-end:span 11}.layout-grid__cell--span-12{grid-column-end:span 12}.layout-grid__cell--span-13{grid-column-end:span 13}.layout-grid__cell--span-14{grid-column-end:span 14}.layout-grid__cell--span-15{grid-column-end:span 15}.layout-grid__cell--span-16{grid-column-end:span 16}.layout-grid__cell--span-17{grid-column-end:span 17}.layout-grid__cell--span-18{grid-column-end:span 18}.layout-grid__cell--span-19{grid-column-end:span 19}.layout-grid__cell--span-20{grid-column-end:span 20}.layout-grid__cell--span-21{grid-column-end:span 21}.layout-grid__cell--span-22{grid-column-end:span 22}.layout-grid__cell--span-23{grid-column-end:span 23}.layout-grid__cell--span-24{grid-column-end:span 24}.flex-layout,.flex-layout__inner{height:100%;align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap}.flex-layout__inner{width:auto}.flex-layout__inner *{display:block;margin:0 1.5em}.flex-layout__inner .flex-layout__cell{display:flex}.flex-layout__inner .flex-layout__cell *{justify-content:center;margin:auto}@media (min-width: 600px) and (max-width: 839px){.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap_mobile);grid-template-columns:repeat(var(--kup_grid_columns, 8), minmax(0px, 1fr))}}@media (max-width: 599px){.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap_mobile);grid-template-columns:repeat(var(--kup_grid_columns, 4), minmax(0px, 1fr))}}:host(.kup-full-width) .flex-layout__inner{width:100%}:host(.kup-full-width) .flex-layout__inner *{margin:auto}";export{u as kup_dash,p as kup_grid}