@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,379 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-06b131ea.js');
6
+ const fButton = require('./f-button-414b3bc3.js');
7
+ const fCheckbox = require('./f-checkbox-57443ca3.js');
8
+ const fTextField = require('./f-text-field-7d31190f.js');
9
+ const fTextFieldMdc = require('./f-text-field-mdc-85997738.js');
10
+ const kupManager = require('./kup-manager-2fee8cf3.js');
11
+ const utils = require('./utils-8470184d.js');
12
+ const GenericVariables = require('./GenericVariables-a9ed17ee.js');
13
+ require('./f-button-declarations-b611587f.js');
14
+ require('./f-image-0618c795.js');
15
+ require('./tslib.es6-0ee02c67.js');
16
+ require('./component-72a5b626.js');
17
+
18
+ /**
19
+ * Props of the kup-dashboard component.
20
+ * Used to export every prop in an object.
21
+ */
22
+ var KupDashboardProps;
23
+ (function (KupDashboardProps) {
24
+ KupDashboardProps["customStyle"] = "Custom style of the component.";
25
+ KupDashboardProps["data"] = "The data of the component.";
26
+ KupDashboardProps["enableDesign"] = "When set to true, the component is in design mode and it is draggable.";
27
+ })(KupDashboardProps || (KupDashboardProps = {}));
28
+
29
+ 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}";
30
+
31
+ const KupDashboard = class {
32
+ constructor(hostRef) {
33
+ index.registerInstance(this, hostRef);
34
+ this.kupSave = index.createEvent(this, "kup-dashboard-save", 6);
35
+ /*-------------------------------------------------*/
36
+ /* S t a t e s */
37
+ /*-------------------------------------------------*/
38
+ /**
39
+ * Force render component by internal event.
40
+ */
41
+ this.resetInternalData = false;
42
+ /*-------------------------------------------------*/
43
+ /* P r o p s */
44
+ /*-------------------------------------------------*/
45
+ /**
46
+ * Custom style of the component.
47
+ * @default ""
48
+ * @see https://ketchup.smeup.com/ketchup-showcase/#/customization
49
+ */
50
+ this.customStyle = '';
51
+ /**
52
+ * The data of the component.
53
+ * @default null
54
+ */
55
+ this.data = null;
56
+ /**
57
+ * Enable drag & drop of the section.
58
+ * @default false
59
+ */
60
+ this.enableDesign = false;
61
+ /*-------------------------------------------------*/
62
+ /* I n t e r n a l V a r i a b l e s */
63
+ /*-------------------------------------------------*/
64
+ /**
65
+ * Instance of the KupManager class.
66
+ */
67
+ this.kupManager = kupManager.kupManagerInstance();
68
+ /**
69
+ * Internal data of the component.
70
+ */
71
+ this.internalData = null;
72
+ /**
73
+ * Internal data backup of the component for refresh when changed content by drag&drop.
74
+ */
75
+ this.internalDataBackup = null;
76
+ }
77
+ onKupSave() {
78
+ this.kupSave.emit({
79
+ comp: this,
80
+ id: this.rootElement.id,
81
+ data: this.internalData,
82
+ });
83
+ }
84
+ /*-------------------------------------------------*/
85
+ /* W a t c h e r s */
86
+ /*-------------------------------------------------*/
87
+ dataChanged() {
88
+ this.resetData();
89
+ }
90
+ /*-------------------------------------------------*/
91
+ /* P u b l i c M e t h o d s */
92
+ /*-------------------------------------------------*/
93
+ /**
94
+ * Used to retrieve component's props values.
95
+ * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
96
+ * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
97
+ */
98
+ async getProps(descriptions) {
99
+ return utils.getProps(this, KupDashboardProps, descriptions);
100
+ }
101
+ /**
102
+ * This method is used to trigger a new render of the component.
103
+ */
104
+ async refresh() {
105
+ index.forceUpdate(this);
106
+ }
107
+ /**
108
+ * Sets the props to the component.
109
+ * @param {GenericObject} props - Object containing props that will be set to the component.
110
+ */
111
+ async setProps(props) {
112
+ utils.setProps(this, KupDashboardProps, props);
113
+ }
114
+ /*-------------------------------------------------*/
115
+ /* P r i v a t e M e t h o d s */
116
+ /*-------------------------------------------------*/
117
+ buildGuid() {
118
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
119
+ var r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3) | 0x8;
120
+ return v.toString(16);
121
+ });
122
+ }
123
+ buildHeader() {
124
+ const clearButtonProp = {
125
+ icon: 'cancel',
126
+ label: this.kupManager.language.translate(kupManager.KupLanguageDashboard.RESET),
127
+ secondary: true,
128
+ onClick: () => {
129
+ this.resetData();
130
+ },
131
+ };
132
+ const saveButtonProp = {
133
+ icon: 'save',
134
+ label: this.kupManager.language.translate(kupManager.KupLanguageDashboard.SAVE),
135
+ onClick: () => this.onKupSave(),
136
+ };
137
+ return (index.h("div", { class: "header" }, this.enableDesign ? (index.h(fButton.FButton, Object.assign({}, clearButtonProp))) : undefined, this.enableDesign ? (index.h(fButton.FButton, Object.assign({}, saveButtonProp))) : undefined));
138
+ }
139
+ buildForm(form, parent) {
140
+ const classes = {
141
+ form: true,
142
+ 'layout-column': form && form.layout == 'column',
143
+ 'layout-row': form && form.layout == 'row',
144
+ 'form-dropzone': this.enableDesign &&
145
+ form &&
146
+ form.sections != null &&
147
+ form.sections.length > 0,
148
+ };
149
+ return form ? (index.h("div", { class: classes, style: this.getGridStyle(form), ref: (el) => {
150
+ if (!el)
151
+ return;
152
+ const kel = el;
153
+ kel.kupData = { parent: parent, form: form };
154
+ } }, form.sections.map((section) => this.buildSection(section, form)))) : (index.h("div", null, this.kupManager.language.translate(kupManager.KupLanguageGeneric.EMPTY_DATA)));
155
+ }
156
+ buildSectionHeader(section, parent) {
157
+ const dimTextFieldProp = {
158
+ value: section.dim,
159
+ label: this.kupManager.language.translate(kupManager.KupLanguageDashboard.DIMENSION),
160
+ onChange: (e) => {
161
+ const { target } = e;
162
+ section.dim = target.value;
163
+ },
164
+ };
165
+ const addButtonProp = {
166
+ icon: 'add',
167
+ slim: true,
168
+ onClick: () => {
169
+ if (!section.sections) {
170
+ section.sections = [];
171
+ }
172
+ const newSec = {
173
+ id: section.id + (section.sections.length + 1),
174
+ loaded: section.loaded,
175
+ layout: section.layout,
176
+ };
177
+ section.sections.push(newSec);
178
+ this.resetData(this.internalData);
179
+ },
180
+ };
181
+ const removeButtonProp = {
182
+ icon: 'remove',
183
+ slim: true,
184
+ secondary: true,
185
+ onClick: () => {
186
+ const idx = parent.sections.indexOf(section);
187
+ parent.sections.splice(idx, 1);
188
+ this.resetData(this.internalData);
189
+ },
190
+ };
191
+ const loadedCheckBoxProp = {
192
+ checked: section.loaded,
193
+ label: this.kupManager.language.translate(kupManager.KupLanguageDashboard.LOADED),
194
+ onChange: () => {
195
+ section.loaded = !section.loaded;
196
+ this.refresh();
197
+ },
198
+ };
199
+ const columnCheckBoxProp = {
200
+ checked: section.layout == 'column',
201
+ label: this.kupManager.language.translate(kupManager.KupLanguageDashboard.VERTICAL),
202
+ onChange: () => {
203
+ section.layout = section.layout == 'column' ? 'row' : 'column';
204
+ this.refresh();
205
+ },
206
+ };
207
+ return (index.h("div", { class: "section-header" }, index.h("div", null, section.id, " - ", section.layout), index.h("div", null, index.h("div", { class: "section-header-actions" }, index.h(fTextField.FTextField, Object.assign({}, dimTextFieldProp)), index.h(fCheckbox.FCheckbox, Object.assign({}, loadedCheckBoxProp)), index.h(fCheckbox.FCheckbox, Object.assign({}, columnCheckBoxProp)), index.h(fButton.FButton, Object.assign({}, addButtonProp)), index.h(fButton.FButton, Object.assign({}, removeButtonProp))))));
208
+ }
209
+ buildSection(section, parent) {
210
+ const classes = {
211
+ section: true,
212
+ 'section-draggable': this.enableDesign,
213
+ 'section-dropzone': this.enableDesign,
214
+ };
215
+ const bodyClasses = {
216
+ 'section-body': true,
217
+ 'layout-column': section && section.layout == 'column',
218
+ 'layout-row': section && section.layout == 'row',
219
+ };
220
+ return (index.h("div", { class: classes, ref: (el) => {
221
+ if (!el)
222
+ return;
223
+ const kel = el;
224
+ kel.kupData = { parent: parent, section: section };
225
+ } }, this.enableDesign
226
+ ? this.buildSectionHeader(section, parent)
227
+ : undefined, index.h("div", { class: bodyClasses, style: this.getGridStyle(section) }, !this.enableDesign &&
228
+ section.loaded &&
229
+ (!section.sections || section.sections.length == 0) ? (index.h("slot", { name: section.id })) : undefined, section.sections && (section.loaded || this.enableDesign)
230
+ ? section.sections.map((childSection) => this.buildSection(childSection, section))
231
+ : undefined)));
232
+ }
233
+ didRenderInteractables() {
234
+ try {
235
+ const items = [];
236
+ this.rootElement.shadowRoot
237
+ .querySelectorAll('.section-draggable')
238
+ .forEach((x) => items.push(x));
239
+ items.forEach((item) => {
240
+ this.kupManager.interact.draggable(item, null, null, kupManager.KupDragEffect.CLONE);
241
+ });
242
+ }
243
+ catch (error) {
244
+ this.kupManager.debug.logMessage(this, error, kupManager.KupDebugCategory.ERROR);
245
+ }
246
+ try {
247
+ const items = [];
248
+ this.rootElement.shadowRoot
249
+ .querySelectorAll('.section-dropzone')
250
+ .forEach((x) => items.push(x));
251
+ this.rootElement.shadowRoot
252
+ .querySelectorAll('.form-dropzone')
253
+ .forEach((x) => items.push(x));
254
+ items.forEach((item) => {
255
+ this.kupManager.interact.dropzone(item, null, null, {
256
+ drop: (ev) => {
257
+ this.dropped(ev.currentTarget, ev.relatedTarget);
258
+ },
259
+ });
260
+ });
261
+ }
262
+ catch (error) {
263
+ this.kupManager.debug.logMessage(this, error, kupManager.KupDebugCategory.ERROR);
264
+ }
265
+ }
266
+ dropped(parent, child) {
267
+ const idx = child.kupData.parent.sections.indexOf(child.kupData.section);
268
+ child.kupData.parent.sections.splice(idx, 1);
269
+ if (parent.kupData.form) {
270
+ // form is the target of drop.
271
+ if (!parent.kupData.form.sections)
272
+ parent.kupData.form.sections = [];
273
+ parent.kupData.form.sections.push(child.kupData.section);
274
+ child.kupData.parent = parent.kupData.form;
275
+ }
276
+ else if (parent.kupData.section) {
277
+ // section is the target of drop.
278
+ if (!parent.kupData.section.sections ||
279
+ parent.kupData.section.sections.length == 0) {
280
+ // if the section target of drop doesn't contains other sections, i create a wrapper that will contain target section and dragged section.
281
+ const newSec = JSON.parse(JSON.stringify(parent.kupData.section));
282
+ newSec.dim = null;
283
+ child.kupData.section.dim = null;
284
+ parent.kupData.section.id = this.buildGuid();
285
+ parent.kupData.section.sections = [];
286
+ parent.kupData.section.sections.push(newSec);
287
+ }
288
+ parent.kupData.section.sections.push(child.kupData.section);
289
+ child.kupData.parent = parent.kupData.section;
290
+ }
291
+ this.resetData(this.internalData);
292
+ }
293
+ getGridStyle(entity) {
294
+ let bodyStyles = {};
295
+ if (!this.enableDesign && entity.sections) {
296
+ let gridTemplate = '';
297
+ entity.sections.forEach((childSection) => {
298
+ if (!childSection.dim)
299
+ gridTemplate += ' 1fr';
300
+ else
301
+ gridTemplate +=
302
+ childSection.dim.indexOf('%') < 0
303
+ ? ' ' + childSection.dim + 'px'
304
+ : ' ' + childSection.dim;
305
+ });
306
+ if (entity.layout == 'column')
307
+ bodyStyles['gridTemplateRows'] = gridTemplate;
308
+ if (entity.layout == 'row')
309
+ bodyStyles['gridTemplateColumns'] = gridTemplate;
310
+ }
311
+ return bodyStyles;
312
+ }
313
+ resetData(form = null) {
314
+ if (form)
315
+ this.internalDataBackup = form;
316
+ this.resetInternalData = true;
317
+ setTimeout(() => {
318
+ if (this.internalDataBackup) {
319
+ this.internalData = this.internalDataBackup;
320
+ this.internalDataBackup = null;
321
+ }
322
+ this.resetInternalData = false;
323
+ }, 250);
324
+ }
325
+ unregisterInteractables() {
326
+ this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.section-dropzone')));
327
+ this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.section-draggable')));
328
+ this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.form-dropzone')));
329
+ }
330
+ /*-------------------------------------------------*/
331
+ /* L i f e c y c l e H o o k s */
332
+ /*-------------------------------------------------*/
333
+ componentWillLoad() {
334
+ this.kupManager.dates.register(this);
335
+ this.kupManager.debug.logLoad(this, false);
336
+ this.kupManager.language.register(this);
337
+ this.kupManager.theme.register(this);
338
+ }
339
+ componentDidLoad() {
340
+ this.kupManager.debug.logLoad(this, true);
341
+ }
342
+ componentWillRender() {
343
+ this.kupManager.debug.logRender(this, false);
344
+ if (this.resetInternalData) {
345
+ this.internalData = null;
346
+ this.unregisterInteractables();
347
+ }
348
+ else if (!this.internalData)
349
+ this.internalData = JSON.parse(JSON.stringify(this.data));
350
+ }
351
+ componentDidRender() {
352
+ this.kupManager.debug.logRender(this, true);
353
+ const root = this.rootElement.shadowRoot;
354
+ if (root) {
355
+ const fields = root.querySelectorAll('.f-text-field');
356
+ if (fields)
357
+ fields.forEach((f) => {
358
+ fTextFieldMdc.FTextFieldMDC(f);
359
+ });
360
+ }
361
+ this.didRenderInteractables();
362
+ }
363
+ render() {
364
+ return (index.h(index.Host, null, index.h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), index.h("div", { id: GenericVariables.componentWrapperId }, this.buildHeader(), this.buildForm(this.internalData, null))));
365
+ }
366
+ disconnectedCallback() {
367
+ this.unregisterInteractables();
368
+ this.kupManager.dates.unregister(this);
369
+ this.kupManager.language.unregister(this);
370
+ this.kupManager.theme.unregister(this);
371
+ }
372
+ get rootElement() { return index.getElement(this); }
373
+ static get watchers() { return {
374
+ "data": ["dataChanged"]
375
+ }; }
376
+ };
377
+ KupDashboard.style = kupDashboardCss;
378
+
379
+ exports.kup_dashboard = KupDashboard;
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-eb556444.js');
6
- const kupManager = require('./kup-manager-5c03da64.js');
7
- const utils = require('./utils-e99921c1.js');
5
+ const index = require('./index-06b131ea.js');
6
+ const kupManager = require('./kup-manager-2fee8cf3.js');
7
+ const utils = require('./utils-8470184d.js');
8
8
  const GenericVariables = require('./GenericVariables-a9ed17ee.js');
