@sme.up/ketchup 5.2.1-SNAPSHOT → 6.2.0-SNAPSHOT

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 (231) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/cjs/{cell-utils-d96b2993.js → cell-utils-d894e802.js} +2 -2
  3. package/dist/cjs/{component-d1496215.js → component-72a5b626.js} +30 -0
  4. package/dist/cjs/{f-button-2b9b99b1.js → f-button-414b3bc3.js} +4 -4
  5. package/dist/cjs/f-cell-c8983ec7.js +418 -0
  6. package/dist/cjs/f-checkbox-57443ca3.js +29 -0
  7. package/dist/cjs/{f-chip-df59e1b0.js → f-chip-ef81bf51.js} +5 -4
  8. package/dist/cjs/{f-image-12bab3b5.js → f-image-0618c795.js} +2 -2
  9. package/dist/cjs/f-paginator-utils-c9dd5173.js +1898 -0
  10. package/dist/cjs/{f-text-field-e7c35b5b.js → f-text-field-7d31190f.js} +3 -3
  11. package/dist/cjs/{f-text-field-mdc-a67f5dfe.js → f-text-field-mdc-85997738.js} +23 -305
  12. package/dist/cjs/{index-eb556444.js → index-06b131ea.js} +6 -4
  13. package/dist/cjs/ketchup.cjs.js +3 -3
  14. package/dist/cjs/kup-accordion.cjs.entry.js +5 -5
  15. package/dist/cjs/{kup-autocomplete_27.cjs.entry.js → kup-autocomplete_25.cjs.entry.js} +1833 -5745
  16. package/dist/cjs/{kup-echart.cjs.entry.js → kup-box_2.cjs.entry.js} +17113 -14788
  17. package/dist/cjs/kup-calendar.cjs.entry.js +42 -34
  18. package/dist/cjs/kup-cell.cjs.entry.js +10 -9
  19. package/dist/cjs/kup-dash-list.cjs.entry.js +4 -4
  20. package/dist/cjs/kup-dash_2.cjs.entry.js +4 -7
  21. package/dist/cjs/kup-dashboard.cjs.entry.js +379 -0
  22. package/dist/cjs/kup-drawer.cjs.entry.js +12 -5
  23. package/dist/cjs/kup-field.cjs.entry.js +2 -2
  24. package/dist/cjs/kup-form.cjs.entry.js +469 -0
  25. package/dist/cjs/kup-iframe.cjs.entry.js +3 -3
  26. package/dist/cjs/kup-image-list.cjs.entry.js +229 -0
  27. package/dist/cjs/kup-lazy.cjs.entry.js +3 -3
  28. package/dist/cjs/kup-magic-box.cjs.entry.js +4 -4
  29. package/dist/cjs/kup-manager-2fee8cf3.js +17021 -0
  30. package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
  31. package/dist/cjs/kup-numeric-picker.cjs.entry.js +5 -5
  32. package/dist/cjs/kup-photo-frame.cjs.entry.js +7 -9
  33. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  34. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  35. package/dist/cjs/kup-snackbar.cjs.entry.js +6 -6
  36. package/dist/cjs/loader.cjs.js +3 -3
  37. package/dist/cjs/{utils-e99921c1.js → utils-8470184d.js} +1 -1
  38. package/dist/collection/assets/card.js +4 -5
  39. package/dist/collection/assets/dashboard.js +113 -0
  40. package/dist/collection/assets/data-table.js +15 -79
  41. package/dist/collection/assets/form.js +179 -0
  42. package/dist/collection/assets/grid.js +17 -0
  43. package/dist/collection/assets/image-list.js +624 -0
  44. package/dist/collection/assets/index.js +16 -4
  45. package/dist/collection/assets/kupdata.js +0 -3
  46. package/dist/collection/assets/kuptooltip.js +53 -7
  47. package/dist/collection/assets/tree.js +0 -128
  48. package/dist/collection/collection-manifest.json +8 -6
  49. package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +136 -130
  50. package/dist/collection/components/kup-box/kup-box-declarations.js +0 -4
  51. package/dist/collection/components/kup-box/kup-box.js +20 -137
  52. package/dist/collection/components/kup-card/built-in/kup-card-clock.js +1 -1
  53. package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +1 -2
  54. package/dist/collection/components/kup-card/kup-card.css +26 -8
  55. package/dist/collection/components/kup-card/kup-card.js +1 -2
  56. package/dist/collection/components/kup-card/standard/kup-card-standard.js +14 -6
  57. package/dist/collection/components/kup-combobox/kup-combobox.js +17 -14
  58. package/dist/collection/components/kup-dashboard/kup-dashboard-declarations.js +10 -0
  59. package/dist/collection/components/kup-dashboard/kup-dashboard.css +81 -0
  60. package/dist/collection/components/kup-dashboard/kup-dashboard.js +560 -0
  61. package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +1 -3
  62. package/dist/collection/components/kup-data-table/kup-data-table.js +19 -136
  63. package/dist/collection/components/kup-drawer/kup-drawer.css +6 -8
  64. package/dist/collection/components/kup-drawer/kup-drawer.js +8 -1
  65. package/dist/collection/components/kup-form/kup-form-declarations.js +19 -0
  66. package/dist/collection/components/kup-form/kup-form.css +86 -0
  67. package/dist/collection/components/kup-form/kup-form.js +668 -0
  68. package/dist/collection/components/kup-grid/kup-grid.js +1 -4
  69. package/dist/collection/components/kup-image-list/kup-image-list-declarations.js +10 -0
  70. package/dist/collection/components/kup-image-list/kup-image-list.css +166 -0
  71. package/dist/collection/components/kup-image-list/kup-image-list.js +432 -0
  72. package/dist/collection/components/kup-list/kup-list-helper.js +9 -3
  73. package/dist/collection/components/kup-photo-frame/kup-photo-frame.css +2 -9
  74. package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +3 -5
  75. package/dist/collection/components/kup-snackbar/kup-snackbar.css +4 -0
  76. package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +18 -19
  77. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +3 -0
  78. package/dist/collection/components/kup-text-field/kup-text-field.js +27 -0
  79. package/dist/collection/components/kup-time-picker/kup-time-picker.js +2 -8
  80. package/dist/collection/components/kup-tree/kup-tree-declarations.js +0 -4
  81. package/dist/collection/components/kup-tree/kup-tree.css +10 -3
  82. package/dist/collection/components/kup-tree/kup-tree.js +73 -142
  83. package/dist/collection/f-components/f-button/f-button.js +2 -2
  84. package/dist/collection/f-components/f-cell/f-cell-declarations.js +5 -1
  85. package/dist/collection/f-components/f-cell/f-cell.js +41 -121
  86. package/dist/collection/f-components/f-chip/f-chip.js +2 -1
  87. package/dist/collection/f-components/f-text-field/f-text-field.js +1 -1
  88. package/dist/collection/managers/kup-data/kup-data-node-helper.js +24 -0
  89. package/dist/collection/managers/kup-data/kup-data.js +98 -1
  90. package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js +4 -2
  91. package/dist/collection/managers/kup-interact/kup-interact.js +1 -22
  92. package/dist/collection/managers/kup-language/kup-language-declarations.js +13 -0
  93. package/dist/collection/managers/kup-manager/kup-manager.js +21 -2
  94. package/dist/collection/managers/kup-objects/kup-objects.js +10 -0
  95. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +21 -1
  96. package/dist/collection/managers/kup-tooltip/kup-tooltip.js +53 -20
  97. package/dist/collection/types/GenericTypes.js +3 -0
  98. package/dist/collection/utils/kup-column-menu/kup-column-menu.js +7 -11
  99. package/dist/esm/{cell-utils-f4bdbbc8.js → cell-utils-7fc84d4e.js} +3 -3
  100. package/dist/esm/{component-c4eb6153.js → component-b1bedf1d.js} +27 -2
  101. package/dist/esm/{f-button-54a49fd8.js → f-button-2f6cc296.js} +4 -4
  102. package/dist/esm/f-cell-4428481c.js +415 -0
  103. package/dist/esm/f-checkbox-c51c4a75.js +27 -0
  104. package/dist/esm/{f-chip-a3035b4b.js → f-chip-b39eb49a.js} +6 -5
  105. package/dist/esm/{f-image-d32465e3.js → f-image-b08ebeb2.js} +2 -2
  106. package/dist/esm/f-paginator-utils-4fda6086.js +1884 -0
  107. package/dist/esm/{f-text-field-c25cc63f.js → f-text-field-184a5fb3.js} +3 -3
  108. package/dist/esm/{f-text-field-mdc-9fbbefc3.js → f-text-field-mdc-d42d3f9e.js} +2 -284
  109. package/dist/esm/{index-baeab1ac.js → index-ad6ab214.js} +6 -4
  110. package/dist/esm/ketchup.js +3 -3
  111. package/dist/esm/kup-accordion.entry.js +6 -6
  112. package/dist/esm/{kup-autocomplete_27.entry.js → kup-autocomplete_25.entry.js} +1775 -5685
  113. package/dist/esm/{kup-echart.entry.js → kup-box_2.entry.js} +17113 -14789
  114. package/dist/esm/kup-calendar.entry.js +43 -35
  115. package/dist/esm/kup-cell.entry.js +9 -8
  116. package/dist/esm/kup-dash-list.entry.js +4 -4
  117. package/dist/esm/kup-dash_2.entry.js +4 -7
  118. package/dist/esm/kup-dashboard.entry.js +375 -0
  119. package/dist/esm/kup-drawer.entry.js +12 -5
  120. package/dist/esm/kup-field.entry.js +2 -2
  121. package/dist/esm/kup-form.entry.js +465 -0
  122. package/dist/esm/kup-iframe.entry.js +3 -3
  123. package/dist/esm/kup-image-list.entry.js +225 -0
  124. package/dist/esm/kup-lazy.entry.js +3 -3
  125. package/dist/esm/kup-magic-box.entry.js +4 -4
  126. package/dist/esm/kup-manager-3325b2d8.js +17000 -0
  127. package/dist/esm/kup-nav-bar.entry.js +3 -3
  128. package/dist/esm/kup-numeric-picker.entry.js +6 -6
  129. package/dist/esm/kup-photo-frame.entry.js +7 -9
  130. package/dist/esm/kup-probe.entry.js +2 -2
  131. package/dist/esm/kup-qlik.entry.js +2 -2
  132. package/dist/esm/kup-snackbar.entry.js +6 -6
  133. package/dist/esm/loader.js +3 -3
  134. package/dist/esm/polyfills/css-shim.js +1 -1
  135. package/dist/esm/{tslib.es6-8f2d44b6.js → tslib.es6-3eea2234.js} +1 -1
  136. package/dist/esm/{utils-f24319a0.js → utils-6373a07e.js} +2 -2
  137. package/dist/ketchup/ketchup.esm.js +1 -1
  138. package/dist/ketchup/p-006bc4d0.entry.js +1 -0
  139. package/dist/ketchup/p-0741da57.js +1 -0
  140. package/dist/ketchup/{p-669bde31.js → p-13e08580.js} +1 -1
  141. package/dist/ketchup/p-153697fb.entry.js +1 -0
  142. package/dist/ketchup/{p-9a61d8dc.entry.js → p-175edb62.entry.js} +1 -1
  143. package/dist/ketchup/{p-11e72a8c.entry.js → p-1db1d42b.entry.js} +1 -1
  144. package/dist/ketchup/{p-67842f1e.entry.js → p-30820f8f.entry.js} +1 -1
  145. package/dist/ketchup/p-35325834.entry.js +9 -0
  146. package/dist/ketchup/p-359e8bec.entry.js +40 -0
  147. package/dist/ketchup/{p-09d708c4.entry.js → p-3c7c92c0.entry.js} +1 -1
  148. package/dist/ketchup/p-41cf8703.entry.js +1 -0
  149. package/dist/ketchup/{p-e6709c26.entry.js → p-6127fccf.entry.js} +1 -1
  150. package/dist/ketchup/{p-203d6295.entry.js → p-6b82e4e2.entry.js} +1 -1
  151. package/dist/ketchup/p-704e60eb.js +30 -0
  152. package/dist/ketchup/{p-4f56932b.js → p-70660fe2.js} +1 -1
  153. package/dist/ketchup/{p-44192f30.entry.js → p-762c0382.entry.js} +1 -1
  154. package/dist/ketchup/{p-c58a2a81.entry.js → p-76947316.entry.js} +1 -1
  155. package/dist/ketchup/{p-a0b1d769.js → p-79b0730b.js} +1 -1
  156. package/dist/ketchup/{p-bb8844bf.entry.js → p-8103b80a.entry.js} +1 -1
  157. package/dist/ketchup/{p-8c44c3b9.js → p-81605f08.js} +4 -5
  158. package/dist/ketchup/p-9fa457d4.entry.js +1 -0
  159. package/dist/ketchup/{p-e8e3c9da.entry.js → p-a0ce8075.entry.js} +1 -1
  160. package/dist/ketchup/p-a203f78b.js +45 -0
  161. package/dist/ketchup/p-a804fe83.entry.js +27 -0
  162. package/dist/ketchup/{p-34748c91.js → p-ca9fd099.js} +1 -1
  163. package/dist/ketchup/p-caabb9ab.entry.js +1 -0
  164. package/dist/ketchup/p-cc3abf84.entry.js +1 -0
  165. package/dist/ketchup/p-cd5cfa7c.js +1 -0
  166. package/dist/ketchup/p-d2e76960.entry.js +1 -0
  167. package/dist/ketchup/p-d3b542b3.js +2 -0
  168. package/dist/ketchup/p-d7004ae4.js +1 -0
  169. package/dist/ketchup/{p-40f97429.js → p-d95c904b.js} +1 -1
  170. package/dist/ketchup/p-ddce3430.js +1 -0
  171. package/dist/ketchup/p-ee580b3a.entry.js +1 -0
  172. package/dist/ketchup/p-f49cb68e.js +1 -0
  173. package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +1 -16
  174. package/dist/types/components/kup-box/kup-box-declarations.d.ts +3 -5
  175. package/dist/types/components/kup-box/kup-box.d.ts +0 -22
  176. package/dist/types/components/kup-dashboard/kup-dashboard-declarations.d.ts +61 -0
  177. package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +75 -0
  178. package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +2 -4
  179. package/dist/types/components/kup-data-table/kup-data-table.d.ts +1 -19
  180. package/dist/types/components/kup-form/kup-form-declarations.d.ts +48 -0
  181. package/dist/types/components/kup-form/kup-form.d.ts +68 -0
  182. package/dist/types/components/kup-image-list/kup-image-list-declarations.d.ts +14 -0
  183. package/dist/types/components/kup-image-list/kup-image-list.d.ts +56 -0
  184. package/dist/types/components/kup-tab-bar/kup-tab-bar-declarations.d.ts +3 -9
  185. package/dist/types/components/kup-tab-bar/kup-tab-bar.d.ts +6 -6
  186. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +3 -0
  187. package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
  188. package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +0 -6
  189. package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +3 -5
  190. package/dist/types/components/kup-tree/kup-tree.d.ts +1 -24
  191. package/dist/types/components.d.ts +512 -369
  192. package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +4 -1
  193. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
  194. package/dist/types/managers/kup-data/kup-data-declarations.d.ts +1 -0
  195. package/dist/types/managers/kup-data/kup-data-node-helper.d.ts +7 -0
  196. package/dist/types/managers/kup-data/kup-data.d.ts +3 -0
  197. package/dist/types/managers/kup-language/kup-language-declarations.d.ts +13 -1
  198. package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +4 -0
  199. package/dist/types/managers/kup-manager/kup-manager.d.ts +12 -0
  200. package/dist/types/managers/kup-objects/kup-objects.d.ts +6 -0
  201. package/dist/types/managers/kup-tooltip/kup-tooltip-declarations.d.ts +3 -3
  202. package/dist/types/managers/kup-tooltip/kup-tooltip.d.ts +17 -6
  203. package/dist/types/types/GenericTypes.d.ts +3 -0
  204. package/dist/types/utils/kup-column-menu/kup-column-menu.d.ts +1 -3
  205. package/package.json +15 -14
  206. package/dist/cjs/f-cell-8351cb84.js +0 -653
  207. package/dist/cjs/kup-manager-5c03da64.js +0 -8795
  208. package/dist/collection/assets/tooltip.js +0 -73
  209. package/dist/collection/components/kup-tooltip/kup-tooltip-declarations.js +0 -20
  210. package/dist/collection/components/kup-tooltip/kup-tooltip.css +0 -149
  211. package/dist/collection/components/kup-tooltip/kup-tooltip.js +0 -1205
  212. package/dist/collection/utils/helpers.js +0 -38
  213. package/dist/esm/f-cell-d5dac50b.js +0 -650
  214. package/dist/esm/kup-manager-9316a184.js +0 -8778
  215. package/dist/ketchup/p-12773ca8.js +0 -9
  216. package/dist/ketchup/p-34b74425.js +0 -1
  217. package/dist/ketchup/p-4173422f.entry.js +0 -1
  218. package/dist/ketchup/p-41741c28.entry.js +0 -1
  219. package/dist/ketchup/p-44f8da2a.js +0 -1
  220. package/dist/ketchup/p-7a74ad17.js +0 -1
  221. package/dist/ketchup/p-7ba8fa4a.entry.js +0 -39
  222. package/dist/ketchup/p-7de0d7e1.js +0 -1
  223. package/dist/ketchup/p-8418e8fa.entry.js +0 -1
  224. package/dist/ketchup/p-96bf19aa.entry.js +0 -1
  225. package/dist/ketchup/p-b0ddcce9.entry.js +0 -9
  226. package/dist/ketchup/p-b6c21223.entry.js +0 -27
  227. package/dist/ketchup/p-ca3d585b.entry.js +0 -1
  228. package/dist/ketchup/p-ecb7069b.js +0 -135
  229. package/dist/types/components/kup-tooltip/kup-tooltip-declarations.d.ts +0 -93
  230. package/dist/types/components/kup-tooltip/kup-tooltip.d.ts +0 -142
  231. package/dist/types/utils/helpers.d.ts +0 -4
