@sme.up/ketchup 4.0.0 → 4.1.0

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 (186) hide show
  1. package/dist/cjs/{cell-utils-1f89a299.js → cell-utils-841a7769.js} +2 -2
  2. package/dist/cjs/{f-chip-2d58c8f7.js → f-chip-b9f489ff.js} +7 -5
  3. package/dist/cjs/{f-image-5f4f29ca.js → f-image-0c3e6aa7.js} +3 -4
  4. package/dist/cjs/{index-3c471303.js → index-0416afab.js} +73 -64
  5. package/dist/cjs/ketchup.cjs.js +3 -3
  6. package/dist/cjs/kup-accordion.cjs.entry.js +5 -5
  7. package/dist/cjs/kup-autocomplete_29.cjs.entry.js +1014 -1103
  8. package/dist/cjs/kup-calendar.cjs.entry.js +8 -8
  9. package/dist/cjs/kup-dash-list.cjs.entry.js +6 -6
  10. package/dist/cjs/kup-dash_2.cjs.entry.js +106 -62
  11. package/dist/cjs/kup-drawer.cjs.entry.js +4 -4
  12. package/dist/cjs/kup-field.cjs.entry.js +3 -3
  13. package/dist/cjs/kup-iframe.cjs.entry.js +4 -4
  14. package/dist/cjs/kup-lazy.cjs.entry.js +4 -4
  15. package/dist/cjs/kup-magic-box.cjs.entry.js +21 -30
  16. package/dist/cjs/{kup-manager-59ad8bdc.js → kup-manager-828bd598.js} +599 -519
  17. package/dist/cjs/kup-nav-bar.cjs.entry.js +4 -4
  18. package/dist/cjs/{kup-objects-59ea949c.js → kup-objects-89f38d6a.js} +7 -29
  19. package/dist/cjs/kup-probe.cjs.entry.js +3 -3
  20. package/dist/cjs/kup-qlik.cjs.entry.js +3 -3
  21. package/dist/cjs/loader.cjs.js +3 -3
  22. package/dist/cjs/{utils-2af73538.js → utils-5192ee20.js} +1 -1
  23. package/dist/collection/assets/data-table.js +1 -0
  24. package/dist/collection/collection-manifest.json +2 -3
  25. package/dist/collection/components/kup-accordion/kup-accordion.js +14 -14
  26. package/dist/collection/components/kup-autocomplete/kup-autocomplete.css +9 -0
  27. package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +20 -23
  28. package/dist/collection/components/kup-badge/kup-badge.js +12 -12
  29. package/dist/collection/components/kup-box/kup-box.css +30 -30
  30. package/dist/collection/components/kup-box/kup-box.js +181 -171
  31. package/dist/collection/components/kup-button/kup-button.css +8 -5
  32. package/dist/collection/components/kup-button/kup-button.js +26 -26
  33. package/dist/collection/components/kup-button-list/kup-button-list.css +8 -5
  34. package/dist/collection/components/kup-button-list/kup-button-list.js +18 -18
  35. package/dist/collection/components/kup-calendar/kup-calendar.css +8 -6
  36. package/dist/collection/components/kup-calendar/kup-calendar.js +30 -30
  37. package/dist/collection/components/kup-card/kup-card-helper.js +2 -1
  38. package/dist/collection/components/kup-card/kup-card.css +20 -1
  39. package/dist/collection/components/kup-card/kup-card.js +26 -26
  40. package/dist/collection/components/kup-chart/kup-chart.js +40 -40
  41. package/dist/collection/components/kup-checkbox/kup-checkbox.js +18 -18
  42. package/dist/collection/components/kup-chip/kup-chip.css +0 -1
  43. package/dist/collection/components/kup-chip/kup-chip.js +14 -14
  44. package/dist/collection/components/kup-color-picker/kup-color-picker.css +6 -9
  45. package/dist/collection/components/kup-color-picker/kup-color-picker.js +32 -40
  46. package/dist/collection/components/kup-combobox/kup-combobox.css +9 -0
  47. package/dist/collection/components/kup-combobox/kup-combobox.js +20 -23
  48. package/dist/collection/components/kup-dash-list/kup-dash-list.js +2 -2
  49. package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +1 -0
  50. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +25 -46
  51. package/dist/collection/components/kup-data-table/kup-data-table.css +83 -87
  52. package/dist/collection/components/kup-data-table/kup-data-table.js +364 -531
  53. package/dist/collection/components/kup-date-picker/kup-date-picker.css +2373 -5
  54. package/dist/collection/components/kup-date-picker/kup-date-picker.js +72 -104
  55. package/dist/collection/components/kup-drawer/kup-drawer.js +8 -8
  56. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.css +13 -5
  57. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +38 -43
  58. package/dist/collection/components/kup-field/kup-field.js +20 -20
  59. package/dist/collection/components/kup-gauge/kup-gauge.js +16 -16
  60. package/dist/collection/components/kup-grid/kup-grid.css +2 -1
  61. package/dist/collection/components/kup-grid/kup-grid.js +12 -12
  62. package/dist/collection/components/kup-iframe/kup-iframe.js +4 -4
  63. package/dist/collection/components/kup-image/kup-image.js +24 -24
  64. package/dist/collection/components/kup-lazy/kup-lazy.js +16 -16
  65. package/dist/collection/components/kup-list/kup-list-declarations.js +1 -1
  66. package/dist/collection/components/kup-list/kup-list.css +4 -0
  67. package/dist/collection/components/kup-list/kup-list.js +38 -47
  68. package/dist/collection/components/kup-magic-box/kup-magic-box.css +11 -6
  69. package/dist/collection/components/kup-magic-box/kup-magic-box.js +27 -36
  70. package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +10 -10
  71. package/dist/collection/components/kup-paginator/kup-paginator.css +8 -5
  72. package/dist/collection/components/kup-probe/kup-probe.js +8 -8
  73. package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +20 -20
  74. package/dist/collection/components/kup-radio/kup-radio.js +16 -16
  75. package/dist/collection/components/kup-rating/kup-rating.js +14 -14
  76. package/dist/collection/components/kup-spinner/kup-spinner.js +22 -22
  77. package/dist/collection/components/kup-switch/kup-switch.js +16 -16
  78. package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +12 -12
  79. package/dist/collection/components/kup-text-field/kup-text-field.js +48 -48
  80. package/dist/collection/components/kup-time-picker/kup-time-picker.css +2376 -0
  81. package/dist/collection/components/kup-time-picker/kup-time-picker.js +50 -83
  82. package/dist/collection/components/kup-tooltip/kup-tooltip.js +18 -12
  83. package/dist/collection/components/kup-tree/kup-tree.css +10 -10
  84. package/dist/collection/components/kup-tree/kup-tree.js +96 -66
  85. package/dist/collection/f-components/f-button/f-button.js +4 -2
  86. package/dist/collection/f-components/f-image/f-image.js +1 -2
  87. package/dist/collection/f-components/f-text-field/f-text-field.js +8 -6
  88. package/dist/collection/utils/kup-column-menu/kup-column-menu.js +11 -3
  89. package/dist/collection/utils/kup-debug/kup-debug.js +25 -27
  90. package/dist/collection/utils/kup-dynamic-position/kup-dynamic-position.js +3 -5
  91. package/dist/collection/utils/kup-interact/kup-interact-declarations.js +48 -0
  92. package/dist/collection/utils/kup-interact/kup-interact.js +362 -0
  93. package/dist/collection/utils/kup-manager/kup-manager.js +18 -6
  94. package/dist/collection/utils/kup-objects/kup-objects.js +7 -29
  95. package/dist/collection/utils/kup-scroll-on-hover/kup-scroll-on-hover.js +60 -62
  96. package/dist/collection/utils/kup-toolbar/kup-toolbar.js +16 -18
  97. package/dist/esm/{cell-utils-cb612463.js → cell-utils-de384721.js} +2 -2
  98. package/dist/esm/{f-chip-125d5dd6.js → f-chip-d585b63e.js} +7 -5
  99. package/dist/esm/{f-image-68b34fab.js → f-image-23548d00.js} +3 -4
  100. package/dist/esm/{index-bf2824a6.js → index-51694018.js} +73 -64
  101. package/dist/esm/ketchup.js +3 -3
  102. package/dist/esm/kup-accordion.entry.js +5 -5
  103. package/dist/esm/kup-autocomplete_29.entry.js +818 -907
  104. package/dist/esm/kup-calendar.entry.js +8 -8
  105. package/dist/esm/kup-dash-list.entry.js +6 -6
  106. package/dist/esm/kup-dash_2.entry.js +106 -62
  107. package/dist/esm/kup-drawer.entry.js +4 -4
  108. package/dist/esm/kup-field.entry.js +3 -3
  109. package/dist/esm/kup-iframe.entry.js +4 -4
  110. package/dist/esm/kup-lazy.entry.js +4 -4
  111. package/dist/esm/kup-magic-box.entry.js +21 -30
  112. package/dist/esm/{kup-manager-e7d7b353.js → kup-manager-583f2815.js} +595 -520
  113. package/dist/esm/kup-nav-bar.entry.js +4 -4
  114. package/dist/esm/{kup-objects-d38d2fa2.js → kup-objects-5968aefd.js} +7 -29
  115. package/dist/esm/kup-probe.entry.js +3 -3
  116. package/dist/esm/kup-qlik.entry.js +3 -3
  117. package/dist/esm/loader.js +3 -3
  118. package/dist/esm/{utils-13dd007a.js → utils-a1dd14c3.js} +1 -1
  119. package/dist/ketchup/ketchup.esm.js +1 -1
  120. package/dist/ketchup/{p-64ea7e37.entry.js → p-0e91c9c9.entry.js} +1 -1
  121. package/dist/ketchup/{p-0320e24e.entry.js → p-0f2b6a24.entry.js} +1 -1
  122. package/dist/ketchup/{p-a5424073.js → p-361d9431.js} +1 -1
  123. package/dist/ketchup/p-565785ce.js +1 -0
  124. package/dist/ketchup/{p-7896031c.entry.js → p-57eb45ac.entry.js} +1 -1
  125. package/dist/ketchup/{p-08c7a092.js → p-6f5d8830.js} +1 -1
  126. package/dist/ketchup/{p-9c858a38.entry.js → p-802d8906.entry.js} +1 -1
  127. package/dist/ketchup/p-850b9e67.entry.js +1 -0
  128. package/dist/ketchup/{p-a12a5690.entry.js → p-88a5787a.entry.js} +1 -1
  129. package/dist/ketchup/p-8ed2b7bf.entry.js +1 -0
  130. package/dist/ketchup/{p-ee89966f.entry.js → p-90a0c2b7.entry.js} +2 -2
  131. package/dist/ketchup/{p-876da4c2.entry.js → p-94c0dd8c.entry.js} +1 -1
  132. package/dist/ketchup/p-9ec3c377.entry.js +45 -0
  133. package/dist/ketchup/p-b30f34d8.js +1 -0
  134. package/dist/ketchup/p-b6a47512.entry.js +1 -0
  135. package/dist/ketchup/p-bfaf8a82.js +1 -0
  136. package/dist/ketchup/{p-940ab57a.entry.js → p-ca0ebdcc.entry.js} +1 -1
  137. package/dist/ketchup/p-d5a3a4ed.js +1 -0
  138. package/dist/ketchup/{p-c7ee1fbc.js → p-ee7b190c.js} +1 -1
  139. package/dist/ketchup/{p-b0724035.entry.js → p-f6b54fa1.entry.js} +1 -1
  140. package/dist/types/components/kup-box/kup-box-declarations.d.ts +11 -2
  141. package/dist/types/components/kup-box/kup-box.d.ts +8 -4
  142. package/dist/types/components/kup-color-picker/kup-color-picker.d.ts +0 -1
  143. package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +12 -4
  144. package/dist/types/components/kup-data-table/kup-data-table-helper.d.ts +0 -2
  145. package/dist/types/components/kup-data-table/kup-data-table.d.ts +16 -49
  146. package/dist/types/components/kup-date-picker/kup-date-picker.d.ts +11 -14
  147. package/dist/types/components/kup-dropdown-button/kup-dropdown-button.d.ts +0 -4
  148. package/dist/types/components/kup-list/kup-list-declarations.d.ts +1 -1
  149. package/dist/types/components/kup-list/kup-list.d.ts +2 -3
  150. package/dist/types/components/kup-magic-box/kup-magic-box.d.ts +1 -0
  151. package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +7 -11
  152. package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +4 -4
  153. package/dist/types/components/kup-tree/kup-tree.d.ts +3 -0
  154. package/dist/types/components.d.ts +84 -121
  155. package/dist/types/utils/kup-dynamic-position/kup-dynamic-position.d.ts +2 -2
  156. package/dist/types/utils/kup-interact/kup-interact-declarations.d.ts +127 -0
  157. package/dist/types/utils/kup-interact/kup-interact.d.ts +93 -0
  158. package/dist/types/utils/kup-manager/kup-manager-declarations.d.ts +21 -4
  159. package/dist/types/utils/kup-manager/kup-manager.d.ts +2 -2
  160. package/dist/types/utils/kup-objects/kup-objects.d.ts +1 -7
  161. package/package.json +3 -3
  162. package/dist/cjs/drag-and-drop-4787ff6f.js +0 -281
  163. package/dist/cjs/kup-grid.cjs.entry.js +0 -130
  164. package/dist/collection/assets/images/drag-multiple.js +0 -1
  165. package/dist/collection/components/kup-layout/kup-layout.css +0 -53
  166. package/dist/collection/components/kup-layout/kup-layout.js +0 -156
  167. package/dist/collection/utils/drag-and-drop.js +0 -109
  168. package/dist/collection/utils/kup-dialog/kup-dialog-declarations.js +0 -36
  169. package/dist/collection/utils/kup-dialog/kup-dialog.js +0 -310
  170. package/dist/esm/drag-and-drop-321cb4ca.js +0 -265
  171. package/dist/esm/kup-grid.entry.js +0 -126
  172. package/dist/ketchup/p-00fe1e3e.js +0 -1
  173. package/dist/ketchup/p-1165f4ea.entry.js +0 -1
  174. package/dist/ketchup/p-170d3cba.js +0 -1
  175. package/dist/ketchup/p-18cb3ba3.js +0 -1
  176. package/dist/ketchup/p-23541a97.entry.js +0 -45
  177. package/dist/ketchup/p-8fb9d9b2.entry.js +0 -1
  178. package/dist/ketchup/p-b14e77f0.js +0 -1
  179. package/dist/ketchup/p-d24cfdea.entry.js +0 -1
  180. package/dist/ketchup/p-fcd2fd8f.js +0 -1
  181. package/dist/ketchup/p-fce3b9d8.entry.js +0 -1
  182. package/dist/types/assets/images/drag-multiple.d.ts +0 -1
  183. package/dist/types/components/kup-layout/kup-layout.d.ts +0 -25
  184. package/dist/types/utils/drag-and-drop.d.ts +0 -53
  185. package/dist/types/utils/kup-dialog/kup-dialog-declarations.d.ts +0 -43
  186. package/dist/types/utils/kup-dialog/kup-dialog.d.ts +0 -50
