@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,474 @@
1
+ import { r as registerInstance, f as forceUpdate, h, H as Host, g as getElement } from './index-e41330a5.js';
2
+ import { k as kupManagerInstance, y as identify, g as getProps, s as setProps, al as FCellTypes, j as KupLanguageGeneric } from './kup-manager-86f440c7.js';
3
+ import { c as componentWrapperId } from './GenericVariables-665de00a.js';
4
+ import { F as FCell } from './f-cell-474dd282.js';
5
+ import { F as FTextFieldMDC } from './f-text-field-mdc-d42d3f9e.js';
6
+ import './f-checkbox-e06cf07b.js';
7
+ import './f-text-field-76341fe3.js';
8
+ import './f-image-914a03ef.js';
9
+ import './f-chip-d6f2eb94.js';
10
+ import './tslib.es6-3eea2234.js';
11
+ import './component-b1bedf1d.js';
12
+
13
+ /**
14
+ * Props of the kup-form component.
15
+ * Used to export every prop in an object.
16
+ */
17
+ var KupFormProps;
18
+ (function (KupFormProps) {
19
+ KupFormProps["customStyle"] = "Custom style of the component.";
20
+ KupFormProps["data"] = "Actual data of the form.";
21
+ KupFormProps["layout"] = "How the form will arrange its content.";
22
+ })(KupFormProps || (KupFormProps = {}));
23
+ var KupFormLabelAlignment;
24
+ (function (KupFormLabelAlignment) {
25
+ KupFormLabelAlignment["CENTER"] = "center";
26
+ KupFormLabelAlignment["LEFT"] = "left";
27
+ KupFormLabelAlignment["RIGHT"] = "right";
28
+ })(KupFormLabelAlignment || (KupFormLabelAlignment = {}));
29
+ var KupFormLabelPlacement;
30
+ (function (KupFormLabelPlacement) {
31
+ KupFormLabelPlacement["BOTTOM"] = "bottom";
32
+ KupFormLabelPlacement["LEFT"] = "left";
33
+ KupFormLabelPlacement["HIDDEN"] = "hidden";
34
+ KupFormLabelPlacement["PLACEHOLDER"] = "placeholder";
35
+ KupFormLabelPlacement["RIGHT"] = "right";
36
+ KupFormLabelPlacement["TOP"] = "top";
37
+ })(KupFormLabelPlacement || (KupFormLabelPlacement = {}));
38
+
39
+ 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}";
40
+
41
+ const dom = document.documentElement;
42
+ const KupForm = class {
43
+ constructor(hostRef) {
44
+ registerInstance(this, hostRef);
45
+ /*-------------------------------------------------*/
46
+ /* P r o p s */
47
+ /*-------------------------------------------------*/
48
+ /**
49
+ * Custom style of the component.
50
+ * @default ""
51
+ * @see https://ketchup.smeup.com/ketchup-showcase/#/customization
52
+ */
53
+ this.customStyle = '';
54
+ /**
55
+ * Actual data of the form.
56
+ * @default null
57
+ */
58
+ this.data = null;
59
+ /**
60
+ * How the form will arrange its content.
61
+ * @default null
62
+ */
63
+ this.layout = null;
64
+ /*-------------------------------------------------*/
65
+ /* I n t e r n a l V a r i a b l e s */
66
+ /*-------------------------------------------------*/
67
+ this.kupManager = kupManagerInstance();
68
+ this.visibleColumns = [];
69
+ }
70
+ /*-------------------------------------------------*/
71
+ /* W a t c h e r s */
72
+ /*-------------------------------------------------*/
73
+ onDataChanged() {
74
+ identify(this.getRows());
75
+ this.initVisibleColumns();
76
+ this.checkLayout();
77
+ }
78
+ onLayoutChanged() {
79
+ this.checkLayout();
80
+ }
81
+ /*-------------------------------------------------*/
82
+ /* P u b l i c M e t h o d s */
83
+ /*-------------------------------------------------*/
84
+ /**
85
+ * Used to retrieve component's props values.
86
+ * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
87
+ * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
88
+ */
89
+ async getProps(descriptions) {
90
+ return getProps(this, KupFormProps, descriptions);
91
+ }
92
+ /**
93
+ * This method is used to trigger a new render of the component.
94
+ */
95
+ async refresh() {
96
+ forceUpdate(this);
97
+ }
98
+ /**
99
+ * Sets the focus on an editable table cell.
100
+ * @param {string} column - Name of the column.
101
+ * @param {string} rowId - Id of the row.
102
+ */
103
+ async setFocus(column, rowId) {
104
+ const cells = this.rootElement.shadowRoot.querySelectorAll('td[data-column="' + column + '"]');
105
+ for (let index = 0; cells && index < cells.length; index++) {
106
+ const cell = cells[index];
107
+ if (cell['data-row'] && cell['data-row'].id == rowId) {
108
+ const input = cell.querySelector('input');
109
+ if (input) {
110
+ input.focus();
111
+ }
112
+ else {
113
+ const kupInput = cell.querySelector('.hydrated');
114
+ if (kupInput) {
115
+ try {
116
+ kupInput.setFocus();
117
+ }
118
+ catch (error) { }
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+ /**
125
+ * Sets the props to the component.
126
+ * @param {GenericObject} props - Object containing props that will be set to the component.
127
+ */
128
+ async setProps(props) {
129
+ setProps(this, KupFormProps, props);
130
+ }
131
+ /*-------------------------------------------------*/
132
+ /* P r i v a t e M e t h o d s */
133
+ /*-------------------------------------------------*/
134
+ getColumns() {
135
+ return this.data && this.data.columns
136
+ ? this.data.columns
137
+ : [{ title: '', name: '', size: undefined }];
138
+ }
139
+ initVisibleColumns() {
140
+ this.visibleColumns = this.getColumns().filter((column) => {
141
+ if (column.hasOwnProperty('visible')) {
142
+ return column.visible;
143
+ }
144
+ return true;
145
+ });
146
+ }
147
+ getRows() {
148
+ return this.data && this.data.rows ? this.data.rows : [];
149
+ }
150
+ checkLayout() {
151
+ if (this.layout) {
152
+ this.formLayout = this.layout;
153
+ return;
154
+ }
155
+ const section = {
156
+ horizontal: false,
157
+ sections: [],
158
+ };
159
+ const visibleColumns = this.visibleColumns;
160
+ let size = visibleColumns.length;
161
+ const content = [];
162
+ let cnt = 0;
163
+ while (size-- > 0) {
164
+ content.push({
165
+ column: visibleColumns[cnt++].name,
166
+ });
167
+ }
168
+ section.content = content;
169
+ this.formLayout = {
170
+ sections: [section],
171
+ };
172
+ }
173
+ renderRow(row) {
174
+ const visibleColumns = [...this.visibleColumns];
175
+ let formContent = null;
176
+ let rowLayout = row.layout;
177
+ if (!rowLayout) {
178
+ rowLayout = this.formLayout;
179
+ }
180
+ let horizontal = false;
181
+ if (rowLayout) {
182
+ if (rowLayout.horizontal) {
183
+ horizontal = true;
184
+ }
185
+ const sections = rowLayout.sections;
186
+ let size = sections.length;
187
+ let cnt = 0;
188
+ if (size > 0) {
189
+ formContent = [];
190
+ }
191
+ const parent = {
192
+ horizontal: horizontal,
193
+ };
194
+ while (size-- > 0) {
195
+ formContent.push(this.renderSection(sections[cnt++], parent, row, visibleColumns));
196
+ }
197
+ }
198
+ const classObj = {
199
+ form: true,
200
+ 'form--column': !horizontal,
201
+ };
202
+ return h("form", { class: classObj }, formContent);
203
+ }
204
+ renderSection(section, parent, row, visibleColumns) {
205
+ var _a;
206
+ let sectionContent = null;
207
+ if (section.sections && section.sections.length > 0) {
208
+ const sections = section.sections;
209
+ let size = sections.length;
210
+ let cnt = 0;
211
+ if (size > 0) {
212
+ sectionContent = [];
213
+ }
214
+ while (size-- > 0) {
215
+ sectionContent.push(this.renderSection(sections[cnt++], section, row, visibleColumns));
216
+ }
217
+ }
218
+ else if (section.content) {
219
+ const content = section.content;
220
+ let size = content.length;
221
+ let cnt = 0;
222
+ if (size > 0) {
223
+ sectionContent = [];
224
+ }
225
+ while (size-- > 0) {
226
+ const formField = this.renderFormField({
227
+ formField: content[cnt++],
228
+ row,
229
+ visibleColumns,
230
+ }, section);
231
+ let field = formField;
232
+ if (!section.horizontal) {
233
+ field = h("tr", null, formField);
234
+ }
235
+ sectionContent.push(field);
236
+ }
237
+ }
238
+ else if (visibleColumns.length > 0) {
239
+ const column = visibleColumns[0];
240
+ sectionContent = this.renderFormField({
241
+ formField: { column: column.name },
242
+ row,
243
+ visibleColumns,
244
+ });
245
+ }
246
+ const isGrid = !!section.columns;
247
+ const labelPlacement = ((_a = section === null || section === void 0 ? void 0 : section.label) === null || _a === void 0 ? void 0 : _a.placement) || KupFormLabelPlacement.LEFT;
248
+ const sectionClass = {
249
+ form__section: true,
250
+ 'form__section--column': !isGrid && !section.horizontal,
251
+ 'form__section--grid': isGrid,
252
+ 'form__section--titled': !!section.title,
253
+ 'form__section--last': !section.sections || section.sections.length === 0,
254
+ [`form__section--${labelPlacement}`]: true,
255
+ };
256
+ const sectionStyle = section.style || {};
257
+ if (section.dim && parent) {
258
+ sectionStyle.flex = `0 0 ${section.dim}`;
259
+ if (parent.horizontal) {
260
+ sectionStyle.maxWidth = section.dim;
261
+ }
262
+ else {
263
+ sectionStyle.maxHeight = section.dim;
264
+ }
265
+ }
266
+ if (isGrid) {
267
+ sectionStyle['grid-template-columns'] = `repeat(${section.columns}, 1fr)`;
268
+ }
269
+ return (h("div", { class: sectionClass, style: sectionStyle }, section.title ? h("h3", null, section.title) : null, h("table", null, h("tbody", null, section.horizontal ? (h("tr", null, sectionContent)) : (sectionContent)))));
270
+ }
271
+ renderFormField({ formField, row, visibleColumns, }, section) {
272
+ var _a;
273
+ const classObj = {
274
+ form__field: true,
275
+ };
276
+ const styleObj = {};
277
+ let column = null;
278
+ let index = -1;
279
+ for (let i = 0; i < visibleColumns.length; i++) {
280
+ const c = visibleColumns[i];
281
+ if (c.name === formField.column) {
282
+ index = i;
283
+ break;
284
+ }
285
+ }
286
+ if (index >= 0) {
287
+ column = visibleColumns[index];
288
+ visibleColumns.splice(index, 1);
289
+ }
290
+ else if (section) {
291
+ column = this.data.columns.find((x) => x.name === formField.column);
292
+ }
293
+ const cell = row.cells[formField.column];
294
+ let title = undefined;
295
+ if (cell) {
296
+ cell.isEditable = true;
297
+ if (!this.kupManager.objects.isEmptyKupObj(cell.obj)) {
298
+ if (this.kupManager.debug.isDebug()) {
299
+ title =
300
+ cell.obj.t +
301
+ '; ' +
302
+ cell.obj.p +
303
+ '; ' +
304
+ cell.obj.k +
305
+ ';';
306
+ }
307
+ }
308
+ }
309
+ else {
310
+ return null;
311
+ }
312
+ const cellProps = {
313
+ cell: formField.data ? Object.assign(Object.assign({}, cell), { data: formField.data }) : cell,
314
+ column: column,
315
+ component: this,
316
+ editable: true,
317
+ renderKup: true,
318
+ row: row,
319
+ setSizes: true,
320
+ shape: formField.shape,
321
+ };
322
+ const label = formField.label || column.title;
323
+ resetLabel();
324
+ switch ((_a = section.label) === null || _a === void 0 ? void 0 : _a.placement) {
325
+ case KupFormLabelPlacement.BOTTOM:
326
+ return [h("tr", null, fieldCell()), h("tr", null, labelCell(label))];
327
+ case KupFormLabelPlacement.PLACEHOLDER:
328
+ setPlaceholderLabel();
329
+ case KupFormLabelPlacement.HIDDEN: {
330
+ if (section) {
331
+ return [fieldCell()];
332
+ }
333
+ else {
334
+ return [h("tr", null, fieldCell())];
335
+ }
336
+ }
337
+ case KupFormLabelPlacement.RIGHT: {
338
+ if (section) {
339
+ return [fieldCell(), labelCell(label)];
340
+ }
341
+ else {
342
+ return [
343
+ h("tr", null, fieldCell(), labelCell(label)),
344
+ ];
345
+ }
346
+ }
347
+ case KupFormLabelPlacement.TOP:
348
+ return [h("tr", null, labelCell(label)), h("tr", null, fieldCell())];
349
+ default: {
350
+ if (section) {
351
+ return [labelCell(label), fieldCell()];
352
+ }
353
+ else {
354
+ return [
355
+ h("tr", null, labelCell(label), fieldCell()),
356
+ ];
357
+ }
358
+ }
359
+ }
360
+ function fieldCell() {
361
+ return (h("td", { "data-cell": cell, "data-row": row, "data-column": formField.column, class: classObj, style: styleObj, title: title }, cell && column ? (h(FCell, Object.assign({}, cellProps))) : (h("span", null, formField.value))));
362
+ }
363
+ function labelCell(label) {
364
+ var _a, _b, _c;
365
+ const alignment = ((_a = section === null || section === void 0 ? void 0 : section.label) === null || _a === void 0 ? void 0 : _a.alignment) || KupFormLabelAlignment.LEFT;
366
+ const style = {
367
+ 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 : '',
368
+ };
369
+ return (h("td", { class: `form__label form__label--${alignment}`, style: style }, h("span", null, label)));
370
+ }
371
+ function resetLabel() {
372
+ if (!cell.data) {
373
+ cell.data = {};
374
+ }
375
+ try {
376
+ delete cell.data.label;
377
+ }
378
+ catch (_a) { }
379
+ try {
380
+ delete cell.data.data['kup-text-field'].label;
381
+ }
382
+ catch (_b) { }
383
+ }
384
+ function setPlaceholderLabel() {
385
+ switch (dom.ketchup.data.cell.getType(cell, cell.shape || column.shape || null)) {
386
+ case FCellTypes.AUTOCOMPLETE:
387
+ case FCellTypes.COLOR_PICKER:
388
+ case FCellTypes.COMBOBOX:
389
+ case FCellTypes.DATE:
390
+ case FCellTypes.DATETIME:
391
+ case FCellTypes.TIME:
392
+ if (cell.data.data) {
393
+ if (cell.data.data['kup-text-field']) {
394
+ cell.data.data['kup-text-field'].label =
395
+ column.title;
396
+ }
397
+ else {
398
+ cell.data.data = {
399
+ 'kup-text-field': {
400
+ label: column.title,
401
+ },
402
+ };
403
+ }
404
+ }
405
+ else {
406
+ cell.data.data = {
407
+ 'kup-text-field': {
408
+ label: column.title,
409
+ },
410
+ };
411
+ }
412
+ break;
413
+ case FCellTypes.CHECKBOX:
414
+ case FCellTypes.NUMBER:
415
+ case FCellTypes.STRING:
416
+ case FCellTypes.SWITCH:
417
+ cell.data.label = column.title;
418
+ }
419
+ }
420
+ }
421
+ /*-------------------------------------------------*/
422
+ /* L i f e c y c l e H o o k s */
423
+ /*-------------------------------------------------*/
424
+ componentWillLoad() {
425
+ this.kupManager.debug.logLoad(this, false);
426
+ this.kupManager.language.register(this);
427
+ this.kupManager.theme.register(this);
428
+ this.onDataChanged();
429
+ }
430
+ componentDidLoad() {
431
+ this.kupManager.debug.logLoad(this, true);
432
+ }
433
+ componentWillRender() {
434
+ this.kupManager.debug.logRender(this, false);
435
+ }
436
+ componentDidRender() {
437
+ const root = this.rootElement.shadowRoot;
438
+ if (root) {
439
+ const fs = root.querySelectorAll('.f-text-field');
440
+ for (let index = 0; index < fs.length; index++) {
441
+ FTextFieldMDC(fs[index]);
442
+ }
443
+ }
444
+ this.kupManager.debug.logRender(this, true);
445
+ }
446
+ render() {
447
+ let formContent = null;
448
+ if (this.data.rows.length === 0) {
449
+ formContent = (h("p", null, this.kupManager.language.translate(KupLanguageGeneric.EMPTY_DATA)));
450
+ }
451
+ else {
452
+ const rows = this.data.rows;
453
+ let size = rows.length;
454
+ let cnt = 0;
455
+ formContent = [];
456
+ while (size-- > 0) {
457
+ formContent.push(this.renderRow(rows[cnt++]));
458
+ }
459
+ }
460
+ return (h(Host, null, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, formContent)));
461
+ }
462
+ disconnectedCallback() {
463
+ this.kupManager.language.unregister(this);
464
+ this.kupManager.theme.unregister(this);
465
+ }
466
+ get rootElement() { return getElement(this); }
467
+ static get watchers() { return {
468
+ "data": ["onDataChanged"],
469
+ "layout": ["onLayoutChanged"]
470
+ }; }
471
+ };
472
+ KupForm.style = kupFormCss;
473
+
474
+ export { KupForm as kup_form };
@@ -1,6 +1,5 @@
1
- import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-baeab1ac.js';
2
- import { k as kupManagerInstance, c as KupDebugCategory } from './kup-manager-58b075b4.js';
3
- import { g as getProps, s as setProps } from './utils-d7e4b3c2.js';
1
+ import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-e41330a5.js';
2
+ import { k as kupManagerInstance, g as getProps, s as setProps, c as KupDebugCategory } from './kup-manager-86f440c7.js';
4
3
 
5
4
  /**
6
5
  * Props of the kup-iframe component.
@@ -1,15 +1,14 @@
1
- import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-baeab1ac.js';
2
- import { k as kupManagerInstance, h as KupLanguageGeneric } from './kup-manager-58b075b4.js';
3
- import { g as getProps, s as setProps } from './utils-d7e4b3c2.js';
1
+ import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-e41330a5.js';
2
+ import { k as kupManagerInstance, g as getProps, s as setProps, j as KupLanguageGeneric, I as FCellPadding } from './kup-manager-86f440c7.js';
4
3
  import { c as componentWrapperId } from './GenericVariables-665de00a.js';
5
- import { F as FImage } from './f-image-c468d8ae.js';
6
- import { F as FButton } from './f-button-871a544b.js';
4
+ import { F as FImage } from './f-image-914a03ef.js';
5
+ import { F as FButton } from './f-button-cd948e50.js';
7
6
  import { F as FButtonStyling } from './f-button-declarations-b1b4cac4.js';
8
- import { a as FCellPadding, b as FCell } from './f-cell-521ef17a.js';
7
+ import { F as FCell } from './f-cell-474dd282.js';
9
8
  import { M as MDCRipple } from './component-b1bedf1d.js';
10
- import './cell-utils-964da6b5.js';
11
- import './f-text-field-d6c61c73.js';
12
- import './f-chip-1dda722f.js';
9
+ import './f-checkbox-e06cf07b.js';
10
+ import './f-text-field-76341fe3.js';
11
+ import './f-chip-d6f2eb94.js';
13
12
  import './tslib.es6-3eea2234.js';
14
13
 
15
14
  /**
@@ -23,7 +22,17 @@ var KupImageListProps;
23
22
  KupImageListProps["ripple"] = "When enabled displays Material's ripple effect on clicked items.";
24
23
  })(KupImageListProps || (KupImageListProps = {}));
25
24
 
26
- 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}";
25
+ class KupImageListState {
26
+ constructor() {
27
+ this.load = false;
28
+ }
29
+ toDebugString() {
30
+ // TODO
31
+ return 'image-list state';
32
+ }
33
+ }
34
+
35
+ 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}";
27
36
 
28
37
  var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
29
38
  if (kind === "a" && !f)
@@ -52,6 +61,7 @@ const KupImageList = class {
52
61
  /*-------------------------------------------------*/
53
62
  /* S t a t e s */
54
63
  /*-------------------------------------------------*/
64
+ this.state = new KupImageListState();
55
65
  this.currentNode = null;
56
66
  this.navigationBarToggled = false;
57
67
  /*-------------------------------------------------*/
@@ -73,9 +83,18 @@ const KupImageList = class {
73
83
  * @default true
74
84
  */
75
85
  this.ripple = true;
86
+ /**
87
+ * An array of integers containing the path to a selected child.\
88
+ */
89
+ this.selectedNode = [];
90
+ this.stateId = '';
76
91
  /*-------------------------------------------------*/
77
92
  /* I n t e r n a l V a r i a b l e s */
78
93
  /*-------------------------------------------------*/
94
+ /**
95
+ * Instance of the KupManager class.
96
+ */
97
+ this.kupManager = kupManagerInstance();
79
98
  _KupImageList_clickTimeout.set(this, []);
80
99
  _KupImageList_kupManager.set(this, kupManagerInstance());
81
100
  _KupImageList_backProps.set(this, {
@@ -99,6 +118,32 @@ const KupImageList = class {
99
118
  wrapperClass: 'navigation-bar__top',
100
119
  });
101
120
  }
121
+ initWithPersistedState() {
122
+ if (this.store && this.stateId) {
123
+ const state = this.store.getState(this.stateId);
124
+ if (state != null) {
125
+ this.currentNode =
126
+ this.kupManager.data.node.findByStrTreeNodePath(this.data, state.selectedTreeNodePath);
127
+ }
128
+ }
129
+ }
130
+ persistState() {
131
+ if (this.store && this.stateId) {
132
+ let somethingChanged = false;
133
+ let cNodeRowId = this.currentNode ? this.currentNode.id : '';
134
+ if (!this.kupManager.objects.deepEqual(this.state.selectedTreeNodePath, cNodeRowId)) {
135
+ this.state.selectedTreeNodePath = cNodeRowId;
136
+ somethingChanged = true;
137
+ }
138
+ if (!this.state.load) {
139
+ this.state.load = true;
140
+ return;
141
+ }
142
+ if (somethingChanged) {
143
+ this.store.persistState(this.stateId, this.state);
144
+ }
145
+ }
146
+ }
102
147
  onKupClick(node) {
103
148
  if (node.children && node.children.length > 0) {
104
149
  this.currentNode = node;
@@ -129,6 +174,15 @@ const KupImageList = class {
129
174
  });
130
175
  }
131
176
  /*-------------------------------------------------*/
177
+ /* W a t c h e r s */
178
+ /*-------------------------------------------------*/
179
+ selectNode(newData) {
180
+ if (!newData || newData.length == 0) {
181
+ return;
182
+ }
183
+ this.currentNode = this.kupManager.data.node.find(this.data, newData);
184
+ }
185
+ /*-------------------------------------------------*/
132
186
  /* P u b l i c M e t h o d s */
133
187
  /*-------------------------------------------------*/
134
188
  /**
@@ -176,6 +230,9 @@ const KupImageList = class {
176
230
  }
177
231
  }
178
232
  }
233
+ // *** Store
234
+ this.persistState();
235
+ // ***
179
236
  __classPrivateFieldGet(this, _KupImageList_kupManager, "f").debug.logRender(this, true);
180
237
  }
181
238
  render() {
@@ -192,6 +249,9 @@ const KupImageList = class {
192
249
  __classPrivateFieldGet(this, _KupImageList_kupManager, "f").theme.unregister(this);
193
250
  }
194
251
  get rootElement() { return getElement(this); }
252
+ static get watchers() { return {
253
+ "selectedNode": ["selectNode"]
254
+ }; }
195
255
  };
196
256
  _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) {
197
257
  const props = {
@@ -1,6 +1,5 @@
1
- import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-baeab1ac.js';
2
- import { k as kupManagerInstance } from './kup-manager-58b075b4.js';
3
- import { g as getProps, s as setProps } from './utils-d7e4b3c2.js';
1
+ import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-e41330a5.js';
2
+ import { k as kupManagerInstance, g as getProps, s as setProps } from './kup-manager-86f440c7.js';
4
3
  import { c as componentWrapperId } from './GenericVariables-665de00a.js';
5
4
 
6
5
  /**
@@ -24,7 +23,7 @@ var KupLazyRender;
24
23
  KupLazyRender["BOTH"] = "both";
25
24
  })(KupLazyRender || (KupLazyRender = {}));
26
25
 
27
- const kupLazyCss = ":host{--kup_lazy_hor_alignment:var(--kup-lazy-hor-alignment, center);--kup_lazy_ver_alignment:var(--kup-lazy-ver-alignment, center);--kup_lazy_animation_time:var(--kup-lazy-animation-time, 2s);--kup_lazy_placeholder_color:var(\n --kup-lazy-placeholder-color,\n var(--kup-icon-color)\n );display:block;height:100%;width:100%;position:relative}#kup-component{align-items:var(--kup_lazy_ver_alignment);display:flex;justify-content:var(--kup_lazy_hor_alignment);height:100%;width:100%}#kup-component kup-data-table{min-width:100%}svg{fill:var(--kup_lazy_placeholder_color);animation:shine ease var(--kup_lazy_animation_time) infinite}@keyframes shine{0%{opacity:0.4}50%{opacity:0.8}100%{opacity:0.4}}:host(.kup-bottom-aligned){--kup-lazy-ver-alignment:flex-end}:host(.kup-left-aligned){--kup-lazy-hor-alignment:flex-start}:host(.kup-right-aligned){--kup-lazy-hor-alignment:flex-end}:host(.kup-top-aligned){--kup-lazy-ver-alignment:flex-start}:host(.kup-to-be-loaded) #kup-component{position:absolute}:host(.kup-to-be-loaded) #kup-component>*{margin:auto}";
26
+ const kupLazyCss = ":host{--kup_lazy_animation_time:var(--kup-lazy-animation-time, 2s);--kup_lazy_hor_alignment:var(--kup-lazy-hor-alignment, center);--kup_lazy_placeholder_color:var(\n --kup-lazy-placeholder-color,\n var(--kup-icon-color)\n );--kup_lazy_ver_alignment:var(--kup-lazy-ver-alignment, center);--kup_lazy_width:var(--kup-lazy-width, 100%);display:block;height:100%;width:var(--kup_lazy_width);position:relative}#kup-component{align-items:var(--kup_lazy_ver_alignment);display:flex;justify-content:var(--kup_lazy_hor_alignment);height:100%;width:var(--kup_lazy_width)}#kup-component kup-data-table{min-width:100%}.kup-loaded,.kup-to-be-loaded{width:var(--kup_lazy_width)}svg{fill:var(--kup_lazy_placeholder_color);animation:shine ease var(--kup_lazy_animation_time) infinite}@keyframes shine{0%{opacity:0.4}50%{opacity:0.8}100%{opacity:0.4}}:host(.kup-bottom-aligned){--kup-lazy-ver-alignment:flex-end}:host(.kup-left-aligned){--kup-lazy-hor-alignment:flex-start}:host(.kup-right-aligned){--kup-lazy-hor-alignment:flex-end}:host(.kup-top-aligned){--kup-lazy-ver-alignment:flex-start}:host(.kup-to-be-loaded) #kup-component{position:absolute}:host(.kup-to-be-loaded) #kup-component>*{margin:auto}";
28
27
 
29
28
  const KupLazy = class {
30
29
  constructor(hostRef) {
@@ -1,8 +1,7 @@
1
- import { r as registerInstance, f as forceUpdate, h, H as Host, g as getElement } from './index-baeab1ac.js';
2
- import { k as kupManagerInstance, h as KupLanguageGeneric, c as KupDebugCategory, _ as kupDropEvent, z as kupDraggableColumnAttr, $ as kupDraggableRowAttr, D as KupDropEventTypes, b as KupThemeColorValues } from './kup-manager-58b075b4.js';
1
+ import { r as registerInstance, f as forceUpdate, h, H as Host, g as getElement } from './index-e41330a5.js';
2
+ import { k as kupManagerInstance, g as getProps, s as setProps, j as KupLanguageGeneric, c as KupDebugCategory, aw as kupDropEvent, O as kupDraggableColumnAttr, ax as kupDraggableRowAttr, V as KupDropEventTypes, b as KupThemeColorValues } from './kup-manager-86f440c7.js';
3
3
  import { F as FButtonStyling } from './f-button-declarations-b1b4cac4.js';
4
- import { F as FImage } from './f-image-c468d8ae.js';
5
- import { g as getProps, s as setProps } from './utils-d7e4b3c2.js';
4
+ import { F as FImage } from './f-image-914a03ef.js';
6
5
  import { c as componentWrapperId } from './GenericVariables-665de00a.js';
7
6
 
8
7
  /**