@sme.up/ketchup 11.0.2 → 11.0.3

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 (200) hide show
  1. package/dist/cjs/{f-cell-6d6073f5.js → f-cell-88ea3c2a.js} +4 -4
  2. package/dist/cjs/{f-chip-18aa9993.js → f-chip-507253cb.js} +1 -1
  3. package/dist/cjs/{f-object-field-a10d8c63.js → f-object-field-7ade850e.js} +2 -2
  4. package/dist/cjs/{f-paginator-utils-e3f3d3c6.js → f-paginator-utils-7bf669ba.js} +1 -1
  5. package/dist/cjs/{f-text-field-f01dc613.js → f-text-field-207cb958.js} +1 -1
  6. package/dist/cjs/index.cjs.js +1 -1
  7. package/dist/cjs/kup-accordion.cjs.entry.js +1 -1
  8. package/dist/cjs/kup-activity-timeline.cjs.entry.js +2 -2
  9. package/dist/cjs/kup-autocomplete_30.cjs.entry.js +7 -7
  10. package/dist/cjs/kup-box.cjs.entry.js +7 -7
  11. package/dist/cjs/kup-calendar.cjs.entry.js +2 -2
  12. package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
  13. package/dist/cjs/kup-cell.cjs.entry.js +5 -5
  14. package/dist/cjs/kup-dashboard.cjs.entry.js +2 -2
  15. package/dist/cjs/{kup-data-table-helper-90a848cd.js → kup-data-table-helper-850b5723.js} +1 -1
  16. package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
  17. package/dist/cjs/kup-echart.cjs.entry.js +1 -1
  18. package/dist/cjs/kup-editor.cjs.entry.js +1 -1
  19. package/dist/cjs/kup-family-tree.cjs.entry.js +1 -1
  20. package/dist/cjs/kup-grid.cjs.entry.js +1 -1
  21. package/dist/cjs/kup-htm.cjs.entry.js +1 -1
  22. package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
  23. package/dist/cjs/kup-input-panel.cjs.entry.js +5 -5
  24. package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
  25. package/dist/cjs/kup-magic-box.cjs.entry.js +1 -1
  26. package/dist/cjs/{kup-manager-b60f8626.js → kup-manager-00e29452.js} +14 -19
  27. package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
  28. package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
  29. package/dist/cjs/kup-object-field.cjs.entry.js +3 -3
  30. package/dist/cjs/kup-planner.cjs.entry.js +2 -2
  31. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  32. package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
  33. package/dist/cjs/kup-snackbar.cjs.entry.js +1 -1
  34. package/dist/cjs/kup-txt.cjs.entry.js +1 -1
  35. package/dist/cjs/kup-typography-list.cjs.entry.js +1 -1
  36. package/dist/cjs/kup-typography.cjs.entry.js +1 -1
  37. package/dist/collection/assets/activity-timeline.js +589 -1193
  38. package/dist/collection/assets/box-performance.js +51 -33942
  39. package/dist/collection/assets/box.js +55 -113
  40. package/dist/collection/assets/button-list.js +45 -47
  41. package/dist/collection/assets/calendar.js +1 -29
  42. package/dist/collection/assets/card-list.js +73 -235
  43. package/dist/collection/assets/card.js +4 -105
  44. package/dist/collection/assets/cell.js +2 -3
  45. package/dist/collection/assets/chart.js +2629 -2899
  46. package/dist/collection/assets/data-table.js +12 -13202
  47. package/dist/collection/assets/echart.js +1 -145
  48. package/dist/collection/assets/family-tree.js +1 -205
  49. package/dist/collection/assets/form.js +1 -31
  50. package/dist/collection/assets/htm.js +4 -3
  51. package/dist/collection/assets/input-panel-tooltip.js +4 -4
  52. package/dist/collection/assets/input-panel.js +123 -290
  53. package/dist/collection/assets/kupdata.js +3 -51
  54. package/dist/collection/assets/planner-example-1.js +939 -1048
  55. package/dist/collection/assets/planner-example-2.js +416 -825
  56. package/dist/collection/assets/planner-example-3.js +5838 -6269
  57. package/dist/collection/assets/tree.js +1 -25125
  58. package/dist/collection/assets/txt.js +3 -2
  59. package/dist/collection/managers/kup-data/kup-data-cell-helper.js +1 -5
  60. package/dist/collection/utils/cell-utils.js +12 -13
  61. package/dist/components/index.js +1 -1
  62. package/dist/components/kup-accordion.js +2 -2
  63. package/dist/components/kup-activity-timeline.js +2 -2
  64. package/dist/components/kup-autocomplete.js +1 -1
  65. package/dist/components/kup-badge.js +1 -1
  66. package/dist/components/kup-box.js +1 -1
  67. package/dist/components/kup-button-list.js +1 -1
  68. package/dist/components/kup-button.js +1 -1
  69. package/dist/components/kup-calendar.js +2 -2
  70. package/dist/components/kup-card-list.js +3 -3
  71. package/dist/components/kup-card.js +1 -1
  72. package/dist/components/kup-cell.js +2 -2
  73. package/dist/components/kup-chart.js +1 -1
  74. package/dist/components/kup-checkbox.js +1 -1
  75. package/dist/components/kup-chip.js +1 -1
  76. package/dist/components/kup-color-picker.js +1 -1
  77. package/dist/components/kup-combobox.js +1 -1
  78. package/dist/components/kup-dashboard.js +2 -2
  79. package/dist/components/kup-data-table.js +1 -1
  80. package/dist/components/kup-date-picker.js +1 -1
  81. package/dist/components/kup-dialog.js +1 -1
  82. package/dist/components/kup-drawer.js +2 -2
  83. package/dist/components/kup-dropdown-button.js +1 -1
  84. package/dist/components/kup-echart.js +1 -1
  85. package/dist/components/kup-editor.js +1 -1
  86. package/dist/components/kup-family-tree.js +3 -3
  87. package/dist/components/kup-file-upload.js +1 -1
  88. package/dist/components/kup-form.js +1 -1
  89. package/dist/components/kup-gauge.js +1 -1
  90. package/dist/components/kup-grid.js +1 -1
  91. package/dist/components/kup-htm.js +2 -2
  92. package/dist/components/kup-iframe.js +2 -2
  93. package/dist/components/kup-image-list.js +1 -1
  94. package/dist/components/kup-image.js +1 -1
  95. package/dist/components/kup-input-panel.js +3 -3
  96. package/dist/components/kup-lazy.js +2 -2
  97. package/dist/components/kup-list.js +1 -1
  98. package/dist/components/kup-magic-box.js +4 -4
  99. package/dist/components/kup-nav-bar.js +2 -2
  100. package/dist/components/kup-numeric-picker.js +2 -2
  101. package/dist/components/kup-object-field.js +2 -2
  102. package/dist/components/kup-planner.js +2 -2
  103. package/dist/components/kup-probe.js +2 -2
  104. package/dist/components/kup-progress-bar.js +1 -1
  105. package/dist/components/kup-qlik.js +2 -2
  106. package/dist/components/kup-radio.js +1 -1
  107. package/dist/components/kup-rating.js +1 -1
  108. package/dist/components/kup-snackbar.js +2 -2
  109. package/dist/components/kup-spinner.js +1 -1
  110. package/dist/components/kup-switch.js +1 -1
  111. package/dist/components/kup-tab-bar.js +1 -1
  112. package/dist/components/kup-text-field.js +1 -1
  113. package/dist/components/kup-time-picker.js +1 -1
  114. package/dist/components/kup-toolbar.js +1 -1
  115. package/dist/components/kup-tree.js +1 -1
  116. package/dist/components/kup-txt.js +2 -2
  117. package/dist/components/kup-typography-list.js +2 -2
  118. package/dist/components/kup-typography.js +2 -2
  119. package/dist/components/{p-86f57305.js → p-2d3187f1.js} +1 -1
  120. package/dist/components/{p-824dec93.js → p-2f618e95.js} +2 -2
  121. package/dist/components/{p-562218f0.js → p-cf2c9c0d.js} +2 -2
  122. package/dist/components/{p-fcc9004a.js → p-d2c21bde.js} +2 -2
  123. package/dist/components/{p-69d904a7.js → p-d56d09a2.js} +14 -19
  124. package/dist/components/{p-990414e2.js → p-e7a113c6.js} +2 -2
  125. package/dist/esm/{f-cell-aed312f3.js → f-cell-0a405bc3.js} +4 -4
  126. package/dist/esm/{f-chip-afad71fb.js → f-chip-9df5d2c6.js} +1 -1
  127. package/dist/esm/{f-object-field-d0794db5.js → f-object-field-aac161d2.js} +2 -2
  128. package/dist/esm/{f-paginator-utils-51bcddea.js → f-paginator-utils-968b5af6.js} +1 -1
  129. package/dist/esm/{f-text-field-5deae7b7.js → f-text-field-416d425c.js} +1 -1
  130. package/dist/esm/index.js +1 -1
  131. package/dist/esm/kup-accordion.entry.js +1 -1
  132. package/dist/esm/kup-activity-timeline.entry.js +2 -2
  133. package/dist/esm/kup-autocomplete_30.entry.js +7 -7
  134. package/dist/esm/kup-box.entry.js +7 -7
  135. package/dist/esm/kup-calendar.entry.js +2 -2
  136. package/dist/esm/kup-card-list.entry.js +1 -1
  137. package/dist/esm/kup-cell.entry.js +5 -5
  138. package/dist/esm/kup-dashboard.entry.js +2 -2
  139. package/dist/esm/{kup-data-table-helper-51ee39b6.js → kup-data-table-helper-050584ae.js} +1 -1
  140. package/dist/esm/kup-drawer.entry.js +1 -1
  141. package/dist/esm/kup-echart.entry.js +1 -1
  142. package/dist/esm/kup-editor.entry.js +1 -1
  143. package/dist/esm/kup-family-tree.entry.js +1 -1
  144. package/dist/esm/kup-grid.entry.js +1 -1
  145. package/dist/esm/kup-htm.entry.js +1 -1
  146. package/dist/esm/kup-iframe.entry.js +1 -1
  147. package/dist/esm/kup-input-panel.entry.js +5 -5
  148. package/dist/esm/kup-lazy.entry.js +1 -1
  149. package/dist/esm/kup-magic-box.entry.js +1 -1
  150. package/dist/esm/{kup-manager-c0eb6d84.js → kup-manager-a47748da.js} +14 -19
  151. package/dist/esm/kup-nav-bar.entry.js +1 -1
  152. package/dist/esm/kup-numeric-picker.entry.js +2 -2
  153. package/dist/esm/kup-object-field.entry.js +3 -3
  154. package/dist/esm/kup-planner.entry.js +2 -2
  155. package/dist/esm/kup-probe.entry.js +1 -1
  156. package/dist/esm/kup-qlik.entry.js +1 -1
  157. package/dist/esm/kup-snackbar.entry.js +1 -1
  158. package/dist/esm/kup-txt.entry.js +1 -1
  159. package/dist/esm/kup-typography-list.entry.js +1 -1
  160. package/dist/esm/kup-typography.entry.js +1 -1
  161. package/dist/ketchup/index.esm.js +1 -1
  162. package/dist/ketchup/ketchup.esm.js +1 -1
  163. package/dist/ketchup/{p-d1abb2b7.js → p-060ec8ef.js} +1 -1
  164. package/dist/ketchup/{p-ba79f51e.entry.js → p-06ceea6f.entry.js} +1 -1
  165. package/dist/ketchup/{p-c4213fe8.entry.js → p-1e546759.entry.js} +1 -1
  166. package/dist/ketchup/{p-2be612b5.entry.js → p-235f2751.entry.js} +1 -1
  167. package/dist/ketchup/{p-003da5d6.js → p-2ca5047c.js} +1 -1
  168. package/dist/ketchup/{p-589825f4.entry.js → p-32c0cc6c.entry.js} +1 -1
  169. package/dist/ketchup/{p-ebc5264a.entry.js → p-3478ab68.entry.js} +1 -1
  170. package/dist/ketchup/{p-7d0f7135.entry.js → p-34a92fec.entry.js} +1 -1
  171. package/dist/ketchup/{p-f226f4b2.entry.js → p-3923312c.entry.js} +1 -1
  172. package/dist/ketchup/{p-b1de7002.entry.js → p-3f71f711.entry.js} +1 -1
  173. package/dist/ketchup/{p-cee0439c.entry.js → p-41d4dd10.entry.js} +1 -1
  174. package/dist/ketchup/{p-e6ba3964.entry.js → p-42e63e2e.entry.js} +1 -1
  175. package/dist/ketchup/{p-8ffde22b.js → p-46a89edc.js} +1 -1
  176. package/dist/ketchup/{p-88b537dd.entry.js → p-4ccac10f.entry.js} +1 -1
  177. package/dist/ketchup/{p-473af3ff.entry.js → p-4f97da3e.entry.js} +1 -1
  178. package/dist/ketchup/{p-9311f6f1.entry.js → p-5a24cdc1.entry.js} +1 -1
  179. package/dist/ketchup/{p-7845a469.entry.js → p-613d82ed.entry.js} +1 -1
  180. package/dist/ketchup/{p-3643331d.entry.js → p-62e118bc.entry.js} +1 -1
  181. package/dist/ketchup/{p-9b913ea0.entry.js → p-65f31377.entry.js} +1 -1
  182. package/dist/ketchup/{p-e0cedb6a.entry.js → p-6b9430ff.entry.js} +1 -1
  183. package/dist/ketchup/{p-53661fe6.entry.js → p-71410c8c.entry.js} +1 -1
  184. package/dist/ketchup/{p-c23a8c8b.entry.js → p-72724296.entry.js} +1 -1
  185. package/dist/ketchup/{p-42c1384e.js → p-7f7a9ebc.js} +1 -1
  186. package/dist/ketchup/{p-80496dcc.entry.js → p-839b289d.entry.js} +1 -1
  187. package/dist/ketchup/{p-bc7182e0.entry.js → p-895a22ef.entry.js} +1 -1
  188. package/dist/ketchup/{p-088744ad.entry.js → p-9854a470.entry.js} +1 -1
  189. package/dist/ketchup/{p-87e79c64.entry.js → p-aebeb30c.entry.js} +1 -1
  190. package/dist/ketchup/{p-a9fa1d78.js → p-bea1f185.js} +1 -1
  191. package/dist/ketchup/{p-e298b76c.js → p-c47a69dc.js} +1 -1
  192. package/dist/ketchup/{p-18ea7578.entry.js → p-c5e5fbb2.entry.js} +1 -1
  193. package/dist/ketchup/{p-489a5ae1.entry.js → p-d09cf0b3.entry.js} +1 -1
  194. package/dist/ketchup/{p-f7f1a210.entry.js → p-df7f1752.entry.js} +1 -1
  195. package/dist/ketchup/p-e4a9100b.entry.js +1 -0
  196. package/dist/ketchup/{p-c98fb668.js → p-ecf0eb17.js} +3 -3
  197. package/dist/ketchup/{p-d4a873a1.entry.js → p-f9a6acb8.entry.js} +1 -1
  198. package/dist/types/utils/cell-utils.d.ts +1 -1
  199. package/package.json +1 -1
  200. package/dist/ketchup/p-fa1e3834.entry.js +0 -1
