@sme.up/ketchup 7.4.2 → 8.0.0-a

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 (173) hide show
  1. package/dist/cjs/{component-72a5b626.js → component-85c2bd4d.js} +1 -1
  2. package/dist/cjs/{f-button-daddd700.js → f-button-b4493396.js} +2 -2
  3. package/dist/cjs/{f-cell-3682fad4.js → f-cell-356b4a8f.js} +6 -6
  4. package/dist/cjs/{f-checkbox-593f72c3.js → f-checkbox-1148e791.js} +1 -1
  5. package/dist/cjs/{f-chip-9d540d94.js → f-chip-617af9d4.js} +3 -3
  6. package/dist/cjs/{f-image-7b42d149.js → f-image-58de00ed.js} +5 -5
  7. package/dist/cjs/{f-paginator-utils-1baeba0f.js → f-paginator-utils-ded7ed1b.js} +3 -3
  8. package/dist/cjs/{f-text-field-a6ed2d22.js → f-text-field-fdba1e89.js} +2 -2
  9. package/dist/cjs/{f-text-field-mdc-85997738.js → f-text-field-mdc-0e22f3e3.js} +2 -2
  10. package/dist/cjs/{index-74433248.js → index-1f177abc.js} +0 -3
  11. package/dist/cjs/ketchup.cjs.js +3 -3
  12. package/dist/cjs/kup-accordion.cjs.entry.js +5 -5
  13. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +817 -822
  14. package/dist/cjs/kup-box.cjs.entry.js +14 -13
  15. package/dist/cjs/kup-calendar.cjs.entry.js +6 -6
  16. package/dist/cjs/kup-cell.cjs.entry.js +7 -7
  17. package/dist/cjs/kup-dash-list.cjs.entry.js +2 -2
  18. package/dist/cjs/kup-dash_2.cjs.entry.js +2 -2
  19. package/dist/cjs/kup-dashboard.cjs.entry.js +9 -12
  20. package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
  21. package/dist/cjs/kup-echart.cjs.entry.js +26 -9
  22. package/dist/cjs/kup-family-tree.cjs.entry.js +9 -20
  23. package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
  24. package/dist/cjs/kup-image-list.cjs.entry.js +10 -10
  25. package/dist/cjs/kup-lazy.cjs.entry.js +2 -2
  26. package/dist/cjs/kup-magic-box.cjs.entry.js +3 -3
  27. package/dist/cjs/{kup-manager-10351449.js → kup-manager-62ae342a.js} +81 -2
  28. package/dist/cjs/kup-nav-bar.cjs.entry.js +2 -2
  29. package/dist/cjs/kup-numeric-picker.cjs.entry.js +6 -6
  30. package/dist/cjs/kup-photo-frame.cjs.entry.js +2 -2
  31. package/dist/cjs/kup-planner.cjs.entry.js +1128 -219
  32. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  33. package/dist/cjs/kup-qlik.cjs.entry.js +3 -3
  34. package/dist/cjs/kup-snackbar.cjs.entry.js +5 -5
  35. package/dist/cjs/loader.cjs.js +3 -3
  36. package/dist/cjs/{tslib.es6-0ee02c67.js → tslib.es6-386654de.js} +9 -5
  37. package/dist/collection/assets/data-table.js +44 -0
  38. package/dist/collection/collection-manifest.json +1 -1
  39. package/dist/collection/components/kup-box/kup-box.js +1 -0
  40. package/dist/collection/components/kup-card/kup-card.css +4 -8
  41. package/dist/collection/components/kup-chip/kup-chip.js +4 -3
  42. package/dist/collection/components/kup-dashboard/kup-dashboard.js +0 -3
  43. package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
  44. package/dist/collection/components/kup-data-table/kup-data-table.css +3 -6
  45. package/dist/collection/components/kup-data-table/kup-data-table.js +6 -20
  46. package/dist/collection/components/kup-echart/kup-echart-declarations.js +2 -0
  47. package/dist/collection/components/kup-echart/kup-echart.js +23 -8
  48. package/dist/collection/components/kup-family-tree/kup-family-tree.css +2 -2
  49. package/dist/collection/components/kup-family-tree/kup-family-tree.js +4 -15
  50. package/dist/collection/components/kup-image/kup-image.js +28 -0
  51. package/dist/collection/components/kup-list/kup-list.css +1 -1
  52. package/dist/collection/components/kup-planner/kup-planner-declarations.js +5 -2
  53. package/dist/collection/components/kup-planner/kup-planner.css +6 -3
  54. package/dist/collection/components/kup-planner/kup-planner.js +347 -65
  55. package/dist/collection/components/kup-qlik/kup-qlik.css +4 -8
  56. package/dist/collection/components/kup-snackbar/kup-snackbar.css +4 -3
  57. package/dist/collection/components/kup-spinner/kup-spinner.css +2 -4
  58. package/dist/collection/components/kup-tree/kup-tree.js +66 -67
  59. package/dist/collection/f-components/f-image/f-image.js +3 -3
  60. package/dist/collection/managers/kup-data/kup-data-column-helper.js +1 -0
  61. package/dist/collection/managers/kup-manager/kup-manager.js +18 -0
  62. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +1 -0
  63. package/dist/collection/types/GenericTypes.js +1 -0
  64. package/dist/components/kup-autocomplete2.js +229 -152
  65. package/dist/components/kup-box2.js +1 -0
  66. package/dist/components/kup-dashboard.js +0 -3
  67. package/dist/components/kup-echart2.js +24 -7
  68. package/dist/components/kup-family-tree.js +5 -16
  69. package/dist/components/kup-planner.js +1127 -219
  70. package/dist/components/kup-progress-bar.js +1 -1
  71. package/dist/components/kup-qlik.js +1 -1
  72. package/dist/components/kup-radio.js +1 -1
  73. package/dist/components/kup-rating.js +1 -1
  74. package/dist/components/kup-snackbar.js +1 -1
  75. package/dist/components/kup-spinner.js +1 -1
  76. package/dist/components/kup-switch.js +1 -1
  77. package/dist/components/kup-tab-bar.js +1 -1
  78. package/dist/components/kup-text-field.js +1 -1
  79. package/dist/components/kup-time-picker.js +1 -1
  80. package/dist/components/kup-tree.js +1 -1
  81. package/dist/esm/{component-b1bedf1d.js → component-120651a0.js} +1 -1
  82. package/dist/esm/{f-button-8d15b5a0.js → f-button-b556d392.js} +2 -2
  83. package/dist/esm/{f-cell-7b706e57.js → f-cell-bee3cc3d.js} +6 -6
  84. package/dist/esm/{f-checkbox-ec85b437.js → f-checkbox-9b3f5f5b.js} +1 -1
  85. package/dist/esm/{f-chip-c671fe90.js → f-chip-a036bc33.js} +3 -3
  86. package/dist/esm/{f-image-21451b15.js → f-image-363c7981.js} +5 -5
  87. package/dist/esm/{f-paginator-utils-92bbf277.js → f-paginator-utils-58ae68aa.js} +3 -3
  88. package/dist/esm/{f-text-field-0bb2d109.js → f-text-field-9df5c22b.js} +2 -2
  89. package/dist/esm/{f-text-field-mdc-d42d3f9e.js → f-text-field-mdc-cee583ea.js} +2 -2
  90. package/dist/esm/{index-b326ffc9.js → index-8bd38435.js} +1 -3
  91. package/dist/esm/ketchup.js +4 -4
  92. package/dist/esm/kup-accordion.entry.js +5 -5
  93. package/dist/esm/kup-autocomplete_27.entry.js +817 -822
  94. package/dist/esm/kup-box.entry.js +14 -13
  95. package/dist/esm/kup-calendar.entry.js +6 -6
  96. package/dist/esm/kup-cell.entry.js +7 -7
  97. package/dist/esm/kup-dash-list.entry.js +2 -2
  98. package/dist/esm/kup-dash_2.entry.js +2 -2
  99. package/dist/esm/kup-dashboard.entry.js +9 -12
  100. package/dist/esm/kup-drawer.entry.js +2 -2
  101. package/dist/esm/kup-echart.entry.js +26 -9
  102. package/dist/esm/kup-family-tree.entry.js +9 -20
  103. package/dist/esm/kup-iframe.entry.js +2 -2
  104. package/dist/esm/kup-image-list.entry.js +10 -10
  105. package/dist/esm/kup-lazy.entry.js +2 -2
  106. package/dist/esm/kup-magic-box.entry.js +3 -3
  107. package/dist/esm/{kup-manager-6145d980.js → kup-manager-5678a52f.js} +81 -3
  108. package/dist/esm/kup-nav-bar.entry.js +2 -2
  109. package/dist/esm/kup-numeric-picker.entry.js +6 -6
  110. package/dist/esm/kup-photo-frame.entry.js +2 -2
  111. package/dist/esm/kup-planner.entry.js +1128 -219
  112. package/dist/esm/kup-probe.entry.js +2 -2
  113. package/dist/esm/kup-qlik.entry.js +3 -3
  114. package/dist/esm/kup-snackbar.entry.js +5 -5
  115. package/dist/esm/loader.js +4 -4
  116. package/dist/esm/{tslib.es6-3eea2234.js → tslib.es6-8c2af864.js} +9 -5
  117. package/dist/ketchup/ketchup.esm.js +1 -1
  118. package/dist/ketchup/p-0eee4a5a.entry.js +39 -0
  119. package/dist/ketchup/{p-81605f08.js → p-10d84b1b.js} +1 -1
  120. package/dist/ketchup/{p-0c1cbf8b.entry.js → p-1ef0b60d.entry.js} +1 -1
  121. package/dist/ketchup/{p-a203f78b.js → p-27a56c87.js} +1 -1
  122. package/dist/ketchup/p-28617a01.entry.js +25 -0
  123. package/dist/ketchup/{p-439ac105.entry.js → p-297e3a99.entry.js} +1 -1
  124. package/dist/ketchup/{p-281cff81.entry.js → p-3e7fcb23.entry.js} +1 -1
  125. package/dist/ketchup/p-452794d7.entry.js +9 -0
  126. package/dist/ketchup/{p-0c9b7c80.entry.js → p-4a5bb19d.entry.js} +1 -1
  127. package/dist/ketchup/{p-ea16ddc0.js → p-4c28b140.js} +1 -1
  128. package/dist/ketchup/p-4fc2a726.js +30 -0
  129. package/dist/ketchup/{p-7cfdce27.js → p-59ecca83.js} +1 -1
  130. package/dist/ketchup/{p-89ac80c1.entry.js → p-5ea29654.entry.js} +1 -1
  131. package/dist/ketchup/{p-d87fb5ff.entry.js → p-63143986.entry.js} +1 -1
  132. package/dist/ketchup/{p-2a2dc2a8.entry.js → p-6a99d95a.entry.js} +1 -1
  133. package/dist/ketchup/{p-4d039705.entry.js → p-6aaf28ac.entry.js} +1 -1
  134. package/dist/ketchup/{p-c222d070.entry.js → p-6be4cc6b.entry.js} +1 -1
  135. package/dist/ketchup/p-7f59211b.js +1 -0
  136. package/dist/ketchup/{p-2915a66a.entry.js → p-86403c79.entry.js} +1 -1
  137. package/dist/ketchup/p-86fd64c8.entry.js +1 -0
  138. package/dist/ketchup/p-8b2fb87c.entry.js +1 -0
  139. package/dist/ketchup/{p-76bf53df.entry.js → p-91d07966.entry.js} +1 -1
  140. package/dist/ketchup/{p-e4975ffa.entry.js → p-98e85fb0.entry.js} +1 -1
  141. package/dist/ketchup/{p-d4ece435.js → p-9dcfbb1e.js} +2 -2
  142. package/dist/ketchup/{p-ae4fffe0.js → p-9f2416d4.js} +1 -1
  143. package/dist/ketchup/{p-c26975bf.js → p-9f9b6656.js} +1 -1
  144. package/dist/ketchup/{p-1242366a.entry.js → p-d299b9ce.entry.js} +1 -1
  145. package/dist/ketchup/p-db43c039.entry.js +1 -0
  146. package/dist/ketchup/{p-a641780a.entry.js → p-dfba4ea4.entry.js} +1 -1
  147. package/dist/ketchup/{p-da37c417.entry.js → p-ed79b1cd.entry.js} +1 -1
  148. package/dist/ketchup/{p-c4d9e3e2.js → p-f197df32.js} +1 -1
  149. package/dist/ketchup/{p-32517a99.entry.js → p-f3282015.entry.js} +1 -1
  150. package/dist/ketchup/{p-826c91d7.js → p-f9823319.js} +1 -1
  151. package/dist/ketchup/p-ff285e51.js +1 -0
  152. package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
  153. package/dist/types/components/kup-echart/kup-echart-declarations.d.ts +2 -0
  154. package/dist/types/components/kup-image/kup-image.d.ts +2 -0
  155. package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +18 -3
  156. package/dist/types/components/kup-planner/kup-planner.d.ts +36 -11
  157. package/dist/types/components/kup-tree/kup-tree.d.ts +1 -5
  158. package/dist/types/components.d.ts +39 -4
  159. package/dist/types/f-components/f-image/f-image-declarations.d.ts +1 -0
  160. package/dist/types/managers/kup-language/kup-language-declarations.d.ts +1 -1
  161. package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +1 -0
  162. package/dist/types/managers/kup-manager/kup-manager.d.ts +7 -0
  163. package/dist/types/types/GenericTypes.d.ts +1 -0
  164. package/package.json +8 -20
  165. package/dist/ketchup/p-02a26d59.entry.js +0 -9
  166. package/dist/ketchup/p-462475ac.entry.js +0 -10
  167. package/dist/ketchup/p-5292ef67.js +0 -30
  168. package/dist/ketchup/p-79b0730b.js +0 -15
  169. package/dist/ketchup/p-849ad5d8.entry.js +0 -1
  170. package/dist/ketchup/p-9f00ad0f.js +0 -1
  171. package/dist/ketchup/p-be61dd36.entry.js +0 -39
  172. package/dist/ketchup/p-c022824e.entry.js +0 -1
  173. package/dist/ketchup/p-e83e70e2.entry.js +0 -1
