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

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 (208) hide show
  1. package/dist/cjs/{f-cell-f5c22ae3.js → f-cell-6a44d289.js} +11 -15
  2. package/dist/cjs/{f-chip-18b45cbc.js → f-chip-0cf9aa65.js} +1 -1
  3. package/dist/cjs/{f-object-field-2c4c3ac5.js → f-object-field-bdc84b8c.js} +2 -2
  4. package/dist/cjs/{f-paginator-utils-53078606.js → f-paginator-utils-8a6562a8.js} +6 -5
  5. package/dist/cjs/{f-text-field-6615a856.js → f-text-field-0ba5b010.js} +9 -1
  6. package/dist/cjs/index.cjs.js +1 -1
  7. package/dist/cjs/ketchup.cjs.js +1 -1
  8. package/dist/cjs/kup-accordion.cjs.entry.js +1 -1
  9. package/dist/cjs/kup-activity-timeline.cjs.entry.js +2 -2
  10. package/dist/cjs/kup-autocomplete_28.cjs.entry.js +49 -22
  11. package/dist/cjs/kup-box.cjs.entry.js +7 -7
  12. package/dist/cjs/kup-calendar.cjs.entry.js +2 -2
  13. package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
  14. package/dist/cjs/kup-cell.cjs.entry.js +5 -5
  15. package/dist/cjs/kup-dashboard.cjs.entry.js +2 -2
  16. package/dist/cjs/{kup-data-table-helper-ba879f52.js → kup-data-table-helper-45809a34.js} +1 -1
  17. package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
  18. package/dist/cjs/kup-echart.cjs.entry.js +1 -1
  19. package/dist/cjs/kup-editor.cjs.entry.js +1 -1
  20. package/dist/cjs/kup-family-tree.cjs.entry.js +1 -1
  21. package/dist/cjs/kup-grid.cjs.entry.js +1 -1
  22. package/dist/cjs/kup-htm.cjs.entry.js +1 -1
  23. package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
  24. package/dist/cjs/kup-image-list.cjs.entry.js +5 -5
  25. package/dist/cjs/kup-input-panel.cjs.entry.js +6 -6
  26. package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
  27. package/dist/cjs/kup-magic-box.cjs.entry.js +1 -1
  28. package/dist/cjs/{kup-manager-0bde5b3e.js → kup-manager-577da7ec.js} +115 -9
  29. package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
  30. package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
  31. package/dist/cjs/kup-object-field.cjs.entry.js +3 -3
  32. package/dist/cjs/kup-pdf.cjs.entry.js +1 -1
  33. package/dist/cjs/kup-planner.cjs.entry.js +2 -2
  34. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  35. package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
  36. package/dist/cjs/kup-snackbar.cjs.entry.js +1 -1
  37. package/dist/cjs/kup-txt.cjs.entry.js +1 -1
  38. package/dist/cjs/kup-typography-list.cjs.entry.js +1 -1
  39. package/dist/cjs/kup-typography.cjs.entry.js +6 -2
  40. package/dist/cjs/loader.cjs.js +1 -1
  41. package/dist/collection/components/kup-data-table/kup-data-table.js +43 -14
  42. package/dist/collection/components/kup-input-panel/kup-input-panel.css +12 -0
  43. package/dist/collection/components/kup-tree/kup-tree.js +2 -1
  44. package/dist/collection/components/kup-typography/kup-typography.js +5 -1
  45. package/dist/collection/f-components/f-cell/f-cell.js +7 -11
  46. package/dist/collection/f-components/f-paginator/f-paginator.js +5 -4
  47. package/dist/collection/f-components/f-text-field/f-text-field.js +8 -0
  48. package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js +70 -8
  49. package/dist/collection/managers/kup-manager/kup-manager.js +24 -0
  50. package/dist/collection/managers/kup-perf-tuning/kup-perf-tuning-declarations.js +1 -0
  51. package/dist/collection/managers/kup-perf-tuning/kup-perf-tuning.js +24 -0
  52. package/dist/components/index.js +1 -1
  53. package/dist/components/kup-accordion.js +2 -2
  54. package/dist/components/kup-activity-timeline.js +2 -2
  55. package/dist/components/kup-autocomplete.js +1 -1
  56. package/dist/components/kup-badge.js +1 -1
  57. package/dist/components/kup-box.js +1 -1
  58. package/dist/components/kup-button-list.js +1 -1
  59. package/dist/components/kup-button.js +1 -1
  60. package/dist/components/kup-calendar.js +2 -2
  61. package/dist/components/kup-card-list.js +3 -3
  62. package/dist/components/kup-card.js +1 -1
  63. package/dist/components/kup-cell.js +2 -2
  64. package/dist/components/kup-chart.js +1 -1
  65. package/dist/components/kup-checkbox.js +1 -1
  66. package/dist/components/kup-chip.js +1 -1
  67. package/dist/components/kup-color-picker.js +1 -1
  68. package/dist/components/kup-combobox.js +1 -1
  69. package/dist/components/kup-dashboard.js +2 -2
  70. package/dist/components/kup-data-table.js +1 -1
  71. package/dist/components/kup-date-picker.js +1 -1
  72. package/dist/components/kup-dialog.js +1 -1
  73. package/dist/components/kup-drawer.js +2 -2
  74. package/dist/components/kup-dropdown-button.js +1 -1
  75. package/dist/components/kup-echart.js +1 -1
  76. package/dist/components/kup-editor.js +1 -1
  77. package/dist/components/kup-family-tree.js +3 -3
  78. package/dist/components/kup-form.js +1 -1
  79. package/dist/components/kup-gauge.js +1 -1
  80. package/dist/components/kup-grid.js +1 -1
  81. package/dist/components/kup-htm.js +2 -2
  82. package/dist/components/kup-iframe.js +2 -2
  83. package/dist/components/kup-image-list.js +2 -2
  84. package/dist/components/kup-image.js +1 -1
  85. package/dist/components/kup-input-panel.js +4 -4
  86. package/dist/components/kup-lazy.js +2 -2
  87. package/dist/components/kup-list.js +1 -1
  88. package/dist/components/kup-magic-box.js +4 -4
  89. package/dist/components/kup-nav-bar.js +2 -2
  90. package/dist/components/kup-numeric-picker.js +2 -2
  91. package/dist/components/kup-object-field.js +2 -2
  92. package/dist/components/kup-pdf.js +2 -2
  93. package/dist/components/kup-planner.js +2 -2
  94. package/dist/components/kup-probe.js +2 -2
  95. package/dist/components/kup-progress-bar.js +1 -1
  96. package/dist/components/kup-qlik.js +2 -2
  97. package/dist/components/kup-radio.js +1 -1
  98. package/dist/components/kup-rating.js +1 -1
  99. package/dist/components/kup-snackbar.js +2 -2
  100. package/dist/components/kup-spinner.js +1 -1
  101. package/dist/components/kup-switch.js +1 -1
  102. package/dist/components/kup-tab-bar.js +1 -1
  103. package/dist/components/kup-text-field.js +1 -1
  104. package/dist/components/kup-time-picker.js +1 -1
  105. package/dist/components/kup-toolbar.js +1 -1
  106. package/dist/components/kup-tree.js +1 -1
  107. package/dist/components/kup-txt.js +2 -2
  108. package/dist/components/kup-typography-list.js +2 -2
  109. package/dist/components/kup-typography.js +7 -3
  110. package/dist/components/{p-1d28c626.js → p-0cbdfe38.js} +2 -2
  111. package/dist/components/{p-0c4c10f2.js → p-27005da8.js} +115 -9
  112. package/dist/components/{p-4a247d05.js → p-8933ce00.js} +2 -2
  113. package/dist/components/{p-4d78f4b5.js → p-94a659ba.js} +65 -33
  114. package/dist/components/{p-b2085cfb.js → p-94e89d81.js} +2 -2
  115. package/dist/components/{p-08a824b7.js → p-9e382ae3.js} +2 -2
  116. package/dist/esm/{f-cell-40840ce5.js → f-cell-00a8bbea.js} +11 -15
  117. package/dist/esm/{f-chip-db575f2c.js → f-chip-c18c9dbe.js} +1 -1
  118. package/dist/esm/{f-object-field-83a4b83e.js → f-object-field-4ffbdea3.js} +2 -2
  119. package/dist/esm/{f-paginator-utils-6acf3cdb.js → f-paginator-utils-ff6255f2.js} +6 -5
  120. package/dist/esm/{f-text-field-b4ff1e80.js → f-text-field-c6f94648.js} +9 -1
  121. package/dist/esm/index.js +1 -1
  122. package/dist/esm/ketchup.js +1 -1
  123. package/dist/esm/kup-accordion.entry.js +1 -1
  124. package/dist/esm/kup-activity-timeline.entry.js +2 -2
  125. package/dist/esm/kup-autocomplete_28.entry.js +49 -22
  126. package/dist/esm/kup-box.entry.js +7 -7
  127. package/dist/esm/kup-calendar.entry.js +2 -2
  128. package/dist/esm/kup-card-list.entry.js +1 -1
  129. package/dist/esm/kup-cell.entry.js +5 -5
  130. package/dist/esm/kup-dashboard.entry.js +2 -2
  131. package/dist/esm/{kup-data-table-helper-7000285d.js → kup-data-table-helper-c6706fc8.js} +1 -1
  132. package/dist/esm/kup-drawer.entry.js +1 -1
  133. package/dist/esm/kup-echart.entry.js +1 -1
  134. package/dist/esm/kup-editor.entry.js +1 -1
  135. package/dist/esm/kup-family-tree.entry.js +1 -1
  136. package/dist/esm/kup-grid.entry.js +1 -1
  137. package/dist/esm/kup-htm.entry.js +1 -1
  138. package/dist/esm/kup-iframe.entry.js +1 -1
  139. package/dist/esm/kup-image-list.entry.js +5 -5
  140. package/dist/esm/kup-input-panel.entry.js +6 -6
  141. package/dist/esm/kup-lazy.entry.js +1 -1
  142. package/dist/esm/kup-magic-box.entry.js +1 -1
  143. package/dist/esm/{kup-manager-f8d8e705.js → kup-manager-3a2bce62.js} +115 -9
  144. package/dist/esm/kup-nav-bar.entry.js +1 -1
  145. package/dist/esm/kup-numeric-picker.entry.js +2 -2
  146. package/dist/esm/kup-object-field.entry.js +3 -3
  147. package/dist/esm/kup-pdf.entry.js +1 -1
  148. package/dist/esm/kup-planner.entry.js +2 -2
  149. package/dist/esm/kup-probe.entry.js +1 -1
  150. package/dist/esm/kup-qlik.entry.js +1 -1
  151. package/dist/esm/kup-snackbar.entry.js +1 -1
  152. package/dist/esm/kup-txt.entry.js +1 -1
  153. package/dist/esm/kup-typography-list.entry.js +1 -1
  154. package/dist/esm/kup-typography.entry.js +6 -2
  155. package/dist/esm/loader.js +1 -1
  156. package/dist/ketchup/index.esm.js +1 -1
  157. package/dist/ketchup/ketchup.esm.js +1 -1
  158. package/dist/ketchup/{p-0db30c4f.entry.js → p-074dca27.entry.js} +1 -1
  159. package/dist/ketchup/{p-f5c79b56.entry.js → p-1e14e55b.entry.js} +1 -1
  160. package/dist/ketchup/{p-af2136bc.entry.js → p-2115a342.entry.js} +1 -1
  161. package/dist/ketchup/{p-510ccd51.entry.js → p-26204ba1.entry.js} +1 -1
  162. package/dist/ketchup/{p-0983475f.js → p-2b86ed1b.js} +1 -1
  163. package/dist/ketchup/{p-2e053030.entry.js → p-3bdaa6dc.entry.js} +1 -1
  164. package/dist/ketchup/{p-ad179f34.entry.js → p-3f10ba95.entry.js} +1 -1
  165. package/dist/ketchup/{p-6b05ef5c.entry.js → p-4308417c.entry.js} +1 -1
  166. package/dist/ketchup/{p-80b75242.entry.js → p-44ddf701.entry.js} +1 -1
  167. package/dist/ketchup/{p-8f19b40a.entry.js → p-4df33b4b.entry.js} +1 -1
  168. package/dist/ketchup/p-4f7f37d8.js +1 -0
  169. package/dist/ketchup/{p-7863d1c8.entry.js → p-53a2c80a.entry.js} +1 -1
  170. package/dist/ketchup/{p-7ebb4a8d.entry.js → p-6958c8b9.entry.js} +1 -1
  171. package/dist/ketchup/{p-7384259c.entry.js → p-6fcea055.entry.js} +1 -1
  172. package/dist/ketchup/p-736d7763.entry.js +1 -0
  173. package/dist/ketchup/{p-569ef87d.entry.js → p-7a206956.entry.js} +1 -1
  174. package/dist/ketchup/{p-bcf0ea99.entry.js → p-81031736.entry.js} +1 -1
  175. package/dist/ketchup/{p-4e63d6b1.entry.js → p-84cb2ab9.entry.js} +1 -1
  176. package/dist/ketchup/p-8a6aa580.entry.js +9 -0
  177. package/dist/ketchup/{p-7aa6e73b.entry.js → p-9021cdff.entry.js} +1 -1
  178. package/dist/ketchup/{p-5cf744cb.entry.js → p-90379022.entry.js} +1 -1
  179. package/dist/ketchup/{p-6c3981c9.entry.js → p-92d8400c.entry.js} +1 -1
  180. package/dist/ketchup/{p-eca493fc.entry.js → p-98ecd58a.entry.js} +1 -1
  181. package/dist/ketchup/{p-57d98740.entry.js → p-a69a94e6.entry.js} +1 -1
  182. package/dist/ketchup/{p-71bd8943.js → p-ac893be0.js} +1 -1
  183. package/dist/ketchup/p-b3d22966.js +1 -0
  184. package/dist/ketchup/p-b8ba1576.js +21 -0
  185. package/dist/ketchup/{p-c377a18e.entry.js → p-bffe2f25.entry.js} +1 -1
  186. package/dist/ketchup/{p-c4864dc5.js → p-c02e91a6.js} +1 -1
  187. package/dist/ketchup/{p-e9be6c07.entry.js → p-c1be5310.entry.js} +1 -1
  188. package/dist/ketchup/{p-a141d42e.entry.js → p-cbb1a9a9.entry.js} +1 -1
  189. package/dist/ketchup/{p-fe404351.entry.js → p-d49a913c.entry.js} +1 -1
  190. package/dist/ketchup/{p-7dc21d98.entry.js → p-d987d2ef.entry.js} +1 -1
  191. package/dist/ketchup/{p-5a48b2e6.entry.js → p-dc0ad9f2.entry.js} +1 -1
  192. package/dist/ketchup/{p-7a1d21a3.entry.js → p-dfef9eff.entry.js} +1 -1
  193. package/dist/ketchup/p-ef906d70.js +1 -0
  194. package/dist/ketchup/{p-a793d438.entry.js → p-f1d8429d.entry.js} +1 -1
  195. package/dist/types/components/kup-data-table/kup-data-table.d.ts +1 -0
  196. package/dist/types/f-components/f-paginator/f-paginator-declarations.d.ts +1 -0
  197. package/dist/types/managers/kup-dynamic-position/kup-dynamic-position.d.ts +6 -0
  198. package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +3 -0
  199. package/dist/types/managers/kup-manager/kup-manager.d.ts +7 -0
  200. package/dist/types/managers/kup-perf-tuning/kup-perf-tuning-declarations.d.ts +3 -0
  201. package/dist/types/managers/kup-perf-tuning/kup-perf-tuning.d.ts +7 -0
  202. package/package.json +1 -1
  203. package/dist/ketchup/p-68e197ca.entry.js +0 -9
  204. package/dist/ketchup/p-728d11e3.js +0 -21
  205. package/dist/ketchup/p-d5d58dd8.js +0 -1
  206. package/dist/ketchup/p-e79cf2e1.js +0 -1
  207. package/dist/ketchup/p-e88c9656.js +0 -1
  208. package/dist/ketchup/p-f07452ae.entry.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-b8ba1576.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 e,h as n,F as a,H as o,d as r}from"./p-b0368f88.js";import{k as p,g as l,s,e as m,ac as c}from"./p-728d11e3.js";import{c as h}from"./p-635bb4b3.js";import{F as f}from"./p-b120abd7.js";import{s as d}from"./p-0983475f.js";import"./p-1ee561ba.js";var g,u;!function(t){t.data="Dataset containing the activities list",t.dateColumn="Column containing dates",t.timeColumn="Column containing times",t.sortOrder="Order for sorting"}(g||(g={})),function(t){t.onClick="onClick",t.onRightClick="onRightClick"}(u||(u={}));var x,v,y,k=function(t,i,e,n){if("a"===e&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!n:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?n:"a"===e?n.call(t):n?n.value:i.get(t)};const w=class{constructor(e){t(this,e),this.kupClick=i(this,"kup-activitytimeline-click",6),this.kupContextMenu=i(this,"kup-activitytimeline-contextmenu",6),this.kupReady=i(this,"kup-activitytimeline-ready",6),x.add(this),v.set(this,p()),this.timeline=[],this.data=void 0,this.dateColumn=void 0,this.sort=[],this.timeColumn=void 0}async getProps(t){return l(this,g,t)}async refresh(){e(this)}async setProps(t){s(this,g,t)}getActivity(t){return{column:this.data.columns.find((i=>i.name===t.columnName)),row:this.data.rows.find((i=>i.id===t.rowId))}}onActivityClick(t,i){this.kupClick.emit({comp:this,id:this.rootElement.id,details:Object.assign(Object.assign({},this.getActivity(i)),{originalEvent:t,type:u.onClick})})}onActivityContextMenu(t,i){this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:Object.assign(Object.assign({},this.getActivity(i)),{originalEvent:t,type:u.onRightClick})})}activityItem(t){return n("div",{class:"atm-row"},t.columns.map((t=>n("div",{class:"atm-col"},n("div",{class:"atm-inner-col"},n("h3",null,t.title,":")),n("div",{class:"atm-inner-col",onClick:i=>{i.stopPropagation(),this.onActivityClick(i,t)},onContextMenu:i=>{this.onActivityContextMenu(i,t)}},n("p",null,t.value))))))}calendarIcon(){return n(f,{color:"white",resource:"calendar",wrapperClass:"activity-timeline-item__icon",sizeX:"20px",sizeY:"32px"})}componentWillLoad(){k(this,v,"f").debug.logLoad(this,!1),k(this,v,"f").theme.register(this)}componentDidLoad(){this.kupReady.emit({comp:this,id:this.rootElement.id}),k(this,v,"f").debug.logLoad(this,!0)}componentWillRender(){k(this,v,"f").debug.logRender(this,!1)}componentDidRender(){k(this,v,"f").debug.logRender(this,!0)}render(){var t,i;if(!Boolean(!(null===(t=this.data)||void 0===t?void 0:t.columns)||!(null===(i=this.data)||void 0===i?void 0:i.rows)))return this.timeline=k(this,x,"m",y).call(this,this.data),n(o,null,n("style",null,k(this,v,"f").theme.setKupStyle(this.rootElement)),n("div",{id:h},n("div",{key:this.rootElement.id,class:"kup-activity-timeline",onContextMenu:t=>{t.preventDefault()}},this.timeline.map((t=>n("div",{class:"atm-container",key:t.date},n("div",{class:"atm-event"},n("div",{class:"atm-icon-wrapper"},n("div",{class:"atm-thumb"},this.calendarIcon())),n("div",{class:"atm-content"},n("div",null,n("h3",null,n("span",null,t.date))),t.activities.map((t=>n(a,null,this.activityItem(t))))))))))));k(this,v,"f").debug.logMessage(this,"Empty data.",m.WARNING)}disconnectedCallback(){k(this,v,"f").theme.unregister(this)}get rootElement(){return r(this)}};v=new WeakMap,x=new WeakSet,y=function(t){const{columns:i,rows:e}=t,n=i.find((t=>t.name===this.dateColumn)),a=i.find((t=>t.name===this.timeColumn));if(!n||!a)return[];const o=d(e,this.sort).reduce(((t,e)=>{const o=`${c(n,e.cells[n.name])} ${c(a,e.cells[a.name])}`;return t[o]=t[o]||[],t[o].push({columns:i.filter((t=>!1!==t.visible)).map((t=>({title:t.title,value:c(t,e.cells[t.name]),columnName:t.name,rowId:e.id})))}),t}),{});return Object.entries(o).map((([t,i])=>({date:t,activities:i})))},w.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}.atm-container{color:var(--kup-gray-color-70)}.atm-container.clickable{cursor:pointer}.atm-container .atm-event{margin-bottom:10px;padding-bottom:25px;display:flex;position:relative;width:100%}.atm-container .atm-event:after{content:"";display:inline-block;width:1px;left:15px;position:absolute;top:0;bottom:0;z-index:1;background:var(--kup-primary-color)}.atm-container .atm-event .atm-icon-wrapper{margin-top:10px}.atm-container .atm-event .atm-thumb{background:var(--kup-primary-color);display:inline-block;vertical-align:top;width:32px;height:32px;border:none;border-radius:var(--kup-radius-00);text-align:center;z-index:10;position:relative;border-bottom-width:2px}.atm-container .atm-event .atm-thumb>span.-atm-icon{vertical-align:middle;line-height:32px;color:white;font-size:20px}.atm-container .atm-event .atm-content{display:inline-block;padding:0 6px 0 10px;vertical-align:top;width:calc(100% - 45px)}.atm-container .atm-event .atm-content .atm-content-header h3.atm-title{margin:0;font-size:15px;line-height:16px;float:left;width:calc(100% - 100px)}.atm-container .atm-event .atm-content .atm-content-header .atm-datetime{font-style:italic;font-size:11px;line-height:16px;float:right;width:100px;text-align:right}.atm-container .atm-event .atm-content .atm-row{max-width:calc(100% - 30px);width:100%;display:grid;grid-template-columns:repeat(8, 1fr);grid-gap:0px 0px;padding-bottom:10px}.atm-container .atm-event .atm-content .atm-row .atm-col{display:flex;align-items:baseline;justify-content:center;gap:3px;width:100%}.atm-container .atm-event .atm-content .atm-row .atm-col .atm-inner-col{width:50%}.atm-container .atm-event .atm-content .atm-row .atm-col .atm-inner-col h3{margin-bottom:7px;font-size:12px;word-break:break-word;padding-right:6px;font-weight:400}.atm-container .atm-event .atm-content .atm-row .atm-col .atm-inner-col p{font-size:12px;word-break:break-word;text-decoration:underline;color:var(--kup-primary-color);cursor:pointer}@media (max-width: 1799px){.atm-container .atm-event .atm-content .atm-row{grid-template-columns:repeat(4, 1fr)}.atm-container .atm-event .atm-content .atm-row .atm-col{justify-content:start}}@media (max-width: 1365px){.atm-container .atm-event .atm-content .atm-row{grid-template-columns:repeat(3, 1fr)}}@media (max-width: 991px){.atm-container .atm-event .atm-content .atm-row{grid-template-columns:repeat(2, 1fr)}}@media (max-width: 575px){.atm-container .atm-event .atm-content .atm-row{grid-template-columns:repeat(1, 1fr)}}';export{w as kup_activity_timeline}