@@ -1,5 +1,6 @@
1
1
  import { KupTagNames, } from '../../types/GenericTypes';
2
- export const autoAlignComps = [KupTagNames.DATA_TABLE, KupTagNames.TREE];
2
+ export const autoCenterComps = [KupTagNames.DATA_TABLE, KupTagNames.TREE];
3
+ export const fullWidthFieldsComps = [KupTagNames.DATA_TABLE, KupTagNames.TREE];
3
4
  /**
4
5
  * Supported cell events.
5
6
  */
@@ -88,6 +89,7 @@ export var FCellShapes;
88
89
  FCellShapes["PROGRESS_BAR"] = "PGB";
89
90
  FCellShapes["RADIO"] = "RAD";
90
91
  FCellShapes["RATING"] = "RTG";
92
+ FCellShapes["SWITCH"] = "SWT";
91
93
  FCellShapes["TEXT_FIELD"] = "ITX";
92
94
  })(FCellShapes || (FCellShapes = {}));
93
95
  /**
@@ -117,6 +119,7 @@ export var FCellTypes;
117
119
  FCellTypes["RADIO"] = "radio";
118
120
  FCellTypes["RATING"] = "rating";
119
121
  FCellTypes["STRING"] = "string";
122
+ FCellTypes["SWITCH"] = "switch";
120
123
  FCellTypes["TIME"] = "time";
121
124
  })(FCellTypes || (FCellTypes = {}));
122
125
  export const editableTypes = [
@@ -128,6 +131,7 @@ export const editableTypes = [
128
131
  FCellTypes.NUMBER,
129
132
  FCellTypes.RATING,
130
133
  FCellTypes.STRING,
134
+ FCellTypes.SWITCH,
131
135
  FCellTypes.TIME,
132
136
  ];
133
137
  export const kupTypes = [
@@ -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,11 +8,12 @@ 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 */
14
15
  /*-------------------------------------------------*/
