@sme.up/ketchup 6.2.0 → 6.3.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 (160) hide show
  1. package/dist/cjs/{f-button-5b69d882.js → f-button-94cb5f35.js} +2 -2
  2. package/dist/cjs/{f-cell-3a740c48.js → f-cell-76830a0d.js} +12 -14
  3. package/dist/cjs/{f-checkbox-57443ca3.js → f-checkbox-cd977193.js} +1 -1
  4. package/dist/cjs/{f-chip-02e83f82.js → f-chip-68d45fd3.js} +3 -3
  5. package/dist/cjs/{f-image-2a61ece2.js → f-image-0e71df7e.js} +2 -2
  6. package/dist/cjs/{f-paginator-utils-09126bdd.js → f-paginator-utils-46689c0a.js} +80 -403
  7. package/dist/cjs/{f-text-field-9ee20a67.js → f-text-field-b4229cef.js} +11 -3
  8. package/dist/cjs/{index-06b131ea.js → index-31125378.js} +9 -4
  9. package/dist/cjs/ketchup.cjs.js +3 -3
  10. package/dist/cjs/kup-accordion.cjs.entry.js +5 -6
  11. package/dist/cjs/kup-autocomplete_25.cjs.entry.js +116 -111
  12. package/dist/cjs/kup-box.cjs.entry.js +15 -17
  13. package/dist/cjs/kup-calendar.cjs.entry.js +9 -11
  14. package/dist/cjs/kup-cell.cjs.entry.js +9 -11
  15. package/dist/cjs/kup-dash-list.cjs.entry.js +5 -7
  16. package/dist/cjs/kup-dash_2.cjs.entry.js +4 -5
  17. package/dist/cjs/kup-dashboard.cjs.entry.js +76 -17
  18. package/dist/cjs/kup-drawer.cjs.entry.js +4 -5
  19. package/dist/cjs/kup-echart.cjs.entry.js +17 -19
  20. package/dist/cjs/kup-family-tree.cjs.entry.js +140 -64
  21. package/dist/cjs/kup-form.cjs.entry.js +10 -12
  22. package/dist/cjs/kup-iframe.cjs.entry.js +4 -5
  23. package/dist/cjs/kup-image-list.cjs.entry.js +10 -12
  24. package/dist/cjs/kup-lazy.cjs.entry.js +4 -5
  25. package/dist/cjs/kup-magic-box.cjs.entry.js +5 -6
  26. package/dist/cjs/{kup-manager-02acbb37.js → kup-manager-7c514a30.js} +1400 -369
  27. package/dist/cjs/kup-nav-bar.cjs.entry.js +4 -5
  28. package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
  29. package/dist/cjs/kup-photo-frame.cjs.entry.js +4 -5
  30. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  31. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  32. package/dist/cjs/kup-snackbar.cjs.entry.js +6 -7
  33. package/dist/cjs/loader.cjs.js +3 -3
  34. package/dist/collection/assets/dashboard.js +48 -0
  35. package/dist/collection/assets/family-tree.js +236 -19
  36. package/dist/collection/assets/index.js +4 -0
  37. package/dist/collection/assets/kupinteract.js +68 -0
  38. package/dist/collection/collection-manifest.json +5 -5
  39. package/dist/collection/components/kup-dashboard/kup-dashboard.css +7 -0
  40. package/dist/collection/components/kup-dashboard/kup-dashboard.js +67 -7
  41. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +42 -30
  42. package/dist/collection/components/kup-echart/kup-echart.js +9 -9
  43. package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +3 -1
  44. package/dist/collection/components/kup-family-tree/kup-family-tree.css +79 -9
  45. package/dist/collection/components/kup-family-tree/kup-family-tree.js +253 -65
  46. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
  47. package/dist/collection/components/kup-text-field/kup-text-field.js +27 -0
  48. package/dist/collection/f-components/f-text-field/f-text-field.js +9 -1
  49. package/dist/collection/managers/kup-data/kup-data-cell-helper.js +48 -15
  50. package/dist/collection/managers/kup-data/kup-data.js +5 -5
  51. package/dist/collection/managers/kup-interact/kup-interact.js +3 -5
  52. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.js +2 -0
  53. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover.js +131 -45
  54. package/dist/collection/utils/filters/filters-rows.js +4 -23
  55. package/dist/collection/utils/filters/filters-tree-items.js +2 -1
  56. package/dist/esm/{f-button-fd44ef70.js → f-button-cd948e50.js} +2 -2
  57. package/dist/esm/{f-cell-7b159a22.js → f-cell-474dd282.js} +6 -8
  58. package/dist/esm/{f-checkbox-c51c4a75.js → f-checkbox-e06cf07b.js} +1 -1
  59. package/dist/esm/{f-chip-c2e4c522.js → f-chip-d6f2eb94.js} +3 -3
  60. package/dist/esm/{f-image-2ab4b9aa.js → f-image-914a03ef.js} +2 -2
  61. package/dist/esm/{f-paginator-utils-ef537d82.js → f-paginator-utils-a4a52732.js} +44 -366
  62. package/dist/esm/{f-text-field-41c575eb.js → f-text-field-76341fe3.js} +11 -3
  63. package/dist/esm/{index-ad6ab214.js → index-e41330a5.js} +9 -4
  64. package/dist/esm/ketchup.js +3 -3
  65. package/dist/esm/kup-accordion.entry.js +3 -4
  66. package/dist/esm/kup-autocomplete_25.entry.js +17 -12
  67. package/dist/esm/kup-box.entry.js +9 -11
  68. package/dist/esm/kup-calendar.entry.js +5 -7
  69. package/dist/esm/kup-cell.entry.js +7 -9
  70. package/dist/esm/kup-dash-list.entry.js +2 -4
  71. package/dist/esm/kup-dash_2.entry.js +2 -3
  72. package/dist/esm/kup-dashboard.entry.js +74 -15
  73. package/dist/esm/kup-drawer.entry.js +2 -3
  74. package/dist/esm/kup-echart.entry.js +11 -13
  75. package/dist/esm/kup-family-tree.entry.js +138 -62
  76. package/dist/esm/kup-form.entry.js +7 -9
  77. package/dist/esm/kup-iframe.entry.js +2 -3
  78. package/dist/esm/kup-image-list.entry.js +8 -10
  79. package/dist/esm/kup-lazy.entry.js +2 -3
  80. package/dist/esm/kup-magic-box.entry.js +3 -4
  81. package/dist/esm/{kup-manager-22a475e6.js → kup-manager-86f440c7.js} +1379 -370
  82. package/dist/esm/kup-nav-bar.entry.js +2 -3
  83. package/dist/esm/kup-numeric-picker.entry.js +3 -3
  84. package/dist/esm/kup-photo-frame.entry.js +2 -3
  85. package/dist/esm/kup-probe.entry.js +2 -2
  86. package/dist/esm/kup-qlik.entry.js +2 -2
  87. package/dist/esm/kup-snackbar.entry.js +4 -5
  88. package/dist/esm/loader.js +3 -3
  89. package/dist/ketchup/ketchup.esm.js +1 -1
  90. package/dist/ketchup/p-00e1133d.entry.js +9 -0
  91. package/dist/ketchup/p-066f344a.entry.js +1 -0
  92. package/dist/ketchup/p-0c6e0647.entry.js +1 -0
  93. package/dist/ketchup/p-151f7c17.entry.js +27 -0
  94. package/dist/ketchup/p-1e9c03b0.entry.js +1 -0
  95. package/dist/ketchup/{p-fc2b1229.js → p-21ea11cb.js} +3 -3
  96. package/dist/ketchup/{p-1959f835.entry.js → p-2f4e6c50.entry.js} +1 -1
  97. package/dist/ketchup/p-3586f59c.js +1 -0
  98. package/dist/ketchup/p-359fd90d.entry.js +1 -0
  99. package/dist/ketchup/{p-38d7584e.js → p-389fd0bf.js} +1 -1
  100. package/dist/ketchup/{p-cd5cfa7c.js → p-5552f156.js} +1 -1
  101. package/dist/ketchup/{p-264b1b19.entry.js → p-77aff9c1.entry.js} +1 -1
  102. package/dist/ketchup/{p-e9366aaf.entry.js → p-7cfdf53c.entry.js} +4 -4
  103. package/dist/ketchup/p-853a5178.entry.js +1 -0
  104. package/dist/ketchup/{p-edae3076.js → p-8673bd4e.js} +1 -1
  105. package/dist/ketchup/p-8b55b786.entry.js +1 -0
  106. package/dist/ketchup/p-95f5834b.entry.js +1 -0
  107. package/dist/ketchup/p-a2c595c4.js +1 -0
  108. package/dist/ketchup/p-ae91f27e.entry.js +1 -0
  109. package/dist/ketchup/{p-928c5c36.js → p-af664379.js} +1 -1
  110. package/dist/ketchup/p-b0b3989b.js +2 -0
  111. package/dist/ketchup/p-b3b65a61.entry.js +1 -0
  112. package/dist/ketchup/p-bc306a53.entry.js +1 -0
  113. package/dist/ketchup/{p-42080355.entry.js → p-c3783b77.entry.js} +1 -1
  114. package/dist/ketchup/{p-dc62a30f.js → p-cd4fc3fb.js} +1 -1
  115. package/dist/ketchup/p-cee76b14.entry.js +1 -0
  116. package/dist/ketchup/p-cfaea29b.entry.js +1 -0
  117. package/dist/ketchup/p-d2f51e7b.entry.js +1 -0
  118. package/dist/ketchup/p-df8e6a4d.entry.js +1 -0
  119. package/dist/ketchup/p-e60a1170.entry.js +1 -0
  120. package/dist/ketchup/p-e9a1ba04.entry.js +1 -0
  121. package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +6 -1
  122. package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +7 -3
  123. package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +26 -5
  124. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +1 -0
  125. package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
  126. package/dist/types/components.d.ts +49 -7
  127. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
  128. package/dist/types/managers/kup-data/kup-data-cell-helper.d.ts +13 -6
  129. package/dist/types/managers/kup-data/kup-data.d.ts +2 -1
  130. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.d.ts +9 -1
  131. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover.d.ts +7 -5
  132. package/dist/types/utils/filters/filters-rows.d.ts +0 -2
  133. package/package.json +2 -2
  134. package/dist/cjs/cell-utils-fe64a28c.js +0 -168
  135. package/dist/cjs/utils-4b208b48.js +0 -447
  136. package/dist/esm/cell-utils-cb5d4149.js +0 -160
  137. package/dist/esm/utils-2c1f4122.js +0 -428
  138. package/dist/ketchup/p-06c6cc68.js +0 -1
  139. package/dist/ketchup/p-0dacd4bc.entry.js +0 -1
  140. package/dist/ketchup/p-1c44dc62.entry.js +0 -1
  141. package/dist/ketchup/p-4bc9f98b.entry.js +0 -1
  142. package/dist/ketchup/p-578583db.entry.js +0 -1
  143. package/dist/ketchup/p-5866d507.entry.js +0 -1
  144. package/dist/ketchup/p-61059e9d.entry.js +0 -9
  145. package/dist/ketchup/p-664be494.entry.js +0 -1
  146. package/dist/ketchup/p-67cd575d.entry.js +0 -1
  147. package/dist/ketchup/p-682a367a.js +0 -1
  148. package/dist/ketchup/p-6ccf7eb2.entry.js +0 -1
  149. package/dist/ketchup/p-7230ab97.entry.js +0 -1
  150. package/dist/ketchup/p-752b4cef.entry.js +0 -1
  151. package/dist/ketchup/p-7de3e7ac.entry.js +0 -1
  152. package/dist/ketchup/p-9b36497d.entry.js +0 -1
  153. package/dist/ketchup/p-b982d137.entry.js +0 -1
  154. package/dist/ketchup/p-c0219e5e.js +0 -1
  155. package/dist/ketchup/p-c55fd0a7.entry.js +0 -1
  156. package/dist/ketchup/p-d154b3a0.entry.js +0 -1
  157. package/dist/ketchup/p-d2affb6f.entry.js +0 -27
  158. package/dist/ketchup/p-d3b542b3.js +0 -2
  159. package/dist/ketchup/p-d6c12c6c.js +0 -1
  160. package/dist/ketchup/p-da0eab60.entry.js +0 -1
