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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/cjs/{cell-utils-d96b2993.js → cell-utils-d894e802.js} +2 -2
  3. package/dist/cjs/{component-d1496215.js → component-72a5b626.js} +30 -0
  4. package/dist/cjs/{f-button-2b9b99b1.js → f-button-414b3bc3.js} +4 -4
  5. package/dist/cjs/f-cell-c8983ec7.js +418 -0
  6. package/dist/cjs/f-checkbox-57443ca3.js +29 -0
  7. package/dist/cjs/{f-chip-df59e1b0.js → f-chip-ef81bf51.js} +5 -4
  8. package/dist/cjs/{f-image-12bab3b5.js → f-image-0618c795.js} +2 -2
  9. package/dist/cjs/f-paginator-utils-c9dd5173.js +1898 -0
  10. package/dist/cjs/{f-text-field-e7c35b5b.js → f-text-field-7d31190f.js} +3 -3
  11. package/dist/cjs/{f-text-field-mdc-a67f5dfe.js → f-text-field-mdc-85997738.js} +23 -305
  12. package/dist/cjs/{index-eb556444.js → index-06b131ea.js} +6 -4
  13. package/dist/cjs/ketchup.cjs.js +3 -3
  14. package/dist/cjs/kup-accordion.cjs.entry.js +5 -5
  15. package/dist/cjs/{kup-autocomplete_27.cjs.entry.js → kup-autocomplete_25.cjs.entry.js} +1833 -5745
  16. package/dist/cjs/{kup-echart.cjs.entry.js → kup-box_2.cjs.entry.js} +17113 -14788
  17. package/dist/cjs/kup-calendar.cjs.entry.js +42 -34
  18. package/dist/cjs/kup-cell.cjs.entry.js +10 -9
  19. package/dist/cjs/kup-dash-list.cjs.entry.js +4 -4
  20. package/dist/cjs/kup-dash_2.cjs.entry.js +4 -7
  21. package/dist/cjs/kup-dashboard.cjs.entry.js +379 -0
  22. package/dist/cjs/kup-drawer.cjs.entry.js +12 -5
  23. package/dist/cjs/kup-field.cjs.entry.js +2 -2
  24. package/dist/cjs/kup-form.cjs.entry.js +469 -0
  25. package/dist/cjs/kup-iframe.cjs.entry.js +3 -3
  26. package/dist/cjs/kup-image-list.cjs.entry.js +229 -0
  27. package/dist/cjs/kup-lazy.cjs.entry.js +3 -3
  28. package/dist/cjs/kup-magic-box.cjs.entry.js +4 -4
  29. package/dist/cjs/kup-manager-2fee8cf3.js +17021 -0
  30. package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
  31. package/dist/cjs/kup-numeric-picker.cjs.entry.js +5 -5
  32. package/dist/cjs/kup-photo-frame.cjs.entry.js +7 -9
  33. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  34. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  35. package/dist/cjs/kup-snackbar.cjs.entry.js +6 -6
  36. package/dist/cjs/loader.cjs.js +3 -3
  37. package/dist/cjs/{utils-e99921c1.js → utils-8470184d.js} +1 -1
  38. package/dist/collection/assets/card.js +4 -5
  39. package/dist/collection/assets/dashboard.js +113 -0
  40. package/dist/collection/assets/data-table.js +15 -79
  41. package/dist/collection/assets/form.js +179 -0
  42. package/dist/collection/assets/grid.js +17 -0
  43. package/dist/collection/assets/image-list.js +624 -0
  44. package/dist/collection/assets/index.js +16 -4
  45. package/dist/collection/assets/kupdata.js +0 -3
  46. package/dist/collection/assets/kuptooltip.js +53 -7
  47. package/dist/collection/assets/tree.js +0 -128
  48. package/dist/collection/collection-manifest.json +8 -6
  49. package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +136 -130
  50. package/dist/collection/components/kup-box/kup-box-declarations.js +0 -4
  51. package/dist/collection/components/kup-box/kup-box.js +20 -137
  52. package/dist/collection/components/kup-card/built-in/kup-card-clock.js +1 -1
  53. package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +1 -2
  54. package/dist/collection/components/kup-card/kup-card.css +26 -8
  55. package/dist/collection/components/kup-card/kup-card.js +1 -2
  56. package/dist/collection/components/kup-card/standard/kup-card-standard.js +14 -6
  57. package/dist/collection/components/kup-combobox/kup-combobox.js +17 -14
  58. package/dist/collection/components/kup-dashboard/kup-dashboard-declarations.js +10 -0
  59. package/dist/collection/components/kup-dashboard/kup-dashboard.css +81 -0
  60. package/dist/collection/components/kup-dashboard/kup-dashboard.js +560 -0
  61. package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +1 -3
  62. package/dist/collection/components/kup-data-table/kup-data-table.js +19 -136
  63. package/dist/collection/components/kup-drawer/kup-drawer.css +6 -8
  64. package/dist/collection/components/kup-drawer/kup-drawer.js +8 -1
  65. package/dist/collection/components/kup-form/kup-form-declarations.js +19 -0
  66. package/dist/collection/components/kup-form/kup-form.css +86 -0
  67. package/dist/collection/components/kup-form/kup-form.js +668 -0
  68. package/dist/collection/components/kup-grid/kup-grid.js +1 -4
  69. package/dist/collection/components/kup-image-list/kup-image-list-declarations.js +10 -0
  70. package/dist/collection/components/kup-image-list/kup-image-list.css +166 -0
  71. package/dist/collection/components/kup-image-list/kup-image-list.js +432 -0
  72. package/dist/collection/components/kup-list/kup-list-helper.js +9 -3
  73. package/dist/collection/components/kup-photo-frame/kup-photo-frame.css +2 -9
  74. package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +3 -5
  75. package/dist/collection/components/kup-snackbar/kup-snackbar.css +4 -0
  76. package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +18 -19
  77. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +3 -0
  78. package/dist/collection/components/kup-text-field/kup-text-field.js +27 -0
  79. package/dist/collection/components/kup-time-picker/kup-time-picker.js +2 -8
  80. package/dist/collection/components/kup-tree/kup-tree-declarations.js +0 -4
  81. package/dist/collection/components/kup-tree/kup-tree.css +10 -3
  82. package/dist/collection/components/kup-tree/kup-tree.js +73 -142
  83. package/dist/collection/f-components/f-button/f-button.js +2 -2
  84. package/dist/collection/f-components/f-cell/f-cell-declarations.js +5 -1
  85. package/dist/collection/f-components/f-cell/f-cell.js +41 -121
  86. package/dist/collection/f-components/f-chip/f-chip.js +2 -1
  87. package/dist/collection/f-components/f-text-field/f-text-field.js +1 -1
  88. package/dist/collection/managers/kup-data/kup-data-node-helper.js +24 -0
  89. package/dist/collection/managers/kup-data/kup-data.js +98 -1
  90. package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js +4 -2
  91. package/dist/collection/managers/kup-interact/kup-interact.js +1 -22
  92. package/dist/collection/managers/kup-language/kup-language-declarations.js +13 -0
  93. package/dist/collection/managers/kup-manager/kup-manager.js +21 -2
  94. package/dist/collection/managers/kup-objects/kup-objects.js +10 -0
  95. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +21 -1
  96. package/dist/collection/managers/kup-tooltip/kup-tooltip.js +53 -20
  97. package/dist/collection/types/GenericTypes.js +3 -0
  98. package/dist/collection/utils/kup-column-menu/kup-column-menu.js +7 -11
  99. package/dist/esm/{cell-utils-f4bdbbc8.js → cell-utils-7fc84d4e.js} +3 -3
  100. package/dist/esm/{component-c4eb6153.js → component-b1bedf1d.js} +27 -2
  101. package/dist/esm/{f-button-54a49fd8.js → f-button-2f6cc296.js} +4 -4
  102. package/dist/esm/f-cell-4428481c.js +415 -0
  103. package/dist/esm/f-checkbox-c51c4a75.js +27 -0
  104. package/dist/esm/{f-chip-a3035b4b.js → f-chip-b39eb49a.js} +6 -5
  105. package/dist/esm/{f-image-d32465e3.js → f-image-b08ebeb2.js} +2 -2
  106. package/dist/esm/f-paginator-utils-4fda6086.js +1884 -0
  107. package/dist/esm/{f-text-field-c25cc63f.js → f-text-field-184a5fb3.js} +3 -3
  108. package/dist/esm/{f-text-field-mdc-9fbbefc3.js → f-text-field-mdc-d42d3f9e.js} +2 -284
  109. package/dist/esm/{index-baeab1ac.js → index-ad6ab214.js} +6 -4
  110. package/dist/esm/ketchup.js +3 -3
  111. package/dist/esm/kup-accordion.entry.js +6 -6
  112. package/dist/esm/{kup-autocomplete_27.entry.js → kup-autocomplete_25.entry.js} +1775 -5685
  113. package/dist/esm/{kup-echart.entry.js → kup-box_2.entry.js} +17113 -14789
  114. package/dist/esm/kup-calendar.entry.js +43 -35
  115. package/dist/esm/kup-cell.entry.js +9 -8
  116. package/dist/esm/kup-dash-list.entry.js +4 -4
  117. package/dist/esm/kup-dash_2.entry.js +4 -7
  118. package/dist/esm/kup-dashboard.entry.js +375 -0
  119. package/dist/esm/kup-drawer.entry.js +12 -5
  120. package/dist/esm/kup-field.entry.js +2 -2
  121. package/dist/esm/kup-form.entry.js +465 -0
  122. package/dist/esm/kup-iframe.entry.js +3 -3
  123. package/dist/esm/kup-image-list.entry.js +225 -0
  124. package/dist/esm/kup-lazy.entry.js +3 -3
  125. package/dist/esm/kup-magic-box.entry.js +4 -4
  126. package/dist/esm/kup-manager-3325b2d8.js +17000 -0
  127. package/dist/esm/kup-nav-bar.entry.js +3 -3
  128. package/dist/esm/kup-numeric-picker.entry.js +6 -6
  129. package/dist/esm/kup-photo-frame.entry.js +7 -9
  130. package/dist/esm/kup-probe.entry.js +2 -2
  131. package/dist/esm/kup-qlik.entry.js +2 -2
  132. package/dist/esm/kup-snackbar.entry.js +6 -6
  133. package/dist/esm/loader.js +3 -3
  134. package/dist/esm/polyfills/css-shim.js +1 -1
  135. package/dist/esm/{tslib.es6-8f2d44b6.js → tslib.es6-3eea2234.js} +1 -1
  136. package/dist/esm/{utils-f24319a0.js → utils-6373a07e.js} +2 -2
  137. package/dist/ketchup/ketchup.esm.js +1 -1
  138. package/dist/ketchup/p-006bc4d0.entry.js +1 -0
  139. package/dist/ketchup/p-0741da57.js +1 -0
  140. package/dist/ketchup/{p-669bde31.js → p-13e08580.js} +1 -1
  141. package/dist/ketchup/p-153697fb.entry.js +1 -0
  142. package/dist/ketchup/{p-9a61d8dc.entry.js → p-175edb62.entry.js} +1 -1
  143. package/dist/ketchup/{p-11e72a8c.entry.js → p-1db1d42b.entry.js} +1 -1
  144. package/dist/ketchup/{p-67842f1e.entry.js → p-30820f8f.entry.js} +1 -1
  145. package/dist/ketchup/p-35325834.entry.js +9 -0
  146. package/dist/ketchup/p-359e8bec.entry.js +40 -0
  147. package/dist/ketchup/{p-09d708c4.entry.js → p-3c7c92c0.entry.js} +1 -1
  148. package/dist/ketchup/p-41cf8703.entry.js +1 -0
  149. package/dist/ketchup/{p-e6709c26.entry.js → p-6127fccf.entry.js} +1 -1
  150. package/dist/ketchup/{p-203d6295.entry.js → p-6b82e4e2.entry.js} +1 -1
  151. package/dist/ketchup/p-704e60eb.js +30 -0
  152. package/dist/ketchup/{p-4f56932b.js → p-70660fe2.js} +1 -1
  153. package/dist/ketchup/{p-44192f30.entry.js → p-762c0382.entry.js} +1 -1
  154. package/dist/ketchup/{p-c58a2a81.entry.js → p-76947316.entry.js} +1 -1
  155. package/dist/ketchup/{p-a0b1d769.js → p-79b0730b.js} +1 -1
  156. package/dist/ketchup/{p-bb8844bf.entry.js → p-8103b80a.entry.js} +1 -1
  157. package/dist/ketchup/{p-8c44c3b9.js → p-81605f08.js} +4 -5
  158. package/dist/ketchup/p-9fa457d4.entry.js +1 -0
  159. package/dist/ketchup/{p-e8e3c9da.entry.js → p-a0ce8075.entry.js} +1 -1
  160. package/dist/ketchup/p-a203f78b.js +45 -0
  161. package/dist/ketchup/p-a804fe83.entry.js +27 -0
  162. package/dist/ketchup/{p-34748c91.js → p-ca9fd099.js} +1 -1
  163. package/dist/ketchup/p-caabb9ab.entry.js +1 -0
  164. package/dist/ketchup/p-cc3abf84.entry.js +1 -0
  165. package/dist/ketchup/p-cd5cfa7c.js +1 -0
  166. package/dist/ketchup/p-d2e76960.entry.js +1 -0
  167. package/dist/ketchup/p-d3b542b3.js +2 -0
  168. package/dist/ketchup/p-d7004ae4.js +1 -0
  169. package/dist/ketchup/{p-40f97429.js → p-d95c904b.js} +1 -1
  170. package/dist/ketchup/p-ddce3430.js +1 -0
  171. package/dist/ketchup/p-ee580b3a.entry.js +1 -0
  172. package/dist/ketchup/p-f49cb68e.js +1 -0
  173. package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +1 -16
  174. package/dist/types/components/kup-box/kup-box-declarations.d.ts +3 -5
  175. package/dist/types/components/kup-box/kup-box.d.ts +0 -22
  176. package/dist/types/components/kup-dashboard/kup-dashboard-declarations.d.ts +61 -0
  177. package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +75 -0
  178. package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +2 -4
  179. package/dist/types/components/kup-data-table/kup-data-table.d.ts +1 -19
  180. package/dist/types/components/kup-form/kup-form-declarations.d.ts +48 -0
  181. package/dist/types/components/kup-form/kup-form.d.ts +68 -0
  182. package/dist/types/components/kup-image-list/kup-image-list-declarations.d.ts +14 -0
  183. package/dist/types/components/kup-image-list/kup-image-list.d.ts +56 -0
  184. package/dist/types/components/kup-tab-bar/kup-tab-bar-declarations.d.ts +3 -9
  185. package/dist/types/components/kup-tab-bar/kup-tab-bar.d.ts +6 -6
  186. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +3 -0
  187. package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
  188. package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +0 -6
  189. package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +3 -5
  190. package/dist/types/components/kup-tree/kup-tree.d.ts +1 -24
  191. package/dist/types/components.d.ts +512 -369
  192. package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +4 -1
  193. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
  194. package/dist/types/managers/kup-data/kup-data-declarations.d.ts +1 -0
  195. package/dist/types/managers/kup-data/kup-data-node-helper.d.ts +7 -0
  196. package/dist/types/managers/kup-data/kup-data.d.ts +3 -0
  197. package/dist/types/managers/kup-language/kup-language-declarations.d.ts +13 -1
  198. package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +4 -0
  199. package/dist/types/managers/kup-manager/kup-manager.d.ts +12 -0
  200. package/dist/types/managers/kup-objects/kup-objects.d.ts +6 -0
  201. package/dist/types/managers/kup-tooltip/kup-tooltip-declarations.d.ts +3 -3
  202. package/dist/types/managers/kup-tooltip/kup-tooltip.d.ts +17 -6
  203. package/dist/types/types/GenericTypes.d.ts +3 -0
  204. package/dist/types/utils/kup-column-menu/kup-column-menu.d.ts +1 -3
  205. package/package.json +15 -14
  206. package/dist/cjs/f-cell-8351cb84.js +0 -653
  207. package/dist/cjs/kup-manager-5c03da64.js +0 -8795
  208. package/dist/collection/assets/tooltip.js +0 -73
  209. package/dist/collection/components/kup-tooltip/kup-tooltip-declarations.js +0 -20
  210. package/dist/collection/components/kup-tooltip/kup-tooltip.css +0 -149
  211. package/dist/collection/components/kup-tooltip/kup-tooltip.js +0 -1205
  212. package/dist/collection/utils/helpers.js +0 -38
  213. package/dist/esm/f-cell-d5dac50b.js +0 -650
  214. package/dist/esm/kup-manager-9316a184.js +0 -8778
  215. package/dist/ketchup/p-12773ca8.js +0 -9
  216. package/dist/ketchup/p-34b74425.js +0 -1
  217. package/dist/ketchup/p-4173422f.entry.js +0 -1
  218. package/dist/ketchup/p-41741c28.entry.js +0 -1
  219. package/dist/ketchup/p-44f8da2a.js +0 -1
  220. package/dist/ketchup/p-7a74ad17.js +0 -1
  221. package/dist/ketchup/p-7ba8fa4a.entry.js +0 -39
  222. package/dist/ketchup/p-7de0d7e1.js +0 -1
  223. package/dist/ketchup/p-8418e8fa.entry.js +0 -1
  224. package/dist/ketchup/p-96bf19aa.entry.js +0 -1
  225. package/dist/ketchup/p-b0ddcce9.entry.js +0 -9
  226. package/dist/ketchup/p-b6c21223.entry.js +0 -27
  227. package/dist/ketchup/p-ca3d585b.entry.js +0 -1
  228. package/dist/ketchup/p-ecb7069b.js +0 -135
  229. package/dist/types/components/kup-tooltip/kup-tooltip-declarations.d.ts +0 -93
  230. package/dist/types/components/kup-tooltip/kup-tooltip.d.ts +0 -142
  231. package/dist/types/utils/helpers.d.ts +0 -4