@@ -3,9 +3,6 @@ import { SortMode, } from '../kup-data-table/kup-data-table-declarations';
3
3
  import { KupBoxProps, } from './kup-box-declarations';
4
4
  import { isEditor, isImage, isProgressBar, isRadio, isGauge, isKnob, isChart, getCellValueForDisplay, getColumnByName, } from '../../utils/cell-utils';
5
5
  import { filterRows, sortRows, paginateRows, } from '../kup-data-table/kup-data-table-helper';
6
- import { setDragEffectAllowed, setKetchupDraggable, setKetchupDroppable, } from '../../utils/drag-and-drop';
7
- const KupBoxDragType = 'text/kup-box-drag';
8
- import { dragMultipleImg } from '../../assets/images/drag-multiple';
9
6
  import { PaginatorMode } from '../kup-paginator/kup-paginator-declarations';
10
7
  import { kupManagerInstance, } from '../../utils/kup-manager/kup-manager';
11
8
  import { KupBoxState } from './kup-box-state';
@@ -18,6 +15,7 @@ import { KupDebugCategory } from '../../utils/kup-debug/kup-debug-declarations';
18
15
  import { KupLanguageGeneric, KupLanguageSearch, } from '../../utils/kup-language/kup-language-declarations';
19
16
  import { componentWrapperId } from '../../variables/GenericVariables';