@@ -1,4 +1,11 @@
1
+ import { SortMode } from '../../components/kup-data-table/kup-data-table-declarations';
2
+ import { compareValues, getCellValueForDisplay, getValueForDisplay2, } from '../../utils/cell-utils';
3
+ import { Filters } from '../../utils/filters/filters';
4
+ import { KupObjects } from '../kup-objects/kup-objects';
1
5
  const dom = document.documentElement;
6
+ const kupObjects = dom.ketchup
7
+ ? dom.ketchup.objects
8
+ : new KupObjects();
2
9
  /**
3
10
  * Finds all the cells matching the filters criteria in the input dataset.
4
11
  * @param {KupDataDataset} dataset - Input dataset.
@@ -9,25 +16,51 @@ export function findCell(dataset, filters) {
9
16
  return dom.ketchup.data.finder(dataset, filters).cells;
10
17
  }
11
18
  /**
12
- * Returns all the cells values of the specified columns.
13
- * @param {KupDataDataset} dataset - Input dataset.
14
- * @param {string[]} columns - Columns included in the search. When missing, searches all columns.
15
- * @returns {string[]} Values of the cells.
19
+ * Returns all the cells values of the specified column, sorted if required.
20
+ * @param {Array<KupDataRow>} dataset - Input dataset.
21
+ * @param {KupDataColumn} column - Column included in the search. When missing, returns empty array.
22
+ * @returns {ValueDisplayedValue[]} Values of the cells, sorted.
16
23
  */
