@sme.up/ketchup 6.1.0-SNAPSHOT → 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 (223) hide show
  1. package/dist/cjs/{f-button-ac179257.js → f-button-94cb5f35.js} +4 -4
  2. package/dist/cjs/f-cell-76830a0d.js +416 -0
  3. package/dist/cjs/f-checkbox-cd977193.js +29 -0
  4. package/dist/cjs/{f-chip-b00897d7.js → f-chip-68d45fd3.js} +3 -3
  5. package/dist/cjs/{f-image-89f25556.js → f-image-0e71df7e.js} +2 -2
  6. package/dist/cjs/{f-paginator-utils-8fa501b3.js → f-paginator-utils-46689c0a.js} +80 -403
  7. package/dist/cjs/{f-text-field-e1e45ade.js → f-text-field-b4229cef.js} +11 -3
  8. package/dist/cjs/{index-eb556444.js → index-31125378.js} +15 -8
  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 +331 -299
  12. package/dist/cjs/kup-box.cjs.entry.js +1304 -0
  13. package/dist/cjs/kup-calendar.cjs.entry.js +9 -11
  14. package/dist/cjs/kup-cell.cjs.entry.js +10 -11
  15. package/dist/cjs/kup-dash-list.cjs.entry.js +5 -7
  16. package/dist/cjs/kup-dash_2.cjs.entry.js +5 -9
  17. package/dist/cjs/kup-dashboard.cjs.entry.js +438 -0
  18. package/dist/cjs/kup-drawer.cjs.entry.js +5 -6
  19. package/dist/cjs/{kup-box_2.cjs.entry.js → kup-echart.cjs.entry.js} +66 -1353
  20. package/dist/cjs/kup-family-tree.cjs.entry.js +486 -0
  21. package/dist/cjs/kup-form.cjs.entry.js +478 -0
  22. package/dist/cjs/kup-iframe.cjs.entry.js +4 -5
  23. package/dist/cjs/kup-image-list.cjs.entry.js +73 -13
  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-7a941909.js → kup-manager-7c514a30.js} +1787 -356
  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 +6 -7
  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 +161 -0
  35. package/dist/collection/assets/data-table.js +59 -0
  36. package/dist/collection/assets/family-tree.js +2654 -0
  37. package/dist/collection/assets/form.js +433 -0
  38. package/dist/collection/assets/grid.js +17 -0
  39. package/dist/collection/assets/index.js +18 -6
  40. package/dist/collection/assets/kupinteract.js +68 -0
  41. package/dist/collection/collection-manifest.json +8 -7
  42. package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +135 -129
  43. package/dist/collection/components/kup-box/kup-box.js +13 -2
  44. package/dist/collection/components/kup-button/kup-button.js +1 -0
  45. package/dist/collection/components/kup-combobox/kup-combobox.js +16 -13
  46. package/dist/collection/components/kup-dashboard/kup-dashboard-declarations.js +10 -0
  47. package/dist/collection/components/{kup-form-editor/kup-form-editor.css → kup-dashboard/kup-dashboard.css} +14 -6
  48. package/dist/collection/components/{kup-form-editor/kup-form-editor.js → kup-dashboard/kup-dashboard.js} +211 -152
  49. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +42 -30
  50. package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
  51. package/dist/collection/components/kup-data-table/kup-data-table.js +7 -6
  52. package/dist/collection/components/kup-drawer/kup-drawer.css +5 -8
  53. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +1 -0
  54. package/dist/collection/components/kup-echart/kup-echart.js +9 -9
  55. package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +14 -0
  56. package/dist/collection/components/kup-family-tree/kup-family-tree.css +171 -0
  57. package/dist/collection/components/kup-family-tree/kup-family-tree.js +854 -0
  58. package/dist/collection/components/kup-form/kup-form-declarations.js +25 -0
  59. package/dist/collection/components/kup-form/kup-form.css +99 -0
  60. package/dist/collection/components/kup-form/kup-form.js +647 -0
  61. package/dist/collection/components/kup-grid/kup-grid.js +1 -4
  62. package/dist/collection/components/kup-image-list/kup-image-list-state.js +9 -0
  63. package/dist/collection/components/kup-image-list/kup-image-list.css +0 -6
  64. package/dist/collection/components/kup-image-list/kup-image-list.js +113 -1
  65. package/dist/collection/components/kup-lazy/kup-lazy.css +13 -6
  66. package/dist/collection/components/kup-list/kup-list-helper.js +9 -3
  67. package/dist/collection/components/kup-photo-frame/kup-photo-frame.css +13 -3
  68. package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +1 -1
  69. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +4 -0
  70. package/dist/collection/components/kup-text-field/kup-text-field.js +54 -0
  71. package/dist/collection/components/kup-time-picker/kup-time-picker.js +0 -6
  72. package/dist/collection/components/kup-tree/kup-tree.js +26 -9
  73. package/dist/collection/f-components/f-button/f-button.js +2 -2
  74. package/dist/collection/f-components/f-cell/f-cell-declarations.js +5 -1
  75. package/dist/collection/f-components/f-cell/f-cell.js +34 -114
  76. package/dist/collection/f-components/f-text-field/f-text-field.js +9 -1
  77. package/dist/collection/managers/kup-data/kup-data-cell-helper.js +48 -15
  78. package/dist/collection/managers/kup-data/kup-data-node-helper.js +69 -0
  79. package/dist/collection/managers/kup-data/kup-data.js +114 -6
  80. package/dist/collection/managers/kup-interact/kup-interact.js +3 -5
  81. package/dist/collection/managers/kup-language/kup-language-declarations.js +11 -0
  82. package/dist/collection/managers/kup-objects/kup-objects.js +10 -0
  83. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.js +2 -0
  84. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover.js +131 -45
  85. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +20 -3
  86. package/dist/collection/types/GenericTypes.js +3 -2
  87. package/dist/collection/utils/filters/filters-rows.js +4 -23
  88. package/dist/collection/utils/filters/filters-tree-items.js +2 -1
  89. package/dist/esm/{f-button-871a544b.js → f-button-cd948e50.js} +4 -4
  90. package/dist/esm/{f-cell-521ef17a.js → f-cell-474dd282.js} +46 -283
  91. package/dist/esm/f-checkbox-e06cf07b.js +27 -0
  92. package/dist/esm/{f-chip-1dda722f.js → f-chip-d6f2eb94.js} +3 -3
  93. package/dist/esm/{f-image-c468d8ae.js → f-image-914a03ef.js} +2 -2
  94. package/dist/esm/{f-paginator-utils-7dff8ff0.js → f-paginator-utils-a4a52732.js} +44 -366
  95. package/dist/esm/{f-text-field-d6c61c73.js → f-text-field-76341fe3.js} +11 -3
  96. package/dist/esm/{index-baeab1ac.js → index-e41330a5.js} +15 -8
  97. package/dist/esm/ketchup.js +3 -3
  98. package/dist/esm/kup-accordion.entry.js +3 -4
  99. package/dist/esm/kup-autocomplete_25.entry.js +222 -190
  100. package/dist/esm/kup-box.entry.js +1300 -0
  101. package/dist/esm/kup-calendar.entry.js +5 -7
  102. package/dist/esm/kup-cell.entry.js +7 -8
  103. package/dist/esm/kup-dash-list.entry.js +2 -4
  104. package/dist/esm/kup-dash_2.entry.js +3 -7
  105. package/dist/esm/kup-dashboard.entry.js +434 -0
  106. package/dist/esm/kup-drawer.entry.js +3 -4
  107. package/dist/esm/{kup-box_2.entry.js → kup-echart.entry.js} +61 -1347
  108. package/dist/esm/kup-family-tree.entry.js +482 -0
  109. package/dist/esm/kup-form.entry.js +474 -0
  110. package/dist/esm/kup-iframe.entry.js +2 -3
  111. package/dist/esm/kup-image-list.entry.js +70 -10
  112. package/dist/esm/kup-lazy.entry.js +3 -4
  113. package/dist/esm/kup-magic-box.entry.js +3 -4
  114. package/dist/esm/{kup-manager-58b075b4.js → kup-manager-86f440c7.js} +1762 -357
  115. package/dist/esm/kup-nav-bar.entry.js +2 -3
  116. package/dist/esm/kup-numeric-picker.entry.js +3 -3
  117. package/dist/esm/kup-photo-frame.entry.js +4 -5
  118. package/dist/esm/kup-probe.entry.js +2 -2
  119. package/dist/esm/kup-qlik.entry.js +2 -2
  120. package/dist/esm/kup-snackbar.entry.js +4 -5
  121. package/dist/esm/loader.js +3 -3
  122. package/dist/ketchup/ketchup.esm.js +1 -1
  123. package/dist/ketchup/p-00e1133d.entry.js +9 -0
  124. package/dist/ketchup/p-066f344a.entry.js +1 -0
  125. package/dist/ketchup/p-0c6e0647.entry.js +1 -0
  126. package/dist/ketchup/p-151f7c17.entry.js +27 -0
  127. package/dist/ketchup/p-1e9c03b0.entry.js +1 -0
  128. package/dist/ketchup/p-21ea11cb.js +30 -0
  129. package/dist/ketchup/{p-fac1a08b.entry.js → p-2f4e6c50.entry.js} +1 -1
  130. package/dist/ketchup/p-3586f59c.js +1 -0
  131. package/dist/ketchup/p-359fd90d.entry.js +1 -0
  132. package/dist/ketchup/p-389fd0bf.js +1 -0
  133. package/dist/ketchup/p-5552f156.js +1 -0
  134. package/dist/ketchup/{p-f09f2f98.entry.js → p-77aff9c1.entry.js} +1 -1
  135. package/dist/ketchup/p-7cfdf53c.entry.js +39 -0
  136. package/dist/ketchup/p-853a5178.entry.js +1 -0
  137. package/dist/ketchup/{p-44ec4f03.js → p-8673bd4e.js} +1 -1
  138. package/dist/ketchup/p-8b55b786.entry.js +1 -0
  139. package/dist/ketchup/p-95f5834b.entry.js +1 -0
  140. package/dist/ketchup/p-a2c595c4.js +1 -0
  141. package/dist/ketchup/p-ae91f27e.entry.js +1 -0
  142. package/dist/ketchup/p-af664379.js +1 -0
  143. package/dist/ketchup/p-b0b3989b.js +2 -0
  144. package/dist/ketchup/p-b3b65a61.entry.js +1 -0
  145. package/dist/ketchup/p-bc306a53.entry.js +1 -0
  146. package/dist/ketchup/{p-f71a1675.entry.js → p-c3783b77.entry.js} +1 -1
  147. package/dist/ketchup/{p-7eff4eee.js → p-cd4fc3fb.js} +1 -1
  148. package/dist/ketchup/p-cee76b14.entry.js +1 -0
  149. package/dist/ketchup/p-cfaea29b.entry.js +1 -0
  150. package/dist/ketchup/p-d2f51e7b.entry.js +1 -0
  151. package/dist/ketchup/p-df8e6a4d.entry.js +1 -0
  152. package/dist/ketchup/p-e60a1170.entry.js +1 -0
  153. package/dist/ketchup/p-e9a1ba04.entry.js +1 -0
  154. package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +1 -16
  155. package/dist/types/components/{kup-form-editor/kup-form-editor-declarations.d.ts → kup-dashboard/kup-dashboard-declarations.d.ts} +9 -27
  156. package/dist/types/components/{kup-form-editor/kup-form-editor.d.ts → kup-dashboard/kup-dashboard.d.ts} +17 -9
  157. package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
  158. package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +37 -0
  159. package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +82 -0
  160. package/dist/types/components/kup-form/kup-form-declarations.d.ts +60 -0
  161. package/dist/types/components/kup-form/kup-form.d.ts +63 -0
  162. package/dist/types/components/kup-image-list/kup-image-list-state.d.ts +6 -0
  163. package/dist/types/components/kup-image-list/kup-image-list.d.ts +17 -0
  164. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +4 -0
  165. package/dist/types/components/kup-text-field/kup-text-field.d.ts +10 -0
  166. package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +0 -6
  167. package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +2 -0
  168. package/dist/types/components/kup-tree/kup-tree.d.ts +0 -1
  169. package/dist/types/components.d.ts +492 -231
  170. package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +4 -1
  171. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +2 -0
  172. package/dist/types/managers/kup-data/kup-data-cell-helper.d.ts +13 -6
  173. package/dist/types/managers/kup-data/kup-data-declarations.d.ts +8 -0
  174. package/dist/types/managers/kup-data/kup-data-node-helper.d.ts +15 -1
  175. package/dist/types/managers/kup-data/kup-data.d.ts +9 -2
  176. package/dist/types/managers/kup-language/kup-language-declarations.d.ts +11 -1
  177. package/dist/types/managers/kup-objects/kup-objects.d.ts +6 -0
  178. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.d.ts +9 -1
  179. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover.d.ts +7 -5
  180. package/dist/types/types/GenericTypes.d.ts +3 -2
  181. package/dist/types/utils/filters/filters-rows.d.ts +0 -2
  182. package/package.json +2 -2
  183. package/dist/cjs/cell-utils-a78d6fac.js +0 -168
  184. package/dist/cjs/f-cell-69294bca.js +0 -653
  185. package/dist/cjs/kup-field.cjs.entry.js +0 -241
  186. package/dist/cjs/kup-form-editor.cjs.entry.js +0 -404
  187. package/dist/cjs/utils-6287d878.js +0 -447
  188. package/dist/collection/assets/form-editor.js +0 -338
  189. package/dist/collection/components/kup-field/kup-field-declarations.js +0 -15
  190. package/dist/collection/components/kup-field/kup-field.css +0 -48
  191. package/dist/collection/components/kup-field/kup-field.js +0 -514
  192. package/dist/collection/components/kup-form-editor/kup-form-editor-declarations.js +0 -23
  193. package/dist/esm/cell-utils-964da6b5.js +0 -160
  194. package/dist/esm/kup-field.entry.js +0 -237
  195. package/dist/esm/kup-form-editor.entry.js +0 -400
  196. package/dist/esm/utils-d7e4b3c2.js +0 -428
  197. package/dist/ketchup/p-1ae66cc5.js +0 -1
  198. package/dist/ketchup/p-34b74425.js +0 -1
  199. package/dist/ketchup/p-3c11e615.entry.js +0 -1
  200. package/dist/ketchup/p-4ffbc3ff.js +0 -1
  201. package/dist/ketchup/p-5264a3e6.entry.js +0 -1
  202. package/dist/ketchup/p-65974e48.entry.js +0 -1
  203. package/dist/ketchup/p-65b46587.entry.js +0 -40
  204. package/dist/ketchup/p-6dff70f8.entry.js +0 -1
  205. package/dist/ketchup/p-7454cb92.js +0 -1
  206. package/dist/ketchup/p-80968627.entry.js +0 -1
  207. package/dist/ketchup/p-8cdf61a4.js +0 -1
  208. package/dist/ketchup/p-954cc340.entry.js +0 -1
  209. package/dist/ketchup/p-976244f9.entry.js +0 -9
  210. package/dist/ketchup/p-99e0d768.entry.js +0 -1
  211. package/dist/ketchup/p-a0f6e25c.entry.js +0 -1
  212. package/dist/ketchup/p-a615a92b.entry.js +0 -1
  213. package/dist/ketchup/p-aca0e54b.js +0 -30
  214. package/dist/ketchup/p-b8939a8b.entry.js +0 -1
  215. package/dist/ketchup/p-bfc3bac7.js +0 -1
  216. package/dist/ketchup/p-c5ce8951.entry.js +0 -1
  217. package/dist/ketchup/p-d2ee56dd.entry.js +0 -1
  218. package/dist/ketchup/p-db71436b.entry.js +0 -27
  219. package/dist/ketchup/p-e0035c58.js +0 -1
  220. package/dist/ketchup/p-e1039cf2.entry.js +0 -1
  221. package/dist/ketchup/p-ea10176c.entry.js +0 -1
  222. package/dist/types/components/kup-field/kup-field-declarations.d.ts +0 -25
  223. package/dist/types/components/kup-field/kup-field.d.ts +0 -90