20
17
  import { KupThemeIconValues } from '../../utils/kup-theme/kup-theme-declarations';
18
+ import { KupDragEffect, kupDraggableCellAttr, KupDropEventTypes, KupPointerEventTypes, } from '../../utils/kup-interact/kup-interact-declarations';
21
19
  export class KupBox {
22
20
  constructor() {
23
21
  /*-------------------------------------------------*/
@@ -150,6 +148,12 @@ export class KupBox {
150
148
  this.rows = [];
151
149
  this.filteredRows = [];
152
150
  this.iconPaths = undefined;
151
+ this.sectionRef = null;
152
+ this.rowsRefs = [];
153
+ this.hold = false;
154
+ this.interactableDrag = [];
155
+ this.interactableDrop = [];
156
+ this.interactableTouch = [];
153
157
  }
154
158
  initWithPersistedState() {
155
159
  if (this.store && this.stateId) {
@@ -377,14 +381,18 @@ export class KupBox {
377
381
  }
378
382
  }
379
383
  getEventDetails(el) {
380
- const boxObject = el.closest('.box-object');
384
+ let boxObject = null;
381
385
  let cell = null;
382
386
  let row = null;
383
387
  let column = null;
388
+ if (el) {
389
+ boxObject =
390
+ el.closest('.box-object') || el.querySelector('.box-object');
391
+ }
384
392
  if (boxObject) {
385
393
  cell = boxObject['data-cell'];
386
394
  row = boxObject['data-row'];
387
- column = boxObject['data-column'];
395
+ column = getColumnByName(this.visibleColumns, boxObject.dataset.column);
388
396
  }
389
397
  return {
390
398
  boxObject: boxObject ? boxObject : null,
@@ -395,16 +403,10 @@ export class KupBox {
395
403
  }
396
404
  contextMenuHandler(e) {
397
405
  const details = this.getEventDetails(e.target);
398
- this.kupBoxContextMenu.emit({
399
- comp: this,
400
- id: this.rootElement.id,
401
- details: details,
402
- });
403
406
  if (this.showTooltipOnRightClick && details.boxObject && details.cell) {
404
- e.preventDefault();
405
- setTooltip(e, details.row.id, details.column, details.cell, this.tooltip);
406
- return;
407
+ setTooltip(e, details.row.id, details.column.name, details.cell, this.tooltip);
407
408
  }
409
+ return details;
408
410
  }
409
411
  /**
410
412
  * Checks if the element is the svg that opens the "row actions menu"
@@ -539,35 +541,6 @@ export class KupBox {
539
541
  index,
540
542
  });
541
543
  }
542
- // when the dragged box is over the drop section (fired on the drop target)
543
- onSectionDragOver(event) {
544
- event.preventDefault();
545
- let target = event.target;
546
- this.searchParentWithClass(target, 'box-component').classList.add('component-dropover');
547
- }
548
- // when the dragged box leaves the drop section (fired on the drop target)
549
- onSectionDragLeave(event) {
550
- let target = event.target;
551
- this.searchParentWithClass(target, 'box-component').classList.remove('component-dropover');
552
- }
553
- addMultiSelectDragImageToEvent(event) {
554
- var dragImage = document.createElement('img');
555
- dragImage.src = dragMultipleImg;
556
- event.dataTransfer.setDragImage(dragImage, 0, 0);
557
- }
558
- searchParentWithClass(target, cssClass) {
559
- // searching parent until class is reached
560
- let element = target;
561
- let classList = element.classList;
562
- while (!classList.contains(cssClass)) {
563
- element = element.parentElement;
564
- if (element === null) {
565
- break;
566
- }
567
- classList = element.classList;
568
- }
569
- return element;
570
- }
571
544
  /**
572
545
  * see onDocumentClick in kup-combo
573
546
  */
@@ -807,59 +780,17 @@ export class KupBox {
807
780
  ? `centered ${badge['className']}`
808
781
  : 'centered', imageData: badge.imageData })));
809
782
  }
810
- let dragHandler = null;
811
- if (this.dragEnabled) {
812
- dragHandler = h("span", { class: "box-drag-handler mdi mdi-drag" });
813
- }
814
783
  const boxClass = {
815
784
  box: true,
816
785
  draggable: this.dragEnabled,
817
786
  selected: this.showSelection && isSelected,
818
787
  column: !horizontal,
819
788
  };
820
- const dragHandlers = {
821
- onDragStart: (e) => {
822
- // Sets the type of drag
823
- setDragEffectAllowed(e, 'move');
824
- if (this.multiSelection) {
825
- this.addMultiSelectDragImageToEvent(e);
826
- }
827
- this.searchParentWithClass(e.target, 'box').classList.add('item-dragged');
828
- },
829
- onDragEnd: (e) => {
830
- this.searchParentWithClass(e.target, 'box').classList.remove('item-dragged');
831
- },
832
- };
833
- const dropHandlers = {
834
- onDragOver: (e) => {
835
- this.searchParentWithClass(e.target, 'box').classList.add('item-dropover');
836
- return true;
837
- },
838
- onDragLeave: (e) => {
839
- this.searchParentWithClass(e.target, 'box').classList.remove('item-dropover');
840
- },
841
- onDrop: (e) => {
842
- this.searchParentWithClass(e.target, 'box').classList.remove('item-dropover');
843
- return KupBoxDragType;
844
- },
845
- };
846
789
  return (h("div", { class: "box-wrapper" },
847
- h("div", Object.assign({ class: boxClass, onClick: (e) => this.onBoxClick(e, row) }, (this.dragEnabled
848
- ? setKetchupDraggable(dragHandlers, {
849
- [KupBoxDragType]: row,
850
- 'kup-drag-source-element': {
851
- id: this.rootElement.id,
852
- row,
853
- selectedRows: this.selectedRows,
854
- },
855
- })
856
- : {}), (this.dropEnabled
857
- ? setKetchupDroppable(dropHandlers, [KupBoxDragType], this.rootElement, { row, id: this.rootElement.id })
858
- : {})),
790
+ h("div", { class: boxClass, onClick: (e) => this.onBoxClick(e, row), ref: (el) => this.rowsRefs.push(el) },
859
791
  multiSel,
860
792
  boxContent,
861
- badges,
862
- dragHandler),
793
+ badges),
863
794
  rowObject));
864
795
  }
