@sme.up/ketchup 11.0.0-SNAPSHOT-20250129113902 → 11.0.0-SNAPSHOT-20250129120724

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 (185) hide show
  1. package/dist/cjs/{f-cell-f5c22ae3.js → f-cell-c280a48a.js} +11 -15
  2. package/dist/cjs/{f-chip-18b45cbc.js → f-chip-d857f0ad.js} +1 -1
  3. package/dist/cjs/{f-object-field-2c4c3ac5.js → f-object-field-0877b344.js} +2 -2
  4. package/dist/cjs/{f-paginator-utils-53078606.js → f-paginator-utils-05acb20c.js} +1 -1
  5. package/dist/cjs/{f-text-field-6615a856.js → f-text-field-2bfe6a67.js} +9 -1
  6. package/dist/cjs/index.cjs.js +1 -1
  7. package/dist/cjs/kup-accordion.cjs.entry.js +1 -1
  8. package/dist/cjs/kup-activity-timeline.cjs.entry.js +2 -2
  9. package/dist/cjs/kup-autocomplete_28.cjs.entry.js +7 -7
  10. package/dist/cjs/kup-box.cjs.entry.js +7 -7
  11. package/dist/cjs/kup-calendar.cjs.entry.js +2 -2
  12. package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
  13. package/dist/cjs/kup-cell.cjs.entry.js +5 -5
  14. package/dist/cjs/kup-dashboard.cjs.entry.js +2 -2
  15. package/dist/cjs/{kup-data-table-helper-ba879f52.js → kup-data-table-helper-786a5878.js} +1 -1
  16. package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
  17. package/dist/cjs/kup-echart.cjs.entry.js +1 -1
  18. package/dist/cjs/kup-editor.cjs.entry.js +1 -1
  19. package/dist/cjs/kup-family-tree.cjs.entry.js +1 -1
  20. package/dist/cjs/kup-grid.cjs.entry.js +1 -1
  21. package/dist/cjs/kup-htm.cjs.entry.js +1 -1
  22. package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
  23. package/dist/cjs/kup-image-list.cjs.entry.js +5 -5
  24. package/dist/cjs/kup-input-panel.cjs.entry.js +6 -6
  25. package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
  26. package/dist/cjs/kup-magic-box.cjs.entry.js +1 -1
  27. package/dist/cjs/{kup-manager-0bde5b3e.js → kup-manager-85fb4608.js} +1 -1
  28. package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
  29. package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
  30. package/dist/cjs/kup-object-field.cjs.entry.js +3 -3
  31. package/dist/cjs/kup-pdf.cjs.entry.js +1 -1
  32. package/dist/cjs/kup-planner.cjs.entry.js +2 -2
  33. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  34. package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
  35. package/dist/cjs/kup-snackbar.cjs.entry.js +1 -1
  36. package/dist/cjs/kup-txt.cjs.entry.js +1 -1
  37. package/dist/cjs/kup-typography-list.cjs.entry.js +1 -1
  38. package/dist/cjs/kup-typography.cjs.entry.js +1 -1
  39. package/dist/collection/components/kup-input-panel/kup-input-panel.css +12 -0
  40. package/dist/collection/f-components/f-cell/f-cell.js +7 -11
  41. package/dist/collection/f-components/f-text-field/f-text-field.js +8 -0
  42. package/dist/components/index.js +1 -1
  43. package/dist/components/kup-accordion.js +2 -2
  44. package/dist/components/kup-activity-timeline.js +2 -2
  45. package/dist/components/kup-autocomplete.js +1 -1
  46. package/dist/components/kup-badge.js +1 -1
  47. package/dist/components/kup-box.js +1 -1
  48. package/dist/components/kup-button-list.js +1 -1
  49. package/dist/components/kup-button.js +1 -1
  50. package/dist/components/kup-calendar.js +2 -2
  51. package/dist/components/kup-card-list.js +3 -3
  52. package/dist/components/kup-card.js +1 -1
  53. package/dist/components/kup-cell.js +2 -2
  54. package/dist/components/kup-chart.js +1 -1
  55. package/dist/components/kup-checkbox.js +1 -1
  56. package/dist/components/kup-chip.js +1 -1
  57. package/dist/components/kup-color-picker.js +1 -1
  58. package/dist/components/kup-combobox.js +1 -1
  59. package/dist/components/kup-dashboard.js +2 -2
  60. package/dist/components/kup-data-table.js +1 -1
  61. package/dist/components/kup-date-picker.js +1 -1
  62. package/dist/components/kup-dialog.js +1 -1
  63. package/dist/components/kup-drawer.js +2 -2
  64. package/dist/components/kup-dropdown-button.js +1 -1
  65. package/dist/components/kup-echart.js +1 -1
  66. package/dist/components/kup-editor.js +1 -1
  67. package/dist/components/kup-family-tree.js +3 -3
  68. package/dist/components/kup-form.js +1 -1
  69. package/dist/components/kup-gauge.js +1 -1
  70. package/dist/components/kup-grid.js +1 -1
  71. package/dist/components/kup-htm.js +2 -2
  72. package/dist/components/kup-iframe.js +2 -2
  73. package/dist/components/kup-image-list.js +2 -2
  74. package/dist/components/kup-image.js +1 -1
  75. package/dist/components/kup-input-panel.js +4 -4
  76. package/dist/components/kup-lazy.js +2 -2
  77. package/dist/components/kup-list.js +1 -1
  78. package/dist/components/kup-magic-box.js +4 -4
  79. package/dist/components/kup-nav-bar.js +2 -2
  80. package/dist/components/kup-numeric-picker.js +2 -2
  81. package/dist/components/kup-object-field.js +2 -2
  82. package/dist/components/kup-pdf.js +2 -2
  83. package/dist/components/kup-planner.js +2 -2
  84. package/dist/components/kup-probe.js +2 -2
  85. package/dist/components/kup-progress-bar.js +1 -1
  86. package/dist/components/kup-qlik.js +2 -2
  87. package/dist/components/kup-radio.js +1 -1
  88. package/dist/components/kup-rating.js +1 -1
  89. package/dist/components/kup-snackbar.js +2 -2
  90. package/dist/components/kup-spinner.js +1 -1
  91. package/dist/components/kup-switch.js +1 -1
  92. package/dist/components/kup-tab-bar.js +1 -1
  93. package/dist/components/kup-text-field.js +1 -1
  94. package/dist/components/kup-time-picker.js +1 -1
  95. package/dist/components/kup-toolbar.js +1 -1
  96. package/dist/components/kup-tree.js +1 -1
  97. package/dist/components/kup-txt.js +2 -2
  98. package/dist/components/kup-typography-list.js +2 -2
  99. package/dist/components/kup-typography.js +2 -2
  100. package/dist/components/{p-4a247d05.js → p-6fd08da4.js} +2 -2
  101. package/dist/components/{p-08a824b7.js → p-7e11d146.js} +2 -2
  102. package/dist/components/{p-4d78f4b5.js → p-7fceb2d6.js} +16 -12
  103. package/dist/components/{p-0c4c10f2.js → p-d7db1472.js} +1 -1
  104. package/dist/components/{p-1d28c626.js → p-e6172a09.js} +2 -2
  105. package/dist/components/{p-b2085cfb.js → p-e93c8327.js} +2 -2
  106. package/dist/esm/{f-cell-40840ce5.js → f-cell-72735360.js} +11 -15
  107. package/dist/esm/{f-chip-db575f2c.js → f-chip-5419a7a3.js} +1 -1
  108. package/dist/esm/{f-object-field-83a4b83e.js → f-object-field-e3a5cfa6.js} +2 -2
  109. package/dist/esm/{f-paginator-utils-6acf3cdb.js → f-paginator-utils-3ec6ec4f.js} +1 -1
  110. package/dist/esm/{f-text-field-b4ff1e80.js → f-text-field-1709b65e.js} +9 -1
  111. package/dist/esm/index.js +1 -1
  112. package/dist/esm/kup-accordion.entry.js +1 -1
  113. package/dist/esm/kup-activity-timeline.entry.js +2 -2
  114. package/dist/esm/kup-autocomplete_28.entry.js +7 -7
  115. package/dist/esm/kup-box.entry.js +7 -7
  116. package/dist/esm/kup-calendar.entry.js +2 -2
  117. package/dist/esm/kup-card-list.entry.js +1 -1
  118. package/dist/esm/kup-cell.entry.js +5 -5
  119. package/dist/esm/kup-dashboard.entry.js +2 -2
  120. package/dist/esm/{kup-data-table-helper-7000285d.js → kup-data-table-helper-5dab6520.js} +1 -1
  121. package/dist/esm/kup-drawer.entry.js +1 -1
  122. package/dist/esm/kup-echart.entry.js +1 -1
  123. package/dist/esm/kup-editor.entry.js +1 -1
  124. package/dist/esm/kup-family-tree.entry.js +1 -1
  125. package/dist/esm/kup-grid.entry.js +1 -1
  126. package/dist/esm/kup-htm.entry.js +1 -1
  127. package/dist/esm/kup-iframe.entry.js +1 -1
  128. package/dist/esm/kup-image-list.entry.js +5 -5
  129. package/dist/esm/kup-input-panel.entry.js +6 -6
  130. package/dist/esm/kup-lazy.entry.js +1 -1
  131. package/dist/esm/kup-magic-box.entry.js +1 -1
  132. package/dist/esm/{kup-manager-f8d8e705.js → kup-manager-ab18cfc3.js} +1 -1
  133. package/dist/esm/kup-nav-bar.entry.js +1 -1
  134. package/dist/esm/kup-numeric-picker.entry.js +2 -2
  135. package/dist/esm/kup-object-field.entry.js +3 -3
  136. package/dist/esm/kup-pdf.entry.js +1 -1
  137. package/dist/esm/kup-planner.entry.js +2 -2
  138. package/dist/esm/kup-probe.entry.js +1 -1
  139. package/dist/esm/kup-qlik.entry.js +1 -1
  140. package/dist/esm/kup-snackbar.entry.js +1 -1
  141. package/dist/esm/kup-txt.entry.js +1 -1
  142. package/dist/esm/kup-typography-list.entry.js +1 -1
  143. package/dist/esm/kup-typography.entry.js +1 -1
  144. package/dist/ketchup/index.esm.js +1 -1
  145. package/dist/ketchup/ketchup.esm.js +1 -1
  146. package/dist/ketchup/{p-5a48b2e6.entry.js → p-00d6ef2b.entry.js} +1 -1
  147. package/dist/ketchup/{p-c377a18e.entry.js → p-03466b3b.entry.js} +1 -1
  148. package/dist/ketchup/{p-7ebb4a8d.entry.js → p-066a0f8e.entry.js} +1 -1
  149. package/dist/ketchup/{p-7dc21d98.entry.js → p-1e23e9ed.entry.js} +1 -1
  150. package/dist/ketchup/{p-68e197ca.entry.js → p-218bd41a.entry.js} +1 -1
  151. package/dist/ketchup/{p-57d98740.entry.js → p-21d960f1.entry.js} +1 -1
  152. package/dist/ketchup/{p-5cf744cb.entry.js → p-27113344.entry.js} +1 -1
  153. package/dist/ketchup/{p-a793d438.entry.js → p-2d088534.entry.js} +1 -1
  154. package/dist/ketchup/{p-569ef87d.entry.js → p-454dcd8e.entry.js} +1 -1
  155. package/dist/ketchup/{p-7384259c.entry.js → p-53840950.entry.js} +1 -1
  156. package/dist/ketchup/p-55ee1a46.js +1 -0
  157. package/dist/ketchup/{p-a141d42e.entry.js → p-5e08babe.entry.js} +1 -1
  158. package/dist/ketchup/{p-7aa6e73b.entry.js → p-619d7f0d.entry.js} +1 -1
  159. package/dist/ketchup/{p-ad179f34.entry.js → p-61c6eb5f.entry.js} +1 -1
  160. package/dist/ketchup/{p-d5d58dd8.js → p-6615a5fe.js} +1 -1
  161. package/dist/ketchup/{p-0983475f.js → p-68aa21b3.js} +1 -1
  162. package/dist/ketchup/{p-f5c79b56.entry.js → p-6c3a09e8.entry.js} +1 -1
  163. package/dist/ketchup/{p-fe404351.entry.js → p-717f0e2d.entry.js} +1 -1
  164. package/dist/ketchup/{p-e9be6c07.entry.js → p-7537eb3c.entry.js} +1 -1
  165. package/dist/ketchup/{p-af2136bc.entry.js → p-82bcdc9c.entry.js} +1 -1
  166. package/dist/ketchup/{p-728d11e3.js → p-85e39883.js} +1 -1
  167. package/dist/ketchup/{p-0db30c4f.entry.js → p-8a3f1620.entry.js} +1 -1
  168. package/dist/ketchup/{p-71bd8943.js → p-9ccb083d.js} +1 -1
  169. package/dist/ketchup/{p-6b05ef5c.entry.js → p-a587c6c6.entry.js} +1 -1
  170. package/dist/ketchup/p-ba757e90.js +1 -0
  171. package/dist/ketchup/{p-7863d1c8.entry.js → p-bd50f3d8.entry.js} +1 -1
  172. package/dist/ketchup/{p-7a1d21a3.entry.js → p-bd761968.entry.js} +1 -1
  173. package/dist/ketchup/{p-8f19b40a.entry.js → p-c8d00a67.entry.js} +1 -1
  174. package/dist/ketchup/{p-4e63d6b1.entry.js → p-cd73e17a.entry.js} +1 -1
  175. package/dist/ketchup/{p-eca493fc.entry.js → p-d1d37afb.entry.js} +1 -1
  176. package/dist/ketchup/{p-2e053030.entry.js → p-d4dc67f6.entry.js} +1 -1
  177. package/dist/ketchup/{p-510ccd51.entry.js → p-dd2add36.entry.js} +1 -1
  178. package/dist/ketchup/{p-6c3981c9.entry.js → p-e4efe2fb.entry.js} +1 -1
  179. package/dist/ketchup/{p-bcf0ea99.entry.js → p-e578c414.entry.js} +1 -1
  180. package/dist/ketchup/{p-f07452ae.entry.js → p-ed54af3e.entry.js} +1 -1
  181. package/dist/ketchup/{p-80b75242.entry.js → p-ed78ac35.entry.js} +1 -1
  182. package/dist/ketchup/{p-c4864dc5.js → p-fbaf1cc5.js} +1 -1
  183. package/package.json +1 -1
  184. package/dist/ketchup/p-e79cf2e1.js +0 -1
  185. package/dist/ketchup/p-e88c9656.js +0 -1
