@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,647 @@
1
+ import { Component, Element, forceUpdate, h, Host, Method, Prop, Watch, } from '@stencil/core';
2
+ import { KupFormProps, KupFormLabelPlacement, KupFormLabelAlignment, } from './kup-form-declarations';
3
+ import { kupManagerInstance, } from '../../managers/kup-manager/kup-manager';
4
+ import { getProps, identify, setProps } from '../../utils/utils';
5
+ import { KupLanguageGeneric } from '../../managers/kup-language/kup-language-declarations';
6
+ import { componentWrapperId } from '../../variables/GenericVariables';
7
+ import { FCell } from '../../f-components/f-cell/f-cell';
8
+ import { FCellTypes, } from '../../f-components/f-cell/f-cell-declarations';
9
+ import { FTextFieldMDC } from '../../f-components/f-text-field/f-text-field-mdc';
10
+ const dom = document.documentElement;
11
+ export class KupForm {
12
+ constructor() {
13
+ /*-------------------------------------------------*/
14
+ /* P r o p s */
15
+ /*-------------------------------------------------*/
16
+ /**
17
+ * Custom style of the component.
18
+ * @default ""
19
+ * @see https://ketchup.smeup.com/ketchup-showcase/#/customization
20
+ */
21
+ this.customStyle = '';
22
+ /**
23
+ * Actual data of the form.
24
+ * @default null
25
+ */
26
+ this.data = null;
27
+ /**
28
+ * How the form will arrange its content.
29
+ * @default null
30
+ */
31
+ this.layout = null;
32
+ /*-------------------------------------------------*/
33
+ /* I n t e r n a l V a r i a b l e s */
34
+ /*-------------------------------------------------*/
35
+ this.kupManager = kupManagerInstance();
36
+ this.visibleColumns = [];
37
+ }
38
+ /*-------------------------------------------------*/
39
+ /* W a t c h e r s */
40
+ /*-------------------------------------------------*/
41
+ onDataChanged() {
42
+ identify(this.getRows());
43
+ this.initVisibleColumns();
44
+ this.checkLayout();
45
+ }
46
+ onLayoutChanged() {
47
+ this.checkLayout();
48
+ }
49
+ /*-------------------------------------------------*/
50
+ /* P u b l i c M e t h o d s */
51
+ /*-------------------------------------------------*/
52
+ /**
53
+ * Used to retrieve component's props values.
54
+ * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
55
+ * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
56
+ */
57
+ async getProps(descriptions) {
58
+ return getProps(this, KupFormProps, descriptions);
59
+ }
60
+ /**
61
+ * This method is used to trigger a new render of the component.
62
+ */
63
+ async refresh() {
64
+ forceUpdate(this);
65
+ }
66
+ /**
67
+ * Sets the focus on an editable table cell.
68
+ * @param {string} column - Name of the column.
69
+ * @param {string} rowId - Id of the row.
70
+ */
71
+ async setFocus(column, rowId) {
72
+ const cells = this.rootElement.shadowRoot.querySelectorAll('td[data-column="' + column + '"]');
73
+ for (let index = 0; cells && index < cells.length; index++) {
74
+ const cell = cells[index];
75
+ if (cell['data-row'] && cell['data-row'].id == rowId) {
76
+ const input = cell.querySelector('input');
77
+ if (input) {
78
+ input.focus();
79
+ }
80
+ else {
81
+ const kupInput = cell.querySelector('.hydrated');
82
+ if (kupInput) {
83
+ try {
84
+ kupInput.setFocus();
85
+ }
86
+ catch (error) { }
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }
92
+ /**
93
+ * Sets the props to the component.
94
+ * @param {GenericObject} props - Object containing props that will be set to the component.
95
+ */
96
+ async setProps(props) {
97
+ setProps(this, KupFormProps, props);
98
+ }
99
+ /*-------------------------------------------------*/
100
+ /* P r i v a t e M e t h o d s */
101
+ /*-------------------------------------------------*/
102
+ getColumns() {
103
+ return this.data && this.data.columns
104
+ ? this.data.columns
105
+ : [{ title: '', name: '', size: undefined }];
106
+ }
107
+ initVisibleColumns() {
108
+ this.visibleColumns = this.getColumns().filter((column) => {
109
+ if (column.hasOwnProperty('visible')) {
110
+ return column.visible;
111
+ }
112
+ return true;
113
+ });
114
+ }
115
+ getRows() {
116
+ return this.data && this.data.rows ? this.data.rows : [];
117
+ }
118
+ checkLayout() {
119
+ if (this.layout) {
120
+ this.formLayout = this.layout;
121
+ return;
122
+ }
123
+ const section = {
124
+ horizontal: false,
125
+ sections: [],
126
+ };
127
+ const visibleColumns = this.visibleColumns;
128
+ let size = visibleColumns.length;
129
+ const content = [];
130
+ let cnt = 0;
131
+ while (size-- > 0) {
132
+ content.push({
133
+ column: visibleColumns[cnt++].name,
134
+ });
135
+ }
136
+ section.content = content;
137
+ this.formLayout = {
138
+ sections: [section],
139
+ };
140
+ }
141
+ renderRow(row) {
142
+ const visibleColumns = [...this.visibleColumns];
143
+ let formContent = null;
144
+ let rowLayout = row.layout;
145
+ if (!rowLayout) {
146
+ rowLayout = this.formLayout;
147
+ }
148
+ let horizontal = false;
149
+ if (rowLayout) {
150
+ if (rowLayout.horizontal) {
151
+ horizontal = true;
152
+ }
153
+ const sections = rowLayout.sections;
154
+ let size = sections.length;
155
+ let cnt = 0;
156
+ if (size > 0) {
157
+ formContent = [];
158
+ }
159
+ const parent = {
160
+ horizontal: horizontal,
161
+ };
162
+ while (size-- > 0) {
163
+ formContent.push(this.renderSection(sections[cnt++], parent, row, visibleColumns));
164
+ }
165
+ }
166
+ const classObj = {
167
+ form: true,
168
+ 'form--column': !horizontal,
169
+ };
170
+ return h("form", { class: classObj }, formContent);
171
+ }
172
+ renderSection(section, parent, row, visibleColumns) {
173
+ var _a;
174
+ let sectionContent = null;
175
+ if (section.sections && section.sections.length > 0) {
176
+ const sections = section.sections;
177
+ let size = sections.length;
178
+ let cnt = 0;
179
+ if (size > 0) {
180
+ sectionContent = [];
181
+ }
182
+ while (size-- > 0) {
183
+ sectionContent.push(this.renderSection(sections[cnt++], section, row, visibleColumns));
184
+ }
185
+ }
186
+ else if (section.content) {
187
+ const content = section.content;
188
+ let size = content.length;
189
+ let cnt = 0;
190
+ if (size > 0) {
191
+ sectionContent = [];
192
+ }
193
+ while (size-- > 0) {
194
+ const formField = this.renderFormField({
195
+ formField: content[cnt++],
196
+ row,
197
+ visibleColumns,
198
+ }, section);
199
+ let field = formField;
200
+ if (!section.horizontal) {
201
+ field = h("tr", null, formField);
202
+ }
203
+ sectionContent.push(field);
204
+ }
205
+ }
206
+ else if (visibleColumns.length > 0) {
207
+ const column = visibleColumns[0];
208
+ sectionContent = this.renderFormField({
209
+ formField: { column: column.name },
210
+ row,
211
+ visibleColumns,
212
+ });
213
+ }
214
+ const isGrid = !!section.columns;
215
+ const labelPlacement = ((_a = section === null || section === void 0 ? void 0 : section.label) === null || _a === void 0 ? void 0 : _a.placement) || KupFormLabelPlacement.LEFT;
216
+ const sectionClass = {
217
+ form__section: true,
218
+ 'form__section--column': !isGrid && !section.horizontal,
219
+ 'form__section--grid': isGrid,
220
+ 'form__section--titled': !!section.title,
221
+ 'form__section--last': !section.sections || section.sections.length === 0,
222
+ [`form__section--${labelPlacement}`]: true,
223
+ };
224
+ const sectionStyle = section.style || {};
225
+ if (section.dim && parent) {
226
+ sectionStyle.flex = `0 0 ${section.dim}`;
227
+ if (parent.horizontal) {
228
+ sectionStyle.maxWidth = section.dim;
229
+ }
230
+ else {
231
+ sectionStyle.maxHeight = section.dim;
232
+ }
233
+ }
234
+ if (isGrid) {
235
+ sectionStyle['grid-template-columns'] = `repeat(${section.columns}, 1fr)`;
236
+ }
237
+ return (h("div", { class: sectionClass, style: sectionStyle },
238
+ section.title ? h("h3", null, section.title) : null,
239
+ h("table", null,
240
+ h("tbody", null, section.horizontal ? (h("tr", null, sectionContent)) : (sectionContent)))));
241
+ }
242
+ renderFormField({ formField, row, visibleColumns, }, section) {
243
+ var _a;
244
+ const classObj = {
245
+ form__field: true,
246
+ };
247
+ const styleObj = {};
248
+ let column = null;
249
+ let index = -1;
250
+ for (let i = 0; i < visibleColumns.length; i++) {
251
+ const c = visibleColumns[i];
252
+ if (c.name === formField.column) {
253
+ index = i;
254
+ break;
255
+ }
256
+ }
257
+ if (index >= 0) {
258
+ column = visibleColumns[index];
259
+ visibleColumns.splice(index, 1);
260
+ }
261
+ else if (section) {
262
+ column = this.data.columns.find((x) => x.name === formField.column);
263
+ }
264
+ const cell = row.cells[formField.column];
265
+ let title = undefined;
266
+ if (cell) {
267
+ cell.isEditable = true;
268
+ if (!this.kupManager.objects.isEmptyKupObj(cell.obj)) {
269
+ if (this.kupManager.debug.isDebug()) {
270
+ title =
271
+ cell.obj.t +
272
+ '; ' +
273
+ cell.obj.p +
274
+ '; ' +
275
+ cell.obj.k +
276
+ ';';
277
+ }
278
+ }
279
+ }
280
+ else {
281
+ return null;
282
+ }
283
+ const cellProps = {
284
+ cell: formField.data ? Object.assign(Object.assign({}, cell), { data: formField.data }) : cell,
285
+ column: column,
286
+ component: this,
287
+ editable: true,
288
+ renderKup: true,
289
+ row: row,
290
+ setSizes: true,
291
+ shape: formField.shape,
292
+ };
293
+ const label = formField.label || column.title;
294
+ resetLabel();
295
+ switch ((_a = section.label) === null || _a === void 0 ? void 0 : _a.placement) {
296
+ case KupFormLabelPlacement.BOTTOM:
297
+ return [h("tr", null, fieldCell()), h("tr", null, labelCell(label))];
298
+ case KupFormLabelPlacement.PLACEHOLDER:
299
+ setPlaceholderLabel();
300
+ case KupFormLabelPlacement.HIDDEN: {
301
+ if (section) {
302
+ return [fieldCell()];
303
+ }
304
+ else {
305
+ return [h("tr", null, fieldCell())];
306
+ }
307
+ }
308
+ case KupFormLabelPlacement.RIGHT: {
309
+ if (section) {
310
+ return [fieldCell(), labelCell(label)];
311
+ }
312
+ else {
313
+ return [
314
+ h("tr", null,
315
+ fieldCell(),
316
+ labelCell(label)),
317
+ ];
318
+ }
319
+ }
320
+ case KupFormLabelPlacement.TOP:
321
+ return [h("tr", null, labelCell(label)), h("tr", null, fieldCell())];
322
+ default: {
323
+ if (section) {
324
+ return [labelCell(label), fieldCell()];
325
+ }
326
+ else {
327
+ return [
328
+ h("tr", null,
329
+ labelCell(label),
330
+ fieldCell()),
331
+ ];
332
+ }
333
+ }
334
+ }
335
+ function fieldCell() {
336
+ 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))));
337
+ }
338
+ function labelCell(label) {
339
+ var _a, _b, _c;
340
+ const alignment = ((_a = section === null || section === void 0 ? void 0 : section.label) === null || _a === void 0 ? void 0 : _a.alignment) || KupFormLabelAlignment.LEFT;
341
+ const style = {
342
+ 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 : '',
343
+ };
344
+ return (h("td", { class: `form__label form__label--${alignment}`, style: style },
345
+ h("span", null, label)));
346
+ }
347
+ function resetLabel() {
348
+ if (!cell.data) {
349
+ cell.data = {};
350
+ }
351
+ try {
352
+ delete cell.data.label;
353
+ }
354
+ catch (_a) { }
355
+ try {
356
+ delete cell.data.data['kup-text-field'].label;
357
+ }
358
+ catch (_b) { }
359
+ }
360
+ function setPlaceholderLabel() {
361
+ switch (dom.ketchup.data.cell.getType(cell, cell.shape || column.shape || null)) {
362
+ case FCellTypes.AUTOCOMPLETE:
363
+ case FCellTypes.COLOR_PICKER:
364
+ case FCellTypes.COMBOBOX:
365
+ case FCellTypes.DATE:
366
+ case FCellTypes.DATETIME:
367
+ case FCellTypes.TIME:
368
+ if (cell.data.data) {
369
+ if (cell.data.data['kup-text-field']) {
370
+ cell.data.data['kup-text-field'].label =
371
+ column.title;
372
+ }
373
+ else {
374
+ cell.data.data = {
375
+ 'kup-text-field': {
376
+ label: column.title,
377
+ },
378
+ };
379
+ }
380
+ }
381
+ else {
382
+ cell.data.data = {
383
+ 'kup-text-field': {
384
+ label: column.title,
385
+ },
386
+ };
387
+ }
388
+ break;
389
+ case FCellTypes.CHECKBOX:
390
+ case FCellTypes.NUMBER:
391
+ case FCellTypes.STRING:
392
+ case FCellTypes.SWITCH:
393
+ cell.data.label = column.title;
394
+ }
395
+ }
396
+ }
397
+ /*-------------------------------------------------*/
398
+ /* L i f e c y c l e H o o k s */
399
+ /*-------------------------------------------------*/
400
+ componentWillLoad() {
401
+ this.kupManager.debug.logLoad(this, false);
402
+ this.kupManager.language.register(this);
403
+ this.kupManager.theme.register(this);
404
+ this.onDataChanged();
405
+ }
406
+ componentDidLoad() {
407
+ this.kupManager.debug.logLoad(this, true);
408
+ }
409
+ componentWillRender() {
410
+ this.kupManager.debug.logRender(this, false);
411
+ }
412
+ componentDidRender() {
413
+ const root = this.rootElement.shadowRoot;
414
+ if (root) {
415
+ const fs = root.querySelectorAll('.f-text-field');
416
+ for (let index = 0; index < fs.length; index++) {
417
+ FTextFieldMDC(fs[index]);
418
+ }
419
+ }
420
+ this.kupManager.debug.logRender(this, true);
421
+ }
422
+ render() {
423
+ let formContent = null;
424
+ if (this.data.rows.length === 0) {
425
+ formContent = (h("p", null, this.kupManager.language.translate(KupLanguageGeneric.EMPTY_DATA)));
426
+ }
427
+ else {
428
+ const rows = this.data.rows;
429
+ let size = rows.length;
430
+ let cnt = 0;
431
+ formContent = [];
432
+ while (size-- > 0) {
433
+ formContent.push(this.renderRow(rows[cnt++]));
434
+ }
435
+ }
436
+ return (h(Host, null,
437
+ h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)),
438
+ h("div", { id: componentWrapperId }, formContent)));
439
+ }
440
+ disconnectedCallback() {
441
+ this.kupManager.language.unregister(this);
442
+ this.kupManager.theme.unregister(this);
443
+ }
444
+ static get is() { return "kup-form"; }
445
+ static get encapsulation() { return "shadow"; }
446
+ static get originalStyleUrls() { return {
447
+ "$": ["kup-form.scss"]
448
+ }; }
449
+ static get styleUrls() { return {
450
+ "$": ["kup-form.css"]
451
+ }; }
452
+ static get properties() { return {
453
+ "customStyle": {
454
+ "type": "string",
455
+ "mutable": false,
456
+ "complexType": {
457
+ "original": "string",
458
+ "resolved": "string",
459
+ "references": {}
460
+ },
461
+ "required": false,
462
+ "optional": false,
463
+ "docs": {
464
+ "tags": [{
465
+ "name": "default",
466
+ "text": "\"\""
467
+ }, {
468
+ "name": "see",
469
+ "text": "https://ketchup.smeup.com/ketchup-showcase/#/customization"
470
+ }],
471
+ "text": "Custom style of the component."
472
+ },
473
+ "attribute": "custom-style",
474
+ "reflect": false,
475
+ "defaultValue": "''"
476
+ },
477
+ "data": {
478
+ "type": "unknown",
479
+ "mutable": false,
480
+ "complexType": {
481
+ "original": "KupFormData",
482
+ "resolved": "KupFormData",
483
+ "references": {
484
+ "KupFormData": {
485
+ "location": "import",
486
+ "path": "./kup-form-declarations"
487
+ }
488
+ }
489
+ },
490
+ "required": false,
491
+ "optional": false,
492
+ "docs": {
493
+ "tags": [{
494
+ "name": "default",
495
+ "text": "null"
496
+ }],
497
+ "text": "Actual data of the form."
498
+ },
499
+ "defaultValue": "null"
500
+ },
501
+ "layout": {
502
+ "type": "unknown",
503
+ "mutable": false,
504
+ "complexType": {
505
+ "original": "KupFormLayout",
506
+ "resolved": "KupFormLayout",
507
+ "references": {
508
+ "KupFormLayout": {
509
+ "location": "import",
510
+ "path": "./kup-form-declarations"
511
+ }
512
+ }
513
+ },
514
+ "required": false,
515
+ "optional": false,
516
+ "docs": {
517
+ "tags": [{
518
+ "name": "default",
519
+ "text": "null"
520
+ }],
521
+ "text": "How the form will arrange its content."
522
+ },
523
+ "defaultValue": "null"
524
+ }
525
+ }; }
526
+ static get methods() { return {
527
+ "getProps": {
528
+ "complexType": {
529
+ "signature": "(descriptions?: boolean) => Promise<GenericObject>",
530
+ "parameters": [{
531
+ "tags": [{
532
+ "name": "param",
533
+ "text": "descriptions - When provided and true, the result will be the list of props with their description."
534
+ }],
535
+ "text": "- When provided and true, the result will be the list of props with their description."
536
+ }],
537
+ "references": {
538
+ "Promise": {
539
+ "location": "global"
540
+ },
541
+ "GenericObject": {
542
+ "location": "import",
543
+ "path": "../../types/GenericTypes"
544
+ }
545
+ },
546
+ "return": "Promise<GenericObject>"
547
+ },
548
+ "docs": {
549
+ "text": "Used to retrieve component's props values.",
550
+ "tags": [{
551
+ "name": "param",
552
+ "text": "descriptions - When provided and true, the result will be the list of props with their description."
553
+ }, {
554
+ "name": "returns",
555
+ "text": "List of props as object, each key will be a prop."
556
+ }]
557
+ }
558
+ },
559
+ "refresh": {
560
+ "complexType": {
561
+ "signature": "() => Promise<void>",
562
+ "parameters": [],
563
+ "references": {
564
+ "Promise": {
565
+ "location": "global"
566
+ }
567
+ },
568
+ "return": "Promise<void>"
569
+ },
570
+ "docs": {
571
+ "text": "This method is used to trigger a new render of the component.",
572
+ "tags": []
573
+ }
574
+ },
575
+ "setFocus": {
576
+ "complexType": {
577
+ "signature": "(column: string, rowId: string) => Promise<void>",
578
+ "parameters": [{
579
+ "tags": [{
580
+ "name": "param",
581
+ "text": "column - Name of the column."
582
+ }],
583
+ "text": "- Name of the column."
584
+ }, {
585
+ "tags": [{
586
+ "name": "param",
587
+ "text": "rowId - Id of the row."
588
+ }],
589
+ "text": "- Id of the row."
590
+ }],
591
+ "references": {
592
+ "Promise": {
593
+ "location": "global"
594
+ }
595
+ },
596
+ "return": "Promise<void>"
597
+ },
598
+ "docs": {
599
+ "text": "Sets the focus on an editable table cell.",
600
+ "tags": [{
601
+ "name": "param",
602
+ "text": "column - Name of the column."
603
+ }, {
604
+ "name": "param",
605
+ "text": "rowId - Id of the row."
606
+ }]
607
+ }
608
+ },
609
+ "setProps": {
610
+ "complexType": {
611
+ "signature": "(props: GenericObject) => Promise<void>",
612
+ "parameters": [{
613
+ "tags": [{
614
+ "name": "param",
615
+ "text": "props - Object containing props that will be set to the component."
616
+ }],
617
+ "text": "- Object containing props that will be set to the component."
618
+ }],
619
+ "references": {
620
+ "Promise": {
621
+ "location": "global"
622
+ },
623
+ "GenericObject": {
624
+ "location": "import",
625
+ "path": "../../types/GenericTypes"
626
+ }
627
+ },
628
+ "return": "Promise<void>"
629
+ },
630
+ "docs": {
631
+ "text": "Sets the props to the component.",
632
+ "tags": [{
633
+ "name": "param",
634
+ "text": "props - Object containing props that will be set to the component."
635
+ }]
636
+ }
637
+ }
638
+ }; }
639
+ static get elementRef() { return "rootElement"; }
640
+ static get watchers() { return [{
641
+ "propName": "data",
642
+ "methodName": "onDataChanged"
643
+ }, {
644
+ "propName": "layout",
645
+ "methodName": "onLayoutChanged"
646
+ }]; }
647
+ }
@@ -86,10 +86,7 @@ export class KupGrid {
86
86
  el = h("slot", { name: `${i}` });
87
87
  }