@@ -1 +1 @@
1
- import{E as e,J as t,H as l,C as n,am as r,u as i,y as o,ao as s,ap as a,N as u,aj as c,f,aq as h,a3 as d,ar as p,q as b,l as m}from"./p-5292ef67.js";import{h as v}from"./p-d4ece435.js";import{F}from"./p-7cfdce27.js";import{F as x}from"./p-6c77a36c.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,l){let n="";if(null==e)return n;let r=e[t];return null==r||(n=l?r.textFieldTmp:r.textField),n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,l){if(!t)return!1;let n=this._getTextFilterValue(e,t.name,l);if(null!=n&&""!=n.trim())return!0;if(this._hasIntervalTextFieldFilterValues(e,t,l))return!0;let r=this.getCheckBoxFilterValues(e,t.name);return!(null==r||r.length<1)}getCheckBoxFilterValues(e={},t){let l=[];if(null==e)return l;let n=e[t];return null==n||null==n.checkBoxes||(l=n.checkBoxes),l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!1)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!0)}_hasIntervalTextFieldFilterValues(e={},l,n){if(null==l)return!1;if(!this.isColumnFiltrableByInterval(l))return!1;let r=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(null!=r&&""!=r.trim())return!0;let i=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);return null!=i&&""!=i.trim()}addCheckboxFilter(t={},l,n){if(null==t)return;let r=t[l];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},t[l]=r),null==r.checkBoxes&&(r.checkBoxes=[]),null==n||null==n.value?r.checkBoxes=[]:e.valuesArrayContainsValue(r.checkBoxes,n.value)||(r.checkBoxes[r.checkBoxes.length]=n)}removeCheckboxFilter(t={},l,n){if(null==t||null==n)return;let r=t[l];if(null==r)return;null==r.checkBoxes&&(r.checkBoxes=[]);let i=e.indexOfValueInValuesArray(r.checkBoxes,n);if(i>=0){let e=[];for(let t=0;t<r.checkBoxes.length;t++)t!=i&&(e[e.length]=r.checkBoxes[t]);r.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!1)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!0)}_getIntervalTextFieldFilterValues(e={},l,n){return this._hasIntervalTextFieldFilterValues(e,l,n)?[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)]:["",""]}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!1)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!0)}_getIntervalTextFieldFilterValue(e={},t,l,n){let r="";if(null==e)return r;let i=e[t];return null==i||n&&null==i.intervalTmp?r:n||null!=i.interval?(r=n?i.intervalTmp[l]:i.interval[l],r):r}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,!0)}_setTextFieldFilterValue(e={},t,l,n){if(null==e)return;let r=e[t];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=r),n?r.textFieldTmp=null!=l?l.trim():l:r.textField=null!=l?l.trim():l}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,!0)}_setIntervalTextFieldFilterValue(e={},t,l,n,r){if(null==e)return;let i=e[t];null==i&&(i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=i),null==i.interval&&(i.interval=[],i.interval.push("","")),null==i.intervalTmp&&(i.intervalTmp=[],i.intervalTmp.push("","")),r?i.intervalTmp[n]=null!=l?l.trim():l:i.interval[n]=null!=l?l.trim():l}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,!1)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,!0)}getFilterValueForTooltip(e={},r){let i=this.getTextFilterValue(e,r.name),o=this.getIntervalTextFieldFilterValues(e,r),s=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=o[t.FROM]&&(u+=a+"(>= "+l(o[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=o[t.TO]&&(u+=a+"(<= "+l(o[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return s.forEach((e=>{c+=a+n(e,r),a=" OR "})),""!=c&&(c="("+c+")",""!=u&&(c=" AND "+c)),c=u+c,c}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var g;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.removableColumns="Sets the possibility to remove the selected column.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(g||(g={}));const k="TREE_COLUMN";var T;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(T||(T={}));const y=document.documentElement,j=y.ketchup?y.ketchup.objects:new o,C=y.ketchup?y.ketchup.data:new s;class V extends e{isFilterCompliantForCell(e,t,l){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=!1,r=[],i){return this.areCellsCompliant(e.cells,t,l,n,r,i)}areCellsCompliant(e,t={},l="",n=!1,o=[],s){if(n){let t=!0;if(o&&null!=o&&o.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<o.length;i++){if(0==o[i].visible)continue;const s=e[o[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,l);let a=r(o[i],s);if(a!=s.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==s&&(s=new w),!this.hasFilters(t,o,s))return!0;let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const r=e[n];if(!r)return!1;let u=s.getTextFilterValue(t,n),c=s.getIntervalTextFieldFilterValues(t,i(o,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(j.isNumber(r.obj)||j.isDate(r.obj)||j.isTime(r.obj)||j.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let p=s.getCheckBoxFilterValues(t,n);if(0==p.length)continue;let b=!1;for(let e=0;e<p.length;e++){let t=p[e];if(null!=t&&null!=t.value){if(null!=r.value&&r.value.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}}}if(!b)return!1}return!0}hasFilters(e={},t,l){if(null==e)return!1;let n=Object.keys(e);if(null==n||n.length<1)return!1;null==l&&(l=new w);for(let r=0;r<n.length;r++){let o=n[r],s=null;if(s=o===k?{name:k,title:""}:i(t,o),l.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},l="",n=[],r){if(!e||null==e)return[];let i=[];const o=!(!l||!n);if(this.hasFilters(t,n,r)||o)for(let s=0;s<e.length;s++){let a=e[s];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,o,n,r))&&(i[i.length]=a)}else i=[...e];return i}getColumnValues(t,n,r,i){let o=new Array;null==i&&(i=new w);let s=i.getTextFilterValueTmp(t.filters,n.name),a=i.getIntervalTextFieldFilterValuesTmp(t.filters,n),u=i.getCheckBoxFilterValues(t.filters,n.name);if(null!=n.valuesForFilter&&n.valuesForFilter.length>0)return n.valuesForFilter.forEach((t=>{let r=t;(e.valuesArrayContainsValue(u,r)||""==s||i.isFilterCompliantForSimpleValue(r,n.obj,s,a))&&o.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),o;let c=Object.assign({},t.filters);c[n.name]={textField:s,textFieldTmp:s,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)o.push(u[e]);return C.cell.getUnivocalValue({rows:f},n,!0)}}const O=document.documentElement;function I(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const l=e[0].group.column;let n=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let l of t)if(l.column===e)return l;return null}(l,t);return n||(n={column:l,sortMode:d.A}),e.sort(((e,t)=>a({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},n.sortMode))),e.forEach((e=>{e.group.children=I(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const r=M(e,n,t[l]);if(0!==r)return r}return 0}return M(e,n,t[0])}))}function M(e,t,l){const n=e.cells[l.column],r=t.cells[l.column];return n||r?n?r?a(n,r,l.sortMode):-1:1:0}function _(e=[],t={},l="",n=[],r,i){return null==i&&(i=new V),i.filterRows(e,t,l,n,r)}function N(e=[],t=[],l=[],n={}){if(!t)return[];if(!l||0===l.length||!e||0===e.length)return t;const o={},s=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return o[l]=n,!0;return!1}));if(0===s.length)return t;const a=[];let f={};return t.forEach((t=>{const l=s[0].column,h=t.cells[l];if(h){const d=i(e,l),p=r(d,h),b=h.value;let m=null;for(let e of a)if(e.group.label===p){m=e;break}null===m&&(m={group:{id:b,parent:null,column:l,columnLabel:o[l],expanded:!1,label:p,children:[],obj:h.obj,totals:{}},cells:{}},a.push(m));for(let l=1;l<s.length;l++){const n=s[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(t,a),s=a.value;let u=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===l){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:n.column,columnLabel:o[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},E(u),m.group.children.push(u)),m=u}}m.group.children.push(t),function(e,t,l,n){if(!e||!t)return;const r=Object.keys(t);0!==r.length&&r.forEach((r=>{const i=O.ketchup.math.numberify(e.group.totals[r]||0),o=l.cells[r];if(o){let l=O.ketchup.objects.isNumber(o.obj);const s=t[r];switch(s){case u.COUNT:e.group.totals[r]=i+1;let t=e.group.parent;for(;null!=t;)t.group.totals[r]=(t.group.totals[r]||0)+1,t=t.group.parent;break;case u.DISTINCT:let a;if(a=l?O.ketchup.math.numberify(c(o.value)):o.value,n[e.group.id]){let t=n[e.group.id][r];t?t.push(a):(n[e.group.id][r]=[],n[e.group.id][r].push(a))}else n[e.group.id]={},n[e.group.id][r]=[],n[e.group.id][r].push(a);let f=e.group.parent;for(;null!=f;){if(n[f.group.id]){let e=n[f.group.id][r];e?e.push(a):(n[f.group.id][r]=[],n[f.group.id][r].push(a))}else n[f.group.id]={},n[f.group.id][r]=[],n[f.group.id][r].push(a);f=f.group.parent}break;case u.SUM:case u.AVERAGE:if(l){const t=O.ketchup.math.numberify(c(o.value));e.group.totals[r]=t+i;let l=e.group.parent;for(;null!=l;){const e=O.ketchup.math.numberify(l.group.totals[r]||0);l.group.totals[r]=t+e,l=l.group.parent}}break;case u.MIN:if(l){const t=e.group.totals[r],l=O.ketchup.math.numberify(c(o.value));e.group.totals[r]=t?Math.min(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.min(e,l):l,n=n.group.parent}}else if(O.ketchup.objects.isDate(o.obj)){const t=o.obj?O.ketchup.objects.parseDate(o.obj):O.ketchup.dates.toDayjs(o.value);if(O.ketchup.dates.isValid(t)){const l=O.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(O.ketchup.dates.format(n)),e.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.min(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(O.ketchup.dates.format(e)),i.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.min(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;case u.MAX:if(l){const t=e.group.totals[r],l=O.ketchup.math.numberify(c(o.value));e.group.totals[r]=t?Math.max(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.max(e,l):l,n=n.group.parent}}else if(O.ketchup.objects.isDate(o.obj)){const t=o.obj?O.ketchup.objects.parseDate(o.obj):O.ketchup.dates.toDayjs(o.value);if(O.ketchup.dates.isValid(t)){const l=O.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(O.ketchup.dates.format(n)),e.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.max(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(O.ketchup.dates.format(e)),i.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.max(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;default:0!=s.indexOf(u.MATH)&&console.warn(`invalid total mode: ${s}`)}}}))}(m,n,t,f)}})),function(e,t,l){if(!e||!t)return;const n=Object.keys(t);if(0===e.length||!e[0].group||0===n.length)return;let r=n.filter((e=>u.DISTINCT===t[e]));r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>A(e,r,l)))}(a,n,f),W(a,u.AVERAGE,n),W(a,u.MATH,n),a}function W(e,t,l){if(!e||!l)return;const n=Object.keys(l);if(0===e.length||!e[0].group||0===n.length)return;let r;t==u.AVERAGE&&(r=n.filter((e=>u.AVERAGE===l[e]))),t==u.MATH&&(r=n.filter((e=>0==l[e].indexOf(u.MATH)))),r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>B(e,t,r,l)))}function A(e,t,l){const n=e.group.children;0!==n.length&&(n[0].group&&n.forEach((e=>{A(e,t,l)})),t.forEach((t=>{e.group.totals[t]=new Set(l[e.group.id][t]).size})))}function B(e,t,l,n){const r=e.group.children;if(0===r.length)return 0;let i=0;return r[0].group?r.forEach((e=>{i+=B(e,t,l,n)})):i=r.length,l.forEach((l=>{if(t==u.AVERAGE&&(e.group.totals[l]=O.ketchup.math.numberify(e.group.totals[l])/i),t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=O.ketchup.math.formulas.custom(t,e.group.totals)}})),i}function D(e,t){if(t){const l=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const l=t.cells[e.name];l&&e.obj&&!l.obj&&(l.obj={t:e.obj.t,p:e.obj.p,k:l.value})}}))})),l}}function $(e=[],t={}){if(O.ketchup.objects.isEmptyJsObject(e)||O.ketchup.objects.isEmptyJsObject(t))return{};const l=Object.keys(t),n={},r=new Array;if(0===l.length||l.every((e=>t[e]===u.COUNT)))l.forEach((t=>n[t]=e.length));else{let i={};e.forEach(((e,o,s)=>{l.filter((e=>u.COUNT!==t[e]&&0!=t[e].indexOf(u.MATH))).forEach((l=>{const a=e.cells[l];if(a)if(t[l]===u.DISTINCT){let e;e=O.ketchup.objects.isNumber(a.obj)?O.ketchup.math.numberify(c(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(O.ketchup.objects.isNumber(a.obj)){const e=O.ketchup.math.numberify(c(a.value));let r=n[l];switch(!0){case t[l]===u.MIN:n[l]=r?Math.min(r,e):e;break;case t[l]===u.MAX:n[l]=r?Math.max(r,e):e;break;default:r=n[l]||0,n[l]=e+O.ketchup.math.numberify(r)}}else if(O.ketchup.objects.isDate(a.obj)){-1==r.indexOf(l)&&r.push(l);const e=O.ketchup.dates.toDayjs(a.value);if(O.ketchup.dates.isValid(e)){const r=O.ketchup.dates.toDate(e),i=n[l]?O.ketchup.dates.toDate(O.ketchup.dates.toDayjs(n[l])):null;switch(!0){case t[l]===u.MIN:if(i){let e=[];e.push(r),e.push(i),n[l]=O.ketchup.dates.format(O.ketchup.dates.min(e),f.ISO_DATE)}else n[l]=O.ketchup.dates.format(r,f.ISO_DATE);break;case t[l]===u.MAX:if(i){let e=[];e.push(r),e.push(i),n[l]=O.ketchup.dates.format(O.ketchup.dates.max(e),f.ISO_DATE)}else n[l]=O.ketchup.dates.format(r,f.ISO_DATE)}}}o===s.length-1&&t[l]===u.DISTINCT&&(n[l]=new Set(i[l]).size,i[l]=[])}))}))}for(let i of l){switch(!0){case t[i]===u.AVERAGE:const l=n[i];l&&e.length>0&&(n[i]=l/e.length);break;case t[i]===u.COUNT:n[i]=e.length;break;case 0==t[i].indexOf(u.MATH):n[i]=O.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=O.ketchup.dates.format(n[i]):h(n[i])&&(n[i]=+n[i].toFixed(2)))}return n}function E(e){if(!e.group)return;let t=e.group.id,l=e.group.parent;for(;null!==l;)t=`${l.group.id};${t}`,l=l.group.parent;e.group.id=t}function L(e,t,l,n){const r=t*l-l,i=r+Number(l);if(0==n)return e.slice(r,i);let o=[];return S(e,o,r,Number(l),0),o}function S(e,t,l,n,r){let i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=q(e[o]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=S(s.group.children,a.group.children,l,n,r);r=e.ci,i=e.added,1==i&&(t[t.length]=a)}else r>=l&&(t[t.length]=a,i=!0),r++;if(r>=l+n)break}return{ci:r,added:i}}function q(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:z(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function R(e){if(null==e)return null;let t=[];for(let l=0;l<e.length;l++)t[t.length]=q(e[l]);return t}function z(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:R(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}var H;!function(e){e.SIMPLE="simple",e.FULL="full"}(H||(H={}));const J=document.documentElement,K=e=>{const t=Math.ceil(e.max/e.perPage),l=function(e,t){const l=[];for(let n=1;n<=t;n++){const t=n==e.currentPage;l.push({id:n.toString(),selected:t,value:n.toString()})}return l}(e,t),n=function(e){const t=[];let l=e.perPage;if(0===l)return t;for(;l<e.max;){const n=l==e.perPage;t.push({id:l.toString(),selected:n,value:l.toString()}),l*=2}const n=e.max==e.perPage;return t.push({id:e.max.toString(),selected:n,value:e.max.toString()}),t}(e),r={"kup-list":{data:l},"kup-text-field":{label:J.ketchup.language.translate(p.PAGE),helper:J.ketchup.language.translate(p.TOTAL)+`: ${t}`,helperWhenFocused:!0,inputType:"number",max:t,min:1}},i={"kup-list":{data:n},"kup-text-field":{label:J.ketchup.language.translate(b.ROWS)+" / "+J.ketchup.language.translate(p.PAGE),helper:J.ketchup.language.translate(b.TOTAL)+`: ${e.max}`,helperWhenFocused:!0,inputType:"number",max:e.max,min:1}};return v("div",Object.assign({class:`f-paginator ${e.mode?e.mode:""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),e.mode!==H.SIMPLE?v(F,{icon:"chevron_left",disabled:G(e),onClick:e.onPrevPage,wrapperClass:"prev-page"}):null,v("kup-combobox",{class:"page-selector",data:r,initialValue:e.currentPage.toString(),"onkup-combobox-change":e.onPageChange}),e.mode!==H.SIMPLE?v(F,{icon:"chevron_right",disabled:U(e),onClick:e.onNextPage,wrapperClass:"next-page"}):null,v("kup-combobox",{class:"rows-selector",data:i,initialValue:e.perPage.toString(),"onkup-combobox-change":e.onRowsChange}),e.onLoadMore?v(F,{icon:"plus",onClick:e.onLoadMore,label:J.ketchup.language.translate(m.LOAD_MORE),styling:x.FLAT,wrapperClass:"load-more-button"}):null)};function U(e){return e.currentPage*e.perPage>=e.max}function G(e){return 1==e.currentPage}function P(e,t,l){if(h(e)){const n=Math.ceil(t/l);let r=e;return r>n&&(r=n),r<1&&(r=1),r}return null}function Q(e,t){if(h(e)){let l=e;return l>t&&(l=t),l<1&&(l=1),l}return null}export{w as F,T as K,V as a,K as b,$ as c,P as d,g as e,_ as f,N as g,H as h,D as n,L as p,Q as r,I as s,k as t}
1
+ import{E as e,J as t,H as l,C as n,am as r,u as i,y as o,ao as s,ap as a,N as u,aj as c,f,aq as h,a3 as d,ar as p,q as b,l as m}from"./p-4fc2a726.js";import{h as v}from"./p-9dcfbb1e.js";import{F}from"./p-59ecca83.js";import{F as x}from"./p-6c77a36c.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,l){let n="";if(null==e)return n;let r=e[t];return null==r||(n=l?r.textFieldTmp:r.textField),n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,l){if(!t)return!1;let n=this._getTextFilterValue(e,t.name,l);if(null!=n&&""!=n.trim())return!0;if(this._hasIntervalTextFieldFilterValues(e,t,l))return!0;let r=this.getCheckBoxFilterValues(e,t.name);return!(null==r||r.length<1)}getCheckBoxFilterValues(e={},t){let l=[];if(null==e)return l;let n=e[t];return null==n||null==n.checkBoxes||(l=n.checkBoxes),l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!1)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!0)}_hasIntervalTextFieldFilterValues(e={},l,n){if(null==l)return!1;if(!this.isColumnFiltrableByInterval(l))return!1;let r=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(null!=r&&""!=r.trim())return!0;let i=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);return null!=i&&""!=i.trim()}addCheckboxFilter(t={},l,n){if(null==t)return;let r=t[l];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},t[l]=r),null==r.checkBoxes&&(r.checkBoxes=[]),null==n||null==n.value?r.checkBoxes=[]:e.valuesArrayContainsValue(r.checkBoxes,n.value)||(r.checkBoxes[r.checkBoxes.length]=n)}removeCheckboxFilter(t={},l,n){if(null==t||null==n)return;let r=t[l];if(null==r)return;null==r.checkBoxes&&(r.checkBoxes=[]);let i=e.indexOfValueInValuesArray(r.checkBoxes,n);if(i>=0){let e=[];for(let t=0;t<r.checkBoxes.length;t++)t!=i&&(e[e.length]=r.checkBoxes[t]);r.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!1)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!0)}_getIntervalTextFieldFilterValues(e={},l,n){return this._hasIntervalTextFieldFilterValues(e,l,n)?[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)]:["",""]}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!1)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!0)}_getIntervalTextFieldFilterValue(e={},t,l,n){let r="";if(null==e)return r;let i=e[t];return null==i||n&&null==i.intervalTmp?r:n||null!=i.interval?(r=n?i.intervalTmp[l]:i.interval[l],r):r}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,!0)}_setTextFieldFilterValue(e={},t,l,n){if(null==e)return;let r=e[t];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=r),n?r.textFieldTmp=null!=l?l.trim():l:r.textField=null!=l?l.trim():l}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,!0)}_setIntervalTextFieldFilterValue(e={},t,l,n,r){if(null==e)return;let i=e[t];null==i&&(i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=i),null==i.interval&&(i.interval=[],i.interval.push("","")),null==i.intervalTmp&&(i.intervalTmp=[],i.intervalTmp.push("","")),r?i.intervalTmp[n]=null!=l?l.trim():l:i.interval[n]=null!=l?l.trim():l}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,!1)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,!0)}getFilterValueForTooltip(e={},r){let i=this.getTextFilterValue(e,r.name),o=this.getIntervalTextFieldFilterValues(e,r),s=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=o[t.FROM]&&(u+=a+"(>= "+l(o[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=o[t.TO]&&(u+=a+"(<= "+l(o[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return s.forEach((e=>{c+=a+n(e,r),a=" OR "})),""!=c&&(c="("+c+")",""!=u&&(c=" AND "+c)),c=u+c,c}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var g;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.removableColumns="Sets the possibility to remove the selected column.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(g||(g={}));const k="TREE_COLUMN";var T;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(T||(T={}));const y=document.documentElement,j=y.ketchup?y.ketchup.objects:new o,C=y.ketchup?y.ketchup.data:new s;class V extends e{isFilterCompliantForCell(e,t,l){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=!1,r=[],i){return this.areCellsCompliant(e.cells,t,l,n,r,i)}areCellsCompliant(e,t={},l="",n=!1,o=[],s){if(n){let t=!0;if(o&&null!=o&&o.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<o.length;i++){if(0==o[i].visible)continue;const s=e[o[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,l);let a=r(o[i],s);if(a!=s.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==s&&(s=new w),!this.hasFilters(t,o,s))return!0;let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const r=e[n];if(!r)return!1;let u=s.getTextFilterValue(t,n),c=s.getIntervalTextFieldFilterValues(t,i(o,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(j.isNumber(r.obj)||j.isDate(r.obj)||j.isTime(r.obj)||j.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let p=s.getCheckBoxFilterValues(t,n);if(0==p.length)continue;let b=!1;for(let e=0;e<p.length;e++){let t=p[e];if(null!=t&&null!=t.value){if(null!=r.value&&r.value.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}}}if(!b)return!1}return!0}hasFilters(e={},t,l){if(null==e)return!1;let n=Object.keys(e);if(null==n||n.length<1)return!1;null==l&&(l=new w);for(let r=0;r<n.length;r++){let o=n[r],s=null;if(s=o===k?{name:k,title:""}:i(t,o),l.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},l="",n=[],r){if(!e||null==e)return[];let i=[];const o=!(!l||!n);if(this.hasFilters(t,n,r)||o)for(let s=0;s<e.length;s++){let a=e[s];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,o,n,r))&&(i[i.length]=a)}else i=[...e];return i}getColumnValues(t,n,r,i){let o=new Array;null==i&&(i=new w);let s=i.getTextFilterValueTmp(t.filters,n.name),a=i.getIntervalTextFieldFilterValuesTmp(t.filters,n),u=i.getCheckBoxFilterValues(t.filters,n.name);if(null!=n.valuesForFilter&&n.valuesForFilter.length>0)return n.valuesForFilter.forEach((t=>{let r=t;(e.valuesArrayContainsValue(u,r)||""==s||i.isFilterCompliantForSimpleValue(r,n.obj,s,a))&&o.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),o;let c=Object.assign({},t.filters);c[n.name]={textField:s,textFieldTmp:s,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)o.push(u[e]);return C.cell.getUnivocalValue({rows:f},n,!0)}}const O=document.documentElement;function I(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const l=e[0].group.column;let n=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let l of t)if(l.column===e)return l;return null}(l,t);return n||(n={column:l,sortMode:d.A}),e.sort(((e,t)=>a({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},n.sortMode))),e.forEach((e=>{e.group.children=I(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const r=M(e,n,t[l]);if(0!==r)return r}return 0}return M(e,n,t[0])}))}function M(e,t,l){const n=e.cells[l.column],r=t.cells[l.column];return n||r?n?r?a(n,r,l.sortMode):-1:1:0}function _(e=[],t={},l="",n=[],r,i){return null==i&&(i=new V),i.filterRows(e,t,l,n,r)}function N(e=[],t=[],l=[],n={}){if(!t)return[];if(!l||0===l.length||!e||0===e.length)return t;const o={},s=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return o[l]=n,!0;return!1}));if(0===s.length)return t;const a=[];let f={};return t.forEach((t=>{const l=s[0].column,h=t.cells[l];if(h){const d=i(e,l),p=r(d,h),b=h.value;let m=null;for(let e of a)if(e.group.label===p){m=e;break}null===m&&(m={group:{id:b,parent:null,column:l,columnLabel:o[l],expanded:!1,label:p,children:[],obj:h.obj,totals:{}},cells:{}},a.push(m));for(let l=1;l<s.length;l++){const n=s[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(t,a),s=a.value;let u=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===l){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:n.column,columnLabel:o[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},E(u),m.group.children.push(u)),m=u}}m.group.children.push(t),function(e,t,l,n){if(!e||!t)return;const r=Object.keys(t);0!==r.length&&r.forEach((r=>{const i=O.ketchup.math.numberify(e.group.totals[r]||0),o=l.cells[r];if(o){let l=O.ketchup.objects.isNumber(o.obj);const s=t[r];switch(s){case u.COUNT:e.group.totals[r]=i+1;let t=e.group.parent;for(;null!=t;)t.group.totals[r]=(t.group.totals[r]||0)+1,t=t.group.parent;break;case u.DISTINCT:let a;if(a=l?O.ketchup.math.numberify(c(o.value)):o.value,n[e.group.id]){let t=n[e.group.id][r];t?t.push(a):(n[e.group.id][r]=[],n[e.group.id][r].push(a))}else n[e.group.id]={},n[e.group.id][r]=[],n[e.group.id][r].push(a);let f=e.group.parent;for(;null!=f;){if(n[f.group.id]){let e=n[f.group.id][r];e?e.push(a):(n[f.group.id][r]=[],n[f.group.id][r].push(a))}else n[f.group.id]={},n[f.group.id][r]=[],n[f.group.id][r].push(a);f=f.group.parent}break;case u.SUM:case u.AVERAGE:if(l){const t=O.ketchup.math.numberify(c(o.value));e.group.totals[r]=t+i;let l=e.group.parent;for(;null!=l;){const e=O.ketchup.math.numberify(l.group.totals[r]||0);l.group.totals[r]=t+e,l=l.group.parent}}break;case u.MIN:if(l){const t=e.group.totals[r],l=O.ketchup.math.numberify(c(o.value));e.group.totals[r]=t?Math.min(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.min(e,l):l,n=n.group.parent}}else if(O.ketchup.objects.isDate(o.obj)){const t=o.obj?O.ketchup.objects.parseDate(o.obj):O.ketchup.dates.toDayjs(o.value);if(O.ketchup.dates.isValid(t)){const l=O.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(O.ketchup.dates.format(n)),e.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.min(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(O.ketchup.dates.format(e)),i.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.min(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;case u.MAX:if(l){const t=e.group.totals[r],l=O.ketchup.math.numberify(c(o.value));e.group.totals[r]=t?Math.max(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.max(e,l):l,n=n.group.parent}}else if(O.ketchup.objects.isDate(o.obj)){const t=o.obj?O.ketchup.objects.parseDate(o.obj):O.ketchup.dates.toDayjs(o.value);if(O.ketchup.dates.isValid(t)){const l=O.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(O.ketchup.dates.format(n)),e.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.max(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(O.ketchup.dates.format(e)),i.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.max(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;default:0!=s.indexOf(u.MATH)&&console.warn(`invalid total mode: ${s}`)}}}))}(m,n,t,f)}})),function(e,t,l){if(!e||!t)return;const n=Object.keys(t);if(0===e.length||!e[0].group||0===n.length)return;let r=n.filter((e=>u.DISTINCT===t[e]));r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>A(e,r,l)))}(a,n,f),W(a,u.AVERAGE,n),W(a,u.MATH,n),a}function W(e,t,l){if(!e||!l)return;const n=Object.keys(l);if(0===e.length||!e[0].group||0===n.length)return;let r;t==u.AVERAGE&&(r=n.filter((e=>u.AVERAGE===l[e]))),t==u.MATH&&(r=n.filter((e=>0==l[e].indexOf(u.MATH)))),r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>B(e,t,r,l)))}function A(e,t,l){const n=e.group.children;0!==n.length&&(n[0].group&&n.forEach((e=>{A(e,t,l)})),t.forEach((t=>{e.group.totals[t]=new Set(l[e.group.id][t]).size})))}function B(e,t,l,n){const r=e.group.children;if(0===r.length)return 0;let i=0;return r[0].group?r.forEach((e=>{i+=B(e,t,l,n)})):i=r.length,l.forEach((l=>{if(t==u.AVERAGE&&(e.group.totals[l]=O.ketchup.math.numberify(e.group.totals[l])/i),t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=O.ketchup.math.formulas.custom(t,e.group.totals)}})),i}function D(e,t){if(t){const l=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const l=t.cells[e.name];l&&e.obj&&!l.obj&&(l.obj={t:e.obj.t,p:e.obj.p,k:l.value})}}))})),l}}function $(e=[],t={}){if(O.ketchup.objects.isEmptyJsObject(e)||O.ketchup.objects.isEmptyJsObject(t))return{};const l=Object.keys(t),n={},r=new Array;if(0===l.length||l.every((e=>t[e]===u.COUNT)))l.forEach((t=>n[t]=e.length));else{let i={};e.forEach(((e,o,s)=>{l.filter((e=>u.COUNT!==t[e]&&0!=t[e].indexOf(u.MATH))).forEach((l=>{const a=e.cells[l];if(a)if(t[l]===u.DISTINCT){let e;e=O.ketchup.objects.isNumber(a.obj)?O.ketchup.math.numberify(c(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(O.ketchup.objects.isNumber(a.obj)){const e=O.ketchup.math.numberify(c(a.value));let r=n[l];switch(!0){case t[l]===u.MIN:n[l]=r?Math.min(r,e):e;break;case t[l]===u.MAX:n[l]=r?Math.max(r,e):e;break;default:r=n[l]||0,n[l]=e+O.ketchup.math.numberify(r)}}else if(O.ketchup.objects.isDate(a.obj)){-1==r.indexOf(l)&&r.push(l);const e=O.ketchup.dates.toDayjs(a.value);if(O.ketchup.dates.isValid(e)){const r=O.ketchup.dates.toDate(e),i=n[l]?O.ketchup.dates.toDate(O.ketchup.dates.toDayjs(n[l])):null;switch(!0){case t[l]===u.MIN:if(i){let e=[];e.push(r),e.push(i),n[l]=O.ketchup.dates.format(O.ketchup.dates.min(e),f.ISO_DATE)}else n[l]=O.ketchup.dates.format(r,f.ISO_DATE);break;case t[l]===u.MAX:if(i){let e=[];e.push(r),e.push(i),n[l]=O.ketchup.dates.format(O.ketchup.dates.max(e),f.ISO_DATE)}else n[l]=O.ketchup.dates.format(r,f.ISO_DATE)}}}o===s.length-1&&t[l]===u.DISTINCT&&(n[l]=new Set(i[l]).size,i[l]=[])}))}))}for(let i of l){switch(!0){case t[i]===u.AVERAGE:const l=n[i];l&&e.length>0&&(n[i]=l/e.length);break;case t[i]===u.COUNT:n[i]=e.length;break;case 0==t[i].indexOf(u.MATH):n[i]=O.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=O.ketchup.dates.format(n[i]):h(n[i])&&(n[i]=+n[i].toFixed(2)))}return n}function E(e){if(!e.group)return;let t=e.group.id,l=e.group.parent;for(;null!==l;)t=`${l.group.id};${t}`,l=l.group.parent;e.group.id=t}function L(e,t,l,n){const r=t*l-l,i=r+Number(l);if(0==n)return e.slice(r,i);let o=[];return S(e,o,r,Number(l),0),o}function S(e,t,l,n,r){let i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=q(e[o]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=S(s.group.children,a.group.children,l,n,r);r=e.ci,i=e.added,1==i&&(t[t.length]=a)}else r>=l&&(t[t.length]=a,i=!0),r++;if(r>=l+n)break}return{ci:r,added:i}}function q(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:z(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function R(e){if(null==e)return null;let t=[];for(let l=0;l<e.length;l++)t[t.length]=q(e[l]);return t}function z(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:R(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}var H;!function(e){e.SIMPLE="simple",e.FULL="full"}(H||(H={}));const J=document.documentElement,K=e=>{const t=Math.ceil(e.max/e.perPage),l=function(e,t){const l=[];for(let n=1;n<=t;n++){const t=n==e.currentPage;l.push({id:n.toString(),selected:t,value:n.toString()})}return l}(e,t),n=function(e){const t=[];let l=e.perPage;if(0===l)return t;for(;l<e.max;){const n=l==e.perPage;t.push({id:l.toString(),selected:n,value:l.toString()}),l*=2}const n=e.max==e.perPage;return t.push({id:e.max.toString(),selected:n,value:e.max.toString()}),t}(e),r={"kup-list":{data:l},"kup-text-field":{label:J.ketchup.language.translate(p.PAGE),helper:J.ketchup.language.translate(p.TOTAL)+`: ${t}`,helperWhenFocused:!0,inputType:"number",max:t,min:1}},i={"kup-list":{data:n},"kup-text-field":{label:J.ketchup.language.translate(b.ROWS)+" / "+J.ketchup.language.translate(p.PAGE),helper:J.ketchup.language.translate(b.TOTAL)+`: ${e.max}`,helperWhenFocused:!0,inputType:"number",max:e.max,min:1}};return v("div",Object.assign({class:`f-paginator ${e.mode?e.mode:""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),e.mode!==H.SIMPLE?v(F,{icon:"chevron_left",disabled:G(e),onClick:e.onPrevPage,wrapperClass:"prev-page"}):null,v("kup-combobox",{class:"page-selector",data:r,initialValue:e.currentPage.toString(),"onkup-combobox-change":e.onPageChange}),e.mode!==H.SIMPLE?v(F,{icon:"chevron_right",disabled:U(e),onClick:e.onNextPage,wrapperClass:"next-page"}):null,v("kup-combobox",{class:"rows-selector",data:i,initialValue:e.perPage.toString(),"onkup-combobox-change":e.onRowsChange}),e.onLoadMore?v(F,{icon:"plus",onClick:e.onLoadMore,label:J.ketchup.language.translate(m.LOAD_MORE),styling:x.FLAT,wrapperClass:"load-more-button"}):null)};function U(e){return e.currentPage*e.perPage>=e.max}function G(e){return 1==e.currentPage}function P(e,t,l){if(h(e)){const n=Math.ceil(t/l);let r=e;return r>n&&(r=n),r<1&&(r=1),r}return null}function Q(e,t){if(h(e)){let l=e;return l>t&&(l=t),l<1&&(l=1),l}return null}export{w as F,T as K,V as a,K as b,$ as c,P as d,g as e,_ as f,N as g,H as h,D as n,L as p,Q as r,I as s,k as t}
@@ -0,0 +1 @@
1
+ import{h as t,a as e}from"./p-9dcfbb1e.js";import{b as s}from"./p-4fc2a726.js";var i;!function(t){t.BAR="bar"}(i||(i={}));const a=a=>{let n,o;a.resource?a.resource.indexOf(".")>-1||a.resource.indexOf("/")>-1||a.resource.indexOf("\\")>-1?(o={"--kup_image_height":a.sizeY?a.sizeY:"auto","--kup_image_width":a.sizeX?a.sizeX:"100%"},n=function(e){return t("img",{onLoad:e.onLoad,src:e.resource})}(a)):(o={"--kup_image_height":a.sizeY?a.sizeY:"100%","--kup_image_width":a.sizeX?a.sizeX:"100%"},n=function(i){const a={"f-image__icon":!0},n={background:i.color?i.color:`var(${s.ICON})`};if(i.resource.indexOf("--kup")>-1){let t=i.resource.replace("--","");a["kup-icon"]=!0,a[t]=!0}else{const t=e(`./assets/svg/${i.resource}.svg`);n.mask=`url('${t}') no-repeat center`,n.webkitMask=`url('${t}') no-repeat center`}return t("div",{class:a,style:n})}(a)):a.data&&(o={"--kup_image_height":a.sizeY?a.sizeY:"100%","--kup_image_width":a.sizeX?a.sizeX:"100%"},n=function(e){const s=[];let a=0;for(let n=0;n<e.length;n++){let o;e[n].shape||(e[n].shape=i.BAR),e[n].color||(e[n].color="transparent"),e[n].height||(e[n].height="100%"),e[n].width||(e[n].width="100%");const r="step-"+n,c="css-step bottom-aligned",l={backgroundColor:e[n].color,left:a+"%",height:e[n].height,width:e[n].width};a+=parseFloat(e[n].width),o=t("span",{id:r,class:c,style:l}),s.push(o)}return t("div",{class:"f-image__css"},s)}(a.data));const r=[];if(a.badgeData)for(let e=0;e<a.badgeData.length;e++)r.push(t("kup-badge",Object.assign({},a.badgeData[e])));return t("div",Object.assign({class:`f-image ${a.wrapperClass?a.wrapperClass:""} ${a.fit?"kup-fit":""}`},a.dataSet,{id:a.id,style:o,title:a.title,onClick:a.onClick}),n,...r)};export{a as F}
@@ -6,8 +6,8 @@ export declare class KupDataTableState implements KupState {
6
6
  expandGroups: boolean;
7
7
  groupLabelDisplay: GroupLabelDisplayMode;
8
8
  density: string;
9
- enableSortableColumns: boolean;
10
9
  enableExtraColumns: boolean;
10
+ enableSortableColumns: boolean;
11
11
  forceOneLine: boolean;
12
12
  globalFilter: boolean;
13
13
  globalFilterValue: string;
@@ -43,7 +43,9 @@ export declare enum KupEchartMaps {
43
43
  WORLD = "world"
44
44
  }
45
45
  export declare enum KupEchartTypes {
46
+ AREA = "Area",
46
47
  BAR = "Bar",
48
+ HBAR = "HBar",
47
49
  GAUSSIAN = "Gaussian",
48
50
  LINE = "Line",
49
51
  MAP = "Map",
@@ -72,6 +72,8 @@ export declare class KupImage {
72
72
  private kupManager;
73
73
  kupClick: EventEmitter<KupImageClickEventPayload>;
74
74
  onKupClick(e: Event): void;
75
+ kupLoad: EventEmitter<KupImageClickEventPayload>;
76
+ onKupLoad(e: Event): void;
75
77
  /**
76
78
  * Used to retrieve component's props values.
77
79
  * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
@@ -1,8 +1,10 @@
1
+ /// <reference types="react" />
1
2
  import { Detail, GanttTask } from '@sme.up/gantt-component';
2
3
  import { Phase } from '@sme.up/gantt-component';
3
4
  import { GanttRow } from '@sme.up/gantt-component';
4
5
  import { KupEventPayload } from '../../components';
5
- import { KupDataRow } from '../../managers/kup-data/kup-data-declarations';
6
+ import { KupDataColumn, KupDataRow } from '../../managers/kup-data/kup-data-declarations';
7
+ import { KupDataTableCell } from '../kup-data-table/kup-data-table-declarations';
6
8
  /**
7
9
  * Props of the kup-gantt component.
8
10
  * Used to export every prop in an object.
@@ -37,13 +39,25 @@ export declare enum KupPlannerProps {
37
39
  titleMess = "Message displayed on top"
38
40
  }
39
41
  export declare enum KupPlannerTaskAction {
40
- onOpening = "onOpening",
41
- onClosing = "onClosing"
42
+ onTaskOpening = "onTaskOpening",
43
+ onTaskClosing = "onTaskClosing",
44
+ onClick = "onClick",
45
+ onResize = "onResize",
46
+ onRightClick = "onRightClick"
42
47
  }
43
48
  export interface KupPlannerEventPayload extends KupEventPayload {
44
49
  value: GanttRow;
45
50
  taskAction?: KupPlannerTaskAction;
46
51
  }
52
+ export interface KupPlannerClickEventPayload extends KupPlannerEventPayload {
53
+ details: KupPlannerEventHandlerDetails;
54
+ }
55
+ export interface KupPlannerEventHandlerDetails {
56
+ cell: KupDataTableCell;
57
+ column: KupDataColumn;
58
+ originalEvent: React.MouseEvent<Element, MouseEvent>;
59
+ row: KupDataRow;
60
+ }
47
61
  export declare enum KupPlannerGanttRowType {
48
62
  TASK = "task",
49
63
  PHASE = "phase",
@@ -56,6 +70,7 @@ export interface KupPlannerGanttTask extends GanttTask {
56
70
  }
57
71
  export interface KupPlannerDetail extends Detail {
58
72
  rowType: KupPlannerGanttRowType;
73
+ detailRow: KupDataRow;
59
74
  }
60
75
  export interface KupPlannerPhase extends Phase {
61
76
  taskRowId: string;
@@ -1,6 +1,7 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
2
  import { GenericObject } from '../../types/GenericTypes';
3
- import { KupPlannerEventPayload, KupPlannerGanttTask, KupPlannerPhase, KupPlannerTaskAction, KupPlannerDetail } from './kup-planner-declarations';
3
+ import { KupPlannerEventPayload, KupPlannerGanttTask, KupPlannerPhase, KupPlannerTaskAction, KupPlannerDetail, KupPlannerClickEventPayload } from './kup-planner-declarations';
4
+ import React from 'react';
4
5
  import { KupDataDataset } from '../../managers/kup-data/kup-data-declarations';
5
6
  import { GanttRow, PlannerProps } from '@sme.up/gantt-component';
6
7
  export declare class KupPlanner {
@@ -9,11 +10,6 @@ export declare class KupPlanner {
9
10
  * References the root HTML element of the component (<kup-planner>).
10
11
  */
11
12
  rootElement: HTMLElement;
12
- /**
13
- * The value of the component.
14
- * @default ""
15
- */
16
- plannerProps: PlannerProps;
17
13
  /**
18
14
  * Custom style of the component.
19
15
  * @default ""
@@ -50,6 +46,11 @@ export declare class KupPlanner {
50
46
  * @default null
51
47
  */
52
48
  detailHeight: number;
49
+ /**
50
+ * Column containing icon name to show, for detail
51
+ * @default null
52
+ */
53
+ detailIconCol: string;
53
54
  /**
54
55
  * Column containing unique detail identifier
55
56
  * @default null
@@ -61,7 +62,7 @@ export declare class KupPlanner {
61
62
  */
62
63
  detailNameCol: string;
63
64
  /**
64
- * Columns containing fForecast detail duration, from (firstDate) to (secondDate)
65
+ * Columns containing forecast detail duration, from (firstDate) to (secondDate)
65
66
  * @default null
66
67
  */
67
68
  detailPrevDates: string[];
@@ -95,6 +96,11 @@ export declare class KupPlanner {
95
96
  * @default null
96
97
  */
97
98
  phaseDates: string[];
99
+ /**
100
+ * Column containing icon name to show, for phase
101
+ * @default null
102
+ */
103
+ phaseIconCol: string;
98
104
  /**
99
105
  * Column containing unique phase identifier
100
106
  * @default null
@@ -130,6 +136,11 @@ export declare class KupPlanner {
130
136
  * @default null
131
137
  */
132
138
  taskHeight: number;
139
+ /**
140
+ * Column containing icon name to show, for task
141
+ * @default null
142
+ */
143
+ taskIconCol: string;
133
144
  /**
134
145
  * Column containing unique task identifier
135
146
  * @default null
@@ -150,11 +161,20 @@ export declare class KupPlanner {
150
161
  * @default null
151
162
  */
152
163
  titleMess: string;
164
+ /**
165
+ * The value of the component.
166
+ * @default ""
167
+ */
168
+ plannerProps: PlannerProps;
169
+ dataChanged(): void;
170
+ showSecondaryDatesChanged(): void;
153
171
  kupClick: EventEmitter<KupPlannerEventPayload>;
154
- onKupClick(event: GanttRow, taskAction?: KupPlannerTaskAction): void;
155
172
  kupDateChange: EventEmitter<KupPlannerEventPayload>;
156
- onKupDateChange(event: GanttRow): void;
157
173
  kupReady: EventEmitter<KupPlannerEventPayload>;
174
+ /**
175
+ * Generic right click event on planner.
176
+ */
177
+ kupContextMenu: EventEmitter<KupPlannerClickEventPayload>;
158
178
  /**
159
179
  * Used to retrieve component's props values.
160
180
  * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
@@ -176,12 +196,17 @@ export declare class KupPlanner {
176
196
  * @param data - Matrix which contains project phases
177
197
  */
178
198
  addPhases(taskId: string, data: KupDataDataset): Promise<void>;
179
- handleOnClick(nativeEvent: KupPlannerGanttTask | KupPlannerPhase | KupPlannerDetail): void;
180
- handleOnDateChange(nativeEvent: GanttRow): void;
181
199
  componentWillLoad(): void;
182
200
  componentDidLoad(): void;
183
201
  componentWillRender(): void;
184
202
  componentDidRender(): void;
203
+ onKupClick(event: GanttRow, taskAction?: KupPlannerTaskAction): void;
204
+ onKupContextMenu(event: React.MouseEvent<Element, MouseEvent>, ganttRow: GanttRow, taskAction?: KupPlannerTaskAction): void;
205
+ onKupDateChange(event: GanttRow, taskAction?: KupPlannerTaskAction): void;
206
+ handleOnClick(nativeEvent: KupPlannerGanttTask | KupPlannerPhase | KupPlannerDetail): void;
207
+ handleOnContextMenu(event: React.MouseEvent<Element, MouseEvent>, row: KupPlannerGanttTask | KupPlannerPhase | KupPlannerDetail): void;
208
+ handleOnSetDoubleView(checked: boolean): void;
209
+ handleOnDateChange(nativeEvent: KupPlannerGanttTask | KupPlannerPhase | KupPlannerDetail): void;
185
210
  render(): any;
186
211
  disconnectedCallback(): void;
187
212
  }
@@ -8,6 +8,7 @@ import { GenericObject, KupEventPayload } from '../../types/GenericTypes';
8
8
  import { FCellPadding } from '../../f-components/f-cell/f-cell-declarations';
9
9
  import { KupDataColumn, KupDataDataset, KupDataRow } from '../../managers/kup-data/kup-data-declarations';
10
10
  export declare class KupTree {
11
+ #private;
11
12
  /**
12
13
  * References the root HTML element of the component (<kup-tree>).
13
14
  */
@@ -153,10 +154,6 @@ export declare class KupTree {
153
154
  * Defines the current totals options.
154
155
  */
155
156
  totals: TotalsMap;
156
- /**
157
- * Instance of the KupManager class.
158
- */
159
- private kupManager;
160
157
  /**
161
158
  * Reference to the column menu card.
162
159
  */
@@ -298,7 +295,6 @@ export declare class KupTree {
298
295
  private onTotalMenuOpen;
299
296
  private getEventDetails;
300
297
  private contextMenuHandler;
301
- private getEventPath;
302
298
  hdlTreeNodeClick(e: MouseEvent, treeNodeData: KupTreeNode, treeNodePath: string): void;
303
299
  hdlTreeNodeExpanderClick(treeNodeData: KupTreeNode, treeNodePath: string, ctrlKey: boolean): void;
304
300
  private hasTotals;
@@ -43,7 +43,7 @@ import { KupImageListEventPayload } from "./components/kup-image-list/kup-image-
43
43
  import { KupLazyRender } from "./components/kup-lazy/kup-lazy-declarations";
44
44
  import { KupNavBarStyling } from "./components/kup-nav-bar/kup-nav-bar-declarations";
45
45
  import { KupNumericPickerEventPayload } from "./components/kup-numeric-picker/kup-numeric-picker-declarations";
46
- import { KupPlannerEventPayload, KupPlannerPhase } from "./components/kup-planner/kup-planner-declarations";
46
+ import { KupPlannerClickEventPayload, KupPlannerEventPayload, KupPlannerPhase } from "./components/kup-planner/kup-planner-declarations";
47
47
  import { TaskType } from "@sme.up/gantt-component/dist/types/public-types";
48
48
  import { KupQlikGrid, QlikServer } from "./components/kup-qlik/kup-qlik-declarations";
49
49
  import { KupRadioChangeEventPayload, KupRadioData } from "./components/kup-radio/kup-radio-declarations";
@@ -90,7 +90,7 @@ export { KupImageListEventPayload } from "./components/kup-image-list/kup-image-
90
90
  export { KupLazyRender } from "./components/kup-lazy/kup-lazy-declarations";
91
91
  export { KupNavBarStyling } from "./components/kup-nav-bar/kup-nav-bar-declarations";
92
92
  export { KupNumericPickerEventPayload } from "./components/kup-numeric-picker/kup-numeric-picker-declarations";
93
- export { KupPlannerEventPayload, KupPlannerPhase } from "./components/kup-planner/kup-planner-declarations";
93
+ export { KupPlannerClickEventPayload, KupPlannerEventPayload, KupPlannerPhase } from "./components/kup-planner/kup-planner-declarations";
94
94
  export { TaskType } from "@sme.up/gantt-component/dist/types/public-types";
95
95
  export { KupQlikGrid, QlikServer } from "./components/kup-qlik/kup-qlik-declarations";
96
96
  export { KupRadioChangeEventPayload, KupRadioData } from "./components/kup-radio/kup-radio-declarations";
@@ -2479,6 +2479,11 @@ export namespace Components {
2479
2479
  * @default null
2480
2480
  */
2481
2481
  "detailHeight": number;
2482
+ /**
2483
+ * Column containing icon name to show, for detail
2484
+ * @default null
2485
+ */
2486
+ "detailIconCol": string;
2482
2487
  /**
2483
2488
  * Column containing unique detail identifier
2484
2489
  * @default null
@@ -2490,7 +2495,7 @@ export namespace Components {
2490
2495
  */
2491
2496
  "detailNameCol": string;
2492
2497
  /**
2493
- * Columns containing fForecast detail duration, from (firstDate) to (secondDate)
2498
+ * Columns containing forecast detail duration, from (firstDate) to (secondDate)
2494
2499
  * @default null
2495
2500
  */
2496
2501
  "detailPrevDates": string[];
@@ -2530,6 +2535,11 @@ export namespace Components {
2530
2535
  * @default null
2531
2536
  */
2532
2537
  "phaseDates": string[];
2538
+ /**
2539
+ * Column containing icon name to show, for phase
2540
+ * @default null
2541
+ */
2542
+ "phaseIconCol": string;
2533
2543
  /**
2534
2544
  * Column containing unique phase identifier
2535
2545
  * @default null
@@ -2574,6 +2584,11 @@ export namespace Components {
2574
2584
  * @default null
2575
2585
  */
2576
2586
  "taskHeight": number;
2587
+ /**
2588
+ * Column containing icon name to show, for task
2589
+ * @default null
2590
+ */
2591
+ "taskIconCol": string;
2577
2592
  /**
2578
2593
  * Column containing unique task identifier
2579
2594
  * @default null
@@ -5483,6 +5498,7 @@ declare namespace LocalJSX {
5483
5498
  */
5484
5499
  "isCanvas"?: boolean;
5485
5500
  "onKup-image-click"?: (event: KupImageCustomEvent<KupImageClickEventPayload>) => void;
5501
+ "onKup-image-load"?: (event: KupImageCustomEvent<KupImageClickEventPayload>) => void;
5486
5502
  /**
5487
5503
  * The resource used to fetch the image.
5488
5504
  * @default null
@@ -5783,6 +5799,11 @@ declare namespace LocalJSX {
5783
5799
  * @default null
5784
5800
  */
5785
5801
  "detailHeight"?: number;
5802
+ /**
5803
+ * Column containing icon name to show, for detail
5804
+ * @default null
5805
+ */
5806
+ "detailIconCol"?: string;
5786
5807
  /**
5787
5808
  * Column containing unique detail identifier
5788
5809
  * @default null
@@ -5794,7 +5815,7 @@ declare namespace LocalJSX {
5794
5815
  */
5795
5816
  "detailNameCol"?: string;
5796
5817
  /**
5797
- * Columns containing fForecast detail duration, from (firstDate) to (secondDate)
5818
+ * Columns containing forecast detail duration, from (firstDate) to (secondDate)
5798
5819
  * @default null
5799
5820
  */
5800
5821
  "detailPrevDates"?: string[];
@@ -5809,6 +5830,10 @@ declare namespace LocalJSX {
5809
5830
  */
5810
5831
  "maxWidth"?: string;
5811
5832
  "onKup-planner-click"?: (event: KupPlannerCustomEvent<KupPlannerEventPayload>) => void;
5833
+ /**
5834
+ * Generic right click event on planner.
5835
+ */
5836
+ "onKup-planner-contextmenu"?: (event: KupPlannerCustomEvent<KupPlannerClickEventPayload>) => void;
5812
5837
  "onKup-planner-datechange"?: (event: KupPlannerCustomEvent<KupPlannerEventPayload>) => void;
5813
5838
  "onKup-planner-ready"?: (event: KupPlannerCustomEvent<KupPlannerEventPayload>) => void;
5814
5839
  /**
@@ -5831,6 +5856,11 @@ declare namespace LocalJSX {
5831
5856
  * @default null
5832
5857
  */
5833
5858
  "phaseDates"?: string[];
5859
+ /**
5860
+ * Column containing icon name to show, for phase
5861
+ * @default null
5862
+ */
5863
+ "phaseIconCol"?: string;
5834
5864
  /**
5835
5865
  * Column containing unique phase identifier
5836
5866
  * @default null
@@ -5866,6 +5896,11 @@ declare namespace LocalJSX {
5866
5896
  * @default null
5867
5897
  */
5868
5898
  "taskHeight"?: number;
5899
+ /**
5900
+ * Column containing icon name to show, for task
5901
+ * @default null
5902
+ */
5903
+ "taskIconCol"?: string;
5869
5904
  /**
5870
5905
  * Column containing unique task identifier
5871
5906
  * @default null
@@ -12,6 +12,7 @@ export interface FImageProps extends FComponent {
12
12
  sizeX?: string;
13
13
  sizeY?: string;
14
14
  onClick?: (event: MouseEvent) => void;
15
+ onLoad?: (event: Event) => void;
15
16
  }
16
17
  /**
17
18
  * The object of a single step of CSS when the f-image is in CSS-drawing mode.
@@ -15,7 +15,7 @@ export interface KupLanguageJSON {
15
15
  */
16
16
  export interface KupLanguageElement {
17
17
  keys: GenericObject;
18
- variants: {
18
+ variants?: {
19
19
  keys: GenericObject;
20
20
  };
21
21
  }
@@ -55,6 +55,7 @@ export interface KupManager {
55
55
  toggleMagicBox: () => void;
56
56
  setLibraryLocalization: (locale: KupDatesLocales) => void;
57
57
  addClickCallback: (cb: KupManagerClickCb, async?: boolean) => void;
58
+ getEventPath: (currentEl: unknown, rootElement: HTMLElement) => HTMLElement[];
58
59
  removeClickCallback: (cb: KupManagerClickCb) => void;
59
60
  rasterize: (el: HTMLElement, options?: Partial<Options>) => Promise<HTMLCanvasElement>;
60
61
  }
@@ -64,6 +64,13 @@ export declare class KupManager {
64
64
  * @param {boolean} async - When true, the callback will be added asynchrounously to prevent instant firing if it was added through a click event.
65
65
  */
66
66
  addClickCallback(cb: KupManagerClickCb, async?: boolean): void;
67
+ /**
68
+ * Retrives event path from event.target
69
+ * @param currentEl event.target
70
+ * @param rootElement rootElement of component
71
+ * @returns
72
+ */
73
+ getEventPath(currentEl: unknown, rootElement: HTMLElement): HTMLElement[];
67
74
  /**
68
75
  * Rasterizes an HTMLElement, transforming into a canvas.
69
76
  * @param {HTMLElement} el - Element to rasterize.
@@ -93,6 +93,7 @@ export declare enum KupTagNames {
93
93
  MAGIC_BOX = "KUP-MAGIC-BOX",
94
94
  NAV_BAR = "KUP-NAV-BAR",
95
95
  NUMERIC_PICKER = "KUP-NUMERIC-PICKER",
96
+ PLANNER = "KUP-PLANNER",
96
97
  PROBE = "KUP-PROBE",
97
98
  PROGRESS_BAR = "KUP-PROGRESS-BAR",
98
99
  QLIK = "KUP-QLIK",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sme.up/ketchup",
3
- "version": "7.4.2",
3
+ "version": "8.0.0a",
4
4
  "keywords": [
5
5
  "smeup",
6
6
  "KetchUP",
@@ -31,7 +31,8 @@
31
31
  "build": "npm run build:setup && stencil build --docs",
32
32
  "start": "npm run build:setup && stencil build --dev --watch --serve",
33
33
  "start--es5": "npm run build:setup && stencil build --dev --watch --serve --es5",
34
- "test:spec": "npm run build:setup && stencil test --spec",
34
+ "test:spec": "rimraf target && npm run build:setup && stencil test --spec",
35
+ "test:speccov": "rimraf target && npm run build:setup && stencil test --spec --coverage",
35
36
  "test:e2e": "npm run build:setup && stencil test --e2e",
36
37
  "test": "npm run build:setup && stencil test --spec --e2e",
37
38
  "test.watch": "npm run build:setup && stencil test --spec --e2e --watchAll",
@@ -47,7 +48,7 @@
47
48
  "@material/form-field": "^14.0.0",
48
49
  "@material/ripple": "^14.0.0",
49
50
  "@material/textfield": "^14.0.0",
50
- "@sme.up/gantt-component": "^1.3.20",
51
+ "@sme.up/gantt-component": "^1.3.25",
51
52
  "d3-shape": "^3.1.0",
52
53
  "dayjs": "^1.11.1",
53
54
  "echarts": "^5.3.2",
@@ -61,24 +62,11 @@
61
62
  "vanilla-picker": "^2.12.1"
62
63
  },
63
64
  "devDependencies": {
64
- "@stencil/core": "^3.1.0",
65
- "@stencil/sass": "^1.4.1",
66
- "@stencil/react-output-target": "0.3.1",
67
- "@types/d3-shape": "^3.0.2",
68
- "@types/geojson": "^7946.0.8",
69
- "@types/jest": "^26.0.24",
70
- "@types/jest-cli": "^24.3.0",
71
- "@types/node": "^14.5.0",
72
- "@types/numeral": "^2.0.2",
73
- "@types/puppeteer": "^5.4.3",
74
- "@types/react": "^18.0.28",
75
- "@types/react-dom": "^18.0.10",
76
- "jest": "^26.6.3",
77
- "jest-cli": "^26.6.3",
78
- "jest-environment-node": "^26.6.2",
79
- "puppeteer": "^13.5.1",
65
+ "@stencil/core": "^3.2.0",
66
+ "@stencil/sass": "^3.0.0",
67
+ "@stencil/react-output-target": "0.5.0",
80
68
  "rimraf": "^3.0.2",
81
- "sass": "^1.50.1"
69
+ "sass": "^1.60.0"
82
70
  },
83
71
  "repository": {
84
72
  "type": "git",