@@ -0,0 +1,375 @@
1
+ import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-ad6ab214.js';
2
+ import { F as FButton } from './f-button-2f6cc296.js';
3
+ import { F as FCheckbox } from './f-checkbox-c51c4a75.js';
4
+ import { F as FTextField } from './f-text-field-184a5fb3.js';
5
+ import { F as FTextFieldMDC } from './f-text-field-mdc-d42d3f9e.js';
6
+ import { k as kupManagerInstance, a6 as KupLanguageDashboard, h as KupLanguageGeneric, B as KupDragEffect, c as KupDebugCategory } from './kup-manager-3325b2d8.js';
7
+ import { g as getProps, s as setProps } from './utils-6373a07e.js';
8
+ import { c as componentWrapperId } from './GenericVariables-665de00a.js';
9
+ import './f-button-declarations-b1b4cac4.js';
10
+ import './f-image-b08ebeb2.js';
11
+ import './tslib.es6-3eea2234.js';
12
+ import './component-b1bedf1d.js';
13
+
14
+ /**
15
+ * Props of the kup-dashboard component.
16
+ * Used to export every prop in an object.
17
+ */
18
+ var KupDashboardProps;
19
+ (function (KupDashboardProps) {
20
+ KupDashboardProps["customStyle"] = "Custom style of the component.";
21
+ KupDashboardProps["data"] = "The data of the component.";
22
+ KupDashboardProps["enableDesign"] = "When set to true, the component is in design mode and it is draggable.";
23
+ })(KupDashboardProps || (KupDashboardProps = {}));
24
+
25
+ const kupDashboardCss = ":host{width:100%;height:100%}#kup-component{height:100%}.header{display:flex;flex-direction:row;justify-content:center}.header>*{margin-left:0.5em}.form{display:grid;height:100%}.form-dropzone{padding:1em;grid-gap:0.5em;border:1px solid var(--kup-primary-color)}.section{display:flex;flex-direction:column;overflow:auto}.section-header{display:flex;flex-direction:column}.section-header>*{width:100%;display:flex;flex-direction:row}.section-header>*>.section-header-actions{display:flex;justify-content:end}.section-header>*>.section-header-actions>*{margin-top:auto;margin-bottom:auto}.section-body{display:grid}.section-dropzone{border:1px solid var(--kup-primary-color)}.section-draggable{border:1px solid var(--kup-secondary-color);padding:1em}.component{height:fit-content;padding:1em;margin:0.5em}.layout-row{grid-auto-flow:column;grid-template-columns:min-content}.layout-column{grid-auto-flow:row;grid-template-rows:min-content}";
26
+
27
+ const KupDashboard = class {
28
+ constructor(hostRef) {
29
+ registerInstance(this, hostRef);
30
+ this.kupSave = createEvent(this, "kup-dashboard-save", 6);
31
+ /*-------------------------------------------------*/
32
+ /* S t a t e s */
33
+ /*-------------------------------------------------*/
34
+ /**
35
+ * Force render component by internal event.
36
+ */
37
+ this.resetInternalData = false;
38
+ /*-------------------------------------------------*/
39
+ /* P r o p s */
40
+ /*-------------------------------------------------*/
41
+ /**
42
+ * Custom style of the component.
43
+ * @default ""
44
+ * @see https://ketchup.smeup.com/ketchup-showcase/#/customization
45
+ */
46
+ this.customStyle = '';
47
+ /**
48
+ * The data of the component.
49
+ * @default null
50
+ */
51
+ this.data = null;
52
+ /**
53
+ * Enable drag & drop of the section.
54
+ * @default false
55
+ */
56
+ this.enableDesign = false;
57
+ /*-------------------------------------------------*/
58
+ /* I n t e r n a l V a r i a b l e s */
59
+ /*-------------------------------------------------*/
60
+ /**
61
+ * Instance of the KupManager class.
62
+ */
63
+ this.kupManager = kupManagerInstance();
64
+ /**
65
+ * Internal data of the component.
66
+ */
67
+ this.internalData = null;
68
+ /**
69
+ * Internal data backup of the component for refresh when changed content by drag&drop.
70
+ */
71
+ this.internalDataBackup = null;
72
+ }
73
+ onKupSave() {
74
+ this.kupSave.emit({
75
+ comp: this,
76
+ id: this.rootElement.id,
77
+ data: this.internalData,
78
+ });
79
+ }
80
+ /*-------------------------------------------------*/
81
+ /* W a t c h e r s */
82
+ /*-------------------------------------------------*/
83
+ dataChanged() {
84
+ this.resetData();
85
+ }
86
+ /*-------------------------------------------------*/
87
+ /* P u b l i c M e t h o d s */
88
+ /*-------------------------------------------------*/
89
+ /**
90
+ * Used to retrieve component's props values.
91
+ * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
92
+ * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
93
+ */
94
+ async getProps(descriptions) {
95
+ return getProps(this, KupDashboardProps, descriptions);
96
+ }
97
+ /**
98
+ * This method is used to trigger a new render of the component.
99
+ */
100
+ async refresh() {
101
+ forceUpdate(this);
102
+ }
103
+ /**
104
+ * Sets the props to the component.
105
+ * @param {GenericObject} props - Object containing props that will be set to the component.
106
+ */
107
+ async setProps(props) {
108
+ setProps(this, KupDashboardProps, props);
109
+ }
110
+ /*-------------------------------------------------*/
111
+ /* P r i v a t e M e t h o d s */
112
+ /*-------------------------------------------------*/
113
+ buildGuid() {
114
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
115
+ var r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3) | 0x8;
116
+ return v.toString(16);
117
+ });
118
+ }
119
+ buildHeader() {
120
+ const clearButtonProp = {
121
+ icon: 'cancel',
122
+ label: this.kupManager.language.translate(KupLanguageDashboard.RESET),
123
+ secondary: true,
124
+ onClick: () => {
125
+ this.resetData();
126
+ },
127
+ };
128
+ const saveButtonProp = {
129
+ icon: 'save',
130
+ label: this.kupManager.language.translate(KupLanguageDashboard.SAVE),
131
+ onClick: () => this.onKupSave(),
132
+ };
133
+ return (h("div", { class: "header" }, this.enableDesign ? (h(FButton, Object.assign({}, clearButtonProp))) : undefined, this.enableDesign ? (h(FButton, Object.assign({}, saveButtonProp))) : undefined));
134
+ }
135
+ buildForm(form, parent) {
136
+ const classes = {
137
+ form: true,
138
+ 'layout-column': form && form.layout == 'column',
139
+ 'layout-row': form && form.layout == 'row',
140
+ 'form-dropzone': this.enableDesign &&
141
+ form &&
142
+ form.sections != null &&
143
+ form.sections.length > 0,
144
+ };
145
+ return form ? (h("div", { class: classes, style: this.getGridStyle(form), ref: (el) => {
146
+ if (!el)
147
+ return;
148
+ const kel = el;
149
+ kel.kupData = { parent: parent, form: form };
150
+ } }, form.sections.map((section) => this.buildSection(section, form)))) : (h("div", null, this.kupManager.language.translate(KupLanguageGeneric.EMPTY_DATA)));
151
+ }
152
+ buildSectionHeader(section, parent) {
153
+ const dimTextFieldProp = {
154
+ value: section.dim,
155
+ label: this.kupManager.language.translate(KupLanguageDashboard.DIMENSION),
156
+ onChange: (e) => {
157
+ const { target } = e;
158
+ section.dim = target.value;
159
+ },
160
+ };
161
+ const addButtonProp = {
162
+ icon: 'add',
163
+ slim: true,
164
+ onClick: () => {
165
+ if (!section.sections) {
166
+ section.sections = [];
167
+ }
168
+ const newSec = {
169
+ id: section.id + (section.sections.length + 1),
170
+ loaded: section.loaded,
171
+ layout: section.layout,
172
+ };
173
+ section.sections.push(newSec);
174
+ this.resetData(this.internalData);
175
+ },
176
+ };
177
+ const removeButtonProp = {
178
+ icon: 'remove',
179
+ slim: true,
180
+ secondary: true,
181
+ onClick: () => {
182
+ const idx = parent.sections.indexOf(section);
183
+ parent.sections.splice(idx, 1);
184
+ this.resetData(this.internalData);
185
+ },
186
+ };
187
+ const loadedCheckBoxProp = {
188
+ checked: section.loaded,
189
+ label: this.kupManager.language.translate(KupLanguageDashboard.LOADED),
190
+ onChange: () => {
191
+ section.loaded = !section.loaded;
192
+ this.refresh();
193
+ },
194
+ };
195
+ const columnCheckBoxProp = {
196
+ checked: section.layout == 'column',
197
+ label: this.kupManager.language.translate(KupLanguageDashboard.VERTICAL),
198
+ onChange: () => {
199
+ section.layout = section.layout == 'column' ? 'row' : 'column';
200
+ this.refresh();
201
+ },
202
+ };
203
+ return (h("div", { class: "section-header" }, h("div", null, section.id, " - ", section.layout), h("div", null, h("div", { class: "section-header-actions" }, h(FTextField, Object.assign({}, dimTextFieldProp)), h(FCheckbox, Object.assign({}, loadedCheckBoxProp)), h(FCheckbox, Object.assign({}, columnCheckBoxProp)), h(FButton, Object.assign({}, addButtonProp)), h(FButton, Object.assign({}, removeButtonProp))))));
204
+ }
205
+ buildSection(section, parent) {
206
+ const classes = {
207
+ section: true,
208
+ 'section-draggable': this.enableDesign,
209
+ 'section-dropzone': this.enableDesign,
210
+ };
211
+ const bodyClasses = {
212
+ 'section-body': true,
213
+ 'layout-column': section && section.layout == 'column',
214
+ 'layout-row': section && section.layout == 'row',
215
+ };
216
+ return (h("div", { class: classes, ref: (el) => {
217
+ if (!el)
218
+ return;
219
+ const kel = el;
220
+ kel.kupData = { parent: parent, section: section };
221
+ } }, this.enableDesign
222
+ ? this.buildSectionHeader(section, parent)
223
+ : undefined, h("div", { class: bodyClasses, style: this.getGridStyle(section) }, !this.enableDesign &&
224
+ section.loaded &&
225
+ (!section.sections || section.sections.length == 0) ? (h("slot", { name: section.id })) : undefined, section.sections && (section.loaded || this.enableDesign)
226
+ ? section.sections.map((childSection) => this.buildSection(childSection, section))
227
+ : undefined)));
228
+ }
229
+ didRenderInteractables() {
230
+ try {
231
+ const items = [];
232
+ this.rootElement.shadowRoot
233
+ .querySelectorAll('.section-draggable')
234
+ .forEach((x) => items.push(x));
235
+ items.forEach((item) => {
236
+ this.kupManager.interact.draggable(item, null, null, KupDragEffect.CLONE);
237
+ });
238
+ }
239
+ catch (error) {
240
+ this.kupManager.debug.logMessage(this, error, KupDebugCategory.ERROR);
241
+ }
242
+ try {
243
+ const items = [];
244
+ this.rootElement.shadowRoot
245
+ .querySelectorAll('.section-dropzone')
246
+ .forEach((x) => items.push(x));
247
+ this.rootElement.shadowRoot
248
+ .querySelectorAll('.form-dropzone')
249
+ .forEach((x) => items.push(x));
250
+ items.forEach((item) => {
251
+ this.kupManager.interact.dropzone(item, null, null, {
252
+ drop: (ev) => {
253
+ this.dropped(ev.currentTarget, ev.relatedTarget);
254
+ },
255
+ });
256
+ });
257
+ }
258
+ catch (error) {
259
+ this.kupManager.debug.logMessage(this, error, KupDebugCategory.ERROR);
260
+ }
261
+ }
262
+ dropped(parent, child) {
263
+ const idx = child.kupData.parent.sections.indexOf(child.kupData.section);
264
+ child.kupData.parent.sections.splice(idx, 1);
265
+ if (parent.kupData.form) {
266
+ // form is the target of drop.
267
+ if (!parent.kupData.form.sections)
268
+ parent.kupData.form.sections = [];
269
+ parent.kupData.form.sections.push(child.kupData.section);
270
+ child.kupData.parent = parent.kupData.form;
271
+ }
272
+ else if (parent.kupData.section) {
273
+ // section is the target of drop.
274
+ if (!parent.kupData.section.sections ||
275
+ parent.kupData.section.sections.length == 0) {
276
+ // if the section target of drop doesn't contains other sections, i create a wrapper that will contain target section and dragged section.
277
+ const newSec = JSON.parse(JSON.stringify(parent.kupData.section));
278
+ newSec.dim = null;
279
+ child.kupData.section.dim = null;
280
+ parent.kupData.section.id = this.buildGuid();
281
+ parent.kupData.section.sections = [];
282
+ parent.kupData.section.sections.push(newSec);
283
+ }
284
+ parent.kupData.section.sections.push(child.kupData.section);
285
+ child.kupData.parent = parent.kupData.section;
286
+ }
287
+ this.resetData(this.internalData);
288
+ }
289
+ getGridStyle(entity) {
290
+ let bodyStyles = {};
291
+ if (!this.enableDesign && entity.sections) {
292
+ let gridTemplate = '';
293
+ entity.sections.forEach((childSection) => {
294
+ if (!childSection.dim)
295
+ gridTemplate += ' 1fr';
296
+ else
297
+ gridTemplate +=
298
+ childSection.dim.indexOf('%') < 0
299
+ ? ' ' + childSection.dim + 'px'
300
+ : ' ' + childSection.dim;
301
+ });
302
+ if (entity.layout == 'column')
303
+ bodyStyles['gridTemplateRows'] = gridTemplate;
304
+ if (entity.layout == 'row')
305
+ bodyStyles['gridTemplateColumns'] = gridTemplate;
306
+ }
307
+ return bodyStyles;
308
+ }
309
+ resetData(form = null) {
310
+ if (form)
311
+ this.internalDataBackup = form;
312
+ this.resetInternalData = true;
313
+ setTimeout(() => {
314
+ if (this.internalDataBackup) {
315
+ this.internalData = this.internalDataBackup;
316
+ this.internalDataBackup = null;
317
+ }
318
+ this.resetInternalData = false;
319
+ }, 250);
320
+ }
321
+ unregisterInteractables() {
322
+ this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.section-dropzone')));
323
+ this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.section-draggable')));
324
+ this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.form-dropzone')));
325
+ }
326
+ /*-------------------------------------------------*/
327
+ /* L i f e c y c l e H o o k s */
328
+ /*-------------------------------------------------*/
329
+ componentWillLoad() {
330
+ this.kupManager.dates.register(this);
331
+ this.kupManager.debug.logLoad(this, false);
332
+ this.kupManager.language.register(this);
333
+ this.kupManager.theme.register(this);
334
+ }
335
+ componentDidLoad() {
336
+ this.kupManager.debug.logLoad(this, true);
337
+ }
338
+ componentWillRender() {
339
+ this.kupManager.debug.logRender(this, false);
340
+ if (this.resetInternalData) {
341
+ this.internalData = null;
342
+ this.unregisterInteractables();
343
+ }
344
+ else if (!this.internalData)
345
+ this.internalData = JSON.parse(JSON.stringify(this.data));
346
+ }
347
+ componentDidRender() {
348
+ this.kupManager.debug.logRender(this, true);
349
+ const root = this.rootElement.shadowRoot;
350
+ if (root) {
351
+ const fields = root.querySelectorAll('.f-text-field');
352
+ if (fields)
353
+ fields.forEach((f) => {
354
+ FTextFieldMDC(f);
355
+ });
356
+ }
357
+ this.didRenderInteractables();
358
+ }
359
+ render() {
360
+ return (h(Host, null, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, this.buildHeader(), this.buildForm(this.internalData, null))));
361
+ }
362
+ disconnectedCallback() {
363
+ this.unregisterInteractables();
364
+ this.kupManager.dates.unregister(this);
365
+ this.kupManager.language.unregister(this);
366
+ this.kupManager.theme.unregister(this);
367
+ }
368
+ get rootElement() { return getElement(this); }
369
+ static get watchers() { return {
370
+ "data": ["dataChanged"]
371
+ }; }
372
+ };
373
+ KupDashboard.style = kupDashboardCss;
374
+
375
+ export { KupDashboard as kup_dashboard };
@@ -1,6 +1,6 @@
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-9316a184.js';
3
- import { g as getProps, s as setProps } from './utils-f24319a0.js';
1
+ import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-ad6ab214.js';
2
+ import { k as kupManagerInstance } from './kup-manager-3325b2d8.js';
3
+ import { g as getProps, s as setProps } from './utils-6373a07e.js';
4
4
  import { c as componentWrapperId } from './GenericVariables-665de00a.js';