17
- export function getCellValue(dataset, columns) {
18
- const result = [];
19
- for (let index = 0; index < dataset.rows.length; index++) {
20
- const row = dataset.rows[index];
21
- const cells = row.cells;
22
- for (const key in cells) {
23
- const cell = cells[key];
24
- if (!columns || !columns.length || columns.includes(key)) {
25
- result.push(cell.value);
26
- }
27
- }
24
+ export function getCellValue(dataset, column, sorted) {
25
+ const rows = dataset.rows;
26
+ const values = new Array();
27
+ const result = new Array();
28
+ if (!rows || rows.length == 0 || !column) {
29
+ return result;
30
+ }
31
+ extractColumnValues(rows, column, values);
32
+ if (sorted == true) {
33
+ values.sort((n1, n2) => {
34
+ return compareValues(null, kupObjects.isDate(n1.obj)
35
+ ? n1.value
36
+ : getValueForDisplay2(n1, column), null, kupObjects.isDate(n2.obj)
37
+ ? n2.value
38
+ : getValueForDisplay2(n2, column), SortMode.A);
39
+ });
40
+ }
41
+ for (let i = 0; i < values.length; i++) {
42
+ let v = values[i];
43
+ result.push({ value: v.value, displayedValue: v.displayedValue });
28
44
  }
29
45
  return result;
30
46
  }
47
+ function extractColumnValues(rows, column, values) {
48
+ /** il valore delle righe attualmente filtrate, formattato */
49
+ rows.forEach((row) => addColumnValueFromRow(values, column, row.cells[column.name]));
50
+ return values;
51
+ }
52
+ export function addColumnValueFromRow(values, column, cell) {
53
+ if (cell) {
54
+ let item = {
55
+ value: cell.value,
56
+ displayedValue: getCellValueForDisplay(column, cell),
57
+ obj: cell.obj ? cell.obj : column.obj,
58
+ };
59
+ if (!Filters.valuesArrayContainsValue(values, cell.value)) {
60
+ values.push(item);
61
+ }
62
+ }
63
+ }
31
64
  /**
32
65
  * Overrides the given cell attributes for the specified columns.
33
66
  * If no columns are provided, the value will be applied to every column of the dataset.
@@ -17,8 +17,8 @@ export class KupData {
17
17
  find(dataset, filters) {
18
18
  return findCell(dataset, filters);
19
19
  },
20
- getValue(dataset, columns) {
21
- return getCellValue(dataset, columns);
20
+ getValue(dataset, column, sorted) {
21
+ return getCellValue(dataset, column, sorted);
22
22
  },
23
23
  replace(dataset, cell, columns) {
24
24
  return replaceCell(dataset, cell, columns);
@@ -375,9 +375,9 @@ export class KupData {
375
375
  };
376
376
  const length = dataset.rows.length;
377
377
  // sort all columns values by descending
378
- let values = getCellValue(dataset, [headerColumn]);
378
+ let values = getCellValue(dataset, this.column.find(dataset, { name: headerColumn })[0]);
379
379
  values.sort(function (a, b) {
380
- return Number(a) - Number(b);
380
+ return Number(a.value) - Number(b.value);
381
381
  });
382
382
  values.reverse();
383
383
  // excluding duplicates values.
@@ -389,7 +389,7 @@ export class KupData {
389
389
  let rightIdx = idx + 1;
390
390
  // sort the rows like a "mountain", the greatest is in the middle and the other ones are splitted left and right
391
391
  for (let i = 0; i < length; i++) {
392
- const value = values[i];
392
+ const value = values[i].value;
393
393
  // looping the rows because we have many rows with same value.
394
394
  this.finder(dataset, {
395
395
  columns: [headerColumn],
@@ -49,16 +49,13 @@ export class KupInteract {
49
49
  draggable.kupDragDrop.ghostImage
50
50
  ? draggable.kupDragDrop.ghostImage
51
51
  : e.target;
52
- const oldTransform = ghostImage.style.transform;
53
52
  let x = parseFloat(ghostImage.getAttribute('data-x')) || 0;
54
53
  let y = parseFloat(ghostImage.getAttribute('data-y')) || 0;
55
54
  x = x + e.dx;
56
55
  y = y + e.dy;
57
56
  ghostImage.style.transform = `translate(${x}px, ${y}px)`;
58
- if (dom.ketchup.interact.isInViewport(el, oldTransform, e.delta)) {
59
- ghostImage.setAttribute('data-x', x.toString());
60
- ghostImage.setAttribute('data-y', y.toString());
61
- }
57
+ ghostImage.setAttribute('data-x', x.toString());
58
+ ghostImage.setAttribute('data-y', y.toString());
62
59
  }
63
60
  },
64
61
  start(e) {
@@ -106,6 +103,7 @@ export class KupInteract {
106
103
  break;
107
104
  case KupDragEffect.CLONE:
108
105
  ghostImage = draggable.cloneNode(true);
106
+ ghostImage.id = '';
109
107
  ghostImage.style.cursor = 'grabbing';
110
108
  ghostImage.style.height = draggable.clientHeight + 'px';
111
109
  ghostImage.style.left =
@@ -3,6 +3,8 @@
3
3
  */
4
4
  export var ScrollOnHoverDirection;
5
5
  (function (ScrollOnHoverDirection) {
6
+ ScrollOnHoverDirection["BOTTOM"] = "bottom";
6
7
  ScrollOnHoverDirection["LEFT"] = "left";
7
8
  ScrollOnHoverDirection["RIGHT"] = "right";
9
+ ScrollOnHoverDirection["TOP"] = "top";
8
10
  })(ScrollOnHoverDirection || (ScrollOnHoverDirection = {}));
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
9
9
  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");
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
- var _KupScrollOnHover_arrowsContainer, _KupScrollOnHover_leftArrows, _KupScrollOnHover_rightArrows, _KupScrollOnHover_scrollEvent, _KupScrollOnHover_mousemoveEvent, _KupScrollOnHover_mouseleaveEvent, _KupScrollOnHover_rAF, _KupScrollOnHover_timeout;
12
+ var _KupScrollOnHover_instances, _KupScrollOnHover_arrowsContainer, _KupScrollOnHover_leftArrows, _KupScrollOnHover_rightArrows, _KupScrollOnHover_scrollEvent, _KupScrollOnHover_mousemoveEvent, _KupScrollOnHover_mouseleaveEvent, _KupScrollOnHover_rAF, _KupScrollOnHover_timeout, _KupScrollOnHover_initArrows;
13
13
  import { ScrollOnHoverDirection, } from './kup-scroll-on-hover-declarations';
14
14
  const dom = document.documentElement;
15
15
  /**
@@ -23,6 +23,7 @@ export class KupScrollOnHover {
23
23
  * @param {number} step - The amount in pixels for each scroll recursion.
24
24
  */
25
25
  constructor(delay, step) {
26
+ _KupScrollOnHover_instances.add(this);
26
27
  _KupScrollOnHover_arrowsContainer.set(this, void 0);
27
28
  _KupScrollOnHover_leftArrows.set(this, void 0);
28
29
  _KupScrollOnHover_rightArrows.set(this, void 0);
@@ -34,42 +35,32 @@ export class KupScrollOnHover {
34
35
  this.delay = delay ? delay : 500;
35
36
  this.managedElements = new Set();
36
37
  this.step = step ? step : 50;
37
- __classPrivateFieldSet(this, _KupScrollOnHover_arrowsContainer, document.createElement('div'), "f");
38
- __classPrivateFieldSet(this, _KupScrollOnHover_leftArrows, [], "f");
39
38
  __classPrivateFieldSet(this, _KupScrollOnHover_mouseleaveEvent, (event) => this.stop(event.target), "f");
40
39
  __classPrivateFieldSet(this, _KupScrollOnHover_mousemoveEvent, (event) => this.start(event), "f");
41
40
  __classPrivateFieldSet(this, _KupScrollOnHover_rAF, null, "f");
42
- __classPrivateFieldSet(this, _KupScrollOnHover_rightArrows, [], "f");
43
41
  __classPrivateFieldSet(this, _KupScrollOnHover_scrollEvent, (event) => this.updateChildren(event.target), "f");
44
42
  __classPrivateFieldSet(this, _KupScrollOnHover_timeout, null, "f");
45
- __classPrivateFieldGet(this, _KupScrollOnHover_arrowsContainer, "f").id = 'kup-scrolling-arrows';
46
- for (let index = 1; index < 4; index++) {
47
- const arrow = document.createElement('div');
48
- arrow.setAttribute('class', 'kup-left-scrolling-arrow kup-arrow-' + index);
49
- __classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f").push(arrow);
50
- }
51
- for (let index = 1; index < 4; index++) {
52
- const arrow = document.createElement('div');
53
- arrow.setAttribute('class', 'kup-right-scrolling-arrow kup-arrow-' + index);
54
- __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f").push(arrow);
55
- }
56
- __classPrivateFieldGet(this, _KupScrollOnHover_arrowsContainer, "f").append(__classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f")[2], __classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f")[1], __classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f")[0], __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f")[0], __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f")[1], __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f")[2]);
57
- this.container = document.createElement('div');
58
- this.container.setAttribute('kup-scroll-on-hover', '');
59
- this.container.appendChild(__classPrivateFieldGet(this, _KupScrollOnHover_arrowsContainer, "f"));
60
- document.body.appendChild(this.container);
61
43
  }
