@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
@@ -1,13 +1,11 @@
1
- import { r as registerInstance, c as createEvent, a as getAssetPath, f as forceUpdate, h as h$1, H as Host, g as getElement } from './index-baeab1ac.js';
1
+ import { r as registerInstance, c as createEvent, a as getAssetPath, f as forceUpdate, h as h$1, H as Host, g as getElement } from './index-e41330a5.js';
2
2
  import { _ as __extends, a as __assign, c as __spreadArray } from './tslib.es6-3eea2234.js';
3
- import { X as createCommonjsModule, Y as getDefaultExportFromCjs, k as kupManagerInstance, Z as KupDatesLocales, h as KupLanguageGeneric } from './kup-manager-58b075b4.js';
4
- import { g as getColumnByName } from './cell-utils-964da6b5.js';
3
+ import { ar as createCommonjsModule, as as getDefaultExportFromCjs, k as kupManagerInstance, g as getProps, s as setProps, at as KupDatesLocales, j as KupLanguageGeneric, t as getColumnByName } from './kup-manager-86f440c7.js';
5
4
  import { c as componentWrapperId } from './GenericVariables-665de00a.js';
6
- import { F as FButton } from './f-button-871a544b.js';
7
- import { g as getProps, s as setProps } from './utils-d7e4b3c2.js';
8
- import { a as FChip, F as FChipType } from './f-chip-1dda722f.js';
5
+ import { F as FButton } from './f-button-cd948e50.js';
6
+ import { a as FChip, F as FChipType } from './f-chip-d6f2eb94.js';
9
7
  import './f-button-declarations-b1b4cac4.js';
10
- import './f-image-c468d8ae.js';
8
+ import './f-image-914a03ef.js';
11
9
 
12
10
  var n,l,u$1,t,o,r$1,f$1,e$1={},c$1=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a$1(n,l){for(var u in l)n[u]=l[u];return n}function h(n){var l=n.parentNode;l&&l.removeChild(n);}function v$1(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return y(l,f,t,o,null)}function y(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l.vnode&&l.vnode(f),f}function p(){return {current:null}}function d(n){return n.children}function _(n,l){this.props=n,this.context=l;}function k(n,l){if(null==l)return n.__?k(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?k(n):null}function b$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b$1(n)}}function m(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g$1.__r++||r$1!==l.debounceRendering)&&((r$1=l.debounceRendering)||o)(g$1);}function g$1(){for(var n;g$1.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=a$1({},t)).__v=t.__v+1,j$2(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?k(t):o,t.__h),z$1(u,t),t.__e!=o&&b$1(t)));});}function w$1(n,l,u,i,t,o,r,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c$1,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?y(null,_,null,null,_):Array.isArray(_)?y(d,{children:_},null,null,null):_.__b>0?y(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null;}j$2(n,_,p=p||e$1,t,o,r,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===p.__k?_.__d=s=x$1(_,s,n):s=P$1(n,_,p,w,b,s),"function"==typeof u.type&&(u.__d=s)):s&&p.__e==s&&s.parentNode!=n&&(s=k(p));}for(u.__e=m,h=A;h--;)null!=w[h]&&("function"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M$1(g[h],g[++h],g[++h]);}function x$1(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?x$1(i,l,u):P$1(u,i,i,t,i.__e,l));return l}function A$1(n,l){return l=l||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some(function(n){A$1(n,l);}):l.push(n)),l}function P$1(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function C$1(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H$1(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H$1(n,o,l[o],u[o],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||s.test(l)?u:u+"px";}function H$1(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T$1:I$1,o):n.removeEventListener(l,o?T$1:I$1,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I$1(n){this.l[n.type+!1](l.event?l.event(n):n);}function T$1(n){this.l[n.type+!0](l.event?l.event(n):n);}function j$2(n,u,i,t,o,r,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(s=l.__b)&&s(u);try{n:if("function"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _(m,x),h.constructor=P,h.render=O$1),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a$1({},h.__s)),a$1(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k);});}h.context=x,h.props=m,h.state=h.__s,(s=l.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a$1(a$1({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d&&null==s.key?s.props.children:s,w$1(n,Array.isArray(A)?A:[A],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L$1(i.__e,u,i,t,o,r,f,c);(s=l.diffed)&&s(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l.__e(n,u,i);}}function z$1(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l.__e(n,u.__v);}});}function L$1(l,u,i,t,o,r,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if("svg"===d&&(o=!0),null!=r)for(;_<r.length;_++)if((s=r[_])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(r=r&&n.call(l.childNodes),a=(y=i.props||e$1).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C$1(l,p,y,o,c),v)u.__k=[];else if(_=u.props.children,w$1(l,Array.isArray(_)?_:[_],u,i,t,o&&"foreignObject"!==d,r,f,r?r[0]:i.__k&&k(i,0),c),null!=r)for(_=r.length;_--;)null!=r[_]&&h(r[_]);c||("value"in p&&void 0!==(_=p.value)&&(_!==l.value||"progress"===d&&!_||"option"===d&&_!==y.value)&&H$1(l,"value",_,y.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H$1(l,"checked",_,y.checked,!1));}return l}function M$1(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l.__e(n,i);}}function N(n,u,i){var t,o;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M$1(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l.__e(n,u);}t.base=t.__P=null;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,"function"!=typeof n.type);i||null==n.__e||h(n.__e),n.__e=n.__d=void 0;}function O$1(n,l,u){return this.constructor(n,u)}function S$1(u,i,t){var o,r,f;l.__&&l.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,f=[],j$2(i,u=(!o&&t||i).__k=v$1(d,null,[u]),r||e$1,e$1,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,f,!o&&t?t:r?r.__e:i.firstChild,o),z$1(f,u);}function D$1(n,l){var u={__c:l="__cC"+f$1++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(m);},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n);};}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=c$1.slice,l={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u$1=0,_.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a$1({},this.state),"function"==typeof n&&(n=n(a$1({},u),this.props)),n&&a$1(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m(this));},_.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m(this));},_.prototype.render=d,t=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g$1.__r=0,f$1=0;