865
796
  renderSection(section, parent, row, visibleColumns) {
@@ -957,7 +888,7 @@ export class KupBox {
957
888
  } },
958
889
  h("div", { class: "header-content" },
959
890
  h("span", null, headerTitle),
960
- h("span", { class: "mdi mdi-chevron-down" })))));
891
+ h(FImage, { resource: `${KupThemeIconValues.DROPDOWN}`, sizeX: "1.25em", sizeY: "1.25em", wrapperClass: sectionExpanded ? 'toggled' : '' })))));
961
892
  }
962
893
  else {
963
894
  const title = section.title ? h("h3", null, section.title) : null;
@@ -982,7 +913,7 @@ export class KupBox {
982
913
  cell = row.cells[boxObject.column];
983
914
  column = null;
984
915
  if (cell) {
985
- _hasTooltip = this.kupManager.objects.hasTooltip(cell.obj);
916
+ _hasTooltip = !this.kupManager.objects.isEmptyKupObj(cell.obj);
986
917
  // removing column from visibleColumns
987
918
  let index = -1;
988
919
  for (let i = 0; i < visibleColumns.length; i++) {
@@ -1279,6 +1210,99 @@ export class KupBox {
1279
1210
  ? 0
1280
1211
  : this.tooltipLoadTimeout, detailTimeout: this.tooltipDetailTimeout, ref: (el) => (this.tooltip = el) }));
1281
1212
  }
1213
+ didLoadInteractables() {
1214
+ this.interactableTouch.push(this.boxContainer);
1215
+ const tapCb = (e) => {
1216
+ if (this.hold) {
1217
+ this.hold = false;
1218
+ return;
1219
+ }
1220
+ switch (e.button) {
1221
+ // right click
1222
+ case 2:
1223
+ this.kupBoxContextMenu.emit({
1224
+ comp: this,
1225
+ id: this.rootElement.id,
1226
+ details: this.contextMenuHandler(e),
1227
+ });
1228
+ break;
1229
+ }
1230
+ };
1231
+ const holdCb = (e) => {
1232
+ if (e.pointerType === 'pen' || e.pointerType === 'touch') {
1233
+ this.hold = true;
1234
+ this.kupBoxContextMenu.emit({
1235
+ comp: this,
1236
+ id: this.rootElement.id,
1237
+ details: this.contextMenuHandler(e),
1238
+ });
1239
+ }
1240
+ };
1241
+ this.kupManager.interact.on(this.boxContainer, KupPointerEventTypes.TAP, tapCb);
1242
+ this.kupManager.interact.on(this.boxContainer, KupPointerEventTypes.HOLD, holdCb);
1243
+ }
1244
+ didRenderInteractables() {
1245
+ if (this.dragEnabled) {
1246
+ for (let index = 0; index < this.rowsRefs.length; index++) {
1247
+ const row = this.rowsRefs[index];
1248
+ const dataCb = () => {
1249
+ const cellEl = this.rootElement.shadowRoot.querySelector('.box-object:hover');
1250
+ return {
1251
+ cell: cellEl['data-cell'],
1252
+ column: getColumnByName(this.visibleColumns, cellEl.dataset.column),
1253
+ id: this.rootElement.id,
1254
+ multiple: this.multiSelection,
1255
+ row: cellEl['data-row'],
1256
+ selectedRows: this.selectedRows,
1257
+ };
1258
+ };
1259
+ if (row && !this.interactableDrag.includes(row)) {
1260
+ this.interactableDrag.push(row);
1261
+ this.kupManager.interact.draggable(row, {
1262
+ allowFrom: '.box-object',
1263
+ cursorChecker() {
1264
+ return null;
1265
+ },
1266
+ }, {
1267
+ callback: dataCb,
1268
+ }, KupDragEffect.BADGE);
1269
+ }
1270
+ }
1271
+ }
1272
+ if (this.dropEnabled) {
1273
+ const dataCb = () => {
1274
+ const receivingDetails = this.getEventDetails(this.rootElement.shadowRoot.querySelector('.box:hover'));
1275
+ return {
1276
+ cell: receivingDetails.cell,
1277
+ column: receivingDetails.column,
1278
+ id: this.rootElement.id,
1279
+ row: receivingDetails.row,
1280
+ };
1281
+ };
1282
+ if (!this.interactableDrop.includes(this.sectionRef)) {
1283
+ this.interactableDrop.push(this.sectionRef);
1284
+ this.kupManager.interact.dropzone(this.sectionRef, {
1285
+ accept: `[${kupDraggableCellAttr}]`,
1286
+ }, {
1287
+ dispatcher: this.rootElement,
1288
+ type: KupDropEventTypes.BOX,
1289
+ });
1290
+ }
1291
+ for (let index = 0; index < this.rowsRefs.length; index++) {
1292
+ const row = this.rowsRefs[index];
1293
+ if (row && !this.interactableDrop.includes(row)) {
1294
+ this.interactableDrop.push(row);
1295
+ this.kupManager.interact.dropzone(row, {
1296
+ accept: `[${kupDraggableCellAttr}]`,
1297
+ }, {
1298
+ callback: dataCb,
1299
+ dispatcher: this.rootElement,
1300
+ type: KupDropEventTypes.BOX,
1301
+ });
1302
+ }
1303
+ }
1304
+ }
1305
+ }
1282
1306
  /*-------------------------------------------------*/
1283
1307
  /* L i f e c y c l e H o o k s */
1284
1308
  /*-------------------------------------------------*/
@@ -1307,6 +1331,7 @@ export class KupBox {
1307
1331
  return selectedIds.indexOf(r.id) >= 0;
1308
1332
  });
