@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
@@ -0,0 +1,478 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-31125378.js');
6
+ const kupManager = require('./kup-manager-7c514a30.js');
7
+ const GenericVariables = require('./GenericVariables-a9ed17ee.js');
8
+ const fCell = require('./f-cell-76830a0d.js');
9
+ const fTextFieldMdc = require('./f-text-field-mdc-85997738.js');
10
+ require('./f-checkbox-cd977193.js');
11
+ require('./f-text-field-b4229cef.js');
12
+ require('./f-image-0e71df7e.js');
13
+ require('./f-chip-68d45fd3.js');
14
+ require('./tslib.es6-0ee02c67.js');
15
+ require('./component-72a5b626.js');
16
+
17
+ /**
18
+ * Props of the kup-form component.
19
+ * Used to export every prop in an object.
20
+ */
21
+ var KupFormProps;
22
+ (function (KupFormProps) {
23
+ KupFormProps["customStyle"] = "Custom style of the component.";
24
+ KupFormProps["data"] = "Actual data of the form.";
25
+ KupFormProps["layout"] = "How the form will arrange its content.";
26
+ })(KupFormProps || (KupFormProps = {}));
27
+ var KupFormLabelAlignment;
28
+ (function (KupFormLabelAlignment) {
29
+ KupFormLabelAlignment["CENTER"] = "center";
30
+ KupFormLabelAlignment["LEFT"] = "left";
31
+ KupFormLabelAlignment["RIGHT"] = "right";
32
+ })(KupFormLabelAlignment || (KupFormLabelAlignment = {}));
33
+ var KupFormLabelPlacement;
34
+ (function (KupFormLabelPlacement) {
35
+ KupFormLabelPlacement["BOTTOM"] = "bottom";
36
+ KupFormLabelPlacement["LEFT"] = "left";
37
+ KupFormLabelPlacement["HIDDEN"] = "hidden";
38
+ KupFormLabelPlacement["PLACEHOLDER"] = "placeholder";
39
+ KupFormLabelPlacement["RIGHT"] = "right";
40
+ KupFormLabelPlacement["TOP"] = "top";
41
+ })(KupFormLabelPlacement || (KupFormLabelPlacement = {}));
42
+
43
+ const kupFormCss = ":host{--kup_form_background_color:var(\n --kup-form-background-color,\n var(--kup-background-color)\n );--kup_form_color:var(--kup-form-color, var(--kup-text-color));--kup_form_font_family:var(--kup-form-font-family, var(--kup-font-family));--kup_form_font_size:var(--kup-form-font-size, var(--kup-font-size));--kup_form_label_alignment:var(--kup-form-label-alignment);--kup_form_label_width:var(--kup-form-label-width);display:block;font-family:var(--kup_form_font_family);font-size:var(--kup_form_font_size)}.form{background:var(--kup_form_background_color);color:var(--kup_form_color);display:flex;flex-grow:1;overflow:auto;position:relative}.form--column{flex-direction:column}.form__section{display:flex;flex:1 1 1%;flex-direction:row;flex-wrap:wrap}.form__section--column{flex-direction:column;flex-wrap:unset}.form__section--column>.form__section{flex:0 0 auto}.form__section--grid{display:grid}.form__section--titled{border:1px solid var(--kup-border-color);padding-top:5px;position:relative;margin:10px}.form__section--titled>h3{background:var(--kup-background-color);font-size:calc(var(--kup-font-size) * 1.15);position:absolute;margin:0px;padding:0 8px;top:-11px;left:5px;transition:background-color 0.25s ease}.form__section--left .form__label{width:var(--kup_form_label_width, 0)}.form__section--right .form__field{min-width:200px;width:0}.form__label{-webkit-font-smoothing:antialiased;box-sizing:border-box;font-size:0.875em;letter-spacing:0.0178571429em;white-space:nowrap;width:var(--kup_form_label_width)}.form__label--center{text-align:var(--kup_form_label_alignment, center)}.form__label--left{text-align:var(--kup_form_label_alignment, left)}.form__label--right{text-align:var(--kup_form_label_alignment, right)}.form__field{min-height:16px}.form__field img{height:auto}.form .f-cell.c-right-aligned:not(.c-centered) .f-cell__content{justify-content:flex-start}";
44
+
45
+ const dom = document.documentElement;
46
+ const KupForm = class {
47
+ constructor(hostRef) {
48
+ index.registerInstance(this, hostRef);
49
+ /*-------------------------------------------------*/
50
+ /* P r o p s */
51
+ /*-------------------------------------------------*/
52
+ /**
53
+ * Custom style of the component.
54
+ * @default ""
55
+ * @see https://ketchup.smeup.com/ketchup-showcase/#/customization
56
+ */
57
+ this.customStyle = '';
58
+ /**
59
+ * Actual data of the form.
60
+ * @default null
61
+ */
62
+ this.data = null;
63
+ /**
64
+ * How the form will arrange its content.
65
+ * @default null
66
+ */
67
+ this.layout = null;
68
+ /*-------------------------------------------------*/
69
+ /* I n t e r n a l V a r i a b l e s */
70
+ /*-------------------------------------------------*/
71
+ this.kupManager = kupManager.kupManagerInstance();
72
+ this.visibleColumns = [];
73
+ }
74
+ /*-------------------------------------------------*/
75
+ /* W a t c h e r s */
76
+ /*-------------------------------------------------*/
77
+ onDataChanged() {
78
+ kupManager.identify(this.getRows());
79
+ this.initVisibleColumns();
80
+ this.checkLayout();
81
+ }
82
+ onLayoutChanged() {
83
+ this.checkLayout();
84
+ }
85
+ /*-------------------------------------------------*/
86
+ /* P u b l i c M e t h o d s */
87
+ /*-------------------------------------------------*/
88
+ /**
89
+ * Used to retrieve component's props values.
90
+ * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
91
+ * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
92
+ */
93
+ async getProps(descriptions) {
94
+ return kupManager.getProps(this, KupFormProps, descriptions);
95
+ }
96
+ /**
97
+ * This method is used to trigger a new render of the component.
98
+ */
99
+ async refresh() {
100
+ index.forceUpdate(this);
101
+ }
102
+ /**
103
+ * Sets the focus on an editable table cell.
104
+ * @param {string} column - Name of the column.
105
+ * @param {string} rowId - Id of the row.
106
+ */
107
+ async setFocus(column, rowId) {
108
+ const cells = this.rootElement.shadowRoot.querySelectorAll('td[data-column="' + column + '"]');
109
+ for (let index = 0; cells && index < cells.length; index++) {
110
+ const cell = cells[index];
111
+ if (cell['data-row'] && cell['data-row'].id == rowId) {
112
+ const input = cell.querySelector('input');
113
+ if (input) {
114
+ input.focus();
115
+ }
116
+ else {
117
+ const kupInput = cell.querySelector('.hydrated');
118
+ if (kupInput) {
119
+ try {
120
+ kupInput.setFocus();
121
+ }
122
+ catch (error) { }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+ /**
129
+ * Sets the props to the component.
130
+ * @param {GenericObject} props - Object containing props that will be set to the component.
131
+ */
132
+ async setProps(props) {
133
+ kupManager.setProps(this, KupFormProps, props);
134
+ }
135
+ /*-------------------------------------------------*/
136
+ /* P r i v a t e M e t h o d s */
137
+ /*-------------------------------------------------*/
138
+ getColumns() {
139
+ return this.data && this.data.columns
140
+ ? this.data.columns
141
+ : [{ title: '', name: '', size: undefined }];
142
+ }
143
+ initVisibleColumns() {
144
+ this.visibleColumns = this.getColumns().filter((column) => {
145
+ if (column.hasOwnProperty('visible')) {
146
+ return column.visible;
147
+ }
148
+ return true;
149
+ });
150
+ }
151
+ getRows() {
152
+ return this.data && this.data.rows ? this.data.rows : [];
153
+ }
154
+ checkLayout() {
155
+ if (this.layout) {
156
+ this.formLayout = this.layout;
157
+ return;
158
+ }
159
+ const section = {
160
+ horizontal: false,
161
+ sections: [],
162
+ };
163
+ const visibleColumns = this.visibleColumns;
164
+ let size = visibleColumns.length;
165
+ const content = [];
166
+ let cnt = 0;
167
+ while (size-- > 0) {
168
+ content.push({
169
+ column: visibleColumns[cnt++].name,
170
+ });
171
+ }
172
+ section.content = content;
173
+ this.formLayout = {
174
+ sections: [section],
175
+ };
176
+ }
177
+ renderRow(row) {
178
+ const visibleColumns = [...this.visibleColumns];
179
+ let formContent = null;
180
+ let rowLayout = row.layout;
181
+ if (!rowLayout) {
182
+ rowLayout = this.formLayout;
183
+ }
184
+ let horizontal = false;
185
+ if (rowLayout) {
186
+ if (rowLayout.horizontal) {
187
+ horizontal = true;
188
+ }
189
+ const sections = rowLayout.sections;
190
+ let size = sections.length;
191
+ let cnt = 0;
192
+ if (size > 0) {
193
+ formContent = [];
194
+ }
195
+ const parent = {
196
+ horizontal: horizontal,
197
+ };
198
+ while (size-- > 0) {
199
+ formContent.push(this.renderSection(sections[cnt++], parent, row, visibleColumns));
200
+ }
201
+ }
202
+ const classObj = {
203
+ form: true,
204
+ 'form--column': !horizontal,
205
+ };
206
+ return index.h("form", { class: classObj }, formContent);
207
+ }
208
+ renderSection(section, parent, row, visibleColumns) {
209
+ var _a;
210
+ let sectionContent = null;
211
+ if (section.sections && section.sections.length > 0) {
212
+ const sections = section.sections;
213
+ let size = sections.length;
214
+ let cnt = 0;
215
+ if (size > 0) {
216
+ sectionContent = [];
217
+ }
218
+ while (size-- > 0) {
219
+ sectionContent.push(this.renderSection(sections[cnt++], section, row, visibleColumns));
220
+ }
221
+ }
222
+ else if (section.content) {
223
+ const content = section.content;
224
+ let size = content.length;
225
+ let cnt = 0;
226
+ if (size > 0) {
227
+ sectionContent = [];
228
+ }
229
+ while (size-- > 0) {
230
+ const formField = this.renderFormField({
231
+ formField: content[cnt++],
232
+ row,
233
+ visibleColumns,
234
+ }, section);
235
+ let field = formField;
236
+ if (!section.horizontal) {
237
+ field = index.h("tr", null, formField);
238
+ }
239
+ sectionContent.push(field);
240
+ }
241
+ }
242
+ else if (visibleColumns.length > 0) {
243
+ const column = visibleColumns[0];
244
+ sectionContent = this.renderFormField({
245
+ formField: { column: column.name },
246
+ row,
247
+ visibleColumns,
248
+ });
249
+ }
250
+ const isGrid = !!section.columns;
251
+ const labelPlacement = ((_a = section === null || section === void 0 ? void 0 : section.label) === null || _a === void 0 ? void 0 : _a.placement) || KupFormLabelPlacement.LEFT;
252
+ const sectionClass = {
253
+ form__section: true,
254
+ 'form__section--column': !isGrid && !section.horizontal,
255
+ 'form__section--grid': isGrid,
256
+ 'form__section--titled': !!section.title,
257
+ 'form__section--last': !section.sections || section.sections.length === 0,
258
+ [`form__section--${labelPlacement}`]: true,
259
+ };
260
+ const sectionStyle = section.style || {};
261
+ if (section.dim && parent) {
262
+ sectionStyle.flex = `0 0 ${section.dim}`;
263
+ if (parent.horizontal) {
264
+ sectionStyle.maxWidth = section.dim;
265
+ }
266
+ else {
267
+ sectionStyle.maxHeight = section.dim;
268
+ }
269
+ }
270
+ if (isGrid) {
271
+ sectionStyle['grid-template-columns'] = `repeat(${section.columns}, 1fr)`;
272
+ }
273
+ return (index.h("div", { class: sectionClass, style: sectionStyle }, section.title ? index.h("h3", null, section.title) : null, index.h("table", null, index.h("tbody", null, section.horizontal ? (index.h("tr", null, sectionContent)) : (sectionContent)))));
274
+ }
275
+ renderFormField({ formField, row, visibleColumns, }, section) {
276
+ var _a;
277
+ const classObj = {
278
+ form__field: true,
279
+ };
280
+ const styleObj = {};
281
+ let column = null;
282
+ let index$1 = -1;
283
+ for (let i = 0; i < visibleColumns.length; i++) {
284
+ const c = visibleColumns[i];
285
+ if (c.name === formField.column) {
286
+ index$1 = i;
287
+ break;
288
+ }
289
+ }
290
+ if (index$1 >= 0) {
291
+ column = visibleColumns[index$1];
292
+ visibleColumns.splice(index$1, 1);
293
+ }
294
+ else if (section) {
295
+ column = this.data.columns.find((x) => x.name === formField.column);
296
+ }
297
+ const cell = row.cells[formField.column];
298
+ let title = undefined;
299
+ if (cell) {
300
+ cell.isEditable = true;
301
+ if (!this.kupManager.objects.isEmptyKupObj(cell.obj)) {
302
+ if (this.kupManager.debug.isDebug()) {
303
+ title =
304
+ cell.obj.t +
305
+ '; ' +
306
+ cell.obj.p +
307
+ '; ' +
308
+ cell.obj.k +
309
+ ';';
310
+ }
311
+ }
312
+ }
313
+ else {
314
+ return null;
315
+ }
316
+ const cellProps = {
317
+ cell: formField.data ? Object.assign(Object.assign({}, cell), { data: formField.data }) : cell,
318
+ column: column,
319
+ component: this,
320
+ editable: true,
321
+ renderKup: true,
322
+ row: row,
323
+ setSizes: true,
324
+ shape: formField.shape,
325
+ };
326
+ const label = formField.label || column.title;
327
+ resetLabel();
328
+ switch ((_a = section.label) === null || _a === void 0 ? void 0 : _a.placement) {
329
+ case KupFormLabelPlacement.BOTTOM:
330
+ return [index.h("tr", null, fieldCell()), index.h("tr", null, labelCell(label))];
331
+ case KupFormLabelPlacement.PLACEHOLDER:
332
+ setPlaceholderLabel();
333
+ case KupFormLabelPlacement.HIDDEN: {
334
+ if (section) {
335
+ return [fieldCell()];
336
+ }
337
+ else {
338
+ return [index.h("tr", null, fieldCell())];
339
+ }
340
+ }
341
+ case KupFormLabelPlacement.RIGHT: {
342
+ if (section) {
343
+ return [fieldCell(), labelCell(label)];
344
+ }
345
+ else {
346
+ return [
347
+ index.h("tr", null, fieldCell(), labelCell(label)),
348
+ ];
349
+ }
350
+ }
351
+ case KupFormLabelPlacement.TOP:
352
+ return [index.h("tr", null, labelCell(label)), index.h("tr", null, fieldCell())];
353
+ default: {
354
+ if (section) {
355
+ return [labelCell(label), fieldCell()];
356
+ }
357
+ else {
358
+ return [
359
+ index.h("tr", null, labelCell(label), fieldCell()),
360
+ ];
361
+ }
362
+ }
363
+ }
364
+ function fieldCell() {
365
+ return (index.h("td", { "data-cell": cell, "data-row": row, "data-column": formField.column, class: classObj, style: styleObj, title: title }, cell && column ? (index.h(fCell.FCell, Object.assign({}, cellProps))) : (index.h("span", null, formField.value))));
366
+ }
367
+ function labelCell(label) {
368
+ var _a, _b, _c;
369
+ const alignment = ((_a = section === null || section === void 0 ? void 0 : section.label) === null || _a === void 0 ? void 0 : _a.alignment) || KupFormLabelAlignment.LEFT;
370
+ const style = {
371
+ width: ((_b = section === null || section === void 0 ? void 0 : section.label) === null || _b === void 0 ? void 0 : _b.width) ? (_c = section === null || section === void 0 ? void 0 : section.label) === null || _c === void 0 ? void 0 : _c.width : '',
372
+ };
373
+ return (index.h("td", { class: `form__label form__label--${alignment}`, style: style }, index.h("span", null, label)));
374
+ }
375
+ function resetLabel() {
376
+ if (!cell.data) {
377
+ cell.data = {};
378
+ }
379
+ try {
380
+ delete cell.data.label;
381
+ }
382
+ catch (_a) { }
383
+ try {
384
+ delete cell.data.data['kup-text-field'].label;
385
+ }
386
+ catch (_b) { }
387
+ }
388
+ function setPlaceholderLabel() {
389
+ switch (dom.ketchup.data.cell.getType(cell, cell.shape || column.shape || null)) {
390
+ case kupManager.FCellTypes.AUTOCOMPLETE:
391
+ case kupManager.FCellTypes.COLOR_PICKER:
392
+ case kupManager.FCellTypes.COMBOBOX:
393
+ case kupManager.FCellTypes.DATE:
394
+ case kupManager.FCellTypes.DATETIME:
395
+ case kupManager.FCellTypes.TIME:
396
+ if (cell.data.data) {
397
+ if (cell.data.data['kup-text-field']) {
398
+ cell.data.data['kup-text-field'].label =
399
+ column.title;
400
+ }
401
+ else {
402
+ cell.data.data = {
403
+ 'kup-text-field': {
404
+ label: column.title,
405
+ },
406
+ };
407
+ }
408
+ }
409
+ else {
410
+ cell.data.data = {
411
+ 'kup-text-field': {
412
+ label: column.title,
413
+ },
414
+ };
415
+ }
416
+ break;
417
+ case kupManager.FCellTypes.CHECKBOX:
418
+ case kupManager.FCellTypes.NUMBER:
419
+ case kupManager.FCellTypes.STRING:
420
+ case kupManager.FCellTypes.SWITCH:
421
+ cell.data.label = column.title;
422
+ }
423
+ }
424
+ }
425
+ /*-------------------------------------------------*/
426
+ /* L i f e c y c l e H o o k s */
427
+ /*-------------------------------------------------*/
428
+ componentWillLoad() {
429
+ this.kupManager.debug.logLoad(this, false);
430
+ this.kupManager.language.register(this);
431
+ this.kupManager.theme.register(this);
432
+ this.onDataChanged();
433
+ }
434
+ componentDidLoad() {
435
+ this.kupManager.debug.logLoad(this, true);
436
+ }
437
+ componentWillRender() {
438
+ this.kupManager.debug.logRender(this, false);
439
+ }
440
+ componentDidRender() {
441
+ const root = this.rootElement.shadowRoot;
442
+ if (root) {
443
+ const fs = root.querySelectorAll('.f-text-field');
444
+ for (let index = 0; index < fs.length; index++) {
445
+ fTextFieldMdc.FTextFieldMDC(fs[index]);
446
+ }
447
+ }
448
+ this.kupManager.debug.logRender(this, true);
449
+ }
450
+ render() {
451
+ let formContent = null;
452
+ if (this.data.rows.length === 0) {
453
+ formContent = (index.h("p", null, this.kupManager.language.translate(kupManager.KupLanguageGeneric.EMPTY_DATA)));
454
+ }
455
+ else {
456
+ const rows = this.data.rows;
457
+ let size = rows.length;
458
+ let cnt = 0;
459
+ formContent = [];
460
+ while (size-- > 0) {
461
+ formContent.push(this.renderRow(rows[cnt++]));
462
+ }
463
+ }
464
+ return (index.h(index.Host, null, index.h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), index.h("div", { id: GenericVariables.componentWrapperId }, formContent)));
465
+ }
466
+ disconnectedCallback() {
467
+ this.kupManager.language.unregister(this);
468
+ this.kupManager.theme.unregister(this);
469
+ }
470
+ get rootElement() { return index.getElement(this); }
471
+ static get watchers() { return {
472
+ "data": ["onDataChanged"],
473
+ "layout": ["onLayoutChanged"]
474
+ }; }
475
+ };
476
+ KupForm.style = kupFormCss;
477
+
478
+ exports.kup_form = KupForm;
@@ -2,9 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-eb556444.js');
6
- const kupManager = require('./kup-manager-7a941909.js');
7
- const utils = require('./utils-6287d878.js');
5
+ const index = require('./index-31125378.js');
6
+ const kupManager = require('./kup-manager-7c514a30.js');
8
7
 
9
8
  /**
10
9
  * Props of the kup-iframe component.
@@ -62,7 +61,7 @@ const KupIframe = class {
62
61
  * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
63
62
  */
64
63
  async getProps(descriptions) {
65
- return utils.getProps(this, KupIframeProps, descriptions);
64
+ return kupManager.getProps(this, KupIframeProps, descriptions);
66
65
  }
67
66
  /**
68
67
  * This method is used to trigger a new render of the component.
@@ -75,7 +74,7 @@ const KupIframe = class {
75
74
  * @param {GenericObject} props - Object containing props that will be set to the component.
76
75
  */
77
76
  async setProps(props) {
78
- utils.setProps(this, KupIframeProps, props);
77
+ kupManager.setProps(this, KupIframeProps, props);
79
78
  }
80
79
  /*-------------------------------------------------*/
81
80
  /* P r i v a t e M e t h o d s */
@@ -2,18 +2,17 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-eb556444.js');
6
- const kupManager = require('./kup-manager-7a941909.js');
7
- const utils = require('./utils-6287d878.js');
5
+ const index = require('./index-31125378.js');
6
+ const kupManager = require('./kup-manager-7c514a30.js');
8
7
  const GenericVariables = require('./GenericVariables-a9ed17ee.js');
9
- const fImage = require('./f-image-89f25556.js');
10
- const fButton = require('./f-button-ac179257.js');
8
+ const fImage = require('./f-image-0e71df7e.js');
9
+ const fButton = require('./f-button-94cb5f35.js');
11
10
  const fButtonDeclarations = require('./f-button-declarations-b611587f.js');
12
- const fCell = require('./f-cell-69294bca.js');
11
+ const fCell = require('./f-cell-76830a0d.js');
13
12
  const component = require('./component-72a5b626.js');
14
- require('./cell-utils-a78d6fac.js');
15
- require('./f-text-field-e1e45ade.js');
16
- require('./f-chip-b00897d7.js');
13
+ require('./f-checkbox-cd977193.js');
14
+ require('./f-text-field-b4229cef.js');
15
+ require('./f-chip-68d45fd3.js');
17
16
  require('./tslib.es6-0ee02c67.js');
18
17
 
19
18
  /**
@@ -27,7 +26,17 @@ var KupImageListProps;
27
26
  KupImageListProps["ripple"] = "When enabled displays Material's ripple effect on clicked items.";
28
27
  })(KupImageListProps || (KupImageListProps = {}));
29
28
 
30
- const kupImageListCss = ":host{--kup_imagelist_background_color:var(\n --kup-imagelist-background-color,\n transparent\n );--kup_imagelist_columns:var(--kup-imagelist-columns, 4);--kup_imagelist_grid_gap:var(--kup-imagelist-grid-gap, 0.5em);--kup_imagelist_image_margin:var(--kup-imagelist-image-margin, 1em auto);--kup_imagelist_image_min_height:var(--kup-imagelist-image-min-height, 64px);--kup_imagelist_item_border_radius:var(\n --kup-imagelist-item-border-radius,\n 8px\n );--kup_imagelist_item_height:var(--kup-imagelist-item-height, auto);--kup_imagelist_item_padding:var(--kup-imagelist-item-padding, 0);--kup_imagelist_item_width:var(--kup-imagelist-item-width, auto);--kup_imagelist_label_margin:var(\n --kup-imagelist-label-margin,\n 0 auto 1em auto\n );--kup_imagelist_navbar_background_color:var(\n --kup-imagelist-navbar-background-color,\n transparent\n );--kup_imagelist_primary_color:var(\n --kup-imagelist-primary-color,\n var(--kup-primary-color)\n );--kup_imagelist_primary_color_rgb:var(\n --kup-imagelist-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_imagelist_text_color:var(\n --kup-imagelist-text-color,\n var(--kup-text-color)\n );display:block}.navigation-bar{align-items:center;background-color:var(--kup_imagelist_navbar_background_color);display:flex;justify-content:center}.navigation-bar__wrapper{align-items:center;display:flex;flex-wrap:wrap;justify-content:center;max-width:100%;position:relative}.navigation-bar__wrapper--active .navigation-bar__title{background-color:rgba(var(--kup_imagelist_primary_color_rgb), 0.15);color:var(--kup_imagelist_primary_color)}.navigation-bar__wrapper--active .navigation-bar__back,.navigation-bar__wrapper--active .navigation-bar__top{display:block}.navigation-bar__back,.navigation-bar__top{--kup-button-primary-color-rgb:0;animation:fade-in 0.375s ease-in;display:none}.navigation-bar__title{border-radius:16px;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;padding:0.75em 1em;user-select:none;transition:background-color 125ms, color 125ms;width:100%}.navigation-bar__title__image.f-image{margin:0}.navigation-bar__title__label{font-size:1.2em;font-weight:bold;letter-spacing:0.12em;overflow:hidden;padding:0 0.5em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.image-list{background-color:var(--kup_imagelist_background_color);display:grid;grid-gap:var(--kup_imagelist_grid_gap);grid-template-columns:repeat(var(--kup_imagelist_columns, 4), minmax(0px, 1fr));margin-top:1em;width:100%}.image-list .f-cell{height:100%;width:100%}.image-list__item{border-radius:var(--kup_imagelist_item_border_radius);cursor:pointer;height:var(--kup_imagelist_item_height);padding:var(--kup_imagelist_item_padding);width:var(--kup_imagelist_item_width)}.image-list__image.f-image{margin:var(--kup_imagelist_image_margin)}.image-list__image.f-image .f-image__icon{min-height:var(--kup_imagelist_image_min_height)}.image-list__label{color:var(--kup_imagelist_text_color);letter-spacing:0.12em;margin:var(--kup_imagelist_label_margin);overflow:hidden;text-align:center;text-overflow:ellipsis}.image-list .mdc-ripple-surface{--mdc-ripple-fg-opacity:0.24}.image-list .mdc-ripple-surface:before,.image-list .mdc-ripple-surface:after{background-color:var(--kup_imagelist_primary_color)}:host(.kup-full-height){height:100%}:host(.kup-full-width){width:100%}:host(.kup-horizontal) .image-list{display:flex}:host(.kup-auto-grid) .image-list{display:flex;flex-wrap:wrap;justify-content:center}";
29
+ class KupImageListState {
30
+ constructor() {
31
+ this.load = false;
32
+ }
33
+ toDebugString() {
34
+ // TODO
35
+ return 'image-list state';
36
+ }
37
+ }
38
+
39
+ const kupImageListCss = ":host{--kup_imagelist_background_color:var(\n --kup-imagelist-background-color,\n transparent\n );--kup_imagelist_columns:var(--kup-imagelist-columns, 4);--kup_imagelist_grid_gap:var(--kup-imagelist-grid-gap, 0.5em);--kup_imagelist_image_margin:var(--kup-imagelist-image-margin, 1em auto);--kup_imagelist_image_min_height:var(--kup-imagelist-image-min-height, 64px);--kup_imagelist_item_border_radius:var(\n --kup-imagelist-item-border-radius,\n 8px\n );--kup_imagelist_item_height:var(--kup-imagelist-item-height, auto);--kup_imagelist_item_padding:var(--kup-imagelist-item-padding, 0);--kup_imagelist_item_width:var(--kup-imagelist-item-width, auto);--kup_imagelist_label_margin:var(\n --kup-imagelist-label-margin,\n 0 auto 1em auto\n );--kup_imagelist_navbar_background_color:var(\n --kup-imagelist-navbar-background-color,\n transparent\n );--kup_imagelist_primary_color:var(\n --kup-imagelist-primary-color,\n var(--kup-primary-color)\n );--kup_imagelist_primary_color_rgb:var(\n --kup-imagelist-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_imagelist_text_color:var(\n --kup-imagelist-text-color,\n var(--kup-text-color)\n );display:block}.navigation-bar{align-items:center;background-color:var(--kup_imagelist_navbar_background_color);display:flex;justify-content:center}.navigation-bar__wrapper{align-items:center;display:flex;flex-wrap:wrap;justify-content:center;max-width:100%;position:relative}.navigation-bar__wrapper--active .navigation-bar__title{background-color:rgba(var(--kup_imagelist_primary_color_rgb), 0.15);color:var(--kup_imagelist_primary_color)}.navigation-bar__back,.navigation-bar__top{--kup-button-primary-color-rgb:0}.navigation-bar__title{border-radius:16px;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;padding:0.75em 1em;user-select:none;transition:background-color 125ms, color 125ms;width:100%}.navigation-bar__title__image.f-image{margin:0}.navigation-bar__title__label{font-size:1.2em;font-weight:bold;letter-spacing:0.12em;overflow:hidden;padding:0 0.5em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.image-list{background-color:var(--kup_imagelist_background_color);display:grid;grid-gap:var(--kup_imagelist_grid_gap);grid-template-columns:repeat(var(--kup_imagelist_columns, 4), minmax(0px, 1fr));margin-top:1em;width:100%}.image-list .f-cell{height:100%;width:100%}.image-list__item{border-radius:var(--kup_imagelist_item_border_radius);cursor:pointer;height:var(--kup_imagelist_item_height);padding:var(--kup_imagelist_item_padding);width:var(--kup_imagelist_item_width)}.image-list__image.f-image{margin:var(--kup_imagelist_image_margin)}.image-list__image.f-image .f-image__icon{min-height:var(--kup_imagelist_image_min_height)}.image-list__label{color:var(--kup_imagelist_text_color);letter-spacing:0.12em;margin:var(--kup_imagelist_label_margin);overflow:hidden;text-align:center;text-overflow:ellipsis}.image-list .mdc-ripple-surface{--mdc-ripple-fg-opacity:0.24}.image-list .mdc-ripple-surface:before,.image-list .mdc-ripple-surface:after{background-color:var(--kup_imagelist_primary_color)}:host(.kup-full-height){height:100%}:host(.kup-full-width){width:100%}:host(.kup-horizontal) .image-list{display:flex}:host(.kup-auto-grid) .image-list{display:flex;flex-wrap:wrap;justify-content:center}";
31
40
 
32
41
  var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
33
42
  if (kind === "a" && !f)
@@ -56,6 +65,7 @@ const KupImageList = class {
56
65
  /*-------------------------------------------------*/
57
66
  /* S t a t e s */
58
67
  /*-------------------------------------------------*/
68
+ this.state = new KupImageListState();
59
69
  this.currentNode = null;
60
70
  this.navigationBarToggled = false;
61
71
  /*-------------------------------------------------*/
@@ -77,9 +87,18 @@ const KupImageList = class {
77
87
  * @default true
78
88
  */
79
89
  this.ripple = true;
90
+ /**
91
+ * An array of integers containing the path to a selected child.\
92
+ */
93
+ this.selectedNode = [];
94
+ this.stateId = '';
80
95
  /*-------------------------------------------------*/
81
96
  /* I n t e r n a l V a r i a b l e s */
82
97
  /*-------------------------------------------------*/
98
+ /**
99
+ * Instance of the KupManager class.
100
+ */
101
+ this.kupManager = kupManager.kupManagerInstance();
83
102
  _KupImageList_clickTimeout.set(this, []);
84
103
  _KupImageList_kupManager.set(this, kupManager.kupManagerInstance());
85
104
  _KupImageList_backProps.set(this, {
@@ -103,6 +122,32 @@ const KupImageList = class {
103
122
  wrapperClass: 'navigation-bar__top',
104
123
  });
105
124
  }
125
+ initWithPersistedState() {
126
+ if (this.store && this.stateId) {
127
+ const state = this.store.getState(this.stateId);
128
+ if (state != null) {
129
+ this.currentNode =
130
+ this.kupManager.data.node.findByStrTreeNodePath(this.data, state.selectedTreeNodePath);
131
+ }
132
+ }
133
+ }
134
+ persistState() {
135
+ if (this.store && this.stateId) {
136
+ let somethingChanged = false;
137
+ let cNodeRowId = this.currentNode ? this.currentNode.id : '';
138
+ if (!this.kupManager.objects.deepEqual(this.state.selectedTreeNodePath, cNodeRowId)) {
139
+ this.state.selectedTreeNodePath = cNodeRowId;
140
+ somethingChanged = true;
141
+ }
142
+ if (!this.state.load) {
143
+ this.state.load = true;
144
+ return;
145
+ }
146
+ if (somethingChanged) {
147
+ this.store.persistState(this.stateId, this.state);
148
+ }
149
+ }
150
+ }
106
151
  onKupClick(node) {
107
152
  if (node.children && node.children.length > 0) {
108
153
  this.currentNode = node;
@@ -133,6 +178,15 @@ const KupImageList = class {
133
178
  });
134
179
  }
135
180
  /*-------------------------------------------------*/
181
+ /* W a t c h e r s */
182
+ /*-------------------------------------------------*/
183
+ selectNode(newData) {
184
+ if (!newData || newData.length == 0) {
185
+ return;
186
+ }
187
+ this.currentNode = this.kupManager.data.node.find(this.data, newData);
188
+ }
189
+ /*-------------------------------------------------*/
136
190
  /* P u b l i c M e t h o d s */
137
191
  /*-------------------------------------------------*/
138
192
  /**
@@ -141,7 +195,7 @@ const KupImageList = class {
141
195
  * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
142
196
  */
143
197
  async getProps(descriptions) {
144
- return utils.getProps(this, KupImageListProps, descriptions);
198
+ return kupManager.getProps(this, KupImageListProps, descriptions);
145
199
  }
146
200
  /**
147
201
  * This method is used to trigger a new render of the component.
@@ -154,7 +208,7 @@ const KupImageList = class {
154
208
  * @param {GenericObject} props - Object containing props that will be set to the component.
155
209
  */
156
210
  async setProps(props) {
157
- utils.setProps(this, KupImageListProps, props);
211
+ kupManager.setProps(this, KupImageListProps, props);
158
212
  }
159
213
  /*-------------------------------------------------*/
160
214
  /* L i f e c y c l e H o o k s */
@@ -180,6 +234,9 @@ const KupImageList = class {
180
234
  }
181
235
  }
182
236
  }
237
+ // *** Store
238
+ this.persistState();
239
+ // ***
183
240
  __classPrivateFieldGet(this, _KupImageList_kupManager, "f").debug.logRender(this, true);
184
241
  }
185
242
  render() {
@@ -196,6 +253,9 @@ const KupImageList = class {
196
253
  __classPrivateFieldGet(this, _KupImageList_kupManager, "f").theme.unregister(this);
197
254
  }
198
255
  get rootElement() { return index.getElement(this); }
256
+ static get watchers() { return {
257
+ "selectedNode": ["selectNode"]
258
+ }; }
199
259
  };
200
260
  _KupImageList_clickTimeout = new WeakMap(), _KupImageList_kupManager = new WeakMap(), _KupImageList_backProps = new WeakMap(), _KupImageList_topProps = new WeakMap(), _KupImageList_instances = new WeakSet(), _KupImageList_createItem = function _KupImageList_createItem(node) {
201
261
  const props = {
@@ -206,7 +266,7 @@ _KupImageList_clickTimeout = new WeakMap(), _KupImageList_kupManager = new WeakM
206
266
  };
207
267
  const image = index.h(fImage.FImage, Object.assign({}, props));
208
268
  const label = index.h("div", { class: "image-list__label" }, node.value);
209
- return (index.h(fCell.FCell, { cell: { value: node.value, icon: node.icon, obj: node.obj }, column: { name: 'IMAGE', title: 'Image' }, density: fCell.FCellPadding.NONE, row: Object.assign({}, node) }, index.h("div", { class: "image-list__wrapper" }, image, label)));
269
+ return (index.h(fCell.FCell, { cell: { value: node.value, icon: node.icon, obj: node.obj }, column: { name: 'IMAGE', title: 'Image' }, density: kupManager.FCellPadding.NONE, row: Object.assign({}, node) }, index.h("div", { class: "image-list__wrapper" }, image, label)));
210
270
  }, _KupImageList_createList = function _KupImageList_createList() {
211
271
  const nodes = [];
212
272
  const items = this.currentNode ? this.currentNode.children : this.data;