@sme.up/ketchup 5.2.0-SNAPSHOT → 5.2.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 (151) hide show
  1. package/dist/cjs/{cell-utils-5b16c180.js → cell-utils-153fb565.js} +2 -2
  2. package/dist/cjs/{f-button-3b9f32af.js → f-button-8f07d095.js} +2 -2
  3. package/dist/cjs/{f-cell-c6ad973a.js → f-cell-c08ad501.js} +8 -96
  4. package/dist/cjs/{f-chip-bed86c4a.js → f-chip-aa8d9253.js} +3 -3
  5. package/dist/cjs/{f-image-08a3d340.js → f-image-42025f08.js} +2 -2
  6. package/dist/cjs/f-text-field-b6300c8a.js +94 -0
  7. package/dist/cjs/f-text-field-mdc-a67f5dfe.js +2852 -0
  8. package/dist/cjs/{index-8d7bb3be.js → index-eb556444.js} +2 -0
  9. package/dist/cjs/ketchup.cjs.js +3 -3
  10. package/dist/cjs/kup-accordion.cjs.entry.js +4 -4
  11. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +455 -3068
  12. package/dist/cjs/kup-calendar.cjs.entry.js +7 -7
  13. package/dist/cjs/kup-cell.cjs.entry.js +8 -7
  14. package/dist/cjs/kup-dash-list.cjs.entry.js +4 -4
  15. package/dist/cjs/kup-dash_2.cjs.entry.js +3 -3
  16. package/dist/cjs/kup-drawer.cjs.entry.js +4 -4
  17. package/dist/cjs/kup-echart.cjs.entry.js +4 -4
  18. package/dist/cjs/kup-field.cjs.entry.js +2 -2
  19. package/dist/cjs/kup-form-editor.cjs.entry.js +404 -0
  20. package/dist/cjs/kup-iframe.cjs.entry.js +3 -3
  21. package/dist/cjs/kup-lazy.cjs.entry.js +3 -3
  22. package/dist/cjs/kup-magic-box.cjs.entry.js +4 -4
  23. package/dist/cjs/{kup-manager-4227f0a2.js → kup-manager-04dc9671.js} +8391 -332
  24. package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
  25. package/dist/cjs/kup-numeric-picker.cjs.entry.js +423 -0
  26. package/dist/cjs/kup-photo-frame.cjs.entry.js +3 -3
  27. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  28. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  29. package/dist/cjs/kup-snackbar.cjs.entry.js +6 -6
  30. package/dist/cjs/loader.cjs.js +3 -3
  31. package/dist/cjs/{utils-b9df398c.js → utils-a201de8b.js} +1 -1
  32. package/dist/collection/assets/data-table.js +44 -0
  33. package/dist/collection/assets/form-editor.js +338 -0
  34. package/dist/collection/assets/index.js +12 -0
  35. package/dist/collection/assets/kuptooltip.js +608 -0
  36. package/dist/collection/collection-manifest.json +3 -1
  37. package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +10 -0
  38. package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +1 -2
  39. package/dist/collection/components/kup-card/built-in/kup-card-numeric.js +153 -0
  40. package/dist/collection/components/kup-card/kup-card.css +35 -0
  41. package/dist/collection/components/kup-card/kup-card.js +2 -2
  42. package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
  43. package/dist/collection/components/kup-data-table/kup-data-table.js +44 -12
  44. package/dist/collection/components/kup-date-picker/kup-date-picker.js +1 -1
  45. package/dist/collection/components/kup-drawer/kup-drawer.css +1 -0
  46. package/dist/collection/components/kup-form-editor/kup-form-editor-declarations.js +23 -0
  47. package/dist/collection/components/kup-form-editor/kup-form-editor.css +80 -0
  48. package/dist/collection/components/kup-form-editor/kup-form-editor.js +561 -0
  49. package/dist/collection/components/kup-numeric-picker/kup-numeric-picker-declarations.js +16 -0
  50. package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.css +50 -0
  51. package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +895 -0
  52. package/dist/collection/components/kup-snackbar/kup-snackbar.css +4 -0
  53. package/dist/collection/components/kup-tree/kup-tree.css +10 -3
  54. package/dist/collection/components/kup-tree/kup-tree.js +75 -13
  55. package/dist/collection/managers/kup-debug/kup-debug.js +1 -0
  56. package/dist/collection/managers/kup-manager/kup-manager.js +28 -1
  57. package/dist/collection/managers/kup-math/kup-math.js +11 -1
  58. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +3 -0
  59. package/dist/collection/managers/kup-tooltip/kup-tooltip-declarations.js +1 -0
  60. package/dist/collection/managers/kup-tooltip/kup-tooltip.js +191 -0
  61. package/dist/collection/types/GenericTypes.js +2 -0
  62. package/dist/collection/utils/kup-column-menu/kup-column-menu.js +1 -1
  63. package/dist/esm/{cell-utils-69f75e2e.js → cell-utils-55b4278f.js} +2 -2
  64. package/dist/esm/{f-button-7e7607d8.js → f-button-ea5059eb.js} +2 -2
  65. package/dist/esm/{f-cell-e4d83c27.js → f-cell-d767085a.js} +8 -95
  66. package/dist/esm/{f-chip-51dfefaf.js → f-chip-e99f71a0.js} +3 -3
  67. package/dist/esm/{f-image-de331954.js → f-image-7bea0647.js} +2 -2
  68. package/dist/esm/f-text-field-662a1d4b.js +92 -0
  69. package/dist/esm/f-text-field-mdc-9fbbefc3.js +2850 -0
  70. package/dist/esm/{index-aeec9835.js → index-baeab1ac.js} +2 -1
  71. package/dist/esm/ketchup.js +3 -3
  72. package/dist/esm/kup-accordion.entry.js +4 -4
  73. package/dist/esm/kup-autocomplete_27.entry.js +439 -3052
  74. package/dist/esm/kup-calendar.entry.js +7 -7
  75. package/dist/esm/kup-cell.entry.js +8 -7
  76. package/dist/esm/kup-dash-list.entry.js +4 -4
  77. package/dist/esm/kup-dash_2.entry.js +3 -3
  78. package/dist/esm/kup-drawer.entry.js +4 -4
  79. package/dist/esm/kup-echart.entry.js +4 -4
  80. package/dist/esm/kup-field.entry.js +2 -2
  81. package/dist/esm/kup-form-editor.entry.js +400 -0
  82. package/dist/esm/kup-iframe.entry.js +3 -3
  83. package/dist/esm/kup-lazy.entry.js +3 -3
  84. package/dist/esm/kup-magic-box.entry.js +4 -4
  85. package/dist/esm/{kup-manager-0ab94726.js → kup-manager-25d71df2.js} +8391 -332
  86. package/dist/esm/kup-nav-bar.entry.js +3 -3
  87. package/dist/esm/kup-numeric-picker.entry.js +419 -0
  88. package/dist/esm/kup-photo-frame.entry.js +3 -3
  89. package/dist/esm/kup-probe.entry.js +2 -2
  90. package/dist/esm/kup-qlik.entry.js +2 -2
  91. package/dist/esm/kup-snackbar.entry.js +6 -6
  92. package/dist/esm/loader.js +3 -3
  93. package/dist/esm/{utils-35c7a90d.js → utils-e4ea8310.js} +1 -1
  94. package/dist/ketchup/ketchup.esm.js +1 -1
  95. package/dist/ketchup/{p-67c64257.entry.js → p-04a941d9.entry.js} +1 -1
  96. package/dist/ketchup/{p-fea316ab.entry.js → p-12e5c8b7.entry.js} +1 -1
  97. package/dist/ketchup/{p-b5e1dbfa.entry.js → p-1e727a6c.entry.js} +1 -1
  98. package/dist/ketchup/{p-24df4f29.entry.js → p-2d322313.entry.js} +1 -1
  99. package/dist/ketchup/{p-8be1337b.js → p-34b74425.js} +1 -1
  100. package/dist/ketchup/p-38dbf4b3.entry.js +1 -0
  101. package/dist/ketchup/{p-5d190cf5.js → p-3b867a04.js} +1 -1
  102. package/dist/ketchup/{p-3813281b.entry.js → p-3e4a0ce7.entry.js} +1 -1
  103. package/dist/ketchup/{p-f9c41e20.entry.js → p-423f8dd0.entry.js} +1 -1
  104. package/dist/ketchup/p-44ffd4c9.js +30 -0
  105. package/dist/ketchup/{p-33073f4a.js → p-52aaf54a.js} +1 -1
  106. package/dist/ketchup/p-5969f1e8.entry.js +9 -0
  107. package/dist/ketchup/p-65c045fa.entry.js +1 -0
  108. package/dist/ketchup/{p-8f735633.entry.js → p-700b2d70.entry.js} +1 -1
  109. package/dist/ketchup/{p-68fc1428.entry.js → p-72ce09e3.entry.js} +1 -1
  110. package/dist/ketchup/p-76cffe8d.js +1 -0
  111. package/dist/ketchup/{p-96101f09.entry.js → p-787615f8.entry.js} +1 -1
  112. package/dist/ketchup/p-8bd00b7f.entry.js +1 -0
  113. package/dist/ketchup/p-937cd436.js +1 -0
  114. package/dist/ketchup/{p-3445be1e.entry.js → p-95754af8.entry.js} +1 -1
  115. package/dist/ketchup/{p-d7af8156.entry.js → p-9a3c41c2.entry.js} +1 -1
  116. package/dist/ketchup/p-a341d44c.entry.js +1 -0
  117. package/dist/ketchup/{p-9bcda66f.entry.js → p-af8dad7a.entry.js} +1 -1
  118. package/dist/ketchup/{p-0751aaf6.entry.js → p-dacd04a5.entry.js} +1 -1
  119. package/dist/ketchup/{p-10c8d755.js → p-dae6ef38.js} +1 -1
  120. package/dist/ketchup/{p-c314b1e6.js → p-e20d4661.js} +1 -1
  121. package/dist/ketchup/p-ecb7069b.js +135 -0
  122. package/dist/ketchup/{p-4081f5f7.entry.js → p-f4fbf6df.entry.js} +1 -1
  123. package/dist/ketchup/p-ffa8ad2d.js +1 -0
  124. package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +7 -0
  125. package/dist/types/components/kup-card/built-in/kup-card-numeric.d.ts +2 -0
  126. package/dist/types/components/kup-card/kup-card-declarations.d.ts +26 -1
  127. package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +2 -0
  128. package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
  129. package/dist/types/components/kup-data-table/kup-data-table.d.ts +4 -0
  130. package/dist/types/components/kup-form-editor/kup-form-editor-declarations.d.ts +79 -0
  131. package/dist/types/components/kup-form-editor/kup-form-editor.d.ts +72 -0
  132. package/dist/types/components/kup-numeric-picker/kup-numeric-picker-declarations.d.ts +19 -0
  133. package/dist/types/components/kup-numeric-picker/kup-numeric-picker.d.ts +121 -0
  134. package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +1 -1
  135. package/dist/types/components/kup-tree/kup-tree.d.ts +1 -1
  136. package/dist/types/components.d.ts +196 -1
  137. package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +12 -0
  138. package/dist/types/managers/kup-manager/kup-manager.d.ts +14 -0
  139. package/dist/types/managers/kup-math/kup-math-declarations.d.ts +6 -0
  140. package/dist/types/managers/kup-math/kup-math.d.ts +2 -1
  141. package/dist/types/managers/kup-tooltip/kup-tooltip-declarations.d.ts +8 -0
  142. package/dist/types/managers/kup-tooltip/kup-tooltip.d.ts +40 -0
  143. package/dist/types/types/GenericTypes.d.ts +2 -0
  144. package/package.json +4 -3
  145. package/CHANGELOG.md +0 -5
  146. package/dist/ketchup/p-2d4f19f4.js +0 -1
  147. package/dist/ketchup/p-3aab1f0d.entry.js +0 -1
  148. package/dist/ketchup/p-47b57d97.js +0 -1
  149. package/dist/ketchup/p-5186885c.entry.js +0 -1
  150. package/dist/ketchup/p-78223dc0.entry.js +0 -143
  151. package/dist/ketchup/p-ee33cbe9.js +0 -9