@@ -1,5 +1,5 @@
1
- import { KupTagNames } from '../../types/GenericTypes';
2
- import { autoAlignComps, editableTypes, FCellClasses, FCellEvents, FCellShapes, FCellTypes, kupTypes, } from './f-cell-declarations';
1
+ import { KupTagNames, } from '../../types/GenericTypes';
2
+ import { autoCenterComps, editableTypes, FCellClasses, FCellEvents, FCellTypes, fullWidthFieldsComps, kupTypes, } from './f-cell-declarations';
3
3
  import { h } from '@stencil/core';
4
4
  import { getCellValueForDisplay } from '../../utils/cell-utils';
5
5
  import { FCheckbox } from '../f-checkbox/f-checkbox';
@@ -8,6 +8,7 @@ import { stringToNumber } from '../../utils/utils';
8
8
  import { FImage } from '../f-image/f-image';
9
9
  import { FChip } from '../f-chip/f-chip';
10
10
  import { KupThemeColorValues } from '../../managers/kup-theme/kup-theme-declarations';
11
+ import { FSwitch } from '../f-switch/f-switch';
11
12
  const dom = document.documentElement;
12
13
  /*-------------------------------------------------*/
13
14
  /* C o m p o n e n t */
@@ -26,7 +27,7 @@ export const FCell = (props, children) => {
26
27
  const hasObj = !dom.ketchup.objects.isEmptyKupObj(cell.obj);
27
28
  const isEditable = cell.isEditable && props.editable ? true : false;
28
29
  const valueToDisplay = props.previousValue !== cell.value ? cell.value : '';
29
- const cellType = getCellType(cell, shape);
30
+ const cellType = dom.ketchup.data.cell.getType(cell, shape);
30
31
  const subcomponentProps = Object.assign({}, cell.data);
31
32
  let cssClasses = cell.cssClass
32
33
  ? cell.cssClass
@@ -201,27 +202,28 @@ function setCellSizeKup(cellType, subcomponentProps, cell) {
201
202
  function setEditableCell(cellType, classObj, cell, column, props) {
202
203
  switch (cellType) {
203
204
  case FCellTypes.AUTOCOMPLETE:
204
- return (h("kup-autocomplete", Object.assign({}, cell.data, { class: "kup-full-width", "onkup-autocomplete-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-autocomplete-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT), "onkup-autocomplete-iconclick": (e) => cellEvent(e, props, cellType, FCellEvents.ICON_CLICK) })));
205
+ return (h("kup-autocomplete", Object.assign({ initialValue: cell.value }, cell.data, { class: isFullWidth(props) ? 'kup-full-width' : '', "onkup-autocomplete-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-autocomplete-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT), "onkup-autocomplete-iconclick": (e) => cellEvent(e, props, cellType, FCellEvents.ICON_CLICK) })));
205
206
  case FCellTypes.CHECKBOX:
206
- if (autoAlignComps.includes(props.component.rootElement
207
- .tagName)) {
207
+ if (isAutoCentered(props)) {
208
208
  classObj[FCellClasses.C_CENTERED] = true;
209
209
  }
210
210
  return (h(FCheckbox, Object.assign({}, cell.data, { onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
211
211
  case FCellTypes.COLOR_PICKER:
212
- return (h("kup-color-picker", Object.assign({}, cell.data, { class: "kup-full-width", disabled: false, "onkup-colorpicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
212
+ return (h("kup-color-picker", Object.assign({ initialValue: cell.value }, cell.data, { class: isFullWidth(props) ? 'kup-full-width' : '', disabled: false, "onkup-colorpicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
213
213
  case FCellTypes.COMBOBOX:
214
- return (h("kup-combobox", Object.assign({}, cell.data, { class: "kup-full-width", "onkup-combobox-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-combobox-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT), "onkup-combobox-iconclick": (e) => cellEvent(e, props, cellType, FCellEvents.ICON_CLICK) })));
214
+ return (h("kup-combobox", Object.assign({ initialValue: cell.value }, cell.data, { class: isFullWidth(props) ? 'kup-full-width' : '', "onkup-combobox-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-combobox-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT), "onkup-combobox-iconclick": (e) => cellEvent(e, props, cellType, FCellEvents.ICON_CLICK) })));
215
215
  case FCellTypes.DATE:
216
- return (h("kup-date-picker", Object.assign({ initialValue: cell.value }, cell.data, { class: "kup-full-width", "onkup-datepicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-datepicker-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
216
+ return (h("kup-date-picker", Object.assign({ initialValue: cell.value }, cell.data, { class: isFullWidth(props) ? 'kup-full-width' : '', "onkup-datepicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-datepicker-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
217
217
  case FCellTypes.RATING:
218
218
  return (h("kup-rating", Object.assign({}, cell.data, { disabled: false, "onkup-rating-click": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
219
+ case FCellTypes.SWITCH:
220
+ return (h(FSwitch, Object.assign({}, cell.data, { disabled: false, onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
219
221
  case FCellTypes.TIME:
220
- return (h("kup-time-picker", Object.assign({ initialValue: cell.value }, cell.data, { class: "kup-full-width", "onkup-timepicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-timepicker-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
222
+ return (h("kup-time-picker", Object.assign({ initialValue: cell.value }, cell.data, { class: isFullWidth(props) ? 'kup-full-width' : '', "onkup-timepicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-timepicker-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
221
223
  case FCellTypes.NUMBER:
222
224
  classObj[FCellClasses.C_RIGHT_ALIGNED] = true;
223
225
  case FCellTypes.STRING:
224
- return (h(FTextField, Object.assign({}, cell.data, { icon: cell.icon ? cell.icon : column.icon ? column.icon : null, fullWidth: true, inputType: cellType === FCellTypes.NUMBER ? 'number' : null, value: cellType === FCellTypes.NUMBER
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
225
227
  ? stringToNumber(cell.value).toString()
226
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) })));
227
229
  }
@@ -239,8 +241,7 @@ function setCell(cellType, subcomponentProps, content, classObj, cell, column, p
239
241
  }
240
242
  return content;
241
243
  case FCellTypes.CHECKBOX:
242
- if (autoAlignComps.includes(props.component.rootElement
243
- .tagName)) {
244
+ if (isAutoCentered(props)) {
244
245
  classObj[FCellClasses.C_CENTERED] = true;
245
246
  }
246
247
  return (h(FImage, { resource: subcomponentProps.checked
@@ -250,8 +251,7 @@ function setCell(cellType, subcomponentProps, content, classObj, cell, column, p
250
251
  return h("div", { innerHTML: cell.value });
251
252
  case FCellTypes.ICON:
252
253
  case FCellTypes.IMAGE:
253
- if (autoAlignComps.includes(props.component.rootElement
254
- .tagName)) {
254
+ if (isAutoCentered(props)) {
255
255
  classObj[FCellClasses.C_CENTERED] = true;
256
256
  }
257
257
  if (subcomponentProps.badgeData) {
@@ -267,13 +267,18 @@ function setCell(cellType, subcomponentProps, content, classObj, cell, column, p
267
267
  if (cellValueNumber < 0) {
268
268
  classObj[FCellClasses.TEXT_DANGER] = true;
269
269
  }
270
- if (autoAlignComps.includes(props.component.rootElement
271
- .tagName)) {
270
+ if (isAutoCentered(props)) {
272
271
  classObj[FCellClasses.C_RIGHT_ALIGNED] = true;
273
272
  }
274
273
  return h("div", { class: "f-cell__text" }, cellValue);
275
274
  }
276
275
  return h("div", { class: "f-cell__text" }, content);
276
+ case FCellTypes.SWITCH:
277
+ if (isAutoCentered(props)) {
278
+ classObj[FCellClasses.C_CENTERED] = true;
279
+ }
280
+ subcomponentProps['disabled'] = true;
281
+ return h(FSwitch, Object.assign({}, subcomponentProps));
277
282
  default:
278
283
  return h("div", { class: "f-cell__text" }, content);
279
284
  }
@@ -293,14 +298,12 @@ function setKupCell(cellType, classObj, subcomponentProps, cell, row, column, pr
293
298
  h(FImage, Object.assign({}, subcomponentProps))));
294
299
  }
295
300
  case FCellTypes.BUTTON:
296
- if (autoAlignComps.includes(props.component.rootElement
297
- .tagName)) {
301
+ if (isAutoCentered(props)) {
298
302
  classObj[FCellClasses.C_CENTERED] = true;
299
303
  }
300
304
  return (h("kup-button", Object.assign({}, subcomponentProps, { "onkup-button-click": (e) => cellEvent(e, props, cellType, FCellEvents.CLICK) })));
301
305
  case FCellTypes.BUTTON_LIST:
302
- if (autoAlignComps.includes(props.component.rootElement
303
- .tagName)) {
306
+ if (isAutoCentered(props)) {
304
307
  classObj[FCellClasses.C_CENTERED] = true;
305
308
  }
306
309
  subcomponentProps['data-storage'] = {
@@ -310,23 +313,21 @@ function setKupCell(cellType, classObj, subcomponentProps, cell, row, column, pr
310
313
  };
311
314
  return h("kup-button-list", Object.assign({}, subcomponentProps));
312
315
  case FCellTypes.CHART:
313
- if (autoAlignComps.includes(props.component.rootElement
314
- .tagName)) {
316
+ if (isAutoCentered(props)) {
315
317
  classObj[FCellClasses.C_CENTERED] = true;
316
318
  }
317
319
  return h("kup-chart", Object.assign({}, subcomponentProps));
318
320
  case FCellTypes.CHIP:
319
321
  return h(FChip, Object.assign({}, subcomponentProps));
320
322
  case FCellTypes.COLOR_PICKER:
321
- return (h("kup-color-picker", Object.assign({}, subcomponentProps, { class: "kup-full-width", disabled: true })));
323
+ return (h("kup-color-picker", Object.assign({}, subcomponentProps, { class: isFullWidth(props) ? 'kup-full-width' : '', disabled: true })));
322
324
  case FCellTypes.GAUGE:
323
325
  return (h("kup-gauge", Object.assign({ value: stringToNumber(cell.value), "width-component": "280px" }, subcomponentProps)));
324
326
  case FCellTypes.KNOB:
325
327
  case FCellTypes.PROGRESS_BAR:
326
328
  return h("kup-progress-bar", Object.assign({}, subcomponentProps));
327
329
  case FCellTypes.RADIO:
328
- if (autoAlignComps.includes(props.component.rootElement
329
- .tagName)) {
330
+ if (isAutoCentered(props)) {
330
331
  classObj[FCellClasses.C_CENTERED] = true;
331
332
  }
332
333
  subcomponentProps['disabled'] = row.readOnly;
@@ -335,94 +336,6 @@ function setKupCell(cellType, classObj, subcomponentProps, cell, row, column, pr
335
336
  return h("kup-rating", Object.assign({}, subcomponentProps, { disabled: true }));
336
337
  }
337
338
  }
338
- function getCellType(cell, shape) {
339
- const obj = cell.obj;
340
- if (shape) {
341
- switch (shape.toUpperCase()) {
342
- case FCellShapes.AUTOCOMPLETE:
343
- return FCellTypes.AUTOCOMPLETE;
344
- case FCellShapes.BUTTON_LIST:
345
- return FCellTypes.BUTTON_LIST;
346
- case FCellShapes.CHART:
347
- return FCellTypes.CHART;
348
- case FCellShapes.CHECKBOX:
349
- return FCellTypes.CHECKBOX;
350
- case FCellShapes.CHIP:
351
- return FCellTypes.CHIP;
352
- case FCellShapes.COLOR_PICKER:
353
- return FCellTypes.COLOR_PICKER;
354
- case FCellShapes.COMBOBOX:
355
- return FCellTypes.COMBOBOX;
356
- case FCellShapes.EDITOR:
357
- return FCellTypes.EDITOR;
358
- case FCellShapes.GAUGE:
359
- return FCellTypes.GAUGE;
360
- case FCellShapes.IMAGE:
361
- return FCellTypes.IMAGE;
362
- case FCellShapes.KNOB:
363
- return FCellTypes.KNOB;
364
- case FCellShapes.PROGRESS_BAR:
365
- return FCellTypes.PROGRESS_BAR;
366
- case FCellShapes.RADIO:
367
- return FCellTypes.RADIO;
368
- case FCellShapes.RATING:
369
- return FCellTypes.RATING;
370
- case FCellShapes.TEXT_FIELD:
371
- return FCellTypes.STRING;
372
- }
373
- }
374
- if (dom.ketchup.objects.isBar(obj)) {
375
- return FCellTypes.BAR;
376
- }
377
- else if (dom.ketchup.objects.isButton(obj)) {
378
- return FCellTypes.BUTTON;
379
- }
380
- else if (dom.ketchup.objects.isChart(obj)) {
381
- return FCellTypes.CHART;
382
- }
383
- else if (dom.ketchup.objects.isCheckbox(obj)) {
384
- return FCellTypes.CHECKBOX;
385
- }
386
- else if (dom.ketchup.objects.isColor(obj)) {
387
- return FCellTypes.COLOR_PICKER;
388
- }
389
- else if (dom.ketchup.objects.isIcon(obj)) {
390
- return FCellTypes.ICON;
391
- }
392
- else if (dom.ketchup.objects.isImage(obj)) {
393
- return FCellTypes.IMAGE;
394
- }
395
- else if (dom.ketchup.objects.isLink(obj)) {
396
- return FCellTypes.LINK;
397
- }
398
- else if (dom.ketchup.objects.isProgressBar(obj)) {
399
- return FCellTypes.PROGRESS_BAR;
400
- }
401
- else if (dom.ketchup.objects.isRadio(obj)) {
402
- return FCellTypes.RADIO;
403
- }
404
- else if (dom.ketchup.objects.isKupObjList(obj)) {
405
- return FCellTypes.CHIP;
406
- }
407
- else if (dom.ketchup.objects.isNumber(obj)) {
408
- return FCellTypes.NUMBER;
409
- }
410
- else if (dom.ketchup.objects.isDate(obj)) {
411
- return FCellTypes.DATE;
412
- }
413
- else if (dom.ketchup.objects.isTimestamp(obj)) {
414
- return FCellTypes.DATETIME;
415
- }
416
- else if (dom.ketchup.objects.isTime(obj)) {
417
- return FCellTypes.TIME;
418
- }
419
- else if (dom.ketchup.objects.isVoCodver(obj)) {
420
- return FCellTypes.ICON;
421
- }
422
- else {
423
- return FCellTypes.STRING;
424
- }
425
- }
426
339
  function cellEvent(e, props, cellType, cellEventName) {
427
340
  const cell = props.cell;
428
341
  const column = props.column;
@@ -443,6 +356,7 @@ function cellEvent(e, props, cellType, cellEventName) {
443
356
  }
444
357
  break;
445
358
  case FCellTypes.CHECKBOX:
359
+ case FCellTypes.SWITCH:
446
360
  value = value === 'on' ? '0' : '1';
447
361
  if (cell.data) {
448
362
  cell.data.checked =
@@ -479,3 +393,9 @@ function cellEvent(e, props, cellType, cellEventName) {
479
393
  catch (error) { }
480
394
  }
481
395
  }
396
+ function isAutoCentered(props) {
397
+ return autoCenterComps.includes(props.component.rootElement.tagName);
398
+ }
399
+ function isFullWidth(props) {
400
+ return fullWidthFieldsComps.includes(props.component.rootElement.tagName);
401
+ }
@@ -55,7 +55,15 @@ 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, 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.label : undefined, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onChange: (e) => {
59
+ if (props.decimals !== null &&
60
+ props.inputType === 'number') {
61
+ e.target.value = parseFloat(e.target.value).toFixed(props.decimals);
62
+ }
63
+ if (props.onChange) {
64
+ props.onChange(e);
65
+ }
66
+ }, onClick: props.onClick, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown })),
59
67
  props.isClearable ? (h("span", { class: `mdc-text-field__icon kup-icon ${KupThemeIconValues.CLEAR.replace('--', '')}`, onClick: props.onClearIconClick })) : undefined,
60
68
  props.trailingIcon ? iconEl : undefined,
61
69
  !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,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.
@@ -70,6 +70,44 @@ export function toStreamNode(nodes) {
70
70
  }
71
71
  return streamlined;
72
72
  }
73
+ /**
74
+ * Gets information about the tree depth, such as max number of children and max depth.
75
+ * @param {KupDataNode[]} nodes - Input array of nodes.
76
+ * @returns {KupDataNodeDrilldownInfo} Information about the tree depth.
77
+ */
78
+ export function getDrilldownInfoNode(nodes) {
79
+ let maxChildren = 0;
80
+ let maxDepth = 0;
81
+ const getDepth = function (n) {
82
+ const depth = 0;
83
+ if (n.children) {
84
+ n.children.forEach(function (d) {
85
+ const tmpDepth = getDepth(d);
86
+ if (tmpDepth > depth) {
87
+ maxDepth = tmpDepth;
88
+ }
89
+ });
90
+ }
91
+ return depth;
92
+ };
93
+ const recursive = (arr) => {
94
+ maxDepth++;
95
+ for (let index = 0; index < arr.length; index++) {
96
+ const node = arr[index];
97
+ getDepth(node);
98
+ if (Array.isArray(node.children) &&
99
+ maxChildren < node.children.length) {
100
+ maxChildren = node.children.length;
101
+ recursive(node.children);
102
+ }
103
+ }
104
+ };
105
+ recursive(nodes);
106
+ return {
107
+ maxChildren,
108
+ maxDepth,
109
+ };
110
+ }
73
111
  /**
74
112
  * Returns the parent of the given node.
75
113
  * @param {KupDataNode[]} nodes - Input array of nodes.
@@ -94,3 +132,34 @@ export function getParentNode(nodes, child) {
94
132
  }
95
133
  return parent;
96
134
  }
135
+ /**
136
+ * Returns the node with id equal to the given value.
137
+ * @param {KupDataNode[]} nodes - Input array of nodes.
138
+ * @param {string} treeNodePath - Tree node path.
139
+ * @returns {KupDataNode} Node.
140
+ */
141
+ export function getNodeByPath(nodes, treeNodePath) {
142
+ if (!nodes || nodes.length == 0) {
143
+ return undefined;
144
+ }
145
+ if (!treeNodePath || treeNodePath.length == 0) {
146
+ return undefined;
147
+ }
148
+ return _getNodeByPath(nodes, treeNodePath);
149
+ }
150
+ function _getNodeByPath(nodes, path) {
151
+ let node = null;
152
+ for (let j = 0; j < path.length; j++) {
153
+ const i = path[j];
154
+ node = _getNode(nodes, node, i);
155
+ }
156
+ return node;
157
+ }
158
+ function _getNode(nodes, node, index) {
159
+ if (node == null) {
160
+ return nodes[index];
161
+ }
162
+ else {
163
+ return node.children[index];
164
+ }
165
+ }
@@ -2,9 +2,10 @@ import { KupDataNewColumnTypes, } from './kup-data-declarations';
2
2
  import { findCell, getCellValue, replaceCell } from './kup-data-cell-helper';
3
3
  import { findColumns, hideColumns, newColumn } from './kup-data-column-helper';
4
4
  import { findRow, toNode } from './kup-data-row-helper';
5
- import { getParentNode, removeNode, setPropertiesNode, toStreamNode, } from './kup-data-node-helper';
5
+ import { getDrilldownInfoNode, getNodeByPath, getParentNode, removeNode, setPropertiesNode, toStreamNode, } from './kup-data-node-helper';
6
6
  import { fieldColumn } from '../../components/kup-data-table/kup-data-table-declarations';
7
7
  import { KupDebugCategory } from '../kup-debug/kup-debug-declarations';
8
+ import { FCellShapes, FCellTypes, } from '../../f-components/f-cell/f-cell-declarations';
8
9
  const dom = document.documentElement;
9
10
  /**
10
11
  * Handles data operations.
@@ -16,12 +17,105 @@ export class KupData {
16
17
  find(dataset, filters) {
17
18
  return findCell(dataset, filters);
18
19
  },
19
- getValue(dataset, columns) {
20
- return getCellValue(dataset, columns);
20
+ getValue(dataset, column, sorted) {
21
+ return getCellValue(dataset, column, sorted);
21
22
  },
22
23
  replace(dataset, cell, columns) {
23
24
  return replaceCell(dataset, cell, columns);
24
25
  },
26
+ getType(cell, shape) {
27
+ const obj = cell.obj;
28
+ if (shape) {
29
+ switch (shape.toUpperCase()) {
30
+ case FCellShapes.AUTOCOMPLETE:
31
+ return FCellTypes.AUTOCOMPLETE;
32
+ case FCellShapes.BUTTON_LIST:
33
+ return FCellTypes.BUTTON_LIST;
34
+ case FCellShapes.CHART:
35
+ return FCellTypes.CHART;
36
+ case FCellShapes.CHECKBOX:
37
+ return FCellTypes.CHECKBOX;
38
+ case FCellShapes.CHIP:
39
+ return FCellTypes.CHIP;
40
+ case FCellShapes.COLOR_PICKER:
41
+ return FCellTypes.COLOR_PICKER;
42
+ case FCellShapes.COMBOBOX:
43
+ return FCellTypes.COMBOBOX;
44
+ case FCellShapes.EDITOR:
45
+ return FCellTypes.EDITOR;
46
+ case FCellShapes.GAUGE:
47
+ return FCellTypes.GAUGE;
48
+ case FCellShapes.IMAGE:
49
+ return FCellTypes.IMAGE;
50
+ case FCellShapes.KNOB:
51
+ return FCellTypes.KNOB;
52
+ case FCellShapes.PROGRESS_BAR:
53
+ return FCellTypes.PROGRESS_BAR;
54
+ case FCellShapes.RADIO:
55
+ return FCellTypes.RADIO;
56
+ case FCellShapes.RATING:
57
+ return FCellTypes.RATING;
58
+ case FCellShapes.SWITCH:
59
+ return FCellTypes.SWITCH;
60
+ case FCellShapes.TEXT_FIELD:
61
+ return FCellTypes.STRING;
62
+ }
63
+ }
64
+ if (dom.ketchup.objects.isBar(obj)) {
65
+ return FCellTypes.BAR;
66
+ }
67
+ else if (dom.ketchup.objects.isButton(obj)) {
68
+ return FCellTypes.BUTTON;
69
+ }
70
+ else if (dom.ketchup.objects.isChart(obj)) {
71
+ return FCellTypes.CHART;
72
+ }
73
+ else if (dom.ketchup.objects.isCheckbox(obj)) {
74
+ return FCellTypes.CHECKBOX;
75
+ }
76
+ else if (dom.ketchup.objects.isColor(obj)) {
77
+ return FCellTypes.COLOR_PICKER;
78
+ }
79
+ else if (dom.ketchup.objects.isIcon(obj)) {
80
+ return FCellTypes.ICON;
81
+ }
82
+ else if (dom.ketchup.objects.isImage(obj)) {
83
+ return FCellTypes.IMAGE;
84
+ }
85
+ else if (dom.ketchup.objects.isLink(obj)) {
86
+ return FCellTypes.LINK;
87
+ }
88
+ else if (dom.ketchup.objects.isProgressBar(obj)) {
89
+ return FCellTypes.PROGRESS_BAR;
90
+ }
91
+ else if (dom.ketchup.objects.isRadio(obj)) {
92
+ return FCellTypes.RADIO;
93
+ }
94
+ else if (dom.ketchup.objects.isSwitch(obj)) {
95
+ return FCellTypes.SWITCH;
96
+ }
97
+ else if (dom.ketchup.objects.isKupObjList(obj)) {
98
+ return FCellTypes.CHIP;
99
+ }
100
+ else if (dom.ketchup.objects.isNumber(obj)) {
101
+ return FCellTypes.NUMBER;
102
+ }
103
+ else if (dom.ketchup.objects.isDate(obj)) {
104
+ return FCellTypes.DATE;
105
+ }
106
+ else if (dom.ketchup.objects.isTimestamp(obj)) {
107
+ return FCellTypes.DATETIME;
108
+ }
109
+ else if (dom.ketchup.objects.isTime(obj)) {
110
+ return FCellTypes.TIME;
111
+ }
112
+ else if (dom.ketchup.objects.isVoCodver(obj)) {
113
+ return FCellTypes.ICON;
114
+ }
115
+ else {
116
+ return FCellTypes.STRING;
117
+ }
118
+ },
25
119
  };
26
120
  this.column = {
27
121
  find(dataset, filters) {
@@ -35,9 +129,23 @@ export class KupData {
35
129
  },
36
130
  };
37
131
  this.node = {
132
+ getDrilldownInfo(nodes) {
133
+ return getDrilldownInfoNode(nodes);
134
+ },
38
135
  getParent(nodes, child) {
39
136
  return getParentNode(nodes, child);
40
137
  },
138
+ find(nodes, treeNodePath) {
139
+ return getNodeByPath(nodes, treeNodePath);
140
+ },
141
+ findByStrTreeNodePath(nodes, treeNodePath) {
142
+ const split = treeNodePath.split(',');
143
+ const path = [];
144
+ for (let i = 0; i < split.length; i++) {
145
+ path.push(Number(split[i]));
146
+ }
147
+ return getNodeByPath(nodes, path);
148
+ },
41
149
  remove(nodes, node2remove) {
42
150
  return removeNode(nodes, node2remove);
43
151
  },
@@ -267,9 +375,9 @@ export class KupData {
267
375
  };
268
376
  const length = dataset.rows.length;
269
377
  // sort all columns values by descending
270
- let values = getCellValue(dataset, [headerColumn]);
378
+ let values = getCellValue(dataset, this.column.find(dataset, { name: headerColumn })[0]);
271
379
  values.sort(function (a, b) {
272
- return Number(a) - Number(b);
380
+ return Number(a.value) - Number(b.value);
273
381
  });
274
382
  values.reverse();
275
383
  // excluding duplicates values.
@@ -281,7 +389,7 @@ export class KupData {
281
389
  let rightIdx = idx + 1;
282
390
  // sort the rows like a "mountain", the greatest is in the middle and the other ones are splitted left and right
283
391
  for (let i = 0; i < length; i++) {
284
- const value = values[i];
392
+ const value = values[i].value;
285
393
  // looping the rows because we have many rows with same value.
286
394
  this.finder(dataset, {
287
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 =
@@ -36,6 +36,17 @@ export var KupLanguageColumn;
36
36
  KupLanguageColumn["NON_NUMERICAL_IN_TABLE"] = "columnNonNumericalInTable";
37
37
  KupLanguageColumn["SWAP"] = "columnSwap";
38
38
  })(KupLanguageColumn || (KupLanguageColumn = {}));
39
+ /**
40
+ * Dashboard related decodes.
41
+ */
42
+ export var KupLanguageDashboard;
43
+ (function (KupLanguageDashboard) {
44
+ KupLanguageDashboard["DIMENSION"] = "dashboardDimension";
45
+ KupLanguageDashboard["LOADED"] = "dashboardLoaded";
46
+ KupLanguageDashboard["RESET"] = "dashboardReset";
47
+ KupLanguageDashboard["SAVE"] = "dashboardSave";
48
+ KupLanguageDashboard["VERTICAL"] = "dashboardVertical";
49
+ })(KupLanguageDashboard || (KupLanguageDashboard = {}));
39
50
  /**
40
51
  * Debug widget decodes.
41
52
  */
@@ -228,6 +228,16 @@ export class KupObjects {
228
228
  !this.isRadio(obj) &&
229
229
  !this.isChart(obj));
230
230
  }
231
+ /**
232
+ * Checks whether the object represents a switch or not.
233
+ * @param {KupObj} obj - Object to check.
234
+ * @returns {boolean} True when the object is a switch.
235
+ */
236
+ isSwitch(obj) {
237
+ if (!obj)
238
+ return false;
239
+ return 'V2' === obj.t && 'ONOFF' === obj.p;
240
+ }
231
241
  /**
232
242
  * Checks whether the object represents a text field or not.
233
243
  * @param {KupObj} obj - Object to check.
@@ -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 = {}));