@sme.up/ketchup 11.0.0-SNAPSHOT-20250702141013 → 11.0.0-SNAPSHOT-20250708094620

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 (182) hide show
  1. package/dist/cjs/{f-cell-baef09a6.js → f-cell-a758df16.js} +5 -5
  2. package/dist/cjs/{f-chip-603198eb.js → f-chip-b4aebf7c.js} +1 -1
  3. package/dist/cjs/{f-object-field-27e696cb.js → f-object-field-ea23cc62.js} +2 -2
  4. package/dist/cjs/{f-paginator-utils-f08e7ccf.js → f-paginator-utils-54bc1b31.js} +1 -1
  5. package/dist/cjs/{f-text-field-8d7447d7.js → f-text-field-4944c78e.js} +1 -1
  6. package/dist/cjs/index.cjs.js +1 -1
  7. package/dist/cjs/kup-accordion.cjs.entry.js +1 -1
  8. package/dist/cjs/kup-activity-timeline.cjs.entry.js +2 -2
  9. package/dist/cjs/kup-autocomplete_30.cjs.entry.js +7 -7
  10. package/dist/cjs/kup-box.cjs.entry.js +7 -7
  11. package/dist/cjs/kup-calendar.cjs.entry.js +7 -4
  12. package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
  13. package/dist/cjs/kup-cell.cjs.entry.js +5 -5
  14. package/dist/cjs/kup-dashboard.cjs.entry.js +2 -2
  15. package/dist/cjs/{kup-data-table-helper-5098a78a.js → kup-data-table-helper-72dc3004.js} +3 -3
  16. package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
  17. package/dist/cjs/kup-echart.cjs.entry.js +1 -1
  18. package/dist/cjs/kup-editor.cjs.entry.js +1 -1
  19. package/dist/cjs/kup-family-tree.cjs.entry.js +1 -1
  20. package/dist/cjs/kup-grid.cjs.entry.js +1 -1
  21. package/dist/cjs/kup-htm.cjs.entry.js +1 -1
  22. package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
  23. package/dist/cjs/kup-input-panel.cjs.entry.js +58 -46
  24. package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
  25. package/dist/cjs/kup-magic-box.cjs.entry.js +1 -1
  26. package/dist/cjs/{kup-manager-349211bf.js → kup-manager-bb0a1490.js} +3 -8
  27. package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
  28. package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
  29. package/dist/cjs/kup-object-field.cjs.entry.js +3 -3
  30. package/dist/cjs/kup-pdf.cjs.entry.js +1 -1
  31. package/dist/cjs/kup-planner.cjs.entry.js +2 -2
  32. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  33. package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
  34. package/dist/cjs/kup-snackbar.cjs.entry.js +1 -1
  35. package/dist/cjs/kup-txt.cjs.entry.js +1 -1
  36. package/dist/cjs/kup-typography-list.cjs.entry.js +1 -1
  37. package/dist/cjs/kup-typography.cjs.entry.js +1 -1
  38. package/dist/collection/components/kup-input-panel/kup-input-panel.js +52 -40
  39. package/dist/collection/utils/cell-utils.js +2 -7
  40. package/dist/components/index.js +1 -1
  41. package/dist/components/kup-accordion.js +2 -2
  42. package/dist/components/kup-activity-timeline.js +2 -2
  43. package/dist/components/kup-autocomplete.js +1 -1
  44. package/dist/components/kup-badge.js +1 -1
  45. package/dist/components/kup-box.js +1 -1
  46. package/dist/components/kup-button-list.js +1 -1
  47. package/dist/components/kup-button.js +1 -1
  48. package/dist/components/kup-calendar.js +7 -4
  49. package/dist/components/kup-card-list.js +3 -3
  50. package/dist/components/kup-card.js +1 -1
  51. package/dist/components/kup-cell.js +2 -2
  52. package/dist/components/kup-chart.js +1 -1
  53. package/dist/components/kup-checkbox.js +1 -1
  54. package/dist/components/kup-chip.js +1 -1
  55. package/dist/components/kup-color-picker.js +1 -1
  56. package/dist/components/kup-combobox.js +1 -1
  57. package/dist/components/kup-dashboard.js +2 -2
  58. package/dist/components/kup-data-table.js +1 -1
  59. package/dist/components/kup-date-picker.js +1 -1
  60. package/dist/components/kup-dialog.js +1 -1
  61. package/dist/components/kup-drawer.js +2 -2
  62. package/dist/components/kup-dropdown-button.js +1 -1
  63. package/dist/components/kup-echart.js +1 -1
  64. package/dist/components/kup-editor.js +1 -1
  65. package/dist/components/kup-family-tree.js +3 -3
  66. package/dist/components/kup-file-upload.js +1 -1
  67. package/dist/components/kup-form.js +1 -1
  68. package/dist/components/kup-gauge.js +1 -1
  69. package/dist/components/kup-grid.js +1 -1
  70. package/dist/components/kup-htm.js +2 -2
  71. package/dist/components/kup-iframe.js +2 -2
  72. package/dist/components/kup-image-list.js +1 -1
  73. package/dist/components/kup-image.js +1 -1
  74. package/dist/components/kup-input-panel.js +56 -44
  75. package/dist/components/kup-lazy.js +2 -2
  76. package/dist/components/kup-list.js +1 -1
  77. package/dist/components/kup-magic-box.js +4 -4
  78. package/dist/components/kup-nav-bar.js +2 -2
  79. package/dist/components/kup-numeric-picker.js +2 -2
  80. package/dist/components/kup-object-field.js +2 -2
  81. package/dist/components/kup-pdf.js +2 -2
  82. package/dist/components/kup-planner.js +2 -2
  83. package/dist/components/kup-probe.js +2 -2
  84. package/dist/components/kup-progress-bar.js +1 -1
  85. package/dist/components/kup-qlik.js +2 -2
  86. package/dist/components/kup-radio.js +1 -1
  87. package/dist/components/kup-rating.js +1 -1
  88. package/dist/components/kup-snackbar.js +2 -2
  89. package/dist/components/kup-spinner.js +1 -1
  90. package/dist/components/kup-switch.js +1 -1
  91. package/dist/components/kup-tab-bar.js +1 -1
  92. package/dist/components/kup-text-field.js +1 -1
  93. package/dist/components/kup-time-picker.js +1 -1
  94. package/dist/components/kup-toolbar.js +1 -1
  95. package/dist/components/kup-tree.js +1 -1
  96. package/dist/components/kup-txt.js +2 -2
  97. package/dist/components/kup-typography-list.js +2 -2
  98. package/dist/components/kup-typography.js +2 -2
  99. package/dist/components/{p-58f4c115.js → p-2478ac88.js} +4 -4
  100. package/dist/components/{p-ba618b1a.js → p-4941442e.js} +2 -2
  101. package/dist/components/{p-560ac835.js → p-5da90ea6.js} +2 -2
  102. package/dist/components/{p-1af909c1.js → p-8b4b2ec7.js} +2 -2
  103. package/dist/components/{p-19c3302b.js → p-970526a0.js} +3 -8
  104. package/dist/components/{p-56cafcf6.js → p-c0a989f4.js} +2 -2
  105. package/dist/esm/{f-cell-63ec90a4.js → f-cell-eb150cfc.js} +5 -5
  106. package/dist/esm/{f-chip-33274c8f.js → f-chip-28fde4c9.js} +1 -1
  107. package/dist/esm/{f-object-field-582c5c14.js → f-object-field-3bd73466.js} +2 -2
  108. package/dist/esm/{f-paginator-utils-567e55d2.js → f-paginator-utils-3e2a0dcd.js} +1 -1
  109. package/dist/esm/{f-text-field-c13c5f52.js → f-text-field-5b392d9b.js} +1 -1
  110. package/dist/esm/index.js +1 -1
  111. package/dist/esm/kup-accordion.entry.js +1 -1
  112. package/dist/esm/kup-activity-timeline.entry.js +2 -2
  113. package/dist/esm/kup-autocomplete_30.entry.js +7 -7
  114. package/dist/esm/kup-box.entry.js +7 -7
  115. package/dist/esm/kup-calendar.entry.js +7 -4
  116. package/dist/esm/kup-card-list.entry.js +1 -1
  117. package/dist/esm/kup-cell.entry.js +5 -5
  118. package/dist/esm/kup-dashboard.entry.js +2 -2
  119. package/dist/esm/{kup-data-table-helper-25906f4e.js → kup-data-table-helper-edbee21a.js} +3 -3
  120. package/dist/esm/kup-drawer.entry.js +1 -1
  121. package/dist/esm/kup-echart.entry.js +1 -1
  122. package/dist/esm/kup-editor.entry.js +1 -1
  123. package/dist/esm/kup-family-tree.entry.js +1 -1
  124. package/dist/esm/kup-grid.entry.js +1 -1
  125. package/dist/esm/kup-htm.entry.js +1 -1
  126. package/dist/esm/kup-iframe.entry.js +1 -1
  127. package/dist/esm/kup-input-panel.entry.js +58 -46
  128. package/dist/esm/kup-lazy.entry.js +1 -1
  129. package/dist/esm/kup-magic-box.entry.js +1 -1
  130. package/dist/esm/{kup-manager-3aede06e.js → kup-manager-7acd779a.js} +3 -8
  131. package/dist/esm/kup-nav-bar.entry.js +1 -1
  132. package/dist/esm/kup-numeric-picker.entry.js +2 -2
  133. package/dist/esm/kup-object-field.entry.js +3 -3
  134. package/dist/esm/kup-pdf.entry.js +1 -1
  135. package/dist/esm/kup-planner.entry.js +2 -2
  136. package/dist/esm/kup-probe.entry.js +1 -1
  137. package/dist/esm/kup-qlik.entry.js +1 -1
  138. package/dist/esm/kup-snackbar.entry.js +1 -1
  139. package/dist/esm/kup-txt.entry.js +1 -1
  140. package/dist/esm/kup-typography-list.entry.js +1 -1
  141. package/dist/esm/kup-typography.entry.js +1 -1
  142. package/dist/ketchup/index.esm.js +1 -1
  143. package/dist/ketchup/ketchup.esm.js +1 -1
  144. package/dist/ketchup/{p-c23f1c86.entry.js → p-0f3e905b.entry.js} +1 -1
  145. package/dist/ketchup/{p-7a8e9e06.entry.js → p-0fed93b6.entry.js} +1 -1
  146. package/dist/ketchup/{p-d247771a.entry.js → p-1c8827c5.entry.js} +1 -1
  147. package/dist/ketchup/{p-ce3de714.js → p-216b5deb.js} +1 -1
  148. package/dist/ketchup/{p-ee458f85.entry.js → p-2a760a0e.entry.js} +1 -1
  149. package/dist/ketchup/{p-bc3217f8.entry.js → p-35597a9e.entry.js} +1 -1
  150. package/dist/ketchup/{p-d952cc39.entry.js → p-4518f1bb.entry.js} +1 -1
  151. package/dist/ketchup/{p-61205f5d.entry.js → p-47e29dc4.entry.js} +1 -1
  152. package/dist/ketchup/{p-d5a9ae60.entry.js → p-4e8d34ad.entry.js} +1 -1
  153. package/dist/ketchup/{p-45495c9b.js → p-52314ee2.js} +1 -1
  154. package/dist/ketchup/{p-e92ec1cb.entry.js → p-58d2a18c.entry.js} +1 -1
  155. package/dist/ketchup/{p-8d788064.entry.js → p-59ef4c6d.entry.js} +1 -1
  156. package/dist/ketchup/{p-9032f098.entry.js → p-5f418d60.entry.js} +1 -1
  157. package/dist/ketchup/{p-da7a61dc.entry.js → p-60c3a948.entry.js} +1 -1
  158. package/dist/ketchup/{p-fb9abc5f.entry.js → p-637150e5.entry.js} +1 -1
  159. package/dist/ketchup/{p-8a108d52.js → p-84a053a8.js} +1 -1
  160. package/dist/ketchup/p-98dc3168.entry.js +1 -0
  161. package/dist/ketchup/{p-2f7f630f.entry.js → p-9c5d2818.entry.js} +1 -1
  162. package/dist/ketchup/{p-8b1fd380.entry.js → p-9dd436ae.entry.js} +1 -1
  163. package/dist/ketchup/{p-1f3d3baa.js → p-9e610c11.js} +1 -1
  164. package/dist/ketchup/{p-b40cde24.js → p-9ffccc52.js} +1 -1
  165. package/dist/ketchup/{p-f304a1e0.entry.js → p-a802f5c5.entry.js} +1 -1
  166. package/dist/ketchup/{p-ce149297.entry.js → p-a8d14eee.entry.js} +1 -1
  167. package/dist/ketchup/{p-26a2b8ee.entry.js → p-c149961e.entry.js} +1 -1
  168. package/dist/ketchup/{p-71f154b3.js → p-c38d19f9.js} +1 -1
  169. package/dist/ketchup/{p-107b75b5.entry.js → p-cdf00a54.entry.js} +1 -1
  170. package/dist/ketchup/{p-4238addc.entry.js → p-d9eca005.entry.js} +1 -1
  171. package/dist/ketchup/{p-8b10e446.entry.js → p-dacc25e0.entry.js} +1 -1
  172. package/dist/ketchup/{p-2c5520f3.entry.js → p-dc52b02d.entry.js} +1 -1
  173. package/dist/ketchup/{p-5d96e8db.entry.js → p-e0b948bf.entry.js} +1 -1
  174. package/dist/ketchup/{p-53beb11a.js → p-e3098793.js} +1 -1
  175. package/dist/ketchup/{p-d6db0530.entry.js → p-e65ca213.entry.js} +1 -1
  176. package/dist/ketchup/{p-efaf71f4.entry.js → p-e7c457c4.entry.js} +1 -1
  177. package/dist/ketchup/{p-f3f5e6b2.entry.js → p-ebcf33a3.entry.js} +1 -1
  178. package/dist/ketchup/{p-aa30c9f1.entry.js → p-f1460083.entry.js} +1 -1
  179. package/dist/ketchup/{p-3dc483a6.entry.js → p-f19b0523.entry.js} +1 -1
  180. package/dist/types/utils/cell-utils.d.ts +3 -1
  181. package/package.json +4 -1
  182. package/dist/ketchup/p-b726490c.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as t,f as i,h as e,H as a,d as o}from"./p-710d0a7d.js";import{k as s,g as n,s as l,b as p,h,aE as c,W as r,aF as f,_ as u,f as d}from"./p-8a108d52.js";import{a as g}from"./p-e3062c19.js";import{F as b}from"./p-3cab6420.js";import{c as m}from"./p-635bb4b3.js";import"./p-cabebabc.js";var k,x;!function(t){t.customStyle="Custom style of the component.",t.data="Sets the data that will be used to display different components."}(k||(k={})),function(t){t.BOX="Box",t.BUTTON_LIST="Button List",t.CHART="Chart",t.CHIP="Chip",t.ECHART="Echart",t.DATATABLE="Datatable",t.JSON="JSON",t.TREE="Tree"}(x||(x={}));const y=class{constructor(i){t(this,i),this.dragHandler=null,this.kupManager=s(),this.textArea=null,this.wrapperRef=null,this.display=x.DATATABLE,this.customStyle="",this.data=null}async getProps(t){return n(this,k,t)}async refresh(){i(this)}async setProps(t){l(this,k,t)}comboboxProps(){const t=[];for(const i in x)Object.prototype.hasOwnProperty.call(x,i)&&t.push({id:x[i],selected:!1,value:x[i]});return{data:{"kup-list":{data:t,id:"kup-debug-theme-changer-list"},"kup-text-field":{emitSubmitEventOnEnter:!1,inputType:"text",label:this.kupManager.language.translate(p.VIEW_AS)}},id:"comp-switcher",initialValue:this.display,isSelect:!0,"onKup-combobox-itemclick":t=>{this.display=t.detail.value}}}setContent(){const t=!!(this.data&&this.data.columns&&this.data.columns.length>0),i=[],a={};if(this.display===x.JSON)a.initialValue=this.data?JSON.stringify(this.data,null,2):"",a.textArea=!0,i.push(e("kup-text-field",Object.assign({class:"kup-full-width kup-full-height"},a,{ref:t=>this.textArea=t,"onkup-textfield-input":t=>{try{this.data=JSON.parse(t.detail.value)}catch(t){this.data={columns:[{name:"ERROR",title:"Error"}],rows:[{cells:{ERROR:{value:"Invalid JSON:"+t}}}]}}}})));else if(t)switch(this.display){case x.BOX:a.data=this.data,i.push(e("kup-box",Object.assign({},a)));break;case x.BUTTON_LIST:a.data=this.data,i.push(e("kup-button-list",Object.assign({},a)));break;case x.CHIP:a.data=this.data,i.push(e("kup-chip",Object.assign({},a)));break;case x.CHART:case x.ECHART:a.data=this.data,a.series=[],a.axis=null;for(let t=0;t<this.data.columns.length;t++){const i=this.data.columns[t];i.obj&&this.kupManager.objects.isNumber(i.obj)||null!==a.axis?a.series.push(this.display===x.CHART?{code:i.name,decode:i.title}:i.name):a.axis=i.name}0===a.series.length&&this.kupManager.debug.logMessage(this,"Not enough numerical columns to display a chart!",h.WARNING),a.axis||this.kupManager.debug.logMessage(this,"No axis for the chart!",h.WARNING),i.push(e(this.display===x.CHART?"kup-chart":"kup-echart",Object.assign({},a)));break;case x.DATATABLE:a.data=this.data,a.autoFillMissingCells=!0,i.push(e("kup-data-table",Object.assign({},a)));break;case x.TREE:a.data=this.data,i.push(e("kup-tree",Object.assign({class:"kup-full-width"},a)));break;default:return void this.kupManager.debug.logMessage(this,"Display mode not supported ("+this.display+")!",h.ERROR)}else i.push(e("div",{class:"empty"},e(b,{sizeY:"100px",resource:"move_to_inbox"}),e("div",{class:"empty-text"},this.kupManager.language.translate(p.DROP_YOUR_DATA))));return i}updateData(t){{const i=Object.assign({},this.data),e=t.detail.sourceElement&&t.detail.sourceElement.column?t.detail.sourceElement.column:null,a=t.detail.sourceElement&&t.detail.sourceElement.row?t.detail.sourceElement.row:null;if(e&&e.name?i.columns?this.data.columns.find((t=>t.name===e.name))||i.columns.push(e):i.columns=[e]:this.kupManager.debug.logMessage(this,"Invalid column received.",h.WARNING),a&&(i.rows?i.rows.push(a):i.rows=[a]),this.data=i,this.data&&this.textArea)try{this.textArea.setValue(JSON.stringify(this.data,null,2))}catch(t){this.textArea.setValue("Invalid JSON:"+t)}}}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.rootElement.addEventListener(c,(t=>this.updateData(t))),this.dragHandler=this.rootElement.shadowRoot.querySelector("#drag-handle"),this.kupManager.interact.dialogify(this.rootElement,this.dragHandler),this.kupManager.interact.dropzone(this.wrapperRef,{accept:`[${r}],[${f}]`},{dispatcher:this.rootElement,type:u.MAGICBOX}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){return e(a,{key:"a0c199ad880dd177c107d9b1a33388b8d0ae2c6c"},e("style",{key:"eaff8539d9aeb37b3b003f2852e5d28fcf734052"},this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{key:"addc89f4cd50f715f5628fdcd61350b9f961354b",id:m},e("div",{key:"16505c7a35947989698e9db6d9b98fcf689a328d",class:"magic-box-wrapper"},e("div",{key:"43d2fc22365fa07262bfce52251feae255a7c202",class:"actions",id:"drag-handle"},e("kup-combobox",Object.assign({key:"3455082ee9ab7ada5de432bb543580aed51c839a"},this.comboboxProps())),e("kup-button",{key:"5e54823bcf9549b13a20e02fbb7413e8f306e5d7",styling:g.FLAT,icon:"delete",label:"Reset","onkup-button-click":()=>{this.data=null}}),e("kup-button",{key:"c87f7803a5498a2a0e2b75eac939f963d357bf06",id:"close-dialog",customStyle:`:host{${d.PRIMARY}: var(${d.TITLE});}`,icon:"clear","onkup-button-click":()=>{this.kupManager.hideMagicBox()}})),e("div",{key:"53351f0e597decdaba1b6c9431099f4768f8259c",class:"content",ref:t=>this.wrapperRef=t},this.setContent()))))}disconnectedCallback(){this.kupManager.interact.unregister([this.rootElement,this.wrapperRef]),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return o(this)}};y.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{background-color:var(--kup-background-color);color:var(--kup-text-color);display:block;height:300px;min-width:700px;width:700px}#kup-component,.magic-box-wrapper{height:100%;width:100%}.magic-box-wrapper{border:3px dashed var(--kup-border-subtle);box-sizing:border-box;display:flex;flex-direction:column}.actions{align-items:center;background-color:var(--kup-title-background-color);display:inline-flex;height:52px;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1}.actions kup-button{margin:0.5em}.actions #comp-switcher{margin:auto 0}.actions #close-dialog{position:absolute;margin:0;top:0;right:0;background-color:var(--kup-title-background-color)}.content{box-sizing:border-box;height:100%;margin-top:52px;overflow:auto;transition:background-color 125ms ease}.empty{flex-direction:column;display:flex;text-align:center;justify-content:center;height:100%;width:100%;opacity:0.5;transition:opacity 0.25s ease-out}.empty .f-image{margin:0}.json{font-family:var(--kup-font-family-monospace);margin:0}[kup-drag-over]{background-color:rgba(var(--kup-success-color-rgb), 0.25)}";export{y as kup_magic_box}