@@ -5,6 +5,7 @@
5
5
  display: block;
6
6
  left: 0;
7
7
  outline: none;
8
+ pointer-events: none;
8
9
  position: fixed;
9
10
  transition: opacity 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms, transform 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms, -webkit-transform 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms;
10
11
  width: 100%;
@@ -37,6 +38,7 @@
37
38
  }
38
39
  .snackbar__text {
39
40
  padding: 14px 16px;
41
+ pointer-events: all;
40
42
  white-space: nowrap;
41
43
  }
42
44
  .snackbar__buttons {
@@ -49,11 +51,13 @@
49
51
  display: flex;
50
52
  justify-content: flex-end;
51
53
  margin-right: 8px;
54
+ pointer-events: all;
52
55
  width: 100%;
53
56
  }
54
57
  .snackbar__close {
55
58
  --kup-button-font-size: 11px;
56
59
  margin-left: 8px;
60
+ pointer-events: all;
57
61
  }
58
62
 
59
63
  @keyframes snackbar-show {
@@ -2,6 +2,7 @@
2
2
  * @prop --kup-tree-border: Sets border of the component.
3
3
  * @prop --kup-tree-color: Sets text color of the component.
4
4
  * @prop --kup-tree-color-rgb: Sets text color RGB values of the component (used for shaders).
5
+ * @prop --kup-tree-filter-background-color: Sets the background color of the global filter.
5
6
  * @prop --kup-tree-font-family: Sets font family of the component.
6
7
  * @prop --kup-tree-font-family-monospace: Sets monospace font family of the component (for number cells).
7
8
  * @prop --kup-tree-font-size: Sets font size of the component.
@@ -17,6 +18,7 @@
17
18
  --kup_tree_color: var(--kup-tree-color, var(--kup-text-color));
18
19
  --kup_tree_color_rgb: var(--kup-tree-color-rgb, var(--kup-text-color-rgb));
19
20
  --kup_tree_font_family: var(--kup-tree-font-family, var(--kup-font-family));
21
+ --kup_tree_filter_background_color: var(--kup-tree-filter-background-color, var(--kup-background-color));
20
22
  --kup_tree_font_family_monospace: var(
21
23
  --kup-tree-font-family-monospace,
22
24
  var(--kup-font-family-monospace)
@@ -79,9 +81,6 @@
79
81
  .wrapper {
80
82
  overflow-x: auto;
81
83
  }
82
- .wrapper #global-filter {
83
- margin-bottom: 1em;
84
- }
85
84
  .wrapper .kup-tree {
86
85
  border-collapse: collapse;
87
86
  width: max-content;
@@ -185,6 +184,14 @@
185
184
  border-bottom: solid 1px var(--kup-border-color);
186
185
  }
187
186
 
187
+ #global-filter {
188
+ background: var(--kup_tree_filter_background_color);
189
+ margin-bottom: 1em;
190
+ position: sticky;
191
+ top: 0;
192
+ z-index: 1;
193
+ }
194
+
188
195
  .first-node .cell-content {
189
196
  font-weight: bold;
190
197
  }
