@sme.up/ketchup 6.2.0 → 6.4.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 (183) hide show
  1. package/dist/cjs/{f-button-5b69d882.js → f-button-826a470e.js} +4 -4
  2. package/dist/cjs/{f-cell-3a740c48.js → f-cell-2d5bcf0c.js} +13 -15
  3. package/dist/cjs/{f-checkbox-57443ca3.js → f-checkbox-cd977193.js} +1 -1
  4. package/dist/cjs/{f-chip-02e83f82.js → f-chip-2fd3363e.js} +3 -3
  5. package/dist/cjs/{f-image-2a61ece2.js → f-image-0f17d599.js} +2 -2
  6. package/dist/cjs/{f-paginator-utils-09126bdd.js → f-paginator-utils-946b579d.js} +80 -403
  7. package/dist/cjs/{f-text-field-9ee20a67.js → f-text-field-d243e4d8.js} +13 -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 +129 -115
  12. package/dist/cjs/kup-box.cjs.entry.js +20 -20
  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 +42 -34
  20. package/dist/cjs/kup-family-tree.cjs.entry.js +140 -64
  21. package/dist/cjs/kup-form.cjs.entry.js +21 -15
  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 +5 -6
  25. package/dist/cjs/kup-magic-box.cjs.entry.js +5 -6
  26. package/dist/cjs/{kup-manager-02acbb37.js → kup-manager-a8eecc60.js} +1419 -375
  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/form.js +41 -0
  37. package/dist/collection/assets/index.js +4 -0
  38. package/dist/collection/assets/kupinteract.js +68 -0
  39. package/dist/collection/collection-manifest.json +5 -5
  40. package/dist/collection/components/kup-box/kup-box.js +5 -3
  41. package/dist/collection/components/kup-button/kup-button-declarations.js +1 -0
  42. package/dist/collection/components/kup-button/kup-button.js +27 -0
  43. package/dist/collection/components/kup-dashboard/kup-dashboard.css +7 -0
  44. package/dist/collection/components/kup-dashboard/kup-dashboard.js +67 -7
  45. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +42 -30
  46. package/dist/collection/components/kup-data-table/kup-data-table.js +3 -1
  47. package/dist/collection/components/kup-echart/kup-echart.js +34 -24
  48. package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +3 -1
  49. package/dist/collection/components/kup-family-tree/kup-family-tree.css +79 -9
  50. package/dist/collection/components/kup-family-tree/kup-family-tree.js +253 -65
  51. package/dist/collection/components/kup-form/kup-form-declarations.js +1 -0
  52. package/dist/collection/components/kup-form/kup-form.css +8 -0
  53. package/dist/collection/components/kup-form/kup-form.js +31 -2
  54. package/dist/collection/components/kup-image/assets/svg/azure.svg +1 -0
  55. package/dist/collection/components/kup-lazy/kup-lazy.css +8 -2
  56. package/dist/collection/components/kup-progress-bar/kup-progress-bar.css +1 -0
  57. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
  58. package/dist/collection/components/kup-text-field/kup-text-field.js +27 -0
  59. package/dist/collection/f-components/f-button/f-button.js +2 -2
  60. package/dist/collection/f-components/f-cell/f-cell.js +1 -1
  61. package/dist/collection/f-components/f-text-field/f-text-field.js +11 -1
  62. package/dist/collection/managers/kup-data/kup-data-cell-helper.js +49 -15
  63. package/dist/collection/managers/kup-data/kup-data.js +9 -11
  64. package/dist/collection/managers/kup-dates/kup-dates.js +14 -0
  65. package/dist/collection/managers/kup-interact/kup-interact.js +3 -5
  66. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.js +2 -0
  67. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover.js +131 -45
  68. package/dist/collection/utils/filters/filters-rows.js +4 -23
  69. package/dist/collection/utils/filters/filters-tree-items.js +4 -3
  70. package/dist/esm/{f-button-fd44ef70.js → f-button-2d0a5f21.js} +4 -4
  71. package/dist/esm/{f-cell-7b159a22.js → f-cell-ee7d7b5c.js} +7 -9
  72. package/dist/esm/{f-checkbox-c51c4a75.js → f-checkbox-e06cf07b.js} +1 -1
  73. package/dist/esm/{f-chip-c2e4c522.js → f-chip-0d29f91f.js} +3 -3
  74. package/dist/esm/{f-image-2ab4b9aa.js → f-image-ab131d59.js} +2 -2
  75. package/dist/esm/{f-paginator-utils-ef537d82.js → f-paginator-utils-aa52af0f.js} +44 -366
  76. package/dist/esm/{f-text-field-41c575eb.js → f-text-field-0729b19f.js} +13 -3
  77. package/dist/esm/{index-ad6ab214.js → index-e41330a5.js} +9 -4
  78. package/dist/esm/ketchup.js +3 -3
  79. package/dist/esm/kup-accordion.entry.js +3 -4
  80. package/dist/esm/kup-autocomplete_25.entry.js +30 -16
  81. package/dist/esm/kup-box.entry.js +14 -14
  82. package/dist/esm/kup-calendar.entry.js +5 -7
  83. package/dist/esm/kup-cell.entry.js +7 -9
  84. package/dist/esm/kup-dash-list.entry.js +2 -4
  85. package/dist/esm/kup-dash_2.entry.js +2 -3
  86. package/dist/esm/kup-dashboard.entry.js +74 -15
  87. package/dist/esm/kup-drawer.entry.js +2 -3
  88. package/dist/esm/kup-echart.entry.js +36 -28
  89. package/dist/esm/kup-family-tree.entry.js +138 -62
  90. package/dist/esm/kup-form.entry.js +18 -12
  91. package/dist/esm/kup-iframe.entry.js +2 -3
  92. package/dist/esm/kup-image-list.entry.js +8 -10
  93. package/dist/esm/kup-lazy.entry.js +3 -4
  94. package/dist/esm/kup-magic-box.entry.js +3 -4
  95. package/dist/esm/{kup-manager-22a475e6.js → kup-manager-13b4f989.js} +1398 -376
  96. package/dist/esm/kup-nav-bar.entry.js +2 -3
  97. package/dist/esm/kup-numeric-picker.entry.js +3 -3
  98. package/dist/esm/kup-photo-frame.entry.js +2 -3
  99. package/dist/esm/kup-probe.entry.js +2 -2
  100. package/dist/esm/kup-qlik.entry.js +2 -2
  101. package/dist/esm/kup-snackbar.entry.js +4 -5
  102. package/dist/esm/loader.js +3 -3
  103. package/dist/ketchup/assets/svg/azure.svg +1 -0
  104. package/dist/ketchup/ketchup.esm.js +1 -1
  105. package/dist/ketchup/p-0986ad5d.js +1 -0
  106. package/dist/ketchup/{p-38d7584e.js → p-0cf10db0.js} +1 -1
  107. package/dist/ketchup/p-13666119.entry.js +27 -0
  108. package/dist/ketchup/p-18b68e86.entry.js +1 -0
  109. package/dist/ketchup/{p-1959f835.entry.js → p-28d514d0.entry.js} +1 -1
  110. package/dist/ketchup/p-2ffdbee1.entry.js +1 -0
  111. package/dist/ketchup/p-3dcfffbe.entry.js +1 -0
  112. package/dist/ketchup/p-3fe35411.entry.js +1 -0
  113. package/dist/ketchup/{p-cd5cfa7c.js → p-5552f156.js} +1 -1
  114. package/dist/ketchup/p-5f51009b.entry.js +1 -0
  115. package/dist/ketchup/{p-264b1b19.entry.js → p-816f0938.entry.js} +1 -1
  116. package/dist/ketchup/p-83c214d7.entry.js +1 -0
  117. package/dist/ketchup/p-84957bbf.entry.js +1 -0
  118. package/dist/ketchup/p-86795579.entry.js +1 -0
  119. package/dist/ketchup/p-8f85b8bb.entry.js +9 -0
  120. package/dist/ketchup/p-982d3e3a.entry.js +1 -0
  121. package/dist/ketchup/{p-e9366aaf.entry.js → p-adcfcd4f.entry.js} +4 -4
  122. package/dist/ketchup/p-b0b3989b.js +2 -0
  123. package/dist/ketchup/{p-dc62a30f.js → p-b705be3b.js} +1 -1
  124. package/dist/ketchup/{p-fc2b1229.js → p-b8c921ee.js} +3 -3
  125. package/dist/ketchup/{p-edae3076.js → p-bfe88b03.js} +1 -1
  126. package/dist/ketchup/p-d7091875.entry.js +1 -0
  127. package/dist/ketchup/p-d8656956.entry.js +1 -0
  128. package/dist/ketchup/p-dc69549c.entry.js +1 -0
  129. package/dist/ketchup/p-e01fa411.entry.js +1 -0
  130. package/dist/ketchup/p-e0f659c9.entry.js +1 -0
  131. package/dist/ketchup/p-e1d82570.entry.js +1 -0
  132. package/dist/ketchup/p-e21c744a.js +1 -0
  133. package/dist/ketchup/p-e5a9d60a.entry.js +1 -0
  134. package/dist/ketchup/p-f50cbed9.js +1 -0
  135. package/dist/ketchup/{p-42080355.entry.js → p-fa9f161a.entry.js} +1 -1
  136. package/dist/types/components/kup-box/kup-box-declarations.d.ts +1 -0
  137. package/dist/types/components/kup-button/kup-button-declarations.d.ts +1 -0
  138. package/dist/types/components/kup-button/kup-button.d.ts +5 -0
  139. package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +6 -1
  140. package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +7 -3
  141. package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +26 -5
  142. package/dist/types/components/kup-form/kup-form-declarations.d.ts +1 -0
  143. package/dist/types/components/kup-form/kup-form.d.ts +5 -0
  144. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +1 -0
  145. package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
  146. package/dist/types/components.d.ts +69 -7
  147. package/dist/types/f-components/f-button/f-button-declarations.d.ts +1 -0
  148. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
  149. package/dist/types/managers/kup-data/kup-data-cell-helper.d.ts +13 -6
  150. package/dist/types/managers/kup-data/kup-data.d.ts +3 -1
  151. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.d.ts +9 -1
  152. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover.d.ts +7 -5
  153. package/dist/types/utils/filters/filters-rows.d.ts +0 -2
  154. package/dist/types/utils/filters/filters-tree-items.d.ts +1 -1
  155. package/package.json +2 -2
  156. package/dist/cjs/cell-utils-fe64a28c.js +0 -168
  157. package/dist/cjs/utils-4b208b48.js +0 -447
  158. package/dist/esm/cell-utils-cb5d4149.js +0 -160
  159. package/dist/esm/utils-2c1f4122.js +0 -428
  160. package/dist/ketchup/p-06c6cc68.js +0 -1
  161. package/dist/ketchup/p-0dacd4bc.entry.js +0 -1
  162. package/dist/ketchup/p-1c44dc62.entry.js +0 -1
  163. package/dist/ketchup/p-4bc9f98b.entry.js +0 -1
  164. package/dist/ketchup/p-578583db.entry.js +0 -1
  165. package/dist/ketchup/p-5866d507.entry.js +0 -1
  166. package/dist/ketchup/p-61059e9d.entry.js +0 -9
  167. package/dist/ketchup/p-664be494.entry.js +0 -1
  168. package/dist/ketchup/p-67cd575d.entry.js +0 -1
  169. package/dist/ketchup/p-682a367a.js +0 -1
  170. package/dist/ketchup/p-6ccf7eb2.entry.js +0 -1
  171. package/dist/ketchup/p-7230ab97.entry.js +0 -1
  172. package/dist/ketchup/p-752b4cef.entry.js +0 -1
  173. package/dist/ketchup/p-7de3e7ac.entry.js +0 -1
  174. package/dist/ketchup/p-928c5c36.js +0 -1
  175. package/dist/ketchup/p-9b36497d.entry.js +0 -1
  176. package/dist/ketchup/p-b982d137.entry.js +0 -1
  177. package/dist/ketchup/p-c0219e5e.js +0 -1
  178. package/dist/ketchup/p-c55fd0a7.entry.js +0 -1
  179. package/dist/ketchup/p-d154b3a0.entry.js +0 -1
  180. package/dist/ketchup/p-d2affb6f.entry.js +0 -27
  181. package/dist/ketchup/p-d3b542b3.js +0 -2
  182. package/dist/ketchup/p-d6c12c6c.js +0 -1
  183. package/dist/ketchup/p-da0eab60.entry.js +0 -1