62
44
  /**
63
45
  * Watches the given element in order to trigger the scroll on hover when conditions are met.
64
46
  * Children nodes with the "hover-scrolling-child" will be watched and scrolled when el scrolls.
65
47
  * @param {KupScrollOnHoverElement} el - Element to watch.
48
+ * @param {boolean} vertical - Enables vertical scroll.
49
+ * @param {KupScrollOnHoverPercentages} percentages - Sets how big is the area in which the scroll is enabled.
66
50
  */
67
- register(el) {
51
+ register(el, vertical, percentages) {
52
+ if (!__classPrivateFieldGet(this, _KupScrollOnHover_arrowsContainer, "f")) {
53
+ __classPrivateFieldGet(this, _KupScrollOnHover_instances, "m", _KupScrollOnHover_initArrows).call(this);
54
+ }
68
55
  el.style.overflowX = 'auto';
69
56
  el.scrollOnHover = {
70
57
  active: false,
71
58
  children: el.querySelectorAll('.hover-scrolling-child'),
59
+ percentages: percentages
60
+ ? percentages
61
+ : { back: 0.1, forward: 0.9 },
72
62
  rect: null,
63
+ vertical: vertical || null,
73
64
  x: 0,
74
65
  y: 0,
75
66
  };
@@ -114,14 +105,19 @@ export class KupScrollOnHover {
114
105
  if (el.scrollOnHover.active || __classPrivateFieldGet(this, _KupScrollOnHover_timeout, "f")) {
115
106
  return;
116
107
  }
108
+ let trueHeight = el.clientHeight;
109
+ if (trueHeight === 0) {
110
+ trueHeight = el.offsetHeight;
111
+ }
117
112
  let trueWidth = el.clientWidth;
118
113
  if (trueWidth === 0) {
119
114
  trueWidth = el.offsetWidth;
120
115
  }
121
116
  if (el.scrollWidth > trueWidth + 10) {
122
117
  if (trueWidth !== 0 && !el.scrollOnHover.active) {
123
- const percRight = trueWidth - trueWidth * 0.1;
124
- const percLeft = trueWidth - trueWidth * 0.9;
118
+ const percRight = trueWidth - trueWidth * el.scrollOnHover.percentages.back;
119
+ const percLeft = trueWidth -
120
+ trueWidth * el.scrollOnHover.percentages.forward;
125
121
  const elOffset = el.scrollOnHover.x - el.scrollOnHover.rect.left;
126
122
  const maxScrollLeft = el.scrollWidth - trueWidth;
127
123
  const direction = elOffset < percLeft && el.scrollLeft !== 0
@@ -148,6 +144,28 @@ export class KupScrollOnHover {
148
144
  }
149
145
  }
150
146
  }
147
+ if (el.scrollOnHover.vertical && el.scrollHeight > trueHeight + 10) {
148
+ if (trueHeight !== 0 && !el.scrollOnHover.active) {
149
+ const percBottom = trueHeight - trueHeight * el.scrollOnHover.percentages.back;
150
+ const percTop = trueHeight -
151
+ trueHeight * el.scrollOnHover.percentages.forward;
152
+ const elOffset = el.scrollOnHover.y - el.scrollOnHover.rect.top;
153
+ const maxScrollTop = el.scrollHeight - trueHeight;
154
+ const direction = elOffset < percTop && el.scrollTop !== 0
155
+ ? ScrollOnHoverDirection.TOP
156
+ : elOffset > percBottom && el.scrollTop !== maxScrollTop
157
+ ? ScrollOnHoverDirection.BOTTOM
158
+ : null;
159
+ if (direction) {
160
+ __classPrivateFieldSet(this, _KupScrollOnHover_timeout, setTimeout(() => {
161
+ el.scrollOnHover.active = true;
162
+ __classPrivateFieldSet(this, _KupScrollOnHover_rAF, requestAnimationFrame(function () {
163
+ dom.ketchup.scrollOnHover.run(el, maxScrollTop, percBottom, percTop, direction);
164
+ }), "f");
165
+ }, this.delay), "f");
166
+ }
167
+ }
168
+ }
151
169
  }
152
170
  /**
153
171
  * When called, this function stops the scrolling process.
@@ -171,25 +189,51 @@ export class KupScrollOnHover {
171
189
  * The actual recursive scroll function.
172
190
  * @param {KupScrollOnHoverElement} el - The scrolled element.
173
191
  * @param {number} maxScrollLeft - Left coordinates to which the recursiveness must be stopped.
174
- * @param {number} percRight - Range of the right scrollable area.
175
- * @param {number} percLeft - Range of the left scrollable area.
192
+ * @param {number} percForward - Range of the right (or bottom) area.
193
+ * @param {number} percBack - Range of the left (or top) scrollable area.
176
194
  * @param {ScrollOnHoverDirection} direction - Direction of the scroll.
177
195
  */
178
- run(el, maxScrollLeft, percRight, percLeft, direction) {
196
+ run(el, maxScrollLeft, percForward, percBack, direction) {
179
197
  if (!el.scrollOnHover.active) {
180
198
  this.stop(el);
181
199
  return;
182
200
  }
183
- const offset = el.scrollOnHover.x - el.scrollOnHover.rect.left;
184
- if (offset > percLeft && offset < percRight) {
201
+ let offset = 0;
202
+ switch (direction) {
203
+ case ScrollOnHoverDirection.BOTTOM:
204
+ case ScrollOnHoverDirection.TOP: {
205
+ offset = el.scrollOnHover.y - el.scrollOnHover.rect.top;
206
+ if (offset > percBack && offset < percForward) {
207
+ this.stop(el);
208
+ return;
209
+ }
210
+ break;
211
+ }
212
+ case ScrollOnHoverDirection.LEFT:
213
+ case ScrollOnHoverDirection.RIGHT: {
214
+ offset = el.scrollOnHover.x - el.scrollOnHover.rect.left;
215
+ if (offset > percBack && offset < percForward) {
216
+ this.stop(el);
217
+ return;
218
+ }
219
+ break;
220
+ }
221
+ }
222
+ if (direction === ScrollOnHoverDirection.RIGHT &&
223
+ percForward > offset) {
224
+ this.stop(el);
225
+ return;
226
+ }
227
+ if (direction === ScrollOnHoverDirection.LEFT && percBack < offset) {
185
228
  this.stop(el);
186
229
  return;
187
230
  }
188
- if (direction === ScrollOnHoverDirection.RIGHT && percRight > offset) {
231
+ if (direction === ScrollOnHoverDirection.TOP && percBack < offset) {
189
232
  this.stop(el);
190
233
  return;
191
234
  }
192
- if (direction === ScrollOnHoverDirection.LEFT && percLeft < offset) {
235
+ if (direction === ScrollOnHoverDirection.BOTTOM &&
236
+ percForward > offset) {
193
237
  this.stop(el);
194
238
  return;
195
239
  }
@@ -197,27 +241,49 @@ export class KupScrollOnHover {
197
241
  this.updateChildren(el);
198
242
  }
199
243
  let arrow;
200
- if (direction === ScrollOnHoverDirection.LEFT) {
201
- arrow = __classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f");
202
- if (el.scrollLeft === 0) {
203
- this.stop(el);
204
- return;
244
+ switch (direction) {
245
+ case ScrollOnHoverDirection.BOTTOM: {
246
+ arrow = [];
247
+ if (el.scrollTop === maxScrollLeft) {
248
+ this.stop(el);
249
+ return;
250
+ }
251
+ el.scrollTop += this.step;
252
+ break;
205
253
  }
206
- el.scrollLeft -= this.step;
207
- }
208
- else {
209
- arrow = __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f");
210
- if (el.scrollLeft === maxScrollLeft) {
211
- this.stop(el);
212
- return;
254
+ case ScrollOnHoverDirection.LEFT: {
255
+ arrow = __classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f");
256
+ if (el.scrollLeft === 0) {
257
+ this.stop(el);
258
+ return;
259
+ }
260
+ el.scrollLeft -= this.step;
261
+ break;
262
+ }
263
+ case ScrollOnHoverDirection.RIGHT: {
264
+ arrow = __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f");
265
+ if (el.scrollLeft === maxScrollLeft) {
266
+ this.stop(el);
267
+ return;
268
+ }
269
+ el.scrollLeft += this.step;
270
+ break;
271
+ }
272
+ case ScrollOnHoverDirection.TOP: {
273
+ arrow = [];
274
+ if (el.scrollTop === 0) {
275
+ this.stop(el);
276
+ return;
277
+ }
278
+ el.scrollTop -= this.step;
279
+ break;
213
280
  }
214
- el.scrollLeft += this.step;
215
281
  }
216
282
  for (let i = 0; i < arrow.length; i++) {
217
283
  arrow[i].classList.add('kup-animated');
218
284
  }
219
285
  __classPrivateFieldSet(this, _KupScrollOnHover_rAF, requestAnimationFrame(function () {
220
- dom.ketchup.scrollOnHover.run(el, maxScrollLeft, percRight, percLeft, direction);
286
+ dom.ketchup.scrollOnHover.run(el, maxScrollLeft, percForward, percBack, direction);
221
287
  }), "f");
222
288
  }
223
289
  /**
@@ -230,4 +296,24 @@ export class KupScrollOnHover {
230
296
  }
231
297
  }
232
298
  }
233
- _KupScrollOnHover_arrowsContainer = new WeakMap(), _KupScrollOnHover_leftArrows = new WeakMap(), _KupScrollOnHover_rightArrows = new WeakMap(), _KupScrollOnHover_scrollEvent = new WeakMap(), _KupScrollOnHover_mousemoveEvent = new WeakMap(), _KupScrollOnHover_mouseleaveEvent = new WeakMap(), _KupScrollOnHover_rAF = new WeakMap(), _KupScrollOnHover_timeout = new WeakMap();
299
+ _KupScrollOnHover_arrowsContainer = new WeakMap(), _KupScrollOnHover_leftArrows = new WeakMap(), _KupScrollOnHover_rightArrows = new WeakMap(), _KupScrollOnHover_scrollEvent = new WeakMap(), _KupScrollOnHover_mousemoveEvent = new WeakMap(), _KupScrollOnHover_mouseleaveEvent = new WeakMap(), _KupScrollOnHover_rAF = new WeakMap(), _KupScrollOnHover_timeout = new WeakMap(), _KupScrollOnHover_instances = new WeakSet(), _KupScrollOnHover_initArrows = function _KupScrollOnHover_initArrows() {
300
+ __classPrivateFieldSet(this, _KupScrollOnHover_arrowsContainer, document.createElement('div'), "f");
301
+ __classPrivateFieldSet(this, _KupScrollOnHover_leftArrows, [], "f");
302
+ __classPrivateFieldSet(this, _KupScrollOnHover_rightArrows, [], "f");
303
+ __classPrivateFieldGet(this, _KupScrollOnHover_arrowsContainer, "f").id = 'kup-scrolling-arrows';
304
+ for (let index = 1; index < 4; index++) {
305
+ const arrow = document.createElement('div');
306
+ arrow.setAttribute('class', 'kup-left-scrolling-arrow kup-arrow-' + index);
307
+ __classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f").push(arrow);
308
+ }
309
+ for (let index = 1; index < 4; index++) {
310
+ const arrow = document.createElement('div');
311
+ arrow.setAttribute('class', 'kup-right-scrolling-arrow kup-arrow-' + index);
312
+ __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f").push(arrow);
313
+ }
314
+ __classPrivateFieldGet(this, _KupScrollOnHover_arrowsContainer, "f").append(__classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f")[2], __classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f")[1], __classPrivateFieldGet(this, _KupScrollOnHover_leftArrows, "f")[0], __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f")[0], __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f")[1], __classPrivateFieldGet(this, _KupScrollOnHover_rightArrows, "f")[2]);
315
+ this.container = document.createElement('div');
316
+ this.container.setAttribute('kup-scroll-on-hover', '');
317
+ this.container.appendChild(__classPrivateFieldGet(this, _KupScrollOnHover_arrowsContainer, "f"));
318
+ document.body.appendChild(this.container);
319
+ };
@@ -1,13 +1,14 @@
1
- import { SortMode } from '../../components/kup-data-table/kup-data-table-declarations';
2
- import { compareValues, getCellValueForDisplay, getColumnByName, getValueForDisplay, getValueForDisplay2, } from '../cell-utils';
1
+ import { getCellValueForDisplay, getColumnByName, getValueForDisplay, } from '../cell-utils';
3
2
  import { Filters } from './filters';
4
3
  import { FiltersColumnMenu } from './filters-column-menu';
5
4
  import { treeMainColumnName } from '../../components/kup-tree/kup-tree-declarations';
6
5
  import { KupObjects } from '../../managers/kup-objects/kup-objects';
6
+ import { KupData } from '../../managers/kup-data/kup-data';
7
7
  const dom = document.documentElement;
8
8
  const kupObjects = dom.ketchup
9
9
  ? dom.ketchup.objects
10
10
  : new KupObjects();
11
+ const kupData = dom.ketchup ? dom.ketchup.data : new KupData();
11
12
  /**
12
13
  * Filtering algorithms related to data-table rows.
13
14
  * @module FiltersRows
@@ -231,26 +232,6 @@ export class FiltersRows extends Filters {
231
232
  for (let i = 0; i < checkboxes.length; i++) {
232
233
  values.push(checkboxes[i]);
233
234
  }
234
- this.extractColumnValues(tmpRows, column, values);
235
- values.sort((n1, n2) => {
236
- return compareValues(null, getValueForDisplay2(n1, column), null, getValueForDisplay2(n2, column), SortMode.A);
237
- });
238
- return values;
239
- }
240
- extractColumnValues(rows, column, values) {
241
- /** il valore delle righe attualmente filtrate, formattato */
242
- rows.forEach((row) => this.addColumnValueFromRow(values, column, row.cells[column.name]));
243
- return values;
244
- }
245
- addColumnValueFromRow(values, column, cell) {
246
- if (cell) {
247
- let item = {
248
- value: cell.value,
249
- displayedValue: getCellValueForDisplay(column, cell),
250
- };
251
- if (!Filters.valuesArrayContainsValue(values, cell.value)) {
252
- values.push(item);
253
- }
254
- }
235
+ return kupData.cell.getValue({ rows: tmpRows }, column, true);
255
236
  }
256
237
  }
@@ -1,6 +1,7 @@
1
1
  import { treeMainColumnName, } from '../../components/kup-tree/kup-tree-declarations';
2
2
  import { FiltersColumnMenu } from './filters-column-menu';
3
3
  import { FiltersRows } from './filters-rows';
4
+ import { addColumnValueFromRow } from '../../managers/kup-data/kup-data-cell-helper';
4
5
  /**
5
6
  * Filtering algorithms related to tree items rows.
6
7
  * @module FiltersTreeItems
@@ -82,7 +83,7 @@ export class FiltersTreeItems extends FiltersRows {
82
83
  value: node.value,
83
84
  };
84
85
  if (node.visible) {
85
- this.addColumnValueFromRow(values, column, cellsHolder[column.name]);
86
+ addColumnValueFromRow(values, column, cellsHolder[column.name]);
86
87
  this.extractColumnValues(node.children, column, values);
87
88
  }
88
89
  });
@@ -1,6 +1,6 @@
1
- import { h } from './index-ad6ab214.js';
1
+ import { h } from './index-e41330a5.js';
2
2
  import { F as FButtonStyling } from './f-button-declarations-b1b4cac4.js';
3
- import { F as FImage } from './f-image-2ab4b9aa.js';
3
+ import { F as FImage } from './f-image-914a03ef.js';
4
4
 
5
5
  /*-------------------------------------------------*/
6
6
  /* C o m p o n e n t */
@@ -1,11 +1,9 @@
1
- import { Y as editableTypes, Z as kupTypes, b as KupThemeColorValues, _ as FCellTypes, W as KupTagNames, $ as fullWidthFieldsComps, a0 as FCellClasses, a1 as autoCenterComps, a2 as FCellEvents } from './kup-manager-22a475e6.js';
2
- import { h } from './index-ad6ab214.js';
3
- import { c as getCellValueForDisplay } from './cell-utils-cb5d4149.js';
4
- import { F as FCheckbox } from './f-checkbox-c51c4a75.js';
5
- import { F as FTextField } from './f-text-field-41c575eb.js';
6
- import { h as stringToNumber } from './utils-2c1f4122.js';
7
- import { F as FImage } from './f-image-2ab4b9aa.js';
8
- import { a as FChip } from './f-chip-c2e4c522.js';
1
+ import { aj as editableTypes, ak as kupTypes, b as KupThemeColorValues, al as FCellTypes, am as KupTagNames, an as fullWidthFieldsComps, ag as stringToNumber, ao as FCellClasses, ap as autoCenterComps, ad as getCellValueForDisplay, aq as FCellEvents } from './kup-manager-86f440c7.js';
2
+ import { h } from './index-e41330a5.js';
3
+ import { F as FCheckbox } from './f-checkbox-e06cf07b.js';
4
+ import { F as FTextField } from './f-text-field-76341fe3.js';
5
+ import { F as FImage } from './f-image-914a03ef.js';
6
+ import { a as FChip } from './f-chip-d6f2eb94.js';
9
7
 
10
8
  /*-------------------------------------------------*/
11
9
  /* C o m p o n e n t */
@@ -1,4 +1,4 @@
1
- import { h } from './index-ad6ab214.js';
1
+ import { h } from './index-e41330a5.js';
2
2
 
3
3
  /*-------------------------------------------------*/
4
4
  /* C o m p o n e n t */
@@ -1,6 +1,6 @@
1
- import { h } from './index-ad6ab214.js';
2
- import { F as FImage } from './f-image-2ab4b9aa.js';
3
- import { K as KupThemeIconValues, h as KupLanguageGeneric, b as KupThemeColorValues } from './kup-manager-22a475e6.js';
1
+ import { h } from './index-e41330a5.js';
2
+ import { F as FImage } from './f-image-914a03ef.js';
3
+ import { K as KupThemeIconValues, j as KupLanguageGeneric, b as KupThemeColorValues } from './kup-manager-86f440c7.js';
4
4
 
5
5
  /**
6
6
  * Types of the f-chip component.
@@ -1,5 +1,5 @@
1
- import { h, a as getAssetPath } from './index-ad6ab214.js';
2
- import { b as KupThemeColorValues } from './kup-manager-22a475e6.js';
1
+ import { h, a as getAssetPath } from './index-e41330a5.js';
2
+ import { b as KupThemeColorValues } from './kup-manager-86f440c7.js';
3
3
 
4
4
  /**
5
5
  * The type of a CSS step in CSS-drawing mode.