5
5
 
6
6
  const drawerClass = 'drawer';
@@ -14,7 +14,7 @@ var KupDrawerProps;
14
14
  KupDrawerProps["opened"] = "Defaults at false. When set to true, the drawer appears.";
15
15
  })(KupDrawerProps || (KupDrawerProps = {}));
16
16
 
17
- const kupDrawerCss = ":host{--kup_drawer_backdrop:var(--kup-drawer-backdrop, rgba(0, 0, 0, 0.32));--kup_drawer_box_shadow:var(\n --kup-drawer-box-shadow,\n 0 8px 10px -5px rgba(0, 0, 0, 0.2),\n 0 16px 24px 2px rgba(0, 0, 0, 0.14),\n 0 6px 30px 5px rgba(0, 0, 0, 0.12)\n );--kup_drawer_permanent_border:var(\n --kup-drawer-permanent-border,\n 1px solid var(--kup-border-color)\n );--kup_drawer_slide_transition:var(--kup-drawer-slide-transition, 750ms);--kup_drawer_transition:var(--kup-drawer-transition, 250ms);box-shadow:var(--kup_drawer_box_shadow);display:block;font-size:var(--kup-font-size);height:100vh;left:calc(var(--kup-drawer-width) * -1);position:fixed;top:0;transition:left var(--kup_drawer_slide_transition) cubic-bezier(0.4, 0, 0.2, 1), right var(--kup_drawer_slide_transition) cubic-bezier(0.4, 0, 0.2, 1);width:var(--kup-drawer-width);z-index:var(--kup-drawer-zindex)}#kup-component{height:100%;width:100%}.backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--kup_drawer_backdrop);opacity:0;pointer-events:none;transition:opacity var(--kup_drawer_transition) ease-in;z-index:var(--kup-drawer-zindex)}.drawer{height:100%;position:fixed;width:var(--kup-drawer-width);z-index:calc(var(--kup-drawer-zindex) + 1)}.drawer__content{background-color:var(--kup-drawer-background-color);box-sizing:border-box;height:100%;overflow-y:auto;width:100%}.drawer ::slotted(*){--kup-button-primary-color:var(--kup-drawer-color);--kup-button-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-button-primary-color-h:var(--kup-drawer-color-h);--kup-button-primary-color-s:var(--kup-drawer-color-s);--kup-button-primary-color-l:var(--kup-drawer-color-l);--kup-switch-label-color:var(--kup-drawer-color);--kup-switch-primary-color:var(--kup-drawer-color);--kup-switch-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-textfield-color:var(--kup-drawer-color);--kup-textfield-color-rgb:var(--kup-drawer-color-rgb);--kup-textfield-primary-color:var(--kup-drawer-color);--kup-textfield-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-tree-color:var(--kup-drawer-color);--kup-tree-color-rgb:var(--kup-drawer-color-rgb);--kup-tree-icon-color:var(--kup-drawer-color);color:var(--kup-drawer-color);fill:var(--kup-drawer-color)}:host([kup-opened]){left:0}:host([kup-opened]) .backdrop{opacity:1;pointer-events:all}:host(.kup-right){left:unset;right:-100%}:host([kup-opened].kup-right){right:0}:host(.kup-permanent){box-shadow:unset;transition:all 250ms}:host(.kup-permanent) .backdrop{display:none}:host(.kup-permanent) .drawer{position:relative}:host(.kup-permanent) .drawer__content{border-right:var(--kup_drawer_permanent_border)}";
17
+ const kupDrawerCss = ":host{--kup_drawer_backdrop:var(--kup-drawer-backdrop, rgba(0, 0, 0, 0.32));--kup_drawer_box_shadow:var(\n --kup-drawer-box-shadow,\n 0 8px 10px -5px rgba(0, 0, 0, 0.2),\n 0 16px 24px 2px rgba(0, 0, 0, 0.14),\n 0 6px 30px 5px rgba(0, 0, 0, 0.12)\n );--kup_drawer_permanent_border:var(\n --kup-drawer-permanent-border,\n 1px solid var(--kup-border-color)\n );--kup_drawer_slide_transition:var(--kup-drawer-slide-transition, 750ms);--kup_drawer_transition:var(--kup-drawer-transition, 250ms);box-shadow:var(--kup_drawer_box_shadow);display:block;font-size:var(--kup-font-size);height:100vh;left:calc(var(--kup-drawer-width) * -1);position:fixed;top:0;transition:left var(--kup_drawer_slide_transition) cubic-bezier(0.4, 0, 0.2, 1), right var(--kup_drawer_slide_transition) cubic-bezier(0.4, 0, 0.2, 1);width:var(--kup-drawer-width);z-index:var(--kup-drawer-zindex)}#kup-component{height:100%;width:100%}.backdrop{background:var(--kup_drawer_backdrop);display:none;height:100%;left:0;position:fixed;top:0;width:100%;z-index:var(--kup-drawer-zindex)}.drawer{height:100%;position:fixed;width:var(--kup-drawer-width);z-index:calc(var(--kup-drawer-zindex) + 1)}.drawer__content{background-color:var(--kup-drawer-background-color);box-sizing:border-box;height:100%;overflow-y:auto;width:100%}.drawer ::slotted(*){--kup-button-primary-color:var(--kup-drawer-color);--kup-button-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-button-primary-color-h:var(--kup-drawer-color-h);--kup-button-primary-color-s:var(--kup-drawer-color-s);--kup-button-primary-color-l:var(--kup-drawer-color-l);--kup-switch-label-color:var(--kup-drawer-color);--kup-switch-primary-color:var(--kup-drawer-color);--kup-switch-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-textfield-color:var(--kup-drawer-color);--kup-textfield-color-rgb:var(--kup-drawer-color-rgb);--kup-textfield-primary-color:var(--kup-drawer-color);--kup-textfield-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-tree-color:var(--kup-drawer-color);--kup-tree-color-rgb:var(--kup-drawer-color-rgb);--kup-tree-filter-background-color:var(--kup-drawer-background-color);--kup-tree-icon-color:var(--kup-drawer-color);color:var(--kup-drawer-color);fill:var(--kup-drawer-color)}:host([kup-opened]){left:0}:host([kup-opened]) .backdrop{display:block}:host(.kup-right){left:unset;right:-100%}:host([kup-opened].kup-right){right:0}:host(.kup-permanent){box-shadow:unset;transition:all 250ms}:host(.kup-permanent) .backdrop{display:none}:host(.kup-permanent) .drawer{position:relative}:host(.kup-permanent) .drawer__content{border-right:var(--kup_drawer_permanent_border)}";
18
18
 