1309
1333
  }
1334
+ this.didLoadInteractables();
1310
1335
  this.kupDidLoad.emit({ comp: this, id: this.rootElement.id });
1311
1336
  this.kupManager.debug.logLoad(this, true);
1312
1337
  }
@@ -1316,6 +1341,7 @@ export class KupBox {
1316
1341
  componentDidRender() {
1317
1342
  this.checkScrollOnHover();
1318
1343
  this.persistState();
1344
+ this.didRenderInteractables();
1319
1345
  this.kupManager.debug.logRender(this, true);
1320
1346
  }
1321
1347
  render() {
@@ -1383,34 +1409,17 @@ export class KupBox {
1383
1409
  }
1384
1410
  }
1385
1411
  const tooltip = this.renderTooltip();
1386
- const dropHandlers = {
1387
- onDragOver: (e) => {
1388
- if (!(e.target instanceof HTMLElement)) {
1389
- return false;
1390
- }
1391
- this.onSectionDragOver(e);
1392
- return true;
1393
- },
1394
- onDragLeave: (e) => {
1395
- this.onSectionDragLeave(e);
1396
- },
1397
- onDrop: (e) => {
1398
- this.searchParentWithClass(e.target, 'box-component').classList.remove('component-dropover');
1399
- return KupBoxDragType;
1400
- },
1401
- };
1402
1412
  const customStyle = this.kupManager.theme.setCustomStyle(this.rootElement);
1403
1413
  return (h(Host, null,
1404
1414
  customStyle ? h("style", null, customStyle) : null,
1405
1415
  h("div", { id: componentWrapperId },
1406
- h("div", Object.assign({ class: 'box-component' }, (this.dropEnabled &&
1407
- (this.dropOnSection || !this.getRows().length)
1408
- ? setKetchupDroppable(dropHandlers, [KupBoxDragType], this.rootElement, { row: null, id: this.rootElement.id })
1409
- : {}), { onContextMenu: (e) => this.contextMenuHandler(e) }),
1416
+ h("div", { class: 'box-component', ref: (el) => (this.sectionRef = el) },
1410
1417
  sortPanel,
1411
1418
  filterPanel,
1412
1419
  paginator,
1413
- h("div", { class: isKanban ? 'is-kanban' : '', id: 'box-container', style: containerStyle, onMouseLeave: (ev) => {
1420
+ h("div", { class: isKanban ? 'is-kanban' : '', id: 'box-container', style: containerStyle, onContextMenu: (e) => {
1421
+ e.preventDefault();
1422
+ }, onMouseLeave: (ev) => {
1414
1423
  ev.stopPropagation();
1415
1424
  unsetTooltip(this.tooltip);
1416
1425
  }, ref: (el) => (this.boxContainer =
@@ -1418,6 +1427,7 @@ export class KupBox {
1418
1427
  tooltip))));
1419
1428
  }
1420
1429
  disconnectedCallback() {
1430
+ this.kupManager.interact.unregister(this.interactableDrag.concat(this.interactableDrop));
1421
1431
  this.kupManager.language.unregister(this);
1422
1432
  this.kupManager.theme.unregister(this);
1423
1433
  if (this.scrollOnHover) {
@@ -1453,8 +1463,8 @@ export class KupBox {
1453
1463
  "optional": false,
1454
1464
  "docs": {
1455
1465
  "tags": [{
1456
- "text": "null",
1457
- "name": "default"
1466
+ "name": "default",
1467
+ "text": "null"
1458
1468
  }],
1459
1469
  "text": "Data of the card linked to the box when the latter's layout must be a premade template."
1460
1470
  },
@@ -1472,8 +1482,8 @@ export class KupBox {
1472
1482
  "optional": false,
1473
1483
  "docs": {
1474
1484
  "tags": [{
1475
- "text": "1",
1476
- "name": "default"
1485
+ "name": "default",
1486
+ "text": "1"
1477
1487
  }],
1478
1488
  "text": "Number of columns"
1479
1489
  },
@@ -1493,11 +1503,11 @@ export class KupBox {
1493
1503
  "optional": false,
1494
1504
  "docs": {
1495
1505
  "tags": [{
1496
- "text": "\"\"",
1497
- "name": "default"
1506
+ "name": "default",
1507
+ "text": "\"\""
1498
1508
  }, {
1499
- "text": "https ://ketchup.smeup.com/ketchup-showcase/#/customization",
1500
- "name": "see"
1509
+ "name": "see",
1510
+ "text": "https://ketchup.smeup.com/ketchup-showcase/#/customization"
1501
1511
  }],
1502
1512
  "text": "Custom style of the component."
1503
1513
  },
@@ -1522,8 +1532,8 @@ export class KupBox {
1522
1532
  "optional": false,
1523
1533
  "docs": {
1524
1534
  "tags": [{
1525
- "text": "null",
1526
- "name": "default"
1535
+ "name": "default",
1536
+ "text": "null"
1527
1537
  }],
1528
1538
  "text": "Actual data of the box."
1529
1539
  },
@@ -1541,8 +1551,8 @@ export class KupBox {
1541
1551
  "optional": false,
1542
1552
  "docs": {
1543
1553
  "tags": [{
1544
- "text": "false",
1545
- "name": "default"
1554
+ "name": "default",
1555
+ "text": "false"
1546
1556
  }],
1547
1557
  "text": "Enable dragging"
1548
1558
  },
@@ -1562,8 +1572,8 @@ export class KupBox {
1562
1572
  "optional": false,
1563
1573
  "docs": {
1564
1574
  "tags": [{
1565
- "text": "false",
1566
- "name": "default"
1575
+ "name": "default",
1576
+ "text": "false"
1567
1577
  }],
1568
1578
  "text": "Enable dropping"
1569
1579
  },
@@ -1583,8 +1593,8 @@ export class KupBox {
1583
1593
  "optional": false,
1584
1594
  "docs": {
1585
1595
  "tags": [{
1586
- "text": "false",
1587
- "name": "default"
1596
+ "name": "default",
1597
+ "text": "false"
1588
1598
  }],
1589
1599
  "text": "Drop can be done in section"
1590
1600
  },
@@ -1604,8 +1614,8 @@ export class KupBox {
1604
1614
  "optional": false,
1605
1615
  "docs": {
1606
1616
  "tags": [{
1607
- "text": "false",
1608
- "name": "default"
1617
+ "name": "default",
1618
+ "text": "false"
1609
1619
  }],
1610
1620
  "text": "If enabled, a button to load / display the row actions\nwill be displayed on the right of every box"
1611
1621
  },
@@ -1625,8 +1635,8 @@ export class KupBox {
1625
1635
  "optional": false,
1626
1636
  "docs": {
1627
1637
  "tags": [{
1628
- "text": "false",
1629
- "name": "default"
1638
+ "name": "default",
1639
+ "text": "false"
1630
1640
  }],
1631
1641
  "text": "When set to true it activates the global filter."
1632
1642
  },
@@ -1646,8 +1656,8 @@ export class KupBox {
1646
1656
  "optional": false,
1647
1657
  "docs": {
1648
1658
  "tags": [{
1649
- "text": "\"\"",
1650
- "name": "default"
1659
+ "name": "default",
1660
+ "text": "\"\""
1651
1661
  }],
1652
1662
  "text": "The value of the global filter."
1653
1663
  },
@@ -1672,8 +1682,8 @@ export class KupBox {
1672
1682
  "optional": false,
1673
1683
  "docs": {
1674
1684
  "tags": [{
1675
- "text": "null",
1676
- "name": "default"
1685
+ "name": "default",
1686
+ "text": "null"
1677
1687
  }],
1678
1688
  "text": "Displays the boxlist as a Kanban."
1679
1689
  },
@@ -1696,8 +1706,8 @@ export class KupBox {
1696
1706
  "optional": false,
1697
1707
  "docs": {
1698
1708
  "tags": [{
1699
- "text": "undefined",
1700
- "name": "default"
1709
+ "name": "default",
1710
+ "text": "undefined"
1701
1711
  }],
1702
1712
  "text": "How the field will be displayed. If not present, a default one will be created."
1703
1713
  }
@@ -1714,8 +1724,8 @@ export class KupBox {
1714
1724
  "optional": false,
1715
1725
  "docs": {
1716
1726
  "tags": [{
1717
- "text": "false",
1718
- "name": "default"
1727
+ "name": "default",
1728
+ "text": "false"
1719
1729
  }],
1720
1730
  "text": "Enable multi selection"
1721
1731
  },
@@ -1735,8 +1745,8 @@ export class KupBox {
1735
1745
  "optional": false,
1736
1746
  "docs": {
1737
1747
  "tags": [{
1738
- "text": "1",
1739
- "name": "default"
1748
+ "name": "default",
1749
+ "text": "1"
1740
1750
  }],
1741
1751
  "text": "Current page number"
1742
1752
  },
@@ -1756,8 +1766,8 @@ export class KupBox {
1756
1766
  "optional": false,
1757
1767
  "docs": {
1758
1768
  "tags": [{
1759
- "text": "10",
1760
- "name": "default"
1769
+ "name": "default",
1770
+ "text": "10"
1761
1771
  }],
1762
1772
  "text": "Number of boxes per page"
1763
1773
  },
@@ -1777,8 +1787,8 @@ export class KupBox {
1777
1787
  "optional": false,
1778
1788
  "docs": {
1779
1789
  "tags": [{
1780
- "text": "false",
1781
- "name": "default"
1790
+ "name": "default",
1791
+ "text": "false"
1782
1792
  }],
1783
1793
  "text": "Enables pagination"
1784
1794
  },
@@ -1798,8 +1808,8 @@ export class KupBox {
1798
1808
  "optional": false,
1799
1809
  "docs": {
1800
1810
  "tags": [{
1801
- "text": "undefined",
1802
- "name": "default"
1811
+ "name": "default",
1812
+ "text": "undefined"
1803
1813
  }],
1804
1814
  "text": "Number of current rows per page"
1805
1815
  },
@@ -1818,8 +1828,8 @@ export class KupBox {
1818
1828
  "optional": false,
1819
1829
  "docs": {
1820
1830
  "tags": [{
1821
- "text": "false",
1822
- "name": "default"
1831
+ "name": "default",
1832
+ "text": "false"
1823
1833
  }],
1824
1834
  "text": "Activates the scroll on hover function."
1825
1835
  },
@@ -1839,8 +1849,8 @@ export class KupBox {
1839
1849
  "optional": false,
1840
1850
  "docs": {
1841
1851
  "tags": [{
1842
- "text": "undefined",
1843
- "name": "default"
1852
+ "name": "default",
1853
+ "text": "undefined"
1844
1854
  }],
1845
1855
  "text": "Automatically selects the box at the specified index"
1846
1856
  },
@@ -1859,8 +1869,8 @@ export class KupBox {
1859
1869
  "optional": false,
1860
1870
  "docs": {
1861
1871
  "tags": [{
1862
- "text": "undefined",
1863
- "name": "default"
1872
+ "name": "default",
1873
+ "text": "undefined"
1864
1874
  }],
1865
1875
  "text": "Multiple selection"
1866
1876
  },
@@ -1879,8 +1889,8 @@ export class KupBox {
1879
1889
  "optional": false,
1880
1890
  "docs": {
1881
1891
  "tags": [{
1882
- "text": "true",
1883
- "name": "default"
1892
+ "name": "default",
1893
+ "text": "true"
1884
1894
  }],
1885
1895
  "text": "If enabled, highlights the selected box/boxes"
1886
1896
  },
@@ -1900,8 +1910,8 @@ export class KupBox {
1900
1910
  "optional": false,
1901
1911
  "docs": {
1902
1912
  "tags": [{
1903
- "text": "true",
1904
- "name": "default"
1913
+ "name": "default",
1914
+ "text": "true"
1905
1915
  }],
1906
1916
  "text": "If set to true, displays tooltip on right click; if set to false, displays tooltip on mouseOver."
1907
1917
  },
@@ -1921,8 +1931,8 @@ export class KupBox {
1921
1931
  "optional": false,
1922
1932
  "docs": {
1923
1933
  "tags": [{
1924
- "text": "undefined",
1925
- "name": "default"
1934
+ "name": "default",
1935
+ "text": "undefined"
1926
1936
  }],
1927
1937
  "text": "If sorting is enabled, specifies which column to sort"
1928
1938
  },
@@ -1941,8 +1951,8 @@ export class KupBox {
1941
1951
  "optional": false,
1942
1952
  "docs": {
1943
1953
  "tags": [{
1944
- "text": "false",
1945
- "name": "default"
1954
+ "name": "default",
1955
+ "text": "false"
1946
1956
  }],
1947
1957
  "text": "Enable sorting"
1948
1958
  },
@@ -2000,8 +2010,8 @@ export class KupBox {
2000
2010
  "optional": false,
2001
2011
  "docs": {
2002
2012
  "tags": [{
2003
- "text": "false",
2004
- "name": "default"
2013
+ "name": "default",
2014
+ "text": "false"
2005
2015
  }],
2006
2016
  "text": "Disable swipe"
2007
2017
  },
@@ -2021,8 +2031,8 @@ export class KupBox {
2021
2031
  "optional": false,
2022
2032
  "docs": {
2023
2033
  "tags": [{
2024
- "text": "undefined",
2025
- "name": "default"
2034
+ "name": "default",
2035
+ "text": "undefined"
2026
2036
  }],
2027
2037
  "text": "Defines the timeout for tooltip detail"
2028
2038
  },
@@ -2041,8 +2051,8 @@ export class KupBox {
2041
2051
  "optional": false,
2042
2052
  "docs": {
2043
2053
  "tags": [{
2044
- "text": "true",
2045
- "name": "default"
2054
+ "name": "default",
2055
+ "text": "true"
2046
2056
  }],
2047
2057
  "text": "Enable show tooltip"
2048
2058
  },
@@ -2062,8 +2072,8 @@ export class KupBox {
2062
2072
  "optional": false,
2063
2073
  "docs": {
2064
2074
  "tags": [{
2065
- "text": "undefined",
2066
- "name": "default"
2075
+ "name": "default",
2076
+ "text": "undefined"
2067
2077
  }],
2068
2078
  "text": "Defines the timeout for tooltip load"
2069
2079
  },
@@ -2245,8 +2255,8 @@ export class KupBox {
2245
2255
  "signature": "(descriptions?: boolean) => Promise<GenericObject>",
2246
2256
  "parameters": [{
2247
2257
  "tags": [{
2248
- "text": "descriptions - When provided and true, the result will be the list of props with their description.",
2249
- "name": "param"
2258
+ "name": "param",
2259
+ "text": "descriptions - When provided and true, the result will be the list of props with their description."
2250
2260
  }],
2251
2261
  "text": "- When provided and true, the result will be the list of props with their description."
2252
2262
  }],
@@ -2323,8 +2333,8 @@ export class KupBox {
2323
2333
  "signature": "(props: GenericObject) => Promise<void>",
2324
2334
  "parameters": [{
2325
2335
  "tags": [{
2326
- "text": "props - Object containing props that will be set to the component.",
2327
- "name": "param"
2336
+ "name": "param",
2337
+ "text": "props - Object containing props that will be set to the component."
2328
2338
  }],
2329
2339
  "text": "- Object containing props that will be set to the component."
2330
2340
  }],