15
- export const FCell = (props) => {
16
+ export const FCell = (props, children) => {
16
17
  const cell = props.cell;
17
18
  const column = props.column;
18
19
  const row = props.row;
@@ -26,7 +27,7 @@ export const FCell = (props) => {
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
@@ -100,12 +101,12 @@ export const FCell = (props) => {
100
101
  };
101
102
  infoEl = h(FImage, Object.assign({}, fProps));
102
103
  }
103
- return (h("div", { class: classObj, style: cell.style },
104
- h("div", { class: "f-cell__content", style: cell.styleContent, title: cellTitle },
105
- props.indents,
106
- infoEl,
107
- icon,
108
- content)));
104
+ return (h("div", { class: classObj, "kup-get-cell-props": () => {
105
+ return props;
106
+ }, style: cell.style },
107
+ h("div", { class: "f-cell__content", style: cell.styleContent, title: cellTitle }, children && children.length > 0
108
+ ? children
109
+ : [props.indents, infoEl, icon, content])));
109
110
  };
110
111
  function setCellSize(cellType, subcomponentProps, cell, props) {
111
112
  switch (cellType) {
@@ -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
+ }
@@ -59,7 +59,8 @@ function createChipList(props, isChoice, isFilter, isInput) {
59
59
  }
60
60
  }
61
61
  function createChip(chip) {
62
- let componentClass = `chip `;
62
+ const onlyIcon = !!(chip.icon && !chip.value);
63
+ let componentClass = `chip ${onlyIcon ? 'chip--only-icon' : ''}`;
63
64
  let iconEl = [];
64
65
  let iconClass = 'chip__icon chip__icon--leading';
65
66
  if (isFilter || isChoice) {
@@ -55,7 +55,7 @@ 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, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown })),
59
59
  props.isClearable ? (h("span", { class: `mdc-text-field__icon kup-icon ${KupThemeIconValues.CLEAR.replace('--', '')}`, onClick: props.onClearIconClick })) : undefined,