1
+ import{r as t,f as i,h as e,H as a,d as o}from"./p-710d0a7d.js";import{k as s,g as n,s as l,b as p,h,aE as c,W as r,aF as f,_ as u,f as d}from"./p-84a053a8.js";import{a as g}from"./p-e3062c19.js";import{F as b}from"./p-3cab6420.js";import{c as m}from"./p-635bb4b3.js";import"./p-cabebabc.js";var k,x;!function(t){t.customStyle="Custom style of the component.",t.data="Sets the data that will be used to display different components."}(k||(k={})),function(t){t.BOX="Box",t.BUTTON_LIST="Button List",t.CHART="Chart",t.CHIP="Chip",t.ECHART="Echart",t.DATATABLE="Datatable",t.JSON="JSON",t.TREE="Tree"}(x||(x={}));const y=class{constructor(i){t(this,i),this.dragHandler=null,this.kupManager=s(),this.textArea=null,this.wrapperRef=null,this.display=x.DATATABLE,this.customStyle="",this.data=null}async getProps(t){return n(this,k,t)}async refresh(){i(this)}async setProps(t){l(this,k,t)}comboboxProps(){const t=[];for(const i in x)Object.prototype.hasOwnProperty.call(x,i)&&t.push({id:x[i],selected:!1,value:x[i]});return{data:{"kup-list":{data:t,id:"kup-debug-theme-changer-list"},"kup-text-field":{emitSubmitEventOnEnter:!1,inputType:"text",label:this.kupManager.language.translate(p.VIEW_AS)}},id:"comp-switcher",initialValue:this.display,isSelect:!0,"onKup-combobox-itemclick":t=>{this.display=t.detail.value}}}setContent(){const t=!!(this.data&&this.data.columns&&this.data.columns.length>0),i=[],a={};if(this.display===x.JSON)a.initialValue=this.data?JSON.stringify(this.data,null,2):"",a.textArea=!0,i.push(e("kup-text-field",Object.assign({class:"kup-full-width kup-full-height"},a,{ref:t=>this.textArea=t,"onkup-textfield-input":t=>{try{this.data=JSON.parse(t.detail.value)}catch(t){this.data={columns:[{name:"ERROR",title:"Error"}],rows:[{cells:{ERROR:{value:"Invalid JSON:"+t}}}]}}}})));else if(t)switch(this.display){case x.BOX:a.data=this.data,i.push(e("kup-box",Object.assign({},a)));break;case x.BUTTON_LIST:a.data=this.data,i.push(e("kup-button-list",Object.assign({},a)));break;case x.CHIP:a.data=this.data,i.push(e("kup-chip",Object.assign({},a)));break;case x.CHART:case x.ECHART:a.data=this.data,a.series=[],a.axis=null;for(let t=0;t<this.data.columns.length;t++){const i=this.data.columns[t];i.obj&&this.kupManager.objects.isNumber(i.obj)||null!==a.axis?a.series.push(this.display===x.CHART?{code:i.name,decode:i.title}:i.name):a.axis=i.name}0===a.series.length&&this.kupManager.debug.logMessage(this,"Not enough numerical columns to display a chart!",h.WARNING),a.axis||this.kupManager.debug.logMessage(this,"No axis for the chart!",h.WARNING),i.push(e(this.display===x.CHART?"kup-chart":"kup-echart",Object.assign({},a)));break;case x.DATATABLE:a.data=this.data,a.autoFillMissingCells=!0,i.push(e("kup-data-table",Object.assign({},a)));break;case x.TREE:a.data=this.data,i.push(e("kup-tree",Object.assign({class:"kup-full-width"},a)));break;default:return void this.kupManager.debug.logMessage(this,"Display mode not supported ("+this.display+")!",h.ERROR)}else i.push(e("div",{class:"empty"},e(b,{sizeY:"100px",resource:"move_to_inbox"}),e("div",{class:"empty-text"},this.kupManager.language.translate(p.DROP_YOUR_DATA))));return i}updateData(t){{const i=Object.assign({},this.data),e=t.detail.sourceElement&&t.detail.sourceElement.column?t.detail.sourceElement.column:null,a=t.detail.sourceElement&&t.detail.sourceElement.row?t.detail.sourceElement.row:null;if(e&&e.name?i.columns?this.data.columns.find((t=>t.name===e.name))||i.columns.push(e):i.columns=[e]:this.kupManager.debug.logMessage(this,"Invalid column received.",h.WARNING),a&&(i.rows?i.rows.push(a):i.rows=[a]),this.data=i,this.data&&this.textArea)try{this.textArea.setValue(JSON.stringify(this.data,null,2))}catch(t){this.textArea.setValue("Invalid JSON:"+t)}}}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.rootElement.addEventListener(c,(t=>this.updateData(t))),this.dragHandler=this.rootElement.shadowRoot.querySelector("#drag-handle"),this.kupManager.interact.dialogify(this.rootElement,this.dragHandler),this.kupManager.interact.dropzone(this.wrapperRef,{accept:`[${r}],[${f}]`},{dispatcher:this.rootElement,type:u.MAGICBOX}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){return e(a,{key:"a0c199ad880dd177c107d9b1a33388b8d0ae2c6c"},e("style",{key:"eaff8539d9aeb37b3b003f2852e5d28fcf734052"},this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{key:"addc89f4cd50f715f5628fdcd61350b9f961354b",id:m},e("div",{key:"16505c7a35947989698e9db6d9b98fcf689a328d",class:"magic-box-wrapper"},e("div",{key:"43d2fc22365fa07262bfce52251feae255a7c202",class:"actions",id:"drag-handle"},e("kup-combobox",Object.assign({key:"3455082ee9ab7ada5de432bb543580aed51c839a"},this.comboboxProps())),e("kup-button",{key:"5e54823bcf9549b13a20e02fbb7413e8f306e5d7",styling:g.FLAT,icon:"delete",label:"Reset","onkup-button-click":()=>{this.data=null}}),e("kup-button",{key:"c87f7803a5498a2a0e2b75eac939f963d357bf06",id:"close-dialog",customStyle:`:host{${d.PRIMARY}: var(${d.TITLE});}`,icon:"clear","onkup-button-click":()=>{this.kupManager.hideMagicBox()}})),e("div",{key:"53351f0e597decdaba1b6c9431099f4768f8259c",class:"content",ref:t=>this.wrapperRef=t},this.setContent()))))}disconnectedCallback(){this.kupManager.interact.unregister([this.rootElement,this.wrapperRef]),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return o(this)}};y.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{background-color:var(--kup-background-color);color:var(--kup-text-color);display:block;height:300px;min-width:700px;width:700px}#kup-component,.magic-box-wrapper{height:100%;width:100%}.magic-box-wrapper{border:3px dashed var(--kup-border-subtle);box-sizing:border-box;display:flex;flex-direction:column}.actions{align-items:center;background-color:var(--kup-title-background-color);display:inline-flex;height:52px;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1}.actions kup-button{margin:0.5em}.actions #comp-switcher{margin:auto 0}.actions #close-dialog{position:absolute;margin:0;top:0;right:0;background-color:var(--kup-title-background-color)}.content{box-sizing:border-box;height:100%;margin-top:52px;overflow:auto;transition:background-color 125ms ease}.empty{flex-direction:column;display:flex;text-align:center;justify-content:center;height:100%;width:100%;opacity:0.5;transition:opacity 0.25s ease-out}.empty .f-image{margin:0}.json{font-family:var(--kup-font-family-monospace);margin:0}[kup-drag-over]{background-color:rgba(var(--kup-success-color-rgb), 0.25)}";export{y as kup_magic_box}
@@ -1 +1 @@
1
- import{E as e,H as t,D as n,ai as l,x as o,z as r,aj as i,ak as s,N as a,O as u,F as c,al as f,am as h,an as d,ao as b,ap as m,a8 as p}from"./p-8a108d52.js";import{K as v}from"./p-cabebabc.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,n){let l="";if(null==e)return l;let o=e[t];return null==o||(l=n?o.textFieldTmp:o.textField),l}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,n){if(!t)return!1;let l=this._getTextFilterValue(e,t.name,n);if(null!=l&&""!=l.trim())return!0;let o=this.getCheckBoxFilterValues(e,t.name);return!(null==o||o.length<1)}getCheckBoxFilterValues(e={},t){let n=[];if(null==e)return n;let l=e[t];return null==l||null==l.checkBoxes||(n=l.checkBoxes),n}addCheckboxFilter(t={},n,l){if(null==t)return;let o=t[n];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},t[n]=o),null==o.checkBoxes&&(o.checkBoxes=[]),null==l||null==l.value?o.checkBoxes=[]:e.valuesArrayContainsValue(o.checkBoxes,l.value)||(o.checkBoxes[o.checkBoxes.length]=l)}removeCheckboxFilter(e={},t,n){var l;if(!e||null==n||!e[t])return;const o=e[t];o.checkBoxes=null!==(l=o.checkBoxes)&&void 0!==l?l:[],o.checkBoxes=o.checkBoxes.filter((e=>e.value!==n)),0===o.checkBoxes.length&&delete e[t]}isColumnNumeric(e){return this.isObjNumeric(e.obj)}setTextFieldFilterValue(e={},t,n){this._setTextFieldFilterValue(e,t,n,!0)}_setTextFieldFilterValue(e={},t,n,l){if(null==e)return;let o=e[t];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},e[t]=o),l?o.textFieldTmp=null!=n?n.trim():n:o.textField=null!=n?n.trim():n}saveTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValueTmp(e,t),!1)}resetTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValue(e,t),!0)}getFilterValueForTooltip(e={},l){let o=this.getTextFilterValue(e,l.name),r=this.getCheckBoxFilterValues(e,l.name),i="",s=t(o,l.obj,l.decimals);""!=o&&(i=" AND "),i="";let a="";return r.forEach((e=>{a+=i+n(e,l),i=" OR "})),""!=a&&(a="("+a+")",""!=s&&(a=" AND "+a)),a=s+a,a}removeFilter(e={},t){delete e[t]}}var F;!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.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.removableColumns="Sets the possibility to remove the selected 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."}(F||(F={}));const x="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const j=document.documentElement,k=j.ketchup?j.ketchup.objects:new r,O=j.ketchup?j.ketchup.data:new i;class y extends e{isFilterCompliantForCell(e,t,n){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,n)}isFilterCompliantForCellObj(e,t,n){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,n)}isRowCompliant(e,t={},n="",l=!1,o=[],r,i){return this.areCellsCompliant(e.cells,t,n,l,o,r,i)}areCellsCompliant(e,t={},n="",r=!1,i=[],s,a){if(r){let t=!0;if(i&&null!=i&&i.length>0){t=!1;let o=this.filterIsNegative(n);for(let s=0;s<i.length;s++){if(!1===i[s].visible&&!a||(null==a?void 0:a.length)>0&&!a.includes(i[s].name))continue;const u=e[i[s].name];if(null==u)continue;t=this.isFilterCompliantForValue(u.value,n,r);let c=l(i[s],u);if(c!=u.value&&(t=t||this.isFilterCompliantForValue(c,n,r)),1==t&&!o)break;if(0==t&&o)break}}if(!t)return!1}return null==s&&(s=new w),!this.hasFilters(t,i,s)||Object.keys(t).every((n=>{const l=e[n],r=o(i,n);if(!l)return!1;let a=s.getTextFilterValue(t,n),u=s.getCheckBoxFilterValues(t,n);const c=this.filterIsNegative(a);let f=""!==a&&this.isFilterCompliantForCell(l,a,!0)||u.some((e=>this.isFilterCompliantForCell(l,e.value)))||u.some((e=>this.isFilterCompliantForCell(l,e.displayedValue)))||!s.hasFiltersForColumn(t,r),h=c;return k.isNumber(l.obj)||k.isDate(l.obj)||k.isTime(l.obj)||k.isTimestamp(l.obj)||(h=""!==a&&this.isFilterCompliantForCellObj(l,a,!0)||u.some((e=>this.isFilterCompliantForCellObj(l,e.value)))||!s.hasFiltersForColumn(t,r)),c?f&&h:f||h}))}hasFilters(e={},t,n){if(null==e)return!1;let l=Object.keys(e);if(null==l||l.length<1)return!1;null==n&&(n=new w);for(let r=0;r<l.length;r++){let i=l[r],s=null;if(s=i===x?{name:x,title:""}:o(t,i),n.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},n="",l=[],o,r){if(!e||null==e)return[];let i=[];const s=!(!n||!l);if(this.hasFilters(t,l,o)||s)for(let a=0;a<e.length;a++){let u=e[a];(u.id&&u.id.indexOf("insert_")>-1||this.isRowCompliant(u,t,n,s,l,o,r))&&(i[i.length]=u)}else i=[...e];return i}getColumnValues(n,l,o,r){let i=new Array;null==r&&(r=new w);let s=r.getTextFilterValueTmp(n.filters,l.name),a=r.getCheckBoxFilterValues(n.filters,l.name);if(null!=l.valuesForFilter&&l.valuesForFilter.length>0)return l.valuesForFilter.forEach((n=>{let o=n;(e.valuesArrayContainsValue(a,o)||""==s||r.isFilterCompliantForSimpleValue(o,l.obj,s))&&i.push({value:o,displayedValue:t(o,l.obj,l.decimals)})})),i;let u=Object.assign({},n.filters);u[l.name]={textField:s,textFieldTmp:s,checkBoxes:[]};let c=this.filterRows(n.getRows(),u,o,n.getVisibleColumns(),r);for(let e=0;e<a.length;e++)i.push(a[e]);return O.cell.getUnivocalValue({rows:c},l,!0)}}const T=document.documentElement;function C(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const n=e[0].group.column;let l=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let n of t)if(n.column===e)return n;return null}(n,t);return l||(l={column:n,sortMode:p.A}),e.sort(((e,t)=>s({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},l.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const n=t.length>1;return e.slice(0).sort(((e,l)=>{if(n){for(let n=0;n<t.length;n++){const o=V(e,l,t[n]);if(0!==o)return o}return 0}return V(e,l,t[0])}))}function V(e,t,n){const l=e.cells[n.column],o=t.cells[n.column];return l||o?l?o?s(l,o,n.sortMode):-1:1:0}function M(e=[],t={},n="",l=[],o,r,i){return null==r&&(r=new y),r.filterRows(e,t,n,l,o,i)}function N(e=[],t=[],n=[],r={}){if(!t)return[];if(!n||0===n.length||!e||0===e.length)return t;const i={},s=n.filter((({column:t})=>{for(let{name:n,title:l}of e)if(n===t)return i[n]=l,!0;return!1}));if(0===s.length)return t;const u=[];let c={};return t.forEach((t=>{const n=s[0].column,f=t.cells[n];if(f){const h=o(e,n),d=l(h,f),b=f.value;let m=null;for(let e of u)if(e.group.label===d){m=e;break}null===m&&(m={group:{id:b,parent:null,column:n,columnLabel:i[n],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},u.push(m));for(let n=1;n<s.length;n++){const r=s[n],a=t.cells[r.column];if(a){const t=o(e,r.column),n=l(t,a),s=a.value;let u=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===n){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:r.column,columnLabel:i[r.column],children:[],expanded:!1,label:n,totals:{},obj:a.obj}},L(u),m.group.children.push(u)),m=u}}m.group.children.push(t),function(e,t,n,l){if(!e||!t)return;const o=Object.keys(t);0!==o.length&&o.forEach((o=>{const r=n.cells[o];if(r){const n=T.ketchup.objects.isNumber(r.obj),i=t[o];switch(i){case a.COUNT:let t=e.group.totals[o]||0;e.group.totals[o]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[o]||0;s.group.totals[o]=++e,s=s.group.parent}break;case a.DISTINCT:let u;if(u=n?T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value)):r.value,l[e.group.id]){let t=l[e.group.id][o];t?t.push(u):(l[e.group.id][o]=[],l[e.group.id][o].push(u))}else l[e.group.id]={},l[e.group.id][o]=[],l[e.group.id][o].push(u);let c=e.group.parent;for(;null!=c;){if(l[c.group.id]){let e=l[c.group.id][o];e?e.push(u):(l[c.group.id][o]=[],l[c.group.id][o].push(u))}else l[c.group.id]={},l[c.group.id][o]=[],l[c.group.id][o].push(u);c=c.group.parent}break;case a.SUM:case a.AVERAGE:if(n&&r.value){const t=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t+(e.group.totals[o]||0);let n=e.group.parent;for(;null!=n;){const e=T.ketchup.math.numberify(n.group.totals[o]||0);n.group.totals[o]=t+e,n=n.group.parent}}break;case a.MIN:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.min(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.min(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;case a.MAX:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.max(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.max(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;default:0!=i.indexOf(a.MATH)&&console.warn(`invalid total mode: ${i}`)}}}))}(m,r,t,c)}})),function(e,t,n){if(!e||!t)return;const l=Object.keys(t);if(0===e.length||!e[0].group||0===l.length)return;let o=l.filter((e=>a.DISTINCT===t[e]));o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>D(e,o,n)))}(u,r,c),W(u,a.AVERAGE,r),W(u,a.MATH,r),u}function W(e,t,n){if(!e||!n)return;const l=Object.keys(n);if(0===e.length||!e[0].group||0===l.length)return;let o;t==a.AVERAGE&&(o=l.filter((e=>a.AVERAGE===n[e]))),t==a.MATH&&(o=l.filter((e=>0==n[e].indexOf(a.MATH)))),o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>E(e,t,o,n)))}function D(e,t,n){const l=e.group.children;0!==l.length&&(l[0].group&&l.forEach((e=>{D(e,t,n)})),t.forEach((t=>{e.group.totals[t]=new Set(n[e.group.id][t]).size})))}function E(e,t,n,l){const o=e.group.children;if(0===o.length)return 0;let r=0;return o[0].group?o.forEach((e=>{r+=E(e,t,n,l)})):r=o.length,n.forEach((n=>{if(t==a.AVERAGE&&(e.group.totals[n]=e.group.totals[n]/r),t==a.MATH){let t=l[n].substring(a.MATH.length);e.group.totals[n]=T.ketchup.math.formulas.custom(t,e.group.totals)}})),r}function A(e,t){if(t){const n=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const n=t.cells[e.name];n&&e.obj&&!n.obj&&(n.obj={t:e.obj.t,p:e.obj.p,k:n.value})}}))})),n}}function B(e,t,n){if(T.ketchup.objects.isEmptyJsObject(n)||T.ketchup.objects.isEmptyJsObject(e))return{};const l={},o=[],r=t.reduce(((t,r)=>{if(!e[r.name])return t;const i=e[r.name];return i===a.COUNT?(l[r.name]=n.length.toString(),t):0===i.indexOf(a.MATH)?(o.push([r.name,i]),t):(t.push({totalOperation:i,totalColumn:r,columnValues:n.map((e=>e.cells[r.name].value))}),t)}),[]);return r||o?(null==r||r.forEach((({totalOperation:e,totalColumn:t,columnValues:o})=>{if(T.ketchup.objects.isNumber(t.obj)){if(e===a.SUM)return void(l[t.name]=o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0).toString());if(e===a.AVERAGE)return void(l[t.name]=(o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0)/n.length).toString());if(e===a.MIN)return void(l[t.name]=Math.min(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString());if(e===a.MAX)return void(l[t.name]=Math.max(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString())}if(T.ketchup.objects.isDate(t.obj)){const n=o.filter((e=>T.ketchup.dates.isIsoDate(e))).map((e=>T.ketchup.dates.toDate(e,v.ISO_DATE)));if(!n)return;if(e===a.MIN)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE));if(e===a.MAX)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE))}e===a.DISTINCT&&(l[t.name]=new Set(o).size.toString())})),null==o||o.forEach((([e,t])=>{const n=null==t?void 0:t.replace(u(a.MATH,"g"),"");l[e]=T.ketchup.math.formulas.custom(n,function(e){var t;return Object.fromEntries(null===(t=Object.entries(e))||void 0===t?void 0:t.reduce(((e,[t,n])=>(T.ketchup.math.isNumber(n)&&e.push([t,Number(n)]),e)),[]))}(l)).toString()})),l):l}function L(e){if(!e.group)return;let t=e.group.id,n=e.group.parent;for(;null!==n;)t=`${n.group.id};${t}`,n=n.group.parent;e.group.id=t}function S(e,t,n,l){const o=t*n-n,r=o+Number(n);if(0==l)return e.slice(o,r);let i=[];return _(e,i,o,Number(n),0),i}function _(e,t,n,l,o){let r=!1;for(let i=0;i<e.length;i++){let s=e[i],a=R(e[i]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=_(s.group.children,a.group.children,n,l,o);o=e.ci,r=e.added,1==r&&(t[t.length]=a)}else o>=n&&(t[t.length]=a,r=!0),o++;if(o>=n+l)break}return{ci:o,added:r}}function R(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:I(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function z(e){if(null==e)return null;let t=[];for(let n=0;n<e.length;n++)t[t.length]=R(e[n]);return t}function I(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:z(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function $(e,t,n=!1){const l={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const o of t.rows){const t={cells:{},id:o.id};for(const n of l.columns){const l=n.name,r=o.cells[l],i=e.rows.find((e=>e.id===o.id)),s=i?i.cells[l]:null;(!s&&r.value||s&&r.value!==s.value)&&(t.cells[l]=r)}(Object.keys(t.cells).length>0||n)&&l.rows.push(t)}return l}function q(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var n;let l=e.cells[t];const o=l.value,r=l.decode,i=l.options;l.isEditable=null!==(n=l.isEditable)&&void 0!==n?n:l.editable;const s={[c.AUTOCOMPLETE]:()=>f(o,"",i),[c.COMBOBOX]:()=>f(o,"",i),[c.RADIO]:()=>h(o,i),[c.CHECKBOX]:()=>d(o,""),[c.CHIP]:()=>b(o,r),[c.SWITCH]:()=>m(o,""),[c.MULTI_AUTOCOMPLETE]:()=>b(o,r),[c.MULTI_COMBOBOX]:()=>b(o,r)}[l.shape];s&&(l.data=Object.assign(Object.assign({},s()),l.data))}))}))}export{w as F,g as K,y as a,N as b,B as c,q as d,F as e,M as f,$ as g,A as n,S as p,C as s,x as t}
1
+ import{E as e,H as t,D as n,ai as l,x as o,z as r,aj as i,ak as s,N as a,O as u,F as c,al as f,am as h,an as d,ao as b,ap as m,a8 as p}from"./p-84a053a8.js";import{K as v}from"./p-cabebabc.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,n){let l="";if(null==e)return l;let o=e[t];return null==o||(l=n?o.textFieldTmp:o.textField),l}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,n){if(!t)return!1;let l=this._getTextFilterValue(e,t.name,n);if(null!=l&&""!=l.trim())return!0;let o=this.getCheckBoxFilterValues(e,t.name);return!(null==o||o.length<1)}getCheckBoxFilterValues(e={},t){let n=[];if(null==e)return n;let l=e[t];return null==l||null==l.checkBoxes||(n=l.checkBoxes),n}addCheckboxFilter(t={},n,l){if(null==t)return;let o=t[n];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},t[n]=o),null==o.checkBoxes&&(o.checkBoxes=[]),null==l||null==l.value?o.checkBoxes=[]:e.valuesArrayContainsValue(o.checkBoxes,l.value)||(o.checkBoxes[o.checkBoxes.length]=l)}removeCheckboxFilter(e={},t,n){var l;if(!e||null==n||!e[t])return;const o=e[t];o.checkBoxes=null!==(l=o.checkBoxes)&&void 0!==l?l:[],o.checkBoxes=o.checkBoxes.filter((e=>e.value!==n)),0===o.checkBoxes.length&&delete e[t]}isColumnNumeric(e){return this.isObjNumeric(e.obj)}setTextFieldFilterValue(e={},t,n){this._setTextFieldFilterValue(e,t,n,!0)}_setTextFieldFilterValue(e={},t,n,l){if(null==e)return;let o=e[t];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},e[t]=o),l?o.textFieldTmp=null!=n?n.trim():n:o.textField=null!=n?n.trim():n}saveTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValueTmp(e,t),!1)}resetTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValue(e,t),!0)}getFilterValueForTooltip(e={},l){let o=this.getTextFilterValue(e,l.name),r=this.getCheckBoxFilterValues(e,l.name),i="",s=t(o,l.obj,l.decimals);""!=o&&(i=" AND "),i="";let a="";return r.forEach((e=>{a+=i+n(e,l),i=" OR "})),""!=a&&(a="("+a+")",""!=s&&(a=" AND "+a)),a=s+a,a}removeFilter(e={},t){delete e[t]}}var F;!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.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.removableColumns="Sets the possibility to remove the selected 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."}(F||(F={}));const x="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const j=document.documentElement,k=j.ketchup?j.ketchup.objects:new r,O=j.ketchup?j.ketchup.data:new i;class y extends e{isFilterCompliantForCell(e,t,n){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,n)}isFilterCompliantForCellObj(e,t,n){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,n)}isRowCompliant(e,t={},n="",l=!1,o=[],r,i){return this.areCellsCompliant(e.cells,t,n,l,o,r,i)}areCellsCompliant(e,t={},n="",r=!1,i=[],s,a){if(r){let t=!0;if(i&&null!=i&&i.length>0){t=!1;let o=this.filterIsNegative(n);for(let s=0;s<i.length;s++){if(!1===i[s].visible&&!a||(null==a?void 0:a.length)>0&&!a.includes(i[s].name))continue;const u=e[i[s].name];if(null==u)continue;t=this.isFilterCompliantForValue(u.value,n,r);let c=l(i[s],u);if(c!=u.value&&(t=t||this.isFilterCompliantForValue(c,n,r)),1==t&&!o)break;if(0==t&&o)break}}if(!t)return!1}return null==s&&(s=new w),!this.hasFilters(t,i,s)||Object.keys(t).every((n=>{const l=e[n],r=o(i,n);if(!l)return!1;let a=s.getTextFilterValue(t,n),u=s.getCheckBoxFilterValues(t,n);const c=this.filterIsNegative(a);let f=""!==a&&this.isFilterCompliantForCell(l,a,!0)||u.some((e=>this.isFilterCompliantForCell(l,e.value)))||u.some((e=>this.isFilterCompliantForCell(l,e.displayedValue)))||!s.hasFiltersForColumn(t,r),h=c;return k.isNumber(l.obj)||k.isDate(l.obj)||k.isTime(l.obj)||k.isTimestamp(l.obj)||(h=""!==a&&this.isFilterCompliantForCellObj(l,a,!0)||u.some((e=>this.isFilterCompliantForCellObj(l,e.value)))||!s.hasFiltersForColumn(t,r)),c?f&&h:f||h}))}hasFilters(e={},t,n){if(null==e)return!1;let l=Object.keys(e);if(null==l||l.length<1)return!1;null==n&&(n=new w);for(let r=0;r<l.length;r++){let i=l[r],s=null;if(s=i===x?{name:x,title:""}:o(t,i),n.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},n="",l=[],o,r){if(!e||null==e)return[];let i=[];const s=!(!n||!l);if(this.hasFilters(t,l,o)||s)for(let a=0;a<e.length;a++){let u=e[a];(u.id&&u.id.indexOf("insert_")>-1||this.isRowCompliant(u,t,n,s,l,o,r))&&(i[i.length]=u)}else i=[...e];return i}getColumnValues(n,l,o,r){let i=new Array;null==r&&(r=new w);let s=r.getTextFilterValueTmp(n.filters,l.name),a=r.getCheckBoxFilterValues(n.filters,l.name);if(null!=l.valuesForFilter&&l.valuesForFilter.length>0)return l.valuesForFilter.forEach((n=>{let o=n;(e.valuesArrayContainsValue(a,o)||""==s||r.isFilterCompliantForSimpleValue(o,l.obj,s))&&i.push({value:o,displayedValue:t(o,l.obj,l.decimals)})})),i;let u=Object.assign({},n.filters);u[l.name]={textField:s,textFieldTmp:s,checkBoxes:[]};let c=this.filterRows(n.getRows(),u,o,n.getVisibleColumns(),r);for(let e=0;e<a.length;e++)i.push(a[e]);return O.cell.getUnivocalValue({rows:c},l,!0)}}const T=document.documentElement;function C(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const n=e[0].group.column;let l=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let n of t)if(n.column===e)return n;return null}(n,t);return l||(l={column:n,sortMode:p.A}),e.sort(((e,t)=>s({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},l.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const n=t.length>1;return e.slice(0).sort(((e,l)=>{if(n){for(let n=0;n<t.length;n++){const o=V(e,l,t[n]);if(0!==o)return o}return 0}return V(e,l,t[0])}))}function V(e,t,n){const l=e.cells[n.column],o=t.cells[n.column];return l||o?l?o?s(l,o,n.sortMode):-1:1:0}function M(e=[],t={},n="",l=[],o,r,i){return null==r&&(r=new y),r.filterRows(e,t,n,l,o,i)}function N(e=[],t=[],n=[],r={}){if(!t)return[];if(!n||0===n.length||!e||0===e.length)return t;const i={},s=n.filter((({column:t})=>{for(let{name:n,title:l}of e)if(n===t)return i[n]=l,!0;return!1}));if(0===s.length)return t;const u=[];let c={};return t.forEach((t=>{const n=s[0].column,f=t.cells[n];if(f){const h=o(e,n),d=l(h,f),b=f.value;let m=null;for(let e of u)if(e.group.label===d){m=e;break}null===m&&(m={group:{id:b,parent:null,column:n,columnLabel:i[n],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},u.push(m));for(let n=1;n<s.length;n++){const r=s[n],a=t.cells[r.column];if(a){const t=o(e,r.column),n=l(t,a),s=a.value;let u=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===n){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:r.column,columnLabel:i[r.column],children:[],expanded:!1,label:n,totals:{},obj:a.obj}},L(u),m.group.children.push(u)),m=u}}m.group.children.push(t),function(e,t,n,l){if(!e||!t)return;const o=Object.keys(t);0!==o.length&&o.forEach((o=>{const r=n.cells[o];if(r){const n=T.ketchup.objects.isNumber(r.obj),i=t[o];switch(i){case a.COUNT:let t=e.group.totals[o]||0;e.group.totals[o]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[o]||0;s.group.totals[o]=++e,s=s.group.parent}break;case a.DISTINCT:let u;if(u=n?T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value)):r.value,l[e.group.id]){let t=l[e.group.id][o];t?t.push(u):(l[e.group.id][o]=[],l[e.group.id][o].push(u))}else l[e.group.id]={},l[e.group.id][o]=[],l[e.group.id][o].push(u);let c=e.group.parent;for(;null!=c;){if(l[c.group.id]){let e=l[c.group.id][o];e?e.push(u):(l[c.group.id][o]=[],l[c.group.id][o].push(u))}else l[c.group.id]={},l[c.group.id][o]=[],l[c.group.id][o].push(u);c=c.group.parent}break;case a.SUM:case a.AVERAGE:if(n&&r.value){const t=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t+(e.group.totals[o]||0);let n=e.group.parent;for(;null!=n;){const e=T.ketchup.math.numberify(n.group.totals[o]||0);n.group.totals[o]=t+e,n=n.group.parent}}break;case a.MIN:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.min(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.min(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;case a.MAX:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.max(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.max(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;default:0!=i.indexOf(a.MATH)&&console.warn(`invalid total mode: ${i}`)}}}))}(m,r,t,c)}})),function(e,t,n){if(!e||!t)return;const l=Object.keys(t);if(0===e.length||!e[0].group||0===l.length)return;let o=l.filter((e=>a.DISTINCT===t[e]));o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>D(e,o,n)))}(u,r,c),W(u,a.AVERAGE,r),W(u,a.MATH,r),u}function W(e,t,n){if(!e||!n)return;const l=Object.keys(n);if(0===e.length||!e[0].group||0===l.length)return;let o;t==a.AVERAGE&&(o=l.filter((e=>a.AVERAGE===n[e]))),t==a.MATH&&(o=l.filter((e=>0==n[e].indexOf(a.MATH)))),o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>E(e,t,o,n)))}function D(e,t,n){const l=e.group.children;0!==l.length&&(l[0].group&&l.forEach((e=>{D(e,t,n)})),t.forEach((t=>{e.group.totals[t]=new Set(n[e.group.id][t]).size})))}function E(e,t,n,l){const o=e.group.children;if(0===o.length)return 0;let r=0;return o[0].group?o.forEach((e=>{r+=E(e,t,n,l)})):r=o.length,n.forEach((n=>{if(t==a.AVERAGE&&(e.group.totals[n]=e.group.totals[n]/r),t==a.MATH){let t=l[n].substring(a.MATH.length);e.group.totals[n]=T.ketchup.math.formulas.custom(t,e.group.totals)}})),r}function A(e,t){if(t){const n=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const n=t.cells[e.name];n&&e.obj&&!n.obj&&(n.obj={t:e.obj.t,p:e.obj.p,k:n.value})}}))})),n}}function B(e,t,n){if(T.ketchup.objects.isEmptyJsObject(n)||T.ketchup.objects.isEmptyJsObject(e))return{};const l={},o=[],r=t.reduce(((t,r)=>{if(!e[r.name])return t;const i=e[r.name];return i===a.COUNT?(l[r.name]=n.length.toString(),t):0===i.indexOf(a.MATH)?(o.push([r.name,i]),t):(t.push({totalOperation:i,totalColumn:r,columnValues:n.map((e=>e.cells[r.name].value))}),t)}),[]);return r||o?(null==r||r.forEach((({totalOperation:e,totalColumn:t,columnValues:o})=>{if(T.ketchup.objects.isNumber(t.obj)){if(e===a.SUM)return void(l[t.name]=o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0).toString());if(e===a.AVERAGE)return void(l[t.name]=(o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0)/n.length).toString());if(e===a.MIN)return void(l[t.name]=Math.min(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString());if(e===a.MAX)return void(l[t.name]=Math.max(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString())}if(T.ketchup.objects.isDate(t.obj)){const n=o.filter((e=>T.ketchup.dates.isIsoDate(e))).map((e=>T.ketchup.dates.toDate(e,v.ISO_DATE)));if(!n)return;if(e===a.MIN)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE));if(e===a.MAX)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE))}e===a.DISTINCT&&(l[t.name]=new Set(o).size.toString())})),null==o||o.forEach((([e,t])=>{const n=null==t?void 0:t.replace(u(a.MATH,"g"),"");l[e]=T.ketchup.math.formulas.custom(n,function(e){var t;return Object.fromEntries(null===(t=Object.entries(e))||void 0===t?void 0:t.reduce(((e,[t,n])=>(T.ketchup.math.isNumber(n)&&e.push([t,Number(n)]),e)),[]))}(l)).toString()})),l):l}function L(e){if(!e.group)return;let t=e.group.id,n=e.group.parent;for(;null!==n;)t=`${n.group.id};${t}`,n=n.group.parent;e.group.id=t}function S(e,t,n,l){const o=t*n-n,r=o+Number(n);if(0==l)return e.slice(o,r);let i=[];return _(e,i,o,Number(n),0),i}function _(e,t,n,l,o){let r=!1;for(let i=0;i<e.length;i++){let s=e[i],a=R(e[i]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=_(s.group.children,a.group.children,n,l,o);o=e.ci,r=e.added,1==r&&(t[t.length]=a)}else o>=n&&(t[t.length]=a,r=!0),o++;if(o>=n+l)break}return{ci:o,added:r}}function R(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:I(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function z(e){if(null==e)return null;let t=[];for(let n=0;n<e.length;n++)t[t.length]=R(e[n]);return t}function I(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:z(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function $(e,t,n=!1){const l={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const o of t.rows){const t={cells:{},id:o.id};for(const n of l.columns){const l=n.name,r=o.cells[l],i=e.rows.find((e=>e.id===o.id)),s=i?i.cells[l]:null;(!s&&r.value||s&&r.value!==s.value)&&(t.cells[l]=r)}(Object.keys(t.cells).length>0||n)&&l.rows.push(t)}return l}function q(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var n;let l=e.cells[t];const o=l.value,r=l.decode,i=l.options;l.isEditable=null!==(n=l.isEditable)&&void 0!==n?n:l.editable;const s={[c.AUTOCOMPLETE]:()=>f(o,"",i,l.data),[c.COMBOBOX]:()=>f(o,"",i,l.data),[c.RADIO]:()=>h(o,i),[c.CHECKBOX]:()=>d(o,""),[c.CHIP]:()=>b(o,r),[c.SWITCH]:()=>m(o,""),[c.MULTI_AUTOCOMPLETE]:()=>b(o,r),[c.MULTI_COMBOBOX]:()=>b(o,r)}[l.shape];s&&(l.data=Object.assign(Object.assign({},s()),l.data))}))}))}export{w as F,g as K,y as a,N as b,B as c,q as d,F as e,M as f,$ as g,A as n,S as p,C as s,x as t}
@@ -1 +1 @@
1
- import{r as t,c as e,f as i,h as a,H as l,d as r}from"./p-710d0a7d.js";import{F as o}from"./p-c4224227.js";import{a as n}from"./p-e3062c19.js";import{F as s}from"./p-3cab6420.js";import{k as f,g as _,s as p,b as m,V as h}from"./p-8a108d52.js";import{c}from"./p-635bb4b3.js";import"./p-cabebabc.js";var u;!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."}(u||(u={}));var d,y,k,g,v,x,b,w,z,j,C,E,T,W,M,S,D,L,O,P,R,A,F,X,Y,H=function(t,e,i,a){if("a"===i&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?a:"a"===i?a.call(t):a?a.value:e.get(t)},$=function(t,e,i,a,l){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!l:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?l.call(t,i):l?l.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),g.set(this,0),v.set(this,0),x.set(this,[]),b.set(this,f()),w.set(this,(t=>{const e=t.clientX-H(this,g,"f"),i=t.clientY-H(this,v,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,g,t.clientX,"f"),$(this,v,t.clientY,"f")})),z.set(this,!1),j.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 _(this,u,t)}async refresh(){i(this)}async runAutofit(){const t=H(this,j,"f").clientWidth,e=H(this,j,"f").children[0].clientWidth,i=.01,a=.85*t,l=.95*t;let r=1,o=2e3,n=e;for(;(n<a||n>l)&&o>0&&r>i;)o--,n<a?r+=i:n>l?r-=i:o=0,n=e*r;H(this,j,"f").style.setProperty("--kup_familytree_scale",r<=1?r.toFixed(2):"1")}async setProps(t){p(this,u,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,z,"f")&&($(this,z,!1,"f"),this.runAutofit()),H(this,b,"f").debug.logRender(this,!0)}render(){return a(l,{key:"e7a1464b62837b0ca1e57cda5c4184f778b29b6f",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)}},a("style",{key:"ff69c47ff4ee430357a2f53a29f027ea4c43888f"},H(this,b,"f").theme.setKupStyle(this.rootElement)),a("div",{key:"6c92cde73c306fa704b16e7e800c608b3e30ff5d",id:c},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 r(this)}};y=new WeakMap,k=new WeakMap,g=new WeakMap,v=new WeakMap,x=new WeakMap,b=new WeakMap,w=new WeakMap,z=new WeakMap,j=new WeakMap,d=new WeakSet,C=function(t,e,i,l){const r=[];return r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},a("div",{class:"family-tree__line--placeholder"}))),r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||l&&!e}},a("div",{class:"family-tree__line--placeholder"}))),r},E=function t(e){var i;let l=null,r=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(r||(r=[]),r.push(t)):(l||(l=[]),l.push(t))})));const s=this.stackedLeaves&&l&&l.every((t=>!t.children||0==t.children.length)),f=l?2*l.length:1,_={"family-tree__line":!0,"family-tree__line--placeholder":!(!l&&!r),"family-tree__line--vertical":!(!l&&!r)},p={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},h=e.layout||this.layout||1,c={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:n.OUTLINED,title:`${H(this,b,"f").language.translate(m.EXPAND)}/${H(this,b,"f").language.translate(m.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,z,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let u=null;H(this,d,"m",L).call(this,h)&&(u=a("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:p,cardData:this.cardData,layout:this.cardData?null:h,showSelection:!1}));const y=a("div",{class:"family-tree__item"},a("div",{class:"family-tree__item__wrapper"},H(this,d,"m",L).call(this,h)?u:H(this,d,"m",T).call(this,e,h),this.collapsible&&e.children&&e.children.length>0?a(o,Object.assign({},c)):void 0)),k={"--kup_familytree_staffchildren":(null==r?void 0:r.length.toString())||"0"};return a("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},a("tr",null,a("td",{"data-row":e,colSpan:f},y)),a("tr",null,a("td",{colSpan:f},a("div",{class:_}))),r?[a("tr",null,a("td",{colSpan:f},a("div",{class:Object.assign(Object.assign({},_),{"family-tree__line--staff":!0}),style:k}),a("div",{class:"family-tree__node__staff",style:k},r.map((e=>[a("div",{class:"family-tree__node__staff__item"},H(this,d,"m",t).call(this,e))])))))]:null,r&&l?[a("tr",null,a("td",{colSpan:f},a("div",{class:_})))]:null,l?[a("tr",null,s?a("td",{colSpan:f},a("div",{class:_})):l.map((t=>H(this,d,"m",C).call(this,0==l.indexOf(t),l.indexOf(t)==l.length-1,1==l.length,l.length>2)))),a("tr",null,s?a("td",{colSpan:f},l.map((e=>H(this,d,"m",t).call(this,e)))):l.map((e=>a("td",{colSpan:2},H(this,d,"m",t).call(this,e)))))]:void 0)},T=function(t,e){return 2===e?H(this,d,"m",M).call(this,t):H(this,d,"m",W).call(this,t)},W=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--1"},a("div",{class:"family-tree__item__layout__text__title"},t.value))},M=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--2"},a("div",{class:"family-tree__item__layout__color"}),a("div",{class:"family-tree__item__layout__image"},a(s,{resource:t.icon,placeholderResource:t.placeholderIcon,sizeX:"48px",sizeY:"48px"})),a("div",{class:"family-tree__item__layout__text"},a("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?a("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},S=function(t){return t.map((t=>H(this,d,"m",E).call(this,t)))},D=function(){return a("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,j,t,"f")},this.data&&this.data.rows&&this.data.rows.length?H(this,d,"m",S).call(this,this.data.rows):a("div",null,H(this,b,"f").language.translate(m.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){$(this,g,t.clientX,"f"),$(this,v,t.clientY,"f"),H(this,j,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",H(this,w,"f")),document.removeEventListener("pointerup",e),H(this,j,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",H(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t,e){let i,a;if(t)for(let e=t.length-1;e>=0;e--){const l=t[e];l.tagName&&(l.classList.contains("family-tree__item__expand")&&(i=l),"TD"===l.tagName.toUpperCase())&&(a=l)}let l=null,r=null,o=null;return a&&(l=a["data-cell"],r=a["data-column"],o=a["data-row"]),{cell:l||null,column:r||null,expandButton:i||null,originalEvent:e,row:o||null,td:a||null}},R=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},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)},X=function(){H(this,x,"f").push(this.rootElement),H(this,b,"f").interact.on(this.rootElement,h.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",R).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.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",F).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.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",A).call(this,t)}))}))},Y=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(H(this,j,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let a=t.deltaY>0?e-i:e+i;a<i&&(a=i),H(this,j,"f").style.setProperty("--kup_familytree_scale",a.toFixed(2))}},B.style='.kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_familytree_item_background_color:var(\n --kup-layer-1,\n var(--kup-layer-1)\n );--kup_familytree_border_color:var(\n --kup-familytree-border-color,\n var(--kup-info-color-50)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_minheight:var(--kup-familytree-item-minheight, 32px);--kup_familytree_item_height:var(--kup-familytree-item-height, 100%);--kup_familytree_item_h_padding:var(\n --kup-familytree-item-h-padding,\n var(--kup-space-00)\n );--kup_familytree_item_v_padding:var(\n --kup-familytree-item-v-padding,\n var(--kup-space-03)\n );--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-subtle)\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_minheight) + 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_minheight) / 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:32px}.family-tree__line--staff{height:calc(var(--kup_familytree_staffchildren) * var(--kup_familytree_item_minheight) + 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;display:flex;flex-direction:column}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 var(--kup-space-05);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);box-sizing:border-box;display:flex;height:--kup_familytree_item_minheight;min-height:32px;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_familytree_border_color);height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto var(--kup-space-03)}.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 a,H as l,d as r}from"./p-710d0a7d.js";import{F as o}from"./p-c4224227.js";import{a as n}from"./p-e3062c19.js";import{F as s}from"./p-3cab6420.js";import{k as f,g as _,s as p,b as m,V as h}from"./p-84a053a8.js";import{c}from"./p-635bb4b3.js";import"./p-cabebabc.js";var u;!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."}(u||(u={}));var d,y,k,g,v,x,b,w,z,j,C,E,T,W,M,S,D,L,O,P,R,A,F,X,Y,H=function(t,e,i,a){if("a"===i&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?a:"a"===i?a.call(t):a?a.value:e.get(t)},$=function(t,e,i,a,l){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!l:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?l.call(t,i):l?l.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),g.set(this,0),v.set(this,0),x.set(this,[]),b.set(this,f()),w.set(this,(t=>{const e=t.clientX-H(this,g,"f"),i=t.clientY-H(this,v,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,g,t.clientX,"f"),$(this,v,t.clientY,"f")})),z.set(this,!1),j.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 _(this,u,t)}async refresh(){i(this)}async runAutofit(){const t=H(this,j,"f").clientWidth,e=H(this,j,"f").children[0].clientWidth,i=.01,a=.85*t,l=.95*t;let r=1,o=2e3,n=e;for(;(n<a||n>l)&&o>0&&r>i;)o--,n<a?r+=i:n>l?r-=i:o=0,n=e*r;H(this,j,"f").style.setProperty("--kup_familytree_scale",r<=1?r.toFixed(2):"1")}async setProps(t){p(this,u,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,z,"f")&&($(this,z,!1,"f"),this.runAutofit()),H(this,b,"f").debug.logRender(this,!0)}render(){return a(l,{key:"e7a1464b62837b0ca1e57cda5c4184f778b29b6f",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)}},a("style",{key:"ff69c47ff4ee430357a2f53a29f027ea4c43888f"},H(this,b,"f").theme.setKupStyle(this.rootElement)),a("div",{key:"6c92cde73c306fa704b16e7e800c608b3e30ff5d",id:c},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 r(this)}};y=new WeakMap,k=new WeakMap,g=new WeakMap,v=new WeakMap,x=new WeakMap,b=new WeakMap,w=new WeakMap,z=new WeakMap,j=new WeakMap,d=new WeakSet,C=function(t,e,i,l){const r=[];return r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},a("div",{class:"family-tree__line--placeholder"}))),r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||l&&!e}},a("div",{class:"family-tree__line--placeholder"}))),r},E=function t(e){var i;let l=null,r=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(r||(r=[]),r.push(t)):(l||(l=[]),l.push(t))})));const s=this.stackedLeaves&&l&&l.every((t=>!t.children||0==t.children.length)),f=l?2*l.length:1,_={"family-tree__line":!0,"family-tree__line--placeholder":!(!l&&!r),"family-tree__line--vertical":!(!l&&!r)},p={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},h=e.layout||this.layout||1,c={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:n.OUTLINED,title:`${H(this,b,"f").language.translate(m.EXPAND)}/${H(this,b,"f").language.translate(m.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,z,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let u=null;H(this,d,"m",L).call(this,h)&&(u=a("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:p,cardData:this.cardData,layout:this.cardData?null:h,showSelection:!1}));const y=a("div",{class:"family-tree__item"},a("div",{class:"family-tree__item__wrapper"},H(this,d,"m",L).call(this,h)?u:H(this,d,"m",T).call(this,e,h),this.collapsible&&e.children&&e.children.length>0?a(o,Object.assign({},c)):void 0)),k={"--kup_familytree_staffchildren":(null==r?void 0:r.length.toString())||"0"};return a("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},a("tr",null,a("td",{"data-row":e,colSpan:f},y)),a("tr",null,a("td",{colSpan:f},a("div",{class:_}))),r?[a("tr",null,a("td",{colSpan:f},a("div",{class:Object.assign(Object.assign({},_),{"family-tree__line--staff":!0}),style:k}),a("div",{class:"family-tree__node__staff",style:k},r.map((e=>[a("div",{class:"family-tree__node__staff__item"},H(this,d,"m",t).call(this,e))])))))]:null,r&&l?[a("tr",null,a("td",{colSpan:f},a("div",{class:_})))]:null,l?[a("tr",null,s?a("td",{colSpan:f},a("div",{class:_})):l.map((t=>H(this,d,"m",C).call(this,0==l.indexOf(t),l.indexOf(t)==l.length-1,1==l.length,l.length>2)))),a("tr",null,s?a("td",{colSpan:f},l.map((e=>H(this,d,"m",t).call(this,e)))):l.map((e=>a("td",{colSpan:2},H(this,d,"m",t).call(this,e)))))]:void 0)},T=function(t,e){return 2===e?H(this,d,"m",M).call(this,t):H(this,d,"m",W).call(this,t)},W=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--1"},a("div",{class:"family-tree__item__layout__text__title"},t.value))},M=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--2"},a("div",{class:"family-tree__item__layout__color"}),a("div",{class:"family-tree__item__layout__image"},a(s,{resource:t.icon,placeholderResource:t.placeholderIcon,sizeX:"48px",sizeY:"48px"})),a("div",{class:"family-tree__item__layout__text"},a("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?a("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},S=function(t){return t.map((t=>H(this,d,"m",E).call(this,t)))},D=function(){return a("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,j,t,"f")},this.data&&this.data.rows&&this.data.rows.length?H(this,d,"m",S).call(this,this.data.rows):a("div",null,H(this,b,"f").language.translate(m.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){$(this,g,t.clientX,"f"),$(this,v,t.clientY,"f"),H(this,j,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",H(this,w,"f")),document.removeEventListener("pointerup",e),H(this,j,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",H(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t,e){let i,a;if(t)for(let e=t.length-1;e>=0;e--){const l=t[e];l.tagName&&(l.classList.contains("family-tree__item__expand")&&(i=l),"TD"===l.tagName.toUpperCase())&&(a=l)}let l=null,r=null,o=null;return a&&(l=a["data-cell"],r=a["data-column"],o=a["data-row"]),{cell:l||null,column:r||null,expandButton:i||null,originalEvent:e,row:o||null,td:a||null}},R=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},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)},X=function(){H(this,x,"f").push(this.rootElement),H(this,b,"f").interact.on(this.rootElement,h.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",R).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.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",F).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.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",A).call(this,t)}))}))},Y=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(H(this,j,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let a=t.deltaY>0?e-i:e+i;a<i&&(a=i),H(this,j,"f").style.setProperty("--kup_familytree_scale",a.toFixed(2))}},B.style='.kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_familytree_item_background_color:var(\n --kup-layer-1,\n var(--kup-layer-1)\n );--kup_familytree_border_color:var(\n --kup-familytree-border-color,\n var(--kup-info-color-50)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_minheight:var(--kup-familytree-item-minheight, 32px);--kup_familytree_item_height:var(--kup-familytree-item-height, 100%);--kup_familytree_item_h_padding:var(\n --kup-familytree-item-h-padding,\n var(--kup-space-00)\n );--kup_familytree_item_v_padding:var(\n --kup-familytree-item-v-padding,\n var(--kup-space-03)\n );--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-subtle)\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_minheight) + 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_minheight) / 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:32px}.family-tree__line--staff{height:calc(var(--kup_familytree_staffchildren) * var(--kup_familytree_item_minheight) + 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;display:flex;flex-direction:column}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 var(--kup-space-05);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);box-sizing:border-box;display:flex;height:--kup_familytree_item_minheight;min-height:32px;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_familytree_border_color);height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto var(--kup-space-03)}.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{r as t,c as e,f as i,h as a,H as n,d as o}from"./p-710d0a7d.js";import{k as s,g as p,s as r}from"./p-8a108d52.js";import{c}from"./p-635bb4b3.js";import{F as l}from"./p-c4224227.js";import"./p-cabebabc.js";import"./p-e3062c19.js";import"./p-3cab6420.js";const f="snackbar";var h;!function(t){t.actionButton="Set of FButton props to set the action button.",t.closeButton="When true, the hide button will be displayed.",t.customStyle="Custom style of the component.",t.text="Sets the textual content of the snackbar.",t.timeout="Defaults at null, when set the snackbar will automatically disappear after the specified amount of milliseconds."}(h||(h={}));const k=class{constructor(i){t(this,i),this.kupActionClick=e(this,"kup-snackbar-actionclick",6),this.kupTimeoutComplete=e(this,"kup-snackbar-timeoutcomplete",6),this.kupManager=s(),this.visible=!1,this.actionButton=null,this.closeButton=!0,this.customStyle="",this.text="",this.header="",this.timeout=null}onKupActionClick(){this.hide(),this.kupActionClick.emit({comp:this,id:this.rootElement.id})}onKupTimeoutComplete(){this.kupTimeoutComplete.emit({comp:this,id:this.rootElement.id})}async getProps(t){return p(this,h,t)}async hide(){this.visible=!1}async refresh(){i(this)}async setProps(t){r(this,h,t)}async show(){this.visible=!0}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.timeout&&this.visible&&setTimeout((()=>{this.hide(),this.onKupTimeoutComplete()}),this.timeout),this.kupManager.debug.logRender(this,!0)}render(){return a(n,{key:"29fc36a9d37ee6a6eb561ba7f3b34f6f52f376d0","kup-visible":this.visible},a("style",{key:"6acdde175ca85d13aaa9476c185872504c9aec67"},this.kupManager.theme.setKupStyle(this.rootElement)),a("div",{key:"0e4c3911b05c87a79d430ae7f42bffc21430167f",id:c},a("div",{key:"6bc4090dfcbda8cf603fed53b010e3a534f819a5",class:f},a("div",{key:"10d40a1420f7876997476be973d1f05ac2e1e628",class:"snackbar__text__block"},a("div",{key:"13871cdd376fe9c57b2a2484d1338c218a3adab1",class:`${f}__header`},this.header),a("div",{key:"79dcfa8747ac1e0621210f48810c591dc8fe343c",class:`${f}__text`},this.text)),this.actionButton||this.closeButton?a("div",{class:`${f}__buttons`},this.actionButton?a("div",{class:`${f}__action`},a(l,Object.assign({},this.actionButton,{onClick:()=>this.onKupActionClick()}))):null,this.closeButton?a("div",{class:`${f}__close`},a(l,{icon:"close",onClick:()=>this.hide()})):null):null)))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return o(this)}};k.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_snackbar_border_left_color:var(\n --kup-snackbar-border-left-color,\n var(--kup-border-interactive)\n );--kup_snackbar_background_color:var(\n --kup-snackbar-background-color,\n var(--kup-layer-0-inverted)\n );--kup_snackbar_text_color:var(\n --kup-snackbar-text-color,\n var(--kup-text-primary-inverted)\n );--kup_snackbar_text_color:var(--kup-snackbar-text-color, var(--kup-layer-1));animation:snackbar-show 125ms;bottom:0;box-sizing:border-box;display:block;left:0;outline:none;pointer-events:none;position:fixed;transition:opacity 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms, transform 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms, -webkit-transform 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms;width:100%;z-index:calc(var(--kup-navbar-zindex) + 1)}:host(:not([kup-visible])){display:none}#kup-component{box-sizing:border-box;display:flex;justify-content:center;height:100%;padding:8px;width:100%}.snackbar{align-items:center;background-color:var(--kup_snackbar_background_color);color:var(--kup_snackbar_text_color);display:flex;justify-content:space-between;max-width:672px;min-height:48px;min-width:344px;border-left:4px solid var(--kup_snackbar_border_left_color);padding:0 var(--kup-space-05)}.snackbar .snackbar__text__block{padding:var(--kup-space-05) 0;color:var(--kup_snackbar_text_color)}.snackbar__header{pointer-events:all;word-break:break-word;font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.snackbar__text{pointer-events:all;word-break:break-word;font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.snackbar__buttons{align-items:center;display:flex;justify-content:flex-end;pointer-events:all;width:max-content}.snackbar__close{--kup-button-font-size:11px;margin-left:8px;pointer-events:all}@media (min-width: 768px){.snackbar__text__block{padding:var(--kup-space-05) 0;min-width:350px}}@keyframes snackbar-show{from{transform:scale(0.5);opacity:0}to{transform:scale(1);opacity:1}}:host(.kup-top){bottom:unset;top:var(--kup-navbar-height, 0)}";export{k as kup_snackbar}
1
+ import{r as t,c as e,f as i,h as a,H as n,d as o}from"./p-710d0a7d.js";import{k as s,g as p,s as r}from"./p-84a053a8.js";import{c}from"./p-635bb4b3.js";import{F as l}from"./p-c4224227.js";import"./p-cabebabc.js";import"./p-e3062c19.js";import"./p-3cab6420.js";const f="snackbar";var h;!function(t){t.actionButton="Set of FButton props to set the action button.",t.closeButton="When true, the hide button will be displayed.",t.customStyle="Custom style of the component.",t.text="Sets the textual content of the snackbar.",t.timeout="Defaults at null, when set the snackbar will automatically disappear after the specified amount of milliseconds."}(h||(h={}));const k=class{constructor(i){t(this,i),this.kupActionClick=e(this,"kup-snackbar-actionclick",6),this.kupTimeoutComplete=e(this,"kup-snackbar-timeoutcomplete",6),this.kupManager=s(),this.visible=!1,this.actionButton=null,this.closeButton=!0,this.customStyle="",this.text="",this.header="",this.timeout=null}onKupActionClick(){this.hide(),this.kupActionClick.emit({comp:this,id:this.rootElement.id})}onKupTimeoutComplete(){this.kupTimeoutComplete.emit({comp:this,id:this.rootElement.id})}async getProps(t){return p(this,h,t)}async hide(){this.visible=!1}async refresh(){i(this)}async setProps(t){r(this,h,t)}async show(){this.visible=!0}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.timeout&&this.visible&&setTimeout((()=>{this.hide(),this.onKupTimeoutComplete()}),this.timeout),this.kupManager.debug.logRender(this,!0)}render(){return a(n,{key:"29fc36a9d37ee6a6eb561ba7f3b34f6f52f376d0","kup-visible":this.visible},a("style",{key:"6acdde175ca85d13aaa9476c185872504c9aec67"},this.kupManager.theme.setKupStyle(this.rootElement)),a("div",{key:"0e4c3911b05c87a79d430ae7f42bffc21430167f",id:c},a("div",{key:"6bc4090dfcbda8cf603fed53b010e3a534f819a5",class:f},a("div",{key:"10d40a1420f7876997476be973d1f05ac2e1e628",class:"snackbar__text__block"},a("div",{key:"13871cdd376fe9c57b2a2484d1338c218a3adab1",class:`${f}__header`},this.header),a("div",{key:"79dcfa8747ac1e0621210f48810c591dc8fe343c",class:`${f}__text`},this.text)),this.actionButton||this.closeButton?a("div",{class:`${f}__buttons`},this.actionButton?a("div",{class:`${f}__action`},a(l,Object.assign({},this.actionButton,{onClick:()=>this.onKupActionClick()}))):null,this.closeButton?a("div",{class:`${f}__close`},a(l,{icon:"close",onClick:()=>this.hide()})):null):null)))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return o(this)}};k.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_snackbar_border_left_color:var(\n --kup-snackbar-border-left-color,\n var(--kup-border-interactive)\n );--kup_snackbar_background_color:var(\n --kup-snackbar-background-color,\n var(--kup-layer-0-inverted)\n );--kup_snackbar_text_color:var(\n --kup-snackbar-text-color,\n var(--kup-text-primary-inverted)\n );--kup_snackbar_text_color:var(--kup-snackbar-text-color, var(--kup-layer-1));animation:snackbar-show 125ms;bottom:0;box-sizing:border-box;display:block;left:0;outline:none;pointer-events:none;position:fixed;transition:opacity 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms, transform 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms, -webkit-transform 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms;width:100%;z-index:calc(var(--kup-navbar-zindex) + 1)}:host(:not([kup-visible])){display:none}#kup-component{box-sizing:border-box;display:flex;justify-content:center;height:100%;padding:8px;width:100%}.snackbar{align-items:center;background-color:var(--kup_snackbar_background_color);color:var(--kup_snackbar_text_color);display:flex;justify-content:space-between;max-width:672px;min-height:48px;min-width:344px;border-left:4px solid var(--kup_snackbar_border_left_color);padding:0 var(--kup-space-05)}.snackbar .snackbar__text__block{padding:var(--kup-space-05) 0;color:var(--kup_snackbar_text_color)}.snackbar__header{pointer-events:all;word-break:break-word;font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.snackbar__text{pointer-events:all;word-break:break-word;font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.snackbar__buttons{align-items:center;display:flex;justify-content:flex-end;pointer-events:all;width:max-content}.snackbar__close{--kup-button-font-size:11px;margin-left:8px;pointer-events:all}@media (min-width: 768px){.snackbar__text__block{padding:var(--kup-space-05) 0;min-width:350px}}@keyframes snackbar-show{from{transform:scale(0.5);opacity:0}to{transform:scale(1);opacity:1}}:host(.kup-top){bottom:unset;top:var(--kup-navbar-height, 0)}";export{k as kup_snackbar}
@@ -1 +1 @@
1
- import{r as t,c as i,f as e,h as n,H as o,d as a}from"./p-710d0a7d.js";import{k as p,g as s,s as h,h as f}from"./p-8a108d52.js";import"./p-cabebabc.js";var r;!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."}(r||(r={}));const l=class{constructor(e){t(this,e),this.kupIframeError=i(this,"kup-iframe-error",6),this.kupIframeLoad=i(this,"kup-iframe-load",6),this.kupManager=p(),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 s(this,r,t)}async refresh(){e(this)}async setProps(t){h(this,r,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?n(o,{"is-button":!0},n("kup-button",Object.assign({},this.buttonData,{"onkup-button-click":()=>this.openInNew()}))):n(o,{"is-iframe":!0},n("iframe",{onError:this.onKupIframeError.bind(this),onLoad:this.onKupIframeLoad.bind(this),src:this.src}));this.kupManager.debug.logMessage(this,"Resource undefined, not rendering!",f.WARNING)}get rootElement(){return a(this)}};l.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}iframe{box-sizing:border-box;height:100%;width:100%}:host([is-iframe]){box-sizing:border-box;display:block;height:100%;width:100%}";export{l as kup_iframe}
1
+ import{r as t,c as i,f as e,h as n,H as o,d as a}from"./p-710d0a7d.js";import{k as p,g as s,s as h,h as f}from"./p-84a053a8.js";import"./p-cabebabc.js";var r;!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."}(r||(r={}));const l=class{constructor(e){t(this,e),this.kupIframeError=i(this,"kup-iframe-error",6),this.kupIframeLoad=i(this,"kup-iframe-load",6),this.kupManager=p(),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 s(this,r,t)}async refresh(){e(this)}async setProps(t){h(this,r,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?n(o,{"is-button":!0},n("kup-button",Object.assign({},this.buttonData,{"onkup-button-click":()=>this.openInNew()}))):n(o,{"is-iframe":!0},n("iframe",{onError:this.onKupIframeError.bind(this),onLoad:this.onKupIframeLoad.bind(this),src:this.src}));this.kupManager.debug.logMessage(this,"Resource undefined, not rendering!",f.WARNING)}get rootElement(){return a(this)}};l.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}iframe{box-sizing:border-box;height:100%;width:100%}:host([is-iframe]){box-sizing:border-box;display:block;height:100%;width:100%}";export{l as kup_iframe}
@@ -1 +1 @@
1
- import{r as t,c as i,f as s,h,H as e,d as n,g as o}from"./p-710d0a7d.js";import{k as a,ai as r,g as l,s as f,d as c,u as d}from"./p-8a108d52.js";import{K as p,d as u,a as m,b as v,c as k}from"./p-cd3a7d53.js";import{c as w}from"./p-635bb4b3.js";import{F as g}from"./p-b40cde24.js";import{F as y}from"./p-7db300e0.js";import"./p-cabebabc.js";import"./p-3cab6420.js";import"./p-c56195a0.js";const b=a();function x(t,i,s,h,e,n,o,a){const r=D(t,i);let l=[];s&&h&&(l=C(s,h)?D(s,h):[...r]);let f=[];e&&n&&(z(e,n)?f=S(e,n):l=[...r]);let c=[];return o&&a&&(z(o,a)?c=S(o,a):l=[...r]),{dateValues:r,secDateValues:l,hourValues:f,secHourValues:c}}function D(t,i){let s=[t.value,i.value];return j(t)&&j(i)?s:j(t)?[t.value,t.value]:j(i)?[i.value,i.value]:s}function S(t,i){let s=[t.value,i.value];return O(t)&&O(i)?s:O(t)?[t.value,t.value]:O(i)?[i.value,i.value]:s}function j(t){return b.objects.isDate(t.obj)&&b.dates.isIsoDate(t.value)}function O(t){return b.objects.isTime(t.obj)||b.objects.isTimeWithSeconds(t.obj)}function C(t,i){return j(t)||j(i)}function z(t,i){return O(t)||O(i)}function T(t,i,s,h,e,n){let o=()=>e.map((i=>r(h.find((t=>t.name==i)),t.cells[i])));return n&&(o=n),(null==e?void 0:e.length)>=2?o():[t.cells[i].value,t.cells[s].value]}class E{constructor(){this.showSecondaryDates=!1,this.detailFilter="",this.detailInitialScrollX=0,this.detailInitialScrollY=0,this.taskFilter="",this.taskInitialScrollX=0,this.taskInitialScrollY=0,this.viewMode="day"}toDebugString(){return"dt state"}}var H,M,P,W,I,R,V,Y,K,A,G,X,L,F,N,_,q,B,J,Q,U,Z,$,tt,it=function(t,i,s,h){if("a"===s&&!h)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!h:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?h:"a"===s?h.call(t):h?h.value:i.get(t)},st=function(t,i,s,h,e){if("m"===h)throw new TypeError("Private method is not writable");if("a"===h&&!e)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===h?e.call(t,s):e?e.value=s:i.set(t,s),s};const ht=class{constructor(s){t(this,s),this.kupClick=i(this,"kup-planner-click",6),this.kupDblClick=i(this,"kup-planner-dblclick",6),this.kupDateChange=i(this,"kup-planner-datechange",6),this.kupPhaseDrop=i(this,"kup-planner-phasedrop",6),this.kupReady=i(this,"kup-planner-ready",6),this.kupContextMenu=i(this,"kup-planner-contextmenu",6),this.kupDidUnload=i(this,"kup-planner-didunload",6),H.add(this),this.state=new E,this.plannerRenderer=void 0,M.set(this,a()),P.set(this,void 0),W.set(this,[]),I.set(this,{}),R.set(this,void 0),this.stateId="",this.store=void 0,this.customStyle="",this.data=void 0,this.detailData=void 0,this.detailColorCol=void 0,this.detailColumns=void 0,this.detailDates=void 0,this.detailFilter=void 0,this.detailHeight=void 0,this.detailHours=[],this.detailIconCol=void 0,this.detailIdCol=void 0,this.detailNameCol=void 0,this.detailPrevHours=[],this.detailPrevDates=void 0,this.detailInitialScrollX=void 0,this.detailInitialScrollY=void 0,this.listCellWidth="300px",this.maxWidth="90vw",this.phaseColorCol=void 0,this.phaseColumns=void 0,this.phaseColParDep=void 0,this.phaseDates=void 0,this.phaseHours=[],this.phaseIconCol=void 0,this.phaseIdCol=void 0,this.phaseNameCol=void 0,this.phasePrevHours=[],this.phasePrevDates=void 0,this.readOnly=!1,this.showSecondaryDates=!1,this.taskColumns=void 0,this.taskDates=void 0,this.taskFilter=void 0,this.taskHeight=void 0,this.taskHours=[],this.taskIconCol=void 0,this.taskIdCol=void 0,this.taskInitialScrollX=void 0,this.taskInitialScrollY=void 0,this.taskNameCol=void 0,this.taskPrevHours=[],this.taskPrevDates=void 0,this.titleMess=void 0,this.viewMode="month",this.mainFilter=void 0,this.secondaryFilter=void 0,this.scrollableTaskList=!1,this.plannerProps=void 0}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);null!=t&&(it(this,M,"f").debug.logMessage(this,"Initializing stateId "+this.stateId),this.detailFilter=t.detailFilter,this.showSecondaryDates=t.showSecondaryDates,this.detailInitialScrollX=t.detailInitialScrollX,this.detailInitialScrollY=t.detailInitialScrollY,this.taskFilter=t.taskFilter,this.taskInitialScrollX=t.taskInitialScrollX,this.taskInitialScrollY=t.taskInitialScrollY,this.viewMode=t.viewMode)}}persistState(){if(this.store&&this.stateId){let t=!1;it(this,M,"f").objects.deepEqual(this.state.detailFilter,it(this,R,"f").detailFilter)||(this.state.detailFilter=it(this,R,"f").detailFilter,t=!0),it(this,M,"f").objects.deepEqual(this.state.showSecondaryDates,it(this,R,"f").showSecondaryDates)||(this.state.showSecondaryDates=it(this,R,"f").showSecondaryDates,t=!0),it(this,M,"f").objects.deepEqual(this.state.detailInitialScrollX,it(this,R,"f").detailInitialScrollX)||(this.state.detailInitialScrollX=it(this,R,"f").detailInitialScrollX,t=!0),it(this,M,"f").objects.deepEqual(this.state.detailInitialScrollY,it(this,R,"f").detailInitialScrollY)||(this.state.detailInitialScrollY=it(this,R,"f").detailInitialScrollY,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskFilter,it(this,R,"f").taskFilter)||(this.state.taskFilter=it(this,R,"f").taskFilter,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskInitialScrollX,it(this,R,"f").taskInitialScrollX)||(this.state.taskInitialScrollX=it(this,R,"f").taskInitialScrollX,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskInitialScrollY,it(this,R,"f").taskInitialScrollY)||(this.state.taskInitialScrollY=it(this,R,"f").taskInitialScrollY,t=!0),it(this,M,"f").objects.deepEqual(this.state.viewMode,it(this,R,"f").viewMode)||(this.state.viewMode=it(this,R,"f").viewMode,t=!0),t&&(it(this,M,"f").debug.logMessage(this,"Persisting stateId "+this.stateId),this.store.persistState(this.stateId,this.state))}}dataChanged(){st(this,I,{},"f")}async getProps(t){return l(this,k,t)}async refresh(){s(this),this.plannerRenderer.refresh()}async setProps(t){f(this,k,t)}async addPhases(t,i){var s;const h=it(this,H,"m",K).call(this,t);h&&(it(this,I,"f")[t]=i,h.phases=null===(s=i.rows)||void 0===s?void 0:s.filter((t=>C(t.cells[this.phaseDates[0]],t.cells[this.phaseDates[1]]))).map((t=>{const s=x(t.cells[this.phaseDates[0]],t.cells[this.phaseDates[1]],t.cells[this.phasePrevDates[0]],t.cells[this.phasePrevDates[1]],t.cells[this.phaseHours[0]],t.cells[this.phaseHours[1]],t.cells[this.phasePrevHours[0]],t.cells[this.phasePrevHours[1]]),e=T(t,this.phaseIdCol,this.phaseNameCol,i.columns,this.phaseColumns,(()=>this.phaseColumns.map((s=>s==this.phaseDates[0]?"#START#":s==this.phaseDates[1]?"#END#":r(i.columns.find((t=>t.name==s)),t.cells[s])))));let n=it(this,H,"m",$).call(this,t,this.phaseIconCol),o=it(this,H,"m",tt).call(this,t,this.phaseIconCol);return{taskRow:h.taskRow,phaseRow:t,id:h.id+"_"+t.cells[this.phaseIdCol].value,phaseRowId:t.id,taskRowId:h.taskRowId,name:t.cells[this.phaseNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"task",color:t.cells[this.phaseColorCol].value,selectedColor:t.cells[this.phaseColorCol].value,valuesToShow:e,rowType:p.PHASE,icon:n?{url:n,color:null!=o?o:"#595959"}:void 0,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]}}))),this.plannerProps.mainGantt.initialScrollX=it(this,R,"f").taskInitialScrollX,this.plannerProps.mainGantt.initialScrollY=it(this,R,"f").taskInitialScrollY,this.plannerProps.secondaryGantt&&(this.plannerProps.secondaryGantt.initialScrollX=it(this,R,"f").detailInitialScrollX,this.plannerProps.secondaryGantt.initialScrollX=it(this,R,"f").detailInitialScrollY),this.plannerProps=Object.assign({},this.plannerProps),this.refresh()}componentWillLoad(){it(this,M,"f").debug.logLoad(this,!1),it(this,M,"f").theme.register(this),this.initWithPersistedState(),st(this,R,{detailFilter:this.detailFilter,detailInitialScrollX:this.detailInitialScrollX,detailInitialScrollY:this.detailInitialScrollY,showSecondaryDates:this.showSecondaryDates,taskFilter:this.taskFilter,taskInitialScrollX:this.taskInitialScrollX,taskInitialScrollY:this.taskInitialScrollY,viewMode:this.viewMode},"f")}componentDidLoad(){let t=it(this,H,"m",Y).call(this,it(this,H,"m",Z).call(this,it(this,R,"f").detailFilter,!0));const i=this.rootElement.shadowRoot.querySelector("#main-filter");y(i);const s=this.rootElement.shadowRoot.querySelector("#secondary-filter");let h,e,n;t&&y(s),this.plannerProps={mainGantt:{title:this.titleMess,items:it(this,H,"m",V).call(this,it(this,H,"m",Z).call(this,it(this,R,"f").taskFilter,!1)),stylingOptions:Object.assign(Object.assign({},u),{listCellWidth:this.listCellWidth}),filter:i,hideLabel:!0,ganttHeight:this.taskHeight,showSecondaryDates:it(this,R,"f").showSecondaryDates,onClick:t=>this.handleOnClick(t),onDblClick:t=>this.handleOnDblClick(t),onContextMenu:(t,i)=>this.handleOnContextMenu(t,i),onDateChange:t=>this.handleOnDateChange(t),initialScrollX:this.taskInitialScrollX,initialScrollY:this.taskInitialScrollY,readOnly:this.readOnly,onScrollY:t=>{window.clearTimeout(e),e=window.setTimeout((()=>this.handleTaskGanttScrollY(t)),500)},onPhaseDrop:t=>this.handleOnPhaseDrop(t)},secondaryGantt:t?{title:"",items:t,stylingOptions:Object.assign(Object.assign({},u),{listCellWidth:this.listCellWidth}),filter:s,hideLabel:!0,ganttHeight:this.detailHeight,onClick:t=>this.handleOnClick(t),onContextMenu:(t,i)=>this.handleOnContextMenu(t,i),onDateChange:t=>this.handleOnDateChange(t),initialScrollX:this.detailInitialScrollX,initialScrollY:this.detailInitialScrollY,readOnly:this.readOnly,onScrollY:t=>{window.clearTimeout(n),n=window.setTimeout((()=>this.handleDetailGanttScrollY(t)),500)}}:void 0,onSetDoubleView:t=>this.handleOnSetDoubleView(t),onSetViewMode:t=>this.handleOnSetViewMode(t),viewMode:this.viewMode,scrollableTaskList:this.scrollableTaskList,onScrollX:t=>{window.clearTimeout(h),h=window.setTimeout((()=>this.handleOnScrollX(t)),500)}},this.kupReady.emit({comp:this,id:this.rootElement.id,value:void 0}),this.taskFilter&&it(this,H,"m",U).call(this,this.taskFilter),this.detailFilter&&it(this,H,"m",U).call(this,this.detailFilter,!0),it(this,M,"f").debug.logLoad(this,!0)}componentDidRender(){this.persistState(),it(this,M,"f").debug.logRender(this,!0)}onKupDblClick(t,i){this.kupDblClick.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupClick(t,i){this.kupClick.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupContextMenu(t,i,s){let h,e,n;switch(i.type){case"project":h=i.taskRow,e=h.cells[this.taskIdCol],n=this.data.columns[this.taskIdCol];break;case"task":h=i.phaseRow,e=h.cells[this.phaseIdCol];break;case"timeline":h=i.detailRow,e=h.cells[this.detailIdCol],n=this.data.columns[this.detailIdCol]}this.kupContextMenu.emit({comp:this,id:this.rootElement.id,value:i,taskAction:s,details:{cell:e,column:n,originalEvent:t,row:h}})}onKupDateChange(t,i){this.kupDateChange.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupPhaseDrop(t,i){this.kupPhaseDrop.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}handleOnDblClick(t){switch(t.rowType){case p.TASK:it(this,H,"m",G).call(this)&&this.onKupDblClick(t,m.onDblClick);break;case p.PHASE:it(this,H,"m",X).call(this)&&this.onKupDblClick(t,m.onDblClick);break;case p.DETAIL:it(this,H,"m",L).call(this)&&this.onKupDblClick(t,m.onDblClick)}for(let t=0;t<it(this,W,"f").length;t++)clearTimeout(it(this,W,"f")[t]),it(this,M,"f").debug.logMessage(this,"Cleared click timeout("+it(this,W,"f")[t]+").");st(this,W,[],"f")}handleOnClick(t){it(this,W,"f").push(setTimeout((()=>{switch(t.rowType){case p.TASK:const i=t.phases?m.onTaskClosing:m.onTaskOpening;it(this,H,"m",F).call(this,t)&&this.onKupClick(t,i);break;case p.PHASE:it(this,H,"m",N).call(this)&&this.onKupClick(t,m.onClick);break;case p.DETAIL:it(this,H,"m",_).call(this)&&this.onKupClick(t,m.onClick)}}),300))}handleOnContextMenu(t,i){switch(i.rowType){case p.TASK:it(this,H,"m",q).call(this)&&this.onKupContextMenu(t,i,m.onRightClick);break;case p.PHASE:it(this,H,"m",B).call(this)&&this.onKupContextMenu(t,i,m.onRightClick);break;case p.DETAIL:it(this,H,"m",J).call(this)&&this.onKupContextMenu(t,i,m.onRightClick)}}handleOnSetDoubleView(t){var i;it(this,R,"f").showSecondaryDates=t,(null===(i=this.plannerProps)||void 0===i?void 0:i.mainGantt)&&(this.plannerProps.mainGantt.showSecondaryDates=t),this.persistState()}handleOnSetViewMode(t){it(this,R,"f").viewMode=t,this.plannerProps.viewMode=t,this.persistState()}handleOnScrollX(t){it(this,R,"f").taskInitialScrollX=t,it(this,R,"f").detailInitialScrollX=t,this.persistState()}handleTaskGanttScrollY(t){it(this,R,"f").taskInitialScrollY=t,this.persistState()}handleDetailGanttScrollY(t){it(this,R,"f").detailInitialScrollY=t,this.persistState()}handleOnDateChange(t){it(this,H,"m",Q).call(this,t)&&t.rowType!=p.DETAIL&&this.onKupDateChange(t,m.onResize)}handleOnPhaseDrop(t){this.onKupPhaseDrop(t,m.onTask)}render(){var t,i,s;const n=this.plannerProps?Object.assign(Object.assign({},this.plannerProps),{onSetDoubleView:this.handleOnSetDoubleView.bind(this),onSetViewMode:this.handleOnSetViewMode.bind(this),onScrollX:this.handleOnScrollX.bind(this),mainGantt:Object.assign(Object.assign({},null===(t=this.plannerProps)||void 0===t?void 0:t.mainGantt),{onScrollY:this.handleTaskGanttScrollY.bind(this)})}):null;return(null===(i=this.plannerProps)||void 0===i?void 0:i.secondaryGantt)&&(n.secondaryGantt=Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{onScrollY:this.handleDetailGanttScrollY.bind(this)})),h(e,{key:"f1d17c16a83023bea2595dd712b6192d100f4f2f"},h("style",{key:"9a0004d1178c0c4385284034249473113a0cf9c3"},it(this,M,"f").theme.setKupStyle(this.rootElement)),h("div",{key:"491d41b97f430ff522e616e420f4123cfa614c75",id:w,style:{maxWidth:this.maxWidth}},this.plannerProps&&h("kup-planner-renderer",{key:"2a1f25cc0196bce9f584206c4fca4ff211361118",props:n,ref:t=>this.plannerRenderer=t})),h("div",{key:"6ccd603983ab126d118da39a7160811b1d86b951",style:{display:this.plannerProps?"none":""}},h(g,{key:"5addcfc4cab563c984e2363e4a4692ee66099f74",icon:c.SEARCH,id:"main-filter",label:it(this,M,"f").language.translate(d.SEARCH),onKeyDown:t=>{"Enter"===t.key&&it(this,H,"m",U).call(this,t.target.value)},value:this.taskFilter,wrapperClass:"filter"}),(null===(s=this.detailData)||void 0===s?void 0:s.rows)&&this.detailData.rows.length>0?h(g,{icon:c.SEARCH,id:"secondary-filter",label:it(this,M,"f").language.translate(d.SEARCH),onKeyDown:t=>{"Enter"===t.key&&it(this,H,"m",U).call(this,t.target.value,!0)},value:this.detailFilter,wrapperClass:"filter"}):null))}disconnectedCallback(){it(this,M,"f").theme.unregister(this),this.kupDidUnload.emit({comp:this,id:this.rootElement.id,storedSettings:it(this,R,"f")})}get rootElement(){return n(this)}static get watchers(){return{data:["dataChanged"]}}};M=new WeakMap,P=new WeakMap,W=new WeakMap,I=new WeakMap,R=new WeakMap,H=new WeakSet,V=function(t){var i;return t&&t.rows?null===(i=t.rows)||void 0===i?void 0:i.filter((t=>C(t.cells[this.taskDates[0]],t.cells[this.taskDates[1]]))).map((i=>{const s=x(i.cells[this.taskDates[0]],i.cells[this.taskDates[1]],i.cells[this.taskPrevDates[0]],i.cells[this.taskPrevDates[1]],i.cells[this.taskHours[0]],i.cells[this.taskHours[1]],i.cells[this.taskPrevHours[0]],i.cells[this.taskPrevHours[1]]),h=T(i,this.taskIdCol,this.taskNameCol,t.columns,this.taskColumns,(()=>this.taskColumns.map((s=>s==this.taskDates[0]?"#START#":s==this.taskDates[1]?"#END#":r(t.columns.find((t=>t.name==s)),i.cells[s])))));let e=it(this,H,"m",$).call(this,i,this.taskIconCol),n=it(this,H,"m",tt).call(this,i,this.taskIconCol);return{taskRow:i,taskRowId:i.id,id:i.cells[this.taskIdCol].value,name:i.cells[this.taskNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"project",valuesToShow:h,rowType:p.TASK,icon:e?{url:e,color:null!=n?n:"#595959"}:void 0,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]}})):[]},Y=function(t){if(!t||!t.rows)return;let i=[];return t.rows.filter((t=>C(t.cells[this.detailDates[0]],t.cells[this.detailDates[1]]))).forEach((s=>{var h,e;const n=s.cells[this.detailIdCol].value,o=s.cells[this.detailNameCol].value,a=x(s.cells[this.detailDates[0]],s.cells[this.detailDates[1]],void 0,void 0,s.cells[this.detailHours[0]],s.cells[this.detailHours[1]]),r=T(s,this.detailIdCol,this.detailNameCol,t.columns,this.detailColumns);let l=i.find((t=>t.id==n));l||(l={id:n,name:o,detailRow:s,type:"timeline",valuesToShow:r,rowType:p.DETAIL,schedule:[]},i.push(l));let f=it(this,H,"m",$).call(this,s,this.detailIconCol),c=it(this,H,"m",tt).call(this,s,this.detailIconCol);l.schedule.push({startDate:a.dateValues[0],endDate:a.dateValues[1],color:this.detailColorCol&&null!==(h=s.cells[this.detailColorCol].value)&&void 0!==h?h:"#D9D9D8",selectedColor:this.detailColorCol&&null!==(e=s.cells[this.detailColorCol].value)&&void 0!==e?e:"#D9D9D8",icon:f?{url:f,color:null!=c?c:"#595959"}:void 0,startHour:a.hourValues[0],endHour:a.hourValues[1]})})),i},K=function(t){return this.plannerProps.mainGantt.items.find((i=>i.id==t))},A=function(t){const i=it(this,H,"m",K).call(this,t);i&&(i.phases=void 0),this.plannerProps=Object.assign({},this.plannerProps)},G=function(){return!0},X=function(){return!0},L=function(){return!0},F=function(t){const i=it(this,H,"m",K).call(this,t.id);return(null==i?void 0:i.phases)&&it(this,H,"m",A).call(this,i.id),!0},N=function(){return!0},_=function(){return!0},q=function(){return!0},B=function(){return!0},J=function(){return!0},Q=function(t){let i=!1;return it(this,P,"f")?it(this,P,"f").isEquivalent(t)||(st(this,P,new v(t),"f"),i=!0):(i=!0,st(this,P,new v(t),"f")),i},U=function(t,i){i?it(this,R,"f").detailFilter=t:it(this,R,"f").taskFilter=t;const s=i?{secondaryGantt:Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{items:it(this,H,"m",Y).call(this,it(this,H,"m",Z).call(this,t,i))})}:{mainGantt:Object.assign(Object.assign({},this.plannerProps.mainGantt),{items:it(this,H,"m",V).call(this,it(this,H,"m",Z).call(this,t,i))})};this.plannerProps=Object.assign(Object.assign({},this.plannerProps),s),this.persistState()},Z=function(t,i){const s=i?this.detailData:this.data;if(!s||!s.rows||0==s.rows.length)return;if(!t)return s;const h={columns:this.data.columns,rows:[]},e=[];for(let i=0;i<s.rows.length;i++){const h=s.rows[i],n=h.cells;for(let i=0;i<s.columns.length;i++){const o=n[s.columns[i].name];if(o&&r(s.columns[i],o).toLowerCase().indexOf(t.toLowerCase())>-1){e.push({row:h,weight:i});break}}}return e.sort(((t,i)=>t.weight-i.weight)).forEach((t=>{h.rows.push(t.row)})),h},$=function(t,i){var s;let h;if(i){const e=t.cells[i];let n=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.resource;n||(n=e.value),n&&(h=o("./assets/svg/"+n+".svg"))}return h},tt=function(t,i){var s;let h;if(i){const e=t.cells[i];h=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.color,h&&(h=it(this,M,"f").theme.colorCheck(h).hexColor)}return h},ht.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{display:block}.filter{margin-bottom:var(--kup-space-04)}.planner-render{padding-top:40px}";export{ht as kup_planner}
1
+ import{r as t,c as i,f as s,h,H as e,d as n,g as o}from"./p-710d0a7d.js";import{k as a,ai as r,g as l,s as f,d as c,u as d}from"./p-84a053a8.js";import{K as p,d as u,a as m,b as v,c as k}from"./p-cd3a7d53.js";import{c as w}from"./p-635bb4b3.js";import{F as g}from"./p-9ffccc52.js";import{F as y}from"./p-7db300e0.js";import"./p-cabebabc.js";import"./p-3cab6420.js";import"./p-c56195a0.js";const b=a();function x(t,i,s,h,e,n,o,a){const r=D(t,i);let l=[];s&&h&&(l=C(s,h)?D(s,h):[...r]);let f=[];e&&n&&(z(e,n)?f=S(e,n):l=[...r]);let c=[];return o&&a&&(z(o,a)?c=S(o,a):l=[...r]),{dateValues:r,secDateValues:l,hourValues:f,secHourValues:c}}function D(t,i){let s=[t.value,i.value];return j(t)&&j(i)?s:j(t)?[t.value,t.value]:j(i)?[i.value,i.value]:s}function S(t,i){let s=[t.value,i.value];return O(t)&&O(i)?s:O(t)?[t.value,t.value]:O(i)?[i.value,i.value]:s}function j(t){return b.objects.isDate(t.obj)&&b.dates.isIsoDate(t.value)}function O(t){return b.objects.isTime(t.obj)||b.objects.isTimeWithSeconds(t.obj)}function C(t,i){return j(t)||j(i)}function z(t,i){return O(t)||O(i)}function T(t,i,s,h,e,n){let o=()=>e.map((i=>r(h.find((t=>t.name==i)),t.cells[i])));return n&&(o=n),(null==e?void 0:e.length)>=2?o():[t.cells[i].value,t.cells[s].value]}class E{constructor(){this.showSecondaryDates=!1,this.detailFilter="",this.detailInitialScrollX=0,this.detailInitialScrollY=0,this.taskFilter="",this.taskInitialScrollX=0,this.taskInitialScrollY=0,this.viewMode="day"}toDebugString(){return"dt state"}}var H,M,P,W,I,R,V,Y,K,A,G,X,L,F,N,_,q,B,J,Q,U,Z,$,tt,it=function(t,i,s,h){if("a"===s&&!h)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!h:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?h:"a"===s?h.call(t):h?h.value:i.get(t)},st=function(t,i,s,h,e){if("m"===h)throw new TypeError("Private method is not writable");if("a"===h&&!e)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===h?e.call(t,s):e?e.value=s:i.set(t,s),s};const ht=class{constructor(s){t(this,s),this.kupClick=i(this,"kup-planner-click",6),this.kupDblClick=i(this,"kup-planner-dblclick",6),this.kupDateChange=i(this,"kup-planner-datechange",6),this.kupPhaseDrop=i(this,"kup-planner-phasedrop",6),this.kupReady=i(this,"kup-planner-ready",6),this.kupContextMenu=i(this,"kup-planner-contextmenu",6),this.kupDidUnload=i(this,"kup-planner-didunload",6),H.add(this),this.state=new E,this.plannerRenderer=void 0,M.set(this,a()),P.set(this,void 0),W.set(this,[]),I.set(this,{}),R.set(this,void 0),this.stateId="",this.store=void 0,this.customStyle="",this.data=void 0,this.detailData=void 0,this.detailColorCol=void 0,this.detailColumns=void 0,this.detailDates=void 0,this.detailFilter=void 0,this.detailHeight=void 0,this.detailHours=[],this.detailIconCol=void 0,this.detailIdCol=void 0,this.detailNameCol=void 0,this.detailPrevHours=[],this.detailPrevDates=void 0,this.detailInitialScrollX=void 0,this.detailInitialScrollY=void 0,this.listCellWidth="300px",this.maxWidth="90vw",this.phaseColorCol=void 0,this.phaseColumns=void 0,this.phaseColParDep=void 0,this.phaseDates=void 0,this.phaseHours=[],this.phaseIconCol=void 0,this.phaseIdCol=void 0,this.phaseNameCol=void 0,this.phasePrevHours=[],this.phasePrevDates=void 0,this.readOnly=!1,this.showSecondaryDates=!1,this.taskColumns=void 0,this.taskDates=void 0,this.taskFilter=void 0,this.taskHeight=void 0,this.taskHours=[],this.taskIconCol=void 0,this.taskIdCol=void 0,this.taskInitialScrollX=void 0,this.taskInitialScrollY=void 0,this.taskNameCol=void 0,this.taskPrevHours=[],this.taskPrevDates=void 0,this.titleMess=void 0,this.viewMode="month",this.mainFilter=void 0,this.secondaryFilter=void 0,this.scrollableTaskList=!1,this.plannerProps=void 0}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);null!=t&&(it(this,M,"f").debug.logMessage(this,"Initializing stateId "+this.stateId),this.detailFilter=t.detailFilter,this.showSecondaryDates=t.showSecondaryDates,this.detailInitialScrollX=t.detailInitialScrollX,this.detailInitialScrollY=t.detailInitialScrollY,this.taskFilter=t.taskFilter,this.taskInitialScrollX=t.taskInitialScrollX,this.taskInitialScrollY=t.taskInitialScrollY,this.viewMode=t.viewMode)}}persistState(){if(this.store&&this.stateId){let t=!1;it(this,M,"f").objects.deepEqual(this.state.detailFilter,it(this,R,"f").detailFilter)||(this.state.detailFilter=it(this,R,"f").detailFilter,t=!0),it(this,M,"f").objects.deepEqual(this.state.showSecondaryDates,it(this,R,"f").showSecondaryDates)||(this.state.showSecondaryDates=it(this,R,"f").showSecondaryDates,t=!0),it(this,M,"f").objects.deepEqual(this.state.detailInitialScrollX,it(this,R,"f").detailInitialScrollX)||(this.state.detailInitialScrollX=it(this,R,"f").detailInitialScrollX,t=!0),it(this,M,"f").objects.deepEqual(this.state.detailInitialScrollY,it(this,R,"f").detailInitialScrollY)||(this.state.detailInitialScrollY=it(this,R,"f").detailInitialScrollY,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskFilter,it(this,R,"f").taskFilter)||(this.state.taskFilter=it(this,R,"f").taskFilter,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskInitialScrollX,it(this,R,"f").taskInitialScrollX)||(this.state.taskInitialScrollX=it(this,R,"f").taskInitialScrollX,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskInitialScrollY,it(this,R,"f").taskInitialScrollY)||(this.state.taskInitialScrollY=it(this,R,"f").taskInitialScrollY,t=!0),it(this,M,"f").objects.deepEqual(this.state.viewMode,it(this,R,"f").viewMode)||(this.state.viewMode=it(this,R,"f").viewMode,t=!0),t&&(it(this,M,"f").debug.logMessage(this,"Persisting stateId "+this.stateId),this.store.persistState(this.stateId,this.state))}}dataChanged(){st(this,I,{},"f")}async getProps(t){return l(this,k,t)}async refresh(){s(this),this.plannerRenderer.refresh()}async setProps(t){f(this,k,t)}async addPhases(t,i){var s;const h=it(this,H,"m",K).call(this,t);h&&(it(this,I,"f")[t]=i,h.phases=null===(s=i.rows)||void 0===s?void 0:s.filter((t=>C(t.cells[this.phaseDates[0]],t.cells[this.phaseDates[1]]))).map((t=>{const s=x(t.cells[this.phaseDates[0]],t.cells[this.phaseDates[1]],t.cells[this.phasePrevDates[0]],t.cells[this.phasePrevDates[1]],t.cells[this.phaseHours[0]],t.cells[this.phaseHours[1]],t.cells[this.phasePrevHours[0]],t.cells[this.phasePrevHours[1]]),e=T(t,this.phaseIdCol,this.phaseNameCol,i.columns,this.phaseColumns,(()=>this.phaseColumns.map((s=>s==this.phaseDates[0]?"#START#":s==this.phaseDates[1]?"#END#":r(i.columns.find((t=>t.name==s)),t.cells[s])))));let n=it(this,H,"m",$).call(this,t,this.phaseIconCol),o=it(this,H,"m",tt).call(this,t,this.phaseIconCol);return{taskRow:h.taskRow,phaseRow:t,id:h.id+"_"+t.cells[this.phaseIdCol].value,phaseRowId:t.id,taskRowId:h.taskRowId,name:t.cells[this.phaseNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"task",color:t.cells[this.phaseColorCol].value,selectedColor:t.cells[this.phaseColorCol].value,valuesToShow:e,rowType:p.PHASE,icon:n?{url:n,color:null!=o?o:"#595959"}:void 0,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]}}))),this.plannerProps.mainGantt.initialScrollX=it(this,R,"f").taskInitialScrollX,this.plannerProps.mainGantt.initialScrollY=it(this,R,"f").taskInitialScrollY,this.plannerProps.secondaryGantt&&(this.plannerProps.secondaryGantt.initialScrollX=it(this,R,"f").detailInitialScrollX,this.plannerProps.secondaryGantt.initialScrollX=it(this,R,"f").detailInitialScrollY),this.plannerProps=Object.assign({},this.plannerProps),this.refresh()}componentWillLoad(){it(this,M,"f").debug.logLoad(this,!1),it(this,M,"f").theme.register(this),this.initWithPersistedState(),st(this,R,{detailFilter:this.detailFilter,detailInitialScrollX:this.detailInitialScrollX,detailInitialScrollY:this.detailInitialScrollY,showSecondaryDates:this.showSecondaryDates,taskFilter:this.taskFilter,taskInitialScrollX:this.taskInitialScrollX,taskInitialScrollY:this.taskInitialScrollY,viewMode:this.viewMode},"f")}componentDidLoad(){let t=it(this,H,"m",Y).call(this,it(this,H,"m",Z).call(this,it(this,R,"f").detailFilter,!0));const i=this.rootElement.shadowRoot.querySelector("#main-filter");y(i);const s=this.rootElement.shadowRoot.querySelector("#secondary-filter");let h,e,n;t&&y(s),this.plannerProps={mainGantt:{title:this.titleMess,items:it(this,H,"m",V).call(this,it(this,H,"m",Z).call(this,it(this,R,"f").taskFilter,!1)),stylingOptions:Object.assign(Object.assign({},u),{listCellWidth:this.listCellWidth}),filter:i,hideLabel:!0,ganttHeight:this.taskHeight,showSecondaryDates:it(this,R,"f").showSecondaryDates,onClick:t=>this.handleOnClick(t),onDblClick:t=>this.handleOnDblClick(t),onContextMenu:(t,i)=>this.handleOnContextMenu(t,i),onDateChange:t=>this.handleOnDateChange(t),initialScrollX:this.taskInitialScrollX,initialScrollY:this.taskInitialScrollY,readOnly:this.readOnly,onScrollY:t=>{window.clearTimeout(e),e=window.setTimeout((()=>this.handleTaskGanttScrollY(t)),500)},onPhaseDrop:t=>this.handleOnPhaseDrop(t)},secondaryGantt:t?{title:"",items:t,stylingOptions:Object.assign(Object.assign({},u),{listCellWidth:this.listCellWidth}),filter:s,hideLabel:!0,ganttHeight:this.detailHeight,onClick:t=>this.handleOnClick(t),onContextMenu:(t,i)=>this.handleOnContextMenu(t,i),onDateChange:t=>this.handleOnDateChange(t),initialScrollX:this.detailInitialScrollX,initialScrollY:this.detailInitialScrollY,readOnly:this.readOnly,onScrollY:t=>{window.clearTimeout(n),n=window.setTimeout((()=>this.handleDetailGanttScrollY(t)),500)}}:void 0,onSetDoubleView:t=>this.handleOnSetDoubleView(t),onSetViewMode:t=>this.handleOnSetViewMode(t),viewMode:this.viewMode,scrollableTaskList:this.scrollableTaskList,onScrollX:t=>{window.clearTimeout(h),h=window.setTimeout((()=>this.handleOnScrollX(t)),500)}},this.kupReady.emit({comp:this,id:this.rootElement.id,value:void 0}),this.taskFilter&&it(this,H,"m",U).call(this,this.taskFilter),this.detailFilter&&it(this,H,"m",U).call(this,this.detailFilter,!0),it(this,M,"f").debug.logLoad(this,!0)}componentDidRender(){this.persistState(),it(this,M,"f").debug.logRender(this,!0)}onKupDblClick(t,i){this.kupDblClick.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupClick(t,i){this.kupClick.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupContextMenu(t,i,s){let h,e,n;switch(i.type){case"project":h=i.taskRow,e=h.cells[this.taskIdCol],n=this.data.columns[this.taskIdCol];break;case"task":h=i.phaseRow,e=h.cells[this.phaseIdCol];break;case"timeline":h=i.detailRow,e=h.cells[this.detailIdCol],n=this.data.columns[this.detailIdCol]}this.kupContextMenu.emit({comp:this,id:this.rootElement.id,value:i,taskAction:s,details:{cell:e,column:n,originalEvent:t,row:h}})}onKupDateChange(t,i){this.kupDateChange.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupPhaseDrop(t,i){this.kupPhaseDrop.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}handleOnDblClick(t){switch(t.rowType){case p.TASK:it(this,H,"m",G).call(this)&&this.onKupDblClick(t,m.onDblClick);break;case p.PHASE:it(this,H,"m",X).call(this)&&this.onKupDblClick(t,m.onDblClick);break;case p.DETAIL:it(this,H,"m",L).call(this)&&this.onKupDblClick(t,m.onDblClick)}for(let t=0;t<it(this,W,"f").length;t++)clearTimeout(it(this,W,"f")[t]),it(this,M,"f").debug.logMessage(this,"Cleared click timeout("+it(this,W,"f")[t]+").");st(this,W,[],"f")}handleOnClick(t){it(this,W,"f").push(setTimeout((()=>{switch(t.rowType){case p.TASK:const i=t.phases?m.onTaskClosing:m.onTaskOpening;it(this,H,"m",F).call(this,t)&&this.onKupClick(t,i);break;case p.PHASE:it(this,H,"m",N).call(this)&&this.onKupClick(t,m.onClick);break;case p.DETAIL:it(this,H,"m",_).call(this)&&this.onKupClick(t,m.onClick)}}),300))}handleOnContextMenu(t,i){switch(i.rowType){case p.TASK:it(this,H,"m",q).call(this)&&this.onKupContextMenu(t,i,m.onRightClick);break;case p.PHASE:it(this,H,"m",B).call(this)&&this.onKupContextMenu(t,i,m.onRightClick);break;case p.DETAIL:it(this,H,"m",J).call(this)&&this.onKupContextMenu(t,i,m.onRightClick)}}handleOnSetDoubleView(t){var i;it(this,R,"f").showSecondaryDates=t,(null===(i=this.plannerProps)||void 0===i?void 0:i.mainGantt)&&(this.plannerProps.mainGantt.showSecondaryDates=t),this.persistState()}handleOnSetViewMode(t){it(this,R,"f").viewMode=t,this.plannerProps.viewMode=t,this.persistState()}handleOnScrollX(t){it(this,R,"f").taskInitialScrollX=t,it(this,R,"f").detailInitialScrollX=t,this.persistState()}handleTaskGanttScrollY(t){it(this,R,"f").taskInitialScrollY=t,this.persistState()}handleDetailGanttScrollY(t){it(this,R,"f").detailInitialScrollY=t,this.persistState()}handleOnDateChange(t){it(this,H,"m",Q).call(this,t)&&t.rowType!=p.DETAIL&&this.onKupDateChange(t,m.onResize)}handleOnPhaseDrop(t){this.onKupPhaseDrop(t,m.onTask)}render(){var t,i,s;const n=this.plannerProps?Object.assign(Object.assign({},this.plannerProps),{onSetDoubleView:this.handleOnSetDoubleView.bind(this),onSetViewMode:this.handleOnSetViewMode.bind(this),onScrollX:this.handleOnScrollX.bind(this),mainGantt:Object.assign(Object.assign({},null===(t=this.plannerProps)||void 0===t?void 0:t.mainGantt),{onScrollY:this.handleTaskGanttScrollY.bind(this)})}):null;return(null===(i=this.plannerProps)||void 0===i?void 0:i.secondaryGantt)&&(n.secondaryGantt=Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{onScrollY:this.handleDetailGanttScrollY.bind(this)})),h(e,{key:"f1d17c16a83023bea2595dd712b6192d100f4f2f"},h("style",{key:"9a0004d1178c0c4385284034249473113a0cf9c3"},it(this,M,"f").theme.setKupStyle(this.rootElement)),h("div",{key:"491d41b97f430ff522e616e420f4123cfa614c75",id:w,style:{maxWidth:this.maxWidth}},this.plannerProps&&h("kup-planner-renderer",{key:"2a1f25cc0196bce9f584206c4fca4ff211361118",props:n,ref:t=>this.plannerRenderer=t})),h("div",{key:"6ccd603983ab126d118da39a7160811b1d86b951",style:{display:this.plannerProps?"none":""}},h(g,{key:"5addcfc4cab563c984e2363e4a4692ee66099f74",icon:c.SEARCH,id:"main-filter",label:it(this,M,"f").language.translate(d.SEARCH),onKeyDown:t=>{"Enter"===t.key&&it(this,H,"m",U).call(this,t.target.value)},value:this.taskFilter,wrapperClass:"filter"}),(null===(s=this.detailData)||void 0===s?void 0:s.rows)&&this.detailData.rows.length>0?h(g,{icon:c.SEARCH,id:"secondary-filter",label:it(this,M,"f").language.translate(d.SEARCH),onKeyDown:t=>{"Enter"===t.key&&it(this,H,"m",U).call(this,t.target.value,!0)},value:this.detailFilter,wrapperClass:"filter"}):null))}disconnectedCallback(){it(this,M,"f").theme.unregister(this),this.kupDidUnload.emit({comp:this,id:this.rootElement.id,storedSettings:it(this,R,"f")})}get rootElement(){return n(this)}static get watchers(){return{data:["dataChanged"]}}};M=new WeakMap,P=new WeakMap,W=new WeakMap,I=new WeakMap,R=new WeakMap,H=new WeakSet,V=function(t){var i;return t&&t.rows?null===(i=t.rows)||void 0===i?void 0:i.filter((t=>C(t.cells[this.taskDates[0]],t.cells[this.taskDates[1]]))).map((i=>{const s=x(i.cells[this.taskDates[0]],i.cells[this.taskDates[1]],i.cells[this.taskPrevDates[0]],i.cells[this.taskPrevDates[1]],i.cells[this.taskHours[0]],i.cells[this.taskHours[1]],i.cells[this.taskPrevHours[0]],i.cells[this.taskPrevHours[1]]),h=T(i,this.taskIdCol,this.taskNameCol,t.columns,this.taskColumns,(()=>this.taskColumns.map((s=>s==this.taskDates[0]?"#START#":s==this.taskDates[1]?"#END#":r(t.columns.find((t=>t.name==s)),i.cells[s])))));let e=it(this,H,"m",$).call(this,i,this.taskIconCol),n=it(this,H,"m",tt).call(this,i,this.taskIconCol);return{taskRow:i,taskRowId:i.id,id:i.cells[this.taskIdCol].value,name:i.cells[this.taskNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"project",valuesToShow:h,rowType:p.TASK,icon:e?{url:e,color:null!=n?n:"#595959"}:void 0,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]}})):[]},Y=function(t){if(!t||!t.rows)return;let i=[];return t.rows.filter((t=>C(t.cells[this.detailDates[0]],t.cells[this.detailDates[1]]))).forEach((s=>{var h,e;const n=s.cells[this.detailIdCol].value,o=s.cells[this.detailNameCol].value,a=x(s.cells[this.detailDates[0]],s.cells[this.detailDates[1]],void 0,void 0,s.cells[this.detailHours[0]],s.cells[this.detailHours[1]]),r=T(s,this.detailIdCol,this.detailNameCol,t.columns,this.detailColumns);let l=i.find((t=>t.id==n));l||(l={id:n,name:o,detailRow:s,type:"timeline",valuesToShow:r,rowType:p.DETAIL,schedule:[]},i.push(l));let f=it(this,H,"m",$).call(this,s,this.detailIconCol),c=it(this,H,"m",tt).call(this,s,this.detailIconCol);l.schedule.push({startDate:a.dateValues[0],endDate:a.dateValues[1],color:this.detailColorCol&&null!==(h=s.cells[this.detailColorCol].value)&&void 0!==h?h:"#D9D9D8",selectedColor:this.detailColorCol&&null!==(e=s.cells[this.detailColorCol].value)&&void 0!==e?e:"#D9D9D8",icon:f?{url:f,color:null!=c?c:"#595959"}:void 0,startHour:a.hourValues[0],endHour:a.hourValues[1]})})),i},K=function(t){return this.plannerProps.mainGantt.items.find((i=>i.id==t))},A=function(t){const i=it(this,H,"m",K).call(this,t);i&&(i.phases=void 0),this.plannerProps=Object.assign({},this.plannerProps)},G=function(){return!0},X=function(){return!0},L=function(){return!0},F=function(t){const i=it(this,H,"m",K).call(this,t.id);return(null==i?void 0:i.phases)&&it(this,H,"m",A).call(this,i.id),!0},N=function(){return!0},_=function(){return!0},q=function(){return!0},B=function(){return!0},J=function(){return!0},Q=function(t){let i=!1;return it(this,P,"f")?it(this,P,"f").isEquivalent(t)||(st(this,P,new v(t),"f"),i=!0):(i=!0,st(this,P,new v(t),"f")),i},U=function(t,i){i?it(this,R,"f").detailFilter=t:it(this,R,"f").taskFilter=t;const s=i?{secondaryGantt:Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{items:it(this,H,"m",Y).call(this,it(this,H,"m",Z).call(this,t,i))})}:{mainGantt:Object.assign(Object.assign({},this.plannerProps.mainGantt),{items:it(this,H,"m",V).call(this,it(this,H,"m",Z).call(this,t,i))})};this.plannerProps=Object.assign(Object.assign({},this.plannerProps),s),this.persistState()},Z=function(t,i){const s=i?this.detailData:this.data;if(!s||!s.rows||0==s.rows.length)return;if(!t)return s;const h={columns:this.data.columns,rows:[]},e=[];for(let i=0;i<s.rows.length;i++){const h=s.rows[i],n=h.cells;for(let i=0;i<s.columns.length;i++){const o=n[s.columns[i].name];if(o&&r(s.columns[i],o).toLowerCase().indexOf(t.toLowerCase())>-1){e.push({row:h,weight:i});break}}}return e.sort(((t,i)=>t.weight-i.weight)).forEach((t=>{h.rows.push(t.row)})),h},$=function(t,i){var s;let h;if(i){const e=t.cells[i];let n=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.resource;n||(n=e.value),n&&(h=o("./assets/svg/"+n+".svg"))}return h},tt=function(t,i){var s;let h;if(i){const e=t.cells[i];h=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.color,h&&(h=it(this,M,"f").theme.colorCheck(h).hexColor)}return h},ht.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{display:block}.filter{margin-bottom:var(--kup-space-04)}.planner-render{padding-top:40px}";export{ht as kup_planner}
@@ -1 +1 @@
1
- import{r as t,c as i,f as e,h as s,H as n,d as a}from"./p-710d0a7d.js";import{k as o,i as p,aA as h,g as f,s as l,Y as r,aB as c,b as m,aC as d}from"./p-8a108d52.js";import{c as g}from"./p-635bb4b3.js";import{F as u}from"./p-c4224227.js";import{F as k}from"./p-45495c9b.js";import"./p-cabebabc.js";import"./p-e3062c19.js";import"./p-3cab6420.js";import"./p-9f9428d1.js";import"./p-ce3de714.js";import"./p-1f3d3baa.js";import"./p-b40cde24.js";var y,x=function(t,i,e,s){if("a"===e&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!s:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?s:"a"===e?s.call(t):s?s.value:i.get(t)};const b=class{constructor(e){t(this,e),this.kupCellSubmitClick=i(this,"kup-cell-submit-click",6),this.kupCellUpload=i(this,"kup-cell-upload",6),y.set(this,o()),this.customStyle="",this.data=null,this.density=p.NONE,this.dragEnabled=!1,this.showSubmit=!1,this.submitPosition=h.right}async addCssClasses(t){if(this.data.cssClass||(this.data.cssClass=""),t)for(let i=0;i<t.length;i++){const e=t[i];this.data.cssClass.indexOf(e)<0&&(this.data.cssClass+=` ${e}`)}this.refresh()}async getProps(t){return f(this,d,t)}async refresh(){e(this)}async removeCssClasses(t){if(this.data.cssClass){if(t)for(let i=0;i<t.length;i++){const e=t[i];this.data.cssClass.indexOf(e)>0&&(this.data.cssClass=this.data.cssClass.replace(new RegExp(e,"g"),""))}this.refresh()}}async setProps(t){l(this,d,t)}didRenderInteractables(){if(this.dragEnabled){const t=()=>({cell:this.data,column:this.generateColumn(),id:this.rootElement.id,multiple:!1,row:this.generateRow()});x(this,y,"f").interact.draggable(this.rootElement.shadowRoot.querySelector("#"+g),{cursorChecker:()=>null},{callback:t},r.BADGE)}}generateColumn(){return{name:"KUPCELL",title:void 0}}generateRow(){const t=this.generateColumn(),i={cells:{}};return i.cells[t.name]=this.data,i}submitClick(t){t.stopPropagation(),this.kupCellSubmitClick.emit({comp:this,id:this.rootElement.id,cell:this.data})}upload(t){t.stopPropagation(),this.kupCellUpload.emit(t.detail)}componentWillLoad(){x(this,y,"f").dates.register(this),x(this,y,"f").debug.logLoad(this,!1),x(this,y,"f").language.register(this),x(this,y,"f").theme.register(this)}componentDidLoad(){x(this,y,"f").debug.logLoad(this,!0)}componentWillRender(){x(this,y,"f").debug.logRender(this,!1)}componentDidRender(){this.didRenderInteractables(),x(this,y,"f").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 s(n,{key:"b450035080d728f4a9e1b192b14e630b36bf879e","onKup-file-upload-upload":this.upload.bind(this)},s("style",{key:"1e895664baa2c86e300be091908403873b96e7f6"},x(this,y,"f").theme.setKupStyle(this.rootElement)),s("div",{key:"75ada02dbdd167998835d443242285d7253a6316",id:g,style:this.showSubmit?{display:"flex","flex-direction":c(this.submitPosition),"align-items":"center",gap:"0.5rem"}:{}},s(k,Object.assign({key:"12365188d85255679404e8e399dfda9f89d8ac51"},t)),this.showSubmit?s(u,{buttonType:"submit",label:x(this,y,"f").language.translate(m.CONFIRM),wrapperClass:"form__submit",onClick:t=>{this.submitClick(t)}}):null))}disconnectedCallback(){x(this,y,"f").dates.unregister(this),x(this,y,"f").language.unregister(this),x(this,y,"f").theme.unregister(this)}get rootElement(){return a(this)}};y=new WeakMap,b.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{display:block;height:fit-content;width:100%}#kup-component{height:fit-content;width:100%}";export{b as kup_cell}
1
+ import{r as t,c as i,f as e,h as s,H as n,d as a}from"./p-710d0a7d.js";import{k as o,i as p,aA as f,g as h,s as l,Y as r,aB as c,b as m,aC as g}from"./p-84a053a8.js";import{c as u}from"./p-635bb4b3.js";import{F as d}from"./p-c4224227.js";import{F as k}from"./p-52314ee2.js";import"./p-cabebabc.js";import"./p-e3062c19.js";import"./p-3cab6420.js";import"./p-9f9428d1.js";import"./p-216b5deb.js";import"./p-9e610c11.js";import"./p-9ffccc52.js";var y,x=function(t,i,e,s){if("a"===e&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!s:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?s:"a"===e?s.call(t):s?s.value:i.get(t)};const b=class{constructor(e){t(this,e),this.kupCellSubmitClick=i(this,"kup-cell-submit-click",6),this.kupCellUpload=i(this,"kup-cell-upload",6),y.set(this,o()),this.customStyle="",this.data=null,this.density=p.NONE,this.dragEnabled=!1,this.showSubmit=!1,this.submitPosition=f.right}async addCssClasses(t){if(this.data.cssClass||(this.data.cssClass=""),t)for(let i=0;i<t.length;i++){const e=t[i];this.data.cssClass.indexOf(e)<0&&(this.data.cssClass+=` ${e}`)}this.refresh()}async getProps(t){return h(this,g,t)}async refresh(){e(this)}async removeCssClasses(t){if(this.data.cssClass){if(t)for(let i=0;i<t.length;i++){const e=t[i];this.data.cssClass.indexOf(e)>0&&(this.data.cssClass=this.data.cssClass.replace(new RegExp(e,"g"),""))}this.refresh()}}async setProps(t){l(this,g,t)}didRenderInteractables(){if(this.dragEnabled){const t=()=>({cell:this.data,column:this.generateColumn(),id:this.rootElement.id,multiple:!1,row:this.generateRow()});x(this,y,"f").interact.draggable(this.rootElement.shadowRoot.querySelector("#"+u),{cursorChecker:()=>null},{callback:t},r.BADGE)}}generateColumn(){return{name:"KUPCELL",title:void 0}}generateRow(){const t=this.generateColumn(),i={cells:{}};return i.cells[t.name]=this.data,i}submitClick(t){t.stopPropagation(),this.kupCellSubmitClick.emit({comp:this,id:this.rootElement.id,cell:this.data})}upload(t){t.stopPropagation(),this.kupCellUpload.emit(t.detail)}componentWillLoad(){x(this,y,"f").dates.register(this),x(this,y,"f").debug.logLoad(this,!1),x(this,y,"f").language.register(this),x(this,y,"f").theme.register(this)}componentDidLoad(){x(this,y,"f").debug.logLoad(this,!0)}componentWillRender(){x(this,y,"f").debug.logRender(this,!1)}componentDidRender(){this.didRenderInteractables(),x(this,y,"f").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 s(n,{key:"b450035080d728f4a9e1b192b14e630b36bf879e","onKup-file-upload-upload":this.upload.bind(this)},s("style",{key:"1e895664baa2c86e300be091908403873b96e7f6"},x(this,y,"f").theme.setKupStyle(this.rootElement)),s("div",{key:"75ada02dbdd167998835d443242285d7253a6316",id:u,style:this.showSubmit?{display:"flex","flex-direction":c(this.submitPosition),"align-items":"center",gap:"0.5rem"}:{}},s(k,Object.assign({key:"12365188d85255679404e8e399dfda9f89d8ac51"},t)),this.showSubmit?s(d,{buttonType:"submit",label:x(this,y,"f").language.translate(m.CONFIRM),wrapperClass:"form__submit",onClick:t=>{this.submitClick(t)}}):null))}disconnectedCallback(){x(this,y,"f").dates.unregister(this),x(this,y,"f").language.unregister(this),x(this,y,"f").theme.unregister(this)}get rootElement(){return a(this)}};y=new WeakMap,b.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{display:block;height:fit-content;width:100%}#kup-component{height:fit-content;width:100%}";export{b as kup_cell}
@@ -13,9 +13,11 @@ export declare function getColumnByName(columns: KupDataColumn[], name: string):
13
13
  export declare function compareCell(cell1: KupDataCell, cell2: KupDataCell, sortMode: SortMode): number;
14
14
  export declare function compareValues(obj1: any, value1: any, obj2: any, value2: any, sortMode: SortMode): number;
15
15
  export declare function isNegativeNumber(value: string): boolean;
16
- export declare const CMBandACPAdapter: (value: string, label: string, options: GenericObject, _cellData: GenericObject) => {
16
+ export declare const CMBandACPAdapter: (value: string, label: string, options: GenericObject, cellData: GenericObject) => {
17
17
  data: {
18
18
  'kup-text-field': {
19
+ maxLength: any;
20
+ size: any;
19
21
  trailingIcon: boolean;
20
22
  label: string;
21
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sme.up/ketchup",
3
- "version": "11.0.0-SNAPSHOT-20250702141013",
3
+ "version": "11.0.0-SNAPSHOT-20250708094620",
4
4
  "keywords": [
5
5
  "smeup",
6
6
  "KetchUP",
@@ -75,5 +75,8 @@
75
75
  },
76
76
  "installConfig": {
77
77
  "hoistingLimits": "workspaces"
78
+ },
79
+ "optionalDependencies": {
80
+ "canvas": "^2.11.2"
78
81
  }
79
82
  }
@@ -1 +0,0 @@
1
- import{r as t,c as i,f as n,h as e,H as l,d as s}from"./p-710d0a7d.js";import{F as o}from"./p-c4224227.js";import{F as a,e as u}from"./p-45495c9b.js";import{F as h,k as r,ad as c,g as p,s as f,b as d,ai as m,a7 as v,ao as b,al as _,an as k,am as g,ap as x,h as y,V as w}from"./p-8a108d52.js";import{F as j}from"./p-7db300e0.js";import{F as O,a as $}from"./p-cec0955d.js";import{c as z}from"./p-635bb4b3.js";import"./p-e3062c19.js";import"./p-3cab6420.js";import"./p-9f9428d1.js";import"./p-ce3de714.js";import"./p-1f3d3baa.js";import"./p-b40cde24.js";import"./p-cabebabc.js";import"./p-c56195a0.js";var T,M,S,E,C;!function(t){t.TAB="tab"}(T||(T={})),function(t){t.customStyle="Custom style of the component.",t.data="Actual data of the input panel.",t.hiddenSubmitButton="Creates a hidden submit button in order to submit the form with enter.",t.submitCb="Sets the callback function on submit form",t.optionsHandler="Sets the callback function to recieve options",t.buttonPosition="Manage the position of the buttons related to the input panel content. It is an enumeration",t.inputPanelPosition="Manage the global layout of the input panel fields. The default is COLUMNS.",t.autoSkip="Sets the auto skip between input text fields when the value reaches the max length.",t.autoFocus="Sets whether the first input should receive focus.",t.fieldReset="Create e Reset button for the form"}(M||(M={})),function(t){t.COLUMNS="COLUMNS",t.INLINE="INLINE",t.STRETCHED="STRETCHED",t.UPINLINE="UPINLINE",t.UPCOLUMNS="UPCOLUMNS",t.PLACEHOLDER="PLACEHOLDER"}(S||(S={})),function(t){t.CENTER="CENTER",t.LEFT="LEFT",t.BOTTOM="BOTTOM",t.RIGHT="RIGHT",t.TOP="TOP"}(E||(E={})),function(t){t.BLUR="blur",t.ITEMCLICK="itemclick"}(C||(C={}));const K={blur:t=>t===h.CHECKBOX||t===h.SWITCH||t===h.COMBOBOX||t===h.AUTOCOMPLETE,itemclick:t=>t!==h.COMBOBOX&&t!==h.AUTOCOMPLETE},L=(t,i)=>0==t?3.75:t?1===t?11.25:7.5*t+(i?18:0)+4:null,W=t=>t?20*t:null,D=(t,i)=>t?t>(null==i?void 0:i.absoluteRow)?20*((null==i?void 0:i.absoluteRow)-1)+2*((null==i?void 0:i.absoluteRow)-1)+W(i.absoluteHeight)+20*(t-((null==i?void 0:i.absoluteRow)+(null==i?void 0:i.absoluteHeight)-1)-1):20*(t-1)+2*(t-1):null,I=t=>t?10*(t-1)*1.15:null;var N,R,F,P,H,A,V,J,U,B,G,q,X,Y,Q,Z,tt,it,nt,et,lt,st,ot,at,ut,ht,rt,ct,pt,ft,dt,mt,vt,bt,_t,kt,gt,xt,yt,wt,jt,Ot,$t,zt,Tt,Mt,St,Et,Ct,Kt,Lt,Wt,Dt,It,Nt,Rt,Ft,Pt,Ht,At,Vt,Jt,Ut,Bt,Gt,qt,Xt,Yt,Qt,Zt,ti,ii,ni,ei,li,si,oi=function(t,i,n,e){if("a"===n&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?e:"a"===n?e.call(t):e?e.value:i.get(t)},ai=function(t,i,n,e,l){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!l:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?l.call(t,n):l?l.value=n:i.set(t,n),n};const ui=document.documentElement,hi=class{constructor(n){t(this,n),this.kupReady=i(this,"kup-input-panel-ready",6),this.kupDataTableContextMenu=i(this,"kup-inputpanel-contextmenu",6),this.kupInputPanelObjectFieldSearchPayload=i(this,"kup-inputpanel-objectfield-searchpayload",6),this.kupInputPanelObjectFieldOpenSearchMenu=i(this,"kup-inputpanel-objectfield-opensearchmenu",6),this.kupInputPanelObjectFieldSelectedMenuItem=i(this,"kup-inputpanel-objectfield-selectedmenuitem",6),this.kupCellUpload=i(this,"kup-inputpanel-upload",6),N.add(this),R.set(this,r()),F.set(this,void 0),P.set(this,new Map([["SmeupDataTree",oi(this,N,"m",Ht).bind(this)],["SmeupDataTable",oi(this,N,"m",At).bind(this)],["SmeupTreeNode",oi(this,N,"m",Pt).bind(this)],["SmeupTable",oi(this,N,"m",At).bind(this)]])),H.set(this,null),A.set(this,[]),V.set(this,new Map([[c.DATE,"kup-date-picker"],[c.TIME,"kup-time-picker"]])),J.set(this,new Map([[c.COMBOBOX,"kup-combobox"],[c.AUTOCOMPLETE,"kup-autocomplete"]])),U.set(this,new Map([[h.BUTTON_LIST,oi(this,N,"m",Z).bind(this)],[h.LABEL,oi(this,N,"m",nt).bind(this)],[h.TABLE,oi(this,N,"m",it).bind(this)]])),B.set(this,new Map([[T.TAB,oi(this,N,"m",ht).bind(this)]])),G.set(this,void 0),q.set(this,void 0),this.buttonPosition=E.BOTTOM,this.customStyle="",this.dashboardMode=!1,this.data=null,this.hiddenSubmitButton=!1,this.inputPanelPosition=S.COLUMNS,this.submitCb=null,this.optionsHandler=null,this.customButtonClickHandler=null,this.checkValidObjCallback=null,this.checkValidValueCallback=null,this.autoFocus=!1,this.autoSkip=!1,this.updateOnClick=!1,this.fieldReset=!1,this.inputPanelCells=[],this.inputPanelCommands=[],this.tabSelected=null}onDataChanged(){ai(this,H,structuredClone(this.data),"f"),oi(this,A,"f").length&&(oi(this,A,"f").map((({event:t,handler:i})=>{this.rootElement.removeEventListener(t,i)})),ai(this,A,[],"f")),this.data&&oi(this,N,"m",dt).call(this,this.data)}listenKeydown(t){if("Enter"===t.key){t.preventDefault(),t.stopPropagation();const i=this.rootElement.shadowRoot.activeElement;"enter"===t.key.toLowerCase()&&i&&(null==i||i.blur(),this.submitCb({value:{before:Object.assign({},oi(this,H,"f")),after:oi(this,N,"m",bt).call(this)}}))}}async waitForReady(){return oi(this,G,"f")}async getProps(t){return p(this,M,t)}async refresh(){n(this)}async setProps(t){f(this,M,t)}async update(t){oi(this,N,"m",Qt).call(this,oi(this,N,"m",X).call(this,t),t)}onFormReset(){var t;for(const i of this.data.columns){const n=oi(this,N,"m",X).call(this,i.name);n.shape!==h.MULTI_AUTOCOMPLETE&&n.shape!==h.MULTI_COMBOBOX||!(null===(t=n.data)||void 0===t?void 0:t.data)||(n.data.data=[]),n.value="",n.obj.k="",n.decode="",n.data.initialValue&&(n.data.initialValue="")}this.refresh()}connectedCallback(){ai(this,G,new Promise((t=>{ai(this,q,t,"f")})),"f")}componentWillLoad(){oi(this,R,"f").debug.logLoad(this,!1),oi(this,R,"f").language.register(this),oi(this,R,"f").theme.register(this),this.onDataChanged()}componentDidLoad(){oi(this,N,"m",ii).call(this),this.kupReady.emit({comp:this,id:this.rootElement.id}),oi(this,N,"m",ni).call(this),oi(this,R,"f").debug.logLoad(this,!0)}componentWillRender(){oi(this,R,"f").debug.logRender(this,!1)}componentDidRender(){if(oi(this,F,"f")){const t=oi(this,F,"f").querySelectorAll(".f-text-field");for(let i=0;i<t.length;i++)j(t[i])}requestAnimationFrame((async()=>{oi(this,F,"f")&&oi(this,q,"f")&&(oi(this,q,"f").call(this),ai(this,q,null,"f"))})),oi(this,R,"f").debug.logRender(this,!0)}render(){const t=Boolean(!this.inputPanelCells.length)?[e("p",null,oi(this,R,"f").language.translate(d.EMPTY_DATA))]:this.inputPanelCells.map((t=>oi(this,N,"m",Y).call(this,t)));return e(l,{key:"2918469fee98a7a9f9d18734c8b33fa0672f7763","onKup-cell-blur":t=>oi(this,N,"m",Gt).call(this,t,C.BLUR),"onKup-cell-update":oi(this,N,"m",qt).bind(this),"onKup-tabbar-click":t=>{this.tabSelected=t.detail.node.id},"onKup-autocomplete-input":oi(this,N,"m",jt).bind(this),"onKup-autocomplete-iconclick":oi(this,N,"m",jt).bind(this),"onKup-combobox-iconclick":t=>oi(this,N,"m",jt).call(this,t,!0),"onKup-cell-itemclick":t=>{oi(this,N,"m",Gt).call(this,t,C.ITEMCLICK)},"onKup-objectfield-searchpayload":t=>{this.kupInputPanelObjectFieldSearchPayload.emit(t.detail)},"onKup-objectfield-opensearchmenu":t=>{this.kupInputPanelObjectFieldOpenSearchMenu.emit(t.detail)},"onKup-objectfield-selectedmenuitem":t=>{this.kupInputPanelObjectFieldSelectedMenuItem.emit(t.detail)},"onKup-file-upload-upload":oi(this,N,"m",si).bind(this)},e("style",{key:"8247a8757e7fc8bd9cf2d9a5f74df47f86159c32"},oi(this,R,"f").theme.setKupStyle(this.rootElement)),e("div",{key:"75cb65d811d5e8d715ede14882a2d904dddb51db",id:z},t))}disconnectedCallback(){oi(this,R,"f").language.unregister(this),oi(this,R,"f").theme.unregister(this)}get rootElement(){return s(this)}static get watchers(){return{data:["onDataChanged"]}}};R=new WeakMap,F=new WeakMap,P=new WeakMap,H=new WeakMap,A=new WeakMap,V=new WeakMap,J=new WeakMap,U=new WeakMap,B=new WeakMap,G=new WeakMap,q=new WeakMap,N=new WeakSet,X=function(t){return t?this.inputPanelCells.reduce(((i,{cells:n})=>{if(!i){const i=n.find((({column:i})=>i.name===t));return i?i.cell:null}return i}),null):null},Y=function(t){var i,n,l;const s=t.row.layout,a=(null==s?void 0:s.horizontal)||!1,u={};let r;if(null===(i=null==s?void 0:s.sections)||void 0===i?void 0:i.length)if(s.absolute)r=oi(this,N,"m",st).call(this,t,s),u.height=`${(t=>{var i,n;if(!t)return 0;const e=null!==(n=null===(i=t.sections.flatMap((t=>t.content)).find((t=>t.shape===h.TABLE)))||void 0===i?void 0:i.absoluteHeight)&&void 0!==n?n:null,l=Math.max(0,...t.sections.flatMap((t=>t.content.map((t=>t.absoluteRow+(t.absoluteHeight-1))))));return e?22*(l-e)+20*e:22*l})(s)}px`;else{if(!s.sectionsType){const i=s.sections.some((t=>t.dim));u.display="grid",this.inputPanelPosition!==S.INLINE&&this.inputPanelPosition!==S.UPINLINE||(u.display=""),s.horizontal?u.gridTemplateColumns=i?s.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${t.cells.length}, 1fr)`:this.dashboardMode&&(u.gridTemplateRows=i?s.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${s.sections.length}, 1fr)`)}r=oi(this,N,"m",lt).call(this,t,s)}else r=t.cells.filter((({column:t})=>!1!==t.visible)).map((i=>oi(this,N,"m",Q).call(this,i.cell,t.row,i.column)));const c={"input-panel-form":!0,"input-panel-form--inline":this.buttonPosition==E.RIGHT},p={"input-panel":!0,"input-panel--column":!a,"input-panel--absolute":null==s?void 0:s.absolute,"input-panel--inline":this.inputPanelPosition===S.INLINE||this.inputPanelPosition===S.UPINLINE},f={"input-panel__commands":!0,[`input-panel__commands--${this.buttonPosition}`]:!0};return e("div",null,e("form",{name:this.rootElement.id,id:this.rootElement.id,class:c,ref:t=>ai(this,F,t,"f"),onSubmit:t=>{t.preventDefault(),this.submitCb({value:{before:Object.assign({},oi(this,H,"f")),after:oi(this,N,"m",bt).call(this)}})},onReset:t=>{t.preventDefault(),this.onFormReset()},onContextMenu:t=>{null!=oi(this,N,"m",Zt).call(this,t)&&t.preventDefault()}},1==(null===(n=null==s?void 0:s.sections)||void 0===n?void 0:n.length)&&(null===(l=null==s?void 0:s.sections[0])||void 0===l?void 0:l.title)&&e("div",{class:"input-panel__typography"},e(O,{value:s.sections[0].title,type:$.HEADING1})),e("div",{class:p,style:u},r),e("div",{class:f},e(o,{buttonType:"submit",label:oi(this,R,"f").language.translate(d.CONFIRM),wrapperClass:"form__submit",invisible:this.hiddenSubmitButton}),this.fieldReset&&e(o,{buttonType:"reset",label:"Reset",wrapperClass:"form__submit",icon:"broom"}),this.inputPanelCommands)))},Q=function(t,i,n){var l;if(!t)return;const s=oi(this,U,"f").get(t.shape);if(void 0!==s)return s(t,n,null===(l=i.layout)||void 0===l?void 0:l.absolute);t.data=Object.assign(Object.assign({},t.data),{sizing:"extra-small"});const o={cell:t,column:n,row:i,editable:!0,component:this,renderKup:!0,setSizes:!0},u=oi(this,N,"m",et).call(this,t,n.title);return u?e("div",{class:{"input-panel__label_container":!0}},u,e(a,Object.assign({},o))):e(a,Object.assign({},o))},Z=function(t,{name:i}){return e(o,Object.assign({icon:t.icon,placeholderIcon:t.placeholderIcon,id:i},t.data,{wrapperClass:"form__submit"}))},tt=function(t,i){return e("kup-dropdown-button",Object.assign({},t.data,{label:t.value,data:i,"onkup-dropdownbutton-itemclick":t=>{oi(this,N,"m",Qt).call(this,t.detail.node,t.detail.node.id)}}))},it=function(t,{name:i}){return e("kup-data-table",Object.assign({id:i,editableData:!0,showGroups:!0,showFilters:!0},t.data,{"onKup-autocomplete-iconclick":t=>{t.preventDefault(),t.stopPropagation()},"onKup-autocomplete-input":t=>{t.preventDefault(),t.stopPropagation()},"onKup-datatable-cell-iconclick":t=>{oi(this,N,"m",jt).call(this,t),t.preventDefault(),t.stopPropagation()},"onKup-datatable-cell-input":t=>{"autocomplete"===t.detail.type&&oi(this,N,"m",jt).call(this,t),t.preventDefault(),t.stopPropagation()},"onKup-cell-itemclick":t=>{oi(this,N,"m",Bt).call(this,t),t.preventDefault(),t.stopPropagation()}}))},nt=function(t,i,n){const l=ui.ketchup.objects.isNumber(t.obj),s=l||ui.ketchup.objects.isDate(t.obj)||ui.ketchup.objects.isTime(t.obj)||ui.ketchup.objects.isTimestamp(t.obj),o=["input-panel-label"];n&&o.push("input-panel-label--legacy-look"),l&&o.push("input-panel-label-number");const a=s?m(i,t):t.value;return e("span",{class:o.join(" "),id:i.name},e(u,{text:a}))},et=function(t,i){return i&&ui.ketchup.data.cell.getType(t,t.shape)===c.RADIO?e("span",null,i):null},lt=function(t,i){const n=oi(this,B,"f").get(i.sectionsType);return n?n(t,i.sections):i.sections.map((i=>oi(this,N,"m",ot).call(this,t,i,!1)))},st=function(t,i){return i.sections.map((i=>oi(this,N,"m",at).call(this,t,i)))},ot=function t(i,n,l=!1,s={}){var o,a;const u={"input-panel__section":!n.horizontal,"input-panel__horizontal-section":n.horizontal,"input-panel__section-inline":this.inputPanelPosition===S.INLINE||this.inputPanelPosition===S.UPINLINE};s.gap=+n.gap>0?`${n.gap}rem`:"1rem";let h=[];if(null===(o=n.sections)||void 0===o?void 0:o.length){h=n.sections.map((n=>oi(this,N,"m",t).call(this,i,n))).filter(Boolean);const e=n.sections.some((t=>t.dim));!n.gridCols&&n.horizontal&&(s.gridTemplateColumns=e?n.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${n.sections.length}, 1fr)`),n.gridRows||n.horizontal||!this.dashboardMode||(s.gridTemplateRows=e?n.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${n.sections.length}, 1fr)`)}else(null===(a=n.content)||void 0===a?void 0:a.length)&&(h=n.content.map((t=>oi(this,N,"m",ct).call(this,i,t))).filter(Boolean),s.gridTemplateColumns=+n.gridCols>0?`repeat(${n.gridCols}, 1fr)`:"",this.dashboardMode&&(s.gridTemplateRows=+n.gridRows>0?`repeat(${n.gridRows}, 1fr)`:""));const r=h.length?e("div",{class:u,style:s},h):void 0;return n.title&&!l?e("div",{class:{"input-panel__section_label_container":!0}},e(O,{type:$.HEADING1,value:n.title}),r):r},at=function t(i,n){var l,s;let o=[];if(null===(l=n.sections)||void 0===l?void 0:l.length)o=n.sections.map((n=>oi(this,N,"m",t).call(this,i,n)));else if(null===(s=n.content)||void 0===s?void 0:s.length){const t=n.content.find((t=>t.shape===h.TABLE)),e=t?{absoluteRow:t.absoluteRow,absoluteHeight:t.absoluteHeight}:{};o=n.content.map((t=>oi(this,N,"m",pt).call(this,i,t,e)))}if(null==L(n.absoluteWidth))return o;const a=null!=L(n.absoluteWidth)?`${L(n.absoluteWidth)}px`:"100%",u=null!=W(n.absoluteHeight)?`${W(n.absoluteHeight)}px`:"100%",r=`${D(n.absoluteRow)}px`,c=`${I(n.absoluteColumn)}px`;return e("div",{style:{position:"relative",width:a,"min-width":a,"max-width":a,height:u,"min-height":u,"max-height":u,top:r,left:c,overflow:"auto"}},o)},ut=function t(i){var n,e;let l=[];return(null===(n=i.content)||void 0===n?void 0:n.length)&&i.content.forEach((t=>{t.id&&l.push(t.id)})),(null===(e=i.sections)||void 0===e?void 0:e.length)&&i.sections.forEach((i=>{l=l.concat(oi(this,N,"m",t).call(this,i))})),l},ht=function(t,i){this.tabSelected||(this.tabSelected=i[0].id||"0");const n=i.map(((i,n)=>{const e=oi(this,N,"m",ut).call(this,i),l=t.cells.some((t=>{var i;const n=t.cell;return e.includes(t.column.name)&&!!(null===(i=n.data)||void 0===i?void 0:i.error)}));return{active:(i.id||`${n}`)===this.tabSelected,value:i.title,icon:l?"error":i.icon,id:i.id||`${n}`,danger:l}})),l=i.map(((i,n)=>{const e=i.id||`${n}`;return oi(this,N,"m",ot).call(this,t,i,!0,{display:this.tabSelected!==e?"none":"grid"})}));return e("div",{class:{"input-panel__tabs_container":!0}},e("kup-tab-bar",{data:n,customStyle:".tab-bar .tab-scroller .tab .tab__content { justify-content: flex-start; }"}),l)},rt=function(t){return!t||!t.cell||!1===t.column.visible},ct=function(t,i){const n=t.cells.find((t=>t.column.name===i.id));if(oi(this,N,"m",rt).call(this,n))return;const l=+i.colSpan>0?i.colSpan:+i.colSpan>0||+i.colStart>0?null:1,s=+i.rowSpan>0?i.rowSpan:+i.rowSpan>0||+i.rowStart>0?null:1;return e("div",{style:{"min-width":"0","grid-column-start":l?`span ${l}`:`${i.colStart}`,"grid-column-end":+i.colEnd>0?`${i.colEnd}`:"","grid-row-start":s?`span ${s}`:`${i.rowStart}`,"grid-row-end":+i.rowEnd>0?`${i.rowEnd}`:""}},oi(this,N,"m",Q).call(this,n.cell,t.row,n.column))},pt=function(t,i,n){const l=t.cells.find((t=>t.column.name===i.id));if(oi(this,N,"m",rt).call(this,l))return;let s;s=l.cell.shape==h.DATE?i.absoluteLength>8?i.absoluteLength:8:i.absoluteLength,i.absoluteHeight||(i.absoluteHeight=1);const o=l.cell.shape===h.LABEL?(t=>0==t?3.75:t?1===t?11.25:7.5*t:null)(s):L(s,(a=l.cell.shape)===h.AUTOCOMPLETE||a===h.COMBOBOX||a===h.DATE);var a;const u=W(i.absoluteHeight),r=D(i.absoluteRow,n),c=I(i.absoluteColumn),p={position:"absolute",width:null!=o?`${o}px`:null,"min-width":null!=o?`${o}px`:null,"max-width":null!=o?`${o}px`:null,height:null!=u?`${u}px`:null,"min-height":null!=u?`${u}px`:null,"max-height":null!=u?`${u}px`:null,top:null!=r?`${r}px`:null,left:null!=c?`${c}px`:null,overflow:"hidden"};return l.cell.data=Object.assign(Object.assign(Object.assign({},l.cell.data),{customStyle:(l.cell.data.customStyle||"")+".mdc-text-field {height: unset !important;}",legacyLook:!0,helperEnabled:!1}),l.cell.shape===h.TABLE&&{rowsPerPage:l.cell.data.data.rows.length,showPaginator:!1,showFooter:!1,tableHeight:`${u}px`}),e("div",{style:p},oi(this,N,"m",Q).call(this,l.cell,t.row,l.column))},ft=function(){this.inputPanelCommands=this.data.setup.commands.map((t=>{if((null==t?void 0:t.children)&&(null==t?void 0:t.children.length)>0){const i={"kup-list":{showIcons:!0,data:t.children.map((t=>oi(this,N,"m",Vt).call(this,t)))}};return oi(this,N,"m",tt).call(this,t,i)}{const i=oi(this,N,"m",Vt).call(this,t);return oi(this,N,"m",Z).call(this,i,{name:t.value,title:t.value})}})).flat()},dt=function(t){var i,n,e,l;const s=null===(i=null==t?void 0:t.rows[0])||void 0===i?void 0:i.layout,o=(null===(n=null==t?void 0:t.rows)||void 0===n?void 0:n.length)?t.rows.reduce(((i,n)=>[...i,{cells:t.columns.map((t=>{const i=structuredClone(n.cells[t.name]);return{column:t,cell:i?Object.assign(Object.assign({},i),{data:oi(this,N,"m",mt).call(this,i,t,s),slotData:oi(this,N,"m",kt).call(this,i,t),isEditable:!0}):null}})),row:n}]),[]):[];o.map((({cells:t})=>t.map((({cell:t,column:i})=>{var n;const e=ui.ketchup.data.cell.getType(t,t.shape),l=oi(this,V,"f").get(e),s=oi(this,J,"f").get(e);if(!l&&!s)return;const o=(null!=l?l:s)+`[id='${i.name.replace(/\//g,"\\$1")}']`,a=this.rootElement.shadowRoot.querySelector(o);s?null==a||a.reset():null===(n=null==a?void 0:a.setValue)||void 0===n||n.call(a,t.value)})))),this.inputPanelCells=o,(null===(l=null===(e=t.setup)||void 0===e?void 0:e.commands)||void 0===l?void 0:l.length)&&oi(this,N,"m",ft).call(this)},mt=function(t,i,n){const e=Object.assign(Object.assign({},oi(this,N,"m",_t).call(this,t,i,n)),{disabled:!t.isEditable||i.useAs===v.KEY,id:i.name}),l=ui.ketchup.data.cell.getType(t,t.shape),s=function(t,i){var n={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(n[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(e=Object.getOwnPropertySymbols(t);l<e.length;l++)i.indexOf(e[l])<0&&Object.prototype.propertyIsEnumerable.call(t,e[l])&&(n[e[l]]=t[e[l]])}return n}(t.data||{},["data"]);return l!==c.MULTI_AUTOCOMPLETE&&l!==c.MULTI_COMBOBOX?oi(this,N,"m",vt).call(this,e,Object.assign({},t.data)):Object.assign(Object.assign({},e),s)},vt=function t(i,n){for(const e in n)i[e]=n[e]instanceof Object&&!Array.isArray(n[e])&&e in i?oi(this,N,"m",t).call(this,i[e],n[e]):n[e];return i},bt=function(){return this.inputPanelCells.reduce(((t,i)=>{const n=Object.keys(i.row.cells).reduce(((t,n)=>{var e;const l=null===(e=i.cells.find((t=>t.column.name===n)))||void 0===e?void 0:e.cell;let s=null==l?void 0:l.value;return(null==l?void 0:l.shape)===h.TABLE&&(s=JSON.stringify(oi(this,N,"m",Rt).call(this,l.data.data,n))),Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({},i.row.cells[n]),{value:s,obj:null==l?void 0:l.obj})})}),{});return{columns:[...t.columns,...i.cells.map((t=>t.column))],rows:[...t.rows,{cells:n,layout:i.row.layout}]}}),{columns:[],rows:[]})},_t=function(t,i,n){if(!t)return null;const e=t.options;let l;l=(null==n?void 0:n.absolute)?null:i.title;const s=t.value,o=ui.ketchup.data.cell.getType(t,t.shape),a=new Map([[c.AUTOCOMPLETE,oi(this,N,"m",wt).bind(this)],[c.BUTTON_LIST,oi(this,N,"m",yt).bind(this)],[c.CHART,oi(this,N,"m",xt).bind(this)],[c.CHIP,oi(this,N,"m",gt).bind(this)],[c.CHECKBOX,oi(this,N,"m",$t).bind(this)],[c.COLOR_PICKER,oi(this,N,"m",zt).bind(this)],[c.COMBOBOX,oi(this,N,"m",wt).bind(this)],[c.EDITOR,oi(this,N,"m",Tt).bind(this)],[c.MULTI_AUTOCOMPLETE,oi(this,N,"m",gt).bind(this)],[c.MULTI_COMBOBOX,oi(this,N,"m",gt).bind(this)],[c.NUMBER,oi(this,N,"m",It).bind(this)],[c.DATE,oi(this,N,"m",Ct).bind(this)],[c.OBJECT,oi(this,N,"m",Kt).bind(this)],[c.RADIO,oi(this,N,"m",St).bind(this)],[c.STRING,oi(this,N,"m",Mt).bind(this)],[c.SWITCH,oi(this,N,"m",Et).bind(this)],[c.TABLE,oi(this,N,"m",Nt).bind(this)],[c.TIME,oi(this,N,"m",Dt).bind(this)],[c.IMAGE_LIST,oi(this,N,"m",Lt).bind(this)],[c.FILE_UPLOAD,oi(this,N,"m",Wt).bind(this)]]).get(o);return a?a(e,l,s,t,i.name,n):null},kt=function(t,i){const n=ui.ketchup.data.cell.getType(t,t.shape);return n===c.CHIP?{trailingIcon:!0,label:i.title,disabled:!t.isEditable,id:i.name,fullWidth:!1}:n===c.MULTI_AUTOCOMPLETE||n===c.MULTI_COMBOBOX?Object.assign(Object.assign({},oi(this,N,"m",wt).call(this,t.options,i.title,null,t)),{showDropDownIcon:!0,class:"",style:{width:"100%"},disabled:!t.isEditable,id:i.name}):null},gt=function(t,i,n,e){return b(n,e.decode)},xt=function(){return{data:{sizeX:"50px",offlineMode:{value:"8;4;5"},id:"i1012_GREF_0",cellId:"i1012_GREF_0",sizeY:"50px"}}},yt=function(t,i,n,e,l){var s,o;if(e.data=e.data||{},e.data.onClick=()=>{oi(this,N,"m",Qt).call(this,e,l)},e.data.BtnMap){const t=null===(o=null===(s=this.data.setup)||void 0===s?void 0:s.commands)||void 0===o?void 0:o.find((t=>t.obj.k===e.data.BtnMap));t&&(e.isEditable=!0,e.data.onClick=()=>{oi(this,N,"m",Qt).call(this,e,t.obj.k)},this.data.setup.commands=this.data.setup.commands.filter((i=>i.obj.k!==t.obj.k)))}return Object.assign({label:e.value,fun:e.fun},e.data)},wt=function(t,i,n){const e=_(n,i,[]);return t&&(e.data["kup-list"].data=oi(this,N,"m",Ft).call(this,t,n)),e},jt=function({detail:t},i=!1){if(oi(this,N,"m",Ot).call(this,t))oi(this,N,"m",Ut).call(this,t);else{const n=oi(this,N,"m",X).call(this,t.id);let e=!0;i&&(e=!t.comp.data["kup-list"].data.length),n.fun&&e&&oi(this,N,"m",Jt).call(this,t,n)}},Ot=function(t){return!!t.cell},$t=function(t,i,n){return k(n,i)},zt=function(t,i){return{data:{"kup-text-field":{label:i}}}},Tt=function(t,i,n){return{initialValue:n}},Mt=function(t,i,n,e,l){var s;const o=Object.assign({label:i},e.data);return this.autoSkip&&e.isEditable&&(null===(s=e.data)||void 0===s?void 0:s.maxLength)&&(o.onInput=t=>{oi(this,N,"m",li).call(this,l,t)}),o},St=function(t,i,n,e){const l=(()=>{var t;if(e.data.data)return null===(t=e.data.data.rows)||void 0===t?void 0:t.map((t=>{const i=t.fields||t.cells,[e,l]=Object.keys(i);return{id:i[e].value,label:l?i[l].value:i[e].value,selected:n===i[e].value}}))})(),s=g(n,l);return l?s:e.data},Et=function(t,i,n){return x(n,i)},Ct=function(t,i,n){return{data:{"kup-text-field":{label:i}},initialValue:null!=n?n:""}},Kt=function(t,i,n){return{initialValue:n||"",label:i||" ",value:n||""}},Lt=function(t,i,n){return{initialValue:n||"",leadingLabel:i||"",value:n||""}},Wt=function(t,i,n,e){return Object.assign({pathString:n},e.data)},Dt=function(t,i,n){return{data:{"kup-text-field":{label:i}},initialValue:n}},It=function(t,i){return{label:i}},Nt=function(t,i,n,e,l,s){try{let t=JSON.parse(e.value);return t?"SmeupDataTable"!==t.type?(oi(this,R,"f").debug.logMessage(this,`Wrong data table type for ${l} cell. Type \`SmeupDataTable\` in value expected`,y.ERROR),null):{data:{columns:t.columns.map((i=>{var n;if(t.rows.length>0){const e=null===(n=t.rows[0].cells[i.name])||void 0===n?void 0:n.obj;return!i.obj&&e?Object.assign(Object.assign({},i),{obj:{t:e.t,p:e.p}}):i}return i})),rows:t.rows.map((i=>Object.assign(Object.assign({},i),{cells:Object.keys(i.cells).reduce(((n,e)=>{const l=t.columns.find((t=>t.name===e));return Object.assign(Object.assign({},n),{[e]:Object.assign(Object.assign({},i.cells[e]),{data:Object.assign(Object.assign({},oi(this,N,"m",_t).call(this,i.cells[e],l,s)),{disabled:!1===i.cells[e].editable,id:l.id})})})}),{})})))}}:(oi(this,R,"f").debug.logMessage(this,`Empty value for ${l} cell.`,y.WARNING),null)}catch(t){return oi(this,R,"f").debug.logMessage(this,`Invalid value for ${l} cell. Type \`SmeupDataTable\` expected`,y.ERROR),null}},Rt=function(t,i){const n=Object.assign(Object.assign({},t),{rows:t.rows.map((t=>Object.assign(Object.assign({},t),{cells:{}})))}),e=t.columns.filter((t=>t.isEditable)).map((t=>t.name));if(!e.length)return n;try{const l=JSON.parse(oi(this,H,"f").rows[0].cells[i].value);return n.rows=t.rows.map(((t,i)=>e.reduce(((n,e)=>{const s=l.rows[i].cells[e]&&t.cells[e].value!==l.rows[i].cells[e].value;return Object.assign(Object.assign({},l.rows[i]),s?{cells:Object.assign(Object.assign({},n.cells),{[e]:Object.assign(Object.assign({},l.rows[i].cells[e]),{value:t.cells[e].value})})}:{cells:n.cells})}),Object.assign(Object.assign({},l.rows[i]),{cells:{}})))),n}catch(t){return n}},Ft=function(t,i){const n=oi(this,P,"f").get(t.type);return n?n(t,i):t.map((t=>({value:t.label,id:t.id,selected:i===t.id})))},Pt=function t(i,n){return i.children.map((i=>{var e;return{id:i.content.codice,value:i.content.testo,selected:n===i.content.codice,children:(null===(e=i.children)||void 0===e?void 0:e.length)?oi(this,N,"m",t).call(this,i,n):[]}}))},Ht=function t(i,n){return i.children.map((i=>{var e;return{id:i.obj.k,value:i.value,selected:n===i.obj.k,children:(null===(e=i.children)||void 0===e?void 0:e.length)?oi(this,N,"m",t).call(this,i,n):[]}}))},At=function(t,i){return t.rows.map((t=>{const n=t.fields||t.cells,[e,l]=Object.keys(n);return{id:n[e].value,value:l?n[l].value:n[e].value,selected:i===n[e].value}}))},Vt=function(t){return Object.assign(Object.assign({},t),{data:oi(this,N,"m",yt).call(this,null,null,t.value,t,t.obj.k),id:t.obj.k})},Jt=function(t,i){this.optionsHandler(i.fun,t.inputValue,oi(this,N,"m",bt).call(this),t.id).then((n=>{var e,l,s,o,a,u;const r=(null===(e=null==n?void 0:n.columns)||void 0===e?void 0:e.filter((t=>!1!==(null==t?void 0:t.visible))).map((t=>t.name)))||[],c=null===(l=null==n?void 0:n.rows)||void 0===l?void 0:l.map((t=>{const{cells:i}=t,n=r.reduce(((n,e)=>(t.cells.hasOwnProperty(e)&&(n[e]=i[e]),n)),{});return Object.assign(Object.assign({},t),{cells:n})})),p=Object.assign(Object.assign({},n),{rows:c}),f=i.shape===h.MULTI_AUTOCOMPLETE?i.slotData.data["kup-list"]:null===(o=null===(s=i.data)||void 0===s?void 0:s.data)||void 0===o?void 0:o["kup-list"];f?(f.data=(null==c?void 0:c.length)&&null!==(a=oi(this,N,"m",Ft).call(this,p,i.value))&&void 0!==a?a:[],f.options=null!==(u=n.columns)&&void 0!==u?u:[]):oi(this,R,"f").debug.logMessage(this,'getAutocompleteEventCallback() - "kup-list" not found in cell.data.data',y.WARNING),t.comp.refresh()}))},Ut=function(t){const{cell:i,row:n,column:e,comp:l,id:s,event:o}=t,a=null==i?void 0:i.value,u=t.event.detail;try{this.optionsHandler(i.fun,u.inputValue,{columns:l.data.columns,rows:[n]},e.name).then((t=>{var i,u,h,r,c,p,f;const d=(null!==(i=null==t?void 0:t.columns)&&void 0!==i?i:[]).filter((t=>!1!==(null==t?void 0:t.visible))).map((t=>t.name)),m=null!==(h=null===(u=null==t?void 0:t.rows)||void 0===u?void 0:u.map((t=>{const i=d.reduce(((i,n)=>(t.cells[n]&&(i[n]=t.cells[n]),i)),{});return Object.assign(Object.assign({},t),{cells:i})})))&&void 0!==h?h:[],v=Object.assign(Object.assign({},t),{rows:m}),b=l.data,_=b.rows[n.id].cells[e.name];(null===(c=null===(r=_.data)||void 0===r?void 0:r.data)||void 0===c?void 0:c["kup-list"])||(_.data={data:{"kup-list":{},"kup-text-field":Object.assign({},_.data)}});const k=_.data.data["kup-list"];k.data=m.length&&null!==(p=oi(this,N,"m",Ft).call(this,v,a))&&void 0!==p?p:[],k.options=null!==(f=t.columns)&&void 0!==f?f:[],l.data=b,this.data.rows[0].cells[s].value=JSON.stringify(b),o.detail.comp.refresh(),l.refresh()}))}catch(t){console.error("Error in autocomplete callback:",t)}},Bt=function(t){const{cell:i,row:n,column:e,id:l,comp:s}=t.detail,o=s.data;o.rows[n.id].cells[e.name]=i,s.data=o,this.data.rows[0].cells[l].value=JSON.stringify(o),t.detail.event.detail.comp.refresh(),s.refresh()},Gt=async function(t,i){var n,e,l,s,o;const{detail:{column:a,cell:u}}=t;if(K[i](null==u?void 0:u.shape))return;const h=oi(this,N,"m",X).call(this,a.name),r=oi(this,H,"f").rows[0].cells[a.name];if(h){if(u.mandatory){if(oi(this,N,"m",Xt).call(this,a.name,h.value?(null===(n=r.data)||void 0===n?void 0:n.error)||null:oi(this,R,"f").language.translate(d.REQUIRED_VALUE)),!u.value)return}else oi(this,N,"m",Xt).call(this,a.name,(null===(e=r.data)||void 0===e?void 0:e.error)||null);if(null===(l=u.inputSettings)||void 0===l?void 0:l.checkObject){const{valid:t}=await this.checkValidObjCallback({obj:u.obj,currentState:oi(this,N,"m",bt).call(this),fun:u.fun});if(!t)return void oi(this,N,"m",Xt).call(this,a.name,oi(this,R,"f").language.translate(d.INVALID_VALUE));oi(this,N,"m",Xt).call(this,a.name,(null===(s=r.data)||void 0===s?void 0:s.error)||null)}(null===(o=u.inputSettings)||void 0===o?void 0:o.checkValueOnExit)&&oi(this,N,"m",Yt).call(this)&&this.checkValidValueCallback({before:Object.assign({},oi(this,H,"f")),after:oi(this,N,"m",bt).call(this)},a.name)}},qt=function({detail:{cell:t,column:i}}){var n;t.shape!==h.CHECKBOX&&t.shape!==h.SWITCH||(this.updateOnClick?this.submitCb({value:{before:Object.assign({},oi(this,H,"f")),after:oi(this,N,"m",bt).call(this)},cell:i.name}):(null===(n=t.inputSettings)||void 0===n?void 0:n.checkValueOnExit)&&this.checkValidValueCallback({before:Object.assign({},oi(this,H,"f")),after:oi(this,N,"m",bt).call(this)},i.name))},Xt=function(t,i){this.inputPanelCells=this.inputPanelCells.map((n=>Object.assign(Object.assign({},n),{cells:n.cells.map((({cell:n,column:e})=>{const l=e.name===t?Object.assign(Object.assign({},n.data),{error:i}):n.data;return{column:e,cell:Object.assign(Object.assign({},n),{data:l})}}))})))},Yt=function(){return this.inputPanelCells.some((({cells:t,row:i})=>t.some((({cell:t,column:{name:n}})=>t.value!==i.cells[n].value))))},Qt=function(t,i){(null==t?void 0:t.fun)?this.customButtonClickHandler({fun:t.fun,cellId:i,currentState:oi(this,N,"m",bt).call(this)}):this.submitCb({value:{before:Object.assign({},oi(this,H,"f")),after:oi(this,N,"m",bt).call(this)},cell:i})},Zt=function(t){return oi(this,R,"f").getEventPath(t.target,this.rootElement).find((t=>{var i;return null===(i=t.classList)||void 0===i?void 0:i.contains("f-cell")}))},ti=function(t){const i=oi(this,N,"m",Zt).call(this,t);if(null==i)return;const n=oi(this,N,"m",bt).call(this),e=i["kup-get-cell-props"]().column.name;return{anchor:i,cell:n.rows[0].cells[e],column:n.columns.find((t=>t.name==e)),row:n.rows[0],originalEvent:t}},ii=function(){oi(this,R,"f").interact.managedElements.add(oi(this,F,"f")),oi(this,R,"f").interact.on(oi(this,F,"f"),w.TAP,(t=>{if(2==t.button){const i=oi(this,N,"m",ti).call(this,t);i&&this.kupDataTableContextMenu.emit({comp:this,id:this.rootElement.id,details:i})}}))},ni=function(){if(!oi(this,F,"f"))return;const t=Array.from(oi(this,F,"f").querySelectorAll(".f-cell__content"));for(const i of t){const t=oi(this,N,"m",ei).call(this,i,!0);if(t)return void setTimeout((()=>t.focus()),300)}if(!this.autoFocus||0===t.length)return;const i=oi(this,N,"m",ei).call(this,t[0]);i&&setTimeout((()=>i.focus()),300)},ei=function(t,i=!1){if(!(t&&t instanceof HTMLElement))return;const n=".mdc-text-field__input",e=i?`.mdc-text-field--error ${n}`:n,l=t.querySelector(e);if(l)return l;const s=Array.from(t.querySelectorAll("*")).filter((t=>t.shadowRoot));for(const t of s){const i=t.shadowRoot.querySelector(e);if(i)return i}},li=function(t,i){var n,e;const l=null==i?void 0:i.target;if(!(l&&l instanceof HTMLInputElement))return;const{maxLength:s,value:o}=l;if(!s||s<0||(null==o?void 0:o.length)<s)return;const a=Array.from(null===(n=oi(this,F,"f"))||void 0===n?void 0:n.querySelectorAll(".f-text-field")).reduce(((t,i)=>{const n=i.querySelector("input");return n?(t.push({id:(null==i?void 0:i.id)||"",HTMLInputElement:n}),t):t}),[]);if(!a.length)return;const u=a.findIndex((i=>i.id===t));u<0||u===a.length-1||null===(e=a[u+1].HTMLInputElement)||void 0===e||e.focus()},si=function(t){t.stopPropagation(),this.kupCellUpload.emit(t.detail)},hi.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup-fcell-width:fit-content;--kup_input_panel_background_color:var(\n --kup-input-panel-background-color,\n var(--kup-layer-0)\n );--kup_input_panel_color:var(\n --kup-input-panel-color,\n var(--kup-text-secondary)\n );--kup_input_panel_font_family:var(\n --kup-input-panel-font-family,\n var(--kup-font-family)\n );--kup_input_panel_font_size:var(\n --kup-input-panel-font-size,\n var(--kup-font-size)\n );--kup_textfield_textarea_height_input_panel:var(\n --kup-textfield-textarea-height-input_panel,\n 200px\n );--kup_textfield_textarea_width_input_panel:var(\n --kup-textfield-textarea-width-input_panel,\n 300px\n );--kup_input_panel_label_alignment:var(--kup-input-panel-label-alignment);--kup_input_panel_label_width:var(--kup-input-panel-label-width);--kup_input_panel_padding:var(--kup-input-panel-padding, 1em 0);--kup_input_panel_padding--inline:var(\n --kup-input-panel-padding--inline,\n 1em 0\n );--kup_input_panel_absolute_max_height:var(\n --kup-input-panel-absolute-max-height,\n \n 716px\n )}:host .input-panel{background:var(--kup_input_panel_background_color);color:var(--kup_input_panel_color);display:flex;flex-grow:1;overflow:auto;padding:var(--kup_input_panel_padding);position:relative;gap:8px}:host .input-panel__commands{display:flex;gap:1rem}:host .input-panel__commands.input-panel__commands--right{flex-shrink:0;overflow:hidden}:host .input-panel--inline{flex:1;overflow-x:auto;white-space:nowrap;padding:var(--kup_input_panel_padding--inline);display:inline-flex;align-items:flex-end}:host .input-panel--column{flex-direction:column}:host .input-panel__section_label_container{display:flex;flex-direction:column;gap:1rem}:host .input-panel__section{display:grid;min-width:0}:host .input-panel__section .f-cell__content>*{width:100%}:host .input-panel .f-text-field .mdc-text-field.mdc-text-field--textarea{min-height:var(--kup_textfield_textarea_height_input_panel) !important;min-width:var(--kup_textfield_textarea_width_input_panel) !important}:host .input-panel__horizontal-section{display:inline-grid}:host .input-panel__section-inline{display:inline-block;width:max-content}:host .input-panel__label_container{display:flex;flex-direction:column;justify-content:center}:host .input-panel__label_container>.f-cell{flex:1}:host .input-panel__tabs_container{display:flex;flex-direction:column;justify-content:center;gap:2rem}:host .input-panel .f-cell.number-cell .f-cell__content{--kup-textfield-font-family:var(--kup_cell_font_family);font-family:var(--kup_cell_font_family)}:host .input-panel .input-panel-label{display:flex;width:100%;height:100%;align-items:center;justify-content:center}:host .input-panel .input-panel-label--legacy-look{font-size:12px;font-family:var(--kup-font-family-monospace);white-space:pre;overflow:hidden}:host .input-panel--absolute{justify-content:flex-end;padding:var(--kup-space-02);max-height:var(--kup_input_panel_absolute_max_height);--kup-textfield-extrasmall-height:20px;--kup-textfield-extrasmall-padding:0 var(--kup-space-01)}:host .input-panel--absolute .input-panel-label{justify-content:start}:host .input-panel--absolute .input-panel-label.input-panel-label-number{justify-content:end}:host .input-panel--absolute .mdc-text-field{height:unset !important}:host .input-panel-form--inline{display:flex;align-items:end;gap:1rem}";export{hi as kup_input_panel}