1
+ import{r as t,c as i,f as e,h as n,F as a,H as o,d as r}from"./p-b0368f88.js";import{k as p,g as l,s,e as m,ac as c}from"./p-b8ba1576.js";import{c as h}from"./p-635bb4b3.js";import{F as f}from"./p-b120abd7.js";import{s as d}from"./p-2b86ed1b.js";import"./p-1ee561ba.js";var g,u;!function(t){t.data="Dataset containing the activities list",t.dateColumn="Column containing dates",t.timeColumn="Column containing times",t.sortOrder="Order for sorting"}(g||(g={})),function(t){t.onClick="onClick",t.onRightClick="onRightClick"}(u||(u={}));var x,v,y,k=function(t,i,e,n){if("a"===e&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!n:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?n:"a"===e?n.call(t):n?n.value:i.get(t)};const w=class{constructor(e){t(this,e),this.kupClick=i(this,"kup-activitytimeline-click",6),this.kupContextMenu=i(this,"kup-activitytimeline-contextmenu",6),this.kupReady=i(this,"kup-activitytimeline-ready",6),x.add(this),v.set(this,p()),this.timeline=[],this.data=void 0,this.dateColumn=void 0,this.sort=[],this.timeColumn=void 0}async getProps(t){return l(this,g,t)}async refresh(){e(this)}async setProps(t){s(this,g,t)}getActivity(t){return{column:this.data.columns.find((i=>i.name===t.columnName)),row:this.data.rows.find((i=>i.id===t.rowId))}}onActivityClick(t,i){this.kupClick.emit({comp:this,id:this.rootElement.id,details:Object.assign(Object.assign({},this.getActivity(i)),{originalEvent:t,type:u.onClick})})}onActivityContextMenu(t,i){this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:Object.assign(Object.assign({},this.getActivity(i)),{originalEvent:t,type:u.onRightClick})})}activityItem(t){return n("div",{class:"atm-row"},t.columns.map((t=>n("div",{class:"atm-col"},n("div",{class:"atm-inner-col"},n("h3",null,t.title,":")),n("div",{class:"atm-inner-col",onClick:i=>{i.stopPropagation(),this.onActivityClick(i,t)},onContextMenu:i=>{this.onActivityContextMenu(i,t)}},n("p",null,t.value))))))}calendarIcon(){return n(f,{color:"white",resource:"calendar",wrapperClass:"activity-timeline-item__icon",sizeX:"20px",sizeY:"32px"})}componentWillLoad(){k(this,v,"f").debug.logLoad(this,!1),k(this,v,"f").theme.register(this)}componentDidLoad(){this.kupReady.emit({comp:this,id:this.rootElement.id}),k(this,v,"f").debug.logLoad(this,!0)}componentWillRender(){k(this,v,"f").debug.logRender(this,!1)}componentDidRender(){k(this,v,"f").debug.logRender(this,!0)}render(){var t,i;if(!Boolean(!(null===(t=this.data)||void 0===t?void 0:t.columns)||!(null===(i=this.data)||void 0===i?void 0:i.rows)))return this.timeline=k(this,x,"m",y).call(this,this.data),n(o,null,n("style",null,k(this,v,"f").theme.setKupStyle(this.rootElement)),n("div",{id:h},n("div",{key:this.rootElement.id,class:"kup-activity-timeline",onContextMenu:t=>{t.preventDefault()}},this.timeline.map((t=>n("div",{class:"atm-container",key:t.date},n("div",{class:"atm-event"},n("div",{class:"atm-icon-wrapper"},n("div",{class:"atm-thumb"},this.calendarIcon())),n("div",{class:"atm-content"},n("div",null,n("h3",null,n("span",null,t.date))),t.activities.map((t=>n(a,null,this.activityItem(t))))))))))));k(this,v,"f").debug.logMessage(this,"Empty data.",m.WARNING)}disconnectedCallback(){k(this,v,"f").theme.unregister(this)}get rootElement(){return r(this)}};v=new WeakMap,x=new WeakSet,y=function(t){const{columns:i,rows:e}=t,n=i.find((t=>t.name===this.dateColumn)),a=i.find((t=>t.name===this.timeColumn));if(!n||!a)return[];const o=d(e,this.sort).reduce(((t,e)=>{const o=`${c(n,e.cells[n.name])} ${c(a,e.cells[a.name])}`;return t[o]=t[o]||[],t[o].push({columns:i.filter((t=>!1!==t.visible)).map((t=>({title:t.title,value:c(t,e.cells[t.name]),columnName:t.name,rowId:e.id})))}),t}),{});return Object.entries(o).map((([t,i])=>({date:t,activities:i})))},w.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}.atm-container{color:var(--kup-gray-color-70)}.atm-container.clickable{cursor:pointer}.atm-container .atm-event{margin-bottom:10px;padding-bottom:25px;display:flex;position:relative;width:100%}.atm-container .atm-event:after{content:"";display:inline-block;width:1px;left:15px;position:absolute;top:0;bottom:0;z-index:1;background:var(--kup-primary-color)}.atm-container .atm-event .atm-icon-wrapper{margin-top:10px}.atm-container .atm-event .atm-thumb{background:var(--kup-primary-color);display:inline-block;vertical-align:top;width:32px;height:32px;border:none;border-radius:var(--kup-radius-00);text-align:center;z-index:10;position:relative;border-bottom-width:2px}.atm-container .atm-event .atm-thumb>span.-atm-icon{vertical-align:middle;line-height:32px;color:white;font-size:20px}.atm-container .atm-event .atm-content{display:inline-block;padding:0 6px 0 10px;vertical-align:top;width:calc(100% - 45px)}.atm-container .atm-event .atm-content .atm-content-header h3.atm-title{margin:0;font-size:15px;line-height:16px;float:left;width:calc(100% - 100px)}.atm-container .atm-event .atm-content .atm-content-header .atm-datetime{font-style:italic;font-size:11px;line-height:16px;float:right;width:100px;text-align:right}.atm-container .atm-event .atm-content .atm-row{max-width:calc(100% - 30px);width:100%;display:grid;grid-template-columns:repeat(8, 1fr);grid-gap:0px 0px;padding-bottom:10px}.atm-container .atm-event .atm-content .atm-row .atm-col{display:flex;align-items:baseline;justify-content:center;gap:3px;width:100%}.atm-container .atm-event .atm-content .atm-row .atm-col .atm-inner-col{width:50%}.atm-container .atm-event .atm-content .atm-row .atm-col .atm-inner-col h3{margin-bottom:7px;font-size:12px;word-break:break-word;padding-right:6px;font-weight:400}.atm-container .atm-event .atm-content .atm-row .atm-col .atm-inner-col p{font-size:12px;word-break:break-word;text-decoration:underline;color:var(--kup-primary-color);cursor:pointer}@media (max-width: 1799px){.atm-container .atm-event .atm-content .atm-row{grid-template-columns:repeat(4, 1fr)}.atm-container .atm-event .atm-content .atm-row .atm-col{justify-content:start}}@media (max-width: 1365px){.atm-container .atm-event .atm-content .atm-row{grid-template-columns:repeat(3, 1fr)}}@media (max-width: 991px){.atm-container .atm-event .atm-content .atm-row{grid-template-columns:repeat(2, 1fr)}}@media (max-width: 575px){.atm-container .atm-event .atm-content .atm-row{grid-template-columns:repeat(1, 1fr)}}';export{w as kup_activity_timeline}
@@ -1 +1 @@
1
- import{r as t,c as e,f as i,h as a,H as h,d as n}from"./p-b0368f88.js";import{k as o,g as p,s}from"./p-728d11e3.js";import{c as l}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var f,c;!function(t){t.componentName="Sets the tag name of the component to be lazy loaded.",t.customStyle="Custom style of the component.",t.data="Sets the data of the component to be lazy loaded.",t.showPlaceholder="Displays an animated SVG placeholder until the component is loaded."}(f||(f={})),function(t){t.VIEWPORT="viewport",t.PROPS="props",t.BOTH="both"}(c||(c={}));const d=class{constructor(i){t(this,i),this.kupLazyLoaded=e(this,"kup-lazy-loaded",6),this.intObserver=null,this.kupManager=o(),this.lazyComponent=null,this.lazyComponentLoaded=!1,this.isInViewport=!1,this.componentName=null,this.customStyle="",this.data=null,this.renderMode=c.BOTH,this.showPlaceholder=!0}async getProps(t){return p(this,f,t)}async getComponent(){return this.lazyComponent}async refresh(){i(this)}async setProps(t){s(this,f,t)}setObserver(){this.intObserver=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.kupManager.debug.logMessage(this,"kup-lazy entering the viewport, rendering "+this.componentName+"."),this.isInViewport=!0,this.intObserver.unobserve(this.rootElement))}))}),{threshold:.25})}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this),this.setObserver()}componentDidLoad(){this.intObserver.observe(this.rootElement),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.lazyComponent&&!this.lazyComponentLoaded&&(this.lazyComponentLoaded=!0,this.kupLazyLoaded.emit({comp:this,id:this.rootElement.id})),this.kupManager.debug.logRender(this,!0)}render(){let t,e,i=this.componentName;switch(this.componentName){case"kup-button":e=a("svg",{key:"fb2b8362e3dc1b12b70f15e99928a57d7b12fedf",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},a("path",{key:"436f390f7b97422e6748b2a7759d592f44c506dc",d:"M42 6H6c-2.2 0-4 1.8-4 4v28c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4V10c0-2.2-1.8-4-4-4zm0 32H6v-6h36v6z"}));break;case"kup-card":e=a("svg",{key:"f3c05242075e730bc7105c53bd62b18aecf5ec3d",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},a("path",{key:"a2eee16a6ace543cac444d960a62b59a086eb744",d:"M44 26H28v-4h16v4zm0-12H28v4h16v-4zM28 34h16v-4H28v4zm-4-16v12c0 2.2-1.8 4-4 4H8c-2.2 0-4-1.8-4-4V18c0-2.2 1.8-4 4-4h12c2.2 0 4 1.8 4 4zm-3 12l-4.5-6-3.5 4.51-2.5-3.01L7 30h14z"}));break;case"kup-checkbox":e=a("svg",{key:"f6716e9ce1594db32cc40769a2670f5eaab944ec",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},a("path",{key:"7a5d24b382c912f86930086ea47d5352f7d268c0",d:"M38 10v28H10V10h28m0-4H10c-2.21 0-4 1.79-4 4v28c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4z"}));break;case"kup-chart":e=a("svg",{key:"282e8485c65d6c90cc6742fab3ea8826eeb3579a",xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",viewBox:"0 0 24 24"},a("path",{key:"ff9a9420e091b9f5ccf64c2a248715445a3ea89b",d:"M22,21H2V3H4V19H6V10H10V19H12V6H16V19H18V14H22V21Z"}));break;case"kup-data-table":e=a("svg",{key:"eaffa11808d13d6a30fff31bea6530830f69d88f",xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",viewBox:"0 0 24 24"},a("path",{key:"c0eac37b259ccaa3176fb122208202dc8885de85",d:"M4,3H20A2,2 0 0,1 22,5V20A2,2 0 0,1 20,22H4A2,2 0 0,1 2,20V5A2,2 0 0,1 4,3M4,7V10H8V7H4M10,7V10H14V7H10M20,10V7H16V10H20M4,12V15H8V12H4M4,20H8V17H4V20M10,12V15H14V12H10M10,20H14V17H10V20M20,20V17H16V20H20M20,12H16V15H20V12Z"}));break;case"kup-image":e=a("svg",{key:"0fc683ca7735ac9d5f48d9c1350d67549444a37e",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},a("path",{key:"dc800aa000585a00f390e3e92f9456af2c83b121",d:"M42 38V10c0-2.21-1.79-4-4-4H10c-2.21 0-4 1.79-4 4v28c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4zM17 27l5 6.01L29 24l9 12H10l7-9z"}));break;case"kup-progress-bar":e=a("svg",{key:"6703f804c86f98915b6fca8d561b79e818480ee0",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},a("path",{key:"5b473c7582738c69b3e693b653eb8e83f0a5bd7d",d:"M39 19c-2.05 0-3.81 1.23-4.58 3h-5.84c-.77-1.77-2.53-3-4.58-3s-3.81 1.23-4.58 3h-5.84c-.77-1.77-2.53-3-4.58-3-2.77 0-5 2.23-5 5s2.23 5 5 5c2.05 0 3.81-1.23 4.58-3h5.84c.77 1.77 2.53 3 4.58 3s3.81-1.23 4.58-3h5.84c.77 1.77 2.53 3 4.58 3 2.77 0 5-2.23 5-5s-2.23-5-5-5z"}));break;case"kup-radio":e=a("svg",{key:"b5020673fe0d60ddcb887878d027f9be1a04f611",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},a("path",{key:"ca7c15a6029ffb8468db47603eae20f8db8eaa54",d:"M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.84 0-16-7.16-16-16S15.16 8 24 8s16 7.16 16 16-7.16 16-16 16z"}));break;default:e=a("svg",{key:"6e916204ad921b9387a2da59225277a12bdfee97",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},a("path",{key:"2397c3c58a7ac2ddfe1c4d95680c805b410a1cda",d:"M44 26H28v-4h16v4zm0-12H28v4h16v-4zM28 34h16v-4H28v4zm-4-16v12c0 2.2-1.8 4-4 4H8c-2.2 0-4-1.8-4-4V18c0-2.2 1.8-4 4-4h12c2.2 0 4 1.8 4 4zm-3 12l-4.5-6-3.5 4.51-2.5-3.01L7 30h14z"}))}return this.renderMode===c.VIEWPORT&&this.isInViewport||this.renderMode===c.PROPS&&this.data||this.renderMode===c.BOTH&&this.data&&this.isInViewport?(t=a(this.componentName,Object.assign({key:"55d8ffa08667bdf2f90e278bd6d28e94d5a5fd90"},this.data,{ref:t=>this.lazyComponent=t})),i+=" kup-loaded"):this.showPlaceholder&&(t=e,i+=" kup-to-be-loaded"),a(h,{key:"b51dd829f66bf9958780ca2a106bd265097e0212",class:i},a("style",{key:"5f16dbbf7222c11e5e3daf2d914b0cbb4f7d757a"},this.kupManager.theme.setKupStyle(this.rootElement)),a("div",{key:"c0c9f7471b8e6529fa510db940edbbd2505deb86",id:l},t))}disconnectedCallback(){var t;this.kupManager.theme.unregister(this),null===(t=this.intObserver)||void 0===t||t.unobserve(this.rootElement)}get rootElement(){return n(this)}};d.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_lazy_animation_time:var(--kup-lazy-animation-time, 2s);--kup_lazy_hor_alignment:var(--kup-lazy-hor-alignment, center);--kup_lazy_placeholder_color:var(\n --kup-lazy-placeholder-color,\n var(--kup-icon-color)\n );--kup_lazy_height:var(--kup-lazy-height, 100%);--kup_lazy_ver_alignment:var(--kup-lazy-ver-alignment, center);--kup_lazy_width:var(--kup-lazy-width, 100%);display:block;height:var(--kup_lazy_height);width:var(--kup_lazy_width);position:relative}#kup-component{align-items:var(--kup_lazy_ver_alignment);display:flex;justify-content:var(--kup_lazy_hor_alignment);height:var(--kup_lazy_height);width:var(--kup_lazy_width)}#kup-component>*{height:var(--kup_lazy_height)}#kup-component kup-data-table{min-width:100%}.kup-loaded,.kup-to-be-loaded{height:var(--kup_lazy_height);width:var(--kup_lazy_width)}svg{fill:var(--kup_lazy_placeholder_color);animation:shine ease var(--kup_lazy_animation_time) infinite}@keyframes shine{0%{opacity:0.4}50%{opacity:0.8}100%{opacity:0.4}}:host(.kup-bottom-aligned){--kup-lazy-ver-alignment:flex-end}:host(.kup-left-aligned){--kup-lazy-hor-alignment:flex-start}:host(.kup-right-aligned){--kup-lazy-hor-alignment:flex-end}:host(.kup-top-aligned){--kup-lazy-ver-alignment:flex-start}:host(.kup-to-be-loaded) #kup-component{position:absolute}:host(.kup-to-be-loaded) #kup-component>*{margin:auto}";export{d as kup_lazy}
1
+ import{r as t,c as e,f as a,h as i,H as h,d as n}from"./p-b0368f88.js";import{k as o,g as p,s}from"./p-b8ba1576.js";import{c as l}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var f,c;!function(t){t.componentName="Sets the tag name of the component to be lazy loaded.",t.customStyle="Custom style of the component.",t.data="Sets the data of the component to be lazy loaded.",t.showPlaceholder="Displays an animated SVG placeholder until the component is loaded."}(f||(f={})),function(t){t.VIEWPORT="viewport",t.PROPS="props",t.BOTH="both"}(c||(c={}));const d=class{constructor(a){t(this,a),this.kupLazyLoaded=e(this,"kup-lazy-loaded",6),this.intObserver=null,this.kupManager=o(),this.lazyComponent=null,this.lazyComponentLoaded=!1,this.isInViewport=!1,this.componentName=null,this.customStyle="",this.data=null,this.renderMode=c.BOTH,this.showPlaceholder=!0}async getProps(t){return p(this,f,t)}async getComponent(){return this.lazyComponent}async refresh(){a(this)}async setProps(t){s(this,f,t)}setObserver(){this.intObserver=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.kupManager.debug.logMessage(this,"kup-lazy entering the viewport, rendering "+this.componentName+"."),this.isInViewport=!0,this.intObserver.unobserve(this.rootElement))}))}),{threshold:.25})}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this),this.setObserver()}componentDidLoad(){this.intObserver.observe(this.rootElement),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.lazyComponent&&!this.lazyComponentLoaded&&(this.lazyComponentLoaded=!0,this.kupLazyLoaded.emit({comp:this,id:this.rootElement.id})),this.kupManager.debug.logRender(this,!0)}render(){let t,e,a=this.componentName;switch(this.componentName){case"kup-button":e=i("svg",{key:"fb2b8362e3dc1b12b70f15e99928a57d7b12fedf",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{key:"436f390f7b97422e6748b2a7759d592f44c506dc",d:"M42 6H6c-2.2 0-4 1.8-4 4v28c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4V10c0-2.2-1.8-4-4-4zm0 32H6v-6h36v6z"}));break;case"kup-card":e=i("svg",{key:"f3c05242075e730bc7105c53bd62b18aecf5ec3d",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{key:"a2eee16a6ace543cac444d960a62b59a086eb744",d:"M44 26H28v-4h16v4zm0-12H28v4h16v-4zM28 34h16v-4H28v4zm-4-16v12c0 2.2-1.8 4-4 4H8c-2.2 0-4-1.8-4-4V18c0-2.2 1.8-4 4-4h12c2.2 0 4 1.8 4 4zm-3 12l-4.5-6-3.5 4.51-2.5-3.01L7 30h14z"}));break;case"kup-checkbox":e=i("svg",{key:"f6716e9ce1594db32cc40769a2670f5eaab944ec",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{key:"7a5d24b382c912f86930086ea47d5352f7d268c0",d:"M38 10v28H10V10h28m0-4H10c-2.21 0-4 1.79-4 4v28c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4z"}));break;case"kup-chart":e=i("svg",{key:"282e8485c65d6c90cc6742fab3ea8826eeb3579a",xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",viewBox:"0 0 24 24"},i("path",{key:"ff9a9420e091b9f5ccf64c2a248715445a3ea89b",d:"M22,21H2V3H4V19H6V10H10V19H12V6H16V19H18V14H22V21Z"}));break;case"kup-data-table":e=i("svg",{key:"eaffa11808d13d6a30fff31bea6530830f69d88f",xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",viewBox:"0 0 24 24"},i("path",{key:"c0eac37b259ccaa3176fb122208202dc8885de85",d:"M4,3H20A2,2 0 0,1 22,5V20A2,2 0 0,1 20,22H4A2,2 0 0,1 2,20V5A2,2 0 0,1 4,3M4,7V10H8V7H4M10,7V10H14V7H10M20,10V7H16V10H20M4,12V15H8V12H4M4,20H8V17H4V20M10,12V15H14V12H10M10,20H14V17H10V20M20,20V17H16V20H20M20,12H16V15H20V12Z"}));break;case"kup-image":e=i("svg",{key:"0fc683ca7735ac9d5f48d9c1350d67549444a37e",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{key:"dc800aa000585a00f390e3e92f9456af2c83b121",d:"M42 38V10c0-2.21-1.79-4-4-4H10c-2.21 0-4 1.79-4 4v28c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4zM17 27l5 6.01L29 24l9 12H10l7-9z"}));break;case"kup-progress-bar":e=i("svg",{key:"6703f804c86f98915b6fca8d561b79e818480ee0",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{key:"5b473c7582738c69b3e693b653eb8e83f0a5bd7d",d:"M39 19c-2.05 0-3.81 1.23-4.58 3h-5.84c-.77-1.77-2.53-3-4.58-3s-3.81 1.23-4.58 3h-5.84c-.77-1.77-2.53-3-4.58-3-2.77 0-5 2.23-5 5s2.23 5 5 5c2.05 0 3.81-1.23 4.58-3h5.84c.77 1.77 2.53 3 4.58 3s3.81-1.23 4.58-3h5.84c.77 1.77 2.53 3 4.58 3 2.77 0 5-2.23 5-5s-2.23-5-5-5z"}));break;case"kup-radio":e=i("svg",{key:"b5020673fe0d60ddcb887878d027f9be1a04f611",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{key:"ca7c15a6029ffb8468db47603eae20f8db8eaa54",d:"M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.84 0-16-7.16-16-16S15.16 8 24 8s16 7.16 16 16-7.16 16-16 16z"}));break;default:e=i("svg",{key:"6e916204ad921b9387a2da59225277a12bdfee97",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{key:"2397c3c58a7ac2ddfe1c4d95680c805b410a1cda",d:"M44 26H28v-4h16v4zm0-12H28v4h16v-4zM28 34h16v-4H28v4zm-4-16v12c0 2.2-1.8 4-4 4H8c-2.2 0-4-1.8-4-4V18c0-2.2 1.8-4 4-4h12c2.2 0 4 1.8 4 4zm-3 12l-4.5-6-3.5 4.51-2.5-3.01L7 30h14z"}))}return this.renderMode===c.VIEWPORT&&this.isInViewport||this.renderMode===c.PROPS&&this.data||this.renderMode===c.BOTH&&this.data&&this.isInViewport?(t=i(this.componentName,Object.assign({key:"55d8ffa08667bdf2f90e278bd6d28e94d5a5fd90"},this.data,{ref:t=>this.lazyComponent=t})),a+=" kup-loaded"):this.showPlaceholder&&(t=e,a+=" kup-to-be-loaded"),i(h,{key:"b51dd829f66bf9958780ca2a106bd265097e0212",class:a},i("style",{key:"5f16dbbf7222c11e5e3daf2d914b0cbb4f7d757a"},this.kupManager.theme.setKupStyle(this.rootElement)),i("div",{key:"c0c9f7471b8e6529fa510db940edbbd2505deb86",id:l},t))}disconnectedCallback(){var t;this.kupManager.theme.unregister(this),null===(t=this.intObserver)||void 0===t||t.unobserve(this.rootElement)}get rootElement(){return n(this)}};d.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_lazy_animation_time:var(--kup-lazy-animation-time, 2s);--kup_lazy_hor_alignment:var(--kup-lazy-hor-alignment, center);--kup_lazy_placeholder_color:var(\n --kup-lazy-placeholder-color,\n var(--kup-icon-color)\n );--kup_lazy_height:var(--kup-lazy-height, 100%);--kup_lazy_ver_alignment:var(--kup-lazy-ver-alignment, center);--kup_lazy_width:var(--kup-lazy-width, 100%);display:block;height:var(--kup_lazy_height);width:var(--kup_lazy_width);position:relative}#kup-component{align-items:var(--kup_lazy_ver_alignment);display:flex;justify-content:var(--kup_lazy_hor_alignment);height:var(--kup_lazy_height);width:var(--kup_lazy_width)}#kup-component>*{height:var(--kup_lazy_height)}#kup-component kup-data-table{min-width:100%}.kup-loaded,.kup-to-be-loaded{height:var(--kup_lazy_height);width:var(--kup_lazy_width)}svg{fill:var(--kup_lazy_placeholder_color);animation:shine ease var(--kup_lazy_animation_time) infinite}@keyframes shine{0%{opacity:0.4}50%{opacity:0.8}100%{opacity:0.4}}:host(.kup-bottom-aligned){--kup-lazy-ver-alignment:flex-end}:host(.kup-left-aligned){--kup-lazy-hor-alignment:flex-start}:host(.kup-right-aligned){--kup-lazy-hor-alignment:flex-end}:host(.kup-top-aligned){--kup-lazy-ver-alignment:flex-start}:host(.kup-to-be-loaded) #kup-component{position:absolute}:host(.kup-to-be-loaded) #kup-component>*{margin:auto}";export{d as kup_lazy}
@@ -1 +1 @@
1
- import{r as t,c as i,f as e,h as o,H as n,d as s}from"./p-b0368f88.js";import{F as a}from"./p-d39c3267.js";import{F as h}from"./p-8b97f53e.js";import{F as l}from"./p-e88c9656.js";import{F as r}from"./p-7db300e0.js";import{k as c,g as p,s as d,ay as f,h as m,V as u,e as g}from"./p-728d11e3.js";import{c as x}from"./p-635bb4b3.js";import"./p-e3062c19.js";import"./p-b120abd7.js";import"./p-c56195a0.js";import"./p-1ee561ba.js";var y;!function(t){t.customStyle="Custom style of the component.",t.data="The data of the component.",t.enableDesign="When set to true, the component is in design mode and it is draggable."}(y||(y={}));const b=class{constructor(e){t(this,e),this.kupSave=i(this,"kup-dashboard-save",6),this.kupManager=c(),this.internalData=null,this.internalDataBackup=null,this.resetInternalData=!1,this.customStyle="",this.data=null,this.enableDesign=!1}onKupSave(){this.kupSave.emit({comp:this,id:this.rootElement.id,data:this.internalData})}dataChanged(){this.resetData()}async getProps(t){return p(this,y,t)}async refresh(){e(this)}async setProps(t){d(this,y,t)}buildGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=16*Math.random()|0;return("x"===t?i:3&i|8).toString(16)}))}buildHeader(){const t={icon:"cancel",label:this.kupManager.language.translate(f.RESET),secondary:!0,onClick:()=>{this.resetData()}},i={icon:"save",label:this.kupManager.language.translate(f.SAVE),onClick:()=>this.onKupSave()};return o("div",{class:"header"},this.enableDesign?o(a,Object.assign({},t)):void 0,this.enableDesign?o(a,Object.assign({},i)):void 0)}buildForm(t,i){return t?o("div",{class:{form:!0,"layout-column":t&&"column"==t.layout,"layout-row":t&&"row"==t.layout,"form-dropzone":this.enableDesign&&t&&null!=t.sections&&t.sections.length>0},style:this.getGridStyle(t),ref:e=>{e&&(e.kupData={parent:i,form:t})}},t.sections.map((i=>this.buildSection(i,t)))):o("div",null,this.kupManager.language.translate(m.EMPTY_DATA))}buildSectionHeader(t,i){const e={value:t.dim,label:this.kupManager.language.translate(f.DIMENSION),onChange:i=>{const{target:e}=i;t.dim=e.value,this.refresh()}},n={icon:"add",slim:!0,onClick:()=>{t.sections||(t.sections=[]),t.sections.push({id:t.id+(t.sections.length+1),loaded:t.loaded,layout:t.layout}),this.resetData(this.internalData)}},s={icon:"remove",slim:!0,secondary:!0,onClick:()=>{const e=i.sections.indexOf(t);i.sections.splice(e,1),this.resetData(this.internalData)}},r={checked:t.loaded,label:this.kupManager.language.translate(f.LOADED),onChange:()=>{t.loaded=!t.loaded,this.refresh()}},c={checked:"column"==t.layout,label:this.kupManager.language.translate(f.VERTICAL),onChange:()=>{t.layout="column"==t.layout?"row":"column",this.refresh()}};return o("div",{class:"section-header"},o("div",null,t.id," - ",t.layout),o("div",null,o("div",{class:"section-header-actions"},o(l,Object.assign({},e)),o(h,Object.assign({},r)),o(h,Object.assign({},c)),o(a,Object.assign({},n)),o(a,Object.assign({},s)))))}buildSection(t,i){const e={"section-body":!0,"layout-column":t&&"column"==t.layout,"layout-row":t&&"row"==t.layout};return o("div",{class:{section:!0,"section-draggable":this.enableDesign,"section-dropzone":this.enableDesign},ref:e=>{e&&(e.kupData={parent:i,section:t})}},this.enableDesign?this.buildSectionHeader(t,i):void 0,o("div",{class:e,style:this.getGridStyle(t)},this.enableDesign||!t.loaded||t.sections&&0!=t.sections.length?void 0:o("slot",{name:t.id}),t.sections&&(t.loaded||this.enableDesign)?t.sections.map((i=>this.buildSection(i,t))):void 0))}calcSectionPosition(t,i,e,o,n){let s=o;for(let o=0;o<n.length;o++){const a=n[o].getBoundingClientRect();if(e&&t<a.y){s=o;break}if(!e&&i<a.x){s=o;break}}return s}didRenderInteractables(){try{const t=[];this.rootElement.shadowRoot.querySelectorAll(".section-draggable").forEach((i=>t.push(i))),t.forEach((t=>{this.kupManager.interact.draggable(t,null,null,u.CLONE)}))}catch(t){this.kupManager.debug.logMessage(this,t,g.ERROR)}try{const t=[];this.rootElement.shadowRoot.querySelectorAll(".section-dropzone").forEach((i=>t.push(i))),this.rootElement.shadowRoot.querySelectorAll(".form-dropzone").forEach((i=>t.push(i))),t.forEach((t=>{this.kupManager.interact.dropzone(t,{ondropdeactivate:()=>{this.removeSectionPlaceHolder()},ondropmove:t=>{this.removeSectionPlaceHolder(),this.dragEnter(t.dragEvent.clientY,t.dragEvent.clientX,t.currentTarget)}},null,{drop:t=>{this.dropped(t,t.currentTarget,t.relatedTarget)}})}))}catch(t){this.kupManager.debug.logMessage(this,t,g.ERROR)}}dragEnter(t,i,e){if(e.kupData.form){const o=this.calcSectionPosition(t,i,"column"==e.kupData.form.layout,e.kupData.form.sections.length,e.children);this.setSectionPlaceHolder(e,o)}else if(e.kupData.section){const o=this.calcSectionPosition(t,i,"column"==e.kupData.section.layout,e.kupData.section.sections.length,e.lastElementChild.children);this.setSectionPlaceHolder(e.lastElementChild,o)}}dropped(t,i,e){const o=e.kupData.parent.sections.indexOf(e.kupData.section);if(e.kupData.parent.sections.splice(o,1),i.kupData.form){i.kupData.form.sections||(i.kupData.form.sections=[]);const o=this.calcSectionPosition(t.dragEvent.clientY,t.dragEvent.clientX,"column"==i.kupData.form.layout,i.kupData.form.sections.length,i.children);i.kupData.form.sections.splice(o,0,e.kupData.section),e.kupData.parent=i.kupData.form}else if(i.kupData.section){if(!i.kupData.section.sections||0==i.kupData.section.sections.length){const t=JSON.parse(JSON.stringify(i.kupData.section));t.dim=null,e.kupData.section.dim=null,i.kupData.section.id=this.buildGuid(),i.kupData.section.sections=[],i.kupData.section.sections.push(t)}const o=this.calcSectionPosition(t.dragEvent.clientY,t.dragEvent.clientX,"column"==i.kupData.section.layout,i.kupData.section.sections.length,i.lastElementChild.children);i.kupData.section.sections.splice(o,0,e.kupData.section),e.kupData.parent=i.kupData.section}this.resetData(this.internalData)}getGridStyle(t){let i={};if(t.sections){let e="";t.sections.forEach((t=>{e+=this.enableDesign||!t.dim?" 1fr":t.dim.indexOf("%")<0?" "+t.dim+"px":" "+t.dim})),"column"==t.layout&&(i.gridTemplateRows=e),"row"==t.layout&&(i.gridTemplateColumns=e)}return i}setSectionPlaceHolder(t,i){const e=document.createElement("div");e.className="section-placeholder",t.insertBefore(e,t.childNodes[i])}removeSectionPlaceHolder(){const t=this.rootElement.shadowRoot.querySelector(".section-placeholder");t&&t.parentElement.removeChild(t)}resetData(t=null){t&&(this.internalDataBackup=t),this.resetInternalData=!0,setTimeout((()=>{this.internalDataBackup&&(this.internalData=this.internalDataBackup,this.internalDataBackup=null),this.resetInternalData=!1}),250)}unregisterInteractables(){this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".section-dropzone"))),this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".section-draggable"))),this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".form-dropzone")))}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1),this.resetInternalData?(this.internalData=null,this.unregisterInteractables()):this.internalData||(this.internalData=JSON.parse(JSON.stringify(this.data)))}componentDidRender(){this.kupManager.debug.logRender(this,!0);const t=this.rootElement.shadowRoot;if(t){const i=t.querySelectorAll(".f-text-field");i&&i.forEach((t=>{r(t)}))}this.didRenderInteractables()}render(){return o(n,{key:"4eeedc0ad554daddc9ea694235fd2447c632bc7d"},o("style",{key:"6b23b56624367d6d9b0ddde03b052b3a4417dac6"},this.kupManager.theme.setKupStyle(this.rootElement)),o("div",{key:"fca3b317ae2101b41ad6a30eb124e012add64504",id:x},this.buildHeader(),this.buildForm(this.internalData,null)))}disconnectedCallback(){this.unregisterInteractables(),this.kupManager.dates.unregister(this),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return s(this)}static get watchers(){return{data:["dataChanged"]}}};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{width:100%;height:100%}#kup-component{height:100%}.header{display:flex;flex-direction:row;justify-content:center}.header>*{margin-left:0.5em}.form{display:grid;height:100%}.form-dropzone{padding:1em;grid-gap:0.5em;border:1px solid var(--kup-primary-color);height:auto}.section{display:flex;flex-direction:column;overflow:auto}.section-header{display:flex;flex-direction:column}.section-header>*{width:100%;display:flex;flex-direction:row}.section-header>*>.section-header-actions{display:flex;justify-content:end}.section-header>*>.section-header-actions>*{margin-top:auto;margin-bottom:auto}.section-body{display:grid}.section-dropzone{border:1px solid var(--kup-primary-color)}.section-draggable{border:1px solid var(--kup-secondary-color);padding:1em}.section-placeholder{background-color:rgba(var(--kup-secondary-color-rgb), 0.5);min-height:1em;min-width:1em}.component{height:fit-content;padding:1em;margin:0.5em}.layout-row{grid-auto-flow:column;grid-template-columns:min-content}.layout-column{grid-auto-flow:row;grid-template-rows:min-content}";export{b as kup_dashboard}
1
+ import{r as t,c as i,f as e,h as o,H as n,d as s}from"./p-b0368f88.js";import{F as a}from"./p-d39c3267.js";import{F as h}from"./p-8b97f53e.js";import{F as l}from"./p-ef906d70.js";import{F as r}from"./p-7db300e0.js";import{k as c,g as p,s as d,ay as f,h as m,V as u,e as g}from"./p-b8ba1576.js";import{c as x}from"./p-635bb4b3.js";import"./p-e3062c19.js";import"./p-b120abd7.js";import"./p-c56195a0.js";import"./p-1ee561ba.js";var y;!function(t){t.customStyle="Custom style of the component.",t.data="The data of the component.",t.enableDesign="When set to true, the component is in design mode and it is draggable."}(y||(y={}));const b=class{constructor(e){t(this,e),this.kupSave=i(this,"kup-dashboard-save",6),this.kupManager=c(),this.internalData=null,this.internalDataBackup=null,this.resetInternalData=!1,this.customStyle="",this.data=null,this.enableDesign=!1}onKupSave(){this.kupSave.emit({comp:this,id:this.rootElement.id,data:this.internalData})}dataChanged(){this.resetData()}async getProps(t){return p(this,y,t)}async refresh(){e(this)}async setProps(t){d(this,y,t)}buildGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=16*Math.random()|0;return("x"===t?i:3&i|8).toString(16)}))}buildHeader(){const t={icon:"cancel",label:this.kupManager.language.translate(f.RESET),secondary:!0,onClick:()=>{this.resetData()}},i={icon:"save",label:this.kupManager.language.translate(f.SAVE),onClick:()=>this.onKupSave()};return o("div",{class:"header"},this.enableDesign?o(a,Object.assign({},t)):void 0,this.enableDesign?o(a,Object.assign({},i)):void 0)}buildForm(t,i){return t?o("div",{class:{form:!0,"layout-column":t&&"column"==t.layout,"layout-row":t&&"row"==t.layout,"form-dropzone":this.enableDesign&&t&&null!=t.sections&&t.sections.length>0},style:this.getGridStyle(t),ref:e=>{e&&(e.kupData={parent:i,form:t})}},t.sections.map((i=>this.buildSection(i,t)))):o("div",null,this.kupManager.language.translate(m.EMPTY_DATA))}buildSectionHeader(t,i){const e={value:t.dim,label:this.kupManager.language.translate(f.DIMENSION),onChange:i=>{const{target:e}=i;t.dim=e.value,this.refresh()}},n={icon:"add",slim:!0,onClick:()=>{t.sections||(t.sections=[]),t.sections.push({id:t.id+(t.sections.length+1),loaded:t.loaded,layout:t.layout}),this.resetData(this.internalData)}},s={icon:"remove",slim:!0,secondary:!0,onClick:()=>{const e=i.sections.indexOf(t);i.sections.splice(e,1),this.resetData(this.internalData)}},r={checked:t.loaded,label:this.kupManager.language.translate(f.LOADED),onChange:()=>{t.loaded=!t.loaded,this.refresh()}},c={checked:"column"==t.layout,label:this.kupManager.language.translate(f.VERTICAL),onChange:()=>{t.layout="column"==t.layout?"row":"column",this.refresh()}};return o("div",{class:"section-header"},o("div",null,t.id," - ",t.layout),o("div",null,o("div",{class:"section-header-actions"},o(l,Object.assign({},e)),o(h,Object.assign({},r)),o(h,Object.assign({},c)),o(a,Object.assign({},n)),o(a,Object.assign({},s)))))}buildSection(t,i){const e={"section-body":!0,"layout-column":t&&"column"==t.layout,"layout-row":t&&"row"==t.layout};return o("div",{class:{section:!0,"section-draggable":this.enableDesign,"section-dropzone":this.enableDesign},ref:e=>{e&&(e.kupData={parent:i,section:t})}},this.enableDesign?this.buildSectionHeader(t,i):void 0,o("div",{class:e,style:this.getGridStyle(t)},this.enableDesign||!t.loaded||t.sections&&0!=t.sections.length?void 0:o("slot",{name:t.id}),t.sections&&(t.loaded||this.enableDesign)?t.sections.map((i=>this.buildSection(i,t))):void 0))}calcSectionPosition(t,i,e,o,n){let s=o;for(let o=0;o<n.length;o++){const a=n[o].getBoundingClientRect();if(e&&t<a.y){s=o;break}if(!e&&i<a.x){s=o;break}}return s}didRenderInteractables(){try{const t=[];this.rootElement.shadowRoot.querySelectorAll(".section-draggable").forEach((i=>t.push(i))),t.forEach((t=>{this.kupManager.interact.draggable(t,null,null,u.CLONE)}))}catch(t){this.kupManager.debug.logMessage(this,t,g.ERROR)}try{const t=[];this.rootElement.shadowRoot.querySelectorAll(".section-dropzone").forEach((i=>t.push(i))),this.rootElement.shadowRoot.querySelectorAll(".form-dropzone").forEach((i=>t.push(i))),t.forEach((t=>{this.kupManager.interact.dropzone(t,{ondropdeactivate:()=>{this.removeSectionPlaceHolder()},ondropmove:t=>{this.removeSectionPlaceHolder(),this.dragEnter(t.dragEvent.clientY,t.dragEvent.clientX,t.currentTarget)}},null,{drop:t=>{this.dropped(t,t.currentTarget,t.relatedTarget)}})}))}catch(t){this.kupManager.debug.logMessage(this,t,g.ERROR)}}dragEnter(t,i,e){if(e.kupData.form){const o=this.calcSectionPosition(t,i,"column"==e.kupData.form.layout,e.kupData.form.sections.length,e.children);this.setSectionPlaceHolder(e,o)}else if(e.kupData.section){const o=this.calcSectionPosition(t,i,"column"==e.kupData.section.layout,e.kupData.section.sections.length,e.lastElementChild.children);this.setSectionPlaceHolder(e.lastElementChild,o)}}dropped(t,i,e){const o=e.kupData.parent.sections.indexOf(e.kupData.section);if(e.kupData.parent.sections.splice(o,1),i.kupData.form){i.kupData.form.sections||(i.kupData.form.sections=[]);const o=this.calcSectionPosition(t.dragEvent.clientY,t.dragEvent.clientX,"column"==i.kupData.form.layout,i.kupData.form.sections.length,i.children);i.kupData.form.sections.splice(o,0,e.kupData.section),e.kupData.parent=i.kupData.form}else if(i.kupData.section){if(!i.kupData.section.sections||0==i.kupData.section.sections.length){const t=JSON.parse(JSON.stringify(i.kupData.section));t.dim=null,e.kupData.section.dim=null,i.kupData.section.id=this.buildGuid(),i.kupData.section.sections=[],i.kupData.section.sections.push(t)}const o=this.calcSectionPosition(t.dragEvent.clientY,t.dragEvent.clientX,"column"==i.kupData.section.layout,i.kupData.section.sections.length,i.lastElementChild.children);i.kupData.section.sections.splice(o,0,e.kupData.section),e.kupData.parent=i.kupData.section}this.resetData(this.internalData)}getGridStyle(t){let i={};if(t.sections){let e="";t.sections.forEach((t=>{e+=this.enableDesign||!t.dim?" 1fr":t.dim.indexOf("%")<0?" "+t.dim+"px":" "+t.dim})),"column"==t.layout&&(i.gridTemplateRows=e),"row"==t.layout&&(i.gridTemplateColumns=e)}return i}setSectionPlaceHolder(t,i){const e=document.createElement("div");e.className="section-placeholder",t.insertBefore(e,t.childNodes[i])}removeSectionPlaceHolder(){const t=this.rootElement.shadowRoot.querySelector(".section-placeholder");t&&t.parentElement.removeChild(t)}resetData(t=null){t&&(this.internalDataBackup=t),this.resetInternalData=!0,setTimeout((()=>{this.internalDataBackup&&(this.internalData=this.internalDataBackup,this.internalDataBackup=null),this.resetInternalData=!1}),250)}unregisterInteractables(){this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".section-dropzone"))),this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".section-draggable"))),this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".form-dropzone")))}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1),this.resetInternalData?(this.internalData=null,this.unregisterInteractables()):this.internalData||(this.internalData=JSON.parse(JSON.stringify(this.data)))}componentDidRender(){this.kupManager.debug.logRender(this,!0);const t=this.rootElement.shadowRoot;if(t){const i=t.querySelectorAll(".f-text-field");i&&i.forEach((t=>{r(t)}))}this.didRenderInteractables()}render(){return o(n,{key:"4eeedc0ad554daddc9ea694235fd2447c632bc7d"},o("style",{key:"6b23b56624367d6d9b0ddde03b052b3a4417dac6"},this.kupManager.theme.setKupStyle(this.rootElement)),o("div",{key:"fca3b317ae2101b41ad6a30eb124e012add64504",id:x},this.buildHeader(),this.buildForm(this.internalData,null)))}disconnectedCallback(){this.unregisterInteractables(),this.kupManager.dates.unregister(this),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return s(this)}static get watchers(){return{data:["dataChanged"]}}};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{width:100%;height:100%}#kup-component{height:100%}.header{display:flex;flex-direction:row;justify-content:center}.header>*{margin-left:0.5em}.form{display:grid;height:100%}.form-dropzone{padding:1em;grid-gap:0.5em;border:1px solid var(--kup-primary-color);height:auto}.section{display:flex;flex-direction:column;overflow:auto}.section-header{display:flex;flex-direction:column}.section-header>*{width:100%;display:flex;flex-direction:row}.section-header>*>.section-header-actions{display:flex;justify-content:end}.section-header>*>.section-header-actions>*{margin-top:auto;margin-bottom:auto}.section-body{display:grid}.section-dropzone{border:1px solid var(--kup-primary-color)}.section-draggable{border:1px solid var(--kup-secondary-color);padding:1em}.section-placeholder{background-color:rgba(var(--kup-secondary-color-rgb), 0.5);min-height:1em;min-width:1em}.component{height:fit-content;padding:1em;margin:0.5em}.layout-row{grid-auto-flow:column;grid-template-columns:min-content}.layout-column{grid-auto-flow:row;grid-template-rows:min-content}";export{b as kup_dashboard}
@@ -1 +1 @@
1
- import{r as t,c as n,f as i,h as e,H as a,d as p}from"./p-b0368f88.js";import{k as o,e as s,g as h,s as l}from"./p-728d11e3.js";import{a as f,F as r}from"./p-60cfddce.js";import{c}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var u;!function(t){t.data="prop of the sub compoennt",t.Style="it is the style of the text",t.Border="when true it will appear a border",t.BorderWidth="it is the width of the border",t.Align="text alignment",t.FontBold="when true it will display the bold font",t.FontItalic="when true it will display the italic ( cursive )",t.FontName="it is the name of the font",t.FontSize="it is the size of the font of the text",t.FontULine="when true it will show the underline",t.FontColor="it is the color of the font of the text",t.BackColor="it is the background color of the text",t.Type="it is the type of the font. It is an enum that can take from different variant such as body, heading1, caption and so on"}(u||(u={}));const g=class{constructor(i){t(this,i),this.kupIconClick=n(this,"kup-typographylist-icon-click",6),this.KupClick=n(this,"kup-typographylist-click",6),this.kupManager=o(),this.customStyle="",this.data=[],this.type=f.BODY_COMPACT,this.toolbar=!1}onKupClick(t,n){this.KupClick.emit({comp:this,id:this.rootElement.id,index:t,subIndex:n,obj:this.getObjForEvent(t,n)})}onKupIconClick(t,n){this.kupIconClick.emit({comp:this,id:this.rootElement.id,index:t,node:n})}checkDataset(t){t||(t=[]),t.columns&&(this.kupManager.debug.logMessage(this,"Detected KupDataDataset: converting rows to nodes.",s.WARNING),this.data=this.kupManager.data.row.toNode(this.data))}async getProps(t){return h(this,u,t)}async refresh(){i(this)}async setProps(t){l(this,u,t)}renderTypography(t,n){if(null===t)return this.kupManager.debug.logMessage(this,"Empty data text.",s.WARNING),null;const i=this.prepareDataFromTreeNode(t,n);return i.value?e(r,Object.assign({},{value:i.value,type:i.type,toolbar:i.toolbar})):(this.kupManager.debug.logMessage(this,"Empty text.",s.WARNING),null)}prepareDataFromTreeNode(t,n){const i=null!=t.data?Object.assign({},t.data):{};return null!=this.customStyle&&""!=this.customStyle.trim()&&(i.customStyle=this.customStyle),null==i.value&&(i.value=t.value),i.wrapperClass||(i.wrapperClass=""),null!=this.type&&(i.type=this.type),null!=this.toolbar&&(i.toolbar=this.toolbar),i.id=n.toString(),i}renderTypographys(){if(null==this.data||this.data.length<1)return null;const t=[];for(let n=0;n<this.data.length;n++){let i=null;i=this.renderTypography(this.data[n],n),i&&t.push(i)}return t}getObjForEvent(t,n){let i=Number(t),e=-1;null!=n&&""!=n.trim()&&(e=Number(n));let a=this.data[i];return-1!=e?a.children[e].obj:a.obj}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.checkDataset(this.data),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){const t=this.renderTypographys();return e(a,{key:"27f10fadd875c6a66a5b414052a3564a451791e7"},e("style",{key:"dac7a659ae4e294309c00da2c307723b123f2e0c"},this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{key:"17d840b0eda542ff89323113b2c34261613ba336",id:c},e("div",{key:"2388ca424d760e9bd3bacedb6570de002300cc19",class:"typographies-wrapper"},t)))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return p(this)}static get watchers(){return{data:["checkDataset"]}}};g.style=".kup-body-compact-01 {\n font-family: var(--kup-font-family);\n font-size: var(--kup-body-compact-01-font-size, 14px);\n line-height: 18px;\n font-weight: 400;\n letter-spacing: 0.16px;\n}\n\n.kup-body-01 {\n font-family: var(--kup-font-family);\n font-size: var(--kup-body-01-font-size, 14px);\n line-height: 20px;\n font-weight: 400;\n letter-spacing: 0.16px;\n}\n\n.kup-code-01 {\n font-family: var(--kup-font-family-monospace);\n font-size: 12px;\n line-height: 16px;\n font-weight: 400;\n letter-spacing: 0.32px;\n}\n\n.kup-label-01 {\n font-family: var(--kup-font-family);\n font-size: 12px;\n line-height: 16px;\n font-weight: 400;\n letter-spacing: 0.32px;\n}\n\n.kup-caption-02 {\n font-family: var(--kup-font-family);\n font-size: 12px;\n line-height: 15px;\n font-weight: 500;\n letter-spacing: 1px;\n}\n\n.kup-caption-01 {\n font-family: var(--kup-font-family);\n font-size: 10px;\n line-height: 13px;\n font-weight: 400;\n letter-spacing: 1px;\n}\n\n.kup-small-label-01 {\n font-family: var(--kup-font-family);\n font-size: 6px;\n line-height: 9px;\n font-weight: 400;\n letter-spacing: 1px;\n}\n\n.kup-heading-compact-01 {\n font-family: var(--kup-font-family);\n font-size: 14px;\n line-height: 18px;\n font-weight: 600;\n letter-spacing: 0.16px;\n}\n\n.kup-heading-01 {\n font-family: var(--kup-font-family);\n font-size: 14px;\n line-height: 20px;\n font-weight: 600;\n letter-spacing: 0.16px;\n}\n\n.kup-heading-02 {\n font-family: var(--kup-font-family);\n font-size: 16px;\n line-height: 24px;\n font-weight: 500;\n letter-spacing: 0;\n}\n\n.kup-heading-03 {\n font-family: var(--kup-font-family);\n font-size: 20px;\n line-height: 28px;\n font-weight: 400;\n letter-spacing: 0;\n}\n\n.kup-heading-04 {\n font-family: var(--kup-font-family);\n font-size: 28px;\n line-height: 36px;\n font-weight: 400;\n letter-spacing: 0;\n}\n\n.kup-heading-05 {\n font-family: var(--kup-font-family);\n font-size: 32px;\n line-height: 40px;\n font-weight: 300;\n letter-spacing: 0;\n}\n\n.kup-heading-06 {\n font-family: var(--kup-font-family);\n font-size: 42px;\n line-height: 50px;\n font-weight: 300;\n letter-spacing: 0;\n}\n\n.kup-heading-07 {\n font-family: var(--kup-font-family);\n font-size: 54px;\n line-height: 64px;\n font-weight: 300;\n letter-spacing: 0;\n}\n\n.kup-heading-08 {\n font-family: var(--kup-font-family);\n font-size: 54px;\n line-height: 64px;\n font-weight: 600;\n letter-spacing: 0;\n}\n\n:host {\n --kup_typographylist_wrapper_gap: var(\n --kup-typographylist-wrapper-gap,\n var(--kup-space-00) ;\n );\n}\n\n.typographies-wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--kup_typographylist_wrapper_gap);\n}\n\n:host {\n display: block;\n}";export{g as kup_typography_list}
1
+ import{r as t,c as n,f as i,h as e,H as a,d as p}from"./p-b0368f88.js";import{k as o,e as s,g as h,s as l}from"./p-b8ba1576.js";import{a as f,F as r}from"./p-60cfddce.js";import{c}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var u;!function(t){t.data="prop of the sub compoennt",t.Style="it is the style of the text",t.Border="when true it will appear a border",t.BorderWidth="it is the width of the border",t.Align="text alignment",t.FontBold="when true it will display the bold font",t.FontItalic="when true it will display the italic ( cursive )",t.FontName="it is the name of the font",t.FontSize="it is the size of the font of the text",t.FontULine="when true it will show the underline",t.FontColor="it is the color of the font of the text",t.BackColor="it is the background color of the text",t.Type="it is the type of the font. It is an enum that can take from different variant such as body, heading1, caption and so on"}(u||(u={}));const g=class{constructor(i){t(this,i),this.kupIconClick=n(this,"kup-typographylist-icon-click",6),this.KupClick=n(this,"kup-typographylist-click",6),this.kupManager=o(),this.customStyle="",this.data=[],this.type=f.BODY_COMPACT,this.toolbar=!1}onKupClick(t,n){this.KupClick.emit({comp:this,id:this.rootElement.id,index:t,subIndex:n,obj:this.getObjForEvent(t,n)})}onKupIconClick(t,n){this.kupIconClick.emit({comp:this,id:this.rootElement.id,index:t,node:n})}checkDataset(t){t||(t=[]),t.columns&&(this.kupManager.debug.logMessage(this,"Detected KupDataDataset: converting rows to nodes.",s.WARNING),this.data=this.kupManager.data.row.toNode(this.data))}async getProps(t){return h(this,u,t)}async refresh(){i(this)}async setProps(t){l(this,u,t)}renderTypography(t,n){if(null===t)return this.kupManager.debug.logMessage(this,"Empty data text.",s.WARNING),null;const i=this.prepareDataFromTreeNode(t,n);return i.value?e(r,Object.assign({},{value:i.value,type:i.type,toolbar:i.toolbar})):(this.kupManager.debug.logMessage(this,"Empty text.",s.WARNING),null)}prepareDataFromTreeNode(t,n){const i=null!=t.data?Object.assign({},t.data):{};return null!=this.customStyle&&""!=this.customStyle.trim()&&(i.customStyle=this.customStyle),null==i.value&&(i.value=t.value),i.wrapperClass||(i.wrapperClass=""),null!=this.type&&(i.type=this.type),null!=this.toolbar&&(i.toolbar=this.toolbar),i.id=n.toString(),i}renderTypographys(){if(null==this.data||this.data.length<1)return null;const t=[];for(let n=0;n<this.data.length;n++){let i=null;i=this.renderTypography(this.data[n],n),i&&t.push(i)}return t}getObjForEvent(t,n){let i=Number(t),e=-1;null!=n&&""!=n.trim()&&(e=Number(n));let a=this.data[i];return-1!=e?a.children[e].obj:a.obj}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.checkDataset(this.data),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){const t=this.renderTypographys();return e(a,{key:"27f10fadd875c6a66a5b414052a3564a451791e7"},e("style",{key:"dac7a659ae4e294309c00da2c307723b123f2e0c"},this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{key:"17d840b0eda542ff89323113b2c34261613ba336",id:c},e("div",{key:"2388ca424d760e9bd3bacedb6570de002300cc19",class:"typographies-wrapper"},t)))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return p(this)}static get watchers(){return{data:["checkDataset"]}}};g.style=".kup-body-compact-01 {\n font-family: var(--kup-font-family);\n font-size: var(--kup-body-compact-01-font-size, 14px);\n line-height: 18px;\n font-weight: 400;\n letter-spacing: 0.16px;\n}\n\n.kup-body-01 {\n font-family: var(--kup-font-family);\n font-size: var(--kup-body-01-font-size, 14px);\n line-height: 20px;\n font-weight: 400;\n letter-spacing: 0.16px;\n}\n\n.kup-code-01 {\n font-family: var(--kup-font-family-monospace);\n font-size: 12px;\n line-height: 16px;\n font-weight: 400;\n letter-spacing: 0.32px;\n}\n\n.kup-label-01 {\n font-family: var(--kup-font-family);\n font-size: 12px;\n line-height: 16px;\n font-weight: 400;\n letter-spacing: 0.32px;\n}\n\n.kup-caption-02 {\n font-family: var(--kup-font-family);\n font-size: 12px;\n line-height: 15px;\n font-weight: 500;\n letter-spacing: 1px;\n}\n\n.kup-caption-01 {\n font-family: var(--kup-font-family);\n font-size: 10px;\n line-height: 13px;\n font-weight: 400;\n letter-spacing: 1px;\n}\n\n.kup-small-label-01 {\n font-family: var(--kup-font-family);\n font-size: 6px;\n line-height: 9px;\n font-weight: 400;\n letter-spacing: 1px;\n}\n\n.kup-heading-compact-01 {\n font-family: var(--kup-font-family);\n font-size: 14px;\n line-height: 18px;\n font-weight: 600;\n letter-spacing: 0.16px;\n}\n\n.kup-heading-01 {\n font-family: var(--kup-font-family);\n font-size: 14px;\n line-height: 20px;\n font-weight: 600;\n letter-spacing: 0.16px;\n}\n\n.kup-heading-02 {\n font-family: var(--kup-font-family);\n font-size: 16px;\n line-height: 24px;\n font-weight: 500;\n letter-spacing: 0;\n}\n\n.kup-heading-03 {\n font-family: var(--kup-font-family);\n font-size: 20px;\n line-height: 28px;\n font-weight: 400;\n letter-spacing: 0;\n}\n\n.kup-heading-04 {\n font-family: var(--kup-font-family);\n font-size: 28px;\n line-height: 36px;\n font-weight: 400;\n letter-spacing: 0;\n}\n\n.kup-heading-05 {\n font-family: var(--kup-font-family);\n font-size: 32px;\n line-height: 40px;\n font-weight: 300;\n letter-spacing: 0;\n}\n\n.kup-heading-06 {\n font-family: var(--kup-font-family);\n font-size: 42px;\n line-height: 50px;\n font-weight: 300;\n letter-spacing: 0;\n}\n\n.kup-heading-07 {\n font-family: var(--kup-font-family);\n font-size: 54px;\n line-height: 64px;\n font-weight: 300;\n letter-spacing: 0;\n}\n\n.kup-heading-08 {\n font-family: var(--kup-font-family);\n font-size: 54px;\n line-height: 64px;\n font-weight: 600;\n letter-spacing: 0;\n}\n\n:host {\n --kup_typographylist_wrapper_gap: var(\n --kup-typographylist-wrapper-gap,\n var(--kup-space-00) ;\n );\n}\n\n.typographies-wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--kup_typographylist_wrapper_gap);\n}\n\n:host {\n display: block;\n}";export{g as kup_typography_list}