@sme.up/ketchup 11.0.0-SNAPSHOT-20241107091530 → 11.0.0-SNAPSHOT-20241107155833

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 (165) hide show
  1. package/dist/cjs/{f-cell-32c25f65.js → f-cell-6c56dc27.js} +4 -4
  2. package/dist/cjs/{f-cell-32c25f65.js.map → f-cell-6c56dc27.js.map} +1 -1
  3. package/dist/cjs/{f-chip-3118b9ba.js → f-chip-ba07ec67.js} +2 -2
  4. package/dist/cjs/{f-chip-3118b9ba.js.map → f-chip-ba07ec67.js.map} +1 -1
  5. package/dist/cjs/{f-paginator-utils-3099b4b3.js → f-paginator-utils-34835b29.js} +2 -2
  6. package/dist/cjs/{f-paginator-utils-3099b4b3.js.map → f-paginator-utils-34835b29.js.map} +1 -1
  7. package/dist/cjs/{f-text-field-1ced2cfa.js → f-text-field-e1540ae4.js} +2 -2
  8. package/dist/cjs/{f-text-field-1ced2cfa.js.map → f-text-field-e1540ae4.js.map} +1 -1
  9. package/dist/cjs/index.cjs.js +1 -1
  10. package/dist/cjs/kup-accordion.cjs.entry.js +1 -1
  11. package/dist/cjs/kup-activity-timeline.cjs.entry.js +2 -2
  12. package/dist/cjs/kup-autocomplete_28.cjs.entry.js +6 -6
  13. package/dist/cjs/kup-box.cjs.entry.js +6 -6
  14. package/dist/cjs/kup-calendar.cjs.entry.js +2 -2
  15. package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
  16. package/dist/cjs/kup-cell.cjs.entry.js +4 -4
  17. package/dist/cjs/kup-dashboard.cjs.entry.js +2 -2
  18. package/dist/cjs/{kup-data-table-helper-457ee6aa.js → kup-data-table-helper-ca99429e.js} +2 -2
  19. package/dist/cjs/{kup-data-table-helper-457ee6aa.js.map → kup-data-table-helper-ca99429e.js.map} +1 -1
  20. package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
  21. package/dist/cjs/kup-echart.cjs.entry.js +1 -1
  22. package/dist/cjs/kup-editor.cjs.entry.js +1 -1
  23. package/dist/cjs/kup-family-tree.cjs.entry.js +1 -1
  24. package/dist/cjs/kup-grid.cjs.entry.js +1 -1
  25. package/dist/cjs/kup-htm.cjs.entry.js +1 -1
  26. package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
  27. package/dist/cjs/kup-image-list.cjs.entry.js +4 -4
  28. package/dist/cjs/kup-input-panel.cjs.entry.js +4 -4
  29. package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
  30. package/dist/cjs/kup-magic-box.cjs.entry.js +1 -1
  31. package/dist/cjs/{kup-manager-65839aad.js → kup-manager-458527e9.js} +2 -2
  32. package/dist/cjs/kup-manager-458527e9.js.map +1 -0
  33. package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
  34. package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
  35. package/dist/cjs/kup-pdf.cjs.entry.js +1 -1
  36. package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
  37. package/dist/cjs/kup-planner.cjs.entry.js +2 -2
  38. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  39. package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
  40. package/dist/cjs/kup-snackbar.cjs.entry.js +1 -1
  41. package/dist/cjs/kup-typography-list.cjs.entry.js +1 -1
  42. package/dist/cjs/kup-typography.cjs.entry.js +1 -1
  43. package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js +1 -1
  44. package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js.map +1 -1
  45. package/dist/components/kup-manager.js +1 -1
  46. package/dist/components/kup-manager.js.map +1 -1
  47. package/dist/esm/{f-cell-678a99c3.js → f-cell-dc6e3d13.js} +4 -4
  48. package/dist/esm/{f-cell-678a99c3.js.map → f-cell-dc6e3d13.js.map} +1 -1
  49. package/dist/esm/{f-chip-b0b7b121.js → f-chip-ba5e40f4.js} +2 -2
  50. package/dist/esm/{f-chip-b0b7b121.js.map → f-chip-ba5e40f4.js.map} +1 -1
  51. package/dist/esm/{f-paginator-utils-56f66406.js → f-paginator-utils-6283a294.js} +2 -2
  52. package/dist/esm/{f-paginator-utils-56f66406.js.map → f-paginator-utils-6283a294.js.map} +1 -1
  53. package/dist/esm/{f-text-field-73c20614.js → f-text-field-7ceb0591.js} +2 -2
  54. package/dist/esm/{f-text-field-73c20614.js.map → f-text-field-7ceb0591.js.map} +1 -1
  55. package/dist/esm/index.js +1 -1
  56. package/dist/esm/kup-accordion.entry.js +1 -1
  57. package/dist/esm/kup-activity-timeline.entry.js +2 -2
  58. package/dist/esm/kup-autocomplete_28.entry.js +6 -6
  59. package/dist/esm/kup-box.entry.js +6 -6
  60. package/dist/esm/kup-calendar.entry.js +2 -2
  61. package/dist/esm/kup-card-list.entry.js +1 -1
  62. package/dist/esm/kup-cell.entry.js +4 -4
  63. package/dist/esm/kup-dashboard.entry.js +2 -2
  64. package/dist/esm/{kup-data-table-helper-1333a2f8.js → kup-data-table-helper-353a9675.js} +2 -2
  65. package/dist/esm/{kup-data-table-helper-1333a2f8.js.map → kup-data-table-helper-353a9675.js.map} +1 -1
  66. package/dist/esm/kup-drawer.entry.js +1 -1
  67. package/dist/esm/kup-echart.entry.js +1 -1
  68. package/dist/esm/kup-editor.entry.js +1 -1
  69. package/dist/esm/kup-family-tree.entry.js +1 -1
  70. package/dist/esm/kup-grid.entry.js +1 -1
  71. package/dist/esm/kup-htm.entry.js +1 -1
  72. package/dist/esm/kup-iframe.entry.js +1 -1
  73. package/dist/esm/kup-image-list.entry.js +4 -4
  74. package/dist/esm/kup-input-panel.entry.js +4 -4
  75. package/dist/esm/kup-lazy.entry.js +1 -1
  76. package/dist/esm/kup-magic-box.entry.js +1 -1
  77. package/dist/esm/{kup-manager-c6f89439.js → kup-manager-f28f3f94.js} +2 -2
  78. package/dist/esm/{kup-manager-c6f89439.js.map → kup-manager-f28f3f94.js.map} +1 -1
  79. package/dist/esm/kup-nav-bar.entry.js +1 -1
  80. package/dist/esm/kup-numeric-picker.entry.js +2 -2
  81. package/dist/esm/kup-pdf.entry.js +1 -1
  82. package/dist/esm/kup-photo-frame.entry.js +1 -1
  83. package/dist/esm/kup-planner.entry.js +2 -2
  84. package/dist/esm/kup-probe.entry.js +1 -1
  85. package/dist/esm/kup-qlik.entry.js +1 -1
  86. package/dist/esm/kup-snackbar.entry.js +1 -1
  87. package/dist/esm/kup-typography-list.entry.js +1 -1
  88. package/dist/esm/kup-typography.entry.js +1 -1
  89. package/dist/ketchup/index.esm.js +1 -1
  90. package/dist/ketchup/ketchup.esm.js +1 -1
  91. package/dist/ketchup/p-04c25532.entry.js +2 -0
  92. package/dist/ketchup/{p-197aa6ed.entry.js.map → p-04c25532.entry.js.map} +1 -1
  93. package/dist/ketchup/{p-f8fe5435.entry.js → p-057f17e6.entry.js} +2 -2
  94. package/dist/ketchup/{p-634b3510.entry.js → p-0b1e37b8.entry.js} +2 -2
  95. package/dist/ketchup/{p-d336255f.js → p-1362560b.js} +2 -2
  96. package/dist/ketchup/{p-9b0551b5.js → p-170d2abd.js} +2 -2
  97. package/dist/ketchup/{p-a496ba6a.entry.js → p-2a6bb010.entry.js} +2 -2
  98. package/dist/ketchup/{p-65780ddc.entry.js → p-2d68ffb5.entry.js} +2 -2
  99. package/dist/ketchup/{p-7f762e33.entry.js → p-3338a656.entry.js} +2 -2
  100. package/dist/ketchup/{p-42ea84f3.entry.js → p-37d71bc6.entry.js} +2 -2
  101. package/dist/ketchup/{p-dd816cfe.entry.js → p-3a2a4de6.entry.js} +2 -2
  102. package/dist/ketchup/{p-a3b1896e.entry.js → p-43b236fe.entry.js} +2 -2
  103. package/dist/ketchup/{p-f073ce49.entry.js → p-4a39ec70.entry.js} +2 -2
  104. package/dist/ketchup/{p-256ca361.entry.js → p-5655beb9.entry.js} +2 -2
  105. package/dist/ketchup/{p-6e4b8f6d.entry.js → p-5da3d8ef.entry.js} +2 -2
  106. package/dist/ketchup/{p-e545ca7b.entry.js → p-64ae9a7d.entry.js} +2 -2
  107. package/dist/ketchup/{p-ebdf1442.entry.js → p-75e96ca0.entry.js} +2 -2
  108. package/dist/ketchup/p-81285484.js +29 -0
  109. package/dist/{cjs/kup-manager-65839aad.js.map → ketchup/p-81285484.js.map} +1 -1
  110. package/dist/ketchup/{p-2b14f215.js → p-854b53fb.js} +2 -2
  111. package/dist/ketchup/{p-0efc24e7.entry.js → p-8e04c2fd.entry.js} +2 -2
  112. package/dist/ketchup/{p-b05c0af5.entry.js → p-92fcbf1a.entry.js} +2 -2
  113. package/dist/ketchup/{p-07e7fade.entry.js → p-947559c9.entry.js} +2 -2
  114. package/dist/ketchup/{p-3e9957c1.entry.js → p-98e9e968.entry.js} +2 -2
  115. package/dist/ketchup/{p-69ada7f9.entry.js → p-99813847.entry.js} +2 -2
  116. package/dist/ketchup/{p-d1fc3c35.entry.js → p-aab21af5.entry.js} +2 -2
  117. package/dist/ketchup/{p-5184497b.entry.js → p-b9f36550.entry.js} +2 -2
  118. package/dist/ketchup/p-ba1eb179.js +2 -0
  119. package/dist/ketchup/{p-00286291.entry.js → p-baaf5cdc.entry.js} +2 -2
  120. package/dist/ketchup/{p-4d6644f0.entry.js → p-bdcd92b2.entry.js} +2 -2
  121. package/dist/ketchup/{p-ddc78c64.entry.js → p-c4d94b5d.entry.js} +2 -2
  122. package/dist/ketchup/{p-b947f411.entry.js → p-d1a9c9a1.entry.js} +2 -2
  123. package/dist/ketchup/{p-31d98241.entry.js → p-d3e76f80.entry.js} +2 -2
  124. package/dist/ketchup/{p-784120c9.entry.js → p-ddee8c53.entry.js} +2 -2
  125. package/dist/ketchup/{p-dfaaabb5.entry.js → p-de9c014f.entry.js} +2 -2
  126. package/dist/ketchup/{p-e34f8755.entry.js → p-fbd5c6f3.entry.js} +2 -2
  127. package/dist/ketchup/{p-49485bbf.js → p-fcfc07e1.js} +2 -2
  128. package/package.json +1 -1
  129. package/dist/ketchup/p-197aa6ed.entry.js +0 -2
  130. package/dist/ketchup/p-e9985f62.js +0 -2
  131. package/dist/ketchup/p-f98dc5f6.js +0 -29
  132. package/dist/ketchup/p-f98dc5f6.js.map +0 -1
  133. /package/dist/ketchup/{p-f8fe5435.entry.js.map → p-057f17e6.entry.js.map} +0 -0
  134. /package/dist/ketchup/{p-634b3510.entry.js.map → p-0b1e37b8.entry.js.map} +0 -0
  135. /package/dist/ketchup/{p-d336255f.js.map → p-1362560b.js.map} +0 -0
  136. /package/dist/ketchup/{p-9b0551b5.js.map → p-170d2abd.js.map} +0 -0
  137. /package/dist/ketchup/{p-a496ba6a.entry.js.map → p-2a6bb010.entry.js.map} +0 -0
  138. /package/dist/ketchup/{p-65780ddc.entry.js.map → p-2d68ffb5.entry.js.map} +0 -0
  139. /package/dist/ketchup/{p-7f762e33.entry.js.map → p-3338a656.entry.js.map} +0 -0
  140. /package/dist/ketchup/{p-42ea84f3.entry.js.map → p-37d71bc6.entry.js.map} +0 -0
  141. /package/dist/ketchup/{p-dd816cfe.entry.js.map → p-3a2a4de6.entry.js.map} +0 -0
  142. /package/dist/ketchup/{p-a3b1896e.entry.js.map → p-43b236fe.entry.js.map} +0 -0
  143. /package/dist/ketchup/{p-f073ce49.entry.js.map → p-4a39ec70.entry.js.map} +0 -0
  144. /package/dist/ketchup/{p-256ca361.entry.js.map → p-5655beb9.entry.js.map} +0 -0
  145. /package/dist/ketchup/{p-6e4b8f6d.entry.js.map → p-5da3d8ef.entry.js.map} +0 -0
  146. /package/dist/ketchup/{p-e545ca7b.entry.js.map → p-64ae9a7d.entry.js.map} +0 -0
  147. /package/dist/ketchup/{p-ebdf1442.entry.js.map → p-75e96ca0.entry.js.map} +0 -0
  148. /package/dist/ketchup/{p-2b14f215.js.map → p-854b53fb.js.map} +0 -0
  149. /package/dist/ketchup/{p-0efc24e7.entry.js.map → p-8e04c2fd.entry.js.map} +0 -0
  150. /package/dist/ketchup/{p-b05c0af5.entry.js.map → p-92fcbf1a.entry.js.map} +0 -0
  151. /package/dist/ketchup/{p-07e7fade.entry.js.map → p-947559c9.entry.js.map} +0 -0
  152. /package/dist/ketchup/{p-3e9957c1.entry.js.map → p-98e9e968.entry.js.map} +0 -0
  153. /package/dist/ketchup/{p-69ada7f9.entry.js.map → p-99813847.entry.js.map} +0 -0
  154. /package/dist/ketchup/{p-d1fc3c35.entry.js.map → p-aab21af5.entry.js.map} +0 -0
  155. /package/dist/ketchup/{p-5184497b.entry.js.map → p-b9f36550.entry.js.map} +0 -0
  156. /package/dist/ketchup/{p-e9985f62.js.map → p-ba1eb179.js.map} +0 -0
  157. /package/dist/ketchup/{p-00286291.entry.js.map → p-baaf5cdc.entry.js.map} +0 -0
  158. /package/dist/ketchup/{p-4d6644f0.entry.js.map → p-bdcd92b2.entry.js.map} +0 -0
  159. /package/dist/ketchup/{p-ddc78c64.entry.js.map → p-c4d94b5d.entry.js.map} +0 -0
  160. /package/dist/ketchup/{p-b947f411.entry.js.map → p-d1a9c9a1.entry.js.map} +0 -0
  161. /package/dist/ketchup/{p-31d98241.entry.js.map → p-d3e76f80.entry.js.map} +0 -0
  162. /package/dist/ketchup/{p-784120c9.entry.js.map → p-ddee8c53.entry.js.map} +0 -0
  163. /package/dist/ketchup/{p-dfaaabb5.entry.js.map → p-de9c014f.entry.js.map} +0 -0
  164. /package/dist/ketchup/{p-e34f8755.entry.js.map → p-fbd5c6f3.entry.js.map} +0 -0
  165. /package/dist/ketchup/{p-49485bbf.js.map → p-fcfc07e1.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{r as t,c as i,f as s,h as e,H as n,d as h,g as o}from"./p-d7c15b0e.js";import{k as a,ag as f,g as r,s as l,b as d,E as u}from"./p-f98dc5f6.js";import{K as c,d as p,a as m,b as k,c as w}from"./p-cd3a7d53.js";import{c as g}from"./p-635bb4b3.js";import{F as y}from"./p-9b0551b5.js";import{F as v}from"./p-c4054aba.js";import"./p-029c7cbe.js";import"./p-2b519589.js";import"./p-d4a879fc.js";const b=a();function x(t,i,s,e,n,h,o,a){const f=D(t,i);let r=[];if(s&&e){if(C(s,e)){r=D(s,e)}else{r=[...f]}}let l=[];if(n&&h){if(z(n,h)){l=S(n,h)}else{r=[...f]}}let d=[];if(o&&a){if(z(o,a)){d=S(o,a)}else{r=[...f]}}return{dateValues:f,secDateValues:r,hourValues:l,secHourValues:d}}function D(t,i){let s=[t.value,i.value];if(j(t)&&j(i)){return s}else if(j(t)){return[t.value,t.value]}else if(j(i)){return[i.value,i.value]}else{return s}}function S(t,i){let s=[t.value,i.value];if(O(t)&&O(i)){return s}else if(O(t)){return[t.value,t.value]}else if(O(i)){return[i.value,i.value]}else{return 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,e,n,h){let o=()=>n.map((i=>f(e.find((t=>t.name==i)),t.cells[i])));if(h){o=h}const a=(n===null||n===void 0?void 0:n.length)>=2?o():[t.cells[i].value,t.cells[s].value];return a}class E{constructor(){this.showSecondaryDates=false;this.detailFilter="";this.detailInitialScrollX=0;this.detailInitialScrollY=0;this.taskFilter="";this.taskInitialScrollX=0;this.taskInitialScrollY=0;this.viewMode="day"}toDebugString(){return"dt state"}}const H=".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: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:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);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}";const M=H;var P=undefined&&undefined.__classPrivateFieldGet||function(t,i,s,e){if(s==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof i==="function"?t!==i||!e:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?e:s==="a"?e.call(t):e?e.value:i.get(t)};var W=undefined&&undefined.__classPrivateFieldSet||function(t,i,s,e,n){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof i==="function"?t!==i||!n:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?n.call(t,s):n?n.value=s:i.set(t,s),s};var I,R,V,Y,K,A,G,X,L,F,N,_,q,B,J,Q,U,Z,$,tt,it,st,et,nt;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);I.add(this);this.state=new E;this.plannerRenderer=undefined;R.set(this,a());V.set(this,void 0);Y.set(this,[]);K.set(this,{});A.set(this,void 0);this.stateId="";this.store=undefined;this.customStyle="";this.data=undefined;this.detailData=undefined;this.detailColorCol=undefined;this.detailColumns=undefined;this.detailDates=undefined;this.detailFilter=undefined;this.detailHeight=undefined;this.detailHours=[];this.detailIconCol=undefined;this.detailIdCol=undefined;this.detailNameCol=undefined;this.detailPrevHours=[];this.detailPrevDates=undefined;this.detailInitialScrollX=undefined;this.detailInitialScrollY=undefined;this.listCellWidth="300px";this.maxWidth="90vw";this.phaseColorCol=undefined;this.phaseColumns=undefined;this.phaseColParDep=undefined;this.phaseDates=undefined;this.phaseHours=[];this.phaseIconCol=undefined;this.phaseIdCol=undefined;this.phaseNameCol=undefined;this.phasePrevHours=[];this.phasePrevDates=undefined;this.readOnly=false;this.showSecondaryDates=false;this.taskColumns=undefined;this.taskDates=undefined;this.taskFilter=undefined;this.taskHeight=undefined;this.taskHours=[];this.taskIconCol=undefined;this.taskIdCol=undefined;this.taskInitialScrollX=undefined;this.taskInitialScrollY=undefined;this.taskNameCol=undefined;this.taskPrevHours=[];this.taskPrevDates=undefined;this.titleMess=undefined;this.viewMode="month";this.mainFilter=undefined;this.secondaryFilter=undefined;this.scrollableTaskList=false;this.plannerProps=undefined}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);if(t!=null){P(this,R,"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=false;if(!P(this,R,"f").objects.deepEqual(this.state.detailFilter,P(this,A,"f").detailFilter)){this.state.detailFilter=P(this,A,"f").detailFilter;t=true}if(!P(this,R,"f").objects.deepEqual(this.state.showSecondaryDates,P(this,A,"f").showSecondaryDates)){this.state.showSecondaryDates=P(this,A,"f").showSecondaryDates;t=true}if(!P(this,R,"f").objects.deepEqual(this.state.detailInitialScrollX,P(this,A,"f").detailInitialScrollX)){this.state.detailInitialScrollX=P(this,A,"f").detailInitialScrollX;t=true}if(!P(this,R,"f").objects.deepEqual(this.state.detailInitialScrollY,P(this,A,"f").detailInitialScrollY)){this.state.detailInitialScrollY=P(this,A,"f").detailInitialScrollY;t=true}if(!P(this,R,"f").objects.deepEqual(this.state.taskFilter,P(this,A,"f").taskFilter)){this.state.taskFilter=P(this,A,"f").taskFilter;t=true}if(!P(this,R,"f").objects.deepEqual(this.state.taskInitialScrollX,P(this,A,"f").taskInitialScrollX)){this.state.taskInitialScrollX=P(this,A,"f").taskInitialScrollX;t=true}if(!P(this,R,"f").objects.deepEqual(this.state.taskInitialScrollY,P(this,A,"f").taskInitialScrollY)){this.state.taskInitialScrollY=P(this,A,"f").taskInitialScrollY;t=true}if(!P(this,R,"f").objects.deepEqual(this.state.viewMode,P(this,A,"f").viewMode)){this.state.viewMode=P(this,A,"f").viewMode;t=true}if(t){P(this,R,"f").debug.logMessage(this,"Persisting stateId "+this.stateId);this.store.persistState(this.stateId,this.state)}}}dataChanged(){W(this,K,{},"f")}async getProps(t){return r(this,w,t)}async refresh(){s(this);this.plannerRenderer.refresh()}async setProps(t){l(this,w,t)}async addPhases(t,i){var s;const e=P(this,I,"m",L).call(this,t);if(e){P(this,K,"f")[t]=i;e.phases=(s=i.rows)===null||s===void 0?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]]);const n=T(t,this.phaseIdCol,this.phaseNameCol,i.columns,this.phaseColumns,(()=>this.phaseColumns.map((s=>s==this.phaseDates[0]?"#START#":s==this.phaseDates[1]?"#END#":f(i.columns.find((t=>t.name==s)),t.cells[s])))));let h=P(this,I,"m",et).call(this,t,this.phaseIconCol);let o=P(this,I,"m",nt).call(this,t,this.phaseIconCol);let a={taskRow:e.taskRow,phaseRow:t,id:e.id+"_"+t.cells[this.phaseIdCol].value,phaseRowId:t.id,taskRowId:e.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:n,rowType:c.PHASE,icon:h?{url:h,color:o!==null&&o!==void 0?o:"#595959"}:undefined,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]};return a}))}this.plannerProps.mainGantt.initialScrollX=P(this,A,"f").taskInitialScrollX;this.plannerProps.mainGantt.initialScrollY=P(this,A,"f").taskInitialScrollY;if(this.plannerProps.secondaryGantt){this.plannerProps.secondaryGantt.initialScrollX=P(this,A,"f").detailInitialScrollX;this.plannerProps.secondaryGantt.initialScrollX=P(this,A,"f").detailInitialScrollY}this.plannerProps=Object.assign({},this.plannerProps);this.refresh()}componentWillLoad(){P(this,R,"f").debug.logLoad(this,false);P(this,R,"f").theme.register(this);this.initWithPersistedState();W(this,A,{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=P(this,I,"m",X).call(this,P(this,I,"m",st).call(this,P(this,A,"f").detailFilter,true));const i=this.rootElement.shadowRoot.querySelector("#main-filter");v(i);const s=this.rootElement.shadowRoot.querySelector("#secondary-filter");if(t){v(s)}let e;let n;let h;const o=500;this.plannerProps={mainGantt:{title:this.titleMess,items:P(this,I,"m",G).call(this,P(this,I,"m",st).call(this,P(this,A,"f").taskFilter,false)),stylingOptions:Object.assign(Object.assign({},p),{listCellWidth:this.listCellWidth}),filter:i,hideLabel:true,ganttHeight:this.taskHeight,showSecondaryDates:P(this,A,"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(n);n=window.setTimeout((()=>this.handleTaskGanttScrollY(t)),o)},onPhaseDrop:t=>this.handleOnPhaseDrop(t)},secondaryGantt:t?{title:"",items:t,stylingOptions:Object.assign(Object.assign({},p),{listCellWidth:this.listCellWidth}),filter:s,hideLabel:true,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(h);h=window.setTimeout((()=>this.handleDetailGanttScrollY(t)),o)}}:undefined,onSetDoubleView:t=>this.handleOnSetDoubleView(t),onSetViewMode:t=>this.handleOnSetViewMode(t),viewMode:this.viewMode,scrollableTaskList:this.scrollableTaskList,onScrollX:t=>{window.clearTimeout(e);e=window.setTimeout((()=>this.handleOnScrollX(t)),o)}};this.kupReady.emit({comp:this,id:this.rootElement.id,value:undefined});if(this.taskFilter){P(this,I,"m",it).call(this,this.taskFilter)}if(this.detailFilter){P(this,I,"m",it).call(this,this.detailFilter,true)}P(this,R,"f").debug.logLoad(this,true)}componentDidRender(){this.persistState();P(this,R,"f").debug.logRender(this,true)}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 e;let n;let h;switch(i.type){case"project":{e=i.taskRow;n=e.cells[this.taskIdCol];h=this.data.columns[this.taskIdCol];break}case"task":{e=i.phaseRow;n=e.cells[this.phaseIdCol];break}case"timeline":{e=i.detailRow;n=e.cells[this.detailIdCol];h=this.data.columns[this.detailIdCol];break}}this.kupContextMenu.emit({comp:this,id:this.rootElement.id,value:i,taskAction:s,details:{cell:n,column:h,originalEvent:t,row:e}})}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 c.TASK:if(P(this,I,"m",N).call(this)){this.onKupDblClick(t,m.onDblClick)}break;case c.PHASE:if(P(this,I,"m",_).call(this)){this.onKupDblClick(t,m.onDblClick)}break;case c.DETAIL:if(P(this,I,"m",q).call(this)){this.onKupDblClick(t,m.onDblClick)}break}for(let t=0;t<P(this,Y,"f").length;t++){clearTimeout(P(this,Y,"f")[t]);P(this,R,"f").debug.logMessage(this,"Cleared click timeout("+P(this,Y,"f")[t]+").")}W(this,Y,[],"f")}handleOnClick(t){P(this,Y,"f").push(setTimeout((()=>{switch(t.rowType){case c.TASK:const i=t.phases?m.onTaskClosing:m.onTaskOpening;if(P(this,I,"m",B).call(this,t)){this.onKupClick(t,i)}break;case c.PHASE:if(P(this,I,"m",J).call(this)){this.onKupClick(t,m.onClick)}break;case c.DETAIL:if(P(this,I,"m",Q).call(this)){this.onKupClick(t,m.onClick)}break}}),300))}handleOnContextMenu(t,i){switch(i.rowType){case c.TASK:if(P(this,I,"m",U).call(this)){this.onKupContextMenu(t,i,m.onRightClick)}break;case c.PHASE:if(P(this,I,"m",Z).call(this)){this.onKupContextMenu(t,i,m.onRightClick)}break;case c.DETAIL:if(P(this,I,"m",$).call(this)){this.onKupContextMenu(t,i,m.onRightClick)}break}}handleOnSetDoubleView(t){var i;P(this,A,"f").showSecondaryDates=t;if((i=this.plannerProps)===null||i===void 0?void 0:i.mainGantt){this.plannerProps.mainGantt.showSecondaryDates=t}this.persistState()}handleOnSetViewMode(t){P(this,A,"f").viewMode=t;this.plannerProps.viewMode=t;this.persistState()}handleOnScrollX(t){P(this,A,"f").taskInitialScrollX=t;P(this,A,"f").detailInitialScrollX=t;this.persistState()}handleTaskGanttScrollY(t){P(this,A,"f").taskInitialScrollY=t;this.persistState()}handleDetailGanttScrollY(t){P(this,A,"f").detailInitialScrollY=t;this.persistState()}handleOnDateChange(t){if(P(this,I,"m",tt).call(this,t)){if(t.rowType!=c.DETAIL){this.onKupDateChange(t,m.onResize)}}}handleOnPhaseDrop(t){this.onKupPhaseDrop(t,m.onTask)}render(){var t,i,s;const h=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({},(t=this.plannerProps)===null||t===void 0?void 0:t.mainGantt),{onScrollY:this.handleTaskGanttScrollY.bind(this)})}):null;if((i=this.plannerProps)===null||i===void 0?void 0:i.secondaryGantt){h.secondaryGantt=Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{onScrollY:this.handleDetailGanttScrollY.bind(this)})}return e(n,{key:"ec595d6944c84d1ff3419a4f9ea4b05b9daa7c8c"},e("style",{key:"9476707409a3f42a4053432d9516fda679f96341"},P(this,R,"f").theme.setKupStyle(this.rootElement)),e("div",{key:"ebcc7405f609f4ecffee385e5c3e710e67e67493",id:g,style:{maxWidth:this.maxWidth}},this.plannerProps&&e("kup-planner-renderer",{key:"9cb8c0178398029f74dded13fb14d96d5a3f3652",props:h,ref:t=>this.plannerRenderer=t})),e("div",{key:"227fba551833686254d2f9d904093fb1cd6afb31",style:{display:this.plannerProps?"none":""}},e(y,{key:"4cb494e54f8ca483dd46165b606ab1b54c5da58a",icon:d.SEARCH,id:"main-filter",label:P(this,R,"f").language.translate(u.SEARCH),onKeyDown:t=>{if(t.key==="Enter"){P(this,I,"m",it).call(this,t.target.value)}},value:this.taskFilter,wrapperClass:"filter"}),((s=this.detailData)===null||s===void 0?void 0:s.rows)&&this.detailData.rows.length>0?e(y,{icon:d.SEARCH,id:"secondary-filter",label:P(this,R,"f").language.translate(u.SEARCH),onKeyDown:t=>{if(t.key==="Enter"){P(this,I,"m",it).call(this,t.target.value,true)}},value:this.detailFilter,wrapperClass:"filter"}):null))}disconnectedCallback(){P(this,R,"f").theme.unregister(this);this.kupDidUnload.emit({comp:this,id:this.rootElement.id,storedSettings:P(this,A,"f")})}get rootElement(){return h(this)}static get watchers(){return{data:["dataChanged"]}}};R=new WeakMap,V=new WeakMap,Y=new WeakMap,K=new WeakMap,A=new WeakMap,I=new WeakSet,G=function t(i){var s;if(!i||!i.rows){return[]}let e=(s=i.rows)===null||s===void 0?void 0:s.filter((t=>C(t.cells[this.taskDates[0]],t.cells[this.taskDates[1]]))).map((t=>{const s=x(t.cells[this.taskDates[0]],t.cells[this.taskDates[1]],t.cells[this.taskPrevDates[0]],t.cells[this.taskPrevDates[1]],t.cells[this.taskHours[0]],t.cells[this.taskHours[1]],t.cells[this.taskPrevHours[0]],t.cells[this.taskPrevHours[1]]);const e=T(t,this.taskIdCol,this.taskNameCol,i.columns,this.taskColumns,(()=>this.taskColumns.map((s=>s==this.taskDates[0]?"#START#":s==this.taskDates[1]?"#END#":f(i.columns.find((t=>t.name==s)),t.cells[s])))));let n=P(this,I,"m",et).call(this,t,this.taskIconCol);let h=P(this,I,"m",nt).call(this,t,this.taskIconCol);let o={taskRow:t,taskRowId:t.id,id:t.cells[this.taskIdCol].value,name:t.cells[this.taskNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"project",valuesToShow:e,rowType:c.TASK,icon:n?{url:n,color:h!==null&&h!==void 0?h:"#595959"}:undefined,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]};return o}));return e},X=function t(i){if(!i||!i.rows){return undefined}let s=[];i.rows.filter((t=>C(t.cells[this.detailDates[0]],t.cells[this.detailDates[1]]))).forEach((t=>{var e,n;const h=t.cells[this.detailIdCol].value;const o=t.cells[this.detailNameCol].value;const a=x(t.cells[this.detailDates[0]],t.cells[this.detailDates[1]],undefined,undefined,t.cells[this.detailHours[0]],t.cells[this.detailHours[1]]);const f=T(t,this.detailIdCol,this.detailNameCol,i.columns,this.detailColumns);let r=s.find((t=>t.id==h));if(!r){r={id:h,name:o,detailRow:t,type:"timeline",valuesToShow:f,rowType:c.DETAIL,schedule:[]};s.push(r)}let l=P(this,I,"m",et).call(this,t,this.detailIconCol);let d=P(this,I,"m",nt).call(this,t,this.detailIconCol);r.schedule.push({startDate:a.dateValues[0],endDate:a.dateValues[1],color:this.detailColorCol?(e=t.cells[this.detailColorCol].value)!==null&&e!==void 0?e:"#D9D9D8":"#D9D9D8",selectedColor:this.detailColorCol?(n=t.cells[this.detailColorCol].value)!==null&&n!==void 0?n:"#D9D9D8":"#D9D9D8",icon:l?{url:l,color:d!==null&&d!==void 0?d:"#595959"}:undefined,startHour:a.hourValues[0],endHour:a.hourValues[1]})}));return s},L=function t(i){return this.plannerProps.mainGantt.items.find((t=>t.id==i))},F=function t(i){const s=P(this,I,"m",L).call(this,i);if(s)s.phases=undefined;this.plannerProps=Object.assign({},this.plannerProps)},N=function t(){return true},_=function t(){return true},q=function t(){return true},B=function t(i){const s=P(this,I,"m",L).call(this,i.id);if(s===null||s===void 0?void 0:s.phases){P(this,I,"m",F).call(this,s.id)}return true},J=function t(){return true},Q=function t(){return true},U=function t(){return true},Z=function t(){return true},$=function t(){return true},tt=function t(i){let s=false;if(!P(this,V,"f")){s=true;W(this,V,new k(i),"f")}else if(!P(this,V,"f").isEquivalent(i)){W(this,V,new k(i),"f");s=true}return s},it=function t(i,s){if(s){P(this,A,"f").detailFilter=i}else{P(this,A,"f").taskFilter=i}const e=s?{secondaryGantt:Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{items:P(this,I,"m",X).call(this,P(this,I,"m",st).call(this,i,s))})}:{mainGantt:Object.assign(Object.assign({},this.plannerProps.mainGantt),{items:P(this,I,"m",G).call(this,P(this,I,"m",st).call(this,i,s))})};this.plannerProps=Object.assign(Object.assign({},this.plannerProps),e);this.persistState()},st=function t(i,s){const e=s?this.detailData:this.data;if(!e||!e.rows||e.rows.length==0){return undefined}if(!i){return e}const n={columns:this.data.columns,rows:[]};const h=[];for(let t=0;t<e.rows.length;t++){const s=e.rows[t];const n=s.cells;for(let t=0;t<e.columns.length;t++){const o=e.columns[t];const a=n[o.name];if(a){const n=f(e.columns[t],a);const o=!!(n.toLowerCase().indexOf(i.toLowerCase())>-1);if(o){h.push({row:s,weight:t});break}}}}h.sort(((t,i)=>t.weight-i.weight)).forEach((t=>{n.rows.push(t.row)}));return n},et=function t(i,s){var e;let n=undefined;if(s){const t=i.cells[s];let h=(e=t===null||t===void 0?void 0:t.data)===null||e===void 0?void 0:e.resource;if(!h){h=t.value}if(h){n=o("./assets/svg/"+h+".svg")}}return n},nt=function t(i,s){var e;let n=undefined;if(s){const t=i.cells[s];n=(e=t===null||t===void 0?void 0:t.data)===null||e===void 0?void 0:e.color;if(n){n=P(this,R,"f").theme.colorCheck(n).hexColor}}return n};ht.style=M;export{ht as kup_planner};
2
- //# sourceMappingURL=p-634b3510.entry.js.map
1
+ import{r as t,c as i,f as s,h as e,H as n,d as h,g as o}from"./p-d7c15b0e.js";import{k as a,ag as f,g as r,s as l,b as d,E as u}from"./p-81285484.js";import{K as c,d as p,a as m,b as k,c as w}from"./p-cd3a7d53.js";import{c as g}from"./p-635bb4b3.js";import{F as y}from"./p-170d2abd.js";import{F as v}from"./p-c4054aba.js";import"./p-029c7cbe.js";import"./p-2b519589.js";import"./p-d4a879fc.js";const b=a();function x(t,i,s,e,n,h,o,a){const f=D(t,i);let r=[];if(s&&e){if(C(s,e)){r=D(s,e)}else{r=[...f]}}let l=[];if(n&&h){if(z(n,h)){l=S(n,h)}else{r=[...f]}}let d=[];if(o&&a){if(z(o,a)){d=S(o,a)}else{r=[...f]}}return{dateValues:f,secDateValues:r,hourValues:l,secHourValues:d}}function D(t,i){let s=[t.value,i.value];if(j(t)&&j(i)){return s}else if(j(t)){return[t.value,t.value]}else if(j(i)){return[i.value,i.value]}else{return s}}function S(t,i){let s=[t.value,i.value];if(O(t)&&O(i)){return s}else if(O(t)){return[t.value,t.value]}else if(O(i)){return[i.value,i.value]}else{return 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,e,n,h){let o=()=>n.map((i=>f(e.find((t=>t.name==i)),t.cells[i])));if(h){o=h}const a=(n===null||n===void 0?void 0:n.length)>=2?o():[t.cells[i].value,t.cells[s].value];return a}class E{constructor(){this.showSecondaryDates=false;this.detailFilter="";this.detailInitialScrollX=0;this.detailInitialScrollY=0;this.taskFilter="";this.taskInitialScrollX=0;this.taskInitialScrollY=0;this.viewMode="day"}toDebugString(){return"dt state"}}const H=".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: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:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);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}";const M=H;var P=undefined&&undefined.__classPrivateFieldGet||function(t,i,s,e){if(s==="a"&&!e)throw new TypeError("Private accessor was defined without a getter");if(typeof i==="function"?t!==i||!e:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?e:s==="a"?e.call(t):e?e.value:i.get(t)};var W=undefined&&undefined.__classPrivateFieldSet||function(t,i,s,e,n){if(e==="m")throw new TypeError("Private method is not writable");if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof i==="function"?t!==i||!n:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e==="a"?n.call(t,s):n?n.value=s:i.set(t,s),s};var I,R,V,Y,K,A,G,X,L,F,N,_,q,B,J,Q,U,Z,$,tt,it,st,et,nt;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);I.add(this);this.state=new E;this.plannerRenderer=undefined;R.set(this,a());V.set(this,void 0);Y.set(this,[]);K.set(this,{});A.set(this,void 0);this.stateId="";this.store=undefined;this.customStyle="";this.data=undefined;this.detailData=undefined;this.detailColorCol=undefined;this.detailColumns=undefined;this.detailDates=undefined;this.detailFilter=undefined;this.detailHeight=undefined;this.detailHours=[];this.detailIconCol=undefined;this.detailIdCol=undefined;this.detailNameCol=undefined;this.detailPrevHours=[];this.detailPrevDates=undefined;this.detailInitialScrollX=undefined;this.detailInitialScrollY=undefined;this.listCellWidth="300px";this.maxWidth="90vw";this.phaseColorCol=undefined;this.phaseColumns=undefined;this.phaseColParDep=undefined;this.phaseDates=undefined;this.phaseHours=[];this.phaseIconCol=undefined;this.phaseIdCol=undefined;this.phaseNameCol=undefined;this.phasePrevHours=[];this.phasePrevDates=undefined;this.readOnly=false;this.showSecondaryDates=false;this.taskColumns=undefined;this.taskDates=undefined;this.taskFilter=undefined;this.taskHeight=undefined;this.taskHours=[];this.taskIconCol=undefined;this.taskIdCol=undefined;this.taskInitialScrollX=undefined;this.taskInitialScrollY=undefined;this.taskNameCol=undefined;this.taskPrevHours=[];this.taskPrevDates=undefined;this.titleMess=undefined;this.viewMode="month";this.mainFilter=undefined;this.secondaryFilter=undefined;this.scrollableTaskList=false;this.plannerProps=undefined}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);if(t!=null){P(this,R,"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=false;if(!P(this,R,"f").objects.deepEqual(this.state.detailFilter,P(this,A,"f").detailFilter)){this.state.detailFilter=P(this,A,"f").detailFilter;t=true}if(!P(this,R,"f").objects.deepEqual(this.state.showSecondaryDates,P(this,A,"f").showSecondaryDates)){this.state.showSecondaryDates=P(this,A,"f").showSecondaryDates;t=true}if(!P(this,R,"f").objects.deepEqual(this.state.detailInitialScrollX,P(this,A,"f").detailInitialScrollX)){this.state.detailInitialScrollX=P(this,A,"f").detailInitialScrollX;t=true}if(!P(this,R,"f").objects.deepEqual(this.state.detailInitialScrollY,P(this,A,"f").detailInitialScrollY)){this.state.detailInitialScrollY=P(this,A,"f").detailInitialScrollY;t=true}if(!P(this,R,"f").objects.deepEqual(this.state.taskFilter,P(this,A,"f").taskFilter)){this.state.taskFilter=P(this,A,"f").taskFilter;t=true}if(!P(this,R,"f").objects.deepEqual(this.state.taskInitialScrollX,P(this,A,"f").taskInitialScrollX)){this.state.taskInitialScrollX=P(this,A,"f").taskInitialScrollX;t=true}if(!P(this,R,"f").objects.deepEqual(this.state.taskInitialScrollY,P(this,A,"f").taskInitialScrollY)){this.state.taskInitialScrollY=P(this,A,"f").taskInitialScrollY;t=true}if(!P(this,R,"f").objects.deepEqual(this.state.viewMode,P(this,A,"f").viewMode)){this.state.viewMode=P(this,A,"f").viewMode;t=true}if(t){P(this,R,"f").debug.logMessage(this,"Persisting stateId "+this.stateId);this.store.persistState(this.stateId,this.state)}}}dataChanged(){W(this,K,{},"f")}async getProps(t){return r(this,w,t)}async refresh(){s(this);this.plannerRenderer.refresh()}async setProps(t){l(this,w,t)}async addPhases(t,i){var s;const e=P(this,I,"m",L).call(this,t);if(e){P(this,K,"f")[t]=i;e.phases=(s=i.rows)===null||s===void 0?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]]);const n=T(t,this.phaseIdCol,this.phaseNameCol,i.columns,this.phaseColumns,(()=>this.phaseColumns.map((s=>s==this.phaseDates[0]?"#START#":s==this.phaseDates[1]?"#END#":f(i.columns.find((t=>t.name==s)),t.cells[s])))));let h=P(this,I,"m",et).call(this,t,this.phaseIconCol);let o=P(this,I,"m",nt).call(this,t,this.phaseIconCol);let a={taskRow:e.taskRow,phaseRow:t,id:e.id+"_"+t.cells[this.phaseIdCol].value,phaseRowId:t.id,taskRowId:e.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:n,rowType:c.PHASE,icon:h?{url:h,color:o!==null&&o!==void 0?o:"#595959"}:undefined,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]};return a}))}this.plannerProps.mainGantt.initialScrollX=P(this,A,"f").taskInitialScrollX;this.plannerProps.mainGantt.initialScrollY=P(this,A,"f").taskInitialScrollY;if(this.plannerProps.secondaryGantt){this.plannerProps.secondaryGantt.initialScrollX=P(this,A,"f").detailInitialScrollX;this.plannerProps.secondaryGantt.initialScrollX=P(this,A,"f").detailInitialScrollY}this.plannerProps=Object.assign({},this.plannerProps);this.refresh()}componentWillLoad(){P(this,R,"f").debug.logLoad(this,false);P(this,R,"f").theme.register(this);this.initWithPersistedState();W(this,A,{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=P(this,I,"m",X).call(this,P(this,I,"m",st).call(this,P(this,A,"f").detailFilter,true));const i=this.rootElement.shadowRoot.querySelector("#main-filter");v(i);const s=this.rootElement.shadowRoot.querySelector("#secondary-filter");if(t){v(s)}let e;let n;let h;const o=500;this.plannerProps={mainGantt:{title:this.titleMess,items:P(this,I,"m",G).call(this,P(this,I,"m",st).call(this,P(this,A,"f").taskFilter,false)),stylingOptions:Object.assign(Object.assign({},p),{listCellWidth:this.listCellWidth}),filter:i,hideLabel:true,ganttHeight:this.taskHeight,showSecondaryDates:P(this,A,"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(n);n=window.setTimeout((()=>this.handleTaskGanttScrollY(t)),o)},onPhaseDrop:t=>this.handleOnPhaseDrop(t)},secondaryGantt:t?{title:"",items:t,stylingOptions:Object.assign(Object.assign({},p),{listCellWidth:this.listCellWidth}),filter:s,hideLabel:true,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(h);h=window.setTimeout((()=>this.handleDetailGanttScrollY(t)),o)}}:undefined,onSetDoubleView:t=>this.handleOnSetDoubleView(t),onSetViewMode:t=>this.handleOnSetViewMode(t),viewMode:this.viewMode,scrollableTaskList:this.scrollableTaskList,onScrollX:t=>{window.clearTimeout(e);e=window.setTimeout((()=>this.handleOnScrollX(t)),o)}};this.kupReady.emit({comp:this,id:this.rootElement.id,value:undefined});if(this.taskFilter){P(this,I,"m",it).call(this,this.taskFilter)}if(this.detailFilter){P(this,I,"m",it).call(this,this.detailFilter,true)}P(this,R,"f").debug.logLoad(this,true)}componentDidRender(){this.persistState();P(this,R,"f").debug.logRender(this,true)}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 e;let n;let h;switch(i.type){case"project":{e=i.taskRow;n=e.cells[this.taskIdCol];h=this.data.columns[this.taskIdCol];break}case"task":{e=i.phaseRow;n=e.cells[this.phaseIdCol];break}case"timeline":{e=i.detailRow;n=e.cells[this.detailIdCol];h=this.data.columns[this.detailIdCol];break}}this.kupContextMenu.emit({comp:this,id:this.rootElement.id,value:i,taskAction:s,details:{cell:n,column:h,originalEvent:t,row:e}})}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 c.TASK:if(P(this,I,"m",N).call(this)){this.onKupDblClick(t,m.onDblClick)}break;case c.PHASE:if(P(this,I,"m",_).call(this)){this.onKupDblClick(t,m.onDblClick)}break;case c.DETAIL:if(P(this,I,"m",q).call(this)){this.onKupDblClick(t,m.onDblClick)}break}for(let t=0;t<P(this,Y,"f").length;t++){clearTimeout(P(this,Y,"f")[t]);P(this,R,"f").debug.logMessage(this,"Cleared click timeout("+P(this,Y,"f")[t]+").")}W(this,Y,[],"f")}handleOnClick(t){P(this,Y,"f").push(setTimeout((()=>{switch(t.rowType){case c.TASK:const i=t.phases?m.onTaskClosing:m.onTaskOpening;if(P(this,I,"m",B).call(this,t)){this.onKupClick(t,i)}break;case c.PHASE:if(P(this,I,"m",J).call(this)){this.onKupClick(t,m.onClick)}break;case c.DETAIL:if(P(this,I,"m",Q).call(this)){this.onKupClick(t,m.onClick)}break}}),300))}handleOnContextMenu(t,i){switch(i.rowType){case c.TASK:if(P(this,I,"m",U).call(this)){this.onKupContextMenu(t,i,m.onRightClick)}break;case c.PHASE:if(P(this,I,"m",Z).call(this)){this.onKupContextMenu(t,i,m.onRightClick)}break;case c.DETAIL:if(P(this,I,"m",$).call(this)){this.onKupContextMenu(t,i,m.onRightClick)}break}}handleOnSetDoubleView(t){var i;P(this,A,"f").showSecondaryDates=t;if((i=this.plannerProps)===null||i===void 0?void 0:i.mainGantt){this.plannerProps.mainGantt.showSecondaryDates=t}this.persistState()}handleOnSetViewMode(t){P(this,A,"f").viewMode=t;this.plannerProps.viewMode=t;this.persistState()}handleOnScrollX(t){P(this,A,"f").taskInitialScrollX=t;P(this,A,"f").detailInitialScrollX=t;this.persistState()}handleTaskGanttScrollY(t){P(this,A,"f").taskInitialScrollY=t;this.persistState()}handleDetailGanttScrollY(t){P(this,A,"f").detailInitialScrollY=t;this.persistState()}handleOnDateChange(t){if(P(this,I,"m",tt).call(this,t)){if(t.rowType!=c.DETAIL){this.onKupDateChange(t,m.onResize)}}}handleOnPhaseDrop(t){this.onKupPhaseDrop(t,m.onTask)}render(){var t,i,s;const h=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({},(t=this.plannerProps)===null||t===void 0?void 0:t.mainGantt),{onScrollY:this.handleTaskGanttScrollY.bind(this)})}):null;if((i=this.plannerProps)===null||i===void 0?void 0:i.secondaryGantt){h.secondaryGantt=Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{onScrollY:this.handleDetailGanttScrollY.bind(this)})}return e(n,{key:"ec595d6944c84d1ff3419a4f9ea4b05b9daa7c8c"},e("style",{key:"9476707409a3f42a4053432d9516fda679f96341"},P(this,R,"f").theme.setKupStyle(this.rootElement)),e("div",{key:"ebcc7405f609f4ecffee385e5c3e710e67e67493",id:g,style:{maxWidth:this.maxWidth}},this.plannerProps&&e("kup-planner-renderer",{key:"9cb8c0178398029f74dded13fb14d96d5a3f3652",props:h,ref:t=>this.plannerRenderer=t})),e("div",{key:"227fba551833686254d2f9d904093fb1cd6afb31",style:{display:this.plannerProps?"none":""}},e(y,{key:"4cb494e54f8ca483dd46165b606ab1b54c5da58a",icon:d.SEARCH,id:"main-filter",label:P(this,R,"f").language.translate(u.SEARCH),onKeyDown:t=>{if(t.key==="Enter"){P(this,I,"m",it).call(this,t.target.value)}},value:this.taskFilter,wrapperClass:"filter"}),((s=this.detailData)===null||s===void 0?void 0:s.rows)&&this.detailData.rows.length>0?e(y,{icon:d.SEARCH,id:"secondary-filter",label:P(this,R,"f").language.translate(u.SEARCH),onKeyDown:t=>{if(t.key==="Enter"){P(this,I,"m",it).call(this,t.target.value,true)}},value:this.detailFilter,wrapperClass:"filter"}):null))}disconnectedCallback(){P(this,R,"f").theme.unregister(this);this.kupDidUnload.emit({comp:this,id:this.rootElement.id,storedSettings:P(this,A,"f")})}get rootElement(){return h(this)}static get watchers(){return{data:["dataChanged"]}}};R=new WeakMap,V=new WeakMap,Y=new WeakMap,K=new WeakMap,A=new WeakMap,I=new WeakSet,G=function t(i){var s;if(!i||!i.rows){return[]}let e=(s=i.rows)===null||s===void 0?void 0:s.filter((t=>C(t.cells[this.taskDates[0]],t.cells[this.taskDates[1]]))).map((t=>{const s=x(t.cells[this.taskDates[0]],t.cells[this.taskDates[1]],t.cells[this.taskPrevDates[0]],t.cells[this.taskPrevDates[1]],t.cells[this.taskHours[0]],t.cells[this.taskHours[1]],t.cells[this.taskPrevHours[0]],t.cells[this.taskPrevHours[1]]);const e=T(t,this.taskIdCol,this.taskNameCol,i.columns,this.taskColumns,(()=>this.taskColumns.map((s=>s==this.taskDates[0]?"#START#":s==this.taskDates[1]?"#END#":f(i.columns.find((t=>t.name==s)),t.cells[s])))));let n=P(this,I,"m",et).call(this,t,this.taskIconCol);let h=P(this,I,"m",nt).call(this,t,this.taskIconCol);let o={taskRow:t,taskRowId:t.id,id:t.cells[this.taskIdCol].value,name:t.cells[this.taskNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"project",valuesToShow:e,rowType:c.TASK,icon:n?{url:n,color:h!==null&&h!==void 0?h:"#595959"}:undefined,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]};return o}));return e},X=function t(i){if(!i||!i.rows){return undefined}let s=[];i.rows.filter((t=>C(t.cells[this.detailDates[0]],t.cells[this.detailDates[1]]))).forEach((t=>{var e,n;const h=t.cells[this.detailIdCol].value;const o=t.cells[this.detailNameCol].value;const a=x(t.cells[this.detailDates[0]],t.cells[this.detailDates[1]],undefined,undefined,t.cells[this.detailHours[0]],t.cells[this.detailHours[1]]);const f=T(t,this.detailIdCol,this.detailNameCol,i.columns,this.detailColumns);let r=s.find((t=>t.id==h));if(!r){r={id:h,name:o,detailRow:t,type:"timeline",valuesToShow:f,rowType:c.DETAIL,schedule:[]};s.push(r)}let l=P(this,I,"m",et).call(this,t,this.detailIconCol);let d=P(this,I,"m",nt).call(this,t,this.detailIconCol);r.schedule.push({startDate:a.dateValues[0],endDate:a.dateValues[1],color:this.detailColorCol?(e=t.cells[this.detailColorCol].value)!==null&&e!==void 0?e:"#D9D9D8":"#D9D9D8",selectedColor:this.detailColorCol?(n=t.cells[this.detailColorCol].value)!==null&&n!==void 0?n:"#D9D9D8":"#D9D9D8",icon:l?{url:l,color:d!==null&&d!==void 0?d:"#595959"}:undefined,startHour:a.hourValues[0],endHour:a.hourValues[1]})}));return s},L=function t(i){return this.plannerProps.mainGantt.items.find((t=>t.id==i))},F=function t(i){const s=P(this,I,"m",L).call(this,i);if(s)s.phases=undefined;this.plannerProps=Object.assign({},this.plannerProps)},N=function t(){return true},_=function t(){return true},q=function t(){return true},B=function t(i){const s=P(this,I,"m",L).call(this,i.id);if(s===null||s===void 0?void 0:s.phases){P(this,I,"m",F).call(this,s.id)}return true},J=function t(){return true},Q=function t(){return true},U=function t(){return true},Z=function t(){return true},$=function t(){return true},tt=function t(i){let s=false;if(!P(this,V,"f")){s=true;W(this,V,new k(i),"f")}else if(!P(this,V,"f").isEquivalent(i)){W(this,V,new k(i),"f");s=true}return s},it=function t(i,s){if(s){P(this,A,"f").detailFilter=i}else{P(this,A,"f").taskFilter=i}const e=s?{secondaryGantt:Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{items:P(this,I,"m",X).call(this,P(this,I,"m",st).call(this,i,s))})}:{mainGantt:Object.assign(Object.assign({},this.plannerProps.mainGantt),{items:P(this,I,"m",G).call(this,P(this,I,"m",st).call(this,i,s))})};this.plannerProps=Object.assign(Object.assign({},this.plannerProps),e);this.persistState()},st=function t(i,s){const e=s?this.detailData:this.data;if(!e||!e.rows||e.rows.length==0){return undefined}if(!i){return e}const n={columns:this.data.columns,rows:[]};const h=[];for(let t=0;t<e.rows.length;t++){const s=e.rows[t];const n=s.cells;for(let t=0;t<e.columns.length;t++){const o=e.columns[t];const a=n[o.name];if(a){const n=f(e.columns[t],a);const o=!!(n.toLowerCase().indexOf(i.toLowerCase())>-1);if(o){h.push({row:s,weight:t});break}}}}h.sort(((t,i)=>t.weight-i.weight)).forEach((t=>{n.rows.push(t.row)}));return n},et=function t(i,s){var e;let n=undefined;if(s){const t=i.cells[s];let h=(e=t===null||t===void 0?void 0:t.data)===null||e===void 0?void 0:e.resource;if(!h){h=t.value}if(h){n=o("./assets/svg/"+h+".svg")}}return n},nt=function t(i,s){var e;let n=undefined;if(s){const t=i.cells[s];n=(e=t===null||t===void 0?void 0:t.data)===null||e===void 0?void 0:e.color;if(n){n=P(this,R,"f").theme.colorCheck(n).hexColor}}return n};ht.style=M;export{ht as kup_planner};
2
+ //# sourceMappingURL=p-0b1e37b8.entry.js.map
@@ -1,2 +1,2 @@
1
- import{C as e,H as t,D as l,B as n,ag as i,v as r,x as s,ai as o,aj as a,J as u,e as f,F as c,ab as h,aa as d,ak as b,al as p,am as m,a1 as v}from"./p-f98dc5f6.js";import{K as F}from"./p-029c7cbe.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,false)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,true)}_getTextFilterValue(e={},t,l){let n="";if(e==null){return n}let i=e[t];if(i==null){return n}n=l?i.textFieldTmp:i.textField;return n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,false)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,true)}_hasFiltersForColumn(e={},t,l){if(!t){return false}let n=this._getTextFilterValue(e,t.name,l);if(n!=null&&n.trim()!=""){return true}if(this._hasIntervalTextFieldFilterValues(e,t,l)){return true}let i=this.getCheckBoxFilterValues(e,t.name);if(i==null||i.length<1){return false}return true}getCheckBoxFilterValues(e={},t){let l=[];if(e==null){return l}let n=e[t];if(n==null){return l}if(n.checkBoxes==null){return l}l=n.checkBoxes;return l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,false)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,true)}_hasIntervalTextFieldFilterValues(e={},l,n){if(l==null){return false}if(!this.isColumnFiltrableByInterval(l)){return false}let i=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(i!=null&&i.trim()!=""){return true}let r=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);if(r!=null&&r.trim()!=""){return true}return false}addCheckboxFilter(t={},l,n){if(t==null){return}let i=t[l];if(i==null){i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null};t[l]=i}if(i.checkBoxes==null){i.checkBoxes=[]}if(n==null||n.value==null){i.checkBoxes=[]}else{if(!e.valuesArrayContainsValue(i.checkBoxes,n.value)){i.checkBoxes[i.checkBoxes.length]=n}}}removeCheckboxFilter(t={},l,n){if(t==null||n==null){return}let i=t[l];if(i==null){return}if(i.checkBoxes==null){i.checkBoxes=[]}let r=e.indexOfValueInValuesArray(i.checkBoxes,n);if(r>=0){let e=[];for(let t=0;t<i.checkBoxes.length;t++){if(t!=r){e[e.length]=i.checkBoxes[t]}}i.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,false)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,true)}_getIntervalTextFieldFilterValues(e={},l,n){if(!this._hasIntervalTextFieldFilterValues(e,l,n)){return["",""]}let i=[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)];return i}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,false)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,true)}_getIntervalTextFieldFilterValue(e={},t,l,n){let i="";if(e==null){return i}let r=e[t];if(r==null){return i}if(n&&r.intervalTmp==null){return i}if(!n&&r.interval==null){return i}i=n?r.intervalTmp[l]:r.interval[l];return i}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,true)}_setTextFieldFilterValue(e={},t,l,n){if(e==null){return}let i=e[t];if(i==null){i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null};e[t]=i}if(n){i.textFieldTmp=l!=null?l.trim():l}else{i.textField=l!=null?l.trim():l}}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,true)}_setIntervalTextFieldFilterValue(e={},t,l,n,i){if(e==null){return}let r=e[t];if(r==null){r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null};e[t]=r}if(r.interval==null){r.interval=[];r.interval.push("","")}if(r.intervalTmp==null){r.intervalTmp=[];r.intervalTmp.push("","")}if(i){r.intervalTmp[n]=l!=null?l.trim():l}else{r.interval[n]=l!=null?l.trim():l}}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),false);this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,false);this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,false)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),true);this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,true);this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,true)}getFilterValueForTooltip(e={},i){let r=this.getTextFilterValue(e,i.name);let s=this.getIntervalTextFieldFilterValues(e,i);let o=this.getCheckBoxFilterValues(e,i.name);let a="";let u=l(r,i.obj,i.decimals);if(r!=""){a=" AND "}if(s[t.FROM]!=""){u+=a+"(>= "+l(s[t.FROM],i.obj,i.decimals)+")";a=" AND "}if(s[t.TO]!=""){u+=a+"(<= "+l(s[t.TO],i.obj,i.decimals)+")";a=" AND "}a="";let f="";o.forEach((e=>{f+=a+n(e,i);a=" OR "}));if(f!=""){f="("+f+")";if(u!=""){f=" AND "+f}}f=u+f;return f}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var x;(function(e){e["asAccordion"]="When enabled, the first level of depth will give an accordion look to nodes.";e["columns"]="The columns of the tree when tree visualization is active.";e["customStyle"]="Custom style of the component.";e["data"]="The json data used to populate the tree view: the basic, always visible tree nodes.";e["density"]="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.";e["dynamicExpansionCallback"]="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.";e["enableExtraColumns"]="Enables adding extra columns.";e["expanded"]="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.";e["expansionMode"]="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.";e["filters"]="List of filters set by the user.";e["globalFilter"]="When set to true it activates the global filter.";e["globalFilterValue"]="The value of the global filter.";e["globalFilterMode"]="The mode of the global filter.";e["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."})(x||(x={}));const T="TREE_COLUMN";var k;(function(e){e["DROPDOWN"]="dropdown";e["NODE"]="node"})(k||(k={}));const g=document.documentElement;const j=g.ketchup?g.ketchup.objects:new s;const y=g.ketchup?g.ketchup.data:new o;class O extends e{isFilterCompliantForCell(e,t,l){if(!e){return false}return this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){if(!e){return false}if(!e.obj){return false}return this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=false,i=[],r){return this.areCellsCompliant(e.cells,t,l,n,i,r)}areCellsCompliant(e,t={},l="",n=false,s=[],o){if(n){let t=true;if(s&&s!=null&&s.length>0){t=false;let n=this.filterIsNegative(l);for(let r=0;r<s.length;r++){if(s[r].visible==false){continue}const o=e[s[r].name];if(o==null){continue}t=this.isFilterCompliantForValue(o.value,l);let a=i(s[r],o);if(a!=o.value){t=t||this.isFilterCompliantForValue(a,l)}if(t==true&&!n){break}if(t==false&&n){break}}}if(!t){return false}}if(o==null){o=new w}if(!this.hasFilters(t,s,o)){return true}let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const i=e[n];if(!i){return false}let u=o.getTextFilterValue(t,n);let f=o.getIntervalTextFieldFilterValues(t,r(s,n));const c=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(i,u,f);let d=c;if(!j.isNumber(i.obj)&&!j.isDate(i.obj)&&!j.isTime(i.obj)&&!j.isTimestamp(i.obj)){d=this.isFilterCompliantForCellObj(i,u,f)}if(c){if(!h||!d){return false}}else{if(!h&&!d){return false}}let b=o.getCheckBoxFilterValues(t,n);if(b.length==0){continue}let p=false;for(let e=0;e<b.length;e++){let t=b[e];if(t==null||t.value==null){continue}if(i.value!=null){if(i.value.toLowerCase().trim()==t.value.toLowerCase().trim()){p=true;break}}if(i.obj!=null){if(i.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){p=true;break}}}if(!p){return false}}return true}hasFilters(e={},t,l){if(e==null){return false}let n=Object.keys(e);if(n==null||n.length<1){return false}if(l==null){l=new w}for(let i=0;i<n.length;i++){let s=n[i];let o=null;if(s===T){o={name:T,title:""}}else{o=r(t,s)}if(l.hasFiltersForColumn(e,o)){return true}}return false}filterRows(e=[],t={},l="",n=[],i){if(!e||e==null){return[]}let r=[];const s=!!(l&&n);if(this.hasFilters(t,n,i)||s){for(let o=0;o<e.length;o++){let a=e[o];if(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,s,n,i)){r[r.length]=a}}}else{r=[...e]}return r}getColumnValues(t,n,i,r){let s=new Array;if(r==null){r=new w}let o=r.getTextFilterValueTmp(t.filters,n.name);let a=r.getIntervalTextFieldFilterValuesTmp(t.filters,n);let u=r.getCheckBoxFilterValues(t.filters,n.name);if(n.valuesForFilter!=null&&n.valuesForFilter.length>0){n.valuesForFilter.forEach((t=>{let i=t;if(e.valuesArrayContainsValue(u,i)||o==""||r.isFilterCompliantForSimpleValue(i,n.obj,o,a)){s.push({value:i,displayedValue:l(i,n.obj,n.decimals)})}}));return s}let f=Object.assign({},t.filters);f[n.name]={textField:o,textFieldTmp:o,checkBoxes:[],interval:a,intervalTmp:a};let c=this.filterRows(t.getRows(),f,i,t.getVisibleColumns(),r);for(let e=0;e<u.length;e++){s.push(u[e])}return y.cell.getUnivocalValue({rows:c},n,true)}}const V=document.documentElement;function C(e=[],t=[]){if(!e||e.length===0){return[]}if(e[0].group){return I(e,t)}if(!t||t.length===0){return e}const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const i=M(e,n,t[l]);if(i!==0){return i}}return 0}else{return M(e,n,t[0])}}))}function I(e=[],t=[]){if(!e||e.length===0){return[]}const l=e[0].group.column;let n=B(l,t);if(!n){n={column:l,sortMode:v.A}}e.sort(((e,t)=>{const l={obj:e.group.obj,value:e.group.id};const i={obj:t.group.obj,value:t.group.id};return a(l,i,n.sortMode)}));e.forEach((e=>{e.group.children=C(e.group.children,t)}));return e}function B(e="",t=[]){if(!e||!t||t.length===0){return null}for(let l of t){if(l.column===e){return l}}return null}function M(e,t,l){const n=e.cells[l.column];const i=t.cells[l.column];if(!n&&!i){return 0}if(!n){return 1}if(!i){return-1}return a(n,i,l.sortMode)}function N(e=[],t={},l="",n=[],i,r){if(r==null){r=new O}return r.filterRows(e,t,l,n,i)}function _(e=[],t=[],l=[],n={}){if(!t){return[]}if(!l||l.length===0||!e||e.length===0){return t}const s={};const o=l.filter((({column:t})=>{for(let{name:l,title:n}of e){if(l===t){s[l]=n;return true}}return false}));if(o.length===0){return t}const a=[];let f={};t.forEach((t=>{const l=o[0].column;const u=t.cells[l];if(u){const c=r(e,l);const h=i(c,u);const d=u.value;let b=null;for(let e of a){if(e.group.label===h){b=e;break}}if(b===null){b={group:{id:d,parent:null,column:l,columnLabel:s[l],expanded:false,label:h,children:[],obj:u.obj,totals:{}},cells:{}};a.push(b)}for(let l=1;l<o.length;l++){const n=o[l];const a=t.cells[n.column];if(a){const t=r(e,n.column);const l=i(t,a);const o=a.value;let u=null;for(let e=0;e<b.group.children.length;e++){const t=b.group.children[e];const n=t.group.label;if(n===l){u=t;break}}if(!u){u={cells:{},group:{id:o,parent:b,column:n.column,columnLabel:s[n.column],children:[],expanded:false,label:l,totals:{},obj:a.obj}};R(u);b.group.children.push(u)}b=u}}b.group.children.push(t);A(b,n,t,f)}}));D(a,n,f);S(a,u.AVERAGE,n);S(a,u.MATH,n);return a}function A(e,t,l,n){if(!e||!t){return}const i=Object.keys(t);if(i.length===0){return}i.forEach((i=>{const r=l.cells[i];if(r){const l=V.ketchup.objects.isNumber(r.obj);const s=t[i];switch(s){case u.COUNT:let t=e.group.totals[i]||0;e.group.totals[i]=++t;let o=e.group.parent;while(o!=null){let e=o.group.totals[i]||0;o.group.totals[i]=++e;o=o.group.parent}break;case u.DISTINCT:let a;if(l){a=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(r.value))}else{a=r.value}let f=n[e.group.id];if(!f){n[e.group.id]={};n[e.group.id][i]=[];n[e.group.id][i].push(a)}else{let t=n[e.group.id][i];if(!t){n[e.group.id][i]=[];n[e.group.id][i].push(a)}else{t.push(a)}}let c=e.group.parent;while(c!=null){let e=n[c.group.id];if(!e){n[c.group.id]={};n[c.group.id][i]=[];n[c.group.id][i].push(a)}else{let e=n[c.group.id][i];if(!e){n[c.group.id][i]=[];n[c.group.id][i].push(a)}else{e.push(a)}}c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(l&&r.value){const t=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(r.value));const l=e.group.totals[i]||0;e.group.totals[i]=t+l;let n=e.group.parent;while(n!=null){const e=V.ketchup.math.numberify(n.group.totals[i]||0);n.group.totals[i]=t+e;n=n.group.parent}}break;case u.MIN:if(l&&r.value){const t=e.group.totals[i];const l=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(r.value));if(t){e.group.totals[i]=Math.min(t,l)}else{e.group.totals[i]=l}let n=e.group.parent;while(n!=null){const e=n.group.totals[i];if(e){n.group.totals[i]=Math.min(e,l)}else{n.group.totals[i]=l}n=n.group.parent}}else if(r.value&&V.ketchup.objects.isDate(r.obj)){if(V.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[i];if(t){let l=[];l.push(a);l.push(V.ketchup.dates.toDayjs(t));e.group.totals[i]=V.ketchup.dates.format(V.ketchup.dates.min(l),F.ISO_DATE)}else{e.group.totals[i]=V.ketchup.dates.format(a,F.ISO_DATE)}let l=e.group.parent;while(l!=null){const e=l.group.totals[i];if(e){let t=[];t.push(a);t.push(V.ketchup.dates.toDayjs(e));l.group.totals[i]=V.ketchup.dates.format(V.ketchup.dates.min(t),F.ISO_DATE)}else{l.group.totals[i]=V.ketchup.dates.format(a,F.ISO_DATE)}l=l.group.parent}}}break;case u.MAX:if(l&&r.value){const t=e.group.totals[i];const l=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(r.value));if(t){e.group.totals[i]=Math.max(t,l)}else{e.group.totals[i]=l}let n=e.group.parent;while(n!=null){const e=n.group.totals[i];if(e){n.group.totals[i]=Math.max(e,l)}else{n.group.totals[i]=l}n=n.group.parent}}else if(r.value&&V.ketchup.objects.isDate(r.obj)){if(V.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[i];if(t){let l=[];l.push(a);l.push(V.ketchup.dates.toDayjs(t));e.group.totals[i]=V.ketchup.dates.format(V.ketchup.dates.max(l),F.ISO_DATE)}else{e.group.totals[i]=V.ketchup.dates.format(a,F.ISO_DATE)}let l=e.group.parent;while(l!=null){const e=l.group.totals[i];if(e){let t=[];t.push(a);t.push(V.ketchup.dates.toDayjs(e));l.group.totals[i]=V.ketchup.dates.format(V.ketchup.dates.max(t),F.ISO_DATE)}else{l.group.totals[i]=V.ketchup.dates.format(a,F.ISO_DATE)}l=l.group.parent}}}break;default:{if(s.indexOf(u.MATH)!=0){console.warn(`invalid total mode: ${s}`)}break}}}}))}function D(e,t,l){if(!e||!t){return}const n=Object.keys(t);if(e.length===0||!e[0].group||n.length===0){return}let i=n.filter((e=>u.DISTINCT===t[e]));if(i.length>0){e.filter((e=>e.group.children.length>0)).forEach((e=>W(e,i,l)))}}function S(e,t,l){if(!e||!l){return}const n=Object.keys(l);if(e.length===0||!e[0].group||n.length===0){return}let i;if(t==u.AVERAGE){i=n.filter((e=>u.AVERAGE===l[e]))}if(t==u.MATH){i=n.filter((e=>l[e].indexOf(u.MATH)==0))}if(i.length>0){e.filter((e=>e.group.children.length>0)).forEach((e=>E(e,t,i,l)))}}function W(e,t,l){const n=e.group.children;if(n.length===0){return}if(n[0].group){n.forEach((e=>{W(e,t,l)}))}t.forEach((t=>{const n=l[e.group.id][t];e.group.totals[t]=new Set(n).size}))}function E(e,t,l,n){const i=e.group.children;if(i.length===0){return 0}let r=0;if(i[0].group){i.forEach((e=>{r+=E(e,t,l,n)}))}else{r=i.length}l.forEach((l=>{if(t==u.AVERAGE){e.group.totals[l]=e.group.totals[l]/r}if(t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=V.ketchup.math.formulas.custom(t,e.group.totals)}}));return r}function L(e,t){if(t){const l=Object.assign(t);t.forEach((t=>{e.forEach((e=>{if(t.cells){const l=t.cells[e.name];if(l&&e.obj&&!l.obj){l.obj={t:e.obj.t,p:e.obj.p,k:l.value}}}}))}));return l}else{return undefined}}function $(e=[],t={}){if(V.ketchup.objects.isEmptyJsObject(e)||V.ketchup.objects.isEmptyJsObject(t)){return{}}const l=Object.keys(t);const n={};const i=new Array;let r=l.length===0||l.every((e=>t[e]===u.COUNT));if(r){l.forEach((t=>n[t]=e.length))}else{let r={};e.forEach(((e,s,o)=>{l.filter((e=>u.COUNT!==t[e]&&t[e].indexOf(u.MATH)!=0)).forEach((l=>{const a=e.cells[l];if(a){if(t[l]===u.DISTINCT){let e;if(V.ketchup.objects.isNumber(a.obj)){e=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(a.value))}else{e=a.value}let t=r[l];if(!t){r[l]=[];r[l].push(e)}else{t.push(e)}}else if(V.ketchup.objects.isNumber(a.obj)){const e=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(a.value));let i=n[l];switch(true){case t[l]===u.MIN:if(i){n[l]=Math.min(i,e)}else{n[l]=e}break;case t[l]===u.MAX:if(i){n[l]=Math.max(i,e)}else{n[l]=e}break;default:i=n[l]||0;n[l]=e+V.ketchup.math.numberify(i)}}else if(V.ketchup.objects.isDate(a.obj)){if(i.indexOf(l)==-1){i.push(l)}if(V.ketchup.dates.isValidFormattedStringDate(a.value)){const e=V.ketchup.dates.toDate(V.ketchup.dates.toDayjs(a.value));const i=n[l]?V.ketchup.dates.toDate(V.ketchup.dates.toDayjs(n[l])):null;switch(true){case t[l]===u.MIN:if(i){let t=[];t.push(e);t.push(i);n[l]=V.ketchup.dates.format(V.ketchup.dates.min(t),F.ISO_DATE)}else{n[l]=V.ketchup.dates.format(e,F.ISO_DATE)}break;case t[l]===u.MAX:if(i){let t=[];t.push(e);t.push(i);n[l]=V.ketchup.dates.format(V.ketchup.dates.max(t),F.ISO_DATE)}else{n[l]=V.ketchup.dates.format(e,F.ISO_DATE)}break}}}}if(s===o.length-1&&t[l]===u.DISTINCT){n[l]=new Set(r[l]).size;r[l]=[]}}))}))}for(let r of l){switch(true){case t[r]===u.AVERAGE:const l=n[r];if(l&&e.length>0){n[r]=l/e.length}break;case t[r]===u.COUNT:n[r]=e.length;break;case t[r].indexOf(u.MATH)==0:n[r]=V.ketchup.math.formulas.custom(t[r].substring(u.MATH.length),n);break}if(n[r]){if(i.indexOf(r)!=-1){n[r]=V.ketchup.dates.format(n[r])}else if(V.ketchup.math.isNumber(n[r])){n[r]=+n[r].toFixed(2)}}}return n}function R(e){if(!e.group){return}let t=e.group.id;let l=e.group.parent;while(l!==null){t=`${l.group.id};${t}`;l=l.group.parent}e.group.id=t}function q(e,t,l,n){const i=t*l-l;const r=i+Number(l);if(n==false){return e.slice(i,r)}let s=[];z(e,s,i,Number(l),0);return s}function z(e,t,l,n,i){let r=false;for(let s=0;s<e.length;s++){let o=e[s];let a=J(e[s]);if(o.group!=null&&o.group.children!=null&&o.group.children.length>0){a.group.children=[];let e=z(o.group.children,a.group.children,l,n,i);i=e.ci;r=e.added;if(r==true){t[t.length]=a}}else{if(i>=l){t[t.length]=a;r=true}i++}if(i>=l+n){break}}return{ci:i,added:r}}function J(e){if(e==null){return null}else{return{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:H(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}}function K(e){if(e==null){return null}let t=[];for(let l=0;l<e.length;l++){t[t.length]=J(e[l])}return t}function H(e){if(e==null){return null}let t={id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:K(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)};return t}function U(e,t,l=false){const n={columns:t.columns,rows:[]};for(const i of t.rows){const r={cells:{},id:i.id};for(const l of t.columns){const t=l.name;const n=i.cells[t];const s=e.rows.find((e=>e.id===i.id));const o=s?s.cells[t]:null;if(!o||n.value!==o.value){r.cells[t]=n}}if(Object.keys(r.cells).length>0||l){n.rows.push(r)}}return n}function G(e){var t;(t=e.rows)===null||t===void 0?void 0:t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var l;let n=e.cells[t];const i=n.value;const r=n["options"];n.isEditable=(l=n.isEditable)!==null&&l!==void 0?l:n["editable"];if(r){const e={[c.AUTOCOMPLETE]:()=>h(i,"",r),[c.COMBOBOX]:()=>h(i,"",r),[c.RADIO]:()=>d(i,r),[c.CHECKBOX]:()=>b(i,r),[c.CHIP]:()=>p(i),[c.SWITCH]:()=>m(i,"")};const t=e[n.shape];if(t){n.data=t()}else{if(n.shape){V.ketchup.debug.logMessage("kup-data",`Shape specified ${n.shape} in cell ${JSON.stringify(n)} unsupported`,f.WARNING)}}}}))}))}export{w as F,k as K,O as a,_ as b,$ as c,G as d,x as e,N as f,U as g,L as n,q as p,C as s,T as t};
2
- //# sourceMappingURL=p-d336255f.js.map
1
+ import{C as e,H as t,D as l,B as n,ag as i,v as r,x as s,ai as o,aj as a,J as u,e as f,F as c,ab as h,aa as d,ak as b,al as p,am as m,a1 as v}from"./p-81285484.js";import{K as F}from"./p-029c7cbe.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,false)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,true)}_getTextFilterValue(e={},t,l){let n="";if(e==null){return n}let i=e[t];if(i==null){return n}n=l?i.textFieldTmp:i.textField;return n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,false)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,true)}_hasFiltersForColumn(e={},t,l){if(!t){return false}let n=this._getTextFilterValue(e,t.name,l);if(n!=null&&n.trim()!=""){return true}if(this._hasIntervalTextFieldFilterValues(e,t,l)){return true}let i=this.getCheckBoxFilterValues(e,t.name);if(i==null||i.length<1){return false}return true}getCheckBoxFilterValues(e={},t){let l=[];if(e==null){return l}let n=e[t];if(n==null){return l}if(n.checkBoxes==null){return l}l=n.checkBoxes;return l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,false)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,true)}_hasIntervalTextFieldFilterValues(e={},l,n){if(l==null){return false}if(!this.isColumnFiltrableByInterval(l)){return false}let i=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(i!=null&&i.trim()!=""){return true}let r=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);if(r!=null&&r.trim()!=""){return true}return false}addCheckboxFilter(t={},l,n){if(t==null){return}let i=t[l];if(i==null){i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null};t[l]=i}if(i.checkBoxes==null){i.checkBoxes=[]}if(n==null||n.value==null){i.checkBoxes=[]}else{if(!e.valuesArrayContainsValue(i.checkBoxes,n.value)){i.checkBoxes[i.checkBoxes.length]=n}}}removeCheckboxFilter(t={},l,n){if(t==null||n==null){return}let i=t[l];if(i==null){return}if(i.checkBoxes==null){i.checkBoxes=[]}let r=e.indexOfValueInValuesArray(i.checkBoxes,n);if(r>=0){let e=[];for(let t=0;t<i.checkBoxes.length;t++){if(t!=r){e[e.length]=i.checkBoxes[t]}}i.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,false)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,true)}_getIntervalTextFieldFilterValues(e={},l,n){if(!this._hasIntervalTextFieldFilterValues(e,l,n)){return["",""]}let i=[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)];return i}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,false)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,true)}_getIntervalTextFieldFilterValue(e={},t,l,n){let i="";if(e==null){return i}let r=e[t];if(r==null){return i}if(n&&r.intervalTmp==null){return i}if(!n&&r.interval==null){return i}i=n?r.intervalTmp[l]:r.interval[l];return i}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,true)}_setTextFieldFilterValue(e={},t,l,n){if(e==null){return}let i=e[t];if(i==null){i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null};e[t]=i}if(n){i.textFieldTmp=l!=null?l.trim():l}else{i.textField=l!=null?l.trim():l}}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,true)}_setIntervalTextFieldFilterValue(e={},t,l,n,i){if(e==null){return}let r=e[t];if(r==null){r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null};e[t]=r}if(r.interval==null){r.interval=[];r.interval.push("","")}if(r.intervalTmp==null){r.intervalTmp=[];r.intervalTmp.push("","")}if(i){r.intervalTmp[n]=l!=null?l.trim():l}else{r.interval[n]=l!=null?l.trim():l}}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),false);this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,false);this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,false)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),true);this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,true);this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,true)}getFilterValueForTooltip(e={},i){let r=this.getTextFilterValue(e,i.name);let s=this.getIntervalTextFieldFilterValues(e,i);let o=this.getCheckBoxFilterValues(e,i.name);let a="";let u=l(r,i.obj,i.decimals);if(r!=""){a=" AND "}if(s[t.FROM]!=""){u+=a+"(>= "+l(s[t.FROM],i.obj,i.decimals)+")";a=" AND "}if(s[t.TO]!=""){u+=a+"(<= "+l(s[t.TO],i.obj,i.decimals)+")";a=" AND "}a="";let f="";o.forEach((e=>{f+=a+n(e,i);a=" OR "}));if(f!=""){f="("+f+")";if(u!=""){f=" AND "+f}}f=u+f;return f}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var x;(function(e){e["asAccordion"]="When enabled, the first level of depth will give an accordion look to nodes.";e["columns"]="The columns of the tree when tree visualization is active.";e["customStyle"]="Custom style of the component.";e["data"]="The json data used to populate the tree view: the basic, always visible tree nodes.";e["density"]="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.";e["dynamicExpansionCallback"]="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.";e["enableExtraColumns"]="Enables adding extra columns.";e["expanded"]="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.";e["expansionMode"]="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.";e["filters"]="List of filters set by the user.";e["globalFilter"]="When set to true it activates the global filter.";e["globalFilterValue"]="The value of the global filter.";e["globalFilterMode"]="The mode of the global filter.";e["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."})(x||(x={}));const T="TREE_COLUMN";var k;(function(e){e["DROPDOWN"]="dropdown";e["NODE"]="node"})(k||(k={}));const g=document.documentElement;const j=g.ketchup?g.ketchup.objects:new s;const y=g.ketchup?g.ketchup.data:new o;class O extends e{isFilterCompliantForCell(e,t,l){if(!e){return false}return this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){if(!e){return false}if(!e.obj){return false}return this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=false,i=[],r){return this.areCellsCompliant(e.cells,t,l,n,i,r)}areCellsCompliant(e,t={},l="",n=false,s=[],o){if(n){let t=true;if(s&&s!=null&&s.length>0){t=false;let n=this.filterIsNegative(l);for(let r=0;r<s.length;r++){if(s[r].visible==false){continue}const o=e[s[r].name];if(o==null){continue}t=this.isFilterCompliantForValue(o.value,l);let a=i(s[r],o);if(a!=o.value){t=t||this.isFilterCompliantForValue(a,l)}if(t==true&&!n){break}if(t==false&&n){break}}}if(!t){return false}}if(o==null){o=new w}if(!this.hasFilters(t,s,o)){return true}let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const i=e[n];if(!i){return false}let u=o.getTextFilterValue(t,n);let f=o.getIntervalTextFieldFilterValues(t,r(s,n));const c=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(i,u,f);let d=c;if(!j.isNumber(i.obj)&&!j.isDate(i.obj)&&!j.isTime(i.obj)&&!j.isTimestamp(i.obj)){d=this.isFilterCompliantForCellObj(i,u,f)}if(c){if(!h||!d){return false}}else{if(!h&&!d){return false}}let b=o.getCheckBoxFilterValues(t,n);if(b.length==0){continue}let p=false;for(let e=0;e<b.length;e++){let t=b[e];if(t==null||t.value==null){continue}if(i.value!=null){if(i.value.toLowerCase().trim()==t.value.toLowerCase().trim()){p=true;break}}if(i.obj!=null){if(i.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){p=true;break}}}if(!p){return false}}return true}hasFilters(e={},t,l){if(e==null){return false}let n=Object.keys(e);if(n==null||n.length<1){return false}if(l==null){l=new w}for(let i=0;i<n.length;i++){let s=n[i];let o=null;if(s===T){o={name:T,title:""}}else{o=r(t,s)}if(l.hasFiltersForColumn(e,o)){return true}}return false}filterRows(e=[],t={},l="",n=[],i){if(!e||e==null){return[]}let r=[];const s=!!(l&&n);if(this.hasFilters(t,n,i)||s){for(let o=0;o<e.length;o++){let a=e[o];if(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,s,n,i)){r[r.length]=a}}}else{r=[...e]}return r}getColumnValues(t,n,i,r){let s=new Array;if(r==null){r=new w}let o=r.getTextFilterValueTmp(t.filters,n.name);let a=r.getIntervalTextFieldFilterValuesTmp(t.filters,n);let u=r.getCheckBoxFilterValues(t.filters,n.name);if(n.valuesForFilter!=null&&n.valuesForFilter.length>0){n.valuesForFilter.forEach((t=>{let i=t;if(e.valuesArrayContainsValue(u,i)||o==""||r.isFilterCompliantForSimpleValue(i,n.obj,o,a)){s.push({value:i,displayedValue:l(i,n.obj,n.decimals)})}}));return s}let f=Object.assign({},t.filters);f[n.name]={textField:o,textFieldTmp:o,checkBoxes:[],interval:a,intervalTmp:a};let c=this.filterRows(t.getRows(),f,i,t.getVisibleColumns(),r);for(let e=0;e<u.length;e++){s.push(u[e])}return y.cell.getUnivocalValue({rows:c},n,true)}}const V=document.documentElement;function C(e=[],t=[]){if(!e||e.length===0){return[]}if(e[0].group){return I(e,t)}if(!t||t.length===0){return e}const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const i=M(e,n,t[l]);if(i!==0){return i}}return 0}else{return M(e,n,t[0])}}))}function I(e=[],t=[]){if(!e||e.length===0){return[]}const l=e[0].group.column;let n=B(l,t);if(!n){n={column:l,sortMode:v.A}}e.sort(((e,t)=>{const l={obj:e.group.obj,value:e.group.id};const i={obj:t.group.obj,value:t.group.id};return a(l,i,n.sortMode)}));e.forEach((e=>{e.group.children=C(e.group.children,t)}));return e}function B(e="",t=[]){if(!e||!t||t.length===0){return null}for(let l of t){if(l.column===e){return l}}return null}function M(e,t,l){const n=e.cells[l.column];const i=t.cells[l.column];if(!n&&!i){return 0}if(!n){return 1}if(!i){return-1}return a(n,i,l.sortMode)}function N(e=[],t={},l="",n=[],i,r){if(r==null){r=new O}return r.filterRows(e,t,l,n,i)}function _(e=[],t=[],l=[],n={}){if(!t){return[]}if(!l||l.length===0||!e||e.length===0){return t}const s={};const o=l.filter((({column:t})=>{for(let{name:l,title:n}of e){if(l===t){s[l]=n;return true}}return false}));if(o.length===0){return t}const a=[];let f={};t.forEach((t=>{const l=o[0].column;const u=t.cells[l];if(u){const c=r(e,l);const h=i(c,u);const d=u.value;let b=null;for(let e of a){if(e.group.label===h){b=e;break}}if(b===null){b={group:{id:d,parent:null,column:l,columnLabel:s[l],expanded:false,label:h,children:[],obj:u.obj,totals:{}},cells:{}};a.push(b)}for(let l=1;l<o.length;l++){const n=o[l];const a=t.cells[n.column];if(a){const t=r(e,n.column);const l=i(t,a);const o=a.value;let u=null;for(let e=0;e<b.group.children.length;e++){const t=b.group.children[e];const n=t.group.label;if(n===l){u=t;break}}if(!u){u={cells:{},group:{id:o,parent:b,column:n.column,columnLabel:s[n.column],children:[],expanded:false,label:l,totals:{},obj:a.obj}};R(u);b.group.children.push(u)}b=u}}b.group.children.push(t);A(b,n,t,f)}}));D(a,n,f);S(a,u.AVERAGE,n);S(a,u.MATH,n);return a}function A(e,t,l,n){if(!e||!t){return}const i=Object.keys(t);if(i.length===0){return}i.forEach((i=>{const r=l.cells[i];if(r){const l=V.ketchup.objects.isNumber(r.obj);const s=t[i];switch(s){case u.COUNT:let t=e.group.totals[i]||0;e.group.totals[i]=++t;let o=e.group.parent;while(o!=null){let e=o.group.totals[i]||0;o.group.totals[i]=++e;o=o.group.parent}break;case u.DISTINCT:let a;if(l){a=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(r.value))}else{a=r.value}let f=n[e.group.id];if(!f){n[e.group.id]={};n[e.group.id][i]=[];n[e.group.id][i].push(a)}else{let t=n[e.group.id][i];if(!t){n[e.group.id][i]=[];n[e.group.id][i].push(a)}else{t.push(a)}}let c=e.group.parent;while(c!=null){let e=n[c.group.id];if(!e){n[c.group.id]={};n[c.group.id][i]=[];n[c.group.id][i].push(a)}else{let e=n[c.group.id][i];if(!e){n[c.group.id][i]=[];n[c.group.id][i].push(a)}else{e.push(a)}}c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(l&&r.value){const t=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(r.value));const l=e.group.totals[i]||0;e.group.totals[i]=t+l;let n=e.group.parent;while(n!=null){const e=V.ketchup.math.numberify(n.group.totals[i]||0);n.group.totals[i]=t+e;n=n.group.parent}}break;case u.MIN:if(l&&r.value){const t=e.group.totals[i];const l=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(r.value));if(t){e.group.totals[i]=Math.min(t,l)}else{e.group.totals[i]=l}let n=e.group.parent;while(n!=null){const e=n.group.totals[i];if(e){n.group.totals[i]=Math.min(e,l)}else{n.group.totals[i]=l}n=n.group.parent}}else if(r.value&&V.ketchup.objects.isDate(r.obj)){if(V.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[i];if(t){let l=[];l.push(a);l.push(V.ketchup.dates.toDayjs(t));e.group.totals[i]=V.ketchup.dates.format(V.ketchup.dates.min(l),F.ISO_DATE)}else{e.group.totals[i]=V.ketchup.dates.format(a,F.ISO_DATE)}let l=e.group.parent;while(l!=null){const e=l.group.totals[i];if(e){let t=[];t.push(a);t.push(V.ketchup.dates.toDayjs(e));l.group.totals[i]=V.ketchup.dates.format(V.ketchup.dates.min(t),F.ISO_DATE)}else{l.group.totals[i]=V.ketchup.dates.format(a,F.ISO_DATE)}l=l.group.parent}}}break;case u.MAX:if(l&&r.value){const t=e.group.totals[i];const l=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(r.value));if(t){e.group.totals[i]=Math.max(t,l)}else{e.group.totals[i]=l}let n=e.group.parent;while(n!=null){const e=n.group.totals[i];if(e){n.group.totals[i]=Math.max(e,l)}else{n.group.totals[i]=l}n=n.group.parent}}else if(r.value&&V.ketchup.objects.isDate(r.obj)){if(V.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[i];if(t){let l=[];l.push(a);l.push(V.ketchup.dates.toDayjs(t));e.group.totals[i]=V.ketchup.dates.format(V.ketchup.dates.max(l),F.ISO_DATE)}else{e.group.totals[i]=V.ketchup.dates.format(a,F.ISO_DATE)}let l=e.group.parent;while(l!=null){const e=l.group.totals[i];if(e){let t=[];t.push(a);t.push(V.ketchup.dates.toDayjs(e));l.group.totals[i]=V.ketchup.dates.format(V.ketchup.dates.max(t),F.ISO_DATE)}else{l.group.totals[i]=V.ketchup.dates.format(a,F.ISO_DATE)}l=l.group.parent}}}break;default:{if(s.indexOf(u.MATH)!=0){console.warn(`invalid total mode: ${s}`)}break}}}}))}function D(e,t,l){if(!e||!t){return}const n=Object.keys(t);if(e.length===0||!e[0].group||n.length===0){return}let i=n.filter((e=>u.DISTINCT===t[e]));if(i.length>0){e.filter((e=>e.group.children.length>0)).forEach((e=>W(e,i,l)))}}function S(e,t,l){if(!e||!l){return}const n=Object.keys(l);if(e.length===0||!e[0].group||n.length===0){return}let i;if(t==u.AVERAGE){i=n.filter((e=>u.AVERAGE===l[e]))}if(t==u.MATH){i=n.filter((e=>l[e].indexOf(u.MATH)==0))}if(i.length>0){e.filter((e=>e.group.children.length>0)).forEach((e=>E(e,t,i,l)))}}function W(e,t,l){const n=e.group.children;if(n.length===0){return}if(n[0].group){n.forEach((e=>{W(e,t,l)}))}t.forEach((t=>{const n=l[e.group.id][t];e.group.totals[t]=new Set(n).size}))}function E(e,t,l,n){const i=e.group.children;if(i.length===0){return 0}let r=0;if(i[0].group){i.forEach((e=>{r+=E(e,t,l,n)}))}else{r=i.length}l.forEach((l=>{if(t==u.AVERAGE){e.group.totals[l]=e.group.totals[l]/r}if(t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=V.ketchup.math.formulas.custom(t,e.group.totals)}}));return r}function L(e,t){if(t){const l=Object.assign(t);t.forEach((t=>{e.forEach((e=>{if(t.cells){const l=t.cells[e.name];if(l&&e.obj&&!l.obj){l.obj={t:e.obj.t,p:e.obj.p,k:l.value}}}}))}));return l}else{return undefined}}function $(e=[],t={}){if(V.ketchup.objects.isEmptyJsObject(e)||V.ketchup.objects.isEmptyJsObject(t)){return{}}const l=Object.keys(t);const n={};const i=new Array;let r=l.length===0||l.every((e=>t[e]===u.COUNT));if(r){l.forEach((t=>n[t]=e.length))}else{let r={};e.forEach(((e,s,o)=>{l.filter((e=>u.COUNT!==t[e]&&t[e].indexOf(u.MATH)!=0)).forEach((l=>{const a=e.cells[l];if(a){if(t[l]===u.DISTINCT){let e;if(V.ketchup.objects.isNumber(a.obj)){e=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(a.value))}else{e=a.value}let t=r[l];if(!t){r[l]=[];r[l].push(e)}else{t.push(e)}}else if(V.ketchup.objects.isNumber(a.obj)){const e=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(a.value));let i=n[l];switch(true){case t[l]===u.MIN:if(i){n[l]=Math.min(i,e)}else{n[l]=e}break;case t[l]===u.MAX:if(i){n[l]=Math.max(i,e)}else{n[l]=e}break;default:i=n[l]||0;n[l]=e+V.ketchup.math.numberify(i)}}else if(V.ketchup.objects.isDate(a.obj)){if(i.indexOf(l)==-1){i.push(l)}if(V.ketchup.dates.isValidFormattedStringDate(a.value)){const e=V.ketchup.dates.toDate(V.ketchup.dates.toDayjs(a.value));const i=n[l]?V.ketchup.dates.toDate(V.ketchup.dates.toDayjs(n[l])):null;switch(true){case t[l]===u.MIN:if(i){let t=[];t.push(e);t.push(i);n[l]=V.ketchup.dates.format(V.ketchup.dates.min(t),F.ISO_DATE)}else{n[l]=V.ketchup.dates.format(e,F.ISO_DATE)}break;case t[l]===u.MAX:if(i){let t=[];t.push(e);t.push(i);n[l]=V.ketchup.dates.format(V.ketchup.dates.max(t),F.ISO_DATE)}else{n[l]=V.ketchup.dates.format(e,F.ISO_DATE)}break}}}}if(s===o.length-1&&t[l]===u.DISTINCT){n[l]=new Set(r[l]).size;r[l]=[]}}))}))}for(let r of l){switch(true){case t[r]===u.AVERAGE:const l=n[r];if(l&&e.length>0){n[r]=l/e.length}break;case t[r]===u.COUNT:n[r]=e.length;break;case t[r].indexOf(u.MATH)==0:n[r]=V.ketchup.math.formulas.custom(t[r].substring(u.MATH.length),n);break}if(n[r]){if(i.indexOf(r)!=-1){n[r]=V.ketchup.dates.format(n[r])}else if(V.ketchup.math.isNumber(n[r])){n[r]=+n[r].toFixed(2)}}}return n}function R(e){if(!e.group){return}let t=e.group.id;let l=e.group.parent;while(l!==null){t=`${l.group.id};${t}`;l=l.group.parent}e.group.id=t}function q(e,t,l,n){const i=t*l-l;const r=i+Number(l);if(n==false){return e.slice(i,r)}let s=[];z(e,s,i,Number(l),0);return s}function z(e,t,l,n,i){let r=false;for(let s=0;s<e.length;s++){let o=e[s];let a=J(e[s]);if(o.group!=null&&o.group.children!=null&&o.group.children.length>0){a.group.children=[];let e=z(o.group.children,a.group.children,l,n,i);i=e.ci;r=e.added;if(r==true){t[t.length]=a}}else{if(i>=l){t[t.length]=a;r=true}i++}if(i>=l+n){break}}return{ci:i,added:r}}function J(e){if(e==null){return null}else{return{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:H(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}}function K(e){if(e==null){return null}let t=[];for(let l=0;l<e.length;l++){t[t.length]=J(e[l])}return t}function H(e){if(e==null){return null}let t={id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:K(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)};return t}function U(e,t,l=false){const n={columns:t.columns,rows:[]};for(const i of t.rows){const r={cells:{},id:i.id};for(const l of t.columns){const t=l.name;const n=i.cells[t];const s=e.rows.find((e=>e.id===i.id));const o=s?s.cells[t]:null;if(!o||n.value!==o.value){r.cells[t]=n}}if(Object.keys(r.cells).length>0||l){n.rows.push(r)}}return n}function G(e){var t;(t=e.rows)===null||t===void 0?void 0:t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var l;let n=e.cells[t];const i=n.value;const r=n["options"];n.isEditable=(l=n.isEditable)!==null&&l!==void 0?l:n["editable"];if(r){const e={[c.AUTOCOMPLETE]:()=>h(i,"",r),[c.COMBOBOX]:()=>h(i,"",r),[c.RADIO]:()=>d(i,r),[c.CHECKBOX]:()=>b(i,r),[c.CHIP]:()=>p(i),[c.SWITCH]:()=>m(i,"")};const t=e[n.shape];if(t){n.data=t()}else{if(n.shape){V.ketchup.debug.logMessage("kup-data",`Shape specified ${n.shape} in cell ${JSON.stringify(n)} unsupported`,f.WARNING)}}}}))}))}export{w as F,k as K,O as a,_ as b,$ as c,G as d,x as e,N as f,U as g,L as n,q as p,C as s,T as t};
2
+ //# sourceMappingURL=p-1362560b.js.map
@@ -1,2 +1,2 @@
1
- import{h as e,g as t}from"./p-d7c15b0e.js";import{b as l}from"./p-f98dc5f6.js";import{F as n}from"./p-2b519589.js";const i=document.documentElement;const s=(t,l)=>{const n={"f-text-field":true,"kup-danger":t.danger,"kup-full-height":t.fullHeight,"kup-full-width":t.fullWidth,"kup-info":t.info,"kup-light-mode":t.lightMode,"kup-secondary":t.secondary,"kup-shaped":t.shaped,"kup-success":t.success,"kup-warning":t.warning,[t.wrapperClass]:!!t.wrapperClass};return e("div",Object.assign({class:n},t.dataSet,{id:t.id,title:t.title}),t.leadingLabel||t.trailingLabel?e("div",{class:`mdc-form-field ${t.leadingLabel?"mdc-form-field--align-end":""}`},[d(t),c(t),e("label",null,t.label)]):[d(t),c(t)],l)};function d(s){var d,c;const r=s.textArea||s.outlined;let o;let u;let f;let m;if(s.label&&!s.leadingLabel&&!s.trailingLabel){o=e("div",{class:"mdc-text-field__label-container"},e("label",{class:"mdc-label",htmlFor:"kup-input"},s.label),s.maxLength?e("div",{class:"mdc-text-field-character-counter"},s.value.length," / ",s.maxLength):undefined)}if(s.icon){let n;let i="";if(Object.values(l).indexOf(s.icon)>-1){i=s.icon.replace("--","")}else{let e=`url('${t(`./assets/svg/${s.icon}.svg`)}') no-repeat center`;n={mask:e,webkitMask:e}}u=e("span",{style:n,onClick:s.onIconClick,class:`mdc-text-field__icon kup-icon action ${i}`})}if(s.quantityButtons){const l=`url('${t(`./assets/svg/minus.svg`)}') no-repeat center`;const n=`url('${t(`./assets/svg/plus.svg`)}') no-repeat center`;const i={mask:l,webkitMask:l};const s={mask:n,webkitMask:n};f=e("span",{style:i,class:`mdc-text-field__icon kup-icon action`});m=e("span",{style:s,class:`mdc-text-field__icon kup-icon action`})}const p={color:s.error?`var(--kup-danger-color-60)`:`var(--kup-warning-color-50)`,resource:s.error?"error":"warning",sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"kup-icon"};const x={"mdc-text-field-container":true,"mdc-text-field-container--disabled":s.disabled};const g={"is-clearable":s.isClearable,"mdc-text-field":true,"mdc-text-field--disabled":s.disabled,"mdc-text-field--read-only":s.readOnly,"mdc-text-field--filled":!s.fullWidth&&!r,"mdc-text-field--no-label":!s.label,"mdc-text-field--fullwidth":s.fullWidth,"mdc-text-field--lightmode":s.lightMode,"mdc-text-field--outlined":r,"mdc-text-field--textarea":s.textArea,"mdc-text-field--with-leading-icon":s.icon&&!s.trailingIcon,"mdc-text-field--with-trailing-icon":s.icon&&s.trailingIcon,"mdc-text-field--with-quantity-buttons":s.quantityButtons,"mdc-text-field--error":Boolean(s.error),"mdc-text-field--alert":Boolean(s.alert),[`mdc-text-field--${s.sizing}`]:s.sizing?true:false};let v=s.value;let k=s.quantityButtons?"number":(d=s.inputType)!==null&&d!==void 0?d:"text";let b=false;if(s.inputType==="number"&&(s.decimals&&s.decimals>0||s.group)){k="text";b=true}if(s.inputType==="number"){const e={allowNegative:(c=s.allowNegative)!==null&&c!==void 0?c:true,decimal:s.decimals,group:s.group,integer:s.integers};v=a(v,e,false)}return e("div",{class:x},!s.fullWidth?o:undefined,e("div",{class:g},!s.trailingIcon?u:undefined,s.textArea?e("span",{class:"mdc-text-field__resizer"},e("textarea",{class:"mdc-text-field__input",disabled:s.disabled,maxlength:s.maxLength,value:v,onBlur:s.onBlur,onClick:s.onClick,onChange:s.onChange,onFocus:s.onFocus,onInput:s.onInput,onKeyDown:s.onKeyDown})):e("input",{inputmode:s.inputMode?s.inputMode:undefined,type:k,step:s.step,min:s.min,max:s.max,name:s.name,class:"mdc-text-field__input",disabled:s.disabled,placeholder:s.placeholder,maxlength:s.maxLength,size:s.size,value:v,onBlur:e=>{var t;if(b){const l={allowNegative:(t=s.allowNegative)!==null&&t!==void 0?t:true,decimal:s.decimals,group:s.group,integer:s.integers};e.target.value=a(e.target.value,l,true)}if(s.onBlur){s.onBlur(e)}},onChange:e=>{var t;if(b){const l={allowNegative:(t=s.allowNegative)!==null&&t!==void 0?t:true,decimal:s.decimals,group:s.group,integer:s.integers};if(s.min!==undefined&&s.min!==null&&s.min>parseFloat(e.target.value)){e.target.value=a(s.min.toString(),l,true)}else if(s.max!==undefined&&s.max!==null&&s.max<parseFloat(e.target.value)){e.target.value=a(s.max.toString(),l,true)}else{e.target.value=a(e.target.value,l,true)}}else{if(s.min!==undefined&&s.min!==null&&s.min>parseFloat(e.target.value)){e.target.value=s.min.toString()}else if(s.max!==undefined&&s.max!==null&&s.max<parseFloat(e.target.value)){e.target.value=s.max.toString()}}if(s.onChange){s.onChange(e)}},onClick:s.onClick,onFocus:s.onFocus,onInput:s.onInput,onKeyDown:s.onKeyDown,onKeyPress:e=>{var t;if(!b){return}if(e.ctrlKey){return}if(e.key.length>1){return}const l={allowNegative:(t=s.allowNegative)!==null&&t!==void 0?t:true,decimal:s.decimals,group:s.group,integer:s.integers};let n=e.target;let d=n.value;let c=d.substring(0,n.selectionStart);let a=d.substring(n.selectionEnd,n.selectionEnd+d.length-1);let r=c+e.key+a;if(!i.ketchup.math.matchNumericValueWithOptions(r,l)){e.preventDefault();return}}}),s.trailingIcon?u:undefined,s.helperIcon&&s.error?e("div",{class:"mdc-error-icon"},e(n,Object.assign({},p))):s.helperIcon&&s.alert?e("div",{class:"mdc-alert-icon"},e(n,Object.assign({},p))):undefined,s.quantityButtons&&e("div",{class:"mdc-quantity-buttons"},e("button",{onClick:s.onMinusClick},f),e("button",{onClick:s.onPlusClick},m)),s.isClearable?e("span",{class:`mdc-text-field__icon kup-icon ${l.CLEAR.replace("--","")}`,onClick:s.onClearIconClick}):undefined))}function c(t){if(t.error||t.alert){return e("div",{class:"mdc-text-field-helper-line"},t.error?e("span",{class:"mdc-error-message"},t.error):t.alert?e("span",{class:"mdc-alert-message"},t.alert):undefined)}else if(t.helperEnabled!==false){if(t.helper){const l={"mdc-text-field-helper-text":true,"mdc-text-field-helper-text--persistent":!t.helperWhenFocused};return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:l},t.helper))}}}const a=function(e,t,l){let n=e;if(!n){return n}if(n=="-"){return""}return i.ketchup.math.format(n,i.ketchup.math.createFormatPattern(t.group,t.decimal),l)};export{s as F};
2
- //# sourceMappingURL=p-9b0551b5.js.map
1
+ import{h as e,g as t}from"./p-d7c15b0e.js";import{b as l}from"./p-81285484.js";import{F as n}from"./p-2b519589.js";const i=document.documentElement;const s=(t,l)=>{const n={"f-text-field":true,"kup-danger":t.danger,"kup-full-height":t.fullHeight,"kup-full-width":t.fullWidth,"kup-info":t.info,"kup-light-mode":t.lightMode,"kup-secondary":t.secondary,"kup-shaped":t.shaped,"kup-success":t.success,"kup-warning":t.warning,[t.wrapperClass]:!!t.wrapperClass};return e("div",Object.assign({class:n},t.dataSet,{id:t.id,title:t.title}),t.leadingLabel||t.trailingLabel?e("div",{class:`mdc-form-field ${t.leadingLabel?"mdc-form-field--align-end":""}`},[d(t),c(t),e("label",null,t.label)]):[d(t),c(t)],l)};function d(s){var d,c;const r=s.textArea||s.outlined;let o;let u;let f;let m;if(s.label&&!s.leadingLabel&&!s.trailingLabel){o=e("div",{class:"mdc-text-field__label-container"},e("label",{class:"mdc-label",htmlFor:"kup-input"},s.label),s.maxLength?e("div",{class:"mdc-text-field-character-counter"},s.value.length," / ",s.maxLength):undefined)}if(s.icon){let n;let i="";if(Object.values(l).indexOf(s.icon)>-1){i=s.icon.replace("--","")}else{let e=`url('${t(`./assets/svg/${s.icon}.svg`)}') no-repeat center`;n={mask:e,webkitMask:e}}u=e("span",{style:n,onClick:s.onIconClick,class:`mdc-text-field__icon kup-icon action ${i}`})}if(s.quantityButtons){const l=`url('${t(`./assets/svg/minus.svg`)}') no-repeat center`;const n=`url('${t(`./assets/svg/plus.svg`)}') no-repeat center`;const i={mask:l,webkitMask:l};const s={mask:n,webkitMask:n};f=e("span",{style:i,class:`mdc-text-field__icon kup-icon action`});m=e("span",{style:s,class:`mdc-text-field__icon kup-icon action`})}const p={color:s.error?`var(--kup-danger-color-60)`:`var(--kup-warning-color-50)`,resource:s.error?"error":"warning",sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"kup-icon"};const x={"mdc-text-field-container":true,"mdc-text-field-container--disabled":s.disabled};const g={"is-clearable":s.isClearable,"mdc-text-field":true,"mdc-text-field--disabled":s.disabled,"mdc-text-field--read-only":s.readOnly,"mdc-text-field--filled":!s.fullWidth&&!r,"mdc-text-field--no-label":!s.label,"mdc-text-field--fullwidth":s.fullWidth,"mdc-text-field--lightmode":s.lightMode,"mdc-text-field--outlined":r,"mdc-text-field--textarea":s.textArea,"mdc-text-field--with-leading-icon":s.icon&&!s.trailingIcon,"mdc-text-field--with-trailing-icon":s.icon&&s.trailingIcon,"mdc-text-field--with-quantity-buttons":s.quantityButtons,"mdc-text-field--error":Boolean(s.error),"mdc-text-field--alert":Boolean(s.alert),[`mdc-text-field--${s.sizing}`]:s.sizing?true:false};let v=s.value;let k=s.quantityButtons?"number":(d=s.inputType)!==null&&d!==void 0?d:"text";let b=false;if(s.inputType==="number"&&(s.decimals&&s.decimals>0||s.group)){k="text";b=true}if(s.inputType==="number"){const e={allowNegative:(c=s.allowNegative)!==null&&c!==void 0?c:true,decimal:s.decimals,group:s.group,integer:s.integers};v=a(v,e,false)}return e("div",{class:x},!s.fullWidth?o:undefined,e("div",{class:g},!s.trailingIcon?u:undefined,s.textArea?e("span",{class:"mdc-text-field__resizer"},e("textarea",{class:"mdc-text-field__input",disabled:s.disabled,maxlength:s.maxLength,value:v,onBlur:s.onBlur,onClick:s.onClick,onChange:s.onChange,onFocus:s.onFocus,onInput:s.onInput,onKeyDown:s.onKeyDown})):e("input",{inputmode:s.inputMode?s.inputMode:undefined,type:k,step:s.step,min:s.min,max:s.max,name:s.name,class:"mdc-text-field__input",disabled:s.disabled,placeholder:s.placeholder,maxlength:s.maxLength,size:s.size,value:v,onBlur:e=>{var t;if(b){const l={allowNegative:(t=s.allowNegative)!==null&&t!==void 0?t:true,decimal:s.decimals,group:s.group,integer:s.integers};e.target.value=a(e.target.value,l,true)}if(s.onBlur){s.onBlur(e)}},onChange:e=>{var t;if(b){const l={allowNegative:(t=s.allowNegative)!==null&&t!==void 0?t:true,decimal:s.decimals,group:s.group,integer:s.integers};if(s.min!==undefined&&s.min!==null&&s.min>parseFloat(e.target.value)){e.target.value=a(s.min.toString(),l,true)}else if(s.max!==undefined&&s.max!==null&&s.max<parseFloat(e.target.value)){e.target.value=a(s.max.toString(),l,true)}else{e.target.value=a(e.target.value,l,true)}}else{if(s.min!==undefined&&s.min!==null&&s.min>parseFloat(e.target.value)){e.target.value=s.min.toString()}else if(s.max!==undefined&&s.max!==null&&s.max<parseFloat(e.target.value)){e.target.value=s.max.toString()}}if(s.onChange){s.onChange(e)}},onClick:s.onClick,onFocus:s.onFocus,onInput:s.onInput,onKeyDown:s.onKeyDown,onKeyPress:e=>{var t;if(!b){return}if(e.ctrlKey){return}if(e.key.length>1){return}const l={allowNegative:(t=s.allowNegative)!==null&&t!==void 0?t:true,decimal:s.decimals,group:s.group,integer:s.integers};let n=e.target;let d=n.value;let c=d.substring(0,n.selectionStart);let a=d.substring(n.selectionEnd,n.selectionEnd+d.length-1);let r=c+e.key+a;if(!i.ketchup.math.matchNumericValueWithOptions(r,l)){e.preventDefault();return}}}),s.trailingIcon?u:undefined,s.helperIcon&&s.error?e("div",{class:"mdc-error-icon"},e(n,Object.assign({},p))):s.helperIcon&&s.alert?e("div",{class:"mdc-alert-icon"},e(n,Object.assign({},p))):undefined,s.quantityButtons&&e("div",{class:"mdc-quantity-buttons"},e("button",{onClick:s.onMinusClick},f),e("button",{onClick:s.onPlusClick},m)),s.isClearable?e("span",{class:`mdc-text-field__icon kup-icon ${l.CLEAR.replace("--","")}`,onClick:s.onClearIconClick}):undefined))}function c(t){if(t.error||t.alert){return e("div",{class:"mdc-text-field-helper-line"},t.error?e("span",{class:"mdc-error-message"},t.error):t.alert?e("span",{class:"mdc-alert-message"},t.alert):undefined)}else if(t.helperEnabled!==false){if(t.helper){const l={"mdc-text-field-helper-text":true,"mdc-text-field-helper-text--persistent":!t.helperWhenFocused};return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:l},t.helper))}}}const a=function(e,t,l){let n=e;if(!n){return n}if(n=="-"){return""}return i.ketchup.math.format(n,i.ketchup.math.createFormatPattern(t.group,t.decimal),l)};export{s as F};
2
+ //# sourceMappingURL=p-170d2abd.js.map