@@ -182,7 +182,6 @@ export class KupTree {
182
182
  * Reference to the column menu card.
183
183
  */
184
184
  this.columnMenuCard = null;
185
- this.selectedColumn = '';
186
185
  this.clickTimeout = [];
187
186
  this.sizedColumns = undefined;
188
187
  this.filtersColumnMenuInstance = new FiltersColumnMenu();
@@ -558,8 +557,48 @@ export class KupTree {
558
557
  this.closeTotalMenu();
559
558
  this.openTotalMenu(column);
560
559
  }
561
- getEventDetails(el) {
562
- const isHeader = !!el.closest('thead'), isBody = !!el.closest('tbody'), isFooter = !!el.closest('tfoot'), td = el.closest('td'), th = el.closest('th'), tr = el.closest('tr'), filterRemove = el.closest('th .filter-remove');
560
+ getEventDetails(path) {
561
+ let isHeader, isBody, isFooter, td, th, tr, filterRemove;
562
+ if (path) {
563
+ for (let i = path.length - 1; i >= 0; i--) {
564
+ let p = path[i];
565
+ if (!p.tagName) {
566
+ continue;
567
+ }
568
+ switch (p.tagName.toUpperCase()) {
569
+ case 'THEAD': {
570
+ isHeader = true;
571
+ break;
572
+ }
573
+ case 'TBODY': {
574
+ isBody = true;
575
+ break;
576
+ }
577
+ case 'TFOOT': {
578
+ isFooter = true;
579
+ break;
580
+ }
581
+ case 'TD': {
582
+ td = p;
583
+ break;
584
+ }
585
+ case 'TH': {
586
+ th = p;
587
+ break;
588
+ }
589
+ case 'TR': {
590
+ tr = p;
591
+ break;
592
+ }
593
+ default: {
594
+ if (p.classList.contains(KupThemeIconValues.FILTER_REMOVE.replace('--', ''))) {
595
+ filterRemove = p;
596
+ }
597
+ break;
598
+ }
599
+ }
600
+ }
601
+ }
563
602
  let cell = null, column = null, row = null;
564
603
  if (isBody) {
565
604
  if (td) {
@@ -598,7 +637,7 @@ export class KupTree {
598
637
  }
599
638
  contextMenuHandler(e) {
600
639
  e.preventDefault();
601
- const details = this.getEventDetails(e.target);
640
+ const details = this.getEventDetails(this.getEventPath(e.target));
602
641
  if (details.area === 'header') {
603
642
  if (details.th && details.column) {
604
643
  this.openColumnMenu(details.column.name);
@@ -614,6 +653,18 @@ export class KupTree {
614
653
  }
615
654
  return details;
616
655
  }
656
+ getEventPath(currentEl) {
657
+ const path = [];
658
+ while (currentEl &&
659
+ currentEl !== this.rootElement &&
660
+ currentEl !== document.body) {
661
+ path.push(currentEl);
662
+ currentEl = currentEl.parentNode
663
+ ? currentEl.parentNode
664
+ : currentEl.host;
665
+ }
666
+ return path;
667
+ }
617
668
  // When a TreeNode can be selected
618
669
  hdlTreeNodeClick(e, treeNodeData, treeNodePath, auto) {
619
670
  unsetTooltip(this.tooltip);
@@ -621,6 +672,12 @@ export class KupTree {
621
672
  KupTreeExpansionMode.DROPDOWN ||
622
673
  (this.expansionMode.toLowerCase() === KupTreeExpansionMode.NODE &&
623
674
  !treeNodeData.expandable)) {
675
+ const td = e
676
+ ? this.getEventPath(e.target).find((el) => {
677
+ if (el.tagName === 'TD')
678
+ return el;
679
+ })
680
+ : null;
624
681
  // If this TreeNode is not disabled, then it can be selected and an event is emitted
625
682
  if (treeNodeData && !treeNodeData.disabled) {
626
683
  if (this.autoSelectionNodeMode)
@@ -634,11 +691,10 @@ export class KupTree {
634
691
  .split(',')
635
692
  .map((treeNodeIndex) => parseInt(treeNodeIndex)),
636
693
  treeNode: treeNodeData,
637
- columnName: this.selectedColumn,
694
+ columnName: td ? td.dataset.column : null,
638
695
  auto: auto,
639
696
  });
640
697
  }
641
- this.selectedColumn = '';
642
698
  }
643
699
  // If KupTreeExpansionMode.NODE then click is a collapse/expand click
644
700
  if (this.expansionMode.toLowerCase() === KupTreeExpansionMode.NODE) {
@@ -1013,13 +1069,20 @@ export class KupTree {
1013
1069
  }
1014
1070
  // When can be expanded OR selected
1015
1071
  if (!treeNodeData.disabled) {
1016
- treeNodeOptions['onClick'] = () => {
1017
- this.clickTimeout.push(setTimeout((e) => this.hdlTreeNodeClick(e, treeNodeData, treeNodePath, false), 300));
1072
+ treeNodeOptions['onClick'] = (e) => {
1073
+ // Note: event must be cloned
1074
+ // otherwise inside setTimeout will be exiting the Shadow DOM scope(causing loss of information, including target).
1075
+ const clone = {};
1076
+ for (const key in e) {
1077
+ clone[key] = e[key];
1078
+ }
1079
+ this.clickTimeout.push(setTimeout(() => this.hdlTreeNodeClick(clone, treeNodeData, treeNodePath, false), 300));
1018
1080
  };
1019
1081
  }
1020
1082
  // When a tree node is displayed as a table
1021
1083
  let treeNodeCells = null;
1022
1084
  let visibleCols = this.getVisibleColumns();
1085
+ const _hasTooltip = !this.kupManager.objects.isEmptyKupObj(treeNodeData.obj);
1023
1086
  if (this.showColumns && visibleCols && visibleCols.length) {
1024
1087
  treeNodeCells = [];
1025
1088
  // Renders all the cells
@@ -1039,7 +1102,7 @@ export class KupTree {
1039
1102
  row: treeNodeData,
1040
1103
  setSizes: true,
1041
1104
  };
1042
- treeNodeCells.push(h("td", { class: `grid-cell` },
1105
+ treeNodeCells.push(h("td", Object.assign({ class: `grid-cell`, "data-column": column.name }, this.getToolTipEventHandlers(treeNodeData, cell, _hasTooltip), { "data-cell": cell }),
1043
1106
  h(FCell, Object.assign({}, cellProps))));
1044
1107
  }
1045
1108
  else {
@@ -1047,7 +1110,6 @@ export class KupTree {
1047
1110
  }
1048
1111
  }
1049
1112
  }
1050
- const _hasTooltip = !this.kupManager.objects.isEmptyKupObj(treeNodeData.obj);
1051
1113
  let title = undefined;
1052
1114
  if (_hasTooltip && this.kupManager.debug.isDebug()) {
1053
1115
  title =
@@ -1079,7 +1141,7 @@ export class KupTree {
1079
1141
  'is-obj': !this.kupManager.objects.isEmptyKupObj(treeNodeData.obj),
1080
1142
  }, style: treeNodeData.style || null, title: title, onDblClick: () => {
1081
1143
  this.onKupTreeNodeDblClick(treeNodeData, treeNodePath);
1082
- } }, this.getToolTipEventHandlers(treeNodeData, cell, _hasTooltip)), this.asAccordion && !treeNodeDepth
1144
+ } }, this.getToolTipEventHandlers(treeNodeData, cell, _hasTooltip), { "data-row": treeNodeData }), this.asAccordion && !treeNodeDepth
1083
1145
  ? [
1084
1146
  treeNodeIcon,
1085
1147
  content,
@@ -1094,7 +1156,7 @@ export class KupTree {
1094
1156
  'kup-tree__node--first': treeNodeDepth ? false : true,
1095
1157
  'kup-tree__node--selected': !treeNodeData.disabled &&
1096
1158
  treeNodePath === this.selectedNodeString,
1097
- }, "data-tree-path": treeNodePath }, treeNodeOptions),
1159
+ }, "data-row": treeNodeData, "data-tree-path": treeNodePath }, treeNodeOptions),
1098
1160
  treeNodeCell,
1099
1161
  treeNodeCells));