@@ -5,6 +5,7 @@
5
5
  export var KupTextFieldProps;
6
6
  (function (KupTextFieldProps) {
7
7
  KupTextFieldProps["customStyle"] = "Custom style of the component.";
8
+ KupTextFieldProps["decimals"] = "Number of decimals (should be used when inputType is number).";
8
9
  KupTextFieldProps["disabled"] = "When set to true, the component is disabled.";
9
10
  KupTextFieldProps["emitSubmitEventOnEnter"] = "When the text field is part of the autocomplete component and the list is opened, enter key selects the item and doesn't submit.";
10
11
  KupTextFieldProps["fullWidth"] = "When set to true, the component will be rendered at full width.";
@@ -25,6 +25,11 @@ export class KupTextField {
25
25
  * @see https://ketchup.smeup.com/ketchup-showcase/#/customization
26
26
  */
27
27
  this.customStyle = '';
28
+ /**
29
+ * Number of decimals (should be used when inputType is number).
30
+ * @default null
31
+ */
32
+ this.decimals = null;
28
33
  /**
29
34
  * When set to true, the component is disabled.
30
35
  * @default false
@@ -291,6 +296,7 @@ export class KupTextField {
291
296
  danger: this.rootElement.classList.contains('kup-danger')
292
297
  ? true
293
298
  : false,
299
+ decimals: this.decimals,
294
300
  disabled: this.disabled,
295
301
  fullHeight: this.rootElement.classList.contains('kup-full-height')
296
302
  ? true
@@ -380,6 +386,27 @@ export class KupTextField {
380
386
  "reflect": false,
381
387
  "defaultValue": "''"
382
388
  },
389
+ "decimals": {
390
+ "type": "number",
391
+ "mutable": false,
392
+ "complexType": {
393
+ "original": "number",
394
+ "resolved": "number",
395
+ "references": {}
396
+ },
397
+ "required": false,
398
+ "optional": false,
399
+ "docs": {
400
+ "tags": [{
401
+ "name": "default",
402
+ "text": "null"
403
+ }],
404
+ "text": "Number of decimals (should be used when inputType is number)."
405
+ },
406
+ "attribute": "decimals",
407
+ "reflect": false,
408
+ "defaultValue": "null"
409
+ },
383
410
  "disabled": {
384
411
  "type": "boolean",
385
412
  "mutable": false,
@@ -58,7 +58,7 @@ function renderButton(props) {
58
58
  const styleSpinnerContainer = {
59
59
  '--kup_button_spinner_height': propsFImage.sizeY,
60
60
  };
61
- return (h("button", { class: classObj, disabled: props.disabled, onBlur: props.onBlur, onClick: props.onClick, onFocus: props.onFocus, style: styleSpinnerContainer, "aria-label": props.title, type: "button" },
61
+ return (h("button", { type: props.buttonType ? props.buttonType : 'button', class: classObj, disabled: props.disabled, onBlur: props.onBlur, onClick: props.onClick, onFocus: props.onFocus, style: styleSpinnerContainer, "aria-label": props.title },
62
62
  props.trailingIcon
63
63
  ? [
64
64
  h("span", { class: classLabelObj }, props.label),
@@ -93,7 +93,7 @@ function renderIconButton(props) {
93
93
  const iconOff = props.iconOff
94
94
  ? props.iconOff
95
95
  : props.icon + '_border';
96
- return (h("button", { class: classObj, disabled: props.disabled, onClick: props.onClick, style: styleSpinnerContainer, type: "button", value: props.checked ? 'on' : 'off', "aria-label": props.title },
96
+ return (h("button", { type: props.buttonType ? props.buttonType : 'button', class: classObj, disabled: props.disabled, onClick: props.onClick, style: styleSpinnerContainer, value: props.checked ? 'on' : 'off', "aria-label": props.title },
97
97
  !props.showSpinner || props.disabled ? (h(FImage, Object.assign({}, propsFImage, { resource: props.toggable && !props.checked ? iconOff : props.icon, wrapperClass: `icon-button__icon kup-icon` }))) : null,
98
98
  props.toggable && !props.showSpinner ? (h(FImage, Object.assign({}, propsFImage, { resource: props.icon, wrapperClass: `icon-button__icon icon-button__icon--on kup-icon` }))) : null,
99
99
  props.showSpinner && !props.disabled ? (h("div", { class: "icon-button__spinner-container" },
@@ -223,7 +223,7 @@ function setEditableCell(cellType, classObj, cell, column, props) {
223
223
  case FCellTypes.NUMBER:
224
224
  classObj[FCellClasses.C_RIGHT_ALIGNED] = true;
225
225
  case FCellTypes.STRING:
226
- return (h(FTextField, Object.assign({}, cell.data, { icon: cell.icon ? cell.icon : column.icon ? column.icon : null, fullWidth: isFullWidth(props) ? true : false, inputType: cellType === FCellTypes.NUMBER ? 'number' : null, value: cellType === FCellTypes.NUMBER
226
+ return (h(FTextField, Object.assign({ inputType: cellType === FCellTypes.NUMBER ? 'number' : null, fullWidth: isFullWidth(props) ? true : false }, cell.data, { icon: cell.icon ? cell.icon : column.icon ? column.icon : null, value: cellType === FCellTypes.NUMBER
227
227
  ? stringToNumber(cell.value).toString()
228
228
  : cell.value, onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), onInput: (e) => cellEvent(e, props, cellType, FCellEvents.INPUT), onIconClick: (e) => cellEvent(e, props, cellType, FCellEvents.ICON_CLICK) })));
229
229
  }
@@ -55,7 +55,17 @@ function setContent(props) {
55
55
  props.maxLength)) : undefined,
56
56
  !props.trailingIcon ? iconEl : undefined,
57
57
  props.textArea ? (h("span", { class: "mdc-text-field__resizer" },
58
- h("textarea", { class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown }))) : (h("input", { type: props.inputType ? props.inputType : 'text', step: props.step, min: props.min, max: props.max, name: props.name, class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, placeholder: props.fullWidth ? props.label : undefined, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown })),
58
+ h("textarea", { class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown }))) : (h("input", { type: props.inputType ? props.inputType : 'text', step: props.step, min: props.min, max: props.max, name: props.name, class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, placeholder: props.fullWidth && !props.outlined
59
+ ? props.label
60
+ : undefined, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onChange: (e) => {
61
+ if (props.decimals !== null &&
62
+ props.inputType === 'number') {
63
+ e.target.value = parseFloat(e.target.value).toFixed(props.decimals);
64
+ }
65
+ if (props.onChange) {
66
+ props.onChange(e);
67
+ }
68
+ }, onClick: props.onClick, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown })),
59
69
  props.isClearable ? (h("span", { class: `mdc-text-field__icon kup-icon ${KupThemeIconValues.CLEAR.replace('--', '')}`, onClick: props.onClearIconClick })) : undefined,
60
70
  props.trailingIcon ? iconEl : undefined,
61
71
  !props.fullWidth && !isOutlined ? labelEl : undefined,
@@ -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,52 @@ 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, univocal) {
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, univocal);
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, univocal) {
48
+ /** il valore delle righe attualmente filtrate, formattato */
49
+ rows.forEach((row) => addColumnValueFromRow(values, column, row.cells[column.name], univocal));
50
+ return values;
51
+ }
52
+ export function addColumnValueFromRow(values, column, cell, univocal) {
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 (univocal != true ||
60
+ !Filters.valuesArrayContainsValue(values, cell.value)) {
61
+ values.push(item);
62
+ }
63
+ }
64
+ }
31
65
  /**
32
66
  * Overrides the given cell attributes for the specified columns.
33
67
  * If no columns are provided, the value will be applied to every column of the dataset.
@@ -17,8 +17,11 @@ 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, false);
22
+ },
23
+ getUnivocalValue(dataset, column, sorted) {
24
+ return getCellValue(dataset, column, sorted, true);
22
25
  },
23
26
  replace(dataset, cell, columns) {
24
27
  return replaceCell(dataset, cell, columns);
@@ -373,23 +376,18 @@ export class KupData {
373
376
  columns: JSON.parse(JSON.stringify(dataset.columns)),
374
377
  rows: [],
375
378
  };
376
- const length = dataset.rows.length;
377
379
  // sort all columns values by descending
378
- let values = getCellValue(dataset, [headerColumn]);
379
- values.sort(function (a, b) {
380
- return Number(a) - Number(b);
381
- });
380
+ let values = getCellValue(dataset, this.column.find(dataset, { name: headerColumn })[0], true, true);
382
381
  values.reverse();
383
- // excluding duplicates values.
384
- values = [...new Set(values)];
382
+ const length = dataset.rows.length;
385
383
  // calculating middle index
386
384
  const idx = Math.floor(length / 2);
387
385
  let lastIdx = idx - 1;
388
386
  let leftIdx = idx - 1;
389
387
  let rightIdx = idx + 1;
390
388
  // sort the rows like a "mountain", the greatest is in the middle and the other ones are splitted left and right
391
- for (let i = 0; i < length; i++) {
392
- const value = values[i];
389
+ for (let i = 0; i < values.length; i++) {
390
+ const value = values[i].value;
393
391
  // looping the rows because we have many rows with same value.
394
392
  this.finder(dataset, {
395
393
  columns: [headerColumn],
@@ -45,6 +45,20 @@ export class KupDates {
45
45
  this.locale = navLangs[0]
46
46
  .split('-')[0]
47
47
  .toLowerCase();
48
+ let found = false;
49
+ for (const key in KupDatesLocales) {
50
+ if (Object.prototype.hasOwnProperty.call(KupDatesLocales, key)) {
51
+ const localeItem = KupDatesLocales[key];
52
+ if (localeItem == this.locale) {
53
+ found = true;
54
+ break;
55
+ }
56
+ }
57
+ }
58
+ if (!found) {
59
+ console.log('set forced locale: en');
60
+ this.locale = KupDatesLocales.ENGLISH;
61
+ }
48
62
  }
49
63
  dayjs.locale(this.locale);
50
64
  this.managedComponents.forEach(function (comp) {
@@ -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.getUnivocalValue({ 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
@@ -70,7 +71,7 @@ export class FiltersTreeItems extends FiltersRows {
70
71
  });
71
72
  }
72
73
  }
73
- extractColumnValues(rows, column, values) {
74
+ extractColumnValues(rows, column, values, univocal) {
74
75
  if (rows == null || rows.length == 0) {
75
76
  return;
76
77
  }
@@ -82,8 +83,8 @@ 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
- this.extractColumnValues(node.children, column, values);
86
+ addColumnValueFromRow(values, column, cellsHolder[column.name], univocal);
87
+ this.extractColumnValues(node.children, column, values, univocal);
87
88
  }
88
89
  });
89
90
  return values;