@@ -1 +1 @@
1
- import{E as e,H as t,D as n,aj as l,x as o,z as r,ak as i,al as s,O as a,Q as u,F as c,am as f,an as d,ao as h,ap as b,aq as m,a9 as p}from"./p-c98fb668.js";import{K as v}from"./p-adadf8b5.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=Object.assign({textField:"",textFieldTmp:"",checkBoxes:[]},t[n]);null==o.checkBoxes&&(o.checkBoxes=[]),null==l||null==l.value?o.checkBoxes=[]:e.valuesArrayContainsValue(o.checkBoxes,l.value)||(o.checkBoxes=[...o.checkBoxes,l]),t[n]=o}removeCheckboxFilter(e={},t,n){var l;if(!e||null==n||!e[t])return;let o=Object.assign({textField:"",textFieldTmp:"",checkBoxes:[]},e[t]);o.checkBoxes=null!==(l=o.checkBoxes)&&void 0!==l?l:[],o.checkBoxes=o.checkBoxes.filter((e=>e.value!==n)),0===o.checkBoxes.length?delete e[t]:e[t]=o}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=Object.assign({textField:"",textFieldTmp:"",checkBoxes:[]},e[t]);l?o.textFieldTmp=null!=n?n.trim():n:o.textField=null!=n?n.trim():n,e[t]=o}saveTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValueTmp(e,t),!1)}resetTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValue(e,t),!0)}getFilterValueForTooltip(e={},l){let o=this.getTextFilterValue(e,l.name),r=this.getCheckBoxFilterValues(e,l.name),i="",s=t(o,l.obj,l.decimals);""!=o&&(i=" AND "),i="";let a="";return r.forEach((e=>{a+=i+n(e,l),i=" OR "})),""!=a&&(a="("+a+")",""!=s&&(a=" AND "+a)),a=s+a,a}removeFilter(e={},t){delete e[t]}}var F;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.removableColumns="Sets the possibility to remove the selected column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(F||(F={}));const x="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const j=document.documentElement,O=j.ketchup?j.ketchup.objects:new r,k=j.ketchup?j.ketchup.data:new i;class y extends e{isFilterCompliantForCell(e,t,n){var l;return!!e&&this.isFilterCompliantForSimpleValue(null!==(l=e.decode)&&void 0!==l?l:e.value,e.obj,t,n)}isFilterCompliantForCellObj(e,t,n){var l;return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(null!==(l=e.decode)&&void 0!==l?l:e.value,e.obj,t,n)}isRowCompliant(e,t={},n="",l=!1,o=[],r,i){return this.areCellsCompliant(e.cells,t,n,l,o,r,i)}areCellsCompliant(e,t={},n="",r=!1,i=[],s,a){var u,c;if(r){let t=!0;if(i&&null!=i&&i.length>0){t=!1;let o=this.filterIsNegative(n);for(let s=0;s<i.length;s++){if(!1===i[s].visible&&!a||(null==a?void 0:a.length)>0&&!a.includes(i[s].name))continue;const f=e[i[s].name];if(null==f)continue;t=this.isFilterCompliantForValue(null!==(u=f.decode)&&void 0!==u?u:f.value,n,r);let d=l(i[s],f);if(d!=(null!==(c=f.decode)&&void 0!==c?c:f.value)&&(t=t||this.isFilterCompliantForValue(d,n,r)),1==t&&!o)break;if(0==t&&o)break}}if(!t)return!1}return null==s&&(s=new w),!this.hasFilters(t,i,s)||Object.keys(t).every((n=>{const l=e[n],r=o(i,n);if(!l)return!1;let a=s.getTextFilterValue(t,n),u=s.getCheckBoxFilterValues(t,n);const c=this.filterIsNegative(a);let f=""!==a&&this.isFilterCompliantForCell(l,a,!0)||u.some((e=>this.isFilterCompliantForCell(l,e.value)))||u.some((e=>this.isFilterCompliantForCell(l,e.displayedValue)))||!s.hasFiltersForColumn(t,r),d=c;return O.isNumber(l.obj)||O.isDate(l.obj)||O.isTime(l.obj)||O.isTimestamp(l.obj)||(d=""!==a&&this.isFilterCompliantForCellObj(l,a,!0)||u.some((e=>this.isFilterCompliantForCellObj(l,e.value)))||!s.hasFiltersForColumn(t,r)),c?f&&d:f||d}))}hasFilters(e={},t,n){if(null==e)return!1;let l=Object.keys(e);if(null==l||l.length<1)return!1;null==n&&(n=new w);for(let r=0;r<l.length;r++){let i=l[r],s=null;if(s=i===x?{name:x,title:""}:o(t,i),n.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},n="",l=[],o,r){if(!e||null==e)return[];let i=[];const s=!(!n||!l);if(this.hasFilters(t,l,o)||s)for(let a=0;a<e.length;a++){let u=e[a];(u.id&&u.id.indexOf("insert_")>-1||this.isRowCompliant(u,t,n,s,l,o,r))&&(i[i.length]=u)}else i=[...e];return i}getColumnValues(n,l,o,r){let i=new Array;null==r&&(r=new w);let s=r.getTextFilterValueTmp(n.filters,l.name),a=r.getCheckBoxFilterValues(n.filters,l.name);if(null!=l.valuesForFilter&&l.valuesForFilter.length>0)return l.valuesForFilter.forEach((n=>{let o=n;(e.valuesArrayContainsValue(a,o)||""==s||r.isFilterCompliantForSimpleValue(o,l.obj,s))&&i.push({value:o,displayedValue:t(o,l.obj,l.decimals)})})),i;let u=Object.assign({},n.filters);u[l.name]={textField:s,textFieldTmp:s,checkBoxes:[]};let c=this.filterRows(n.getRows(),u,o,n.getVisibleColumns(),r);for(let e=0;e<a.length;e++)i.push(a[e]);return k.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,decode:e.group.label},{obj:t.group.obj,value:t.group.id,decode:t.group.label},l.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const n=t.length>1;return e.slice(0).sort(((e,l)=>{if(n){for(let n=0;n<t.length;n++){const o=V(e,l,t[n]);if(0!==o)return o}return 0}return V(e,l,t[0])}))}function V(e,t,n){const l=e.cells[n.column],o=t.cells[n.column];return l||o?l?o?s(l,o,n.sortMode):-1:1:0}function M(e=[],t={},n="",l=[],o,r,i){return null==r&&(r=new y),r.filterRows(e,t,n,l,o,i)}function N(e=[],t=[],n=[],r={}){if(!t)return[];if(!n||0===n.length||!e||0===e.length)return t;const i={},s=n.filter((({column:t})=>{for(let{name:n,title:l}of e)if(n===t)return i[n]=l,!0;return!1}));if(0===s.length)return t;const u=[];let c={};return t.forEach((t=>{const n=s[0].column,f=t.cells[n];if(f){const d=o(e,n),h=l(d,f),b=f.value;let m=null;for(let e of u)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:{}},u.push(m));for(let n=1;n<s.length;n++){const r=s[n],a=t.cells[r.column];if(a){const t=o(e,r.column),n=l(t,a),s=a.value;let u=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===n){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:r.column,columnLabel:i[r.column],children:[],expanded:!1,label:n,totals:{},obj:a.obj}},L(u),m.group.children.push(u)),m=u}}m.group.children.push(t),function(e,t,n,l){if(!e||!t)return;const o=Object.keys(t);0!==o.length&&o.forEach((o=>{const r=n.cells[o];if(r){const n=T.ketchup.objects.isNumber(r.obj),i=t[o];switch(i){case a.COUNT:let t=e.group.totals[o]||0;e.group.totals[o]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[o]||0;s.group.totals[o]=++e,s=s.group.parent}break;case a.DISTINCT:let u;if(u=n?T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value)):r.value,l[e.group.id]){let t=l[e.group.id][o];t?t.push(u):(l[e.group.id][o]=[],l[e.group.id][o].push(u))}else l[e.group.id]={},l[e.group.id][o]=[],l[e.group.id][o].push(u);let c=e.group.parent;for(;null!=c;){if(l[c.group.id]){let e=l[c.group.id][o];e?e.push(u):(l[c.group.id][o]=[],l[c.group.id][o].push(u))}else l[c.group.id]={},l[c.group.id][o]=[],l[c.group.id][o].push(u);c=c.group.parent}break;case a.SUM:case a.AVERAGE:if(n&&r.value){const t=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t+(e.group.totals[o]||0);let n=e.group.parent;for(;null!=n;){const e=T.ketchup.math.numberify(n.group.totals[o]||0);n.group.totals[o]=t+e,n=n.group.parent}}break;case a.MIN:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.min(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.min(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;case a.MAX:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.max(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.max(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;default:0!=i.indexOf(a.MATH)&&console.warn(`invalid total mode: ${i}`)}}}))}(m,r,t,c)}})),function(e,t,n){if(!e||!t)return;const l=Object.keys(t);if(0===e.length||!e[0].group||0===l.length)return;let o=l.filter((e=>a.DISTINCT===t[e]));o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>B(e,o,n)))}(u,r,c),W(u,a.AVERAGE,r),W(u,a.MATH,r),u}function W(e,t,n){if(!e||!n)return;const l=Object.keys(n);if(0===e.length||!e[0].group||0===l.length)return;let o;t==a.AVERAGE&&(o=l.filter((e=>a.AVERAGE===n[e]))),t==a.MATH&&(o=l.filter((e=>0==n[e].indexOf(a.MATH)))),o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>D(e,t,o,n)))}function B(e,t,n){const l=e.group.children;0!==l.length&&(l[0].group&&l.forEach((e=>{B(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==a.AVERAGE&&(e.group.totals[n]=e.group.totals[n]/r),t==a.MATH){let t=l[n].substring(a.MATH.length);e.group.totals[n]=T.ketchup.math.formulas.custom(t,e.group.totals)}})),r}function E(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})}}))})),n}}function A(e,t,n){if(T.ketchup.objects.isEmptyJsObject(n)||T.ketchup.objects.isEmptyJsObject(e))return{};const l={},o=[],r=t.reduce(((t,r)=>{if(!e[r.name])return t;const i=e[r.name];return i===a.COUNT?(l[r.name]=n.length.toString(),t):0===i.indexOf(a.MATH)?(o.push([r.name,i]),t):(t.push({totalOperation:i,totalColumn:r,columnValues:n.map((e=>e.cells[r.name].value))}),t)}),[]);return r||o?(null==r||r.forEach((({totalOperation:e,totalColumn:t,columnValues:o})=>{if(T.ketchup.objects.isNumber(t.obj)){if(e===a.SUM)return void(l[t.name]=o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0).toString());if(e===a.AVERAGE)return void(l[t.name]=(o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0)/n.length).toString());if(e===a.MIN)return void(l[t.name]=Math.min(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString());if(e===a.MAX)return void(l[t.name]=Math.max(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString())}if(T.ketchup.objects.isDate(t.obj)){const n=o.filter((e=>T.ketchup.dates.isIsoDate(e))).map((e=>T.ketchup.dates.toDate(e,v.ISO_DATE)));if(!n)return;if(e===a.MIN)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE));if(e===a.MAX)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE))}e===a.DISTINCT&&(l[t.name]=new Set(o).size.toString())})),null==o||o.forEach((([e,t])=>{const n=null==t?void 0:t.replace(u(a.MATH,"g"),"");l[e]=T.ketchup.math.formulas.custom(n,function(e){var t;return Object.fromEntries(null===(t=Object.entries(e))||void 0===t?void 0:t.reduce(((e,[t,n])=>(T.ketchup.math.isNumber(n)&&e.push([t,Number(n)]),e)),[]))}(l)).toString()})),l):l}function L(e){if(!e.group)return;let t=e.group.id,n=e.group.parent;for(;null!==n;)t=`${n.group.id};${t}`,n=n.group.parent;e.group.id=t}function S(e,t,n,l){const o=t*n-n,r=o+Number(n);if(0==l)return e.slice(o,r);let i=[];return _(e,i,o,Number(n),0),i}function _(e,t,n,l,o){let r=!1;for(let i=0;i<e.length;i++){let s=e[i],a=R(e[i]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=_(s.group.children,a.group.children,n,l,o);o=e.ci,r=e.added,1==r&&(t[t.length]=a)}else o>=n&&(t[t.length]=a,r=!0),o++;if(o>=n+l)break}return{ci:o,added:r}}function R(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:z(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function q(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 z(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:q(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function I(e,t,n=!1,l=[]){const o={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const r of t.rows){if(l.includes(r.id)){o.rows.push(r);continue}const t={cells:{},id:r.id};for(const n of o.columns){const l=n.name,o=r.cells[l],i=e.rows.find((e=>e.id===r.id)),s=i?i.cells[l]:null;(!s&&o.value||s&&o.value!==s.value)&&(t.cells[l]=o)}(Object.keys(t.cells).length>0||n)&&o.rows.push(t)}return o}function $(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var n;let l=e.cells[t];const o=l.value,r=l.decode,i=l.options;l.isEditable=null!==(n=l.isEditable)&&void 0!==n?n:l.editable;const s={[c.AUTOCOMPLETE]:()=>f(o,"",i,l.data),[c.COMBOBOX]:()=>f(o,"",i,l.data),[c.RADIO]:()=>d(o,i),[c.CHECKBOX]:()=>h(o,""),[c.CHIP]:()=>b(o,r),[c.SWITCH]:()=>m(o,""),[c.MULTI_AUTOCOMPLETE]:()=>b(o,r),[c.MULTI_COMBOBOX]:()=>b(o,r)}[l.shape];s&&(l.data=Object.assign(Object.assign({},s()),l.data))}))}))}export{w as F,g as K,y as a,N as b,A as c,$ as d,F as e,M as f,I as g,E as n,S as p,C as s,x as t}
1
+ import{E as e,H as t,D as n,aj as l,x as o,z as r,ak as i,al as s,O as a,Q as u,F as c,am as f,an as d,ao as h,ap as b,aq as m,a9 as p}from"./p-ecf0eb17.js";import{K as v}from"./p-adadf8b5.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=Object.assign({textField:"",textFieldTmp:"",checkBoxes:[]},t[n]);null==o.checkBoxes&&(o.checkBoxes=[]),null==l||null==l.value?o.checkBoxes=[]:e.valuesArrayContainsValue(o.checkBoxes,l.value)||(o.checkBoxes=[...o.checkBoxes,l]),t[n]=o}removeCheckboxFilter(e={},t,n){var l;if(!e||null==n||!e[t])return;let o=Object.assign({textField:"",textFieldTmp:"",checkBoxes:[]},e[t]);o.checkBoxes=null!==(l=o.checkBoxes)&&void 0!==l?l:[],o.checkBoxes=o.checkBoxes.filter((e=>e.value!==n)),0===o.checkBoxes.length?delete e[t]:e[t]=o}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=Object.assign({textField:"",textFieldTmp:"",checkBoxes:[]},e[t]);l?o.textFieldTmp=null!=n?n.trim():n:o.textField=null!=n?n.trim():n,e[t]=o}saveTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValueTmp(e,t),!1)}resetTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValue(e,t),!0)}getFilterValueForTooltip(e={},l){let o=this.getTextFilterValue(e,l.name),r=this.getCheckBoxFilterValues(e,l.name),i="",s=t(o,l.obj,l.decimals);""!=o&&(i=" AND "),i="";let a="";return r.forEach((e=>{a+=i+n(e,l),i=" OR "})),""!=a&&(a="("+a+")",""!=s&&(a=" AND "+a)),a=s+a,a}removeFilter(e={},t){delete e[t]}}var F;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.removableColumns="Sets the possibility to remove the selected column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(F||(F={}));const x="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const j=document.documentElement,O=j.ketchup?j.ketchup.objects:new r,k=j.ketchup?j.ketchup.data:new i;class y extends e{isFilterCompliantForCell(e,t,n){var l;return!!e&&this.isFilterCompliantForSimpleValue(null!==(l=e.decode)&&void 0!==l?l:e.value,e.obj,t,n)}isFilterCompliantForCellObj(e,t,n){var l;return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(null!==(l=e.decode)&&void 0!==l?l:e.value,e.obj,t,n)}isRowCompliant(e,t={},n="",l=!1,o=[],r,i){return this.areCellsCompliant(e.cells,t,n,l,o,r,i)}areCellsCompliant(e,t={},n="",r=!1,i=[],s,a){var u,c;if(r){let t=!0;if(i&&null!=i&&i.length>0){t=!1;let o=this.filterIsNegative(n);for(let s=0;s<i.length;s++){if(!1===i[s].visible&&!a||(null==a?void 0:a.length)>0&&!a.includes(i[s].name))continue;const f=e[i[s].name];if(null==f)continue;t=this.isFilterCompliantForValue(null!==(u=f.decode)&&void 0!==u?u:f.value,n,r);let d=l(i[s],f);if(d!=(null!==(c=f.decode)&&void 0!==c?c:f.value)&&(t=t||this.isFilterCompliantForValue(d,n,r)),1==t&&!o)break;if(0==t&&o)break}}if(!t)return!1}return null==s&&(s=new w),!this.hasFilters(t,i,s)||Object.keys(t).every((n=>{const l=e[n],r=o(i,n);if(!l)return!1;let a=s.getTextFilterValue(t,n),u=s.getCheckBoxFilterValues(t,n);const c=this.filterIsNegative(a);let f=""!==a&&this.isFilterCompliantForCell(l,a,!0)||u.some((e=>this.isFilterCompliantForCell(l,e.value)))||u.some((e=>this.isFilterCompliantForCell(l,e.displayedValue)))||!s.hasFiltersForColumn(t,r),d=c;return O.isNumber(l.obj)||O.isDate(l.obj)||O.isTime(l.obj)||O.isTimestamp(l.obj)||(d=""!==a&&this.isFilterCompliantForCellObj(l,a,!0)||u.some((e=>this.isFilterCompliantForCellObj(l,e.value)))||!s.hasFiltersForColumn(t,r)),c?f&&d:f||d}))}hasFilters(e={},t,n){if(null==e)return!1;let l=Object.keys(e);if(null==l||l.length<1)return!1;null==n&&(n=new w);for(let r=0;r<l.length;r++){let i=l[r],s=null;if(s=i===x?{name:x,title:""}:o(t,i),n.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},n="",l=[],o,r){if(!e||null==e)return[];let i=[];const s=!(!n||!l);if(this.hasFilters(t,l,o)||s)for(let a=0;a<e.length;a++){let u=e[a];(u.id&&u.id.indexOf("insert_")>-1||this.isRowCompliant(u,t,n,s,l,o,r))&&(i[i.length]=u)}else i=[...e];return i}getColumnValues(n,l,o,r){let i=new Array;null==r&&(r=new w);let s=r.getTextFilterValueTmp(n.filters,l.name),a=r.getCheckBoxFilterValues(n.filters,l.name);if(null!=l.valuesForFilter&&l.valuesForFilter.length>0)return l.valuesForFilter.forEach((n=>{let o=n;(e.valuesArrayContainsValue(a,o)||""==s||r.isFilterCompliantForSimpleValue(o,l.obj,s))&&i.push({value:o,displayedValue:t(o,l.obj,l.decimals)})})),i;let u=Object.assign({},n.filters);u[l.name]={textField:s,textFieldTmp:s,checkBoxes:[]};let c=this.filterRows(n.getRows(),u,o,n.getVisibleColumns(),r);for(let e=0;e<a.length;e++)i.push(a[e]);return k.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,decode:e.group.label},{obj:t.group.obj,value:t.group.id,decode:t.group.label},l.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const n=t.length>1;return e.slice(0).sort(((e,l)=>{if(n){for(let n=0;n<t.length;n++){const o=V(e,l,t[n]);if(0!==o)return o}return 0}return V(e,l,t[0])}))}function V(e,t,n){const l=e.cells[n.column],o=t.cells[n.column];return l||o?l?o?s(l,o,n.sortMode):-1:1:0}function M(e=[],t={},n="",l=[],o,r,i){return null==r&&(r=new y),r.filterRows(e,t,n,l,o,i)}function N(e=[],t=[],n=[],r={}){if(!t)return[];if(!n||0===n.length||!e||0===e.length)return t;const i={},s=n.filter((({column:t})=>{for(let{name:n,title:l}of e)if(n===t)return i[n]=l,!0;return!1}));if(0===s.length)return t;const u=[];let c={};return t.forEach((t=>{const n=s[0].column,f=t.cells[n];if(f){const d=o(e,n),h=l(d,f),b=f.value;let m=null;for(let e of u)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:{}},u.push(m));for(let n=1;n<s.length;n++){const r=s[n],a=t.cells[r.column];if(a){const t=o(e,r.column),n=l(t,a),s=a.value;let u=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===n){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:r.column,columnLabel:i[r.column],children:[],expanded:!1,label:n,totals:{},obj:a.obj}},L(u),m.group.children.push(u)),m=u}}m.group.children.push(t),function(e,t,n,l){if(!e||!t)return;const o=Object.keys(t);0!==o.length&&o.forEach((o=>{const r=n.cells[o];if(r){const n=T.ketchup.objects.isNumber(r.obj),i=t[o];switch(i){case a.COUNT:let t=e.group.totals[o]||0;e.group.totals[o]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[o]||0;s.group.totals[o]=++e,s=s.group.parent}break;case a.DISTINCT:let u;if(u=n?T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value)):r.value,l[e.group.id]){let t=l[e.group.id][o];t?t.push(u):(l[e.group.id][o]=[],l[e.group.id][o].push(u))}else l[e.group.id]={},l[e.group.id][o]=[],l[e.group.id][o].push(u);let c=e.group.parent;for(;null!=c;){if(l[c.group.id]){let e=l[c.group.id][o];e?e.push(u):(l[c.group.id][o]=[],l[c.group.id][o].push(u))}else l[c.group.id]={},l[c.group.id][o]=[],l[c.group.id][o].push(u);c=c.group.parent}break;case a.SUM:case a.AVERAGE:if(n&&r.value){const t=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t+(e.group.totals[o]||0);let n=e.group.parent;for(;null!=n;){const e=T.ketchup.math.numberify(n.group.totals[o]||0);n.group.totals[o]=t+e,n=n.group.parent}}break;case a.MIN:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.min(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.min(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;case a.MAX:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.max(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.max(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;default:0!=i.indexOf(a.MATH)&&console.warn(`invalid total mode: ${i}`)}}}))}(m,r,t,c)}})),function(e,t,n){if(!e||!t)return;const l=Object.keys(t);if(0===e.length||!e[0].group||0===l.length)return;let o=l.filter((e=>a.DISTINCT===t[e]));o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>B(e,o,n)))}(u,r,c),W(u,a.AVERAGE,r),W(u,a.MATH,r),u}function W(e,t,n){if(!e||!n)return;const l=Object.keys(n);if(0===e.length||!e[0].group||0===l.length)return;let o;t==a.AVERAGE&&(o=l.filter((e=>a.AVERAGE===n[e]))),t==a.MATH&&(o=l.filter((e=>0==n[e].indexOf(a.MATH)))),o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>D(e,t,o,n)))}function B(e,t,n){const l=e.group.children;0!==l.length&&(l[0].group&&l.forEach((e=>{B(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==a.AVERAGE&&(e.group.totals[n]=e.group.totals[n]/r),t==a.MATH){let t=l[n].substring(a.MATH.length);e.group.totals[n]=T.ketchup.math.formulas.custom(t,e.group.totals)}})),r}function E(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})}}))})),n}}function A(e,t,n){if(T.ketchup.objects.isEmptyJsObject(n)||T.ketchup.objects.isEmptyJsObject(e))return{};const l={},o=[],r=t.reduce(((t,r)=>{if(!e[r.name])return t;const i=e[r.name];return i===a.COUNT?(l[r.name]=n.length.toString(),t):0===i.indexOf(a.MATH)?(o.push([r.name,i]),t):(t.push({totalOperation:i,totalColumn:r,columnValues:n.map((e=>e.cells[r.name].value))}),t)}),[]);return r||o?(null==r||r.forEach((({totalOperation:e,totalColumn:t,columnValues:o})=>{if(T.ketchup.objects.isNumber(t.obj)){if(e===a.SUM)return void(l[t.name]=o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0).toString());if(e===a.AVERAGE)return void(l[t.name]=(o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0)/n.length).toString());if(e===a.MIN)return void(l[t.name]=Math.min(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString());if(e===a.MAX)return void(l[t.name]=Math.max(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString())}if(T.ketchup.objects.isDate(t.obj)){const n=o.filter((e=>T.ketchup.dates.isIsoDate(e))).map((e=>T.ketchup.dates.toDate(e,v.ISO_DATE)));if(!n)return;if(e===a.MIN)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE));if(e===a.MAX)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE))}e===a.DISTINCT&&(l[t.name]=new Set(o).size.toString())})),null==o||o.forEach((([e,t])=>{const n=null==t?void 0:t.replace(u(a.MATH,"g"),"");l[e]=T.ketchup.math.formulas.custom(n,function(e){var t;return Object.fromEntries(null===(t=Object.entries(e))||void 0===t?void 0:t.reduce(((e,[t,n])=>(T.ketchup.math.isNumber(n)&&e.push([t,Number(n)]),e)),[]))}(l)).toString()})),l):l}function L(e){if(!e.group)return;let t=e.group.id,n=e.group.parent;for(;null!==n;)t=`${n.group.id};${t}`,n=n.group.parent;e.group.id=t}function S(e,t,n,l){const o=t*n-n,r=o+Number(n);if(0==l)return e.slice(o,r);let i=[];return _(e,i,o,Number(n),0),i}function _(e,t,n,l,o){let r=!1;for(let i=0;i<e.length;i++){let s=e[i],a=R(e[i]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=_(s.group.children,a.group.children,n,l,o);o=e.ci,r=e.added,1==r&&(t[t.length]=a)}else o>=n&&(t[t.length]=a,r=!0),o++;if(o>=n+l)break}return{ci:o,added:r}}function R(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:z(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function q(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 z(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:q(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function I(e,t,n=!1,l=[]){const o={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const r of t.rows){if(l.includes(r.id)){o.rows.push(r);continue}const t={cells:{},id:r.id};for(const n of o.columns){const l=n.name,o=r.cells[l],i=e.rows.find((e=>e.id===r.id)),s=i?i.cells[l]:null;(!s&&o.value||s&&o.value!==s.value)&&(t.cells[l]=o)}(Object.keys(t.cells).length>0||n)&&o.rows.push(t)}return o}function $(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var n;let l=e.cells[t];const o=l.value,r=l.decode,i=l.options;l.isEditable=null!==(n=l.isEditable)&&void 0!==n?n:l.editable;const s={[c.AUTOCOMPLETE]:()=>f(o,"",i,l.data),[c.COMBOBOX]:()=>f(o,"",i,l.data),[c.RADIO]:()=>d(o,i),[c.CHECKBOX]:()=>h(o,""),[c.CHIP]:()=>b(o,r),[c.SWITCH]:()=>m(o,""),[c.MULTI_AUTOCOMPLETE]:()=>b(o,r),[c.MULTI_COMBOBOX]:()=>b(o,r)}[l.shape];s&&(l.data=Object.assign(Object.assign({},s()),l.data))}))}))}export{w as F,g as K,y as a,N as b,A as c,$ as d,F as e,M as f,I as g,E as n,S as p,C as s,x as t}
@@ -1,4 +1,4 @@
1
- import{r as t,c as n,f as i,h as r,H as e,d as o,g as a}from"./p-710d0a7d.js";import{k as s,g as u,s as l,f as h,h as f,x as c,p as v}from"./p-c98fb668.js";import{c as d}from"./p-635bb4b3.js";import"./p-adadf8b5.js";
1
+ import{r as t,c as n,f as i,h as r,H as e,d as o,g as a}from"./p-710d0a7d.js";import{k as s,g as u,s as l,f as h,h as f,x as c,p as v}from"./p-ecf0eb17.js";import{c as d}from"./p-635bb4b3.js";import"./p-adadf8b5.js";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -1 +1 @@
1
- import{r as t,c as i,f as s,h,H as e,d as n,g as o}from"./p-710d0a7d.js";import{k as a,aj as r,g as l,s as c,d as f,u as d}from"./p-c98fb668.js";import{K as p,d as u,a as m,b as v,c as k}from"./p-cd3a7d53.js";import{c as w}from"./p-635bb4b3.js";import{F as b}from"./p-e298b76c.js";import{F as g}from"./p-7db300e0.js";import"./p-adadf8b5.js";import"./p-cce08de3.js";import"./p-c56195a0.js";const y=a();function x(t,i,s,h,e,n,o,a){const r=D(t,i);let l=[];s&&h&&(l=C(s,h)?D(s,h):[...r]);let c=[];e&&n&&(z(e,n)?c=S(e,n):l=[...r]);let f=[];return o&&a&&(z(o,a)?f=S(o,a):l=[...r]),{dateValues:r,secDateValues:l,hourValues:c,secHourValues:f}}function D(t,i){let s=[t.value,i.value];return j(t)&&j(i)?s:j(t)?[t.value,t.value]:j(i)?[i.value,i.value]:s}function S(t,i){let s=[t.value,i.value];return O(t)&&O(i)?s:O(t)?[t.value,t.value]:O(i)?[i.value,i.value]:s}function j(t){return y.objects.isDate(t.obj)&&y.dates.isIsoDate(t.value)}function O(t){return y.objects.isTime(t.obj)||y.objects.isTimeWithSeconds(t.obj)}function C(t,i){return j(t)||j(i)}function z(t,i){return O(t)||O(i)}function T(t,i,s,h,e,n){let o=()=>e.map((i=>r(h.find((t=>t.name==i)),t.cells[i])));return n&&(o=n),(null==e?void 0:e.length)>=2?o():[t.cells[i].value,t.cells[s].value]}class E{constructor(){this.showSecondaryDates=!1,this.detailFilter="",this.detailInitialScrollX=0,this.detailInitialScrollY=0,this.taskFilter="",this.taskInitialScrollX=0,this.taskInitialScrollY=0,this.viewMode="day"}toDebugString(){return"dt state"}}var H,M,P,W,I,R,V,Y,K,A,G,X,L,F,N,_,q,B,J,Q,U,Z,$,tt,it=function(t,i,s,h){if("a"===s&&!h)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!h:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?h:"a"===s?h.call(t):h?h.value:i.get(t)},st=function(t,i,s,h,e){if("m"===h)throw new TypeError("Private method is not writable");if("a"===h&&!e)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===h?e.call(t,s):e?e.value=s:i.set(t,s),s};const ht=class{constructor(s){t(this,s),this.kupClick=i(this,"kup-planner-click",6),this.kupDblClick=i(this,"kup-planner-dblclick",6),this.kupDateChange=i(this,"kup-planner-datechange",6),this.kupPhaseDrop=i(this,"kup-planner-phasedrop",6),this.kupReady=i(this,"kup-planner-ready",6),this.kupContextMenu=i(this,"kup-planner-contextmenu",6),this.kupDidUnload=i(this,"kup-planner-didunload",6),H.add(this),this.state=new E,this.plannerRenderer=void 0,M.set(this,a()),P.set(this,void 0),W.set(this,[]),I.set(this,{}),R.set(this,void 0),this.stateId="",this.store=void 0,this.customStyle="",this.data=void 0,this.detailData=void 0,this.detailColorCol=void 0,this.detailColumns=void 0,this.detailDates=void 0,this.detailFilter=void 0,this.detailHeight=void 0,this.detailHours=[],this.detailIconCol=void 0,this.detailIdCol=void 0,this.detailNameCol=void 0,this.detailPrevHours=[],this.detailPrevDates=void 0,this.detailInitialScrollX=void 0,this.detailInitialScrollY=void 0,this.listCellWidth="300px",this.maxWidth="90vw",this.phaseColorCol=void 0,this.phaseColumns=void 0,this.phaseColParDep=void 0,this.phaseDates=void 0,this.phaseHours=[],this.phaseIconCol=void 0,this.phaseIdCol=void 0,this.phaseNameCol=void 0,this.phasePrevHours=[],this.phasePrevDates=void 0,this.readOnly=!1,this.showSecondaryDates=!1,this.taskColumns=void 0,this.taskDates=void 0,this.taskFilter=void 0,this.taskHeight=void 0,this.taskHours=[],this.taskIconCol=void 0,this.taskIdCol=void 0,this.taskInitialScrollX=void 0,this.taskInitialScrollY=void 0,this.taskNameCol=void 0,this.taskPrevHours=[],this.taskPrevDates=void 0,this.titleMess=void 0,this.viewMode="month",this.mainFilter=void 0,this.secondaryFilter=void 0,this.scrollableTaskList=!1,this.plannerProps=void 0}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);null!=t&&(it(this,M,"f").debug.logMessage(this,"Initializing stateId "+this.stateId),this.detailFilter=t.detailFilter,this.showSecondaryDates=t.showSecondaryDates,this.detailInitialScrollX=t.detailInitialScrollX,this.detailInitialScrollY=t.detailInitialScrollY,this.taskFilter=t.taskFilter,this.taskInitialScrollX=t.taskInitialScrollX,this.taskInitialScrollY=t.taskInitialScrollY,this.viewMode=t.viewMode)}}persistState(){if(this.store&&this.stateId){let t=!1;it(this,M,"f").objects.deepEqual(this.state.detailFilter,it(this,R,"f").detailFilter)||(this.state.detailFilter=it(this,R,"f").detailFilter,t=!0),it(this,M,"f").objects.deepEqual(this.state.showSecondaryDates,it(this,R,"f").showSecondaryDates)||(this.state.showSecondaryDates=it(this,R,"f").showSecondaryDates,t=!0),it(this,M,"f").objects.deepEqual(this.state.detailInitialScrollX,it(this,R,"f").detailInitialScrollX)||(this.state.detailInitialScrollX=it(this,R,"f").detailInitialScrollX,t=!0),it(this,M,"f").objects.deepEqual(this.state.detailInitialScrollY,it(this,R,"f").detailInitialScrollY)||(this.state.detailInitialScrollY=it(this,R,"f").detailInitialScrollY,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskFilter,it(this,R,"f").taskFilter)||(this.state.taskFilter=it(this,R,"f").taskFilter,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskInitialScrollX,it(this,R,"f").taskInitialScrollX)||(this.state.taskInitialScrollX=it(this,R,"f").taskInitialScrollX,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskInitialScrollY,it(this,R,"f").taskInitialScrollY)||(this.state.taskInitialScrollY=it(this,R,"f").taskInitialScrollY,t=!0),it(this,M,"f").objects.deepEqual(this.state.viewMode,it(this,R,"f").viewMode)||(this.state.viewMode=it(this,R,"f").viewMode,t=!0),t&&(it(this,M,"f").debug.logMessage(this,"Persisting stateId "+this.stateId),this.store.persistState(this.stateId,this.state))}}dataChanged(){st(this,I,{},"f")}async getProps(t){return l(this,k,t)}async refresh(){s(this),this.plannerRenderer.refresh()}async setProps(t){c(this,k,t)}async addPhases(t,i){var s;const h=it(this,H,"m",K).call(this,t);h&&(it(this,I,"f")[t]=i,h.phases=null===(s=i.rows)||void 0===s?void 0:s.filter((t=>C(t.cells[this.phaseDates[0]],t.cells[this.phaseDates[1]]))).map((t=>{const s=x(t.cells[this.phaseDates[0]],t.cells[this.phaseDates[1]],t.cells[this.phasePrevDates[0]],t.cells[this.phasePrevDates[1]],t.cells[this.phaseHours[0]],t.cells[this.phaseHours[1]],t.cells[this.phasePrevHours[0]],t.cells[this.phasePrevHours[1]]),e=T(t,this.phaseIdCol,this.phaseNameCol,i.columns,this.phaseColumns,(()=>this.phaseColumns.map((s=>s==this.phaseDates[0]?"#START#":s==this.phaseDates[1]?"#END#":r(i.columns.find((t=>t.name==s)),t.cells[s])))));let n=it(this,H,"m",$).call(this,t,this.phaseIconCol),o=it(this,H,"m",tt).call(this,t,this.phaseIconCol);return{taskRow:h.taskRow,phaseRow:t,id:h.id+"_"+t.cells[this.phaseIdCol].value,phaseRowId:t.id,taskRowId:h.taskRowId,name:t.cells[this.phaseNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"task",color:t.cells[this.phaseColorCol].value,selectedColor:t.cells[this.phaseColorCol].value,valuesToShow:e,rowType:p.PHASE,icon:n?{url:n,color:null!=o?o:"#595959"}:void 0,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]}}))),this.plannerProps.mainGantt.initialScrollX=it(this,R,"f").taskInitialScrollX,this.plannerProps.mainGantt.initialScrollY=it(this,R,"f").taskInitialScrollY,this.plannerProps.secondaryGantt&&(this.plannerProps.secondaryGantt.initialScrollX=it(this,R,"f").detailInitialScrollX,this.plannerProps.secondaryGantt.initialScrollX=it(this,R,"f").detailInitialScrollY),this.plannerProps=Object.assign({},this.plannerProps),this.refresh()}componentWillLoad(){it(this,M,"f").debug.logLoad(this,!1),it(this,M,"f").theme.register(this),this.initWithPersistedState(),st(this,R,{detailFilter:this.detailFilter,detailInitialScrollX:this.detailInitialScrollX,detailInitialScrollY:this.detailInitialScrollY,showSecondaryDates:this.showSecondaryDates,taskFilter:this.taskFilter,taskInitialScrollX:this.taskInitialScrollX,taskInitialScrollY:this.taskInitialScrollY,viewMode:this.viewMode},"f")}componentDidLoad(){let t=it(this,H,"m",Y).call(this,it(this,H,"m",Z).call(this,it(this,R,"f").detailFilter,!0));const i=this.rootElement.shadowRoot.querySelector("#main-filter");g(i);const s=this.rootElement.shadowRoot.querySelector("#secondary-filter");let h,e,n;t&&g(s),this.plannerProps={mainGantt:{title:this.titleMess,items:it(this,H,"m",V).call(this,it(this,H,"m",Z).call(this,it(this,R,"f").taskFilter,!1)),stylingOptions:Object.assign(Object.assign({},u),{listCellWidth:this.listCellWidth}),filter:i,hideLabel:!0,ganttHeight:this.taskHeight,showSecondaryDates:it(this,R,"f").showSecondaryDates,onClick:t=>this.handleOnClick(t),onDblClick:t=>this.handleOnDblClick(t),onContextMenu:(t,i)=>this.handleOnContextMenu(t,i),onDateChange:t=>this.handleOnDateChange(t),initialScrollX:this.taskInitialScrollX,initialScrollY:this.taskInitialScrollY,readOnly:this.readOnly,onScrollY:t=>{window.clearTimeout(e),e=window.setTimeout((()=>this.handleTaskGanttScrollY(t)),500)},onPhaseDrop:t=>this.handleOnPhaseDrop(t)},secondaryGantt:t?{title:"",items:t,stylingOptions:Object.assign(Object.assign({},u),{listCellWidth:this.listCellWidth}),filter:s,hideLabel:!0,ganttHeight:this.detailHeight,onClick:t=>this.handleOnClick(t),onContextMenu:(t,i)=>this.handleOnContextMenu(t,i),onDateChange:t=>this.handleOnDateChange(t),initialScrollX:this.detailInitialScrollX,initialScrollY:this.detailInitialScrollY,readOnly:this.readOnly,onScrollY:t=>{window.clearTimeout(n),n=window.setTimeout((()=>this.handleDetailGanttScrollY(t)),500)}}:void 0,onSetDoubleView:t=>this.handleOnSetDoubleView(t),onSetViewMode:t=>this.handleOnSetViewMode(t),viewMode:this.viewMode,scrollableTaskList:this.scrollableTaskList,onScrollX:t=>{window.clearTimeout(h),h=window.setTimeout((()=>this.handleOnScrollX(t)),500)}},this.kupReady.emit({comp:this,id:this.rootElement.id,value:void 0}),this.taskFilter&&it(this,H,"m",U).call(this,this.taskFilter),this.detailFilter&&it(this,H,"m",U).call(this,this.detailFilter,!0),it(this,M,"f").debug.logLoad(this,!0)}componentDidRender(){this.persistState(),it(this,M,"f").debug.logRender(this,!0)}onKupDblClick(t,i){this.kupDblClick.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupClick(t,i){this.kupClick.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupContextMenu(t,i,s){let h,e,n;switch(i.type){case"project":h=i.taskRow,e=h.cells[this.taskIdCol],n=this.data.columns[this.taskIdCol];break;case"task":h=i.phaseRow,e=h.cells[this.phaseIdCol];break;case"timeline":h=i.detailRow,e=h.cells[this.detailIdCol],n=this.data.columns[this.detailIdCol]}this.kupContextMenu.emit({comp:this,id:this.rootElement.id,value:i,taskAction:s,details:{cell:e,column:n,originalEvent:t,row:h}})}onKupDateChange(t,i){this.kupDateChange.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupPhaseDrop(t,i){this.kupPhaseDrop.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}handleOnDblClick(t){switch(t.rowType){case p.TASK:it(this,H,"m",G).call(this)&&this.onKupDblClick(t,m.onDblClick);break;case p.PHASE:it(this,H,"m",X).call(this)&&this.onKupDblClick(t,m.onDblClick);break;case p.DETAIL:it(this,H,"m",L).call(this)&&this.onKupDblClick(t,m.onDblClick)}for(let t=0;t<it(this,W,"f").length;t++)clearTimeout(it(this,W,"f")[t]),it(this,M,"f").debug.logMessage(this,"Cleared click timeout("+it(this,W,"f")[t]+").");st(this,W,[],"f")}handleOnClick(t){it(this,W,"f").push(setTimeout((()=>{switch(t.rowType){case p.TASK:const i=t.phases?m.onTaskClosing:m.onTaskOpening;it(this,H,"m",F).call(this,t)&&this.onKupClick(t,i);break;case p.PHASE:it(this,H,"m",N).call(this)&&this.onKupClick(t,m.onClick);break;case p.DETAIL:it(this,H,"m",_).call(this)&&this.onKupClick(t,m.onClick)}}),300))}handleOnContextMenu(t,i){switch(i.rowType){case p.TASK:it(this,H,"m",q).call(this)&&this.onKupContextMenu(t,i,m.onRightClick);break;case p.PHASE:it(this,H,"m",B).call(this)&&this.onKupContextMenu(t,i,m.onRightClick);break;case p.DETAIL:it(this,H,"m",J).call(this)&&this.onKupContextMenu(t,i,m.onRightClick)}}handleOnSetDoubleView(t){var i;it(this,R,"f").showSecondaryDates=t,(null===(i=this.plannerProps)||void 0===i?void 0:i.mainGantt)&&(this.plannerProps.mainGantt.showSecondaryDates=t),this.persistState()}handleOnSetViewMode(t){it(this,R,"f").viewMode=t,this.plannerProps.viewMode=t,this.persistState()}handleOnScrollX(t){it(this,R,"f").taskInitialScrollX=t,it(this,R,"f").detailInitialScrollX=t,this.persistState()}handleTaskGanttScrollY(t){it(this,R,"f").taskInitialScrollY=t,this.persistState()}handleDetailGanttScrollY(t){it(this,R,"f").detailInitialScrollY=t,this.persistState()}handleOnDateChange(t){it(this,H,"m",Q).call(this,t)&&t.rowType!=p.DETAIL&&this.onKupDateChange(t,m.onResize)}handleOnPhaseDrop(t){this.onKupPhaseDrop(t,m.onTask)}render(){var t,i,s;const n=this.plannerProps?Object.assign(Object.assign({},this.plannerProps),{onSetDoubleView:this.handleOnSetDoubleView.bind(this),onSetViewMode:this.handleOnSetViewMode.bind(this),onScrollX:this.handleOnScrollX.bind(this),mainGantt:Object.assign(Object.assign({},null===(t=this.plannerProps)||void 0===t?void 0:t.mainGantt),{onScrollY:this.handleTaskGanttScrollY.bind(this)})}):null;return(null===(i=this.plannerProps)||void 0===i?void 0:i.secondaryGantt)&&(n.secondaryGantt=Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{onScrollY:this.handleDetailGanttScrollY.bind(this)})),h(e,{key:"b92ccaa55c0653a32090bd2f8d56137ca3c020c1"},h("style",{key:"0c84264c55e0bc13bab866b0240200851ca2d278"},it(this,M,"f").theme.setKupStyle(this.rootElement)),h("div",{key:"b13e4e3f5736fb548b1b4090948ed1bfbcf5c2b7",id:w,style:{maxWidth:this.maxWidth}},this.plannerProps&&h("kup-planner-renderer",{key:"cb5cb8c176fb49c8b3dc4ff8bf68aa383ea3b3b6",props:n,ref:t=>this.plannerRenderer=t})),h("div",{key:"b17375ff799b641dd10154ea34b62e595237a260",style:{display:this.plannerProps?"none":""}},h(b,{key:"2b2c91d6a081640b8bda0b693ddcd89a9610e229",icon:f.SEARCH,id:"main-filter",label:it(this,M,"f").language.translate(d.SEARCH),onKeyDown:t=>{"Enter"===t.key&&it(this,H,"m",U).call(this,t.target.value)},value:this.taskFilter,wrapperClass:"filter"}),(null===(s=this.detailData)||void 0===s?void 0:s.rows)&&this.detailData.rows.length>0?h(b,{icon:f.SEARCH,id:"secondary-filter",label:it(this,M,"f").language.translate(d.SEARCH),onKeyDown:t=>{"Enter"===t.key&&it(this,H,"m",U).call(this,t.target.value,!0)},value:this.detailFilter,wrapperClass:"filter"}):null))}disconnectedCallback(){it(this,M,"f").theme.unregister(this),this.kupDidUnload.emit({comp:this,id:this.rootElement.id,storedSettings:it(this,R,"f")})}get rootElement(){return n(this)}static get watchers(){return{data:["dataChanged"]}}};M=new WeakMap,P=new WeakMap,W=new WeakMap,I=new WeakMap,R=new WeakMap,H=new WeakSet,V=function(t){var i;return t&&t.rows?null===(i=t.rows)||void 0===i?void 0:i.filter((t=>C(t.cells[this.taskDates[0]],t.cells[this.taskDates[1]]))).map((i=>{const s=x(i.cells[this.taskDates[0]],i.cells[this.taskDates[1]],i.cells[this.taskPrevDates[0]],i.cells[this.taskPrevDates[1]],i.cells[this.taskHours[0]],i.cells[this.taskHours[1]],i.cells[this.taskPrevHours[0]],i.cells[this.taskPrevHours[1]]),h=T(i,this.taskIdCol,this.taskNameCol,t.columns,this.taskColumns,(()=>this.taskColumns.map((s=>s==this.taskDates[0]?"#START#":s==this.taskDates[1]?"#END#":r(t.columns.find((t=>t.name==s)),i.cells[s])))));let e=it(this,H,"m",$).call(this,i,this.taskIconCol),n=it(this,H,"m",tt).call(this,i,this.taskIconCol);return{taskRow:i,taskRowId:i.id,id:i.cells[this.taskIdCol].value,name:i.cells[this.taskNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"project",valuesToShow:h,rowType:p.TASK,icon:e?{url:e,color:null!=n?n:"#595959"}:void 0,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]}})):[]},Y=function(t){if(!t||!t.rows)return;let i=[];return t.rows.filter((t=>C(t.cells[this.detailDates[0]],t.cells[this.detailDates[1]]))).forEach((s=>{var h,e;const n=s.cells[this.detailIdCol].value,o=s.cells[this.detailNameCol].value,a=x(s.cells[this.detailDates[0]],s.cells[this.detailDates[1]],void 0,void 0,s.cells[this.detailHours[0]],s.cells[this.detailHours[1]]),r=T(s,this.detailIdCol,this.detailNameCol,t.columns,this.detailColumns);let l=i.find((t=>t.id==n));l||(l={id:n,name:o,detailRow:s,type:"timeline",valuesToShow:r,rowType:p.DETAIL,schedule:[]},i.push(l));let c=it(this,H,"m",$).call(this,s,this.detailIconCol),f=it(this,H,"m",tt).call(this,s,this.detailIconCol);l.schedule.push({startDate:a.dateValues[0],endDate:a.dateValues[1],color:this.detailColorCol&&null!==(h=s.cells[this.detailColorCol].value)&&void 0!==h?h:"#D9D9D8",selectedColor:this.detailColorCol&&null!==(e=s.cells[this.detailColorCol].value)&&void 0!==e?e:"#D9D9D8",icon:c?{url:c,color:null!=f?f:"#595959"}:void 0,startHour:a.hourValues[0],endHour:a.hourValues[1]})})),i},K=function(t){return this.plannerProps.mainGantt.items.find((i=>i.id==t))},A=function(t){const i=it(this,H,"m",K).call(this,t);i&&(i.phases=void 0),this.plannerProps=Object.assign({},this.plannerProps)},G=function(){return!0},X=function(){return!0},L=function(){return!0},F=function(t){const i=it(this,H,"m",K).call(this,t.id);return(null==i?void 0:i.phases)&&it(this,H,"m",A).call(this,i.id),!0},N=function(){return!0},_=function(){return!0},q=function(){return!0},B=function(){return!0},J=function(){return!0},Q=function(t){let i=!1;return it(this,P,"f")?it(this,P,"f").isEquivalent(t)||(st(this,P,new v(t),"f"),i=!0):(i=!0,st(this,P,new v(t),"f")),i},U=function(t,i){i?it(this,R,"f").detailFilter=t:it(this,R,"f").taskFilter=t;const s=i?{secondaryGantt:Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{items:it(this,H,"m",Y).call(this,it(this,H,"m",Z).call(this,t,i))})}:{mainGantt:Object.assign(Object.assign({},this.plannerProps.mainGantt),{items:it(this,H,"m",V).call(this,it(this,H,"m",Z).call(this,t,i))})};this.plannerProps=Object.assign(Object.assign({},this.plannerProps),s),this.persistState()},Z=function(t,i){const s=i?this.detailData:this.data;if(!s||!s.rows||0==s.rows.length)return;if(!t)return s;const h={columns:this.data.columns,rows:[]},e=[];for(let i=0;i<s.rows.length;i++){const h=s.rows[i],n=h.cells;for(let i=0;i<s.columns.length;i++){const o=n[s.columns[i].name];if(o&&r(s.columns[i],o).toLowerCase().indexOf(t.toLowerCase())>-1){e.push({row:h,weight:i});break}}}return e.sort(((t,i)=>t.weight-i.weight)).forEach((t=>{h.rows.push(t.row)})),h},$=function(t,i){var s;let h;if(i){const e=t.cells[i];let n=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.resource;n||(n=e.value),n&&(h=o("./assets/svg/"+n+".svg"))}return h},tt=function(t,i){var s;let h;if(i){const e=t.cells[i];h=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.color,h&&(h=it(this,M,"f").theme.colorCheck(h).hexColor)}return h},ht.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{display:block}.filter{margin-bottom:var(--kup-space-04)}.planner-render{padding-top:40px}";export{ht as kup_planner}
1
+ import{r as t,c as i,f as s,h,H as e,d as n,g as o}from"./p-710d0a7d.js";import{k as a,aj as r,g as l,s as c,d as f,u as d}from"./p-ecf0eb17.js";import{K as p,d as u,a as m,b as v,c as k}from"./p-cd3a7d53.js";import{c as w}from"./p-635bb4b3.js";import{F as b}from"./p-c47a69dc.js";import{F as g}from"./p-7db300e0.js";import"./p-adadf8b5.js";import"./p-cce08de3.js";import"./p-c56195a0.js";const y=a();function x(t,i,s,h,e,n,o,a){const r=D(t,i);let l=[];s&&h&&(l=C(s,h)?D(s,h):[...r]);let c=[];e&&n&&(z(e,n)?c=S(e,n):l=[...r]);let f=[];return o&&a&&(z(o,a)?f=S(o,a):l=[...r]),{dateValues:r,secDateValues:l,hourValues:c,secHourValues:f}}function D(t,i){let s=[t.value,i.value];return j(t)&&j(i)?s:j(t)?[t.value,t.value]:j(i)?[i.value,i.value]:s}function S(t,i){let s=[t.value,i.value];return O(t)&&O(i)?s:O(t)?[t.value,t.value]:O(i)?[i.value,i.value]:s}function j(t){return y.objects.isDate(t.obj)&&y.dates.isIsoDate(t.value)}function O(t){return y.objects.isTime(t.obj)||y.objects.isTimeWithSeconds(t.obj)}function C(t,i){return j(t)||j(i)}function z(t,i){return O(t)||O(i)}function T(t,i,s,h,e,n){let o=()=>e.map((i=>r(h.find((t=>t.name==i)),t.cells[i])));return n&&(o=n),(null==e?void 0:e.length)>=2?o():[t.cells[i].value,t.cells[s].value]}class E{constructor(){this.showSecondaryDates=!1,this.detailFilter="",this.detailInitialScrollX=0,this.detailInitialScrollY=0,this.taskFilter="",this.taskInitialScrollX=0,this.taskInitialScrollY=0,this.viewMode="day"}toDebugString(){return"dt state"}}var H,M,P,W,I,R,V,Y,K,A,G,X,L,F,N,_,q,B,J,Q,U,Z,$,tt,it=function(t,i,s,h){if("a"===s&&!h)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!h:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?h:"a"===s?h.call(t):h?h.value:i.get(t)},st=function(t,i,s,h,e){if("m"===h)throw new TypeError("Private method is not writable");if("a"===h&&!e)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===h?e.call(t,s):e?e.value=s:i.set(t,s),s};const ht=class{constructor(s){t(this,s),this.kupClick=i(this,"kup-planner-click",6),this.kupDblClick=i(this,"kup-planner-dblclick",6),this.kupDateChange=i(this,"kup-planner-datechange",6),this.kupPhaseDrop=i(this,"kup-planner-phasedrop",6),this.kupReady=i(this,"kup-planner-ready",6),this.kupContextMenu=i(this,"kup-planner-contextmenu",6),this.kupDidUnload=i(this,"kup-planner-didunload",6),H.add(this),this.state=new E,this.plannerRenderer=void 0,M.set(this,a()),P.set(this,void 0),W.set(this,[]),I.set(this,{}),R.set(this,void 0),this.stateId="",this.store=void 0,this.customStyle="",this.data=void 0,this.detailData=void 0,this.detailColorCol=void 0,this.detailColumns=void 0,this.detailDates=void 0,this.detailFilter=void 0,this.detailHeight=void 0,this.detailHours=[],this.detailIconCol=void 0,this.detailIdCol=void 0,this.detailNameCol=void 0,this.detailPrevHours=[],this.detailPrevDates=void 0,this.detailInitialScrollX=void 0,this.detailInitialScrollY=void 0,this.listCellWidth="300px",this.maxWidth="90vw",this.phaseColorCol=void 0,this.phaseColumns=void 0,this.phaseColParDep=void 0,this.phaseDates=void 0,this.phaseHours=[],this.phaseIconCol=void 0,this.phaseIdCol=void 0,this.phaseNameCol=void 0,this.phasePrevHours=[],this.phasePrevDates=void 0,this.readOnly=!1,this.showSecondaryDates=!1,this.taskColumns=void 0,this.taskDates=void 0,this.taskFilter=void 0,this.taskHeight=void 0,this.taskHours=[],this.taskIconCol=void 0,this.taskIdCol=void 0,this.taskInitialScrollX=void 0,this.taskInitialScrollY=void 0,this.taskNameCol=void 0,this.taskPrevHours=[],this.taskPrevDates=void 0,this.titleMess=void 0,this.viewMode="month",this.mainFilter=void 0,this.secondaryFilter=void 0,this.scrollableTaskList=!1,this.plannerProps=void 0}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);null!=t&&(it(this,M,"f").debug.logMessage(this,"Initializing stateId "+this.stateId),this.detailFilter=t.detailFilter,this.showSecondaryDates=t.showSecondaryDates,this.detailInitialScrollX=t.detailInitialScrollX,this.detailInitialScrollY=t.detailInitialScrollY,this.taskFilter=t.taskFilter,this.taskInitialScrollX=t.taskInitialScrollX,this.taskInitialScrollY=t.taskInitialScrollY,this.viewMode=t.viewMode)}}persistState(){if(this.store&&this.stateId){let t=!1;it(this,M,"f").objects.deepEqual(this.state.detailFilter,it(this,R,"f").detailFilter)||(this.state.detailFilter=it(this,R,"f").detailFilter,t=!0),it(this,M,"f").objects.deepEqual(this.state.showSecondaryDates,it(this,R,"f").showSecondaryDates)||(this.state.showSecondaryDates=it(this,R,"f").showSecondaryDates,t=!0),it(this,M,"f").objects.deepEqual(this.state.detailInitialScrollX,it(this,R,"f").detailInitialScrollX)||(this.state.detailInitialScrollX=it(this,R,"f").detailInitialScrollX,t=!0),it(this,M,"f").objects.deepEqual(this.state.detailInitialScrollY,it(this,R,"f").detailInitialScrollY)||(this.state.detailInitialScrollY=it(this,R,"f").detailInitialScrollY,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskFilter,it(this,R,"f").taskFilter)||(this.state.taskFilter=it(this,R,"f").taskFilter,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskInitialScrollX,it(this,R,"f").taskInitialScrollX)||(this.state.taskInitialScrollX=it(this,R,"f").taskInitialScrollX,t=!0),it(this,M,"f").objects.deepEqual(this.state.taskInitialScrollY,it(this,R,"f").taskInitialScrollY)||(this.state.taskInitialScrollY=it(this,R,"f").taskInitialScrollY,t=!0),it(this,M,"f").objects.deepEqual(this.state.viewMode,it(this,R,"f").viewMode)||(this.state.viewMode=it(this,R,"f").viewMode,t=!0),t&&(it(this,M,"f").debug.logMessage(this,"Persisting stateId "+this.stateId),this.store.persistState(this.stateId,this.state))}}dataChanged(){st(this,I,{},"f")}async getProps(t){return l(this,k,t)}async refresh(){s(this),this.plannerRenderer.refresh()}async setProps(t){c(this,k,t)}async addPhases(t,i){var s;const h=it(this,H,"m",K).call(this,t);h&&(it(this,I,"f")[t]=i,h.phases=null===(s=i.rows)||void 0===s?void 0:s.filter((t=>C(t.cells[this.phaseDates[0]],t.cells[this.phaseDates[1]]))).map((t=>{const s=x(t.cells[this.phaseDates[0]],t.cells[this.phaseDates[1]],t.cells[this.phasePrevDates[0]],t.cells[this.phasePrevDates[1]],t.cells[this.phaseHours[0]],t.cells[this.phaseHours[1]],t.cells[this.phasePrevHours[0]],t.cells[this.phasePrevHours[1]]),e=T(t,this.phaseIdCol,this.phaseNameCol,i.columns,this.phaseColumns,(()=>this.phaseColumns.map((s=>s==this.phaseDates[0]?"#START#":s==this.phaseDates[1]?"#END#":r(i.columns.find((t=>t.name==s)),t.cells[s])))));let n=it(this,H,"m",$).call(this,t,this.phaseIconCol),o=it(this,H,"m",tt).call(this,t,this.phaseIconCol);return{taskRow:h.taskRow,phaseRow:t,id:h.id+"_"+t.cells[this.phaseIdCol].value,phaseRowId:t.id,taskRowId:h.taskRowId,name:t.cells[this.phaseNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"task",color:t.cells[this.phaseColorCol].value,selectedColor:t.cells[this.phaseColorCol].value,valuesToShow:e,rowType:p.PHASE,icon:n?{url:n,color:null!=o?o:"#595959"}:void 0,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]}}))),this.plannerProps.mainGantt.initialScrollX=it(this,R,"f").taskInitialScrollX,this.plannerProps.mainGantt.initialScrollY=it(this,R,"f").taskInitialScrollY,this.plannerProps.secondaryGantt&&(this.plannerProps.secondaryGantt.initialScrollX=it(this,R,"f").detailInitialScrollX,this.plannerProps.secondaryGantt.initialScrollX=it(this,R,"f").detailInitialScrollY),this.plannerProps=Object.assign({},this.plannerProps),this.refresh()}componentWillLoad(){it(this,M,"f").debug.logLoad(this,!1),it(this,M,"f").theme.register(this),this.initWithPersistedState(),st(this,R,{detailFilter:this.detailFilter,detailInitialScrollX:this.detailInitialScrollX,detailInitialScrollY:this.detailInitialScrollY,showSecondaryDates:this.showSecondaryDates,taskFilter:this.taskFilter,taskInitialScrollX:this.taskInitialScrollX,taskInitialScrollY:this.taskInitialScrollY,viewMode:this.viewMode},"f")}componentDidLoad(){let t=it(this,H,"m",Y).call(this,it(this,H,"m",Z).call(this,it(this,R,"f").detailFilter,!0));const i=this.rootElement.shadowRoot.querySelector("#main-filter");g(i);const s=this.rootElement.shadowRoot.querySelector("#secondary-filter");let h,e,n;t&&g(s),this.plannerProps={mainGantt:{title:this.titleMess,items:it(this,H,"m",V).call(this,it(this,H,"m",Z).call(this,it(this,R,"f").taskFilter,!1)),stylingOptions:Object.assign(Object.assign({},u),{listCellWidth:this.listCellWidth}),filter:i,hideLabel:!0,ganttHeight:this.taskHeight,showSecondaryDates:it(this,R,"f").showSecondaryDates,onClick:t=>this.handleOnClick(t),onDblClick:t=>this.handleOnDblClick(t),onContextMenu:(t,i)=>this.handleOnContextMenu(t,i),onDateChange:t=>this.handleOnDateChange(t),initialScrollX:this.taskInitialScrollX,initialScrollY:this.taskInitialScrollY,readOnly:this.readOnly,onScrollY:t=>{window.clearTimeout(e),e=window.setTimeout((()=>this.handleTaskGanttScrollY(t)),500)},onPhaseDrop:t=>this.handleOnPhaseDrop(t)},secondaryGantt:t?{title:"",items:t,stylingOptions:Object.assign(Object.assign({},u),{listCellWidth:this.listCellWidth}),filter:s,hideLabel:!0,ganttHeight:this.detailHeight,onClick:t=>this.handleOnClick(t),onContextMenu:(t,i)=>this.handleOnContextMenu(t,i),onDateChange:t=>this.handleOnDateChange(t),initialScrollX:this.detailInitialScrollX,initialScrollY:this.detailInitialScrollY,readOnly:this.readOnly,onScrollY:t=>{window.clearTimeout(n),n=window.setTimeout((()=>this.handleDetailGanttScrollY(t)),500)}}:void 0,onSetDoubleView:t=>this.handleOnSetDoubleView(t),onSetViewMode:t=>this.handleOnSetViewMode(t),viewMode:this.viewMode,scrollableTaskList:this.scrollableTaskList,onScrollX:t=>{window.clearTimeout(h),h=window.setTimeout((()=>this.handleOnScrollX(t)),500)}},this.kupReady.emit({comp:this,id:this.rootElement.id,value:void 0}),this.taskFilter&&it(this,H,"m",U).call(this,this.taskFilter),this.detailFilter&&it(this,H,"m",U).call(this,this.detailFilter,!0),it(this,M,"f").debug.logLoad(this,!0)}componentDidRender(){this.persistState(),it(this,M,"f").debug.logRender(this,!0)}onKupDblClick(t,i){this.kupDblClick.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupClick(t,i){this.kupClick.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupContextMenu(t,i,s){let h,e,n;switch(i.type){case"project":h=i.taskRow,e=h.cells[this.taskIdCol],n=this.data.columns[this.taskIdCol];break;case"task":h=i.phaseRow,e=h.cells[this.phaseIdCol];break;case"timeline":h=i.detailRow,e=h.cells[this.detailIdCol],n=this.data.columns[this.detailIdCol]}this.kupContextMenu.emit({comp:this,id:this.rootElement.id,value:i,taskAction:s,details:{cell:e,column:n,originalEvent:t,row:h}})}onKupDateChange(t,i){this.kupDateChange.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}onKupPhaseDrop(t,i){this.kupPhaseDrop.emit({comp:this,id:this.rootElement.id,value:t,taskAction:i})}handleOnDblClick(t){switch(t.rowType){case p.TASK:it(this,H,"m",G).call(this)&&this.onKupDblClick(t,m.onDblClick);break;case p.PHASE:it(this,H,"m",X).call(this)&&this.onKupDblClick(t,m.onDblClick);break;case p.DETAIL:it(this,H,"m",L).call(this)&&this.onKupDblClick(t,m.onDblClick)}for(let t=0;t<it(this,W,"f").length;t++)clearTimeout(it(this,W,"f")[t]),it(this,M,"f").debug.logMessage(this,"Cleared click timeout("+it(this,W,"f")[t]+").");st(this,W,[],"f")}handleOnClick(t){it(this,W,"f").push(setTimeout((()=>{switch(t.rowType){case p.TASK:const i=t.phases?m.onTaskClosing:m.onTaskOpening;it(this,H,"m",F).call(this,t)&&this.onKupClick(t,i);break;case p.PHASE:it(this,H,"m",N).call(this)&&this.onKupClick(t,m.onClick);break;case p.DETAIL:it(this,H,"m",_).call(this)&&this.onKupClick(t,m.onClick)}}),300))}handleOnContextMenu(t,i){switch(i.rowType){case p.TASK:it(this,H,"m",q).call(this)&&this.onKupContextMenu(t,i,m.onRightClick);break;case p.PHASE:it(this,H,"m",B).call(this)&&this.onKupContextMenu(t,i,m.onRightClick);break;case p.DETAIL:it(this,H,"m",J).call(this)&&this.onKupContextMenu(t,i,m.onRightClick)}}handleOnSetDoubleView(t){var i;it(this,R,"f").showSecondaryDates=t,(null===(i=this.plannerProps)||void 0===i?void 0:i.mainGantt)&&(this.plannerProps.mainGantt.showSecondaryDates=t),this.persistState()}handleOnSetViewMode(t){it(this,R,"f").viewMode=t,this.plannerProps.viewMode=t,this.persistState()}handleOnScrollX(t){it(this,R,"f").taskInitialScrollX=t,it(this,R,"f").detailInitialScrollX=t,this.persistState()}handleTaskGanttScrollY(t){it(this,R,"f").taskInitialScrollY=t,this.persistState()}handleDetailGanttScrollY(t){it(this,R,"f").detailInitialScrollY=t,this.persistState()}handleOnDateChange(t){it(this,H,"m",Q).call(this,t)&&t.rowType!=p.DETAIL&&this.onKupDateChange(t,m.onResize)}handleOnPhaseDrop(t){this.onKupPhaseDrop(t,m.onTask)}render(){var t,i,s;const n=this.plannerProps?Object.assign(Object.assign({},this.plannerProps),{onSetDoubleView:this.handleOnSetDoubleView.bind(this),onSetViewMode:this.handleOnSetViewMode.bind(this),onScrollX:this.handleOnScrollX.bind(this),mainGantt:Object.assign(Object.assign({},null===(t=this.plannerProps)||void 0===t?void 0:t.mainGantt),{onScrollY:this.handleTaskGanttScrollY.bind(this)})}):null;return(null===(i=this.plannerProps)||void 0===i?void 0:i.secondaryGantt)&&(n.secondaryGantt=Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{onScrollY:this.handleDetailGanttScrollY.bind(this)})),h(e,{key:"b92ccaa55c0653a32090bd2f8d56137ca3c020c1"},h("style",{key:"0c84264c55e0bc13bab866b0240200851ca2d278"},it(this,M,"f").theme.setKupStyle(this.rootElement)),h("div",{key:"b13e4e3f5736fb548b1b4090948ed1bfbcf5c2b7",id:w,style:{maxWidth:this.maxWidth}},this.plannerProps&&h("kup-planner-renderer",{key:"cb5cb8c176fb49c8b3dc4ff8bf68aa383ea3b3b6",props:n,ref:t=>this.plannerRenderer=t})),h("div",{key:"b17375ff799b641dd10154ea34b62e595237a260",style:{display:this.plannerProps?"none":""}},h(b,{key:"2b2c91d6a081640b8bda0b693ddcd89a9610e229",icon:f.SEARCH,id:"main-filter",label:it(this,M,"f").language.translate(d.SEARCH),onKeyDown:t=>{"Enter"===t.key&&it(this,H,"m",U).call(this,t.target.value)},value:this.taskFilter,wrapperClass:"filter"}),(null===(s=this.detailData)||void 0===s?void 0:s.rows)&&this.detailData.rows.length>0?h(b,{icon:f.SEARCH,id:"secondary-filter",label:it(this,M,"f").language.translate(d.SEARCH),onKeyDown:t=>{"Enter"===t.key&&it(this,H,"m",U).call(this,t.target.value,!0)},value:this.detailFilter,wrapperClass:"filter"}):null))}disconnectedCallback(){it(this,M,"f").theme.unregister(this),this.kupDidUnload.emit({comp:this,id:this.rootElement.id,storedSettings:it(this,R,"f")})}get rootElement(){return n(this)}static get watchers(){return{data:["dataChanged"]}}};M=new WeakMap,P=new WeakMap,W=new WeakMap,I=new WeakMap,R=new WeakMap,H=new WeakSet,V=function(t){var i;return t&&t.rows?null===(i=t.rows)||void 0===i?void 0:i.filter((t=>C(t.cells[this.taskDates[0]],t.cells[this.taskDates[1]]))).map((i=>{const s=x(i.cells[this.taskDates[0]],i.cells[this.taskDates[1]],i.cells[this.taskPrevDates[0]],i.cells[this.taskPrevDates[1]],i.cells[this.taskHours[0]],i.cells[this.taskHours[1]],i.cells[this.taskPrevHours[0]],i.cells[this.taskPrevHours[1]]),h=T(i,this.taskIdCol,this.taskNameCol,t.columns,this.taskColumns,(()=>this.taskColumns.map((s=>s==this.taskDates[0]?"#START#":s==this.taskDates[1]?"#END#":r(t.columns.find((t=>t.name==s)),i.cells[s])))));let e=it(this,H,"m",$).call(this,i,this.taskIconCol),n=it(this,H,"m",tt).call(this,i,this.taskIconCol);return{taskRow:i,taskRowId:i.id,id:i.cells[this.taskIdCol].value,name:i.cells[this.taskNameCol].value,startDate:s.dateValues[0],endDate:s.dateValues[1],secondaryStartDate:s.secDateValues[0],secondaryEndDate:s.secDateValues[1],type:"project",valuesToShow:h,rowType:p.TASK,icon:e?{url:e,color:null!=n?n:"#595959"}:void 0,startHour:s.hourValues[0],endHour:s.hourValues[1],secondaryStartHour:s.secHourValues[0],secondaryEndHour:s.secHourValues[1]}})):[]},Y=function(t){if(!t||!t.rows)return;let i=[];return t.rows.filter((t=>C(t.cells[this.detailDates[0]],t.cells[this.detailDates[1]]))).forEach((s=>{var h,e;const n=s.cells[this.detailIdCol].value,o=s.cells[this.detailNameCol].value,a=x(s.cells[this.detailDates[0]],s.cells[this.detailDates[1]],void 0,void 0,s.cells[this.detailHours[0]],s.cells[this.detailHours[1]]),r=T(s,this.detailIdCol,this.detailNameCol,t.columns,this.detailColumns);let l=i.find((t=>t.id==n));l||(l={id:n,name:o,detailRow:s,type:"timeline",valuesToShow:r,rowType:p.DETAIL,schedule:[]},i.push(l));let c=it(this,H,"m",$).call(this,s,this.detailIconCol),f=it(this,H,"m",tt).call(this,s,this.detailIconCol);l.schedule.push({startDate:a.dateValues[0],endDate:a.dateValues[1],color:this.detailColorCol&&null!==(h=s.cells[this.detailColorCol].value)&&void 0!==h?h:"#D9D9D8",selectedColor:this.detailColorCol&&null!==(e=s.cells[this.detailColorCol].value)&&void 0!==e?e:"#D9D9D8",icon:c?{url:c,color:null!=f?f:"#595959"}:void 0,startHour:a.hourValues[0],endHour:a.hourValues[1]})})),i},K=function(t){return this.plannerProps.mainGantt.items.find((i=>i.id==t))},A=function(t){const i=it(this,H,"m",K).call(this,t);i&&(i.phases=void 0),this.plannerProps=Object.assign({},this.plannerProps)},G=function(){return!0},X=function(){return!0},L=function(){return!0},F=function(t){const i=it(this,H,"m",K).call(this,t.id);return(null==i?void 0:i.phases)&&it(this,H,"m",A).call(this,i.id),!0},N=function(){return!0},_=function(){return!0},q=function(){return!0},B=function(){return!0},J=function(){return!0},Q=function(t){let i=!1;return it(this,P,"f")?it(this,P,"f").isEquivalent(t)||(st(this,P,new v(t),"f"),i=!0):(i=!0,st(this,P,new v(t),"f")),i},U=function(t,i){i?it(this,R,"f").detailFilter=t:it(this,R,"f").taskFilter=t;const s=i?{secondaryGantt:Object.assign(Object.assign({},this.plannerProps.secondaryGantt),{items:it(this,H,"m",Y).call(this,it(this,H,"m",Z).call(this,t,i))})}:{mainGantt:Object.assign(Object.assign({},this.plannerProps.mainGantt),{items:it(this,H,"m",V).call(this,it(this,H,"m",Z).call(this,t,i))})};this.plannerProps=Object.assign(Object.assign({},this.plannerProps),s),this.persistState()},Z=function(t,i){const s=i?this.detailData:this.data;if(!s||!s.rows||0==s.rows.length)return;if(!t)return s;const h={columns:this.data.columns,rows:[]},e=[];for(let i=0;i<s.rows.length;i++){const h=s.rows[i],n=h.cells;for(let i=0;i<s.columns.length;i++){const o=n[s.columns[i].name];if(o&&r(s.columns[i],o).toLowerCase().indexOf(t.toLowerCase())>-1){e.push({row:h,weight:i});break}}}return e.sort(((t,i)=>t.weight-i.weight)).forEach((t=>{h.rows.push(t.row)})),h},$=function(t,i){var s;let h;if(i){const e=t.cells[i];let n=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.resource;n||(n=e.value),n&&(h=o("./assets/svg/"+n+".svg"))}return h},tt=function(t,i){var s;let h;if(i){const e=t.cells[i];h=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.color,h&&(h=it(this,M,"f").theme.colorCheck(h).hexColor)}return h},ht.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{display:block}.filter{margin-bottom:var(--kup-space-04)}.planner-render{padding-top:40px}";export{ht as kup_planner}
@@ -1 +1 @@
1
- import{r as t,c as i,f as e,h as o,H as s,d as a}from"./p-710d0a7d.js";import{k as n,e as h,g as r,s as p}from"./p-c98fb668.js";import{a as f,F as l}from"./p-cec0955d.js";import{c}from"./p-635bb4b3.js";import{F as u}from"./p-cce08de3.js";import"./p-adadf8b5.js";var d;!function(t){t.data="the text of the text",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"}(d||(d={}));var y,g,m=function(t,i,e,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!s:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(t,e):s?s.value=e:i.set(t,e),e},k=function(t,i,e,o){if("a"===e&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!o:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?o:"a"===e?o.call(t):o?o.value:i.get(t)};const b=class{constructor(e){t(this,e),this.kupIconClick=i(this,"kup-typography-iconclick",6),this.kupClick=i(this,"kup-typography-click",6),this.kupInfoIconClick=i(this,"kup-typography-infoiconclick",6),this.kupItemClick=i(this,"kup-typography-itemclick",6),this.toolbarState=[],this.infoState=[],this.kupManager=n(),y.set(this,null),g.set(this,null),this.customStyle="",this.infoIcon=!1,this.toolbar=!0,this.type=f.BODY_COMPACT,this.value=null,this.toolbarCallback=void 0,this.infoCallBack=void 0}onKupClick(){this.kupClick.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupInfoIconClick(t){t?(m(this,g,t,"f"),this.createDropDownInfoList()):this.kupManager.debug.logMessage(this,"onKupIconClick: Element is null")}onKupIconClick(t){t?(m(this,g,t,"f"),this.createDropDownToolbarList()):this.kupManager.debug.logMessage(this,"onKupIconClick: Element is null")}onKupToolbarItemClick(t){this.kupItemClick.emit({comp:this,id:this.rootElement.id,value:this.value,node:t.detail.selected})}closeRowToolbarList(){this.toolbarList&&(this.kupManager.dynamicPosition.stop(this.toolbarList),this.kupManager.removeClickCallback(k(this,y,"f")),this.toolbarList.remove(),this.kupManager.dynamicPosition.unregister([this.toolbarList]),this.toolbarList=null)}createDropDownToolbarList(){if(!k(this,g,"f"))return void this.kupManager.debug.logMessage(this,"createDropDownToolbarList: Anchor is null!");if(this.toolbarList&&this.closeRowToolbarList(),0===this.toolbarState.length)return void this.kupManager.debug.logMessage(this,"No toolbar state available.");const t=document.createElement("kup-toolbar");t.data=this.toolbarState,t.addEventListener("kup-toolbar-click",(t=>{this.onKupToolbarItemClick(t),setTimeout((()=>{this.closeRowToolbarList()}),0)})),this.toolbarList=t,m(this,y,{cb:()=>{this.closeRowToolbarList()},el:this.toolbarList},"f"),this.kupManager.addClickCallback(k(this,y,"f"),!0),this.rootElement.shadowRoot.appendChild(this.toolbarList),requestAnimationFrame((()=>{k(this,g,"f")?(this.kupManager.dynamicPosition.register(this.toolbarList,k(this,g,"f"),0,h.AUTO,!0),this.kupManager.dynamicPosition.start(this.toolbarList)):this.kupManager.debug.logMessage(this,"DropDown anchor is still null after delay!")}))}createDropDownInfoList(){if(!k(this,g,"f"))return void this.kupManager.debug.logMessage(this,"createDropDownToolbarList: Anchor is null!");if(this.infoList&&this.closeInfoDataList(),0===this.infoState.length)return void this.kupManager.debug.logMessage(this,"No infoicon available.");const t=document.createElement("kup-list");t.data=this.infoState,this.infoList=t,m(this,y,{cb:()=>{this.closeInfoDataList()},el:this.infoList},"f"),this.kupManager.addClickCallback(k(this,y,"f"),!0),this.rootElement.shadowRoot.appendChild(this.infoList),requestAnimationFrame((()=>{this.kupManager.dynamicPosition.register(this.infoList,k(this,g,"f"),0,h.AUTO,!0),this.kupManager.dynamicPosition.start(this.infoList)}))}closeInfoDataList(){this.infoList&&(this.kupManager.dynamicPosition.stop(this.infoList),this.kupManager.removeClickCallback(k(this,y,"f")),this.infoList.remove(),this.kupManager.dynamicPosition.unregister([this.infoList]),this.infoList=null)}async getProps(t){return r(this,d,t)}async refresh(){e(this)}async setProps(t){p(this,d,t)}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){const t={toolbar:this.toolbar,value:this.value,type:this.type},i={"kup-typography--wrap":!!t.toolbar};return o(s,{key:"4d9b49a70410c35af3d8fa1c5868a6cfb1ee5420"},o("style",{key:"d614ca7ac690e2b84fecf531c0a35ef450fe97b0"},this.kupManager.theme.setKupStyle(this.rootElement)),o("div",{key:"1518f326fa6e41f67b5208ade340e6e949f168bf",id:c,class:i,onClick:()=>this.onKupClick},o(l,Object.assign({key:"d7d9b24f7707041edd45e1d526d3e73d754137cd"},t)),this.infoIcon&&o(u,Object.assign({key:"1edfaa26af5dd36705f7abb793835db19e73abae"},{color:"var(--kup-gray-color-70)",resource:"info_outline",sizeX:"16px",sizeY:"16px",wrapperClass:"image__iconToolbar iconInfo"},{onClick:async t=>{t.stopPropagation();const i=t.currentTarget,e=await this.infoCallBack();this.infoState=e,this.infoState.length>0?this.onKupInfoIconClick(i):this.kupManager.debug.logMessage(this,"Toolbar data is empty, not opening dropdown.")}})),this.toolbar&&o(u,Object.assign({key:"9b4e57e71be401942c814ddded5208c6e68d9db3"},{color:"var(--kup-gray-color-70)",resource:"more_vert",sizeX:"16px",sizeY:"16px",wrapperClass:"image__iconToolbar iconToolbar"},{onClick:async t=>{t.stopPropagation();const i=t.currentTarget,e=await this.toolbarCallback();this.toolbarState=e,this.toolbarState.length>0?this.onKupIconClick(i):this.kupManager.debug.logMessage(this,"Toolbar data is empty, not opening dropdown.")}}))))}disconnectedCallback(){this.kupManager.theme.unregister(this),this.toolbarList&&this.kupManager.dynamicPosition.unregister([this.toolbarList]),this.infoList&&this.kupManager.dynamicPosition.unregister([this.infoList])}static get assetsDirs(){return["assets/fonts"]}get rootElement(){return a(this)}};y=new WeakMap,g=new WeakMap,b.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}.kup-typography--wrap{display:flex;align-items:center;gap:var(--kup-space-03)}.kup-typography--wrap:hover .image__iconToolbar{opacity:0.3}.kup-typography--wrap:hover .image__iconToolbar:hover{cursor:pointer;opacity:1;background-color:var(--kup-gray-color-20-hover)}.kup-typography--wrap .image__iconToolbar{opacity:0.3;margin:0}:host{display:block}";export{b as kup_typography}
1
+ import{r as t,c as i,f as e,h as o,H as s,d as a}from"./p-710d0a7d.js";import{k as n,e as h,g as r,s as p}from"./p-ecf0eb17.js";import{a as f,F as l}from"./p-cec0955d.js";import{c}from"./p-635bb4b3.js";import{F as u}from"./p-cce08de3.js";import"./p-adadf8b5.js";var d;!function(t){t.data="the text of the text",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"}(d||(d={}));var y,g,m=function(t,i,e,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!s:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(t,e):s?s.value=e:i.set(t,e),e},k=function(t,i,e,o){if("a"===e&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!o:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?o:"a"===e?o.call(t):o?o.value:i.get(t)};const b=class{constructor(e){t(this,e),this.kupIconClick=i(this,"kup-typography-iconclick",6),this.kupClick=i(this,"kup-typography-click",6),this.kupInfoIconClick=i(this,"kup-typography-infoiconclick",6),this.kupItemClick=i(this,"kup-typography-itemclick",6),this.toolbarState=[],this.infoState=[],this.kupManager=n(),y.set(this,null),g.set(this,null),this.customStyle="",this.infoIcon=!1,this.toolbar=!0,this.type=f.BODY_COMPACT,this.value=null,this.toolbarCallback=void 0,this.infoCallBack=void 0}onKupClick(){this.kupClick.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupInfoIconClick(t){t?(m(this,g,t,"f"),this.createDropDownInfoList()):this.kupManager.debug.logMessage(this,"onKupIconClick: Element is null")}onKupIconClick(t){t?(m(this,g,t,"f"),this.createDropDownToolbarList()):this.kupManager.debug.logMessage(this,"onKupIconClick: Element is null")}onKupToolbarItemClick(t){this.kupItemClick.emit({comp:this,id:this.rootElement.id,value:this.value,node:t.detail.selected})}closeRowToolbarList(){this.toolbarList&&(this.kupManager.dynamicPosition.stop(this.toolbarList),this.kupManager.removeClickCallback(k(this,y,"f")),this.toolbarList.remove(),this.kupManager.dynamicPosition.unregister([this.toolbarList]),this.toolbarList=null)}createDropDownToolbarList(){if(!k(this,g,"f"))return void this.kupManager.debug.logMessage(this,"createDropDownToolbarList: Anchor is null!");if(this.toolbarList&&this.closeRowToolbarList(),0===this.toolbarState.length)return void this.kupManager.debug.logMessage(this,"No toolbar state available.");const t=document.createElement("kup-toolbar");t.data=this.toolbarState,t.addEventListener("kup-toolbar-click",(t=>{this.onKupToolbarItemClick(t),setTimeout((()=>{this.closeRowToolbarList()}),0)})),this.toolbarList=t,m(this,y,{cb:()=>{this.closeRowToolbarList()},el:this.toolbarList},"f"),this.kupManager.addClickCallback(k(this,y,"f"),!0),this.rootElement.shadowRoot.appendChild(this.toolbarList),requestAnimationFrame((()=>{k(this,g,"f")?(this.kupManager.dynamicPosition.register(this.toolbarList,k(this,g,"f"),0,h.AUTO,!0),this.kupManager.dynamicPosition.start(this.toolbarList)):this.kupManager.debug.logMessage(this,"DropDown anchor is still null after delay!")}))}createDropDownInfoList(){if(!k(this,g,"f"))return void this.kupManager.debug.logMessage(this,"createDropDownToolbarList: Anchor is null!");if(this.infoList&&this.closeInfoDataList(),0===this.infoState.length)return void this.kupManager.debug.logMessage(this,"No infoicon available.");const t=document.createElement("kup-list");t.data=this.infoState,this.infoList=t,m(this,y,{cb:()=>{this.closeInfoDataList()},el:this.infoList},"f"),this.kupManager.addClickCallback(k(this,y,"f"),!0),this.rootElement.shadowRoot.appendChild(this.infoList),requestAnimationFrame((()=>{this.kupManager.dynamicPosition.register(this.infoList,k(this,g,"f"),0,h.AUTO,!0),this.kupManager.dynamicPosition.start(this.infoList)}))}closeInfoDataList(){this.infoList&&(this.kupManager.dynamicPosition.stop(this.infoList),this.kupManager.removeClickCallback(k(this,y,"f")),this.infoList.remove(),this.kupManager.dynamicPosition.unregister([this.infoList]),this.infoList=null)}async getProps(t){return r(this,d,t)}async refresh(){e(this)}async setProps(t){p(this,d,t)}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){const t={toolbar:this.toolbar,value:this.value,type:this.type},i={"kup-typography--wrap":!!t.toolbar};return o(s,{key:"4d9b49a70410c35af3d8fa1c5868a6cfb1ee5420"},o("style",{key:"d614ca7ac690e2b84fecf531c0a35ef450fe97b0"},this.kupManager.theme.setKupStyle(this.rootElement)),o("div",{key:"1518f326fa6e41f67b5208ade340e6e949f168bf",id:c,class:i,onClick:()=>this.onKupClick},o(l,Object.assign({key:"d7d9b24f7707041edd45e1d526d3e73d754137cd"},t)),this.infoIcon&&o(u,Object.assign({key:"1edfaa26af5dd36705f7abb793835db19e73abae"},{color:"var(--kup-gray-color-70)",resource:"info_outline",sizeX:"16px",sizeY:"16px",wrapperClass:"image__iconToolbar iconInfo"},{onClick:async t=>{t.stopPropagation();const i=t.currentTarget,e=await this.infoCallBack();this.infoState=e,this.infoState.length>0?this.onKupInfoIconClick(i):this.kupManager.debug.logMessage(this,"Toolbar data is empty, not opening dropdown.")}})),this.toolbar&&o(u,Object.assign({key:"9b4e57e71be401942c814ddded5208c6e68d9db3"},{color:"var(--kup-gray-color-70)",resource:"more_vert",sizeX:"16px",sizeY:"16px",wrapperClass:"image__iconToolbar iconToolbar"},{onClick:async t=>{t.stopPropagation();const i=t.currentTarget,e=await this.toolbarCallback();this.toolbarState=e,this.toolbarState.length>0?this.onKupIconClick(i):this.kupManager.debug.logMessage(this,"Toolbar data is empty, not opening dropdown.")}}))))}disconnectedCallback(){this.kupManager.theme.unregister(this),this.toolbarList&&this.kupManager.dynamicPosition.unregister([this.toolbarList]),this.infoList&&this.kupManager.dynamicPosition.unregister([this.infoList])}static get assetsDirs(){return["assets/fonts"]}get rootElement(){return a(this)}};y=new WeakMap,g=new WeakMap,b.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}.kup-typography--wrap{display:flex;align-items:center;gap:var(--kup-space-03)}.kup-typography--wrap:hover .image__iconToolbar{opacity:0.3}.kup-typography--wrap:hover .image__iconToolbar:hover{cursor:pointer;opacity:1;background-color:var(--kup-gray-color-20-hover)}.kup-typography--wrap .image__iconToolbar{opacity:0.3;margin:0}:host{display:block}";export{b as kup_typography}
@@ -1 +1 @@
1
- import{h as e,F as n}from"./p-710d0a7d.js";import{ar as o,as as t,U as a,ae as c,f as l,ap as i,an as r,am as s,at as u,F as d,aj as p,a as b,au as k,I as v,av as f,aw as m,ax as h,ay as g,az as j,h as O}from"./p-c98fb668.js";import{F as x}from"./p-14c6efce.js";import{F as w}from"./p-31ae78d1.js";import{F as _,d as y}from"./p-42c1384e.js";import{F as C}from"./p-cce08de3.js";import{F as $}from"./p-8ffde22b.js";import{F}from"./p-e298b76c.js";var I;!function(e){e.RADIO="radio",e.CHEVRON="chevron"}(I||(I={}));const D=o=>{var t;const a=o.horizontal||"lineDirection"==o.RadLay,c=!!o.columns,l=[],i=o.type||I.RADIO;for(let a=0;a<(null===(t=o.data)||void 0===t?void 0:t.length);a++){const t=o.data[a],c={radio:!0,"radio--checked":!!t.checked,"radio--disabled":!!o.disabled,[`radio--${o.type}`]:!!o.type};l.push(e("div",{class:`form-field \n ${o.leadingLabel?" form-field--align-end":""} ${o.disabled?"radio--disabled":""} ${i===I.CHEVRON?"form--chevron":""}`,onClick:o.onChange?o.onChange.bind(o.onChange,a):null},e("div",{class:c},i===I.RADIO?e("input",{class:"radio__native-control",type:"radio",name:"radio-element",value:t.value,checked:t.checked,disabled:o.disabled,onBlur:o.onBlur,onChange:e=>{o.onChange&&o.onChange(a,e),e.stopPropagation()},onFocus:o.onFocus}):e(n,null,e(C,t.checked?{resource:"check",sizeX:"14px",sizeY:"14px"}:{sizeX:"14px",sizeY:"14px",onClick:e=>{o.onChange&&o.onChange(a,e),e.stopPropagation()}})),i===I.RADIO&&e("div",{class:"radio__background"},e("div",{class:"radio__outer-circle"}),e("div",{class:"radio__inner-circle"}))),e("div",{class:"label-wrapper",onClick:e=>{o.onChange&&o.onChange(a,e),e.stopPropagation()}},i===I.CHEVRON&&e(C,{resource:t.icon,sizeX:"14px",sizeY:"14px"}),e("label",{htmlFor:"radio-element"},t.label?t.label:""),t.shortcutLabel&&e("div",{class:"shortcut"},t.shortcutLabel))))}return e("div",{class:`f-radio radio-wrapper\n ${c?"radio-wrapper-grid":""} ${o.danger?"kup-danger":""} ${o.info?"kup-info":""} ${o.secondary?"kup-secondary":""} ${o.success?"kup-success":""} ${o.warning?"kup-warning":""} ${o.wrapperClass?o.wrapperClass:""} ${a?"kup-horizontal":""}`,style:{"--kup_radio_columns":c?`repeat(${o.columns}, 1fr)`:""}},l)},E=n=>(n.maxValue||(n.maxValue=5),e("div",{class:`f-rating ${n.disabled?"disabled":""} ${n.danger?"kup-danger":""} ${n.info?"kup-info":""} ${n.secondary?"kup-secondary":""} ${n.success?"kup-success":""} ${n.warning?"kup-warning":""} ${n.wrapperClass?n.wrapperClass:""}`},function(n){const o=[];for(let t=1;t<=n.maxValue;t++)o.push(e("span",{class:"rating",onClick:n.onClick?n.onClick.bind(n.onClick,t):null},t<=n.value?"★":"☆"));return o}(n)));var A;!function(e){e.SMALL="small",e.MEDIUM="medium"}(A||(A={}));const B=n=>{n.sizing||(n.sizing=A.MEDIUM),n.sizing.toLowerCase();const o={switch:!0,"switch--checked":n.checked,"switch--disabled":n.disabled,[`switch--${n.sizing}`]:!!n.sizing};return e("div",Object.assign({class:`f-switch ${n.danger?"kup-danger":""} ${n.info?"kup-info":""} ${n.secondary?"kup-secondary":""} ${n.success?"kup-success":""} ${n.warning?"kup-warning":""} ${n.wrapperClass?n.wrapperClass:""}`},n.dataSet,{id:n.id,title:n.title}),e("div",{class:"form-field "+(n.leadingLabel?"form-field--align-end":"")},e("div",{class:o},e("div",{class:"switch__track"}),e("div",{class:"switch__thumb-underlay"},e("div",{class:"switch__thumb"},e("input",{type:"checkbox",class:"switch__native-control",role:"switch",checked:n.checked,disabled:n.disabled,value:n.checked?"on":"off",onBlur:n.onBlur,onChange:n.onChange,onFocus:n.onFocus})))),e("label",{onClick:n.onChange},n.label)))},z={"*BOLD":"font-weight: bold; !important;","*ERROR":"color: white !important; background: red !important;","*UNDERLINE":"text-decoration: underline !important;","*ITALIC":"font-style: italic !important;"};function N(e){let n;switch(e){case"0":n="color: #000000 !important;";break;case"1":n="color: #6C7A89 !important;";break;case"2":n="color: #3A539B !important;";break;case"3":n="color: var(--kup-danger-color-60) !important;";break;case"4":n="color: #C0C0C0 !important;";break;case"5":n="color: #FFFFFF !important;";break;case"6":n="color: var(--kup-success-color-60) !important;";break;case"7":n="color: #9B59B6 !important;";break;default:n=""}return n}function R(e){let n;switch(e){case"1":n="font-weight: bold !important;";break;case"2":n="font-style: italic !important;";break;case"3":n="text-decoration: underline !important;";break;default:n=""}return n}function L(e){let n;switch(e){case"0":n="background: transparent;";break;case"1":n="background: #D5ECF7;";break;case"2":n="background: #59ABE3;";break;case"3":n="background: #446CB3;";break;case"4":n="background: #9B59B6;";break;case"5":n="background: #F1A9A0;";break;case"6":n="background: #E74C3C;";break;case"7":n="background: #CF000F;";break;case"8":n="background: #C0392B;";break;case"9":n="background: #95A5A6;";break;case"A":n="background: #F5D76E;";break;case"B":case"C":n="background: #F7CA18;";break;case"D":n="background: #F39C12;";break;case"E":n="background: #90C695;";break;case"F":n="background: #26A65B;";break;case"G":n="background: #019875;";break;case"H":n="background: #36D7B7;";break;default:n=""}return n}function K(e){let n;switch(e){case"1":n='font-family: "Courier New", Courier, monospace !important;';break;case"2":n='font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif !important;';break;case"3":n="font-family: Arial, Helvetica, sans-serif !important;";break;default:n=""}return n}const M=({style:n,text:o,classes:t})=>{const a=function(e){const n=[];let o=null;return function(e,n){const o=/((_G\d{2}[A-Z0-9]\d{2}_|_G\*(BOLD|ERROR|ITALIC|UNDERLINE)_)|_n_)/g;let t,a=0;for(;null!==(t=o.exec(e));)t.index>a&&n.onContent(e.slice(a,t.index)),"_n_"===t[1]?n.onEndTag(t[1]):n.onStartTag(t[2]),a=o.lastIndex;a<e.length&&n.onContent(e.slice(a))}(e,{onStartTag(e){(null==o?void 0:o.tag)&&(o.closed=!0),n.push(o={tag:e,content:""})},onEndTag(e){o?o.tag?(o.closed=!0,o=null):this.onContent(e):n.push(o={content:e})},onContent(e){o?o.content+=e:n.push(o={content:e})}}),o&&o.tag&&(o.closed=!0),n}(o);return e("span",{class:t,style:n},a.find((e=>void 0!==e.tag))?function(n){return n.map((n=>{var o,t;const a=function(e){const n=function(e){let n="";if((null==e?void 0:e.match(/\d{2}[A-Z0-9]\d{2}|\*(BOLD|ERROR|ITALIC|UNDERLINE)/))&&(n=z[e],!n)){n="";for(let o=0;o<e.length;o++)switch(o){case 0:n+=N(e.charAt(o));break;case 1:n+=R(e.charAt(o));break;case 2:n+=L(e.charAt(o));break;case 3:n+=K(e.charAt(o))}}return n}(e);return n.split(";").filter((e=>e.trim())).reduce(((e,n)=>{const[o,t]=n.split(":").map((e=>e.trim()));if(o&&t){const n=t.replace(/!important/g,"").trim();e[o.replace(/-([a-z])/g,((e,n)=>n.toUpperCase()))]=n}return e}),{})}(null===(o=n.tag)||void 0===o?void 0:o.replace(/[_]/g,"").slice(1));return n.closed?e("span",{style:a},n.content):e("span",null,`${null!==(t=n.tag)&&void 0!==t?t:""}${n.content}`)}))}(a):o)},T=document.documentElement,V=(n,i)=>{var r,s,k,f,O,I;const A=n.cell,z=n.column,N=n.row,R=n.shape?n.shape:A.shape?A.shape:z.shape?z.shape:null,L=!T.ketchup.objects.isEmptyKupObj(A.obj);let K=!1;A.hasOwnProperty("isEditable")?K=A.isEditable:z.hasOwnProperty("isEditable")&&(K=z.isEditable),K=K&&n.editable,A.data=null!==(r=X(A,z))&&void 0!==r?r:A.data;let V=null!==(s=A.decode)&&void 0!==s?s:A.value;const G=n.previousValue!==V?V:"",U=T.ketchup.data.cell.getType(A,R),Y="extra_dense"===n.density?"extra-small":null===(k=A.data)||void 0===k?void 0:k.sizing;let W=A.cssClass?A.cssClass:(null==z?void 0:z.cssClass)?null==z?void 0:z.cssClass:"";const P={"f-cell":!0,[a.OBJ]:!!L,[U+"-cell"]:!0,[n.wrapperClass]:!!n.wrapperClass,[n.density]:!(!n.density||U===c.BAR),[W]:!!W,"c-input-uppercase":g(A),"c-input-lowercase":j(A),"monospace c-pre":null===(f=A.data)||void 0===f?void 0:f.legacyLook};let Z=G;A.data&&0!==Object.keys(A.data).length||function(e,n){function o(e){return e.toUpperCase().startsWith("SHAPE;BAR")}function t(e){return e.toUpperCase().startsWith("SHAPE;")}function a(e){return e.toUpperCase().startsWith("BCOLOR;")}function l(e){return e.toUpperCase().startsWith("HEIGHT;")}function i(e){return e.toUpperCase().startsWith("SEP;")||e.toUpperCase().startsWith("DIV;")||e.toUpperCase().startsWith("ARW;")||e.toUpperCase().startsWith("GRID;")}function r(e){const n={},c=e.split("\\\\"),r=[];for(const e of c){if(e){if(i(e))return null;if(t(e)){if(!o(e))return null;{const o=e.split(";");if(3===o.length){const e=o[2].replace(",",".");isNaN(parseFloat(e))||(n.width=`${e}%`)}}}else if(a(e));else if(l(e)){const o=e.substring(7).replace(",",".");isNaN(parseFloat(o))||(n.height=`${o}%`)}else r.push(s(e,n))}return r.length?r:null}function s(e,n){const o=Object.assign({},n),t=e.split(";");if(t.length>=1){const e=/R(\d+)G(\d+)B(\d+)/.exec(t[0]);if(e){const[,n,t,a]=e;isNaN(parseInt(n,10))||isNaN(parseInt(t,10))||isNaN(parseInt(a,10))||(o.color=`rgb(${parseInt(n)},${parseInt(t)},${parseInt(a)})`)}if(t.length>=2){const e=t[1].replace(",",".");isNaN(parseFloat(e))||(o.width=`${e}%`)}}return o}}n.data={};switch(e){case c.CHECKBOX:case c.SWITCH:n.data.checked="1"===n.value;break;case c.BAR:t(n.value)?(n.data.isCanvas=!0,n.data.resource=n.value):n.data.data=function(e){if(!e)return null;const n=e.split("\\\\AND\\"),o=[];for(const e of n){const n=r(e);if(!n)return null;o.push(...n)}return o}(n.value);break;case c.BUTTON:n.data.label=n.value;break;case c.CHART:Object.assign(n.data,{sizeX:"100px",sizeY:"100px",offlineMode:{value:n.value,shape:"pie"}});break;case c.BUTTON_LIST:case c.CHIP:case c.MULTI_AUTOCOMPLETE:case c.MULTI_COMBOBOX:case c.RADIO:(()=>{var e;const o=null===(e=n.value)||void 0===e?void 0:e.split(";");if(""===(null==o?void 0:o[o.length-1].trim())&&o.pop(),o&&o.length){n.data.data=[];for(let e of o)n.data.data.push({id:e,value:e})}})();break;case c.COLOR_PICKER:n.data.initialValue=n.value;break;case c.GAUGE:case c.KNOB:case c.PROGRESS_BAR:case c.RATING:n.data.value=parseInt(n.value);break;case c.ICON:case c.IMAGE:n.data.resource=n.value}}(U,A);const q=Object.assign(Object.assign(Object.assign(Object.assign({},A.data),(null==A?void 0:A.icon)?{resource:A.icon}:{}),(null==A?void 0:A.placeholderIcon)?{placeholderResource:A.placeholderIcon}:{}),Y?{sizing:Y}:{});K&&o.includes(U)?(A.data.showMarker=null!==(O=A.tooltip)&&void 0!==O&&O,Z=function(n,o,t,l,i){var r,s,u,k,f,m,g,j,O,x,y,C,I,E;switch(n){case c.AUTOCOMPLETE:return e("kup-autocomplete",Object.assign({key:l.name+i.row.id,initialValue:t.value,initialValueDecode:t.decode},t.data,{class:le(i)?"kup-full-width":"","onkup-autocomplete-change":e=>ae(e,i,n,h.UPDATE),"onkup-autocomplete-input":e=>ae(e,i,n,h.INPUT),"onkup-autocomplete-iconclick":e=>ae(e,i,n,h.ICON_CLICK),"onKup-autocomplete-blur":e=>ae(e,i,n,h.BLUR),"onKup-autocomplete-itemclick":e=>ae(e,i,n,h.ITEMCLICK)}));case c.CHECKBOX:return ce(i)&&(o[a.C_CENTERED]=!0),t.shape===d.INPUT_CHECKBOX?e("input",{checked:"on"===t.value.toLowerCase()||"1"===t.value,class:"input-checkbox",onChange:e=>ae(e,i,n,h.UPDATE),type:"checkbox",onBlur:e=>ae(e,i,n,h.BLUR)}):e(w,Object.assign({},t.data,{onChange:e=>ae(e,i,n,h.UPDATE),onBlur:e=>ae(e,i,n,h.BLUR)}));case c.CHIP:return e("kup-chip",Object.assign({},t.data,{type:_.INPUT,enableInput:!0,"onKup-chip-change":e=>ae(e,i,n,h.UPDATE)}),e("kup-text-field",Object.assign({fullWidth:!0,slot:"field"},t.slotData,{error:t.data.error,"onKup-textfield-blur":e=>ae(e,i,n,h.BLUR)})));case c.COLOR_PICKER:return e("kup-color-picker",Object.assign({},t.data,{key:l.name+i.row.id,initialValue:t.value.toUpperCase(),class:le(i)?"kup-full-width":"",disabled:!1,"onkup-colorpicker-change":e=>ae(e,i,n,h.UPDATE)}));case c.COMBOBOX:return e("kup-combobox",Object.assign({key:l.name+i.row.id,initialValue:t.value,initialValueDecode:t.decode,ListDescrMode:t.data.ListDescrMode},t.data,{class:le(i)?"kup-full-width":"","onkup-combobox-change":e=>ae(e,i,n,h.UPDATE),"onkup-combobox-input":e=>ae(e,i,n,h.INPUT),"onkup-combobox-iconclick":e=>ae(e,i,n,h.ICON_CLICK),"onKup-combobox-blur":e=>ae(e,i,n,h.BLUR),"onKup-combobox-itemclick":e=>ae(e,i,n,h.ITEMCLICK)}));case c.DATE:return e("kup-date-picker",Object.assign({key:l.name+i.row.id,initialValue:t.value},t.data,{class:le(i)?"kup-full-width":"","onkup-datepicker-change":e=>ae(e,i,n,h.UPDATE),"onkup-datepicker-input":e=>ae(e,i,n,h.INPUT),"onKup-datepicker-blur":e=>ae(e,i,n,h.BLUR),"onkup-datepicker-textfieldsubmit":e=>ae(e,i,n,h.UPDATE)}));case c.EDITOR:const A=e=>{"Enter"!==e.key||e.ctrlKey?("Enter"===e.key&&e.ctrlKey||/^F[1-9]|F1[0-2]$/.test(e.key))&&ae(e,i,n,h.UPDATE):e.stopPropagation()};return e(F,Object.assign({},t.data,{textArea:!0,sizing:b.EXTRA_LARGE,label:l.title,fullWidth:!!le(i),maxLength:t.data.maxLength,value:t.value,onChange:e=>{ae(e,i,n,h.UPDATE)},onInput:e=>{var o,a;null===(a=null===(o=t.data)||void 0===o?void 0:o.onInput)||void 0===a||a.call(o,e),ae(e,i,n,h.INPUT)},onBlur:e=>ae(e,i,n,h.BLUR),onKeyDown:A}));case c.FILE_UPLOAD:return e("kup-file-upload",Object.assign({"onKup-file-upload-change":e=>ae(e,i,n,h.UPDATE)},t.data));case c.MULTI_AUTOCOMPLETE:return e("kup-chip",Object.assign({DescrMode:null!==(r=t.data.DescrMode)&&void 0!==r?r:v.DESCRIPTION},t.data,{label:null!==(u=null===(s=t.slotData)||void 0===s?void 0:s.label)&&void 0!==u?u:"",type:_.INPUT,enableInput:!0,"onKup-chip-change":e=>ae(e,i,n,h.UPDATE)}),e("kup-autocomplete",{class:"kup-full-width",slot:"field",DescrMode:v.CODE_AND_DESC,sizing:b.EXTRA_SMALL,"onKup-autocomplete-blur":e=>ae(e,i,n,h.BLUR),"onkup-autocomplete-input":e=>ae(e,i,n,h.INPUT),"onkup-autocomplete-iconclick":e=>ae(e,i,n,h.ICON_CLICK),data:null===(k=t.slotData)||void 0===k?void 0:k.data,initialValue:null===(f=t.slotData)||void 0===f?void 0:f.initialValue,showDropDownIcon:null===(m=t.slotData)||void 0===m?void 0:m.showDropDownIcon,style:null===(g=t.slotData)||void 0===g?void 0:g.style,disabled:null===(j=t.slotData)||void 0===j?void 0:j.disabled,id:null===(O=t.slotData)||void 0===O?void 0:O.id,error:t.data.error,showMarker:null!==(x=t.tooltip)&&void 0!==x&&x,ListDescrMode:t.data.ListDescrMode}));case c.MULTI_COMBOBOX:return e("kup-chip",Object.assign({DescrMode:null!==(y=t.data.DescrMode)&&void 0!==y?y:v.DESCRIPTION},t.data,{type:_.INPUT,enableInput:!0,"onKup-chip-change":e=>ae(e,i,n,h.UPDATE)}),e("kup-combobox",Object.assign({class:"kup-full-width",slot:"field",DescrMode:v.CODE_AND_DESC,sizing:b.EXTRA_SMALL,"onKup-combobox-blur":e=>ae(e,i,n,h.BLUR),"onkup-combobox-input":e=>ae(e,i,n,h.INPUT),"onkup-combobox-iconclick":e=>ae(e,i,n,h.ICON_CLICK)},t.slotData,{error:t.data.error,showMarker:null!==(C=t.tooltip)&&void 0!==C&&C,ListDescrMode:t.data.ListDescrMode})));case c.RADIO:return e(D,Object.assign({},t.data,{disabled:!1,onChange:(e,o)=>{const a=t.data.data;for(let n=0;n<a.length;n++){a[n].checked=n===e}ae(o,i,n,h.UPDATE)},onBlur:e=>ae(e,i,n,h.BLUR)}));case c.RATING:return e("kup-rating",Object.assign({key:l.name+i.row.id},t.data,{disabled:!1,"onkup-rating-click":e=>ae(e,i,n,h.UPDATE)}));case c.SWITCH:return e(B,Object.assign({},t.data,{disabled:!1,onChange:e=>ae(e,i,n,h.UPDATE),onBlur:e=>ae(e,i,n,h.BLUR)}));case c.TIME:return e("kup-time-picker",Object.assign({key:l.name+i.row.id,initialValue:t.value},t.data,{class:le(i)?"kup-full-width":"","onkup-timepicker-change":e=>ae(e,i,n,h.UPDATE),"onkup-timepicker-input":e=>ae(e,i,n,h.INPUT),"onKup-timepicker-blur":e=>ae(e,i,n,h.BLUR)}));case c.OBJECT:return e($,{cell:t,column:i.column,row:i.row,inputValue:t.value,onChange:e=>ae(e,i,n,h.UPDATE)});case c.NUMBER:o[a.C_RIGHT_ALIGNED]=!0;case c.LINK:case c.MEMO:case c.STRING:const z=e=>ae(e,i,n,h.UPDATE),N=e=>{var o,a;null===(a=null===(o=t.data)||void 0===o?void 0:o.onInput)||void 0===a||a.call(o,e),ae(e,i,n,h.INPUT)},R=e=>{var o,a,l;null===(a=null===(o=t.data)||void 0===o?void 0:o.onKeyDown)||void 0===a||a.call(o,e);const r="MEMO"===t.shape||(null===(l=t.data)||void 0===l?void 0:l.maxLength)>=256||n===c.MEMO,s="Enter"===e.key&&e.ctrlKey;r&&"Enter"===e.key&&!e.ctrlKey?e.stopPropagation():(s||/^F[1-9]|F1[0-2]$/.test(e.key))&&ae(e,i,n,h.UPDATE)},L=n===c.NUMBER?"number":null;if(t.shape===d.INPUT_FIELD){const o=n===c.NUMBER&&t.value?p(l,t):t.value;return e("input",{class:"input-field",onChange:z,onInput:N,onKeyDown:R,type:L,value:o,maxLength:null!==(E=null===(I=l.cellData)||void 0===I?void 0:I.maxLength)&&void 0!==E?E:-1})}{const o=!!t.shape&&t.shape===d.MEMO||!!n&&n===c.MEMO||t.data.maxLength>=256;return e(F,Object.assign({},t.data,{textArea:o,sizing:t.data.sizing?t.data.sizing:o?b.EXTRA_LARGE:b.SMALL,inputType:L,fullWidth:!!le(i),maxLength:n==c.NUMBER&&(i.column.decimals&&i.column.decimals>0||i.column.group)||i.column.integers&&i.column.integers>0?-1:t.data.maxLength,icon:t.data&&t.data.icon?t.data.icon:t.icon?t.icon:l.icon?l.icon:null,decimals:i.column.decimals,integers:i.column.integers,group:i.column.group,value:t.value,label:l.title,onChange:z,onInput:N,onKeyDown:R,onIconClick:e=>ae(e,i,n,h.ICON_CLICK),onBlur:e=>ae(e,i,n,h.BLUR)}))}}}(U,P,A,z,n)):A.data&&t.includes(U)?(n.setSizes&&function(e,n,o,t){switch(e){case c.BAR:n.sizeY||(n.sizeY="26px"),!n.sizeX&&t.size&&(n.sizeX=t.size);break;case c.BUTTON:let e="";n.label&&(e="36px"),o.style?o.style.height||(o.style.minHeight=e):o.style={minHeight:e};break;case c.CHART:n.sizeX||(n.sizeX="100%"),n.sizeY||(n.sizeY="100%");break;case c.CHIP:o.style?o.style.height||(o.style.minHeight="18px"):o.style={minHeight:"18px"};break;case c.RADIO:o.style?o.style.height||(o.style.minHeight="40px"):o.style={minHeight:"40px"}}}(U,q,A,z),Z=n.renderKup?function(n,o,t,l,i,r,s){switch(n){case c.BAR:return t.data?e("div",{style:{height:t.sizeY,width:"100%"}},e(C,Object.assign({},t))):e("kup-image",Object.assign({key:r.name+s.row.id,sizeX:"250px"},t));case c.BUTTON:ce(s)&&(o[a.C_CENTERED]=!0);let u=l.decode;u||l.icon||l.placeholderIcon||(u=l.value);const d=Object.assign({label:u,icon:l.icon,placeholderIcon:l.placeholderIcon,title:r.title},t);return e(x,Object.assign({},d,{onClick:e=>ae(e,s,n,h.CLICK)}));case c.BUTTON_LIST:return ce(s)&&(o[a.C_CENTERED]=!0),t["data-storage"]={cell:l,row:i,column:r},e("kup-button-list",Object.assign({key:r.name+s.row.id},t,{"onKup-buttonlist-click":e=>ae(e,s,n,h.CLICK)}));case c.CHART:return ce(s)&&(o[a.C_CENTERED]=!0),e("kup-chart",Object.assign({key:r.name+s.row.id},t));case c.MULTI_AUTOCOMPLETE:case c.MULTI_COMBOBOX:case c.CHIP:return e(y,Object.assign({},t));case c.COLOR_PICKER:return e("kup-color-picker",Object.assign({key:r.name+s.row.id},t,{class:le(s)?"kup-full-width":"",disabled:!0}));case c.GAUGE:return e("kup-gauge",Object.assign({key:r.name+s.row.id,value:T.ketchup.math.numberifySafe(l.value),"width-component":"280px"},t));case c.KNOB:case c.PROGRESS_BAR:return e("kup-progress-bar",Object.assign({key:r.name+s.row.id},t,{value:T.ketchup.math.numberifySafe(l.value)}));case c.RADIO:return ce(s)&&(o[a.C_CENTERED]=!0),t.disabled=i.readOnly,e(D,Object.assign({},t));case c.RATING:return e(E,Object.assign({},t,{disabled:!0}));case c.OBJECT:return e(F,Object.assign({icon:"table"},t,{disabled:!0}))}}(U,P,q,A,N,z,n):e("span",{class:"cell-"+U+" placeholder"})):(n.setSizes&&function(e,n,o,t){var a;switch(e){case c.CHECKBOX:case c.ICON:n.sizeX||(n.sizeX="18px"),n.sizeY||(n.sizeY="18px"),o.style?o.style.height||(o.style.minHeight=n.sizeY):o.style={minHeight:n.sizeY};break;case c.IMAGE:const e=(null===(a=t.cell)||void 0===a?void 0:a.value)||"",l=e.indexOf(".")>-1||e.indexOf("/")>-1||e.indexOf("\\")>-1;t.component.rootElement.tagName!==u.DATA_TABLE||l||(n.sizeX||n.sizeY?(n.sizeX||(n.sizeX="100%",n.wrapperClass="noWidth"),n.sizeY||(n.sizeY="auto")):(n.sizeX="100%",n.sizeY="64px",n.wrapperClass="noWidth")),t.component.rootElement.tagName===u.BOX?(n.sizeY||(n.sizeY="auto"),void 0===n.fit&&(n.fit=!0)):n.sizeX||(n.sizeX="auto"),n.sizeY||(n.sizeY="64px")}}(U,q,A,n),P[a.INDICATOR_TOPRIGHT]=null!==(I=A.tooltip)&&void 0!==I&&I,Z=function(n,o,t,l,i,r,s){switch(n){case c.AUTOCOMPLETE:case c.COMBOBOX:return t&&""!=t?e("div",{class:"f-cell__text"},m(i,t," - ")):t;case c.DATE:case c.DATETIME:case c.TIME:return t&&""!=t?e("div",{class:"f-cell__text"},p(r,i)):t;case c.CHECKBOX:return ce(s)&&(l[a.C_CENTERED]=!0),e(C,{resource:o.checked?"check_box":"check_box_outline_blank",sizeX:"18px",sizeY:"18px"});case c.EDITOR:case c.MEMO:return e("div",{innerHTML:p(r,i)});case c.ICON:case c.IMAGE:return ce(s)&&(l[a.C_CENTERED]=!0),o.badgeData&&(l[a.C_PADDED]=!0),e(C,Object.assign({},o));case c.LINK:return e("a",{href:t,target:"_blank"},p(r,i));case c.NUMBER:if(t&&""!=t){const n=T.ketchup.math.numberifySafe(i.value),o=p(r,i);return!Boolean(i.style&&i.style.color)&&n<0&&(l[a.TEXT_DANGER]=!0),ce(s)&&(l[a.C_RIGHT_ALIGNED]=!0),e("div",{class:"f-cell__text"},o)}return e("div",{class:"f-cell__text"},t);case c.SWITCH:return ce(s)&&(l[a.C_CENTERED]=!0),o.disabled=!0,e(B,Object.assign({},o));case c.LABEL:return e(M,{style:i.style,text:p(r,i),classes:"f-cell__text"});case c.IMAGE_LIST:const u=i.data.data.find((e=>e.value===i.value))||null;return e("kup-image-list",Object.assign({ripple:!0},i.data,{"onKup-imagelist-click":e=>ae(e,s,n,h.UPDATE),activeNode:u}));default:return e("div",{class:"f-cell__text"},i.data.DescrMode?m(i,t,"-"):t)}}(U,q,Z,P,A,z,n));let J=null;!K&&(z.icon||A.icon)&&Z&&U!=c.BUTTON&&U!=c.BUTTON_LIST&&U!=c.IMAGE&&U!=c.ICON&&(J=e(C,Object.assign({},{color:`rgba(var(${l.TEXT}-rgb), 0.375)`,resource:A.icon?A.icon:z.icon,placeholderResource:A.placeholderIcon?A.placeholderIcon:z.placeholderIcon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"obj-icon"})));let Q=null;T.ketchup.debug.isDebug()&&L?Q=A.obj.t+"; "+A.obj.p+"; "+V+";":null!=A.title&&""!=A.title.trim()&&(Q=A.title);let ee=null;if(A.info){const n=Object.assign({},A.info);n.color||(n.color=`var(${l.INFO})`),n.icon||(n.icon="info"),ee=e(C,Object.assign({},{color:n.color,resource:n.icon,placeholderResource:n.placeholderIcon,sizeX:"1.25em",sizeY:"1.25em",title:n.message?n.message:"",wrapperClass:"cell-info"}))}if(n.component.rootElement.tagName===u.INPUT_PANEL&&A.style){if(A.style.backgroundColor){const e=A.style.backgroundColor;A.style.backgroundColor="",A.style["--kup-textfield-background-color"]=e}if(A.style.color){const e=A.style.color;A.style.color="",A.style["--kup-textfield-color"]=e}}return e("div",{onKeyUp:e=>ae(e,n,U,h.KEYUP),class:P,"kup-get-cell-props":()=>n,ref:e=>A.element=e,style:A.style},e("div",{class:"f-cell__content",style:A.styleContent,title:Q,onMouseEnter:e=>H(e,n,U),onMouseLeave:e=>S(e)},i&&i.length>0?i:[n.indents,ee,J,Z]))},H=(e,n,o)=>{var t;if(n.cellActionIcon){const a=e.currentTarget,l=document.createElement("kup-image");l.resource="more_vert",l.sizeX="16px",l.sizeY="16px",l.tabIndex=0,l.className="f-cell__iconfunction "+(o===c.NUMBER?"left":"right"),(null===(t=n.cellActionIcon)||void 0===t?void 0:t.onClick)&&l.addEventListener("click",n.cellActionIcon.onClick),a.appendChild(l)}},S=e=>{const n=e.currentTarget.querySelector("kup-image.f-cell__iconfunction");n&&n.remove()},X=(e,n)=>{var o;if(!e)return null;const t=e.options,a=(null===(o=e.data)||void 0===o?void 0:o.hasOwnProperty("label"))?e.data.label:n.title,l=e.value,i=T.ketchup.data.cell.getType(e,e.shape),r=new Map([[c.BUTTON_LIST,W.bind(void 0)],[c.STRING,P.bind(void 0)],[c.RADIO,Z.bind(void 0)],[c.AUTOCOMPLETE,q.bind(void 0)],[c.COMBOBOX,q.bind(void 0)],[c.CHECKBOX,Y.bind(void 0)],[c.OBJECT,U.bind(void 0)],[c.CHIP,G.bind(void 0)],[c.FILE_UPLOAD,J.bind(void 0)]]).get(i);return r?r(t,a,l,e):null},G=(e,n,o,t)=>{var a;return(null===(a=t.data)||void 0===a?void 0:a.data)?Object.assign({},t.data):i(t.value,t.decode)},U=(e,n,o,t)=>Object.assign(Object.assign({},t.data),{data:{initialValue:o||"",label:n||"",value:o||""}}),Y=(e,n,o,t)=>Object.assign(Object.assign({},t.data),{checked:"on"===o||"1"===o,label:n}),W=(e,n,o,t)=>({data:[Object.assign(Object.assign({},t.data),{icon:t.icon,placeholderIcon:t.placeholderIcon,value:o})]}),P=(e,n,o,t)=>{var a;return Object.assign(Object.assign(Object.assign({},t.data),{label:n}),(null===(a=t.data)||void 0===a?void 0:a.maxLength)&&{textArea:t.data.maxLength>=256})},Z=(e,n,o,t)=>{var a,c,l;const i=r(o,e);return Object.assign(Object.assign(Object.assign({},t.data),i),{data:Array.from(new Map([...null!==(c=null===(a=t.data)||void 0===a?void 0:a.data)&&void 0!==c?c:[],...null!==(l=i.data)&&void 0!==l?l:[]].map((e=>[e.value,e]))).values())})},q=(e,n,o,t)=>{if(e){const a=s(o,n,[],t.data);return a.data["kup-list"].data=Q(e,o),t.data?Object.assign(Object.assign({},a),t.data):a}},J=(e,n,o,t)=>Object.assign(Object.assign({},t.data),{pathString:o}),Q=(e,n)=>{const o=te.get(e.type);return o?o(e,n):e.map((e=>({value:e.label,id:e.id,selected:n===e.id})))},ee=(e,n)=>e.children.map((e=>{var o;return{id:e.content.codice,value:e.content.testo,selected:n===e.content.codice,children:(null===(o=e.children)||void 0===o?void 0:o.length)?ee(e,n):[]}})),ne=(e,n)=>e.children.map((e=>{var o;return{id:e.value,value:e.value,selected:n===e.value,children:(null===(o=e.children)||void 0===o?void 0:o.length)?ne(e,n):[]}})),oe=(e,n)=>e.rows.map((e=>{var o;const t=e.fields||e.cells,[a,c]=Object.keys(t);return{id:t[a].value,value:(null===(o=t[c])||void 0===o?void 0:o.value)||t[a].value,selected:n===t[a].value}})),te=new Map([["SmeupTreeNode",ee.bind(void 0)],["SmeupDataTree",ne.bind(void 0)],["SmeupTable",oe.bind(void 0)],["SmeupDataTable",oe.bind(void 0)]]);function ae(e,n,o,t){var a,l,i,r,s,u,d,b;const k=n.cell,v=n.column,f=n.component,m=n.row;if(t===h.UPDATE){let n=function(e,n){var o;const t=!("INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName);let a=t?e.target.value:e.detail.value;return n===c.CHECKBOX&&t&&(a=e.target.checked?"off":"on"),n===c.DATE&&t&&(a=null===(o=e.detail)||void 0===o?void 0:o.value),n===c.NUMBER&&t&&(a=T.ketchup.math.formattedStringToNumberString(a,"")),a}(e,o);switch(g(k)?n=null==n?void 0:n.toUpperCase():j(k)&&(n=null==n?void 0:n.toLowerCase()),o){case c.AUTOCOMPLETE:k.decode=null===(l=null===(a=e.detail)||void 0===a?void 0:a.node)||void 0===l?void 0:l.value,k.data&&(k.data.initialValue=n,k.data.initialValueDecode=null===(r=null===(i=e.detail)||void 0===i?void 0:i.node)||void 0===r?void 0:r.value);break;case c.COMBOBOX:k.decode=null===(u=null===(s=e.detail)||void 0===s?void 0:s.node)||void 0===u?void 0:u.value;case c.DATE:case c.TIME:k.data&&(k.data.initialValue=n);break;case c.CHECKBOX:case c.SWITCH:n="on"===n.toLowerCase()?"0":"1",k.data&&(k.data.checked="0"!==n);break;case c.RADIO:if(k.data.data){const e=k.data.data.find((e=>e.checked));e&&(n=e.value)}break;case c.CHIP:case c.MULTI_AUTOCOMPLETE:case c.MULTI_COMBOBOX:n=e.detail.stringifiedValues,k.data&&(k.data.data=e.detail.comp.data);break;case c.IMAGE_LIST:n=e.detail.details.cell.value}k.value=null==n?void 0:n.toString(),k.displayedValue=null,k.displayedValue=p(v,k)}if(f&&f.rootElement){const n=new CustomEvent(t,{bubbles:!0,cancelable:!0,composed:!0,detail:{comp:f,id:f.rootElement.id,cell:k,column:v,event:e,row:m,type:o,inputValue:(null===(b=null===(d=k.element)||void 0===d?void 0:d.querySelector("input"))||void 0===b?void 0:b.value)||null}});if(f.rootElement.dispatchEvent(n),t===h.UPDATE)try{f.refresh()}catch(e){T.ketchup.debug.logMessage(f,e,O.ERROR)}}}function ce(e){var n;return f.includes(null===(n=e.component)||void 0===n?void 0:n.rootElement.tagName)}function le(e){var n;return k.includes(null===(n=e.component)||void 0===n?void 0:n.rootElement.tagName)}export{V as F,D as a,E as b,A as c,B as d,M as e}
1
+ import{h as e,F as n}from"./p-710d0a7d.js";import{ar as o,as as a,U as t,ae as c,f as l,ap as i,an as r,am as s,at as u,F as d,aj as p,a as b,au as k,I as v,av as f,aw as m,ax as h,ay as g,az as j,h as O}from"./p-ecf0eb17.js";import{F as x}from"./p-14c6efce.js";import{F as w}from"./p-31ae78d1.js";import{F as _,d as y}from"./p-7f7a9ebc.js";import{F as C}from"./p-cce08de3.js";import{F as $}from"./p-46a89edc.js";import{F}from"./p-c47a69dc.js";var I;!function(e){e.RADIO="radio",e.CHEVRON="chevron"}(I||(I={}));const D=o=>{var a;const t=o.horizontal||"lineDirection"==o.RadLay,c=!!o.columns,l=[],i=o.type||I.RADIO;for(let t=0;t<(null===(a=o.data)||void 0===a?void 0:a.length);t++){const a=o.data[t],c={radio:!0,"radio--checked":!!a.checked,"radio--disabled":!!o.disabled,[`radio--${o.type}`]:!!o.type};l.push(e("div",{class:`form-field \n ${o.leadingLabel?" form-field--align-end":""} ${o.disabled?"radio--disabled":""} ${i===I.CHEVRON?"form--chevron":""}`,onClick:o.onChange?o.onChange.bind(o.onChange,t):null},e("div",{class:c},i===I.RADIO?e("input",{class:"radio__native-control",type:"radio",name:"radio-element",value:a.value,checked:a.checked,disabled:o.disabled,onBlur:o.onBlur,onChange:e=>{o.onChange&&o.onChange(t,e),e.stopPropagation()},onFocus:o.onFocus}):e(n,null,e(C,a.checked?{resource:"check",sizeX:"14px",sizeY:"14px"}:{sizeX:"14px",sizeY:"14px",onClick:e=>{o.onChange&&o.onChange(t,e),e.stopPropagation()}})),i===I.RADIO&&e("div",{class:"radio__background"},e("div",{class:"radio__outer-circle"}),e("div",{class:"radio__inner-circle"}))),e("div",{class:"label-wrapper",onClick:e=>{o.onChange&&o.onChange(t,e),e.stopPropagation()}},i===I.CHEVRON&&e(C,{resource:a.icon,sizeX:"14px",sizeY:"14px"}),e("label",{htmlFor:"radio-element"},a.label?a.label:""),a.shortcutLabel&&e("div",{class:"shortcut"},a.shortcutLabel))))}return e("div",{class:`f-radio radio-wrapper\n ${c?"radio-wrapper-grid":""} ${o.danger?"kup-danger":""} ${o.info?"kup-info":""} ${o.secondary?"kup-secondary":""} ${o.success?"kup-success":""} ${o.warning?"kup-warning":""} ${o.wrapperClass?o.wrapperClass:""} ${t?"kup-horizontal":""}`,style:{"--kup_radio_columns":c?`repeat(${o.columns}, 1fr)`:""}},l)},E=n=>(n.maxValue||(n.maxValue=5),e("div",{class:`f-rating ${n.disabled?"disabled":""} ${n.danger?"kup-danger":""} ${n.info?"kup-info":""} ${n.secondary?"kup-secondary":""} ${n.success?"kup-success":""} ${n.warning?"kup-warning":""} ${n.wrapperClass?n.wrapperClass:""}`},function(n){const o=[];for(let a=1;a<=n.maxValue;a++)o.push(e("span",{class:"rating",onClick:n.onClick?n.onClick.bind(n.onClick,a):null},a<=n.value?"★":"☆"));return o}(n)));var A;!function(e){e.SMALL="small",e.MEDIUM="medium"}(A||(A={}));const B=n=>{n.sizing||(n.sizing=A.MEDIUM),n.sizing.toLowerCase();const o={switch:!0,"switch--checked":n.checked,"switch--disabled":n.disabled,[`switch--${n.sizing}`]:!!n.sizing};return e("div",Object.assign({class:`f-switch ${n.danger?"kup-danger":""} ${n.info?"kup-info":""} ${n.secondary?"kup-secondary":""} ${n.success?"kup-success":""} ${n.warning?"kup-warning":""} ${n.wrapperClass?n.wrapperClass:""}`},n.dataSet,{id:n.id,title:n.title}),e("div",{class:"form-field "+(n.leadingLabel?"form-field--align-end":"")},e("div",{class:o},e("div",{class:"switch__track"}),e("div",{class:"switch__thumb-underlay"},e("div",{class:"switch__thumb"},e("input",{type:"checkbox",class:"switch__native-control",role:"switch",checked:n.checked,disabled:n.disabled,value:n.checked?"on":"off",onBlur:n.onBlur,onChange:n.onChange,onFocus:n.onFocus})))),e("label",{onClick:n.onChange},n.label)))},z={"*BOLD":"font-weight: bold; !important;","*ERROR":"color: white !important; background: red !important;","*UNDERLINE":"text-decoration: underline !important;","*ITALIC":"font-style: italic !important;"};function N(e){let n;switch(e){case"0":n="color: #000000 !important;";break;case"1":n="color: #6C7A89 !important;";break;case"2":n="color: #3A539B !important;";break;case"3":n="color: var(--kup-danger-color-60) !important;";break;case"4":n="color: #C0C0C0 !important;";break;case"5":n="color: #FFFFFF !important;";break;case"6":n="color: var(--kup-success-color-60) !important;";break;case"7":n="color: #9B59B6 !important;";break;default:n=""}return n}function R(e){let n;switch(e){case"1":n="font-weight: bold !important;";break;case"2":n="font-style: italic !important;";break;case"3":n="text-decoration: underline !important;";break;default:n=""}return n}function L(e){let n;switch(e){case"0":n="background: transparent;";break;case"1":n="background: #D5ECF7;";break;case"2":n="background: #59ABE3;";break;case"3":n="background: #446CB3;";break;case"4":n="background: #9B59B6;";break;case"5":n="background: #F1A9A0;";break;case"6":n="background: #E74C3C;";break;case"7":n="background: #CF000F;";break;case"8":n="background: #C0392B;";break;case"9":n="background: #95A5A6;";break;case"A":n="background: #F5D76E;";break;case"B":case"C":n="background: #F7CA18;";break;case"D":n="background: #F39C12;";break;case"E":n="background: #90C695;";break;case"F":n="background: #26A65B;";break;case"G":n="background: #019875;";break;case"H":n="background: #36D7B7;";break;default:n=""}return n}function K(e){let n;switch(e){case"1":n='font-family: "Courier New", Courier, monospace !important;';break;case"2":n='font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif !important;';break;case"3":n="font-family: Arial, Helvetica, sans-serif !important;";break;default:n=""}return n}const M=({style:n,text:o,classes:a})=>{const t=function(e){const n=[];let o=null;return function(e,n){const o=/((_G\d{2}[A-Z0-9]\d{2}_|_G\*(BOLD|ERROR|ITALIC|UNDERLINE)_)|_n_)/g;let a,t=0;for(;null!==(a=o.exec(e));)a.index>t&&n.onContent(e.slice(t,a.index)),"_n_"===a[1]?n.onEndTag(a[1]):n.onStartTag(a[2]),t=o.lastIndex;t<e.length&&n.onContent(e.slice(t))}(e,{onStartTag(e){(null==o?void 0:o.tag)&&(o.closed=!0),n.push(o={tag:e,content:""})},onEndTag(e){o?o.tag?(o.closed=!0,o=null):this.onContent(e):n.push(o={content:e})},onContent(e){o?o.content+=e:n.push(o={content:e})}}),o&&o.tag&&(o.closed=!0),n}(o);return e("span",{class:a,style:n},t.find((e=>void 0!==e.tag))?function(n){return n.map((n=>{var o,a;const t=function(e){const n=function(e){let n="";if((null==e?void 0:e.match(/\d{2}[A-Z0-9]\d{2}|\*(BOLD|ERROR|ITALIC|UNDERLINE)/))&&(n=z[e],!n)){n="";for(let o=0;o<e.length;o++)switch(o){case 0:n+=N(e.charAt(o));break;case 1:n+=R(e.charAt(o));break;case 2:n+=L(e.charAt(o));break;case 3:n+=K(e.charAt(o))}}return n}(e);return n.split(";").filter((e=>e.trim())).reduce(((e,n)=>{const[o,a]=n.split(":").map((e=>e.trim()));if(o&&a){const n=a.replace(/!important/g,"").trim();e[o.replace(/-([a-z])/g,((e,n)=>n.toUpperCase()))]=n}return e}),{})}(null===(o=n.tag)||void 0===o?void 0:o.replace(/[_]/g,"").slice(1));return n.closed?e("span",{style:t},n.content):e("span",null,`${null!==(a=n.tag)&&void 0!==a?a:""}${n.content}`)}))}(t):o)},T=document.documentElement,V=(n,i)=>{var r,s,k,f,O,I;const A=n.cell,z=n.column,N=n.row,R=n.shape?n.shape:A.shape?A.shape:z.shape?z.shape:null,L=!T.ketchup.objects.isEmptyKupObj(A.obj);let K=!1;A.hasOwnProperty("isEditable")?K=A.isEditable:z.hasOwnProperty("isEditable")&&(K=z.isEditable),K=K&&n.editable,A.data=null!==(r=X(A,z))&&void 0!==r?r:A.data;let V=null!==(s=A.decode)&&void 0!==s?s:A.value;const G=n.previousValue!==V?V:"",U=T.ketchup.data.cell.getType(A,R),Y="extra_dense"===n.density?"extra-small":null===(k=A.data)||void 0===k?void 0:k.sizing;let W=A.cssClass?A.cssClass:(null==z?void 0:z.cssClass)?null==z?void 0:z.cssClass:"";const P={"f-cell":!0,[t.OBJ]:!!L,[U+"-cell"]:!0,[n.wrapperClass]:!!n.wrapperClass,[n.density]:!(!n.density||U===c.BAR),[W]:!!W,"c-input-uppercase":g(A),"c-input-lowercase":j(A),"monospace c-pre":null===(f=A.data)||void 0===f?void 0:f.legacyLook};let Z=G;A.data&&0!==Object.keys(A.data).length||function(e,n){function o(e){return e.toUpperCase().startsWith("SHAPE;BAR")}function a(e){return e.toUpperCase().startsWith("SHAPE;")}function t(e){return e.toUpperCase().startsWith("BCOLOR;")}function l(e){return e.toUpperCase().startsWith("HEIGHT;")}function i(e){return e.toUpperCase().startsWith("SEP;")||e.toUpperCase().startsWith("DIV;")||e.toUpperCase().startsWith("ARW;")||e.toUpperCase().startsWith("GRID;")}function r(e){const n={},c=e.split("\\\\"),r=[];for(const e of c){if(e){if(i(e))return null;if(a(e)){if(!o(e))return null;{const o=e.split(";");if(3===o.length){const e=o[2].replace(",",".");isNaN(parseFloat(e))||(n.width=`${e}%`)}}}else if(t(e));else if(l(e)){const o=e.substring(7).replace(",",".");isNaN(parseFloat(o))||(n.height=`${o}%`)}else r.push(s(e,n))}return r.length?r:null}function s(e,n){const o=Object.assign({},n),a=e.split(";");if(a.length>=1){const e=/R(\d+)G(\d+)B(\d+)/.exec(a[0]);if(e){const[,n,a,t]=e;isNaN(parseInt(n,10))||isNaN(parseInt(a,10))||isNaN(parseInt(t,10))||(o.color=`rgb(${parseInt(n)},${parseInt(a)},${parseInt(t)})`)}if(a.length>=2){const e=a[1].replace(",",".");isNaN(parseFloat(e))||(o.width=`${e}%`)}}return o}}n.data={};switch(e){case c.CHECKBOX:case c.SWITCH:n.data.checked="1"===n.value;break;case c.BAR:a(n.value)?(n.data.isCanvas=!0,n.data.resource=n.value):n.data.data=function(e){if(!e)return null;const n=e.split("\\\\AND\\"),o=[];for(const e of n){const n=r(e);if(!n)return null;o.push(...n)}return o}(n.value);break;case c.BUTTON:n.data.label=n.value;break;case c.CHART:Object.assign(n.data,{sizeX:"100px",sizeY:"100px",offlineMode:{value:n.value,shape:"pie"}});break;case c.BUTTON_LIST:case c.CHIP:case c.MULTI_AUTOCOMPLETE:case c.MULTI_COMBOBOX:case c.RADIO:(()=>{var e;const o=null===(e=n.value)||void 0===e?void 0:e.split(";");if(""===(null==o?void 0:o[o.length-1].trim())&&o.pop(),o&&o.length){n.data.data=[];for(let e of o)n.data.data.push({id:e,value:e})}})();break;case c.COLOR_PICKER:n.data.initialValue=n.value;break;case c.GAUGE:case c.KNOB:case c.PROGRESS_BAR:case c.RATING:n.data.value=parseInt(n.value);break;case c.ICON:case c.IMAGE:n.data.resource=n.value}}(U,A);const q=Object.assign(Object.assign(Object.assign(Object.assign({},A.data),(null==A?void 0:A.icon)?{resource:A.icon}:{}),(null==A?void 0:A.placeholderIcon)?{placeholderResource:A.placeholderIcon}:{}),Y?{sizing:Y}:{});K&&o.includes(U)?(A.data.showMarker=null!==(O=A.tooltip)&&void 0!==O&&O,Z=function(n,o,a,l,i){var r,s,u,k,f,m,g,j,O,x,y,C,I,E;switch(n){case c.AUTOCOMPLETE:return e("kup-autocomplete",Object.assign({key:l.name+i.row.id,initialValue:a.value,initialValueDecode:a.decode},a.data,{class:le(i)?"kup-full-width":"","onkup-autocomplete-change":e=>te(e,i,n,h.UPDATE),"onkup-autocomplete-input":e=>te(e,i,n,h.INPUT),"onkup-autocomplete-iconclick":e=>te(e,i,n,h.ICON_CLICK),"onKup-autocomplete-blur":e=>te(e,i,n,h.BLUR),"onKup-autocomplete-itemclick":e=>te(e,i,n,h.ITEMCLICK)}));case c.CHECKBOX:return ce(i)&&(o[t.C_CENTERED]=!0),a.shape===d.INPUT_CHECKBOX?e("input",{checked:"on"===a.value.toLowerCase()||"1"===a.value,class:"input-checkbox",onChange:e=>te(e,i,n,h.UPDATE),type:"checkbox",onBlur:e=>te(e,i,n,h.BLUR)}):e(w,Object.assign({},a.data,{onChange:e=>te(e,i,n,h.UPDATE),onBlur:e=>te(e,i,n,h.BLUR)}));case c.CHIP:return e("kup-chip",Object.assign({},a.data,{type:_.INPUT,enableInput:!0,"onKup-chip-change":e=>te(e,i,n,h.UPDATE)}),e("kup-text-field",Object.assign({fullWidth:!0,slot:"field"},a.slotData,{error:a.data.error,"onKup-textfield-blur":e=>te(e,i,n,h.BLUR)})));case c.COLOR_PICKER:return e("kup-color-picker",Object.assign({},a.data,{key:l.name+i.row.id,initialValue:a.value.toUpperCase(),class:le(i)?"kup-full-width":"",disabled:!1,"onkup-colorpicker-change":e=>te(e,i,n,h.UPDATE)}));case c.COMBOBOX:return e("kup-combobox",Object.assign({key:l.name+i.row.id,initialValue:a.value,initialValueDecode:a.decode,ListDescrMode:a.data.ListDescrMode},a.data,{class:le(i)?"kup-full-width":"","onkup-combobox-change":e=>te(e,i,n,h.UPDATE),"onkup-combobox-input":e=>te(e,i,n,h.INPUT),"onkup-combobox-iconclick":e=>te(e,i,n,h.ICON_CLICK),"onKup-combobox-blur":e=>te(e,i,n,h.BLUR),"onKup-combobox-itemclick":e=>te(e,i,n,h.ITEMCLICK)}));case c.DATE:return e("kup-date-picker",Object.assign({key:l.name+i.row.id,initialValue:a.value},a.data,{class:le(i)?"kup-full-width":"","onkup-datepicker-change":e=>te(e,i,n,h.UPDATE),"onkup-datepicker-input":e=>te(e,i,n,h.INPUT),"onKup-datepicker-blur":e=>te(e,i,n,h.BLUR),"onkup-datepicker-textfieldsubmit":e=>te(e,i,n,h.UPDATE)}));case c.EDITOR:const A=e=>{"Enter"!==e.key||e.ctrlKey?("Enter"===e.key&&e.ctrlKey||/^F[1-9]|F1[0-2]$/.test(e.key))&&te(e,i,n,h.UPDATE):e.stopPropagation()};return e(F,Object.assign({},a.data,{textArea:!0,sizing:b.EXTRA_LARGE,label:l.title,fullWidth:!!le(i),maxLength:a.data.maxLength,value:a.value,onChange:e=>{te(e,i,n,h.UPDATE)},onInput:e=>{var o,t;null===(t=null===(o=a.data)||void 0===o?void 0:o.onInput)||void 0===t||t.call(o,e),te(e,i,n,h.INPUT)},onBlur:e=>te(e,i,n,h.BLUR),onKeyDown:A}));case c.FILE_UPLOAD:return e("kup-file-upload",Object.assign({"onKup-file-upload-change":e=>te(e,i,n,h.UPDATE)},a.data));case c.MULTI_AUTOCOMPLETE:return e("kup-chip",Object.assign({DescrMode:null!==(r=a.data.DescrMode)&&void 0!==r?r:v.DESCRIPTION},a.data,{label:null!==(u=null===(s=a.slotData)||void 0===s?void 0:s.label)&&void 0!==u?u:"",type:_.INPUT,enableInput:!0,"onKup-chip-change":e=>te(e,i,n,h.UPDATE)}),e("kup-autocomplete",{class:"kup-full-width",slot:"field",DescrMode:v.CODE_AND_DESC,sizing:b.EXTRA_SMALL,"onKup-autocomplete-blur":e=>te(e,i,n,h.BLUR),"onkup-autocomplete-input":e=>te(e,i,n,h.INPUT),"onkup-autocomplete-iconclick":e=>te(e,i,n,h.ICON_CLICK),data:null===(k=a.slotData)||void 0===k?void 0:k.data,initialValue:null===(f=a.slotData)||void 0===f?void 0:f.initialValue,showDropDownIcon:null===(m=a.slotData)||void 0===m?void 0:m.showDropDownIcon,style:null===(g=a.slotData)||void 0===g?void 0:g.style,disabled:null===(j=a.slotData)||void 0===j?void 0:j.disabled,id:null===(O=a.slotData)||void 0===O?void 0:O.id,error:a.data.error,showMarker:null!==(x=a.tooltip)&&void 0!==x&&x,ListDescrMode:a.data.ListDescrMode}));case c.MULTI_COMBOBOX:return e("kup-chip",Object.assign({DescrMode:null!==(y=a.data.DescrMode)&&void 0!==y?y:v.DESCRIPTION},a.data,{type:_.INPUT,enableInput:!0,"onKup-chip-change":e=>te(e,i,n,h.UPDATE)}),e("kup-combobox",Object.assign({class:"kup-full-width",slot:"field",DescrMode:v.CODE_AND_DESC,sizing:b.EXTRA_SMALL,"onKup-combobox-blur":e=>te(e,i,n,h.BLUR),"onkup-combobox-input":e=>te(e,i,n,h.INPUT),"onkup-combobox-iconclick":e=>te(e,i,n,h.ICON_CLICK)},a.slotData,{error:a.data.error,showMarker:null!==(C=a.tooltip)&&void 0!==C&&C,ListDescrMode:a.data.ListDescrMode})));case c.RADIO:return e(D,Object.assign({},a.data,{disabled:!1,onChange:(e,o)=>{const t=a.data.data;for(let n=0;n<t.length;n++){t[n].checked=n===e}te(o,i,n,h.UPDATE)},onBlur:e=>te(e,i,n,h.BLUR)}));case c.RATING:return e("kup-rating",Object.assign({key:l.name+i.row.id},a.data,{disabled:!1,"onkup-rating-click":e=>te(e,i,n,h.UPDATE)}));case c.SWITCH:return e(B,Object.assign({},a.data,{disabled:!1,onChange:e=>te(e,i,n,h.UPDATE),onBlur:e=>te(e,i,n,h.BLUR)}));case c.TIME:return e("kup-time-picker",Object.assign({key:l.name+i.row.id,initialValue:a.value},a.data,{class:le(i)?"kup-full-width":"","onkup-timepicker-change":e=>te(e,i,n,h.UPDATE),"onkup-timepicker-input":e=>te(e,i,n,h.INPUT),"onKup-timepicker-blur":e=>te(e,i,n,h.BLUR)}));case c.OBJECT:return e($,{cell:a,column:i.column,row:i.row,inputValue:a.value,onChange:e=>te(e,i,n,h.UPDATE)});case c.NUMBER:o[t.C_RIGHT_ALIGNED]=!0;case c.LINK:case c.MEMO:case c.STRING:const z=e=>te(e,i,n,h.UPDATE),N=e=>{var o,t;null===(t=null===(o=a.data)||void 0===o?void 0:o.onInput)||void 0===t||t.call(o,e),te(e,i,n,h.INPUT)},R=e=>{var o,t,l;null===(t=null===(o=a.data)||void 0===o?void 0:o.onKeyDown)||void 0===t||t.call(o,e);const r="MEMO"===a.shape||(null===(l=a.data)||void 0===l?void 0:l.maxLength)>=256||n===c.MEMO,s="Enter"===e.key&&e.ctrlKey;r&&"Enter"===e.key&&!e.ctrlKey?e.stopPropagation():(s||/^F[1-9]|F1[0-2]$/.test(e.key))&&te(e,i,n,h.UPDATE)},L=n===c.NUMBER?"number":null;if(a.shape===d.INPUT_FIELD){const o=n===c.NUMBER&&a.value?p(l,a):a.value;return e("input",{class:"input-field",onChange:z,onInput:N,onKeyDown:R,type:L,value:o,maxLength:null!==(E=null===(I=l.cellData)||void 0===I?void 0:I.maxLength)&&void 0!==E?E:-1})}{const o=!!a.shape&&a.shape===d.MEMO||!!n&&n===c.MEMO||a.data.maxLength>=256;return e(F,Object.assign({},a.data,{textArea:o,sizing:a.data.sizing?a.data.sizing:o?b.EXTRA_LARGE:b.SMALL,inputType:L,fullWidth:!!le(i),maxLength:n==c.NUMBER&&(i.column.decimals&&i.column.decimals>0||i.column.group)||i.column.integers&&i.column.integers>0?-1:a.data.maxLength,icon:a.data&&a.data.icon?a.data.icon:a.icon?a.icon:l.icon?l.icon:null,decimals:i.column.decimals,integers:i.column.integers,group:i.column.group,value:a.value,label:l.title,onChange:z,onInput:N,onKeyDown:R,onIconClick:e=>te(e,i,n,h.ICON_CLICK),onBlur:e=>te(e,i,n,h.BLUR)}))}}}(U,P,A,z,n)):A.data&&a.includes(U)?(n.setSizes&&function(e,n,o,a){switch(e){case c.BAR:n.sizeY||(n.sizeY="26px"),!n.sizeX&&a.size&&(n.sizeX=a.size);break;case c.BUTTON:let e="";n.label&&(e="36px"),o.style?o.style.height||(o.style.minHeight=e):o.style={minHeight:e};break;case c.CHART:n.sizeX||(n.sizeX="100%"),n.sizeY||(n.sizeY="100%");break;case c.CHIP:o.style?o.style.height||(o.style.minHeight="18px"):o.style={minHeight:"18px"};break;case c.RADIO:o.style?o.style.height||(o.style.minHeight="40px"):o.style={minHeight:"40px"}}}(U,q,A,z),Z=n.renderKup?function(n,o,a,l,i,r,s){switch(n){case c.BAR:return a.data?e("div",{style:{height:a.sizeY,width:"100%"}},e(C,Object.assign({},a))):e("kup-image",Object.assign({key:r.name+s.row.id,sizeX:"250px"},a));case c.BUTTON:ce(s)&&(o[t.C_CENTERED]=!0);let u=l.decode;u||l.icon||l.placeholderIcon||(u=l.value);const d=Object.assign({label:u,icon:l.icon,placeholderIcon:l.placeholderIcon,title:r.title},a);return e(x,Object.assign({},d,{onClick:e=>te(e,s,n,h.CLICK)}));case c.BUTTON_LIST:return ce(s)&&(o[t.C_CENTERED]=!0),a["data-storage"]={cell:l,row:i,column:r},e("kup-button-list",Object.assign({key:r.name+s.row.id},a,{"onKup-buttonlist-click":e=>te(e,s,n,h.CLICK)}));case c.CHART:return ce(s)&&(o[t.C_CENTERED]=!0),e("kup-chart",Object.assign({key:r.name+s.row.id},a));case c.MULTI_AUTOCOMPLETE:case c.MULTI_COMBOBOX:case c.CHIP:return e(y,Object.assign({},a));case c.COLOR_PICKER:return e("kup-color-picker",Object.assign({key:r.name+s.row.id},a,{class:le(s)?"kup-full-width":"",disabled:!0}));case c.GAUGE:return e("kup-gauge",Object.assign({key:r.name+s.row.id,value:T.ketchup.math.numberifySafe(l.value),"width-component":"280px"},a));case c.KNOB:case c.PROGRESS_BAR:return e("kup-progress-bar",Object.assign({key:r.name+s.row.id},a,{value:T.ketchup.math.numberifySafe(l.value)}));case c.RADIO:return ce(s)&&(o[t.C_CENTERED]=!0),a.disabled=i.readOnly,e(D,Object.assign({},a));case c.RATING:return e(E,Object.assign({},a,{disabled:!0}));case c.OBJECT:return e(F,Object.assign({icon:"table"},a,{disabled:!0}))}}(U,P,q,A,N,z,n):e("span",{class:"cell-"+U+" placeholder"})):(n.setSizes&&function(e,n,o,a){var t;switch(e){case c.CHECKBOX:case c.ICON:n.sizeX||(n.sizeX="18px"),n.sizeY||(n.sizeY="18px"),o.style?o.style.height||(o.style.minHeight=n.sizeY):o.style={minHeight:n.sizeY};break;case c.IMAGE:const e=(null===(t=a.cell)||void 0===t?void 0:t.value)||"",l=e.indexOf(".")>-1||e.indexOf("/")>-1||e.indexOf("\\")>-1;a.component.rootElement.tagName!==u.DATA_TABLE||l||(n.sizeX||n.sizeY?(n.sizeX||(n.sizeX="100%",n.wrapperClass="noWidth"),n.sizeY||(n.sizeY="auto")):(n.sizeX="100%",n.sizeY="64px",n.wrapperClass="noWidth")),a.component.rootElement.tagName===u.BOX?(n.sizeY||(n.sizeY="auto"),void 0===n.fit&&(n.fit=!0)):n.sizeX||(n.sizeX="auto"),n.sizeY||(n.sizeY="64px")}}(U,q,A,n),P[t.INDICATOR_TOPRIGHT]=null!==(I=A.tooltip)&&void 0!==I&&I,Z=function(n,o,a,l,i,r,s){switch(n){case c.AUTOCOMPLETE:case c.COMBOBOX:return a&&""!=a?e("div",{class:"f-cell__text"},m(i,a," - ")):a;case c.DATE:case c.DATETIME:case c.TIME:return a&&""!=a?e("div",{class:"f-cell__text"},p(r,i)):a;case c.CHECKBOX:return ce(s)&&(l[t.C_CENTERED]=!0),e(C,{resource:o.checked?"check_box":"check_box_outline_blank",sizeX:"18px",sizeY:"18px"});case c.EDITOR:case c.MEMO:return e("div",{innerHTML:p(r,i)});case c.ICON:case c.IMAGE:return ce(s)&&(l[t.C_CENTERED]=!0),o.badgeData&&(l[t.C_PADDED]=!0),e(C,Object.assign({},o));case c.LINK:return e("a",{href:a,target:"_blank"},p(r,i));case c.NUMBER:if(a&&""!=a){const n=T.ketchup.math.numberifySafe(i.value),o=p(r,i);return!Boolean(i.style&&i.style.color)&&n<0&&(l[t.TEXT_DANGER]=!0),ce(s)&&(l[t.C_RIGHT_ALIGNED]=!0),e("div",{class:"f-cell__text"},o)}return e("div",{class:"f-cell__text"},a);case c.SWITCH:return ce(s)&&(l[t.C_CENTERED]=!0),o.disabled=!0,e(B,Object.assign({},o));case c.LABEL:return e(M,{style:i.style,text:p(r,i),classes:"f-cell__text"});case c.IMAGE_LIST:const u=i.data.data.find((e=>e.value===i.value))||null;return e("kup-image-list",Object.assign({ripple:!0},i.data,{"onKup-imagelist-click":e=>te(e,s,n,h.UPDATE),activeNode:u}));default:return e("div",{class:"f-cell__text"},i.data.DescrMode?m(i,a,"-"):a)}}(U,q,Z,P,A,z,n));let J=null;!K&&(z.icon||A.icon)&&Z&&U!=c.BUTTON&&U!=c.BUTTON_LIST&&U!=c.IMAGE&&U!=c.ICON&&(J=e(C,Object.assign({},{color:`rgba(var(${l.TEXT}-rgb), 0.375)`,resource:A.icon?A.icon:z.icon,placeholderResource:A.placeholderIcon?A.placeholderIcon:z.placeholderIcon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"obj-icon"})));let Q=null;T.ketchup.debug.isDebug()&&L?Q=A.obj.t+"; "+A.obj.p+"; "+V+";":null!=A.title&&""!=A.title.trim()&&(Q=A.title);let ee=null;if(A.info){const n=Object.assign({},A.info);n.color||(n.color=`var(${l.INFO})`),n.icon||(n.icon="info"),ee=e(C,Object.assign({},{color:n.color,resource:n.icon,placeholderResource:n.placeholderIcon,sizeX:"1.25em",sizeY:"1.25em",title:n.message?n.message:"",wrapperClass:"cell-info"}))}if(n.component.rootElement.tagName===u.INPUT_PANEL&&A.style){if(A.style.backgroundColor){const e=A.style.backgroundColor;A.style.backgroundColor="",A.style["--kup-textfield-background-color"]=e}if(A.style.color){const e=A.style.color;A.style.color="",A.style["--kup-textfield-color"]=e}}return e("div",{onKeyUp:e=>te(e,n,U,h.KEYUP),class:P,"kup-get-cell-props":()=>n,ref:e=>A.element=e,style:A.style},e("div",{class:"f-cell__content",style:A.styleContent,title:Q,onMouseEnter:e=>H(e,n,U),onMouseLeave:e=>S(e)},i&&i.length>0?i:[n.indents,ee,J,Z]))},H=(e,n,o)=>{var a;if(n.cellActionIcon){const t=e.currentTarget,l=document.createElement("kup-image");l.resource="more_vert",l.sizeX="16px",l.sizeY="16px",l.tabIndex=0,l.className="f-cell__iconfunction "+(o===c.NUMBER?"left":"right"),(null===(a=n.cellActionIcon)||void 0===a?void 0:a.onClick)&&l.addEventListener("click",n.cellActionIcon.onClick),t.appendChild(l)}},S=e=>{const n=e.currentTarget.querySelector("kup-image.f-cell__iconfunction");n&&n.remove()},X=(e,n)=>{var o;if(!e)return null;const a=e.options,t=(null===(o=e.data)||void 0===o?void 0:o.hasOwnProperty("label"))?e.data.label:n.title,l=e.value,i=T.ketchup.data.cell.getType(e,e.shape),r=new Map([[c.BUTTON_LIST,W.bind(void 0)],[c.STRING,P.bind(void 0)],[c.RADIO,Z.bind(void 0)],[c.AUTOCOMPLETE,q.bind(void 0)],[c.COMBOBOX,q.bind(void 0)],[c.CHECKBOX,Y.bind(void 0)],[c.OBJECT,U.bind(void 0)],[c.CHIP,G.bind(void 0)],[c.FILE_UPLOAD,J.bind(void 0)]]).get(i);return r?r(a,t,l,e):null},G=(e,n,o,a)=>{var t;return(null===(t=a.data)||void 0===t?void 0:t.data)?Object.assign({},a.data):i(a.value,a.decode)},U=(e,n,o,a)=>Object.assign(Object.assign({},a.data),{data:{initialValue:o||"",label:n||"",value:o||""}}),Y=(e,n,o,a)=>Object.assign(Object.assign({},a.data),{checked:"on"===o||"1"===o,label:n}),W=(e,n,o,a)=>({data:[Object.assign(Object.assign({},a.data),{icon:a.icon,placeholderIcon:a.placeholderIcon,value:o})]}),P=(e,n,o,a)=>{var t;return Object.assign(Object.assign(Object.assign({},a.data),{label:n}),(null===(t=a.data)||void 0===t?void 0:t.maxLength)&&{textArea:a.data.maxLength>=256})},Z=(e,n,o,a)=>{var t,c,l;const i=r(o,e);return Object.assign(Object.assign(Object.assign({},a.data),i),{data:Array.from(new Map([...null!==(c=null===(t=a.data)||void 0===t?void 0:t.data)&&void 0!==c?c:[],...null!==(l=i.data)&&void 0!==l?l:[]].map((e=>[e.value,e]))).values())})},q=(e,n,o,a)=>{if(e){const t=s(o,n,[],a.data);return t.data["kup-list"].data=Q(e,o),a.data?Object.assign(Object.assign({},t),a.data):t}},J=(e,n,o,a)=>Object.assign(Object.assign({},a.data),{pathString:o}),Q=(e,n)=>{const o=ae.get(e.type);return o?o(e,n):e.map((e=>({value:e.label,id:e.id,selected:n===e.id})))},ee=(e,n)=>e.children.map((e=>{var o;return{id:e.content.codice,value:e.content.testo,selected:n===e.content.codice,children:(null===(o=e.children)||void 0===o?void 0:o.length)?ee(e,n):[]}})),ne=(e,n)=>e.children.map((e=>{var o;return{id:e.value,value:e.value,selected:n===e.value,children:(null===(o=e.children)||void 0===o?void 0:o.length)?ne(e,n):[]}})),oe=(e,n)=>e.rows.map((e=>{var o;const a=e.fields||e.cells,[t,c]=Object.keys(a);return{id:a[t].value,value:(null===(o=a[c])||void 0===o?void 0:o.value)||a[t].value,selected:n===a[t].value}})),ae=new Map([["SmeupTreeNode",ee.bind(void 0)],["SmeupDataTree",ne.bind(void 0)],["SmeupTable",oe.bind(void 0)],["SmeupDataTable",oe.bind(void 0)]]);function te(e,n,o,a){var t,l,i,r,s,u,d,b;const k=n.cell,v=n.column,f=n.component,m=n.row;if(a===h.UPDATE){let n=function(e,n){var o;const a=!("INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName);let t=a?e.target.value:e.detail.value;return n===c.CHECKBOX&&a&&(t=e.target.checked?"off":"on"),n===c.DATE&&a&&(t=null===(o=e.detail)||void 0===o?void 0:o.value),n===c.NUMBER&&a&&(t=T.ketchup.math.formattedStringToNumberString(t,"")),t}(e,o);switch(g(k)?n=null==n?void 0:n.toUpperCase():j(k)&&(n=null==n?void 0:n.toLowerCase()),o){case c.AUTOCOMPLETE:k.decode=null===(l=null===(t=e.detail)||void 0===t?void 0:t.node)||void 0===l?void 0:l.value,k.data&&(k.data.initialValue=n,k.data.initialValueDecode=null===(r=null===(i=e.detail)||void 0===i?void 0:i.node)||void 0===r?void 0:r.value);break;case c.COMBOBOX:k.decode=null===(u=null===(s=e.detail)||void 0===s?void 0:s.node)||void 0===u?void 0:u.value;case c.DATE:case c.TIME:k.data&&(k.data.initialValue=n);break;case c.CHECKBOX:case c.SWITCH:n="on"===n.toLowerCase()?"0":"1",k.data&&(k.data.checked="0"!==n);break;case c.RADIO:if(k.data.data){const e=k.data.data.find((e=>e.checked));e&&(n=e.value)}break;case c.CHIP:case c.MULTI_AUTOCOMPLETE:case c.MULTI_COMBOBOX:n=e.detail.stringifiedValues,k.data&&(k.data.data=e.detail.comp.data);break;case c.IMAGE_LIST:n=e.detail.details.cell.value}k.value=null==n?void 0:n.toString(),k.displayedValue=null,k.displayedValue=p(v,k)}if(f&&f.rootElement){const n=new CustomEvent(a,{bubbles:!0,cancelable:!0,composed:!0,detail:{comp:f,id:f.rootElement.id,cell:k,column:v,event:e,row:m,type:o,inputValue:(null===(b=null===(d=k.element)||void 0===d?void 0:d.querySelector("input"))||void 0===b?void 0:b.value)||null}});if(f.rootElement.dispatchEvent(n),a===h.UPDATE)try{f.refresh()}catch(e){T.ketchup.debug.logMessage(f,e,O.ERROR)}}}function ce(e){var n;return f.includes(null===(n=e.component)||void 0===n?void 0:n.rootElement.tagName)}function le(e){var n;return k.includes(null===(n=e.component)||void 0===n?void 0:n.rootElement.tagName)}export{V as F,D as a,E as b,A as c,B as d,M as e}
@@ -1 +1 @@
1
- import{r as t,c as i,f as e,h as s,H as h,d as n}from"./p-710d0a7d.js";import{k as o,g as a,e as l,v as p}from"./p-c98fb668.js";import{c as r}from"./p-635bb4b3.js";import{F as u}from"./p-e298b76c.js";import{F as c}from"./p-7db300e0.js";import"./p-adadf8b5.js";import"./p-cce08de3.js";import"./p-c56195a0.js";var f;!function(t){t.customStyle="Custom style of the component.",t.data="Props of the sub-components.",t.decimals="Defaults at false. When set to true, the component has decimals.",t.disabled="Defaults at false. When set to true, the component is disabled.",t.initialValue="Sets the initial value of the component",t.maxDecimals="when set, the component allows you to enter decimals with a maximum of characters.",t.maxIntegers="When set, the component allows you to enter integer numbers with a maximum of characters.",t.maxLength="When set, the component allows you to enter numbers with a maximum of characters, including decimals.",t.negative="Defaults at false. When set to true, the component has negative number."}(f||(f={}));const m=class{constructor(e){t(this,e),this.kupBlur=i(this,"kup-numericpicker-blur",6),this.kupChange=i(this,"kup-numericpicker-change",6),this.kupClick=i(this,"kup-numericpicker-click",6),this.kupFocus=i(this,"kup-numericpicker-focus",6),this.kupInput=i(this,"kup-numericpicker-input",6),this.kupIconClick=i(this,"kup-numericpicker-iconclick",6),this.kupItemClick=i(this,"kup-numericpicker-itemclick",6),this.kupTextFieldSubmit=i(this,"kup-numericpicker-textfieldsubmit",6),this.kupClearIconClick=i(this,"kup-numericpicker-cleariconclick",6),this.kupManager=o(),this.textfieldEl=null,this.pickerContainerEl=null,this.pickerEl={value:(new Date).toISOString(),date:new Date},this.clickCb=null,this.stateSwitcher=!1,this.value="",this.customStyle="",this.data=null,this.decimals=!1,this.disabled=!1,this.initialValue="",this.maxDecimals=null,this.maxIntegers=null,this.maxLength=null,this.negative=!1}onKupPickerItemClick(t){this.setPickerValueSelected(t),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupItemClick.emit({comp:this,id:this.rootElement.id,value:this.value}),this.setFocus()}onKupClearIconClick(){this.setPickerValueSelected(""),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupClearIconClick.emit({comp:this,id:this.rootElement.id})}onKupBlur(){this.kupBlur.emit({id:this.rootElement.id,value:this.value,comp:this})}onKupChange(t){this.refreshPickerValue(t.target.value,this.kupChange)}onKupClick(){this.kupClick.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupFocus(){this.kupFocus.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupInput(t){this.refreshPickerValue(t.target.value,this.kupInput,!0)}onkupTextFieldSubmit(t){"Enter"===t.key&&this.refreshPickerValue(t.target.value,this.kupTextFieldSubmit)}onKupIconClick(){this.isPickerOpened()?this.closePicker():this.openPicker(),this.kupIconClick.emit({comp:this,id:this.rootElement.id,value:this.value})}listenKeyup(t){this.isPickerOpened()&&("Escape"===t.key&&this.closePicker(),"Enter"===t.key&&this.setPickerValueSelected())}async getValue(){return this.value}async getProps(t){return a(this,f,t)}async refresh(){e(this)}async setFocus(){null!=this.textfieldEl&&this.textfieldEl.focus()}async setValue(t){this.value=t}refreshPickerValue(t,i,e){let s=this.kupManager.math.numberify(t,!0);if(s){let t=s.toString();const h=t.indexOf(".");let n=h>-1?t.substring(0,h):t,o=h>-1?t.substring(h+1):"";for(this.maxIntegers&&n.length>this.maxIntegers&&(n=n.substring(n.length-this.maxIntegers)),this.maxDecimals&&o.length>this.maxDecimals&&(o=o.substring(0,this.maxDecimals));this.maxLength&&n.length+o.length>this.maxLength;)o.length>1?o=o.substring(0,o.length-1):n.length>1&&(n=n.substring(1));t=h>-1?`${n}.${o}`:n,1!=e&&this.setValue(t),null!=i&&i.emit({id:this.rootElement.id,value:t})}}setPickerValueSelected(t){1!=this.disabled&&(null==t&&(t=this.getPickerValueSelected()),this.closePicker(),null!=t&&this.setValue(t))}getPickerValueSelected(){return this.pickerEl.value}getValueForPickerComponent(){return this.value}openPicker(){const t=this.textfieldEl;this.pickerContainerEl.menuVisible=!0;const i=this.pickerContainerEl.style;i.height="auto",i.minWidth=this.textfieldEl.parentElement.clientWidth+"px",null!=t&&t.classList.add("toggled"),this.kupManager.dynamicPosition.isRegistered(this.pickerContainerEl)?this.kupManager.dynamicPosition.changeAnchor(this.pickerContainerEl,this.textfieldEl.parentElement):this.kupManager.dynamicPosition.register(this.pickerContainerEl,this.textfieldEl.parentElement,0,l.AUTO,!0),this.kupManager.dynamicPosition.start(this.pickerContainerEl),this.clickCb||(this.clickCb={cb:()=>{this.closePicker()},el:this.pickerContainerEl}),this.kupManager.addClickCallback(this.clickCb,!0)}closePicker(){if(this.kupManager.removeClickCallback(this.clickCb),!this.isPickerOpened())return;let t=this.textfieldEl;null!=t&&t.classList.remove("toggled"),this.pickerContainerEl.menuVisible=!1,this.kupManager.dynamicPosition.stop(this.pickerContainerEl)}isPickerOpened(){return 1==this.pickerContainerEl.menuVisible}getTextFieldId(){return this.textfieldEl.id}prepTextfield(){this.decimals||this.maxIntegers||(this.maxIntegers=17),!this.decimals||this.maxIntegers||this.maxDecimals||(this.maxIntegers=15,this.maxDecimals=2);const t=this.rootElement.classList.contains("kup-full-height"),i=this.rootElement.classList.contains("kup-full-width"),e=Object.assign({},this.data["kup-text-field"]);return e.icon||(e.icon="calculator"),e.icon&&(e.trailingIcon=!0),s(u,Object.assign({},e,{disabled:this.disabled,fullHeight:t,fullWidth:i,id:this.rootElement.id+"_text-field",value:this.kupManager.math.numbers.toLocaleString(this.value),onBlur:()=>this.onKupBlur(),onChange:t=>this.onKupChange(t),onClearIconClick:()=>this.onKupClearIconClick(),onClick:()=>this.onKupClick(),onFocus:()=>this.onKupFocus(),onIconClick:()=>this.onKupIconClick(),onKeyDown:t=>this.onkupTextFieldSubmit(t),onInput:t=>this.onKupInput(t)}),this.prepPicker())}prepPicker(){return s("kup-card",{ref:t=>this.pickerContainerEl=t,data:{options:{decimals:this.decimals,initialValue:this.value,maxDecimals:this.maxDecimals,maxIntegers:this.maxIntegers,maxLength:this.maxLength,negative:this.negative,resetStatus:!0}},layoutFamily:p.BUILT_IN,layoutNumber:5,sizeX:"300px",sizeY:"auto",isMenu:!0,"onkup-card-click":t=>{null!=t.detail.value&&this.onKupPickerItemClick(t.detail.value)}})}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this),this.value=this.initialValue,this.data||(this.data={"kup-text-field":{}})}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const i=t.querySelector(".f-text-field");i&&(this.textfieldEl=i.querySelector("input"),c(i))}this.kupManager.debug.logRender(this,!0)}render(){return s(h,{key:"22a6ef8139d04934008071cfa9f9d395144cf82c"},s("style",{key:"3631b7dedacb5a4732a78a36ab6a4ddd772ae632"},this.kupManager.theme.setKupStyle(this.rootElement)),s("div",{key:"9496502390810c10eb60f5fad738d99ee2cbaef5",id:r},this.prepTextfield()))}disconnectedCallback(){this.kupManager.dates.unregister(this),this.kupManager.theme.unregister(this),this.pickerContainerEl&&this.pickerContainerEl.remove()}get rootElement(){return n(this)}};m.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{display:block;font-size:var(--kup-font-size)}.f-text-field{position:relative}:host(.kup-full-height){height:100%}:host(.kup-full-height) #kup-component{height:100%}:host(.kup-full-width){width:100%}:host(.kup-full-width) #kup-component{width:100%}:host(.kup-danger){--kup-textfield-primary-color:var(--kup-danger-color-60);--kup-textfield-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-textfield-primary-color:var(--kup-info-color);--kup-textfield-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-textfield-primary-color:var(--kup-secondary-color);--kup-textfield-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-textfield-primary-color:var(--kup-success-color);--kup-textfield-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-textfield-primary-color:var(--kup-warning-color-50);--kup-textfield-primary-color-rgb:var(--kup-warning-color-rgb)}";export{m as kup_numeric_picker}
1
+ import{r as t,c as i,f as e,h as s,H as h,d as n}from"./p-710d0a7d.js";import{k as o,g as a,e as l,v as p}from"./p-ecf0eb17.js";import{c as r}from"./p-635bb4b3.js";import{F as u}from"./p-c47a69dc.js";import{F as c}from"./p-7db300e0.js";import"./p-adadf8b5.js";import"./p-cce08de3.js";import"./p-c56195a0.js";var f;!function(t){t.customStyle="Custom style of the component.",t.data="Props of the sub-components.",t.decimals="Defaults at false. When set to true, the component has decimals.",t.disabled="Defaults at false. When set to true, the component is disabled.",t.initialValue="Sets the initial value of the component",t.maxDecimals="when set, the component allows you to enter decimals with a maximum of characters.",t.maxIntegers="When set, the component allows you to enter integer numbers with a maximum of characters.",t.maxLength="When set, the component allows you to enter numbers with a maximum of characters, including decimals.",t.negative="Defaults at false. When set to true, the component has negative number."}(f||(f={}));const m=class{constructor(e){t(this,e),this.kupBlur=i(this,"kup-numericpicker-blur",6),this.kupChange=i(this,"kup-numericpicker-change",6),this.kupClick=i(this,"kup-numericpicker-click",6),this.kupFocus=i(this,"kup-numericpicker-focus",6),this.kupInput=i(this,"kup-numericpicker-input",6),this.kupIconClick=i(this,"kup-numericpicker-iconclick",6),this.kupItemClick=i(this,"kup-numericpicker-itemclick",6),this.kupTextFieldSubmit=i(this,"kup-numericpicker-textfieldsubmit",6),this.kupClearIconClick=i(this,"kup-numericpicker-cleariconclick",6),this.kupManager=o(),this.textfieldEl=null,this.pickerContainerEl=null,this.pickerEl={value:(new Date).toISOString(),date:new Date},this.clickCb=null,this.stateSwitcher=!1,this.value="",this.customStyle="",this.data=null,this.decimals=!1,this.disabled=!1,this.initialValue="",this.maxDecimals=null,this.maxIntegers=null,this.maxLength=null,this.negative=!1}onKupPickerItemClick(t){this.setPickerValueSelected(t),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupItemClick.emit({comp:this,id:this.rootElement.id,value:this.value}),this.setFocus()}onKupClearIconClick(){this.setPickerValueSelected(""),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupClearIconClick.emit({comp:this,id:this.rootElement.id})}onKupBlur(){this.kupBlur.emit({id:this.rootElement.id,value:this.value,comp:this})}onKupChange(t){this.refreshPickerValue(t.target.value,this.kupChange)}onKupClick(){this.kupClick.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupFocus(){this.kupFocus.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupInput(t){this.refreshPickerValue(t.target.value,this.kupInput,!0)}onkupTextFieldSubmit(t){"Enter"===t.key&&this.refreshPickerValue(t.target.value,this.kupTextFieldSubmit)}onKupIconClick(){this.isPickerOpened()?this.closePicker():this.openPicker(),this.kupIconClick.emit({comp:this,id:this.rootElement.id,value:this.value})}listenKeyup(t){this.isPickerOpened()&&("Escape"===t.key&&this.closePicker(),"Enter"===t.key&&this.setPickerValueSelected())}async getValue(){return this.value}async getProps(t){return a(this,f,t)}async refresh(){e(this)}async setFocus(){null!=this.textfieldEl&&this.textfieldEl.focus()}async setValue(t){this.value=t}refreshPickerValue(t,i,e){let s=this.kupManager.math.numberify(t,!0);if(s){let t=s.toString();const h=t.indexOf(".");let n=h>-1?t.substring(0,h):t,o=h>-1?t.substring(h+1):"";for(this.maxIntegers&&n.length>this.maxIntegers&&(n=n.substring(n.length-this.maxIntegers)),this.maxDecimals&&o.length>this.maxDecimals&&(o=o.substring(0,this.maxDecimals));this.maxLength&&n.length+o.length>this.maxLength;)o.length>1?o=o.substring(0,o.length-1):n.length>1&&(n=n.substring(1));t=h>-1?`${n}.${o}`:n,1!=e&&this.setValue(t),null!=i&&i.emit({id:this.rootElement.id,value:t})}}setPickerValueSelected(t){1!=this.disabled&&(null==t&&(t=this.getPickerValueSelected()),this.closePicker(),null!=t&&this.setValue(t))}getPickerValueSelected(){return this.pickerEl.value}getValueForPickerComponent(){return this.value}openPicker(){const t=this.textfieldEl;this.pickerContainerEl.menuVisible=!0;const i=this.pickerContainerEl.style;i.height="auto",i.minWidth=this.textfieldEl.parentElement.clientWidth+"px",null!=t&&t.classList.add("toggled"),this.kupManager.dynamicPosition.isRegistered(this.pickerContainerEl)?this.kupManager.dynamicPosition.changeAnchor(this.pickerContainerEl,this.textfieldEl.parentElement):this.kupManager.dynamicPosition.register(this.pickerContainerEl,this.textfieldEl.parentElement,0,l.AUTO,!0),this.kupManager.dynamicPosition.start(this.pickerContainerEl),this.clickCb||(this.clickCb={cb:()=>{this.closePicker()},el:this.pickerContainerEl}),this.kupManager.addClickCallback(this.clickCb,!0)}closePicker(){if(this.kupManager.removeClickCallback(this.clickCb),!this.isPickerOpened())return;let t=this.textfieldEl;null!=t&&t.classList.remove("toggled"),this.pickerContainerEl.menuVisible=!1,this.kupManager.dynamicPosition.stop(this.pickerContainerEl)}isPickerOpened(){return 1==this.pickerContainerEl.menuVisible}getTextFieldId(){return this.textfieldEl.id}prepTextfield(){this.decimals||this.maxIntegers||(this.maxIntegers=17),!this.decimals||this.maxIntegers||this.maxDecimals||(this.maxIntegers=15,this.maxDecimals=2);const t=this.rootElement.classList.contains("kup-full-height"),i=this.rootElement.classList.contains("kup-full-width"),e=Object.assign({},this.data["kup-text-field"]);return e.icon||(e.icon="calculator"),e.icon&&(e.trailingIcon=!0),s(u,Object.assign({},e,{disabled:this.disabled,fullHeight:t,fullWidth:i,id:this.rootElement.id+"_text-field",value:this.kupManager.math.numbers.toLocaleString(this.value),onBlur:()=>this.onKupBlur(),onChange:t=>this.onKupChange(t),onClearIconClick:()=>this.onKupClearIconClick(),onClick:()=>this.onKupClick(),onFocus:()=>this.onKupFocus(),onIconClick:()=>this.onKupIconClick(),onKeyDown:t=>this.onkupTextFieldSubmit(t),onInput:t=>this.onKupInput(t)}),this.prepPicker())}prepPicker(){return s("kup-card",{ref:t=>this.pickerContainerEl=t,data:{options:{decimals:this.decimals,initialValue:this.value,maxDecimals:this.maxDecimals,maxIntegers:this.maxIntegers,maxLength:this.maxLength,negative:this.negative,resetStatus:!0}},layoutFamily:p.BUILT_IN,layoutNumber:5,sizeX:"300px",sizeY:"auto",isMenu:!0,"onkup-card-click":t=>{null!=t.detail.value&&this.onKupPickerItemClick(t.detail.value)}})}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this),this.value=this.initialValue,this.data||(this.data={"kup-text-field":{}})}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const i=t.querySelector(".f-text-field");i&&(this.textfieldEl=i.querySelector("input"),c(i))}this.kupManager.debug.logRender(this,!0)}render(){return s(h,{key:"22a6ef8139d04934008071cfa9f9d395144cf82c"},s("style",{key:"3631b7dedacb5a4732a78a36ab6a4ddd772ae632"},this.kupManager.theme.setKupStyle(this.rootElement)),s("div",{key:"9496502390810c10eb60f5fad738d99ee2cbaef5",id:r},this.prepTextfield()))}disconnectedCallback(){this.kupManager.dates.unregister(this),this.kupManager.theme.unregister(this),this.pickerContainerEl&&this.pickerContainerEl.remove()}get rootElement(){return n(this)}};m.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{display:block;font-size:var(--kup-font-size)}.f-text-field{position:relative}:host(.kup-full-height){height:100%}:host(.kup-full-height) #kup-component{height:100%}:host(.kup-full-width){width:100%}:host(.kup-full-width) #kup-component{width:100%}:host(.kup-danger){--kup-textfield-primary-color:var(--kup-danger-color-60);--kup-textfield-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-textfield-primary-color:var(--kup-info-color);--kup-textfield-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-textfield-primary-color:var(--kup-secondary-color);--kup-textfield-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-textfield-primary-color:var(--kup-success-color);--kup-textfield-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-textfield-primary-color:var(--kup-warning-color-50);--kup-textfield-primary-color-rgb:var(--kup-warning-color-rgb)}";export{m as kup_numeric_picker}