88
88
  else {
89
- let span = 1;
90
- if (slots[i]['span']) {
91
- span = slots[i]['span'];
92
- }
89
+ const span = slots[i]['span'] || slots[i].getAttribute('span') || 1;
93
90
  el = (h("div", { class: `layout-grid__cell layout-grid__cell--span-${span}` },
94
91
  h("slot", { name: `${i}` })));
95
92
  }
@@ -0,0 +1,9 @@
1
+ export class KupImageListState {
2
+ constructor() {
3
+ this.load = false;
4
+ }
5
+ toDebugString() {
6
+ // TODO
7
+ return 'image-list state';
8
+ }
9
+ }
@@ -70,14 +70,8 @@
70
70
  background-color: rgba(var(--kup_imagelist_primary_color_rgb), 0.15);
71
71
  color: var(--kup_imagelist_primary_color);
72
72
  }
73
- .navigation-bar__wrapper--active .navigation-bar__back,
74
- .navigation-bar__wrapper--active .navigation-bar__top {
75
- display: block;
76
- }
77
73
  .navigation-bar__back, .navigation-bar__top {
78
74
  --kup-button-primary-color-rgb: 0;
79
- animation: fade-in 0.375s ease-in;
80
- display: none;
81
75
  }
82
76
  .navigation-bar__title {
83
77
  border-radius: 16px;