1100
1162
  }
@@ -1429,9 +1491,9 @@ export class KupTree {
1429
1491
  return (h(Host, null,
1430
1492
  h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)),
1431
1493
  h("div", { id: componentWrapperId, class: wrapperClass },
1494
+ filterField,
1432
1495
  h("div", { class: "wrapper", ref: (el) => (this.treeWrapperRef =
1433
1496
  el) },
1434
- filterField,
1435
1497
  h("table", { class: "kup-tree", "data-show-columns": this.showColumns, onContextMenu: (e) => {
1436
1498
  e.preventDefault();
1437
1499
  } },
@@ -279,6 +279,7 @@ export class KupDebug {
279
279
  break;
280
280
  case 'kup-debug-locale-changer':
281
281
  dom.ketchup.dates.setLocale(compEvent.detail.value);
282
+ dom.ketchup.math.setLocale(compEvent.detail.value);
282
283
  break;
283
284
  case 'kup-debug-theme-changer':
284
285
  dom.ketchup.theme.set(compEvent.detail.value);
@@ -15,6 +15,9 @@ import { KupDebugCategory } from '../kup-debug/kup-debug-declarations';
15
15
  import { KupSearch } from '../kup-search/kup-search';
16
16
  import { KupMathLocales } from '../kup-math/kup-math-declarations';
17
17
  import { KupMath } from '../kup-math/kup-math';
18
+ import { KupTooltip } from '../kup-tooltip/kup-tooltip';
19
+ import { setAssetPath } from '@stencil/core';
20
+ import html2canvas from 'html2canvas';
18
21
  const dom = document.documentElement;
19
22
  /**
20
23
  * This class controls every other Ketchup utility suite.
@@ -25,8 +28,9 @@ export class KupManager {
25
28
  * Initializes KupManager.
26
29
  */
27
30
  constructor(overrides) {
28
- let datesLocale = null, debugActive = null, debugAutoprint = null, debugLogLimit = null, dialogRestrictContainer = null, dialogZIndex = null, languageList = null, languageName = null, objectsList = null, scrollOnHoverDelay = null, scrollOnHoverStep = null, themeList = null, themeName = null;
31
+ let datesLocale = null, debugActive = null, debugAutoprint = null, debugLogLimit = null, dialogRestrictContainer = null, dialogZIndex = null, languageList = null, languageName = null, objectsList = null, scrollOnHoverDelay = null, scrollOnHoverStep = null, themeList = null, themeName = null, tooltipDelay = null;
29
32
  if (overrides) {
33
+ const assetsPath = overrides.assetsPath;
30
34
  const dates = overrides.dates;
31
35
  const debug = overrides.debug;
32
36
  const interact = overrides.interact;
@@ -34,6 +38,10 @@ export class KupManager {
34
38
  const objects = overrides.objects;
35
39
  const scrollOnHover = overrides.scrollOnHover;
36
40
  const theme = overrides.theme;
41
+ const tooltip = overrides.tooltip;
42
+ if (assetsPath) {
43
+ setAssetPath(assetsPath);
44
+ }
37
45
  if (dates) {
38
46
  datesLocale = dates.locale ? dates.locale : null;
39
47
  }
@@ -67,6 +75,9 @@ export class KupManager {
67
75
  themeList = theme.list ? theme.list : null;
68
76
  themeName = theme.name ? theme.name : null;
69
77
  }
78
+ if (tooltip) {
79
+ tooltipDelay = tooltip.delay ? tooltip.delay : null;
80
+ }
70
81
  }
71
82
  this.data = new KupData();
72
83
  this.dates = new KupDates(datesLocale);
@@ -102,6 +113,7 @@ export class KupManager {
102
113
  };
103
114
  this.theme = new KupTheme(themeList, themeName);
104
115
  this.toolbar = new KupToolbar();
116
+ this.tooltip = new KupTooltip(tooltipDelay);
105
117
  document.addEventListener('pointerdown', (e) => {
106
118
  const paths = e.composedPath();
107
119
  const lastString = paths[0].innerText || paths[0].value;
@@ -218,6 +230,21 @@ export class KupManager {
218
230
  this.utilities.clickCallbacks.add(cb);
219
231
  }
220
232
  }
233
+ /**
234
+ * Rasterizes an HTMLElement, transforming into a canvas.
235
+ * @param {HTMLElement} el - Element to rasterize.
236
+ * @returns {HTMLCanvasElement} - Canvas created from the HTMLElement.
237
+ *
238
+ * CSS Mask is not supported:
239
+ * @see https://github.com/niklasvh/html2canvas/issues/2814
240
+ * Warning in console about sourcemap, claimed to be solved here but...:
241
+ * @see https://github.com/niklasvh/html2canvas/pull/2787/files
242
+ */
243
+ async rasterize(el, options) {
244
+ return html2canvas(el, options).then((canvas) => {
245
+ return canvas;
246
+ });
247
+ }
221
248
  /**
222
249
  * Removes the given click callback.
223
250
  * @param {KupManagerClickCb} cb - The callback to remove.
@@ -6,7 +6,7 @@ import 'numeral/locales/it';
6
6
  import 'numeral/locales/pl';
7
7
  import 'numeral/locales/ru';
8
8
  import { KupDebugCategory } from '../kup-debug/kup-debug-declarations';
9
- import { KupMathLocales } from './kup-math-declarations';
9
+ import { KupMathLocales, } from './kup-math-declarations';
10
10
  import { customFormula, normalDistributionFormula } from './kup-math-helper';
11
11
  const dom = document.documentElement;
12
12
  /**
@@ -26,6 +26,16 @@ export class KupMath {
26
26
  return normalDistributionFormula(average, variance, x);
27
27
  },
28
28
  };
29
+ this.numbers = {
30
+ toLocaleString(value) {
31
+ const maximumFractionDigits = 14;
32
+ if (value == null || value == '')
33
+ return value;
34
+ return Number(value).toLocaleString(dom.ketchup.math.locale, {
35
+ maximumFractionDigits: maximumFractionDigits,
36
+ });
37
+ },
38
+ };
29
39
  this.locale = locale ? locale : KupMathLocales.en;
30
40
  this.managedComponents = new Set();
31
41
  this.numeral = numeral;
@@ -14,6 +14,7 @@ export const fButtonUsers = [
14
14
  KupTagNames.CARD,
15
15
  KupTagNames.DATA_TABLE,
16
16
  KupTagNames.DROPDOWN_BUTTON,
17
+ KupTagNames.FORM_EDITOR,
17
18
  KupTagNames.SNACKBAR,
18
19
  ];
19
20
  /**
@@ -62,6 +63,7 @@ export const fImageUsers = [
62
63
  KupTagNames.CHIP,
63
64
  KupTagNames.DATA_TABLE,
64
65
  KupTagNames.DROPDOWN_BUTTON,
66
+ KupTagNames.FORM_EDITOR,
65
67
  KupTagNames.IMAGE,
66
68
  KupTagNames.LIST,
67
69
  KupTagNames.MAGIC_BOX,
@@ -88,6 +90,7 @@ export const fTextFieldUsers = [
88
90
  KupTagNames.COMBOBOX,
89
91
  KupTagNames.DATA_TABLE,
90
92
  KupTagNames.DATE_PICKER,
93
+ KupTagNames.NUMERIC_PICKER,
91
94
  KupTagNames.TEXT_FIELD,
92
95
  KupTagNames.TIME_PICKER,
93
96
  KupTagNames.TREE,
@@ -0,0 +1,191 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7
+ if (kind === "m") throw new TypeError("Private method is not writable");
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
+ };
12
+ var _KupTooltip_instances, _KupTooltip_clickCb, _KupTooltip_dynPos, _KupTooltip_create, _KupTooltip_setOptions;
13
+ import { KupDebugCategory } from '../kup-debug/kup-debug-declarations';
14
+ const dom = document.documentElement;
15
+ /**
16
+ * Handles application-wide tooltip using card component.
17
+ * @module KupTooltip
18
+ */
19
+ export class KupTooltip {
20
+ /**
21
+ * Initializes KupTooltip.
22
+ */
23
+ constructor(delay) {
24
+ _KupTooltip_instances.add(this);
25
+ this.currentAnchor = null;
26
+ this.delay = null;
27
+ this.element = null;
28
+ this.managedElements = null;
29
+ this.timeout = null;
30
+ _KupTooltip_clickCb.set(this, null);
31
+ this.delay = delay ? delay : 125;
32
+ this.managedElements = new Set();
33
+ document.addEventListener('pointermove', (e) => {
34
+ const paths = e.composedPath();
35
+ // Leaving the function when hovering on the tooltip itself
36
+ if (paths.includes(this.element)) {
37
+ return;
38
+ }
39
+ const enterHandler = (anchor) => {
40
+ this.timeout = null;
41
+ requestAnimationFrame(anchor.kupTooltip.enter.bind(anchor.kupTooltip.enter, e));
42
+ };
43
+ const overHandler = (anchor) => {
44
+ requestAnimationFrame(anchor.kupTooltip.over.bind(anchor.kupTooltip.over, e));
45
+ };
46
+ const leaveHandler = () => {
47
+ requestAnimationFrame(this.currentAnchor.kupTooltip.leave.bind(this.currentAnchor.kupTooltip.leave, e));
48
+ };
49
+ // If the current anchor exists and is not included in the event path,
50
+ // the leaving callback is fired.
51
+ if (this.currentAnchor && !paths.includes(this.currentAnchor)) {
52
+ if (this.timeout) {
53
+ clearTimeout(this.timeout);
54
+ this.timeout = null;
55
+ }
56
+ else {
57
+ if (this.currentAnchor.kupTooltip.leave) {
58
+ leaveHandler();
59
+ }
60
+ }
61
+ this.currentAnchor = null;
62
+ }
63
+ else if (!this.timeout) {
64
+ for (let index = 0; index < paths.length; index++) {
65
+ const element = paths[index];
66
+ if (this.managedElements.has(element)) {
67
+ // If the current anchor is the same as the registered element found
68
+ // in the path, the mouse over function is invoked
69
+ if (this.currentAnchor === element) {
70
+ if (element.kupTooltip.over) {
71
+ overHandler(element);
72
+ }
73
+ // Otherwise, the mouse enter callback will be invoked
74
+ }
75
+ else {
76
+ this.currentAnchor = element;
77
+ if (element.kupTooltip.enter) {
78
+ if (this.delay) {
79
+ this.timeout = setTimeout(enterHandler.bind(enterHandler, element), this.delay);
80
+ }
81
+ else {
82
+ enterHandler(element);
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ });
90
+ }
91
+ hide() {
92
+ if (this.element) {
93
+ this.element.menuVisible = false;
94
+ dom.ketchup.dynamicPosition.stop(this.element);
95
+ dom.ketchup.removeClickCallback(__classPrivateFieldGet(this, _KupTooltip_clickCb, "f"));
96
+ }
97
+ }
98
+ show(anchor, options) {
99
+ // Creates the card or updates it with new options
100
+ if (!this.element) {
101
+ __classPrivateFieldGet(this, _KupTooltip_instances, "m", _KupTooltip_create).call(this, options);
102
+ }
103
+ else if (options) {
104
+ __classPrivateFieldGet(this, _KupTooltip_instances, "m", _KupTooltip_setOptions).call(this, options);
105
+ }
106
+ // If an anchor was provided, initializes or updates dynamic positioning
107
+ if (anchor) {
108
+ __classPrivateFieldGet(this, _KupTooltip_instances, "m", _KupTooltip_dynPos).call(this, anchor);
109
+ }
110
+ // If the tooltip is already visible, it's pointless to go on
111
+ if (this.element.menuVisible) {
112
+ return;
113
+ }
114
+ // If the dynamic positioning is still to be registered, a warning is thrown
115
+ if (!dom.ketchup.dynamicPosition.isRegistered(this.element)) {
116
+ dom.ketchup.debug.logMessage('kup-tooltip', 'Unable to display KupTooltip without specifying a valid anchor point.', KupDebugCategory.WARNING);
117
+ return;
118
+ }
119
+ this.element.menuVisible = true;
120
+ dom.ketchup.addClickCallback(__classPrivateFieldGet(this, _KupTooltip_clickCb, "f"), true);
121
+ }
122
+ /**
123
+ * Returns whether an element was previously registered or not.
124
+ * @param {KupTooltipAnchor} element - Element to test.
125
+ * @returns {boolean} True if the element was registered.
126
+ */
127
+ isRegistered(element) {
128
+ return !this.managedElements
129
+ ? false
130
+ : this.managedElements.has(element);
131
+ }
132
+ /**
133
+ * Registers an HTMLElement as KupTooltipAnchor, triggering callback invocation on mouse over.
134
+ * @param {KupTooltipAnchor} element - The HTML element to be registered.
135
+ * @param {(e: PointerEvent) => void} cbEnter - Callback invoked when hovering on the the element for the first time.
136
+ * @param {(e: PointerEvent) => void} cbOver - Callback invoked when hovering on the element.
137
+ * @param {(e: PointerEvent) => void} cbLeave - Callback invoked when leaving the element.
138
+ */
139
+ register(element, cbEnter, cbOver, cbLeave) {
140
+ this.managedElements.add(element);
141
+ const kupTooltip = {
142
+ enter: cbEnter,
143
+ leave: cbLeave,
144
+ over: cbOver,
145
+ };
146
+ element.kupTooltip = kupTooltip;
147
+ }
148
+ /**
149
+ * Unregisters an HTMLElement, preventing its attached callback from being invoked.
150
+ *
151
+ * @param {KupTooltipAnchor} element - - The HTML element to be unregistered.
152
+ */
153
+ unregister(element) {
154
+ if (this.managedElements) {
155
+ this.managedElements.delete(element);
156
+ }
157
+ }
158
+ }
159
+ _KupTooltip_clickCb = new WeakMap(), _KupTooltip_instances = new WeakSet(), _KupTooltip_dynPos = function _KupTooltip_dynPos(anchor) {
160
+ if (dom.ketchup.dynamicPosition.isRegistered(this.element)) {
161
+ dom.ketchup.dynamicPosition.changeAnchor(this.element, anchor);
162
+ }
163
+ else {
164
+ dom.ketchup.dynamicPosition.register(this.element, anchor, null, null, true);
165
+ }
166
+ dom.ketchup.dynamicPosition.start(this.element);
167
+ }, _KupTooltip_create = function _KupTooltip_create(options) {
168
+ this.element = document.createElement('kup-card');
169
+ this.element.id = 'kup-tooltip';
170
+ this.element.isMenu = true;
171
+ this.element.layoutNumber = 15;
172
+ this.element.sizeX = 'auto';
173
+ this.element.sizeY = 'auto';
174
+ if (options) {
175
+ __classPrivateFieldGet(this, _KupTooltip_instances, "m", _KupTooltip_setOptions).call(this, options);
176
+ }
177
+ document.body.appendChild(this.element);
178
+ __classPrivateFieldSet(this, _KupTooltip_clickCb, {
179
+ cb: () => {
180
+ this.hide();
181
+ },
182
+ el: this.element,
183
+ }, "f");
184
+ }, _KupTooltip_setOptions = function _KupTooltip_setOptions(options) {
185
+ for (const key in options) {
186
+ if (Object.prototype.hasOwnProperty.call(options, key)) {
187
+ const prop = options[key];
188
+ this.element[key] = prop;
189
+ }
190
+ }
191
+ };
@@ -24,6 +24,7 @@ export var KupTagNames;
24
24
  KupTagNames["DRAWER"] = "KUP-DRAWER";
25
25
  KupTagNames["DROPDOWN_BUTTON"] = "KUP-DROPDOWN-BUTTON";
26
26
  KupTagNames["FIELD"] = "KUP-FIELD";
27
+ KupTagNames["FORM_EDITOR"] = "KUP-FORM-EDITOR";
27
28
  KupTagNames["GAUGE"] = "KUP-GAUGE";
28
29
  KupTagNames["GRID"] = "KUP-GRID";
29
30
  KupTagNames["IFRAME"] = "KUP-IFRAME";
@@ -32,6 +33,7 @@ export var KupTagNames;
32
33
  KupTagNames["LIST"] = "KUP-LIST";
33
34
  KupTagNames["MAGIC_BOX"] = "KUP-MAGIC-BOX";
34
35
  KupTagNames["NAV_BAR"] = "KUP-NAV-BAR";
36
+ KupTagNames["NUMERIC_PICKER"] = "KUP-NUMERIC-PICKER";
35
37
  KupTagNames["PROBE"] = "KUP-PROBE";
36
38
  KupTagNames["PROGRESS_BAR"] = "KUP-PROGRESS-BAR";
37
39
  KupTagNames["QLIK"] = "KUP-QLIK";
@@ -342,7 +342,7 @@ export class KupColumnMenu {
342
342
  let props = [];
343
343
  if (comp.showFilters) {
344
344
  if (this.filtersColumnMenuInstance.isColumnFiltrableByInterval(column)) {
345
- props.concat(this.prepIntervalTextfield(comp, column));
345
+ props = props.concat(this.prepIntervalTextfield(comp, column));
346
346
  }
347
347
  else if (dom.ketchup.objects.isStringObject(column.obj)) {
348
348
  let filterInitialValue = this.filtersColumnMenuInstance.getTextFilterValue(comp.filters, column.name);
@@ -1,5 +1,5 @@
1
- import { k as unformattedStringToFormattedStringNumber, m as unformattedStringToFormattedStringTime, o as unformattedStringToFormattedStringTimestamp, d as stringToNumber } from './utils-35c7a90d.js';
2
- import { d as KupDatesFormats } from './kup-manager-0ab94726.js';
1
+ import { k as unformattedStringToFormattedStringNumber, m as unformattedStringToFormattedStringTime, o as unformattedStringToFormattedStringTimestamp, d as stringToNumber } from './utils-e4ea8310.js';
2
+ import { d as KupDatesFormats } from './kup-manager-25d71df2.js';
3
3
 
4
4
  const dom = document.documentElement;
5
5
  // -------------
@@ -1,6 +1,6 @@
1
- import { h } from './index-aeec9835.js';
1
+ import { h } from './index-baeab1ac.js';
2
2
  import { F as FButtonStyling } from './f-button-declarations-b1b4cac4.js';
3
- import { F as FImage } from './f-image-de331954.js';
3
+ import { F as FImage } from './f-image-7bea0647.js';
4
4
 
5
5
  /*-------------------------------------------------*/
6
6
  /* C o m p o n e n t */