@@ -1 +1 @@
1
- import{C as e,D as t,B as n,ac as l,v as o,x as r,ad as i,ae as s,M as u,N as a,F as c,af as f,ag as d,ah as h,ai as b,aj as m,a3 as p}from"./p-728d11e3.js";import{K as v}from"./p-1ee561ba.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,n){let l="";if(null==e)return l;let o=e[t];return null==o||(l=n?o.textFieldTmp:o.textField),l}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,n){if(!t)return!1;let l=this._getTextFilterValue(e,t.name,n);if(null!=l&&""!=l.trim())return!0;let o=this.getCheckBoxFilterValues(e,t.name);return!(null==o||o.length<1)}getCheckBoxFilterValues(e={},t){let n=[];if(null==e)return n;let l=e[t];return null==l||null==l.checkBoxes||(n=l.checkBoxes),n}addCheckboxFilter(t={},n,l){if(null==t)return;let o=t[n];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},t[n]=o),null==o.checkBoxes&&(o.checkBoxes=[]),null==l||null==l.value?o.checkBoxes=[]:e.valuesArrayContainsValue(o.checkBoxes,l.value)||(o.checkBoxes[o.checkBoxes.length]=l)}removeCheckboxFilter(t={},n,l){if(null==t||null==l)return;let o=t[n];if(null==o)return;null==o.checkBoxes&&(o.checkBoxes=[]);let r=e.indexOfValueInValuesArray(o.checkBoxes,l);if(r>=0){let e=[];for(let t=0;t<o.checkBoxes.length;t++)t!=r&&(e[e.length]=o.checkBoxes[t]);o.checkBoxes=[...e]}}isColumnNumeric(e){return this.isObjNumeric(e.obj)}setTextFieldFilterValue(e={},t,n){this._setTextFieldFilterValue(e,t,n,!0)}_setTextFieldFilterValue(e={},t,n,l){if(null==e)return;let o=e[t];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},e[t]=o),l?o.textFieldTmp=null!=n?n.trim():n:o.textField=null!=n?n.trim():n}saveTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValueTmp(e,t),!1)}resetTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValue(e,t),!0)}getFilterValueForTooltip(e={},l){let o=this.getTextFilterValue(e,l.name),r=this.getCheckBoxFilterValues(e,l.name),i="",s=t(o,l.obj,l.decimals);""!=o&&(i=" AND "),i="";let u="";return r.forEach((e=>{u+=i+n(e,l),i=" OR "})),""!=u&&(u="("+u+")",""!=s&&(u=" AND "+u)),u=s+u,u}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[]}}}var F;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.removableColumns="Sets the possibility to remove the selected column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(F||(F={}));const x="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const j=document.documentElement,k=j.ketchup?j.ketchup.objects:new r,O=j.ketchup?j.ketchup.data:new i;class y extends e{isFilterCompliantForCell(e,t){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t)}isFilterCompliantForCellObj(e,t){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t)}isRowCompliant(e,t={},n="",l=!1,o=[],r){return this.areCellsCompliant(e.cells,t,n,l,o,r)}areCellsCompliant(e,t={},n="",o=!1,r=[],i){if(o){let t=!0;if(r&&null!=r&&r.length>0){t=!1;let o=this.filterIsNegative(n);for(let i=0;i<r.length;i++){if(0==r[i].visible)continue;const s=e[r[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,n);let u=l(r[i],s);if(u!=s.value&&(t=t||this.isFilterCompliantForValue(u,n)),1==t&&!o)break;if(0==t&&o)break}}if(!t)return!1}if(null==i&&(i=new w),!this.hasFilters(t,r,i))return!0;let s=Object.keys(t);for(let n=0;n<s.length;n++){let l=s[n];const o=e[l];if(!o)return!1;let r=i.getTextFilterValue(t,l);const u=this.filterIsNegative(r);let a=this.isFilterCompliantForCell(o,r),c=u;if(k.isNumber(o.obj)||k.isDate(o.obj)||k.isTime(o.obj)||k.isTimestamp(o.obj)||(c=this.isFilterCompliantForCellObj(o,r)),u){if(!a||!c)return!1}else if(!a&&!c)return!1;let f=i.getCheckBoxFilterValues(t,l);if(0==f.length)continue;let d=!1;for(let e=0;e<f.length;e++){let t=f[e];if(null!=t&&null!=t.value){if(null!=o.value&&o.value.toLowerCase().trim()==t.value.toLowerCase().trim()){d=!0;break}if(null!=o.obj&&o.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){d=!0;break}}}if(!d)return!1}return!0}hasFilters(e={},t,n){if(null==e)return!1;let l=Object.keys(e);if(null==l||l.length<1)return!1;null==n&&(n=new w);for(let r=0;r<l.length;r++){let i=l[r],s=null;if(s=i===x?{name:x,title:""}:o(t,i),n.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},n="",l=[],o){if(!e||null==e)return[];let r=[];const i=!(!n||!l);if(this.hasFilters(t,l,o)||i)for(let s=0;s<e.length;s++){let u=e[s];(u.id&&u.id.indexOf("insert_")>-1||this.isRowCompliant(u,t,n,i,l,o))&&(r[r.length]=u)}else r=[...e];return r}getColumnValues(n,l,o,r){let i=new Array;null==r&&(r=new w);let s=r.getTextFilterValueTmp(n.filters,l.name),u=r.getCheckBoxFilterValues(n.filters,l.name);if(null!=l.valuesForFilter&&l.valuesForFilter.length>0)return l.valuesForFilter.forEach((n=>{let o=n;(e.valuesArrayContainsValue(u,o)||""==s||r.isFilterCompliantForSimpleValue(o,l.obj,s))&&i.push({value:o,displayedValue:t(o,l.obj,l.decimals)})})),i;let a=Object.assign({},n.filters);a[l.name]={textField:s,textFieldTmp:s,checkBoxes:[]};let c=this.filterRows(n.getRows(),a,o,n.getVisibleColumns(),r);for(let e=0;e<u.length;e++)i.push(u[e]);return O.cell.getUnivocalValue({rows:c},l,!0)}}const T=document.documentElement;function C(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const n=e[0].group.column;let l=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let n of t)if(n.column===e)return n;return null}(n,t);return l||(l={column:n,sortMode:p.A}),e.sort(((e,t)=>s({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},l.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const n=t.length>1;return e.slice(0).sort(((e,l)=>{if(n){for(let n=0;n<t.length;n++){const o=N(e,l,t[n]);if(0!==o)return o}return 0}return N(e,l,t[0])}))}function N(e,t,n){const l=e.cells[n.column],o=t.cells[n.column];return l||o?l?o?s(l,o,n.sortMode):-1:1:0}function M(e=[],t={},n="",l=[],o,r){return null==r&&(r=new y),r.filterRows(e,t,n,l,o)}function V(e=[],t=[],n=[],r={}){if(!t)return[];if(!n||0===n.length||!e||0===e.length)return t;const i={},s=n.filter((({column:t})=>{for(let{name:n,title:l}of e)if(n===t)return i[n]=l,!0;return!1}));if(0===s.length)return t;const a=[];let c={};return t.forEach((t=>{const n=s[0].column,f=t.cells[n];if(f){const d=o(e,n),h=l(d,f),b=f.value;let m=null;for(let e of a)if(e.group.label===h){m=e;break}null===m&&(m={group:{id:b,parent:null,column:n,columnLabel:i[n],expanded:!1,label:h,children:[],obj:f.obj,totals:{}},cells:{}},a.push(m));for(let n=1;n<s.length;n++){const r=s[n],u=t.cells[r.column];if(u){const t=o(e,r.column),n=l(t,u),s=u.value;let a=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===n){a=t;break}}a||(a={cells:{},group:{id:s,parent:m,column:r.column,columnLabel:i[r.column],children:[],expanded:!1,label:n,totals:{},obj:u.obj}},L(a),m.group.children.push(a)),m=a}}m.group.children.push(t),function(e,t,n,l){if(!e||!t)return;const o=Object.keys(t);0!==o.length&&o.forEach((o=>{const r=n.cells[o];if(r){const n=T.ketchup.objects.isNumber(r.obj),i=t[o];switch(i){case u.COUNT:let t=e.group.totals[o]||0;e.group.totals[o]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[o]||0;s.group.totals[o]=++e,s=s.group.parent}break;case u.DISTINCT:let a;if(a=n?T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value)):r.value,l[e.group.id]){let t=l[e.group.id][o];t?t.push(a):(l[e.group.id][o]=[],l[e.group.id][o].push(a))}else l[e.group.id]={},l[e.group.id][o]=[],l[e.group.id][o].push(a);let c=e.group.parent;for(;null!=c;){if(l[c.group.id]){let e=l[c.group.id][o];e?e.push(a):(l[c.group.id][o]=[],l[c.group.id][o].push(a))}else l[c.group.id]={},l[c.group.id][o]=[],l[c.group.id][o].push(a);c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(n&&r.value){const t=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t+(e.group.totals[o]||0);let n=e.group.parent;for(;null!=n;){const e=T.ketchup.math.numberify(n.group.totals[o]||0);n.group.totals[o]=t+e,n=n.group.parent}}break;case u.MIN:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.min(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.min(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(a),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(a),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);n=n.group.parent}}break;case u.MAX:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.max(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.max(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(a),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(a),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);n=n.group.parent}}break;default:0!=i.indexOf(u.MATH)&&console.warn(`invalid total mode: ${i}`)}}}))}(m,r,t,c)}})),function(e,t,n){if(!e||!t)return;const l=Object.keys(t);if(0===e.length||!e[0].group||0===l.length)return;let o=l.filter((e=>u.DISTINCT===t[e]));o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>W(e,o,n)))}(a,r,c),B(a,u.AVERAGE,r),B(a,u.MATH,r),a}function B(e,t,n){if(!e||!n)return;const l=Object.keys(n);if(0===e.length||!e[0].group||0===l.length)return;let o;t==u.AVERAGE&&(o=l.filter((e=>u.AVERAGE===n[e]))),t==u.MATH&&(o=l.filter((e=>0==n[e].indexOf(u.MATH)))),o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>D(e,t,o,n)))}function W(e,t,n){const l=e.group.children;0!==l.length&&(l[0].group&&l.forEach((e=>{W(e,t,n)})),t.forEach((t=>{e.group.totals[t]=new Set(n[e.group.id][t]).size})))}function D(e,t,n,l){const o=e.group.children;if(0===o.length)return 0;let r=0;return o[0].group?o.forEach((e=>{r+=D(e,t,n,l)})):r=o.length,n.forEach((n=>{if(t==u.AVERAGE&&(e.group.totals[n]=e.group.totals[n]/r),t==u.MATH){let t=l[n].substring(u.MATH.length);e.group.totals[n]=T.ketchup.math.formulas.custom(t,e.group.totals)}})),r}function A(e,t){if(t){const n=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const n=t.cells[e.name];n&&e.obj&&!n.obj&&(n.obj={t:e.obj.t,p:e.obj.p,k:n.value})}}))})),n}}function E(e,t,n){if(T.ketchup.objects.isEmptyJsObject(t)||T.ketchup.objects.isEmptyJsObject(e))return{};const l={},o=[],r=Object.entries(e).reduce(((e,[n,r])=>r===u.COUNT?(l[n]=t.length.toString(),e):0===r.indexOf(u.MATH)?(o.push([n,r]),e):(e.push([n,r]),e)),[]);if(!r&&!o)return l;const i=null==r?void 0:r.map((([e,l])=>{var o,r,i;let s="generic";const u=null!==(r=null===(o=null==n?void 0:n.find((t=>t.name===e)))||void 0===o?void 0:o.obj)&&void 0!==r?r:null===(i=t[0].cells[e])||void 0===i?void 0:i.obj;return T.ketchup.objects.isNumber(u)&&(s="number"),T.ketchup.objects.isDate(u)&&(s="date"),{columnName:e,objType:s,totalOperation:l,values:t.map((t=>t.cells[e].value))}}));return null==i||i.forEach((({columnName:e,objType:n,totalOperation:o,values:r})=>{if("number"===n){if(o===u.SUM)return void(l[e]=r.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0).toString());if(o===u.AVERAGE)return void(l[e]=(r.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0)/t.length).toString());if(o===u.MIN)return void(l[e]=Math.min(...r.map((e=>T.ketchup.math.numberifySafe(e)))).toString());if(o===u.MAX)return void(l[e]=Math.max(...r.map((e=>T.ketchup.math.numberifySafe(e)))).toString())}if("date"===n){const t=r.filter((e=>T.ketchup.dates.isIsoDate(e))).map((e=>T.ketchup.dates.toDate(e,v.ISO_DATE)));if(!t)return;if(o===u.MIN)return void(l[e]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE));if(o===u.MAX)return void(l[e]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE))}o===u.DISTINCT&&(l[e]=new Set(r).size.toString())})),null==o||o.forEach((([e,t])=>{const n=null==t?void 0:t.replace(a(u.MATH,"g"),"");l[e]=T.ketchup.math.formulas.custom(n,function(e){var t;return Object.fromEntries(null===(t=Object.entries(e))||void 0===t?void 0:t.reduce(((e,[t,n])=>(T.ketchup.math.isNumber(n)&&e.push([t,Number(n)]),e)),[]))}(l)).toString()})),l}function L(e){if(!e.group)return;let t=e.group.id,n=e.group.parent;for(;null!==n;)t=`${n.group.id};${t}`,n=n.group.parent;e.group.id=t}function S(e,t,n,l){const o=t*n-n,r=o+Number(n);if(0==l)return e.slice(o,r);let i=[];return _(e,i,o,Number(n),0),i}function _(e,t,n,l,o){let r=!1;for(let i=0;i<e.length;i++){let s=e[i],u=R(e[i]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){u.group.children=[];let e=_(s.group.children,u.group.children,n,l,o);o=e.ci,r=e.added,1==r&&(t[t.length]=u)}else o>=n&&(t[t.length]=u,r=!0),o++;if(o>=n+l)break}return{ci:o,added:r}}function R(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:$(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function I(e){if(null==e)return null;let t=[];for(let n=0;n<e.length;n++)t[t.length]=R(e[n]);return t}function $(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:I(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function q(e,t,n=!1){const l={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const o of t.rows){const t={cells:{},id:o.id};for(const n of l.columns){const l=n.name,r=o.cells[l],i=e.rows.find((e=>e.id===o.id)),s=i?i.cells[l]:null;(!s&&r.value||s&&r.value!==s.value)&&(t.cells[l]=r)}(Object.keys(t.cells).length>0||n)&&l.rows.push(t)}return l}function z(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var n;let l=e.cells[t];const o=l.value,r=l.options;l.isEditable=null!==(n=l.isEditable)&&void 0!==n?n:l.editable;const i={[c.AUTOCOMPLETE]:()=>f(o,"",r),[c.COMBOBOX]:()=>f(o,"",r),[c.RADIO]:()=>d(o,r),[c.CHECKBOX]:()=>h(o,""),[c.CHIP]:()=>b(o),[c.SWITCH]:()=>m(o,"")}[l.shape];i&&(l.data=Object.assign(Object.assign({},i()),l.data))}))}))}export{w as F,g as K,y as a,V as b,E as c,z as d,F as e,M as f,q as g,A as n,S as p,C as s,x as t}
1
+ import{C as e,D as t,B as n,ac as l,v as o,x as r,ad as i,ae as s,M as u,N as a,F as c,af as f,ag as d,ah as h,ai as b,aj as m,a3 as p}from"./p-85e39883.js";import{K as v}from"./p-1ee561ba.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,n){let l="";if(null==e)return l;let o=e[t];return null==o||(l=n?o.textFieldTmp:o.textField),l}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,n){if(!t)return!1;let l=this._getTextFilterValue(e,t.name,n);if(null!=l&&""!=l.trim())return!0;let o=this.getCheckBoxFilterValues(e,t.name);return!(null==o||o.length<1)}getCheckBoxFilterValues(e={},t){let n=[];if(null==e)return n;let l=e[t];return null==l||null==l.checkBoxes||(n=l.checkBoxes),n}addCheckboxFilter(t={},n,l){if(null==t)return;let o=t[n];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},t[n]=o),null==o.checkBoxes&&(o.checkBoxes=[]),null==l||null==l.value?o.checkBoxes=[]:e.valuesArrayContainsValue(o.checkBoxes,l.value)||(o.checkBoxes[o.checkBoxes.length]=l)}removeCheckboxFilter(t={},n,l){if(null==t||null==l)return;let o=t[n];if(null==o)return;null==o.checkBoxes&&(o.checkBoxes=[]);let r=e.indexOfValueInValuesArray(o.checkBoxes,l);if(r>=0){let e=[];for(let t=0;t<o.checkBoxes.length;t++)t!=r&&(e[e.length]=o.checkBoxes[t]);o.checkBoxes=[...e]}}isColumnNumeric(e){return this.isObjNumeric(e.obj)}setTextFieldFilterValue(e={},t,n){this._setTextFieldFilterValue(e,t,n,!0)}_setTextFieldFilterValue(e={},t,n,l){if(null==e)return;let o=e[t];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},e[t]=o),l?o.textFieldTmp=null!=n?n.trim():n:o.textField=null!=n?n.trim():n}saveTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValueTmp(e,t),!1)}resetTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValue(e,t),!0)}getFilterValueForTooltip(e={},l){let o=this.getTextFilterValue(e,l.name),r=this.getCheckBoxFilterValues(e,l.name),i="",s=t(o,l.obj,l.decimals);""!=o&&(i=" AND "),i="";let u="";return r.forEach((e=>{u+=i+n(e,l),i=" OR "})),""!=u&&(u="("+u+")",""!=s&&(u=" AND "+u)),u=s+u,u}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[]}}}var F;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.removableColumns="Sets the possibility to remove the selected column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(F||(F={}));const x="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const j=document.documentElement,k=j.ketchup?j.ketchup.objects:new r,O=j.ketchup?j.ketchup.data:new i;class y extends e{isFilterCompliantForCell(e,t){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t)}isFilterCompliantForCellObj(e,t){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t)}isRowCompliant(e,t={},n="",l=!1,o=[],r){return this.areCellsCompliant(e.cells,t,n,l,o,r)}areCellsCompliant(e,t={},n="",o=!1,r=[],i){if(o){let t=!0;if(r&&null!=r&&r.length>0){t=!1;let o=this.filterIsNegative(n);for(let i=0;i<r.length;i++){if(0==r[i].visible)continue;const s=e[r[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,n);let u=l(r[i],s);if(u!=s.value&&(t=t||this.isFilterCompliantForValue(u,n)),1==t&&!o)break;if(0==t&&o)break}}if(!t)return!1}if(null==i&&(i=new w),!this.hasFilters(t,r,i))return!0;let s=Object.keys(t);for(let n=0;n<s.length;n++){let l=s[n];const o=e[l];if(!o)return!1;let r=i.getTextFilterValue(t,l);const u=this.filterIsNegative(r);let a=this.isFilterCompliantForCell(o,r),c=u;if(k.isNumber(o.obj)||k.isDate(o.obj)||k.isTime(o.obj)||k.isTimestamp(o.obj)||(c=this.isFilterCompliantForCellObj(o,r)),u){if(!a||!c)return!1}else if(!a&&!c)return!1;let f=i.getCheckBoxFilterValues(t,l);if(0==f.length)continue;let d=!1;for(let e=0;e<f.length;e++){let t=f[e];if(null!=t&&null!=t.value){if(null!=o.value&&o.value.toLowerCase().trim()==t.value.toLowerCase().trim()){d=!0;break}if(null!=o.obj&&o.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){d=!0;break}}}if(!d)return!1}return!0}hasFilters(e={},t,n){if(null==e)return!1;let l=Object.keys(e);if(null==l||l.length<1)return!1;null==n&&(n=new w);for(let r=0;r<l.length;r++){let i=l[r],s=null;if(s=i===x?{name:x,title:""}:o(t,i),n.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},n="",l=[],o){if(!e||null==e)return[];let r=[];const i=!(!n||!l);if(this.hasFilters(t,l,o)||i)for(let s=0;s<e.length;s++){let u=e[s];(u.id&&u.id.indexOf("insert_")>-1||this.isRowCompliant(u,t,n,i,l,o))&&(r[r.length]=u)}else r=[...e];return r}getColumnValues(n,l,o,r){let i=new Array;null==r&&(r=new w);let s=r.getTextFilterValueTmp(n.filters,l.name),u=r.getCheckBoxFilterValues(n.filters,l.name);if(null!=l.valuesForFilter&&l.valuesForFilter.length>0)return l.valuesForFilter.forEach((n=>{let o=n;(e.valuesArrayContainsValue(u,o)||""==s||r.isFilterCompliantForSimpleValue(o,l.obj,s))&&i.push({value:o,displayedValue:t(o,l.obj,l.decimals)})})),i;let a=Object.assign({},n.filters);a[l.name]={textField:s,textFieldTmp:s,checkBoxes:[]};let c=this.filterRows(n.getRows(),a,o,n.getVisibleColumns(),r);for(let e=0;e<u.length;e++)i.push(u[e]);return O.cell.getUnivocalValue({rows:c},l,!0)}}const T=document.documentElement;function C(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const n=e[0].group.column;let l=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let n of t)if(n.column===e)return n;return null}(n,t);return l||(l={column:n,sortMode:p.A}),e.sort(((e,t)=>s({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},l.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const n=t.length>1;return e.slice(0).sort(((e,l)=>{if(n){for(let n=0;n<t.length;n++){const o=N(e,l,t[n]);if(0!==o)return o}return 0}return N(e,l,t[0])}))}function N(e,t,n){const l=e.cells[n.column],o=t.cells[n.column];return l||o?l?o?s(l,o,n.sortMode):-1:1:0}function M(e=[],t={},n="",l=[],o,r){return null==r&&(r=new y),r.filterRows(e,t,n,l,o)}function V(e=[],t=[],n=[],r={}){if(!t)return[];if(!n||0===n.length||!e||0===e.length)return t;const i={},s=n.filter((({column:t})=>{for(let{name:n,title:l}of e)if(n===t)return i[n]=l,!0;return!1}));if(0===s.length)return t;const a=[];let c={};return t.forEach((t=>{const n=s[0].column,f=t.cells[n];if(f){const d=o(e,n),h=l(d,f),b=f.value;let m=null;for(let e of a)if(e.group.label===h){m=e;break}null===m&&(m={group:{id:b,parent:null,column:n,columnLabel:i[n],expanded:!1,label:h,children:[],obj:f.obj,totals:{}},cells:{}},a.push(m));for(let n=1;n<s.length;n++){const r=s[n],u=t.cells[r.column];if(u){const t=o(e,r.column),n=l(t,u),s=u.value;let a=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===n){a=t;break}}a||(a={cells:{},group:{id:s,parent:m,column:r.column,columnLabel:i[r.column],children:[],expanded:!1,label:n,totals:{},obj:u.obj}},L(a),m.group.children.push(a)),m=a}}m.group.children.push(t),function(e,t,n,l){if(!e||!t)return;const o=Object.keys(t);0!==o.length&&o.forEach((o=>{const r=n.cells[o];if(r){const n=T.ketchup.objects.isNumber(r.obj),i=t[o];switch(i){case u.COUNT:let t=e.group.totals[o]||0;e.group.totals[o]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[o]||0;s.group.totals[o]=++e,s=s.group.parent}break;case u.DISTINCT:let a;if(a=n?T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value)):r.value,l[e.group.id]){let t=l[e.group.id][o];t?t.push(a):(l[e.group.id][o]=[],l[e.group.id][o].push(a))}else l[e.group.id]={},l[e.group.id][o]=[],l[e.group.id][o].push(a);let c=e.group.parent;for(;null!=c;){if(l[c.group.id]){let e=l[c.group.id][o];e?e.push(a):(l[c.group.id][o]=[],l[c.group.id][o].push(a))}else l[c.group.id]={},l[c.group.id][o]=[],l[c.group.id][o].push(a);c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(n&&r.value){const t=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t+(e.group.totals[o]||0);let n=e.group.parent;for(;null!=n;){const e=T.ketchup.math.numberify(n.group.totals[o]||0);n.group.totals[o]=t+e,n=n.group.parent}}break;case u.MIN:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.min(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.min(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(a),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(a),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);n=n.group.parent}}break;case u.MAX:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.max(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.max(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(a),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(a),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(a,v.ISO_DATE);n=n.group.parent}}break;default:0!=i.indexOf(u.MATH)&&console.warn(`invalid total mode: ${i}`)}}}))}(m,r,t,c)}})),function(e,t,n){if(!e||!t)return;const l=Object.keys(t);if(0===e.length||!e[0].group||0===l.length)return;let o=l.filter((e=>u.DISTINCT===t[e]));o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>W(e,o,n)))}(a,r,c),B(a,u.AVERAGE,r),B(a,u.MATH,r),a}function B(e,t,n){if(!e||!n)return;const l=Object.keys(n);if(0===e.length||!e[0].group||0===l.length)return;let o;t==u.AVERAGE&&(o=l.filter((e=>u.AVERAGE===n[e]))),t==u.MATH&&(o=l.filter((e=>0==n[e].indexOf(u.MATH)))),o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>D(e,t,o,n)))}function W(e,t,n){const l=e.group.children;0!==l.length&&(l[0].group&&l.forEach((e=>{W(e,t,n)})),t.forEach((t=>{e.group.totals[t]=new Set(n[e.group.id][t]).size})))}function D(e,t,n,l){const o=e.group.children;if(0===o.length)return 0;let r=0;return o[0].group?o.forEach((e=>{r+=D(e,t,n,l)})):r=o.length,n.forEach((n=>{if(t==u.AVERAGE&&(e.group.totals[n]=e.group.totals[n]/r),t==u.MATH){let t=l[n].substring(u.MATH.length);e.group.totals[n]=T.ketchup.math.formulas.custom(t,e.group.totals)}})),r}function A(e,t){if(t){const n=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const n=t.cells[e.name];n&&e.obj&&!n.obj&&(n.obj={t:e.obj.t,p:e.obj.p,k:n.value})}}))})),n}}function E(e,t,n){if(T.ketchup.objects.isEmptyJsObject(t)||T.ketchup.objects.isEmptyJsObject(e))return{};const l={},o=[],r=Object.entries(e).reduce(((e,[n,r])=>r===u.COUNT?(l[n]=t.length.toString(),e):0===r.indexOf(u.MATH)?(o.push([n,r]),e):(e.push([n,r]),e)),[]);if(!r&&!o)return l;const i=null==r?void 0:r.map((([e,l])=>{var o,r,i;let s="generic";const u=null!==(r=null===(o=null==n?void 0:n.find((t=>t.name===e)))||void 0===o?void 0:o.obj)&&void 0!==r?r:null===(i=t[0].cells[e])||void 0===i?void 0:i.obj;return T.ketchup.objects.isNumber(u)&&(s="number"),T.ketchup.objects.isDate(u)&&(s="date"),{columnName:e,objType:s,totalOperation:l,values:t.map((t=>t.cells[e].value))}}));return null==i||i.forEach((({columnName:e,objType:n,totalOperation:o,values:r})=>{if("number"===n){if(o===u.SUM)return void(l[e]=r.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0).toString());if(o===u.AVERAGE)return void(l[e]=(r.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0)/t.length).toString());if(o===u.MIN)return void(l[e]=Math.min(...r.map((e=>T.ketchup.math.numberifySafe(e)))).toString());if(o===u.MAX)return void(l[e]=Math.max(...r.map((e=>T.ketchup.math.numberifySafe(e)))).toString())}if("date"===n){const t=r.filter((e=>T.ketchup.dates.isIsoDate(e))).map((e=>T.ketchup.dates.toDate(e,v.ISO_DATE)));if(!t)return;if(o===u.MIN)return void(l[e]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE));if(o===u.MAX)return void(l[e]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE))}o===u.DISTINCT&&(l[e]=new Set(r).size.toString())})),null==o||o.forEach((([e,t])=>{const n=null==t?void 0:t.replace(a(u.MATH,"g"),"");l[e]=T.ketchup.math.formulas.custom(n,function(e){var t;return Object.fromEntries(null===(t=Object.entries(e))||void 0===t?void 0:t.reduce(((e,[t,n])=>(T.ketchup.math.isNumber(n)&&e.push([t,Number(n)]),e)),[]))}(l)).toString()})),l}function L(e){if(!e.group)return;let t=e.group.id,n=e.group.parent;for(;null!==n;)t=`${n.group.id};${t}`,n=n.group.parent;e.group.id=t}function S(e,t,n,l){const o=t*n-n,r=o+Number(n);if(0==l)return e.slice(o,r);let i=[];return _(e,i,o,Number(n),0),i}function _(e,t,n,l,o){let r=!1;for(let i=0;i<e.length;i++){let s=e[i],u=R(e[i]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){u.group.children=[];let e=_(s.group.children,u.group.children,n,l,o);o=e.ci,r=e.added,1==r&&(t[t.length]=u)}else o>=n&&(t[t.length]=u,r=!0),o++;if(o>=n+l)break}return{ci:o,added:r}}function R(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:$(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function I(e){if(null==e)return null;let t=[];for(let n=0;n<e.length;n++)t[t.length]=R(e[n]);return t}function $(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:I(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function q(e,t,n=!1){const l={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const o of t.rows){const t={cells:{},id:o.id};for(const n of l.columns){const l=n.name,r=o.cells[l],i=e.rows.find((e=>e.id===o.id)),s=i?i.cells[l]:null;(!s&&r.value||s&&r.value!==s.value)&&(t.cells[l]=r)}(Object.keys(t.cells).length>0||n)&&l.rows.push(t)}return l}function z(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var n;let l=e.cells[t];const o=l.value,r=l.options;l.isEditable=null!==(n=l.isEditable)&&void 0!==n?n:l.editable;const i={[c.AUTOCOMPLETE]:()=>f(o,"",r),[c.COMBOBOX]:()=>f(o,"",r),[c.RADIO]:()=>d(o,r),[c.CHECKBOX]:()=>h(o,""),[c.CHIP]:()=>b(o),[c.SWITCH]:()=>m(o,"")}[l.shape];i&&(l.data=Object.assign(Object.assign({},i()),l.data))}))}))}export{w as F,g as K,y as a,V as b,E as c,z as d,F as e,M as f,q as g,A as n,S as p,C as s,x as t}
@@ -1 +1 @@
1
- import{r as t,c as i,f as s,h,H as e,d as n,g as o}from"./p-b0368f88.js";import{k as a,ac as r,g as l,s as c,b as f,E as d}from"./p-728d11e3.js";import{K as p,d as u,a as m,b as v,c as k}from"./p-cd3a7d53.js";import{c as w}from"./p-635bb4b3.js";import{F as g}from"./p-e88c9656.js";import{F as y}from"./p-7db300e0.js";import"./p-1ee561ba.js";import"./p-b120abd7.js";import"./p-c56195a0.js";const b=a();function x(t,i,s,h,e,n,o,a){const r=D(t,i);let l=[];s&&h&&(l=C(s,h)?D(s,h):[...r]);let c=[];e&&n&&(z(e,n)?c=S(e,n):l=[...r]);let f=[];return o&&a&&(z(o,a)?f=S(o,a):l=[...r]),{dateValues:r,secDateValues:l,hourValues:c,secHourValues:f}}function D(t,i){let s=[t.value,i.value];return j(t)&&j(i)?s:j(t)?[t.value,t.value]:j(i)?[i.value,i.value]:s}function S(t,i){let s=[t.value,i.value];return O(t)&&O(i)?s:O(t)?[t.value,t.value]:O(i)?[i.value,i.value]:s}function j(t){return b.objects.isDate(t.obj)&&b.dates.isIsoDate(t.value)}function O(t){return b.objects.isTime(t.obj)||b.objects.isTimeWithSeconds(t.obj)}function C(t,i){return j(t)||j(i)}function z(t,i){return O(t)||O(i)}function T(t,i,s,h,e,n){let o=()=>e.map((i=>r(h.find((t=>t.name==i)),t.cells[i])));return n&&(o=n),(null==e?void 0:e.length)>=2?o():[t.cells[i].value,t.cells[s].value]}class E{constructor(){this.showSecondaryDates=!1,this.detailFilter="",this.detailInitialScrollX=0,this.detailInitialScrollY=0,this.taskFilter="",this.taskInitialScrollX=0,this.taskInitialScrollY=0,this.viewMode="day"}toDebugString(){return"dt state"}}var H,M,P,W,I,R,V,Y,K,A,G,X,L,F,N,_,q,B,J,Q,U,Z,$,tt,it=function(t,i,s,h){if("a"===s&&!h)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!h:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?h:"a"===s?h.call(t):h?h.value:i.get(t)},st=function(t,i,s,h,e){if("m"===h)throw new TypeError("Private method is not writable");if("a"===h&&!e)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===h?e.call(t,s):e?e.value=s:i.set(t,s),s};const ht=class{constructor(s){t(this,s),this.kupClick=i(this,"kup-planner-click",6),this.kupDblClick=i(this,"kup-planner-dblclick",6),this.kupDateChange=i(this,"kup-planner-datechange",6),this.kupPhaseDrop=i(this,"kup-planner-phasedrop",6),this.kupReady=i(this,"kup-planner-ready",6),this.kupContextMenu=i(this,"kup-planner-contextmenu",6),this.kupDidUnload=i(this,"kup-planner-didunload",6),H.add(this),this.state=new E,this.plannerRenderer=void 0,M.set(this,a()),P.set(this,void 0),W.set(this,[]),I.set(this,{}),R.set(this,void 0),this.stateId="",this.store=void 0,this.customStyle="",this.data=void 0,this.detailData=void 0,this.detailColorCol=void 0,this.detailColumns=void 0,this.detailDates=void 0,this.detailFilter=void 0,this.detailHeight=void 0,this.detailHours=[],this.detailIconCol=void 0,this.detailIdCol=void 0,this.detailNameCol=void 0,this.detailPrevHours=[],this.detailPrevDates=void 0,this.detailInitialScrollX=void 0,this.detailInitialScrollY=void 0,this.listCellWidth="300px",this.maxWidth="90vw",this.phaseColorCol=void 0,this.phaseColumns=void 0,this.phaseColParDep=void 0,this.phaseDates=void 0,this.phaseHours=[],this.phaseIconCol=void 0,this.phaseIdCol=void 0,this.phaseNameCol=void 0,this.phasePrevHours=[],this.phasePrevDates=void 0,this.readOnly=!1,this.showSecondaryDates=!1,this.taskColumns=void 0,this.taskDates=void 0,this.taskFilter=void 0,this.taskHeight=void 0,this.taskHours=[],this.taskIconCol=void 0,this.taskIdCol=void 0,this.taskInitialScrollX=void 0,this.taskInitialScrollY=void 0,this.taskNameCol=void 0,this.taskPrevHours=[],this.taskPrevDates=void 0,this.titleMess=void 0,this.viewMode="month",this.mainFilter=void 0,this.secondaryFilter=void 0,this.scrollableTaskList=!1,this.plannerProps=void 0}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);null!=t&&(it(this,M,"f").debug.logMessage(this,"Initializing stateId "+this.stateId),this.detailFilter=t.detailFilter,this.showSecondaryDates=t.showSecondaryDates,this.detailInitialScrollX=t.detailInitialScrollX,this.detailInitialScrollY=t.detailInitialScrollY,this.taskFilter=t.taskFilter,this.taskInitialScrollX=t.taskInitialScrollX,this.taskInitialScrollY=t.taskInitialScrollY,this.viewMode=t.viewMode)}}persistState(){if(this.store&&this.stateId){let t=!1;it(this,M,"f").objects.deepEqual(this.state.detailFilter,it(this,R,"f").detailFilter)||(this.state.detailFilter=it(this,R,"f").detailFilter,t=!0),it(this,M,"f").objects.deepEqual(this.state.showSecondaryDates,it(this,R,"f").showSecondaryDates)||(this.state.showSecondaryDates=it(this,R,"f").showSecondaryDates,t=!0),it(this,M,"f").objects.deepEqual(this.state.detailInitialScrollX,it(this,R,"f").detailInitialScrollX)||(this.state.detailInitialScrollX=it(this,R,"f").detailInitialScrollX,t=!0),it(this,M,"f").objects.deepEqual(this.state.detailInitialScrollY,it(this,R,"f").detailInitialScrollY)||(this.state.detailInitialScrollY=it(this,R,"f").detailInitialScrollY,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskFilter,it(this,R,"f").taskFilter)||(this.state.taskFilter=it(this,R,"f").taskFilter,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskInitialScrollX,it(this,R,"f").taskInitialScrollX)||(this.state.taskInitialScrollX=it(this,R,"f").taskInitialScrollX,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskInitialScrollY,it(this,R,"f").taskInitialScrollY)||(this.state.taskInitialScrollY=it(this,R,"f").taskInitialScrollY,t=!0),it(this,M,"f").objects.deepEqual(this.state.viewMode,it(this,R,"f").viewMode)||(this.state.viewMode=it(this,R,"f").viewMode,t=!0),t&&(it(this,M,"f").debug.logMessage(this,"Persisting stateId "+this.stateId),this.store.persistState(this.stateId,this.state))}}dataChanged(){st(this,I,{},"f")}async getProps(t){return l(this,k,t)}async refresh(){s(this),this.plannerRenderer.refresh()}async setProps(t){c(this,k,t)}async addPhases(t,i){var s;const h=it(this,H,"m",K).call(this,t);h&&(it(this,I,"f")[t]=i,h.phases=null===(s=i.rows)||void 0===s?void 0:s.filter((t=>C(t.cells[this.phaseDates[0]],t.cells[this.phaseDates[1]]))).map((t=>{const s=x(t.cells[this.phaseDates[0]],t.cells[this.phaseDates[1]],t.cells[this.phasePrevDates[0]],t.cells[this.phasePrevDates[1]],t.cells[this.phaseHours[0]],t.cells[this.phaseHours[1]],t.cells[this.phasePrevHours[0]],t.cells[this.phasePrevHours[1]]),e=T(t,this.phaseIdCol,this.phaseNameCol,i.columns,this.phaseColumns,(()=>this.phaseColumns.map((s=>s==this.phaseDates[0]?"#START#":s==this.phaseDates[1]?"#END#":r(i.columns.find((t=>t.name==s)),t.cells[s])))));let n=it(this,H,"m",$).call(this,t,this.phaseIconCol),o=it(this,H,"m",tt).call(this,t,this.phaseIconCol);return{taskRow:h.taskRow,phaseRow:t,id:h.id+"_"+t.cells[this.phaseIdCol].value,phaseRowId:t.id,taskRowId:h.taskRowId,name:t.cells[this.phaseNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"task",color:t.cells[this.phaseColorCol].value,selectedColor:t.cells[this.phaseColorCol].value,valuesToShow:e,rowType:p.PHASE,icon:n?{url:n,color:null!=o?o:"#595959"}:void 0,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]}}))),this.plannerProps.mainGantt.initialScrollX=it(this,R,"f").taskInitialScrollX,this.plannerProps.mainGantt.initialScrollY=it(this,R,"f").taskInitialScrollY,this.plannerProps.secondaryGantt&&(this.plannerProps.secondaryGantt.initialScrollX=it(this,R,"f").detailInitialScrollX,this.plannerProps.secondaryGantt.initialScrollX=it(this,R,"f").detailInitialScrollY),this.plannerProps=Object.assign({},this.plannerProps),this.refresh()}componentWillLoad(){it(this,M,"f").debug.logLoad(this,!1),it(this,M,"f").theme.register(this),this.initWithPersistedState(),st(this,R,{detailFilter:this.detailFilter,detailInitialScrollX:this.detailInitialScrollX,detailInitialScrollY:this.detailInitialScrollY,showSecondaryDates:this.showSecondaryDates,taskFilter:this.taskFilter,taskInitialScrollX:this.taskInitialScrollX,taskInitialScrollY:this.taskInitialScrollY,viewMode:this.viewMode},"f")}componentDidLoad(){let t=it(this,H,"m",Y).call(this,it(this,H,"m",Z).call(this,it(this,R,"f").detailFilter,!0));const i=this.rootElement.shadowRoot.querySelector("#main-filter");y(i);const s=this.rootElement.shadowRoot.querySelector("#secondary-filter");let h,e,n;t&&y(s),this.plannerProps={mainGantt:{title:this.titleMess,items:it(this,H,"m",V).call(this,it(this,H,"m",Z).call(this,it(this,R,"f").taskFilter,!1)),stylingOptions:Object.assign(Object.assign({},u),{listCellWidth:this.listCellWidth}),filter:i,hideLabel:!0,ganttHeight:this.taskHeight,showSecondaryDates:it(this,R,"f").showSecondaryDates,onClick:t=>this.handleOnClick(t),onDblClick:t=>this.handleOnDblClick(t),onContextMenu:(t,i)=>this.handleOnContextMenu(t,i),onDateChange:t=>this.handleOnDateChange(t),initialScrollX:this.taskInitialScrollX,initialScrollY:this.taskInitialScrollY,readOnly:this.readOnly,onScrollY:t=>{window.clearTimeout(e),e=window.setTimeout((()=>this.handleTaskGanttScrollY(t)),500)},onPhaseDrop:t=>this.handleOnPhaseDrop(t)},secondaryGantt:t?{title:"",items:t,stylingOptions:Object.assign(Object.assign({},u),{listCellWidth:this.listCellWidth}),filter:s,hideLabel:!0,ganttHeight:this.detailHeight,onClick:t=>this.handleOnClick(t),onContextMenu:(t,i)=>this.handleOnContextMenu(t,i),onDateChange:t=>this.handleOnDateChange(t),initialScrollX:this.detailInitialScrollX,initialScrollY:this.detailInitialScrollY,readOnly:this.readOnly,onScrollY:t=>{window.clearTimeout(n),n=window.setTimeout((()=>this.handleDetailGanttScrollY(t)),500)}}:void 0,onSetDoubleView:t=>this.handleOnSetDoubleView(t),onSetViewMode:t=>this.handleOnSetViewMode(t),viewMode:this.viewMode,scrollableTaskList:this.scrollableTaskList,onScrollX:t=>{window.clearTimeout(h),h=window.setTimeout((()=>this.handleOnScrollX(t)),500)}},this.kupReady.emit({comp:this,id:this.rootElement.id,value:void 0}),this.taskFilter&&it(this,H,"m",U).call(this,this.taskFilter),this.detailFilter&&it(this,H,"m",U).call(this,this.detailFilter,!0),it(this,M,"f").debug.logLoad(this,!0)}componentDidRender(){this.persistState(),it(this,M,"f").debug.logRender(this,!0)}onKupDblClick(t,i){this.kupDblClick.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupClick(t,i){this.kupClick.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupContextMenu(t,i,s){let h,e,n;switch(i.type){case"project":h=i.taskRow,e=h.cells[this.taskIdCol],n=this.data.columns[this.taskIdCol];break;case"task":h=i.phaseRow,e=h.cells[this.phaseIdCol];break;case"timeline":h=i.detailRow,e=h.cells[this.detailIdCol],n=this.data.columns[this.detailIdCol]}this.kupContextMenu.emit({comp:this,id:this.rootElement.id,value:i,taskAction:s,details:{cell:e,column:n,originalEvent:t,row:h}})}onKupDateChange(t,i){this.kupDateChange.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupPhaseDrop(t,i){this.kupPhaseDrop.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}handleOnDblClick(t){switch(t.rowType){case p.TASK:it(this,H,"m",G).call(this)&&this.onKupDblClick(t,m.onDblClick);break;case p.PHASE:it(this,H,"m",X).call(this)&&this.onKupDblClick(t,m.onDblClick);break;case p.DETAIL:it(this,H,"m",L).call(this)&&this.onKupDblClick(t,m.onDblClick)}for(let t=0;t<it(this,W,"f").length;t++)clearTimeout(it(this,W,"f")[t]),it(this,M,"f").debug.logMessage(this,"Cleared click timeout("+it(this,W,"f")[t]+").");st(this,W,[],"f")}handleOnClick(t){it(this,W,"f").push(setTimeout((()=>{switch(t.rowType){case p.TASK:const i=t.phases?m.onTaskClosing:m.onTaskOpening;it(this,H,"m",F).call(this,t)&&this.onKupClick(t,i);break;case p.PHASE:it(this,H,"m",N).call(this)&&this.onKupClick(t,m.onClick);break;case p.DETAIL:it(this,H,"m",_).call(this)&&this.onKupClick(t,m.onClick)}}),300))}handleOnContextMenu(t,i){switch(i.rowType){case p.TASK:it(this,H,"m",q).call(this)&&this.onKupContextMenu(t,i,m.onRightClick);break;case p.PHASE:it(this,H,"m",B).call(this)&&this.onKupContextMenu(t,i,m.onRightClick);break;case p.DETAIL:it(this,H,"m",J).call(this)&&this.onKupContextMenu(t,i,m.onRightClick)}}handleOnSetDoubleView(t){var i;it(this,R,"f").showSecondaryDates=t,(null===(i=this.plannerProps)||void 0===i?void 0:i.mainGantt)&&(this.plannerProps.mainGantt.showSecondaryDates=t),this.persistState()}handleOnSetViewMode(t){it(this,R,"f").viewMode=t,this.plannerProps.viewMode=t,this.persistState()}handleOnScrollX(t){it(this,R,"f").taskInitialScrollX=t,it(this,R,"f").detailInitialScrollX=t,this.persistState()}handleTaskGanttScrollY(t){it(this,R,"f").taskInitialScrollY=t,this.persistState()}handleDetailGanttScrollY(t){it(this,R,"f").detailInitialScrollY=t,this.persistState()}handleOnDateChange(t){it(this,H,"m",Q).call(this,t)&&t.rowType!=p.DETAIL&&this.onKupDateChange(t,m.onResize)}handleOnPhaseDrop(t){this.onKupPhaseDrop(t,m.onTask)}render(){var t,i,s;const n=this.plannerProps?Object.assign(Object.assign({},this.plannerProps),{onSetDoubleView:this.handleOnSetDoubleView.bind(this),onSetViewMode:this.handleOnSetViewMode.bind(this),onScrollX:this.handleOnScrollX.bind(this),mainGantt:Object.assign(Object.assign({},null===(t=this.plannerProps)||void 0===t?void 0:t.mainGantt),{onScrollY:this.handleTaskGanttScrollY.bind(this)})}):null;return(null===(i=this.plannerProps)||void 0===i?void 0:i.secondaryGantt)&&(n.secondaryGantt=Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{onScrollY:this.handleDetailGanttScrollY.bind(this)})),h(e,{key:"566acc19713e3e86dd7df82289970c2177d9ca64"},h("style",{key:"b963bc1a35ee326159dcfdba26d54b0363a6b24d"},it(this,M,"f").theme.setKupStyle(this.rootElement)),h("div",{key:"431b11c904af49b67400e33dd151eab1e662a2c9",id:w,style:{maxWidth:this.maxWidth}},this.plannerProps&&h("kup-planner-renderer",{key:"c3ea134d3afc42f6e1d3089dc65c251e2338febe",props:n,ref:t=>this.plannerRenderer=t})),h("div",{key:"43969a35e6a3ada36973257bcdb0081d560098e4",style:{display:this.plannerProps?"none":""}},h(g,{key:"c0a01be246cc6e28f2780fe57194b6e4c84ad194",icon:f.SEARCH,id:"main-filter",label:it(this,M,"f").language.translate(d.SEARCH),onKeyDown:t=>{"Enter"===t.key&&it(this,H,"m",U).call(this,t.target.value)},value:this.taskFilter,wrapperClass:"filter"}),(null===(s=this.detailData)||void 0===s?void 0:s.rows)&&this.detailData.rows.length>0?h(g,{icon:f.SEARCH,id:"secondary-filter",label:it(this,M,"f").language.translate(d.SEARCH),onKeyDown:t=>{"Enter"===t.key&&it(this,H,"m",U).call(this,t.target.value,!0)},value:this.detailFilter,wrapperClass:"filter"}):null))}disconnectedCallback(){it(this,M,"f").theme.unregister(this),this.kupDidUnload.emit({comp:this,id:this.rootElement.id,storedSettings:it(this,R,"f")})}get rootElement(){return n(this)}static get watchers(){return{data:["dataChanged"]}}};M=new WeakMap,P=new WeakMap,W=new WeakMap,I=new WeakMap,R=new WeakMap,H=new WeakSet,V=function(t){var i;return t&&t.rows?null===(i=t.rows)||void 0===i?void 0:i.filter((t=>C(t.cells[this.taskDates[0]],t.cells[this.taskDates[1]]))).map((i=>{const s=x(i.cells[this.taskDates[0]],i.cells[this.taskDates[1]],i.cells[this.taskPrevDates[0]],i.cells[this.taskPrevDates[1]],i.cells[this.taskHours[0]],i.cells[this.taskHours[1]],i.cells[this.taskPrevHours[0]],i.cells[this.taskPrevHours[1]]),h=T(i,this.taskIdCol,this.taskNameCol,t.columns,this.taskColumns,(()=>this.taskColumns.map((s=>s==this.taskDates[0]?"#START#":s==this.taskDates[1]?"#END#":r(t.columns.find((t=>t.name==s)),i.cells[s])))));let e=it(this,H,"m",$).call(this,i,this.taskIconCol),n=it(this,H,"m",tt).call(this,i,this.taskIconCol);return{taskRow:i,taskRowId:i.id,id:i.cells[this.taskIdCol].value,name:i.cells[this.taskNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"project",valuesToShow:h,rowType:p.TASK,icon:e?{url:e,color:null!=n?n:"#595959"}:void 0,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]}})):[]},Y=function(t){if(!t||!t.rows)return;let i=[];return t.rows.filter((t=>C(t.cells[this.detailDates[0]],t.cells[this.detailDates[1]]))).forEach((s=>{var h,e;const n=s.cells[this.detailIdCol].value,o=s.cells[this.detailNameCol].value,a=x(s.cells[this.detailDates[0]],s.cells[this.detailDates[1]],void 0,void 0,s.cells[this.detailHours[0]],s.cells[this.detailHours[1]]),r=T(s,this.detailIdCol,this.detailNameCol,t.columns,this.detailColumns);let l=i.find((t=>t.id==n));l||(l={id:n,name:o,detailRow:s,type:"timeline",valuesToShow:r,rowType:p.DETAIL,schedule:[]},i.push(l));let c=it(this,H,"m",$).call(this,s,this.detailIconCol),f=it(this,H,"m",tt).call(this,s,this.detailIconCol);l.schedule.push({startDate:a.dateValues[0],endDate:a.dateValues[1],color:this.detailColorCol&&null!==(h=s.cells[this.detailColorCol].value)&&void 0!==h?h:"#D9D9D8",selectedColor:this.detailColorCol&&null!==(e=s.cells[this.detailColorCol].value)&&void 0!==e?e:"#D9D9D8",icon:c?{url:c,color:null!=f?f:"#595959"}:void 0,startHour:a.hourValues[0],endHour:a.hourValues[1]})})),i},K=function(t){return this.plannerProps.mainGantt.items.find((i=>i.id==t))},A=function(t){const i=it(this,H,"m",K).call(this,t);i&&(i.phases=void 0),this.plannerProps=Object.assign({},this.plannerProps)},G=function(){return!0},X=function(){return!0},L=function(){return!0},F=function(t){const i=it(this,H,"m",K).call(this,t.id);return(null==i?void 0:i.phases)&&it(this,H,"m",A).call(this,i.id),!0},N=function(){return!0},_=function(){return!0},q=function(){return!0},B=function(){return!0},J=function(){return!0},Q=function(t){let i=!1;return it(this,P,"f")?it(this,P,"f").isEquivalent(t)||(st(this,P,new v(t),"f"),i=!0):(i=!0,st(this,P,new v(t),"f")),i},U=function(t,i){i?it(this,R,"f").detailFilter=t:it(this,R,"f").taskFilter=t;const s=i?{secondaryGantt:Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{items:it(this,H,"m",Y).call(this,it(this,H,"m",Z).call(this,t,i))})}:{mainGantt:Object.assign(Object.assign({},this.plannerProps.mainGantt),{items:it(this,H,"m",V).call(this,it(this,H,"m",Z).call(this,t,i))})};this.plannerProps=Object.assign(Object.assign({},this.plannerProps),s),this.persistState()},Z=function(t,i){const s=i?this.detailData:this.data;if(!s||!s.rows||0==s.rows.length)return;if(!t)return s;const h={columns:this.data.columns,rows:[]},e=[];for(let i=0;i<s.rows.length;i++){const h=s.rows[i],n=h.cells;for(let i=0;i<s.columns.length;i++){const o=n[s.columns[i].name];if(o&&r(s.columns[i],o).toLowerCase().indexOf(t.toLowerCase())>-1){e.push({row:h,weight:i});break}}}return e.sort(((t,i)=>t.weight-i.weight)).forEach((t=>{h.rows.push(t.row)})),h},$=function(t,i){var s;let h;if(i){const e=t.cells[i];let n=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.resource;n||(n=e.value),n&&(h=o("./assets/svg/"+n+".svg"))}return h},tt=function(t,i){var s;let h;if(i){const e=t.cells[i];h=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.color,h&&(h=it(this,M,"f").theme.colorCheck(h).hexColor)}return h},ht.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size: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}";export{ht as kup_planner}
1
+ import{r as t,c as i,f as s,h,H as e,d as n,g as o}from"./p-b0368f88.js";import{k as a,ac as r,g as l,s as c,b as f,E as d}from"./p-85e39883.js";import{K as p,d as u,a as m,b as v,c as k}from"./p-cd3a7d53.js";import{c as w}from"./p-635bb4b3.js";import{F as g}from"./p-55ee1a46.js";import{F as y}from"./p-7db300e0.js";import"./p-1ee561ba.js";import"./p-b120abd7.js";import"./p-c56195a0.js";const b=a();function x(t,i,s,h,e,n,o,a){const r=D(t,i);let l=[];s&&h&&(l=C(s,h)?D(s,h):[...r]);let c=[];e&&n&&(z(e,n)?c=S(e,n):l=[...r]);let f=[];return o&&a&&(z(o,a)?f=S(o,a):l=[...r]),{dateValues:r,secDateValues:l,hourValues:c,secHourValues:f}}function D(t,i){let s=[t.value,i.value];return j(t)&&j(i)?s:j(t)?[t.value,t.value]:j(i)?[i.value,i.value]:s}function S(t,i){let s=[t.value,i.value];return O(t)&&O(i)?s:O(t)?[t.value,t.value]:O(i)?[i.value,i.value]:s}function j(t){return b.objects.isDate(t.obj)&&b.dates.isIsoDate(t.value)}function O(t){return b.objects.isTime(t.obj)||b.objects.isTimeWithSeconds(t.obj)}function C(t,i){return j(t)||j(i)}function z(t,i){return O(t)||O(i)}function T(t,i,s,h,e,n){let o=()=>e.map((i=>r(h.find((t=>t.name==i)),t.cells[i])));return n&&(o=n),(null==e?void 0:e.length)>=2?o():[t.cells[i].value,t.cells[s].value]}class E{constructor(){this.showSecondaryDates=!1,this.detailFilter="",this.detailInitialScrollX=0,this.detailInitialScrollY=0,this.taskFilter="",this.taskInitialScrollX=0,this.taskInitialScrollY=0,this.viewMode="day"}toDebugString(){return"dt state"}}var H,M,P,W,I,R,V,Y,K,A,G,X,L,F,N,_,q,B,J,Q,U,Z,$,tt,it=function(t,i,s,h){if("a"===s&&!h)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!h:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?h:"a"===s?h.call(t):h?h.value:i.get(t)},st=function(t,i,s,h,e){if("m"===h)throw new TypeError("Private method is not writable");if("a"===h&&!e)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===h?e.call(t,s):e?e.value=s:i.set(t,s),s};const ht=class{constructor(s){t(this,s),this.kupClick=i(this,"kup-planner-click",6),this.kupDblClick=i(this,"kup-planner-dblclick",6),this.kupDateChange=i(this,"kup-planner-datechange",6),this.kupPhaseDrop=i(this,"kup-planner-phasedrop",6),this.kupReady=i(this,"kup-planner-ready",6),this.kupContextMenu=i(this,"kup-planner-contextmenu",6),this.kupDidUnload=i(this,"kup-planner-didunload",6),H.add(this),this.state=new E,this.plannerRenderer=void 0,M.set(this,a()),P.set(this,void 0),W.set(this,[]),I.set(this,{}),R.set(this,void 0),this.stateId="",this.store=void 0,this.customStyle="",this.data=void 0,this.detailData=void 0,this.detailColorCol=void 0,this.detailColumns=void 0,this.detailDates=void 0,this.detailFilter=void 0,this.detailHeight=void 0,this.detailHours=[],this.detailIconCol=void 0,this.detailIdCol=void 0,this.detailNameCol=void 0,this.detailPrevHours=[],this.detailPrevDates=void 0,this.detailInitialScrollX=void 0,this.detailInitialScrollY=void 0,this.listCellWidth="300px",this.maxWidth="90vw",this.phaseColorCol=void 0,this.phaseColumns=void 0,this.phaseColParDep=void 0,this.phaseDates=void 0,this.phaseHours=[],this.phaseIconCol=void 0,this.phaseIdCol=void 0,this.phaseNameCol=void 0,this.phasePrevHours=[],this.phasePrevDates=void 0,this.readOnly=!1,this.showSecondaryDates=!1,this.taskColumns=void 0,this.taskDates=void 0,this.taskFilter=void 0,this.taskHeight=void 0,this.taskHours=[],this.taskIconCol=void 0,this.taskIdCol=void 0,this.taskInitialScrollX=void 0,this.taskInitialScrollY=void 0,this.taskNameCol=void 0,this.taskPrevHours=[],this.taskPrevDates=void 0,this.titleMess=void 0,this.viewMode="month",this.mainFilter=void 0,this.secondaryFilter=void 0,this.scrollableTaskList=!1,this.plannerProps=void 0}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);null!=t&&(it(this,M,"f").debug.logMessage(this,"Initializing stateId "+this.stateId),this.detailFilter=t.detailFilter,this.showSecondaryDates=t.showSecondaryDates,this.detailInitialScrollX=t.detailInitialScrollX,this.detailInitialScrollY=t.detailInitialScrollY,this.taskFilter=t.taskFilter,this.taskInitialScrollX=t.taskInitialScrollX,this.taskInitialScrollY=t.taskInitialScrollY,this.viewMode=t.viewMode)}}persistState(){if(this.store&&this.stateId){let t=!1;it(this,M,"f").objects.deepEqual(this.state.detailFilter,it(this,R,"f").detailFilter)||(this.state.detailFilter=it(this,R,"f").detailFilter,t=!0),it(this,M,"f").objects.deepEqual(this.state.showSecondaryDates,it(this,R,"f").showSecondaryDates)||(this.state.showSecondaryDates=it(this,R,"f").showSecondaryDates,t=!0),it(this,M,"f").objects.deepEqual(this.state.detailInitialScrollX,it(this,R,"f").detailInitialScrollX)||(this.state.detailInitialScrollX=it(this,R,"f").detailInitialScrollX,t=!0),it(this,M,"f").objects.deepEqual(this.state.detailInitialScrollY,it(this,R,"f").detailInitialScrollY)||(this.state.detailInitialScrollY=it(this,R,"f").detailInitialScrollY,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskFilter,it(this,R,"f").taskFilter)||(this.state.taskFilter=it(this,R,"f").taskFilter,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskInitialScrollX,it(this,R,"f").taskInitialScrollX)||(this.state.taskInitialScrollX=it(this,R,"f").taskInitialScrollX,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskInitialScrollY,it(this,R,"f").taskInitialScrollY)||(this.state.taskInitialScrollY=it(this,R,"f").taskInitialScrollY,t=!0),it(this,M,"f").objects.deepEqual(this.state.viewMode,it(this,R,"f").viewMode)||(this.state.viewMode=it(this,R,"f").viewMode,t=!0),t&&(it(this,M,"f").debug.logMessage(this,"Persisting stateId "+this.stateId),this.store.persistState(this.stateId,this.state))}}dataChanged(){st(this,I,{},"f")}async getProps(t){return l(this,k,t)}async refresh(){s(this),this.plannerRenderer.refresh()}async setProps(t){c(this,k,t)}async addPhases(t,i){var s;const h=it(this,H,"m",K).call(this,t);h&&(it(this,I,"f")[t]=i,h.phases=null===(s=i.rows)||void 0===s?void 0:s.filter((t=>C(t.cells[this.phaseDates[0]],t.cells[this.phaseDates[1]]))).map((t=>{const s=x(t.cells[this.phaseDates[0]],t.cells[this.phaseDates[1]],t.cells[this.phasePrevDates[0]],t.cells[this.phasePrevDates[1]],t.cells[this.phaseHours[0]],t.cells[this.phaseHours[1]],t.cells[this.phasePrevHours[0]],t.cells[this.phasePrevHours[1]]),e=T(t,this.phaseIdCol,this.phaseNameCol,i.columns,this.phaseColumns,(()=>this.phaseColumns.map((s=>s==this.phaseDates[0]?"#START#":s==this.phaseDates[1]?"#END#":r(i.columns.find((t=>t.name==s)),t.cells[s])))));let n=it(this,H,"m",$).call(this,t,this.phaseIconCol),o=it(this,H,"m",tt).call(this,t,this.phaseIconCol);return{taskRow:h.taskRow,phaseRow:t,id:h.id+"_"+t.cells[this.phaseIdCol].value,phaseRowId:t.id,taskRowId:h.taskRowId,name:t.cells[this.phaseNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"task",color:t.cells[this.phaseColorCol].value,selectedColor:t.cells[this.phaseColorCol].value,valuesToShow:e,rowType:p.PHASE,icon:n?{url:n,color:null!=o?o:"#595959"}:void 0,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]}}))),this.plannerProps.mainGantt.initialScrollX=it(this,R,"f").taskInitialScrollX,this.plannerProps.mainGantt.initialScrollY=it(this,R,"f").taskInitialScrollY,this.plannerProps.secondaryGantt&&(this.plannerProps.secondaryGantt.initialScrollX=it(this,R,"f").detailInitialScrollX,this.plannerProps.secondaryGantt.initialScrollX=it(this,R,"f").detailInitialScrollY),this.plannerProps=Object.assign({},this.plannerProps),this.refresh()}componentWillLoad(){it(this,M,"f").debug.logLoad(this,!1),it(this,M,"f").theme.register(this),this.initWithPersistedState(),st(this,R,{detailFilter:this.detailFilter,detailInitialScrollX:this.detailInitialScrollX,detailInitialScrollY:this.detailInitialScrollY,showSecondaryDates:this.showSecondaryDates,taskFilter:this.taskFilter,taskInitialScrollX:this.taskInitialScrollX,taskInitialScrollY:this.taskInitialScrollY,viewMode:this.viewMode},"f")}componentDidLoad(){let t=it(this,H,"m",Y).call(this,it(this,H,"m",Z).call(this,it(this,R,"f").detailFilter,!0));const i=this.rootElement.shadowRoot.querySelector("#main-filter");y(i);const s=this.rootElement.shadowRoot.querySelector("#secondary-filter");let h,e,n;t&&y(s),this.plannerProps={mainGantt:{title:this.titleMess,items:it(this,H,"m",V).call(this,it(this,H,"m",Z).call(this,it(this,R,"f").taskFilter,!1)),stylingOptions:Object.assign(Object.assign({},u),{listCellWidth:this.listCellWidth}),filter:i,hideLabel:!0,ganttHeight:this.taskHeight,showSecondaryDates:it(this,R,"f").showSecondaryDates,onClick:t=>this.handleOnClick(t),onDblClick:t=>this.handleOnDblClick(t),onContextMenu:(t,i)=>this.handleOnContextMenu(t,i),onDateChange:t=>this.handleOnDateChange(t),initialScrollX:this.taskInitialScrollX,initialScrollY:this.taskInitialScrollY,readOnly:this.readOnly,onScrollY:t=>{window.clearTimeout(e),e=window.setTimeout((()=>this.handleTaskGanttScrollY(t)),500)},onPhaseDrop:t=>this.handleOnPhaseDrop(t)},secondaryGantt:t?{title:"",items:t,stylingOptions:Object.assign(Object.assign({},u),{listCellWidth:this.listCellWidth}),filter:s,hideLabel:!0,ganttHeight:this.detailHeight,onClick:t=>this.handleOnClick(t),onContextMenu:(t,i)=>this.handleOnContextMenu(t,i),onDateChange:t=>this.handleOnDateChange(t),initialScrollX:this.detailInitialScrollX,initialScrollY:this.detailInitialScrollY,readOnly:this.readOnly,onScrollY:t=>{window.clearTimeout(n),n=window.setTimeout((()=>this.handleDetailGanttScrollY(t)),500)}}:void 0,onSetDoubleView:t=>this.handleOnSetDoubleView(t),onSetViewMode:t=>this.handleOnSetViewMode(t),viewMode:this.viewMode,scrollableTaskList:this.scrollableTaskList,onScrollX:t=>{window.clearTimeout(h),h=window.setTimeout((()=>this.handleOnScrollX(t)),500)}},this.kupReady.emit({comp:this,id:this.rootElement.id,value:void 0}),this.taskFilter&&it(this,H,"m",U).call(this,this.taskFilter),this.detailFilter&&it(this,H,"m",U).call(this,this.detailFilter,!0),it(this,M,"f").debug.logLoad(this,!0)}componentDidRender(){this.persistState(),it(this,M,"f").debug.logRender(this,!0)}onKupDblClick(t,i){this.kupDblClick.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupClick(t,i){this.kupClick.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupContextMenu(t,i,s){let h,e,n;switch(i.type){case"project":h=i.taskRow,e=h.cells[this.taskIdCol],n=this.data.columns[this.taskIdCol];break;case"task":h=i.phaseRow,e=h.cells[this.phaseIdCol];break;case"timeline":h=i.detailRow,e=h.cells[this.detailIdCol],n=this.data.columns[this.detailIdCol]}this.kupContextMenu.emit({comp:this,id:this.rootElement.id,value:i,taskAction:s,details:{cell:e,column:n,originalEvent:t,row:h}})}onKupDateChange(t,i){this.kupDateChange.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupPhaseDrop(t,i){this.kupPhaseDrop.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}handleOnDblClick(t){switch(t.rowType){case p.TASK:it(this,H,"m",G).call(this)&&this.onKupDblClick(t,m.onDblClick);break;case p.PHASE:it(this,H,"m",X).call(this)&&this.onKupDblClick(t,m.onDblClick);break;case p.DETAIL:it(this,H,"m",L).call(this)&&this.onKupDblClick(t,m.onDblClick)}for(let t=0;t<it(this,W,"f").length;t++)clearTimeout(it(this,W,"f")[t]),it(this,M,"f").debug.logMessage(this,"Cleared click timeout("+it(this,W,"f")[t]+").");st(this,W,[],"f")}handleOnClick(t){it(this,W,"f").push(setTimeout((()=>{switch(t.rowType){case p.TASK:const i=t.phases?m.onTaskClosing:m.onTaskOpening;it(this,H,"m",F).call(this,t)&&this.onKupClick(t,i);break;case p.PHASE:it(this,H,"m",N).call(this)&&this.onKupClick(t,m.onClick);break;case p.DETAIL:it(this,H,"m",_).call(this)&&this.onKupClick(t,m.onClick)}}),300))}handleOnContextMenu(t,i){switch(i.rowType){case p.TASK:it(this,H,"m",q).call(this)&&this.onKupContextMenu(t,i,m.onRightClick);break;case p.PHASE:it(this,H,"m",B).call(this)&&this.onKupContextMenu(t,i,m.onRightClick);break;case p.DETAIL:it(this,H,"m",J).call(this)&&this.onKupContextMenu(t,i,m.onRightClick)}}handleOnSetDoubleView(t){var i;it(this,R,"f").showSecondaryDates=t,(null===(i=this.plannerProps)||void 0===i?void 0:i.mainGantt)&&(this.plannerProps.mainGantt.showSecondaryDates=t),this.persistState()}handleOnSetViewMode(t){it(this,R,"f").viewMode=t,this.plannerProps.viewMode=t,this.persistState()}handleOnScrollX(t){it(this,R,"f").taskInitialScrollX=t,it(this,R,"f").detailInitialScrollX=t,this.persistState()}handleTaskGanttScrollY(t){it(this,R,"f").taskInitialScrollY=t,this.persistState()}handleDetailGanttScrollY(t){it(this,R,"f").detailInitialScrollY=t,this.persistState()}handleOnDateChange(t){it(this,H,"m",Q).call(this,t)&&t.rowType!=p.DETAIL&&this.onKupDateChange(t,m.onResize)}handleOnPhaseDrop(t){this.onKupPhaseDrop(t,m.onTask)}render(){var t,i,s;const n=this.plannerProps?Object.assign(Object.assign({},this.plannerProps),{onSetDoubleView:this.handleOnSetDoubleView.bind(this),onSetViewMode:this.handleOnSetViewMode.bind(this),onScrollX:this.handleOnScrollX.bind(this),mainGantt:Object.assign(Object.assign({},null===(t=this.plannerProps)||void 0===t?void 0:t.mainGantt),{onScrollY:this.handleTaskGanttScrollY.bind(this)})}):null;return(null===(i=this.plannerProps)||void 0===i?void 0:i.secondaryGantt)&&(n.secondaryGantt=Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{onScrollY:this.handleDetailGanttScrollY.bind(this)})),h(e,{key:"566acc19713e3e86dd7df82289970c2177d9ca64"},h("style",{key:"b963bc1a35ee326159dcfdba26d54b0363a6b24d"},it(this,M,"f").theme.setKupStyle(this.rootElement)),h("div",{key:"431b11c904af49b67400e33dd151eab1e662a2c9",id:w,style:{maxWidth:this.maxWidth}},this.plannerProps&&h("kup-planner-renderer",{key:"c3ea134d3afc42f6e1d3089dc65c251e2338febe",props:n,ref:t=>this.plannerRenderer=t})),h("div",{key:"43969a35e6a3ada36973257bcdb0081d560098e4",style:{display:this.plannerProps?"none":""}},h(g,{key:"c0a01be246cc6e28f2780fe57194b6e4c84ad194",icon:f.SEARCH,id:"main-filter",label:it(this,M,"f").language.translate(d.SEARCH),onKeyDown:t=>{"Enter"===t.key&&it(this,H,"m",U).call(this,t.target.value)},value:this.taskFilter,wrapperClass:"filter"}),(null===(s=this.detailData)||void 0===s?void 0:s.rows)&&this.detailData.rows.length>0?h(g,{icon:f.SEARCH,id:"secondary-filter",label:it(this,M,"f").language.translate(d.SEARCH),onKeyDown:t=>{"Enter"===t.key&&it(this,H,"m",U).call(this,t.target.value,!0)},value:this.detailFilter,wrapperClass:"filter"}):null))}disconnectedCallback(){it(this,M,"f").theme.unregister(this),this.kupDidUnload.emit({comp:this,id:this.rootElement.id,storedSettings:it(this,R,"f")})}get rootElement(){return n(this)}static get watchers(){return{data:["dataChanged"]}}};M=new WeakMap,P=new WeakMap,W=new WeakMap,I=new WeakMap,R=new WeakMap,H=new WeakSet,V=function(t){var i;return t&&t.rows?null===(i=t.rows)||void 0===i?void 0:i.filter((t=>C(t.cells[this.taskDates[0]],t.cells[this.taskDates[1]]))).map((i=>{const s=x(i.cells[this.taskDates[0]],i.cells[this.taskDates[1]],i.cells[this.taskPrevDates[0]],i.cells[this.taskPrevDates[1]],i.cells[this.taskHours[0]],i.cells[this.taskHours[1]],i.cells[this.taskPrevHours[0]],i.cells[this.taskPrevHours[1]]),h=T(i,this.taskIdCol,this.taskNameCol,t.columns,this.taskColumns,(()=>this.taskColumns.map((s=>s==this.taskDates[0]?"#START#":s==this.taskDates[1]?"#END#":r(t.columns.find((t=>t.name==s)),i.cells[s])))));let e=it(this,H,"m",$).call(this,i,this.taskIconCol),n=it(this,H,"m",tt).call(this,i,this.taskIconCol);return{taskRow:i,taskRowId:i.id,id:i.cells[this.taskIdCol].value,name:i.cells[this.taskNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"project",valuesToShow:h,rowType:p.TASK,icon:e?{url:e,color:null!=n?n:"#595959"}:void 0,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]}})):[]},Y=function(t){if(!t||!t.rows)return;let i=[];return t.rows.filter((t=>C(t.cells[this.detailDates[0]],t.cells[this.detailDates[1]]))).forEach((s=>{var h,e;const n=s.cells[this.detailIdCol].value,o=s.cells[this.detailNameCol].value,a=x(s.cells[this.detailDates[0]],s.cells[this.detailDates[1]],void 0,void 0,s.cells[this.detailHours[0]],s.cells[this.detailHours[1]]),r=T(s,this.detailIdCol,this.detailNameCol,t.columns,this.detailColumns);let l=i.find((t=>t.id==n));l||(l={id:n,name:o,detailRow:s,type:"timeline",valuesToShow:r,rowType:p.DETAIL,schedule:[]},i.push(l));let c=it(this,H,"m",$).call(this,s,this.detailIconCol),f=it(this,H,"m",tt).call(this,s,this.detailIconCol);l.schedule.push({startDate:a.dateValues[0],endDate:a.dateValues[1],color:this.detailColorCol&&null!==(h=s.cells[this.detailColorCol].value)&&void 0!==h?h:"#D9D9D8",selectedColor:this.detailColorCol&&null!==(e=s.cells[this.detailColorCol].value)&&void 0!==e?e:"#D9D9D8",icon:c?{url:c,color:null!=f?f:"#595959"}:void 0,startHour:a.hourValues[0],endHour:a.hourValues[1]})})),i},K=function(t){return this.plannerProps.mainGantt.items.find((i=>i.id==t))},A=function(t){const i=it(this,H,"m",K).call(this,t);i&&(i.phases=void 0),this.plannerProps=Object.assign({},this.plannerProps)},G=function(){return!0},X=function(){return!0},L=function(){return!0},F=function(t){const i=it(this,H,"m",K).call(this,t.id);return(null==i?void 0:i.phases)&&it(this,H,"m",A).call(this,i.id),!0},N=function(){return!0},_=function(){return!0},q=function(){return!0},B=function(){return!0},J=function(){return!0},Q=function(t){let i=!1;return it(this,P,"f")?it(this,P,"f").isEquivalent(t)||(st(this,P,new v(t),"f"),i=!0):(i=!0,st(this,P,new v(t),"f")),i},U=function(t,i){i?it(this,R,"f").detailFilter=t:it(this,R,"f").taskFilter=t;const s=i?{secondaryGantt:Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{items:it(this,H,"m",Y).call(this,it(this,H,"m",Z).call(this,t,i))})}:{mainGantt:Object.assign(Object.assign({},this.plannerProps.mainGantt),{items:it(this,H,"m",V).call(this,it(this,H,"m",Z).call(this,t,i))})};this.plannerProps=Object.assign(Object.assign({},this.plannerProps),s),this.persistState()},Z=function(t,i){const s=i?this.detailData:this.data;if(!s||!s.rows||0==s.rows.length)return;if(!t)return s;const h={columns:this.data.columns,rows:[]},e=[];for(let i=0;i<s.rows.length;i++){const h=s.rows[i],n=h.cells;for(let i=0;i<s.columns.length;i++){const o=n[s.columns[i].name];if(o&&r(s.columns[i],o).toLowerCase().indexOf(t.toLowerCase())>-1){e.push({row:h,weight:i});break}}}return e.sort(((t,i)=>t.weight-i.weight)).forEach((t=>{h.rows.push(t.row)})),h},$=function(t,i){var s;let h;if(i){const e=t.cells[i];let n=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.resource;n||(n=e.value),n&&(h=o("./assets/svg/"+n+".svg"))}return h},tt=function(t,i){var s;let h;if(i){const e=t.cells[i];h=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.color,h&&(h=it(this,M,"f").theme.colorCheck(h).hexColor)}return h},ht.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size: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}";export{ht as kup_planner}
@@ -1 +1 @@
1
- import{r as o,c as i,f as r,h as t,H as e,d as a}from"./p-b0368f88.js";import{k as n,a as c,g as p,s as d,d as s,b as l}from"./p-728d11e3.js";import{F as h}from"./p-b120abd7.js";import{c as u}from"./p-635bb4b3.js";import{M as m}from"./p-c56195a0.js";import"./p-1ee561ba.js";var f;!function(o){o.customStyle="Custom style of the component. For more information: https://smeup.github.io/ketchup/#/customization",o.data="Data of the accordion.",o.ripple="When enabled displays Material's ripple effect on item headers."}(f||(f={}));const _=class{constructor(r){o(this,r),this.kupAccordionItemSelected=i(this,"kup-accordion-itemselected",6),this.kupManager=n(),this.slotsNames=[],this.selectedItems=[],this.customStyle="",this.data=null,this.ripple=!1,this.sizing=c.SMALL}applyRipple(){const o=this.rootElement.shadowRoot;if(o&&this.ripple){const i=o.querySelectorAll(".mdc-ripple-surface:not(.mdc-ripple-upgraded)");if(i)for(let o=0;o<i.length;o++)m.attachTo(i[o])}}async collapseAll(){const o=[];for(let i=0;i<this.data.columns.length;i++){const r=this.data.columns[i].name;!this.isItemExpandible(r)&&this.isItemSelected(r)&&o.push(r)}this.selectedItems=o}async expandAll(){const o=[];for(let i=0;i<this.data.columns.length;i++){const r=this.data.columns[i].name;this.isItemExpandible(r)&&o.push(r)}this.selectedItems=o}async getProps(o){return p(this,f,o)}async refresh(){r(this)}async setProps(o){d(this,f,o)}async toggleItem(o){const i=this.isItemExpandible(o),r=[...this.selectedItems];r.includes(o)?r.splice(r.indexOf(o),1):r.push(o),this.selectedItems=r,i||this.kupAccordionItemSelected.emit({comp:this,id:this.rootElement.id,itemName:o})}isItemExpandible(o){return this.slotsNames.includes(o)}isItemSelected(o){return this.selectedItems.includes(o)}renderItems(){const o=[],i=Array.prototype.slice.call(this.rootElement.children,0);this.slotsNames=[];for(let o=0;o<i.length;o++)this.slotsNames.push(i[o].slot);for(let i=0;i<this.data.columns.length;i++){const r=this.data.columns[i],e=r.name,a=this.isItemSelected(e),n=this.isItemExpandible(e),c={"accordion-item__content":!0,"accordion-item__content--selected":!!a};o.push(t("div",{class:"accordion-item"},t("div",{tabindex:"1",title:r.title,class:{"accordion-item__header":!0,"accordion-item__header--selected":!(n||!a),"accordion-item__header--expanded":!(!n||!a),"mdc-ripple-surface":!!this.ripple,[`accordion-item--${this.sizing}`]:!!this.sizing},onClick:()=>this.toggleItem(e)},r.icon?t(h,{color:`var(${s.ICON})`,resource:r.icon,sizeX:"1.5em",sizeY:"1.5em",wrapperClass:"accordion-item__icon"}):null,t("span",{class:"accordion-item__text"},r.title),n?t("span",{class:`accordion-item__dropdown kup-icon ${l.DROPDOWN.replace("--","")}`}):null),t("div",{class:c},t("slot",{name:r.name}))))}return o}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.applyRipple(),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const o=this.rootElement.shadowRoot;if(o){const i=o.querySelectorAll(".mdc-ripple-surface");if(i)for(let o=0;o<i.length;o++)m.attachTo(i[o])}this.kupManager.debug.logRender(this,!0)}render(){const o=this.data&&this.data.columns?this.renderItems():null;return t(e,{key:"e833d2f12eaadc0a52bbfa292e29c92e3a7d737c"},t("style",{key:"93b4315cd2a0f9834ec9f4cf70c0c2cf6baf91cb"},this.kupManager.theme.setKupStyle(this.rootElement)),t("div",{key:"a9cbd70c8e08f1b00cdee843c8b34540e49a7541",id:u},t("div",{key:"9ddf2bd8d16f97c3004948e31dcd2bb17ee155b6",class:"accordion"},o)))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return a(this)}static get watchers(){return{ripple:["applyRipple"]}}};_.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size: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{--kup_accordion_border_top_color:var(\n --kup-accordion-border-top-color,\n var(--kup-border-subtle)\n );--kup_accordion_item_small_height:var(\n --kup-accordion-item-small-height,\n 32px\n );--kup_accordion_item_medium_height:var(\n --kup-accordion-item-medium-height,\n 40px\n );--kup_accordion_item_outline_color_active:var(\n --kup-accordion-item-outline-color-focus,\n var(--kup-border-interactive)\n );--kup_accordion_item_large_height:var(\n --kup-accordion-item-medium-height,\n 48px\n );--kup_accordion_header_background_color:var(\n --kup-accordion-header-background-color,\n var(--kup-layer-0)\n );--kup_accordion_header_background_color_hover:var(\n --kup-accordion-header-background-color-hover,\n var(--kup-layer-0-hover)\n );--kup_accordion_header_padding:var(\n --kup-accordion-header-padding,\n var(--kup-space-05)\n );--kup_accordion_dropdown_icon_color:var(\n --kup-accordio-dropdown-icon-color,\n var(--kup-text-primary)\n );--kup_accordion_transition:var(--kup-accordion-transition, 80ms);display:block;font-family:var(--kup_accordion_font_family);font-size:var(--kup_accordion_font_size)}.accordion{border-radius:var(--kup_accordion_border_radius);display:flex;flex-wrap:wrap;flex-direction:column;width:100%}.accordion-item{border-top:1px solid var(--kup_accordion_border_top_color);box-sizing:border-box;width:100%}.accordion-item--visible{display:block}.accordion-item:is(:last-of-type){border-bottom:1px solid var(--kup_accordion_border_top_color)}.accordion-item__header{height:var(--kup_accordion_item_medium_height);align-items:center;border:none;box-sizing:border-box;color:var(--kup_accordion_text_color);cursor:pointer;display:flex;line-height:1.75em;outline:none;padding:var(--kup_accordion_padding);text-align:left;transition:background-color var(--kup_accordion_transition), color var(--kup_accordion_transition);width:100%;outline:2px solid transparent;outline-offset:-2px;padding-left:16px;padding-right:16px}.accordion-item__header:focus{outline:2px solid var(--kup_accordion_item_outline_color_active)}.accordion-item__header.accordion-item--small{height:var(--kup_accordion_item_small_height)}.accordion-item__header.accordion-item--large{height:var(--kup_accordion_item_large_height)}.accordion-item__header:hover:not(.accordion-item__header--selected){background-color:var(--kup_accordion_header_background_color_hover)}.accordion-item__header:focus(.accordion-item__header--selected){outline:2px solid var(--kup_accordion_item_outline_color_active)}.accordion-item__header--expanded{background-color:var(--kup_accordion_background_color)}.accordion-item__header--expanded .accordion-item__dropdown{transform:rotate(-180deg)}.accordion-item__text{margin-right:0.5em;overflow:hidden;text-overflow:ellipsis;white-space:pre}.accordion-item__text--highlighted{color:var(--kup_accordion_text_on_primary_color);background-color:var(--kup_accordion_primary_color)}.accordion-item__icon{margin-left:0;margin-right:0.5em}.accordion-item__dropdown{background-color:var(--kup_accordion_dropdown_icon_color);height:1.5em;margin-left:auto;margin-right:0;min-width:1.5em;width:1.5em;transition:transform var(--kup_accordion_transition)}.accordion-item__content{padding-left:16px;padding-top:8px;padding-bottom:24px;padding-right:80px;animation:fade-in 0.25s ease-out;display:none;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}.accordion-item__content--selected{display:block}.mdc-ripple-surface{--mdc-ripple-fg-opacity:0.24}.mdc-ripple-surface:before,.mdc-ripple-surface:after{background-color:var(--kup_accordion_primary_color)}.kup-icon.kup-dropdown-icon{-webkit-mask:var(--kup-dropdown-icon);mask:var(--kup-dropdown-icon)}:host(.kup-borderless){--kup-accordion-border:none}:host(.kup-full-height){height:100%}:host(.kup-full-width){width:100%}:host(.kup-danger){--kup-accordion-primary-color:var(--kup-danger-color-60);--kup-accordion-primary-color-rgb:var(--kup-danger-color-60-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-info){--kup-accordion-primary-color:var(--kup-info-50-color);--kup-accordion-primary-color-rgb:var(--kup-info-color-50-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-secondary){--kup-accordion-primary-color:var(--kup-secondary-color);--kup-accordion-primary-color-rgb:var(--kup-secondary-color-rgb);--kup-accordion-text-on-primary-color:var(--kup-text-on-secondary-color)}:host(.kup-success){--kup-accordion-primary-color:var(--kup-success-color-40);--kup-accordion-primary-color-rgb:var(--kup-success-color-40-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-warning){--kup-accordion-primary-color:var(--kup-warning-color-50);--kup-accordion-primary-color-rgb:var(--kup-warning-color-50-rgb);--kup-accordion-text-on-primary-color:white}";export{_ as kup_accordion}
1
+ import{r as o,c as i,f as r,h as t,H as e,d as a}from"./p-b0368f88.js";import{k as n,a as c,g as p,s as d,d as s,b as l}from"./p-85e39883.js";import{F as h}from"./p-b120abd7.js";import{c as u}from"./p-635bb4b3.js";import{M as m}from"./p-c56195a0.js";import"./p-1ee561ba.js";var f;!function(o){o.customStyle="Custom style of the component. For more information: https://smeup.github.io/ketchup/#/customization",o.data="Data of the accordion.",o.ripple="When enabled displays Material's ripple effect on item headers."}(f||(f={}));const _=class{constructor(r){o(this,r),this.kupAccordionItemSelected=i(this,"kup-accordion-itemselected",6),this.kupManager=n(),this.slotsNames=[],this.selectedItems=[],this.customStyle="",this.data=null,this.ripple=!1,this.sizing=c.SMALL}applyRipple(){const o=this.rootElement.shadowRoot;if(o&&this.ripple){const i=o.querySelectorAll(".mdc-ripple-surface:not(.mdc-ripple-upgraded)");if(i)for(let o=0;o<i.length;o++)m.attachTo(i[o])}}async collapseAll(){const o=[];for(let i=0;i<this.data.columns.length;i++){const r=this.data.columns[i].name;!this.isItemExpandible(r)&&this.isItemSelected(r)&&o.push(r)}this.selectedItems=o}async expandAll(){const o=[];for(let i=0;i<this.data.columns.length;i++){const r=this.data.columns[i].name;this.isItemExpandible(r)&&o.push(r)}this.selectedItems=o}async getProps(o){return p(this,f,o)}async refresh(){r(this)}async setProps(o){d(this,f,o)}async toggleItem(o){const i=this.isItemExpandible(o),r=[...this.selectedItems];r.includes(o)?r.splice(r.indexOf(o),1):r.push(o),this.selectedItems=r,i||this.kupAccordionItemSelected.emit({comp:this,id:this.rootElement.id,itemName:o})}isItemExpandible(o){return this.slotsNames.includes(o)}isItemSelected(o){return this.selectedItems.includes(o)}renderItems(){const o=[],i=Array.prototype.slice.call(this.rootElement.children,0);this.slotsNames=[];for(let o=0;o<i.length;o++)this.slotsNames.push(i[o].slot);for(let i=0;i<this.data.columns.length;i++){const r=this.data.columns[i],e=r.name,a=this.isItemSelected(e),n=this.isItemExpandible(e),c={"accordion-item__content":!0,"accordion-item__content--selected":!!a};o.push(t("div",{class:"accordion-item"},t("div",{tabindex:"1",title:r.title,class:{"accordion-item__header":!0,"accordion-item__header--selected":!(n||!a),"accordion-item__header--expanded":!(!n||!a),"mdc-ripple-surface":!!this.ripple,[`accordion-item--${this.sizing}`]:!!this.sizing},onClick:()=>this.toggleItem(e)},r.icon?t(h,{color:`var(${s.ICON})`,resource:r.icon,sizeX:"1.5em",sizeY:"1.5em",wrapperClass:"accordion-item__icon"}):null,t("span",{class:"accordion-item__text"},r.title),n?t("span",{class:`accordion-item__dropdown kup-icon ${l.DROPDOWN.replace("--","")}`}):null),t("div",{class:c},t("slot",{name:r.name}))))}return o}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.applyRipple(),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const o=this.rootElement.shadowRoot;if(o){const i=o.querySelectorAll(".mdc-ripple-surface");if(i)for(let o=0;o<i.length;o++)m.attachTo(i[o])}this.kupManager.debug.logRender(this,!0)}render(){const o=this.data&&this.data.columns?this.renderItems():null;return t(e,{key:"e833d2f12eaadc0a52bbfa292e29c92e3a7d737c"},t("style",{key:"93b4315cd2a0f9834ec9f4cf70c0c2cf6baf91cb"},this.kupManager.theme.setKupStyle(this.rootElement)),t("div",{key:"a9cbd70c8e08f1b00cdee843c8b34540e49a7541",id:u},t("div",{key:"9ddf2bd8d16f97c3004948e31dcd2bb17ee155b6",class:"accordion"},o)))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return a(this)}static get watchers(){return{ripple:["applyRipple"]}}};_.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size: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{--kup_accordion_border_top_color:var(\n --kup-accordion-border-top-color,\n var(--kup-border-subtle)\n );--kup_accordion_item_small_height:var(\n --kup-accordion-item-small-height,\n 32px\n );--kup_accordion_item_medium_height:var(\n --kup-accordion-item-medium-height,\n 40px\n );--kup_accordion_item_outline_color_active:var(\n --kup-accordion-item-outline-color-focus,\n var(--kup-border-interactive)\n );--kup_accordion_item_large_height:var(\n --kup-accordion-item-medium-height,\n 48px\n );--kup_accordion_header_background_color:var(\n --kup-accordion-header-background-color,\n var(--kup-layer-0)\n );--kup_accordion_header_background_color_hover:var(\n --kup-accordion-header-background-color-hover,\n var(--kup-layer-0-hover)\n );--kup_accordion_header_padding:var(\n --kup-accordion-header-padding,\n var(--kup-space-05)\n );--kup_accordion_dropdown_icon_color:var(\n --kup-accordio-dropdown-icon-color,\n var(--kup-text-primary)\n );--kup_accordion_transition:var(--kup-accordion-transition, 80ms);display:block;font-family:var(--kup_accordion_font_family);font-size:var(--kup_accordion_font_size)}.accordion{border-radius:var(--kup_accordion_border_radius);display:flex;flex-wrap:wrap;flex-direction:column;width:100%}.accordion-item{border-top:1px solid var(--kup_accordion_border_top_color);box-sizing:border-box;width:100%}.accordion-item--visible{display:block}.accordion-item:is(:last-of-type){border-bottom:1px solid var(--kup_accordion_border_top_color)}.accordion-item__header{height:var(--kup_accordion_item_medium_height);align-items:center;border:none;box-sizing:border-box;color:var(--kup_accordion_text_color);cursor:pointer;display:flex;line-height:1.75em;outline:none;padding:var(--kup_accordion_padding);text-align:left;transition:background-color var(--kup_accordion_transition), color var(--kup_accordion_transition);width:100%;outline:2px solid transparent;outline-offset:-2px;padding-left:16px;padding-right:16px}.accordion-item__header:focus{outline:2px solid var(--kup_accordion_item_outline_color_active)}.accordion-item__header.accordion-item--small{height:var(--kup_accordion_item_small_height)}.accordion-item__header.accordion-item--large{height:var(--kup_accordion_item_large_height)}.accordion-item__header:hover:not(.accordion-item__header--selected){background-color:var(--kup_accordion_header_background_color_hover)}.accordion-item__header:focus(.accordion-item__header--selected){outline:2px solid var(--kup_accordion_item_outline_color_active)}.accordion-item__header--expanded{background-color:var(--kup_accordion_background_color)}.accordion-item__header--expanded .accordion-item__dropdown{transform:rotate(-180deg)}.accordion-item__text{margin-right:0.5em;overflow:hidden;text-overflow:ellipsis;white-space:pre}.accordion-item__text--highlighted{color:var(--kup_accordion_text_on_primary_color);background-color:var(--kup_accordion_primary_color)}.accordion-item__icon{margin-left:0;margin-right:0.5em}.accordion-item__dropdown{background-color:var(--kup_accordion_dropdown_icon_color);height:1.5em;margin-left:auto;margin-right:0;min-width:1.5em;width:1.5em;transition:transform var(--kup_accordion_transition)}.accordion-item__content{padding-left:16px;padding-top:8px;padding-bottom:24px;padding-right:80px;animation:fade-in 0.25s ease-out;display:none;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}.accordion-item__content--selected{display:block}.mdc-ripple-surface{--mdc-ripple-fg-opacity:0.24}.mdc-ripple-surface:before,.mdc-ripple-surface:after{background-color:var(--kup_accordion_primary_color)}.kup-icon.kup-dropdown-icon{-webkit-mask:var(--kup-dropdown-icon);mask:var(--kup-dropdown-icon)}:host(.kup-borderless){--kup-accordion-border:none}:host(.kup-full-height){height:100%}:host(.kup-full-width){width:100%}:host(.kup-danger){--kup-accordion-primary-color:var(--kup-danger-color-60);--kup-accordion-primary-color-rgb:var(--kup-danger-color-60-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-info){--kup-accordion-primary-color:var(--kup-info-50-color);--kup-accordion-primary-color-rgb:var(--kup-info-color-50-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-secondary){--kup-accordion-primary-color:var(--kup-secondary-color);--kup-accordion-primary-color-rgb:var(--kup-secondary-color-rgb);--kup-accordion-text-on-primary-color:var(--kup-text-on-secondary-color)}:host(.kup-success){--kup-accordion-primary-color:var(--kup-success-color-40);--kup-accordion-primary-color-rgb:var(--kup-success-color-40-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-warning){--kup-accordion-primary-color:var(--kup-warning-color-50);--kup-accordion-primary-color-rgb:var(--kup-warning-color-50-rgb);--kup-accordion-text-on-primary-color:white}";export{_ as kup_accordion}
@@ -1,4 +1,4 @@
1
- import{r as t,c as n,f as i,h as r,H as e,d as o,g as a}from"./p-b0368f88.js";import{k as s,g as u,s as l,d as f,e as h,v as c,o as v}from"./p-728d11e3.js";import{c as d}from"./p-635bb4b3.js";import"./p-1ee561ba.js";
1
+ import{r as t,c as n,f as i,h as r,H as e,d as o,g as a}from"./p-b0368f88.js";import{k as s,g as u,s as l,d as f,e as h,v as c,o as v}from"./p-85e39883.js";import{c as d}from"./p-635bb4b3.js";import"./p-1ee561ba.js";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -1 +1 @@
1
- import{r as t,c as e,f as i,h as a,H as l,d as r}from"./p-b0368f88.js";import{F as o}from"./p-d39c3267.js";import{a as n}from"./p-e3062c19.js";import{F as s}from"./p-b120abd7.js";import{k as f,g as _,s as p,h as m,Q as h}from"./p-728d11e3.js";import{c}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var u;!function(t){t.autofitOnExpand="The component will autofit everytime a node is expanded.",t.autofitOnLoad="The component's initial render will fit the container by invoking the runAutofit method.",t.cardData="Used to render the family tree boxes as kup-cards (through kup-box).",t.collapsible="Nodes can be expanded/collapsed.",t.customStyle="Custom style of the component.",t.data="Actual data of the component",t.layout="Layout of the boxes.",t.stackedLeaves="Child nodes that have no children are arranged vertically."}(u||(u={}));var d,y,k,g,v,x,b,w,z,j,C,E,T,W,M,S,D,L,O,P,R,A,F,X,Y,H=function(t,e,i,a){if("a"===i&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?a:"a"===i?a.call(t):a?a.value:e.get(t)},$=function(t,e,i,a,l){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!l:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?l.call(t,i):l?l.value=i:e.set(t,i),i};const B=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),k.set(this,!1),g.set(this,0),v.set(this,0),x.set(this,[]),b.set(this,f()),w.set(this,(t=>{const e=t.clientX-H(this,g,"f"),i=t.clientY-H(this,v,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,g,t.clientX,"f"),$(this,v,t.clientY,"f")})),z.set(this,!1),j.set(this,null),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1}async collapseAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return _(this,u,t)}async refresh(){i(this)}async runAutofit(){const t=H(this,j,"f").clientWidth,e=H(this,j,"f").children[0].clientWidth,i=.01,a=.85*t,l=.95*t;let r=1,o=2e3,n=e;for(;(n<a||n>l)&&o>0&&r>i;)o--,n<a?r+=i:n>l?r-=i:o=0,n=e*r;H(this,j,"f").style.setProperty("--kup_familytree_scale",r<=1?r.toFixed(2):"1")}async setProps(t){p(this,u,t)}componentWillLoad(){H(this,b,"f").debug.logLoad(this,!1),H(this,b,"f").language.register(this),H(this,b,"f").theme.register(this)}componentDidLoad(){H(this,d,"m",X).call(this),this.autofitOnLoad&&this.runAutofit(),H(this,b,"f").debug.logLoad(this,!0)}componentWillRender(){H(this,b,"f").debug.logRender(this,!1)}componentDidRender(){H(this,z,"f")&&($(this,z,!1,"f"),this.runAutofit()),H(this,b,"f").debug.logRender(this,!0)}render(){return a(l,{key:"09a067148b3438469a9773c276c6aaddecda73fa",onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),H(this,d,"m",O).call(this,t)},onWheel:t=>{H(this,d,"m",Y).call(this,t)}},a("style",{key:"dbae8f187ff51f8168d4df72de2ba563ef7a9d7c"},H(this,b,"f").theme.setKupStyle(this.rootElement)),a("div",{key:"cf23802e9e58e68d0c89ee7fdd13fde331a04705",id:c},H(this,d,"m",D).call(this)))}disconnectedCallback(){H(this,b,"f").language.unregister(this),H(this,b,"f").theme.unregister(this)}get rootElement(){return r(this)}};y=new WeakMap,k=new WeakMap,g=new WeakMap,v=new WeakMap,x=new WeakMap,b=new WeakMap,w=new WeakMap,z=new WeakMap,j=new WeakMap,d=new WeakSet,C=function(t,e,i,l){const r=[];return r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},a("div",{class:"family-tree__line--placeholder"}))),r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||l&&!e}},a("div",{class:"family-tree__line--placeholder"}))),r},E=function t(e){var i;let l=null,r=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(r||(r=[]),r.push(t)):(l||(l=[]),l.push(t))})));const s=this.stackedLeaves&&l&&l.every((t=>!t.children||0==t.children.length)),f=l?2*l.length:1,_={"family-tree__line":!0,"family-tree__line--placeholder":!(!l&&!r),"family-tree__line--vertical":!(!l&&!r)},p={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},h=e.layout||this.layout||1,c={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:n.OUTLINED,title:`${H(this,b,"f").language.translate(m.EXPAND)}/${H(this,b,"f").language.translate(m.COLLAPSE)} (CTRL + Click)`,onClick:t=>{t.ctrlKey&&e.children&&e.children.length>0&&(e.isExpanded?this.collapseAll(e.children):this.expandAll(e.children)),e.isExpanded=!e.isExpanded,this.autofitOnExpand&&$(this,z,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let u=null;H(this,d,"m",L).call(this,h)&&(u=a("kup-box",{class:"kup-borderless kup-paddingless",customStyle:"#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }",data:p,cardData:this.cardData,layout:this.cardData?null:h,showSelection:!1}));const y=a("div",{class:"family-tree__item"},a("div",{class:"family-tree__item__wrapper"},H(this,d,"m",L).call(this,h)?u:H(this,d,"m",T).call(this,e,h),this.collapsible&&e.children&&e.children.length>0?a(o,Object.assign({},c)):void 0)),k={"--kup_familytree_staffchildren":(null==r?void 0:r.length.toString())||"0"};return a("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},a("tr",null,a("td",{"data-row":e,colSpan:f},y)),a("tr",null,a("td",{colSpan:f},a("div",{class:_}))),r?[a("tr",null,a("td",{colSpan:f},a("div",{class:Object.assign(Object.assign({},_),{"family-tree__line--staff":!0}),style:k}),a("div",{class:"family-tree__node__staff",style:k},r.map((e=>[a("div",{class:"family-tree__node__staff__item"},H(this,d,"m",t).call(this,e))])))))]:null,r&&l?[a("tr",null,a("td",{colSpan:f},a("div",{class:_})))]:null,l?[a("tr",null,s?a("td",{colSpan:f},a("div",{class:_})):l.map((t=>H(this,d,"m",C).call(this,0==l.indexOf(t),l.indexOf(t)==l.length-1,1==l.length,l.length>2)))),a("tr",null,s?a("td",{colSpan:f},l.map((e=>H(this,d,"m",t).call(this,e)))):l.map((e=>a("td",{colSpan:2},H(this,d,"m",t).call(this,e)))))]:void 0)},T=function(t,e){return 2===e?H(this,d,"m",M).call(this,t):H(this,d,"m",W).call(this,t)},W=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--1"},a("div",{class:"family-tree__item__layout__text__title"},t.value))},M=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--2"},a("div",{class:"family-tree__item__layout__color"}),a("div",{class:"family-tree__item__layout__image"},a(s,{resource:t.icon,placeholderResource:t.placeholderIcon,sizeX:"48px",sizeY:"48px"})),a("div",{class:"family-tree__item__layout__text"},a("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?a("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},S=function(t){return t.map((t=>H(this,d,"m",E).call(this,t)))},D=function(){return a("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,j,t,"f")},this.data&&this.data.rows&&this.data.rows.length?H(this,d,"m",S).call(this,this.data.rows):a("div",null,H(this,b,"f").language.translate(m.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){$(this,g,t.clientX,"f"),$(this,v,t.clientY,"f"),H(this,j,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",H(this,w,"f")),document.removeEventListener("pointerup",e),H(this,j,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",H(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t,e){let i,a;if(t)for(let e=t.length-1;e>=0;e--){const l=t[e];l.tagName&&(l.classList.contains("family-tree__item__expand")&&(i=l),"TD"===l.tagName.toUpperCase())&&(a=l)}let l=null,r=null,o=null;return a&&(l=a["data-cell"],r=a["data-column"],o=a["data-row"]),{cell:l||null,column:r||null,expandButton:i||null,originalEvent:e,row:o||null,td:a||null}},R=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},A=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},F=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},X=function(){H(this,x,"f").push(this.rootElement),H(this,b,"f").interact.on(this.rootElement,h.TAP,(t=>{if(H(this,k,"f"))$(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];H(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",R).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.DOUBLETAP,(t=>{if(0===t.button){for(let t=0;t<H(this,y,"f").length;t++)clearTimeout(H(this,y,"f")[t]),H(this,b,"f").debug.logMessage(this,"Cleared clickHandler timeout("+H(this,y,"f")[t]+").");$(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||($(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,t)}))}))},Y=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(H(this,j,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let a=t.deltaY>0?e-i:e+i;a<i&&(a=i),H(this,j,"f").style.setProperty("--kup_familytree_scale",a.toFixed(2))}},B.style='.kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size: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{--kup_familytree_item_background_color:var(\n --kup-layer-1,\n var(--kup-layer-1)\n );--kup_familytree_border_color:var(\n --kup-familytree-border-color,\n var(--kup-info-color-50)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 80px);--kup_familytree_item_h_padding:var(\n --kup-familytree-item-h-padding,\n var(--kup-space-03)\n );--kup_familytree_item_v_padding:var(\n --kup-familytree-item-v-padding,\n var(--kup-space-03)\n );--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-subtle)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc((var(--kup_familytree_item_width) + var(--kup_familytree_item_h_padding) * 2) / 2)) translateY(calc(0px - (var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:"";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc(var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);box-sizing:border-box;display:flex;height:var(--kup_familytree_item_height);margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup_familytree_border_color);height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto var(--kup-space-03)}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';export{B as kup_family_tree}
1
+ import{r as t,c as e,f as i,h as a,H as l,d as r}from"./p-b0368f88.js";import{F as o}from"./p-d39c3267.js";import{a as n}from"./p-e3062c19.js";import{F as s}from"./p-b120abd7.js";import{k as f,g as _,s as p,h as m,Q as h}from"./p-85e39883.js";import{c}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var u;!function(t){t.autofitOnExpand="The component will autofit everytime a node is expanded.",t.autofitOnLoad="The component's initial render will fit the container by invoking the runAutofit method.",t.cardData="Used to render the family tree boxes as kup-cards (through kup-box).",t.collapsible="Nodes can be expanded/collapsed.",t.customStyle="Custom style of the component.",t.data="Actual data of the component",t.layout="Layout of the boxes.",t.stackedLeaves="Child nodes that have no children are arranged vertically."}(u||(u={}));var d,y,k,g,v,x,b,w,z,j,C,E,T,W,M,S,D,L,O,P,R,A,F,X,Y,H=function(t,e,i,a){if("a"===i&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?a:"a"===i?a.call(t):a?a.value:e.get(t)},$=function(t,e,i,a,l){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!l:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?l.call(t,i):l?l.value=i:e.set(t,i),i};const B=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),k.set(this,!1),g.set(this,0),v.set(this,0),x.set(this,[]),b.set(this,f()),w.set(this,(t=>{const e=t.clientX-H(this,g,"f"),i=t.clientY-H(this,v,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,g,t.clientX,"f"),$(this,v,t.clientY,"f")})),z.set(this,!1),j.set(this,null),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1}async collapseAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return _(this,u,t)}async refresh(){i(this)}async runAutofit(){const t=H(this,j,"f").clientWidth,e=H(this,j,"f").children[0].clientWidth,i=.01,a=.85*t,l=.95*t;let r=1,o=2e3,n=e;for(;(n<a||n>l)&&o>0&&r>i;)o--,n<a?r+=i:n>l?r-=i:o=0,n=e*r;H(this,j,"f").style.setProperty("--kup_familytree_scale",r<=1?r.toFixed(2):"1")}async setProps(t){p(this,u,t)}componentWillLoad(){H(this,b,"f").debug.logLoad(this,!1),H(this,b,"f").language.register(this),H(this,b,"f").theme.register(this)}componentDidLoad(){H(this,d,"m",X).call(this),this.autofitOnLoad&&this.runAutofit(),H(this,b,"f").debug.logLoad(this,!0)}componentWillRender(){H(this,b,"f").debug.logRender(this,!1)}componentDidRender(){H(this,z,"f")&&($(this,z,!1,"f"),this.runAutofit()),H(this,b,"f").debug.logRender(this,!0)}render(){return a(l,{key:"09a067148b3438469a9773c276c6aaddecda73fa",onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),H(this,d,"m",O).call(this,t)},onWheel:t=>{H(this,d,"m",Y).call(this,t)}},a("style",{key:"dbae8f187ff51f8168d4df72de2ba563ef7a9d7c"},H(this,b,"f").theme.setKupStyle(this.rootElement)),a("div",{key:"cf23802e9e58e68d0c89ee7fdd13fde331a04705",id:c},H(this,d,"m",D).call(this)))}disconnectedCallback(){H(this,b,"f").language.unregister(this),H(this,b,"f").theme.unregister(this)}get rootElement(){return r(this)}};y=new WeakMap,k=new WeakMap,g=new WeakMap,v=new WeakMap,x=new WeakMap,b=new WeakMap,w=new WeakMap,z=new WeakMap,j=new WeakMap,d=new WeakSet,C=function(t,e,i,l){const r=[];return r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},a("div",{class:"family-tree__line--placeholder"}))),r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||l&&!e}},a("div",{class:"family-tree__line--placeholder"}))),r},E=function t(e){var i;let l=null,r=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(r||(r=[]),r.push(t)):(l||(l=[]),l.push(t))})));const s=this.stackedLeaves&&l&&l.every((t=>!t.children||0==t.children.length)),f=l?2*l.length:1,_={"family-tree__line":!0,"family-tree__line--placeholder":!(!l&&!r),"family-tree__line--vertical":!(!l&&!r)},p={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},h=e.layout||this.layout||1,c={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:n.OUTLINED,title:`${H(this,b,"f").language.translate(m.EXPAND)}/${H(this,b,"f").language.translate(m.COLLAPSE)} (CTRL + Click)`,onClick:t=>{t.ctrlKey&&e.children&&e.children.length>0&&(e.isExpanded?this.collapseAll(e.children):this.expandAll(e.children)),e.isExpanded=!e.isExpanded,this.autofitOnExpand&&$(this,z,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let u=null;H(this,d,"m",L).call(this,h)&&(u=a("kup-box",{class:"kup-borderless kup-paddingless",customStyle:"#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }",data:p,cardData:this.cardData,layout:this.cardData?null:h,showSelection:!1}));const y=a("div",{class:"family-tree__item"},a("div",{class:"family-tree__item__wrapper"},H(this,d,"m",L).call(this,h)?u:H(this,d,"m",T).call(this,e,h),this.collapsible&&e.children&&e.children.length>0?a(o,Object.assign({},c)):void 0)),k={"--kup_familytree_staffchildren":(null==r?void 0:r.length.toString())||"0"};return a("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},a("tr",null,a("td",{"data-row":e,colSpan:f},y)),a("tr",null,a("td",{colSpan:f},a("div",{class:_}))),r?[a("tr",null,a("td",{colSpan:f},a("div",{class:Object.assign(Object.assign({},_),{"family-tree__line--staff":!0}),style:k}),a("div",{class:"family-tree__node__staff",style:k},r.map((e=>[a("div",{class:"family-tree__node__staff__item"},H(this,d,"m",t).call(this,e))])))))]:null,r&&l?[a("tr",null,a("td",{colSpan:f},a("div",{class:_})))]:null,l?[a("tr",null,s?a("td",{colSpan:f},a("div",{class:_})):l.map((t=>H(this,d,"m",C).call(this,0==l.indexOf(t),l.indexOf(t)==l.length-1,1==l.length,l.length>2)))),a("tr",null,s?a("td",{colSpan:f},l.map((e=>H(this,d,"m",t).call(this,e)))):l.map((e=>a("td",{colSpan:2},H(this,d,"m",t).call(this,e)))))]:void 0)},T=function(t,e){return 2===e?H(this,d,"m",M).call(this,t):H(this,d,"m",W).call(this,t)},W=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--1"},a("div",{class:"family-tree__item__layout__text__title"},t.value))},M=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--2"},a("div",{class:"family-tree__item__layout__color"}),a("div",{class:"family-tree__item__layout__image"},a(s,{resource:t.icon,placeholderResource:t.placeholderIcon,sizeX:"48px",sizeY:"48px"})),a("div",{class:"family-tree__item__layout__text"},a("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?a("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},S=function(t){return t.map((t=>H(this,d,"m",E).call(this,t)))},D=function(){return a("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,j,t,"f")},this.data&&this.data.rows&&this.data.rows.length?H(this,d,"m",S).call(this,this.data.rows):a("div",null,H(this,b,"f").language.translate(m.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){$(this,g,t.clientX,"f"),$(this,v,t.clientY,"f"),H(this,j,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",H(this,w,"f")),document.removeEventListener("pointerup",e),H(this,j,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",H(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t,e){let i,a;if(t)for(let e=t.length-1;e>=0;e--){const l=t[e];l.tagName&&(l.classList.contains("family-tree__item__expand")&&(i=l),"TD"===l.tagName.toUpperCase())&&(a=l)}let l=null,r=null,o=null;return a&&(l=a["data-cell"],r=a["data-column"],o=a["data-row"]),{cell:l||null,column:r||null,expandButton:i||null,originalEvent:e,row:o||null,td:a||null}},R=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},A=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},F=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},X=function(){H(this,x,"f").push(this.rootElement),H(this,b,"f").interact.on(this.rootElement,h.TAP,(t=>{if(H(this,k,"f"))$(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];H(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",R).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.DOUBLETAP,(t=>{if(0===t.button){for(let t=0;t<H(this,y,"f").length;t++)clearTimeout(H(this,y,"f")[t]),H(this,b,"f").debug.logMessage(this,"Cleared clickHandler timeout("+H(this,y,"f")[t]+").");$(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||($(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,t)}))}))},Y=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(H(this,j,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let a=t.deltaY>0?e-i:e+i;a<i&&(a=i),H(this,j,"f").style.setProperty("--kup_familytree_scale",a.toFixed(2))}},B.style='.kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size: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{--kup_familytree_item_background_color:var(\n --kup-layer-1,\n var(--kup-layer-1)\n );--kup_familytree_border_color:var(\n --kup-familytree-border-color,\n var(--kup-info-color-50)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 80px);--kup_familytree_item_h_padding:var(\n --kup-familytree-item-h-padding,\n var(--kup-space-03)\n );--kup_familytree_item_v_padding:var(\n --kup-familytree-item-v-padding,\n var(--kup-space-03)\n );--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-subtle)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc((var(--kup_familytree_item_width) + var(--kup_familytree_item_h_padding) * 2) / 2)) translateY(calc(0px - (var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:"";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc(var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);box-sizing:border-box;display:flex;height:var(--kup_familytree_item_height);margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup_familytree_border_color);height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto var(--kup-space-03)}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';export{B as kup_family_tree}