60
60
  props.trailingIcon ? iconEl : undefined,
61
61
  !props.fullWidth && !isOutlined ? labelEl : undefined,
@@ -70,3 +70,27 @@ export function toStreamNode(nodes) {
70
70
  }
71
71
  return streamlined;
72
72
  }
73
+ /**
74
+ * Returns the parent of the given node.
75
+ * @param {KupDataNode[]} nodes - Input array of nodes.
76
+ * @param {KupDataNode} child - Child node.
77
+ * @returns {KupDataNode} Parent node.
78
+ */
79
+ export function getParentNode(nodes, child) {
80
+ let parent = null;
81
+ for (let index = 0; index < nodes.length; index++) {
82
+ const node = nodes[index];
83
+ recursive(node);
84
+ function recursive(node) {
85
+ const hasChildren = !!node.children;
86
+ if (hasChildren && node.children.includes(child)) {
87
+ parent = node;
88
+ return;
89
+ }
90
+ for (let index = 0; !parent && hasChildren && index < node.children.length; index++) {
91
+ recursive(node.children[index]);
92
+ }
93
+ }
94
+ }
95
+ return parent;
96
+ }
@@ -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 { removeNode, setPropertiesNode, toStreamNode, } from './kup-data-node-helper';
5
+ import { 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.
@@ -22,6 +23,99 @@ export class KupData {
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,6 +129,9 @@ export class KupData {
35
129
  },
36
130
  };
37
131
  this.node = {
132
+ getParent(nodes, child) {
133
+ return getParentNode(nodes, child);
134
+ },
38
135
  remove(nodes, node2remove) {
39
136
  return removeNode(nodes, node2remove);
40
137
  },
@@ -188,7 +188,8 @@ export class KupDynamicPosition {
188
188
  el.style.top = `${bottom + el.kupDynamicPosition.margin}px`;
189
189
  }
190
190
  else {
191
- if (window.innerHeight - rect.bottom < offsetH) {
191
+ if (offsetH < rect.top &&
192
+ window.innerHeight - rect.bottom < offsetH) {
192
193
  el.style.bottom = `${window.innerHeight - top + el.kupDynamicPosition.margin}px`;
193
194
  }
194
195
  else {
@@ -217,7 +218,8 @@ export class KupDynamicPosition {
217
218
  el.style.right = `${window.innerWidth - scrollbarWidth - right}px`;
218
219
  }
219
220
  else {
220
- if (window.innerWidth - rect.left < offsetW) {
221
+ if (offsetW < rect.right &&
222
+ window.innerWidth - rect.left < offsetW) {
221
223
  let scrollbarWidth = window.innerWidth - document.documentElement.offsetWidth;
222
224
  if (scrollbarWidth > 30) {
223
225
  scrollbarWidth = 0;
@@ -106,7 +106,6 @@ export class KupInteract {
106
106
  break;
107
107
  case KupDragEffect.CLONE:
108
108
  ghostImage = draggable.cloneNode(true);
109
- setComputedStyle(draggable, ghostImage);
110
109
  ghostImage.style.cursor = 'grabbing';
111
110
  ghostImage.style.height = draggable.clientHeight + 'px';
112
111
  ghostImage.style.left =
@@ -120,7 +119,7 @@ export class KupInteract {
120
119
  ghostImage.style.width = draggable.clientWidth + 'px';
121
120
  ghostImage.style.zIndex =
122
121
  'calc(var(--kup-navbar-zindex) + 1)';
123
- dom.ketchup.interact.container.appendChild(ghostImage);
122
+ draggable.parentElement.appendChild(ghostImage);
124
123
  draggable.kupDragDrop.ghostImage = ghostImage;
125
124
  break;
126
125
  }
@@ -145,26 +144,6 @@ export class KupInteract {
145
144
  };
146
145
  interact(el).draggable(options);
147
146
  this.managedElements.add(el);
148
- function setComputedStyle(draggable, ghostImage) {
149
- recursive(draggable, ghostImage);
150
- function recursive(source, target) {
151
- const styles = getComputedStyle(source);
152
- for (const key in styles) {
153
- if (Object.prototype.hasOwnProperty.call(styles, key)) {
154
- const s = styles[key];
155
- try {
156
- target.style[s] = styles[s];
157
- }
158
- catch (error) { }
159
- }
160
- }
161
- for (let index = 0; index < source.children.length; index++) {
162
- const sourceChild = source.children[index];
163
- const targetChild = target.children[index];
164
- recursive(sourceChild, targetChild);
165
- }
166
- }
167
- }
168
147
  }
169
148
  /**
170
149
  * Sets up a new dropzone.
@@ -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
  */
@@ -82,6 +93,7 @@ export var KupLanguageGeneric;
82
93
  (function (KupLanguageGeneric) {
83
94
  KupLanguageGeneric["ADD_NEW"] = "genericAddNew";
84
95
  KupLanguageGeneric["APPLY"] = "genericApply";
96
+ KupLanguageGeneric["BACK"] = "genericBack";
85
97
  KupLanguageGeneric["COLLAPSE"] = "genericCollapse";
86
98
  KupLanguageGeneric["DAY"] = "genericDay";
87
99
  KupLanguageGeneric["DRAG_AND_DROP"] = "genericDragAndDrop";
@@ -116,6 +128,7 @@ export var KupLanguageGeneric;
116
128
  KupLanguageGeneric["SWAP"] = "genericSwap";
117
129
  KupLanguageGeneric["TOGGLE"] = "genericToggle";
118
130
  KupLanguageGeneric["TODAY"] = "genericToday";
131
+ KupLanguageGeneric["TOP"] = "genericTop";
119
132
  KupLanguageGeneric["TOTALS_TABLE"] = "genericTotalsTable";
120
133
  KupLanguageGeneric["TRANSPOSE_DATA"] = "genericTransposeData";
121
134
  KupLanguageGeneric["VIEW_AS"] = "genericViewAs";
@@ -17,6 +17,7 @@ import { KupMathLocales } from '../kup-math/kup-math-declarations';
17
17
  import { KupMath } from '../kup-math/kup-math';
18
18
  import { KupTooltip } from '../kup-tooltip/kup-tooltip';
19
19
  import { setAssetPath } from '@stencil/core';
20
+ import html2canvas from 'html2canvas';
20
21
  const dom = document.documentElement;
21
22
  /**
22
23
  * This class controls every other Ketchup utility suite.
@@ -27,7 +28,7 @@ export class KupManager {
27
28
  * Initializes KupManager.
28
29
  */
29
30
  constructor(overrides) {
30
- let datesLocale = null, debugActive = null, debugAutoprint = null, debugLogLimit = null, dialogRestrictContainer = null, dialogZIndex = null, languageList = null, languageName = null, objectsList = null, scrollOnHoverDelay = null, scrollOnHoverStep = null, themeList = null, themeName = null, tooltipDelay = null;
31
+ let datesLocale = null, debugActive = null, debugAutoprint = null, debugLogLimit = null, dialogRestrictContainer = null, dialogZIndex = null, languageList = null, languageName = null, objectsList = null, scrollOnHoverDelay = null, scrollOnHoverStep = null, themeList = null, themeName = null, tooltipDelay = null, tooltipFCellCallbacks = null;
31
32
  if (overrides) {
32
33
  const assetsPath = overrides.assetsPath;
33
34
  const dates = overrides.dates;
@@ -76,6 +77,9 @@ export class KupManager {
76
77
  }
77
78
  if (tooltip) {
78
79
  tooltipDelay = tooltip.delay ? tooltip.delay : null;
80
+ tooltipFCellCallbacks = tooltip.fCellCallbacks
81
+ ? tooltip.fCellCallbacks
82
+ : null;
79
83
  }
80
84
  }
81
85
  this.data = new KupData();
@@ -112,7 +116,7 @@ export class KupManager {
112
116
  };
113
117
  this.theme = new KupTheme(themeList, themeName);
114
118
  this.toolbar = new KupToolbar();
115
- this.tooltip = new KupTooltip(tooltipDelay);
119
+ this.tooltip = new KupTooltip(tooltipDelay, tooltipFCellCallbacks);
116
120
  document.addEventListener('pointerdown', (e) => {
117
121
  const paths = e.composedPath();
118
122
  const lastString = paths[0].innerText || paths[0].value;
@@ -229,6 +233,21 @@ export class KupManager {
229
233
  this.utilities.clickCallbacks.add(cb);
230
234
  }
231
235
  }
236
+ /**
237
+ * Rasterizes an HTMLElement, transforming into a canvas.
238
+ * @param {HTMLElement} el - Element to rasterize.
239
+ * @returns {HTMLCanvasElement} - Canvas created from the HTMLElement.
240
+ *
241
+ * CSS Mask is not supported:
242
+ * @see https://github.com/niklasvh/html2canvas/issues/2814
243
+ * Warning in console about sourcemap, claimed to be solved here but...:
244
+ * @see https://github.com/niklasvh/html2canvas/pull/2787/files
245
+ */
246
+ async rasterize(el, options) {
247
+ return html2canvas(el, options).then((canvas) => {
248
+ return canvas;
249
+ });
250
+ }
232
251
  /**
233
252
  * Removes the given click callback.
234
253
  * @param {KupManagerClickCb} cb - The callback to remove.
@@ -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.