13
11
 
@@ -1,12 +1,11 @@
1
- import { r as registerInstance, f as forceUpdate, h, H as Host, g as getElement } from './index-baeab1ac.js';
2
- import { k as kupManagerInstance, B as KupDragEffect, h as KupLanguageGeneric } from './kup-manager-58b075b4.js';
3
- import { g as getProps, s as setProps } from './utils-d7e4b3c2.js';
1
+ import { r as registerInstance, f as forceUpdate, h, H as Host, g as getElement } from './index-e41330a5.js';
2
+ import { I as FCellPadding, k as kupManagerInstance, g as getProps, s as setProps, R as KupDragEffect, j as KupLanguageGeneric } from './kup-manager-86f440c7.js';
4
3
  import { c as componentWrapperId } from './GenericVariables-665de00a.js';
5
- import { a as FCellPadding, b as FCell } from './f-cell-521ef17a.js';
6
- import './cell-utils-964da6b5.js';
7
- import './f-text-field-d6c61c73.js';
8
- import './f-image-c468d8ae.js';
9
- import './f-chip-1dda722f.js';
4
+ import { F as FCell } from './f-cell-474dd282.js';
5
+ import './f-checkbox-e06cf07b.js';
6
+ import './f-text-field-76341fe3.js';
7
+ import './f-image-914a03ef.js';
8
+ import './f-chip-d6f2eb94.js';
10
9
 