9
9
 
10
10
  const drawerClass = 'drawer';
@@ -18,7 +18,7 @@ var KupDrawerProps;
18
18
  KupDrawerProps["opened"] = "Defaults at false. When set to true, the drawer appears.";
19
19
  })(KupDrawerProps || (KupDrawerProps = {}));
20
20
 
21
- 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)}";
21
+ 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)}";
22
22
 
23
23
  const KupDrawer = class {
24
24
  constructor(hostRef) {
@@ -144,9 +144,16 @@ const KupDrawer = class {
144
144
  this.kupManager.debug.logRender(this, true);
145
145
  }
146
146
  render() {
147
- return (index.h(index.Host, { "kup-opened": this.opened }, index.h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), index.h("div", { class: "backdrop", onPointerDown: (e) => {
147
+ return (index.h(index.Host, { "kup-opened": this.opened }, index.h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), index.h("div", { class: "backdrop", onClick: (e) => {
148
+ e.preventDefault();
149
+ e.stopPropagation();
150
+ }, onPointerDown: (e) => {
151
+ e.preventDefault();
148
152
  e.stopPropagation();
149
153
  this.close();
154
+ }, onTouchStart: (e) => {
155
+ e.preventDefault();
156
+ e.stopPropagation();
150
157
  } }), index.h("div", { id: GenericVariables.componentWrapperId }, index.h("div", { class: drawerClass }, this.content()))));
151
158
  }
152
159
  disconnectedCallback() {
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-eb556444.js');
6
- const kupManager = require('./kup-manager-5c03da64.js');
5
+ const index = require('./index-06b131ea.js');
6
+ const kupManager = require('./kup-manager-2fee8cf3.js');
7
7
  const GenericVariables = require('./GenericVariables-a9ed17ee.js');
8
8
 
9
9
  /**