19
19
  const KupDrawer = class {
20
20
  constructor(hostRef) {
@@ -140,9 +140,16 @@ const KupDrawer = class {
140
140
  this.kupManager.debug.logRender(this, true);
141
141
  }
142
142
  render() {
143
- return (h(Host, { "kup-opened": this.opened }, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { class: "backdrop", onPointerDown: (e) => {
143
+ return (h(Host, { "kup-opened": this.opened }, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { class: "backdrop", onClick: (e) => {
144
+ e.preventDefault();
145
+ e.stopPropagation();
146
+ }, onPointerDown: (e) => {
147
+ e.preventDefault();
144
148
  e.stopPropagation();
145
149
  this.close();
150
+ }, onTouchStart: (e) => {
151
+ e.preventDefault();
152
+ e.stopPropagation();
146
153
  } }), h("div", { id: componentWrapperId }, h("div", { class: drawerClass }, this.content()))));
147
154
  }
148
155
  disconnectedCallback() {
@@ -1,5 +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, j as KupDebugCategory } from './kup-manager-9316a184.js';
1
+ import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-ad6ab214.js';
2
+ import { k as kupManagerInstance, c as KupDebugCategory } from './kup-manager-3325b2d8.js';
3
3
  import { c as componentWrapperId } from './GenericVariables-665de00a.js';
4
4
 
5
5
  /**