11
10
  /**
12
11
  * Props of the kup-cell component.
@@ -1,7 +1,5 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-baeab1ac.js';
2
- import { c as getCellValueForDisplay } from './cell-utils-964da6b5.js';
3
- import { k as kupManagerInstance } from './kup-manager-58b075b4.js';
4
- import { p as getDecimalSeparator } from './utils-d7e4b3c2.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-e41330a5.js';
2
+ import { k as kupManagerInstance, ad as getCellValueForDisplay, au as getDecimalSeparator } from './kup-manager-86f440c7.js';
5
3
 
6
4
  const kupDashListCss = ".horizontal{display:inline-block;min-width:300px;max-width:100%;overflow:visible;white-space:nowrap;border:solid;border-width:1px;margin:2px}";
7
5
 
@@ -1,6 +1,5 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement, f as forceUpdate, H as Host } from './index-baeab1ac.js';
2
- import { k as kupManagerInstance, c as KupDebugCategory } from './kup-manager-58b075b4.js';
3
- import { g as getProps, s as setProps } from './utils-d7e4b3c2.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement, f as forceUpdate, H as Host } from './index-e41330a5.js';
2
+ import { k as kupManagerInstance, g as getProps, s as setProps, c as KupDebugCategory } from './kup-manager-86f440c7.js';
4
3
  import { c as componentWrapperId } from './GenericVariables-665de00a.js';
5
4
 
6
5
  const kupDashCss = "#dash{color:var(--kup-text-color);font-size:2vw;display:flex;align-items:center;justify-content:center;position:relative;text-align:center;position:relative;word-break:normal}#dash.with-dyn{cursor:pointer}#dash #content .icon{margin:auto;font-size:90%}#dash #content.layout-1,#dash #content.layout-3{text-align:center}#dash #content.layout-1 .descr,#dash #content.layout-3 .descr{font-size:70%;width:100%}#dash #content.layout-1 .value,#dash #content.layout-3 .value{font-size:220%}#dash #content.layout-2>div{display:flex}#dash #content.layout-2>div .icon{margin:auto;font-size:150%;margin-right:5%}#dash #content.layout-2>div .value-int{font-size:250%}#dash #content.layout-2>div .value-dec,#dash #content.layout-2>div .unit{font-size:130%;margin-top:auto;margin-bottom:7%}#dash #content.layout-2>div .value-dec{margin-left:2%}#dash #content.layout-2>div .unit{margin-left:4%}#dash #content.layout-4>div{display:grid;grid-template-columns:2fr 5fr}#dash #content.layout-4>div .icon{margin:auto;font-size:150%;margin-right:5%}#dash #content.layout-4>div .value-and-unit{display:flex}#dash #content.layout-4>div .value-and-unit .value-int{font-size:250%}#dash #content.layout-4>div .value-and-unit .value-dec,#dash #content.layout-4>div .value-and-unit .unit{font-size:130%;margin-top:auto;margin-bottom:7%}#dash #content.layout-4>div .value-and-unit .value-dec{margin-left:2%}#dash #content.layout-4>div .value-and-unit .unit{margin-left:4%}#dash #content.layout-4>div .descr{margin-left:4%;text-align:left;font-size:80%;width:100%;min-width:max-content}#dash #content.layout-5>div,#dash #content.layout-7>div{display:flex}#dash #content.layout-5>div .icon,#dash #content.layout-7>div .icon{font-size:150%;margin:auto;margin-left:10%}#dash #content.layout-5>div .value,#dash #content.layout-7>div .value{font-size:200%}#dash #content.layout-5>div .descr,#dash #content.layout-7>div .descr{text-align:right;font-size:65%;width:100%;min-width:max-content}#dash #content.layout-6>div{display:flex;justify-content:space-between}#dash #content.layout-6>div .icon{font-size:150%;margin-right:10%}#dash #content.layout-6>div .value{font-size:220%;text-align:right}#dash #content.layout-6>div .descr{font-size:80%;text-align:right;width:100%;min-width:max-content}#dash #content.layout-8>div{display:flex;align-items:center}#dash #content.layout-8>div .icon{margin-right:4%;font-size:75%}#dash #content.layout-8>div .value{margin:0 10%;font-size:250%}#dash #content.layout-8>div .descr{font-size:60%;text-align:left}";
@@ -180,10 +179,7 @@ const KupGrid = class {
180
179
  el = h("slot", { name: `${i}` });
181
180
  }
182
181
  else {
183
- let span = 1;
184
- if (slots[i]['span']) {
185
- span = slots[i]['span'];
186
- }
182
+ const span = slots[i]['span'] || slots[i].getAttribute('span') || 1;
187
183
  el = (h("div", { class: `layout-grid__cell layout-grid__cell--span-${span}` }, h("slot", { name: `${i}` })));
188
184
  }
189
185
  content.push(el);
@@ -0,0 +1,434 @@
1
+ import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-e41330a5.js';
2
+ import { F as FButton } from './f-button-cd948e50.js';
3
+ import { F as FCheckbox } from './f-checkbox-e06cf07b.js';
4
+ import { F as FTextField } from './f-text-field-76341fe3.js';
5
+ import { F as FTextFieldMDC } from './f-text-field-mdc-d42d3f9e.js';
6
+ import { k as kupManagerInstance, g as getProps, s as setProps, av as KupLanguageDashboard, j as KupLanguageGeneric, R as KupDragEffect, c as KupDebugCategory } from './kup-manager-86f440c7.js';
7
+ import { c as componentWrapperId } from './GenericVariables-665de00a.js';
8
+ import './f-button-declarations-b1b4cac4.js';
9
+ import './f-image-914a03ef.js';
10
+ import './tslib.es6-3eea2234.js';
11
+ import './component-b1bedf1d.js';
12
+
13
+ /**
14
+ * Props of the kup-dashboard component.
15
+ * Used to export every prop in an object.
16
+ */
17
+ var KupDashboardProps;
18
+ (function (KupDashboardProps) {
19
+ KupDashboardProps["customStyle"] = "Custom style of the component.";
20
+ KupDashboardProps["data"] = "The data of the component.";
21
+ KupDashboardProps["enableDesign"] = "When set to true, the component is in design mode and it is draggable.";
22
+ })(KupDashboardProps || (KupDashboardProps = {}));
23
+
24
+ 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);height:auto}.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}.section-placeholder{background-color:rgba(var(--kup-secondary-color-rgb), 0.5);min-height:1em;min-width: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}";
25
+
26
+ const KupDashboard = class {
27
+ constructor(hostRef) {
28
+ registerInstance(this, hostRef);
29
+ this.kupSave = createEvent(this, "kup-dashboard-save", 6);
30
+ /*-------------------------------------------------*/
31
+ /* S t a t e s */
32
+ /*-------------------------------------------------*/
33
+ /**
34
+ * Force render component by internal event.
35
+ */
36
+ this.resetInternalData = false;
37
+ /*-------------------------------------------------*/
38
+ /* P r o p s */
39
+ /*-------------------------------------------------*/
40
+ /**
41
+ * Custom style of the component.
42
+ * @default ""
43
+ * @see https://ketchup.smeup.com/ketchup-showcase/#/customization
44
+ */
45
+ this.customStyle = '';
46
+ /**
47
+ * The data of the component.
48
+ * @default null
49
+ */
50
+ this.data = null;
51
+ /**
52
+ * Enable drag & drop of the section.
53
+ * @default false
54
+ */
55
+ this.enableDesign = false;
56
+ /*-------------------------------------------------*/
57
+ /* I n t e r n a l V a r i a b l e s */
58
+ /*-------------------------------------------------*/
59
+ /**
60
+ * Instance of the KupManager class.
61
+ */
62
+ this.kupManager = kupManagerInstance();
63
+ /**
64
+ * Internal data of the component.
65
+ */
66
+ this.internalData = null;
67
+ /**
68
+ * Internal data backup of the component for refresh when changed content by drag&drop.
69
+ */
70
+ this.internalDataBackup = null;
71
+ }
72
+ onKupSave() {
73
+ this.kupSave.emit({
74
+ comp: this,
75
+ id: this.rootElement.id,
76
+ data: this.internalData,
77
+ });
78
+ }
79
+ /*-------------------------------------------------*/
80
+ /* W a t c h e r s */
81
+ /*-------------------------------------------------*/
82
+ dataChanged() {
83
+ this.resetData();
84
+ }
85
+ /*-------------------------------------------------*/
86
+ /* P u b l i c M e t h o d s */
87
+ /*-------------------------------------------------*/
88
+ /**
89
+ * Used to retrieve component's props values.
90
+ * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
91
+ * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
92
+ */
93
+ async getProps(descriptions) {
94
+ return getProps(this, KupDashboardProps, descriptions);
95
+ }
96
+ /**
97
+ * This method is used to trigger a new render of the component.
98
+ */
99
+ async refresh() {
100
+ forceUpdate(this);
101
+ }
102
+ /**
103
+ * Sets the props to the component.
104
+ * @param {GenericObject} props - Object containing props that will be set to the component.
105
+ */
106
+ async setProps(props) {
107
+ setProps(this, KupDashboardProps, props);
108
+ }
109
+ /*-------------------------------------------------*/
110
+ /* P r i v a t e M e t h o d s */
111
+ /*-------------------------------------------------*/
112
+ buildGuid() {
113
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
114
+ var r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3) | 0x8;
115
+ return v.toString(16);
116
+ });
117
+ }
118
+ buildHeader() {
119
+ const clearButtonProp = {
120
+ icon: 'cancel',
121
+ label: this.kupManager.language.translate(KupLanguageDashboard.RESET),
122
+ secondary: true,
123
+ onClick: () => {
124
+ this.resetData();
125
+ },
126
+ };
127
+ const saveButtonProp = {
128
+ icon: 'save',
129
+ label: this.kupManager.language.translate(KupLanguageDashboard.SAVE),
130
+ onClick: () => this.onKupSave(),
131
+ };
132
+ return (h("div", { class: "header" }, this.enableDesign ? (h(FButton, Object.assign({}, clearButtonProp))) : undefined, this.enableDesign ? (h(FButton, Object.assign({}, saveButtonProp))) : undefined));
133
+ }
134
+ buildForm(form, parent) {
135
+ const classes = {
136
+ form: true,
137
+ 'layout-column': form && form.layout == 'column',
138
+ 'layout-row': form && form.layout == 'row',
139
+ 'form-dropzone': this.enableDesign &&
140
+ form &&
141
+ form.sections != null &&
142
+ form.sections.length > 0,
143
+ };
144
+ return form ? (h("div", { class: classes, style: this.getGridStyle(form), ref: (el) => {
145
+ if (!el)
146
+ return;
147
+ const kel = el;
148
+ kel.kupData = { parent: parent, form: form };
149
+ } }, form.sections.map((section) => this.buildSection(section, form)))) : (h("div", null, this.kupManager.language.translate(KupLanguageGeneric.EMPTY_DATA)));
150
+ }
151
+ buildSectionHeader(section, parent) {
152
+ const dimTextFieldProp = {
153
+ value: section.dim,
154
+ label: this.kupManager.language.translate(KupLanguageDashboard.DIMENSION),
155
+ onChange: (e) => {
156
+ const { target } = e;
157
+ section.dim = target.value;
158
+ this.refresh();
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
+ calcSectionPosition(pointerY, pointerX, vertical, sectionCount, elements) {
230
+ let idx = sectionCount;
231
+ for (let index = 0; index < elements.length; index++) {
232
+ const element = elements[index];
233
+ const srect = element.getBoundingClientRect();
234
+ if (vertical && pointerY < srect.y) {
235
+ idx = index;
236
+ break;
237
+ }
238
+ else if (!vertical && pointerX < srect.x) {
239
+ idx = index;
240
+ break;
241
+ }
242
+ }
243
+ //console.log(
244
+ // `pointer: ${pointerX}:${pointerY} - vertical: ${vertical} - index: ${idx}`
245
+ //);
246
+ return idx;
247
+ }
248
+ didRenderInteractables() {
249
+ try {
250
+ const items = [];
251
+ this.rootElement.shadowRoot
252
+ .querySelectorAll('.section-draggable')
253
+ .forEach((x) => items.push(x));
254
+ items.forEach((item) => {
255
+ this.kupManager.interact.draggable(item, null, null, KupDragEffect.CLONE);
256
+ });
257
+ }
258
+ catch (error) {
259
+ this.kupManager.debug.logMessage(this, error, KupDebugCategory.ERROR);
260
+ }
261
+ try {
262
+ const items = [];
263
+ this.rootElement.shadowRoot
264
+ .querySelectorAll('.section-dropzone')
265
+ .forEach((x) => items.push(x));
266
+ this.rootElement.shadowRoot
267
+ .querySelectorAll('.form-dropzone')
268
+ .forEach((x) => items.push(x));
269
+ items.forEach((item) => {
270
+ this.kupManager.interact.dropzone(item, {
271
+ ondropdeactivate: () => {
272
+ this.removeSectionPlaceHolder();
273
+ },
274
+ ondropmove: (ev) => {
275
+ this.removeSectionPlaceHolder();
276
+ this.dragEnter(ev.dragEvent.clientY, ev.dragEvent.clientX, ev.currentTarget);
277
+ },
278
+ }, null, {
279
+ drop: (ev) => {
280
+ this.dropped(ev, ev.currentTarget, ev.relatedTarget);
281
+ },
282
+ });
283
+ });
284
+ }
285
+ catch (error) {
286
+ this.kupManager.debug.logMessage(this, error, KupDebugCategory.ERROR);
287
+ }
288
+ }
289
+ dragEnter(clientY, clientX, parent) {
290
+ if (parent.kupData.form) {
291
+ // form is the target of drop.
292
+ // calculate a new position for the section.
293
+ const nidx = this.calcSectionPosition(clientY, clientX, parent.kupData.form.layout == 'column', parent.kupData.form.sections.length, parent.children);
294
+ // set placeholder into target area.
295
+ this.setSectionPlaceHolder(parent, nidx);
296
+ }
297
+ else if (parent.kupData.section) {
298
+ // section is the target of drop.
299
+ // calculate a new position for the section.
300
+ const nidx = this.calcSectionPosition(clientY, clientX, parent.kupData.section.layout == 'column', parent.kupData.section.sections.length, parent.lastElementChild.children);
301
+ // set placeholder into target area.
302
+ this.setSectionPlaceHolder(parent.lastElementChild, nidx);
303
+ }
304
+ }
305
+ dropped(event, parent, child) {
306
+ const idx = child.kupData.parent.sections.indexOf(child.kupData.section);
307
+ child.kupData.parent.sections.splice(idx, 1);
308
+ if (parent.kupData.form) {
309
+ // form is the target of drop.
310
+ if (!parent.kupData.form.sections)
311
+ parent.kupData.form.sections = [];
312
+ // calculate a new position for the section.
313
+ const nidx = this.calcSectionPosition(event.dragEvent.clientY, event.dragEvent.clientX, parent.kupData.form.layout == 'column', parent.kupData.form.sections.length, parent.children);
314
+ // set the section in 'nidx' position.
315
+ parent.kupData.form.sections.splice(nidx, 0, child.kupData.section);
316
+ child.kupData.parent = parent.kupData.form;
317
+ }
318
+ else if (parent.kupData.section) {
319
+ // section is the target of drop.
320
+ if (!parent.kupData.section.sections ||
321
+ parent.kupData.section.sections.length == 0) {
322
+ // if the section target of drop doesn't contains other sections, i create a wrapper that will contain target section and dragged section.
323
+ const newSec = JSON.parse(JSON.stringify(parent.kupData.section));
324
+ newSec.dim = null;
325
+ child.kupData.section.dim = null;
326
+ parent.kupData.section.id = this.buildGuid();
327
+ parent.kupData.section.sections = [];
328
+ parent.kupData.section.sections.push(newSec);
329
+ }
330
+ // calculate a new position for the section.
331
+ const nidx = this.calcSectionPosition(event.dragEvent.clientY, event.dragEvent.clientX, parent.kupData.section.layout == 'column', parent.kupData.section.sections.length, parent.lastElementChild.children);
332
+ // set the section in 'nidx' position.
333
+ parent.kupData.section.sections.splice(nidx, 0, child.kupData.section);
334
+ child.kupData.parent = parent.kupData.section;
335
+ }
336
+ this.resetData(this.internalData);
337
+ }
338
+ getGridStyle(entity) {
339
+ let bodyStyles = {};
340
+ if (entity.sections) {
341
+ let gridTemplate = '';
342
+ entity.sections.forEach((childSection) => {
343
+ if (this.enableDesign || !childSection.dim)
344
+ gridTemplate += ' 1fr';
345
+ else
346
+ gridTemplate +=
347
+ childSection.dim.indexOf('%') < 0
348
+ ? ' ' + childSection.dim + 'px'
349
+ : ' ' + childSection.dim;
350
+ });
351
+ if (entity.layout == 'column')
352
+ bodyStyles['gridTemplateRows'] = gridTemplate;
353
+ if (entity.layout == 'row')
354
+ bodyStyles['gridTemplateColumns'] = gridTemplate;
355
+ }
356
+ return bodyStyles;
357
+ }
358
+ setSectionPlaceHolder(element, index) {
359
+ const ph = document.createElement('div');
360
+ ph.className = 'section-placeholder';
361
+ element.insertBefore(ph, element.childNodes[index]);
362
+ }
363
+ removeSectionPlaceHolder() {
364
+ const ph = this.rootElement.shadowRoot.querySelector('.section-placeholder');
365
+ if (ph)
366
+ ph.parentElement.removeChild(ph);
367
+ }
368
+ resetData(form = null) {
369
+ if (form)
370
+ this.internalDataBackup = form;
371
+ this.resetInternalData = true;
372
+ setTimeout(() => {
373
+ if (this.internalDataBackup) {
374
+ this.internalData = this.internalDataBackup;
375
+ this.internalDataBackup = null;
376
+ }
377
+ this.resetInternalData = false;
378
+ }, 250);
379
+ }
380
+ unregisterInteractables() {
381
+ this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.section-dropzone')));
382
+ this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.section-draggable')));
383
+ this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.form-dropzone')));
384
+ }
385
+ /*-------------------------------------------------*/
386
+ /* L i f e c y c l e H o o k s */
387
+ /*-------------------------------------------------*/
388
+ componentWillLoad() {
389
+ this.kupManager.dates.register(this);
390
+ this.kupManager.debug.logLoad(this, false);
391
+ this.kupManager.language.register(this);
392
+ this.kupManager.theme.register(this);
393
+ }
394
+ componentDidLoad() {
395
+ this.kupManager.debug.logLoad(this, true);
396
+ }
397
+ componentWillRender() {
398
+ this.kupManager.debug.logRender(this, false);
399
+ if (this.resetInternalData) {
400
+ this.internalData = null;
401
+ this.unregisterInteractables();
402
+ }
403
+ else if (!this.internalData)
404
+ this.internalData = JSON.parse(JSON.stringify(this.data));
405
+ }
406
+ componentDidRender() {
407
+ this.kupManager.debug.logRender(this, true);
408
+ const root = this.rootElement.shadowRoot;
409
+ if (root) {
410
+ const fields = root.querySelectorAll('.f-text-field');
411
+ if (fields)
412
+ fields.forEach((f) => {
413
+ FTextFieldMDC(f);
414
+ });
415
+ }
416
+ this.didRenderInteractables();
417
+ }
418
+ render() {
419
+ return (h(Host, null, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, this.buildHeader(), this.buildForm(this.internalData, null))));
420
+ }
421
+ disconnectedCallback() {
422
+ this.unregisterInteractables();
423
+ this.kupManager.dates.unregister(this);
424
+ this.kupManager.language.unregister(this);
425
+ this.kupManager.theme.unregister(this);
426
+ }
427
+ get rootElement() { return getElement(this); }
428
+ static get watchers() { return {
429
+ "data": ["dataChanged"]
430
+ }; }
431
+ };
432
+ KupDashboard.style = kupDashboardCss;
433
+
434
+ export { KupDashboard as kup_dashboard };
@@ -1,6 +1,5 @@
1
- import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-baeab1ac.js';
2
- import { k as kupManagerInstance } from './kup-manager-58b075b4.js';
3
- import { g as getProps, s as setProps } from './utils-d7e4b3c2.js';
1
+ import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-e41330a5.js';
2
+ import { k as kupManagerInstance, g as getProps, s as setProps } from './kup-manager-86f440c7.js';
4
3
  import { c as componentWrapperId } from './GenericVariables-665de00a.js';
5
4
 
6
5
  const drawerClass = 'drawer';
@@ -14,7 +13,7 @@ var KupDrawerProps;
14
13
  KupDrawerProps["opened"] = "Defaults at false. When set to true, the drawer appears.";
15
14
  })(KupDrawerProps || (KupDrawerProps = {}));
16
15
 
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-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{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)}";
16
+ 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
17
 
19
18
  const KupDrawer = class {
20
19
  constructor(hostRef) {