@sme.up/ketchup 6.1.0-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 (166) hide show
  1. package/dist/cjs/{cell-utils-a78d6fac.js → cell-utils-d894e802.js} +2 -2
  2. package/dist/cjs/{f-button-ac179257.js → f-button-414b3bc3.js} +4 -4
  3. package/dist/cjs/f-cell-c8983ec7.js +418 -0
  4. package/dist/cjs/f-checkbox-57443ca3.js +29 -0
  5. package/dist/cjs/{f-chip-b00897d7.js → f-chip-ef81bf51.js} +3 -3
  6. package/dist/cjs/{f-image-89f25556.js → f-image-0618c795.js} +2 -2
  7. package/dist/cjs/{f-paginator-utils-8fa501b3.js → f-paginator-utils-c9dd5173.js} +5 -5
  8. package/dist/cjs/{f-text-field-e1e45ade.js → f-text-field-7d31190f.js} +3 -3
  9. package/dist/cjs/{index-eb556444.js → index-06b131ea.js} +6 -4
  10. package/dist/cjs/ketchup.cjs.js +3 -3
  11. package/dist/cjs/kup-accordion.cjs.entry.js +4 -4
  12. package/dist/cjs/kup-autocomplete_25.cjs.entry.js +200 -187
  13. package/dist/cjs/kup-box_2.cjs.entry.js +23 -12
  14. package/dist/cjs/kup-calendar.cjs.entry.js +7 -7
  15. package/dist/cjs/kup-cell.cjs.entry.js +10 -9
  16. package/dist/cjs/kup-dash-list.cjs.entry.js +4 -4
  17. package/dist/cjs/kup-dash_2.cjs.entry.js +4 -7
  18. package/dist/cjs/{kup-form-editor.cjs.entry.js → kup-dashboard.cjs.entry.js} +123 -148
  19. package/dist/cjs/kup-drawer.cjs.entry.js +4 -4
  20. package/dist/cjs/kup-field.cjs.entry.js +2 -2
  21. package/dist/cjs/kup-form.cjs.entry.js +469 -0
  22. package/dist/cjs/kup-iframe.cjs.entry.js +3 -3
  23. package/dist/cjs/kup-image-list.cjs.entry.js +11 -10
  24. package/dist/cjs/kup-lazy.cjs.entry.js +3 -3
  25. package/dist/cjs/kup-magic-box.cjs.entry.js +4 -4
  26. package/dist/cjs/{kup-manager-7a941909.js → kup-manager-2fee8cf3.js} +324 -6
  27. package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
  28. package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
  29. package/dist/cjs/kup-photo-frame.cjs.entry.js +7 -9
  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 +5 -5
  33. package/dist/cjs/loader.cjs.js +3 -3
  34. package/dist/cjs/{utils-6287d878.js → utils-8470184d.js} +1 -1
  35. package/dist/collection/assets/dashboard.js +113 -0
  36. package/dist/collection/assets/data-table.js +15 -0
  37. package/dist/collection/assets/form.js +179 -0
  38. package/dist/collection/assets/grid.js +17 -0
  39. package/dist/collection/assets/index.js +10 -6
  40. package/dist/collection/collection-manifest.json +3 -2
  41. package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +135 -129
  42. package/dist/collection/components/kup-box/kup-box.js +13 -2
  43. package/dist/collection/components/kup-combobox/kup-combobox.js +16 -13
  44. package/dist/collection/components/kup-dashboard/kup-dashboard-declarations.js +10 -0
  45. package/dist/collection/components/{kup-form-editor/kup-form-editor.css → kup-dashboard/kup-dashboard.css} +7 -6
  46. package/dist/collection/components/{kup-form-editor/kup-form-editor.js → kup-dashboard/kup-dashboard.js} +148 -149
  47. package/dist/collection/components/kup-drawer/kup-drawer.css +5 -8
  48. package/dist/collection/components/kup-form/kup-form-declarations.js +19 -0
  49. package/dist/collection/components/kup-form/kup-form.css +86 -0
  50. package/dist/collection/components/kup-form/kup-form.js +668 -0
  51. package/dist/collection/components/kup-grid/kup-grid.js +1 -4
  52. package/dist/collection/components/kup-list/kup-list-helper.js +9 -3
  53. package/dist/collection/components/kup-photo-frame/kup-photo-frame.css +10 -7
  54. package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +3 -5
  55. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +3 -0
  56. package/dist/collection/components/kup-text-field/kup-text-field.js +27 -0
  57. package/dist/collection/components/kup-time-picker/kup-time-picker.js +0 -6
  58. package/dist/collection/components/kup-tree/kup-tree.js +10 -4
  59. package/dist/collection/f-components/f-button/f-button.js +2 -2
  60. package/dist/collection/f-components/f-cell/f-cell-declarations.js +5 -1
  61. package/dist/collection/f-components/f-cell/f-cell.js +34 -114
  62. package/dist/collection/f-components/f-text-field/f-text-field.js +1 -1
  63. package/dist/collection/managers/kup-data/kup-data.js +94 -0
  64. package/dist/collection/managers/kup-language/kup-language-declarations.js +11 -0
  65. package/dist/collection/managers/kup-objects/kup-objects.js +10 -0
  66. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +18 -3
  67. package/dist/collection/types/GenericTypes.js +2 -1
  68. package/dist/esm/{cell-utils-964da6b5.js → cell-utils-7fc84d4e.js} +2 -2
  69. package/dist/esm/{f-button-871a544b.js → f-button-2f6cc296.js} +4 -4
  70. package/dist/esm/{f-cell-521ef17a.js → f-cell-4428481c.js} +48 -283
  71. package/dist/esm/f-checkbox-c51c4a75.js +27 -0
  72. package/dist/esm/{f-chip-1dda722f.js → f-chip-b39eb49a.js} +3 -3
  73. package/dist/esm/{f-image-c468d8ae.js → f-image-b08ebeb2.js} +2 -2
  74. package/dist/esm/{f-paginator-utils-7dff8ff0.js → f-paginator-utils-4fda6086.js} +5 -5
  75. package/dist/esm/{f-text-field-d6c61c73.js → f-text-field-184a5fb3.js} +3 -3
  76. package/dist/esm/{index-baeab1ac.js → index-ad6ab214.js} +6 -4
  77. package/dist/esm/ketchup.js +3 -3
  78. package/dist/esm/kup-accordion.entry.js +4 -4
  79. package/dist/esm/kup-autocomplete_25.entry.js +190 -177
  80. package/dist/esm/kup-box_2.entry.js +23 -12
  81. package/dist/esm/kup-calendar.entry.js +7 -7
  82. package/dist/esm/kup-cell.entry.js +9 -8
  83. package/dist/esm/kup-dash-list.entry.js +4 -4
  84. package/dist/esm/kup-dash_2.entry.js +4 -7
  85. package/dist/esm/{kup-form-editor.entry.js → kup-dashboard.entry.js} +123 -148
  86. package/dist/esm/kup-drawer.entry.js +4 -4
  87. package/dist/esm/kup-field.entry.js +2 -2
  88. package/dist/esm/kup-form.entry.js +465 -0
  89. package/dist/esm/kup-iframe.entry.js +3 -3
  90. package/dist/esm/kup-image-list.entry.js +10 -9
  91. package/dist/esm/kup-lazy.entry.js +3 -3
  92. package/dist/esm/kup-magic-box.entry.js +4 -4
  93. package/dist/esm/{kup-manager-58b075b4.js → kup-manager-3325b2d8.js} +321 -7
  94. package/dist/esm/kup-nav-bar.entry.js +3 -3
  95. package/dist/esm/kup-numeric-picker.entry.js +3 -3
  96. package/dist/esm/kup-photo-frame.entry.js +7 -9
  97. package/dist/esm/kup-probe.entry.js +2 -2
  98. package/dist/esm/kup-qlik.entry.js +2 -2
  99. package/dist/esm/kup-snackbar.entry.js +5 -5
  100. package/dist/esm/loader.js +3 -3
  101. package/dist/esm/{utils-d7e4b3c2.js → utils-6373a07e.js} +1 -1
  102. package/dist/ketchup/ketchup.esm.js +1 -1
  103. package/dist/ketchup/p-006bc4d0.entry.js +1 -0
  104. package/dist/ketchup/{p-8cdf61a4.js → p-0741da57.js} +1 -1
  105. package/dist/ketchup/{p-44ec4f03.js → p-13e08580.js} +1 -1
  106. package/dist/ketchup/p-153697fb.entry.js +1 -0
  107. package/dist/ketchup/{p-a615a92b.entry.js → p-175edb62.entry.js} +1 -1
  108. package/dist/ketchup/{p-fac1a08b.entry.js → p-1db1d42b.entry.js} +1 -1
  109. package/dist/ketchup/{p-f09f2f98.entry.js → p-30820f8f.entry.js} +1 -1
  110. package/dist/ketchup/p-35325834.entry.js +9 -0
  111. package/dist/ketchup/{p-65b46587.entry.js → p-359e8bec.entry.js} +4 -4
  112. package/dist/ketchup/{p-6dff70f8.entry.js → p-3c7c92c0.entry.js} +1 -1
  113. package/dist/ketchup/{p-954cc340.entry.js → p-41cf8703.entry.js} +1 -1
  114. package/dist/ketchup/{p-3c11e615.entry.js → p-6127fccf.entry.js} +1 -1
  115. package/dist/ketchup/{p-f71a1675.entry.js → p-6b82e4e2.entry.js} +1 -1
  116. package/dist/ketchup/p-704e60eb.js +30 -0
  117. package/dist/ketchup/p-70660fe2.js +1 -0
  118. package/dist/ketchup/{p-ea10176c.entry.js → p-762c0382.entry.js} +1 -1
  119. package/dist/ketchup/{p-c5ce8951.entry.js → p-76947316.entry.js} +1 -1
  120. package/dist/ketchup/{p-d2ee56dd.entry.js → p-8103b80a.entry.js} +1 -1
  121. package/dist/ketchup/{p-99e0d768.entry.js → p-9fa457d4.entry.js} +1 -1
  122. package/dist/ketchup/{p-65974e48.entry.js → p-a0ce8075.entry.js} +1 -1
  123. package/dist/ketchup/p-a804fe83.entry.js +27 -0
  124. package/dist/ketchup/{p-7454cb92.js → p-ca9fd099.js} +1 -1
  125. package/dist/ketchup/p-caabb9ab.entry.js +1 -0
  126. package/dist/ketchup/p-cc3abf84.entry.js +1 -0
  127. package/dist/ketchup/p-cd5cfa7c.js +1 -0
  128. package/dist/ketchup/p-d2e76960.entry.js +1 -0
  129. package/dist/ketchup/p-d3b542b3.js +2 -0
  130. package/dist/ketchup/p-d7004ae4.js +1 -0
  131. package/dist/ketchup/{p-e0035c58.js → p-d95c904b.js} +1 -1
  132. package/dist/ketchup/{p-7eff4eee.js → p-ddce3430.js} +1 -1
  133. package/dist/ketchup/p-ee580b3a.entry.js +1 -0
  134. package/dist/ketchup/p-f49cb68e.js +1 -0
  135. package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +1 -16
  136. package/dist/types/components/{kup-form-editor/kup-form-editor-declarations.d.ts → kup-dashboard/kup-dashboard-declarations.d.ts} +9 -27
  137. package/dist/types/components/{kup-form-editor/kup-form-editor.d.ts → kup-dashboard/kup-dashboard.d.ts} +12 -9
  138. package/dist/types/components/kup-form/kup-form-declarations.d.ts +48 -0
  139. package/dist/types/components/kup-form/kup-form.d.ts +68 -0
  140. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +3 -0
  141. package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
  142. package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +0 -6
  143. package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +2 -0
  144. package/dist/types/components.d.ts +412 -159
  145. package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +4 -1
  146. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
  147. package/dist/types/managers/kup-data/kup-data.d.ts +2 -0
  148. package/dist/types/managers/kup-language/kup-language-declarations.d.ts +11 -1
  149. package/dist/types/managers/kup-objects/kup-objects.d.ts +6 -0
  150. package/dist/types/types/GenericTypes.d.ts +2 -1
  151. package/package.json +2 -2
  152. package/dist/cjs/f-cell-69294bca.js +0 -653
  153. package/dist/collection/assets/form-editor.js +0 -338
  154. package/dist/collection/components/kup-form-editor/kup-form-editor-declarations.js +0 -23
  155. package/dist/ketchup/p-1ae66cc5.js +0 -1
  156. package/dist/ketchup/p-34b74425.js +0 -1
  157. package/dist/ketchup/p-4ffbc3ff.js +0 -1
  158. package/dist/ketchup/p-5264a3e6.entry.js +0 -1
  159. package/dist/ketchup/p-80968627.entry.js +0 -1
  160. package/dist/ketchup/p-976244f9.entry.js +0 -9
  161. package/dist/ketchup/p-a0f6e25c.entry.js +0 -1
  162. package/dist/ketchup/p-aca0e54b.js +0 -30
  163. package/dist/ketchup/p-b8939a8b.entry.js +0 -1
  164. package/dist/ketchup/p-bfc3bac7.js +0 -1
  165. package/dist/ketchup/p-db71436b.entry.js +0 -27
  166. package/dist/ketchup/p-e1039cf2.entry.js +0 -1
@@ -2,18 +2,22 @@
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-7a941909.js');
7
- const cellUtils = require('./cell-utils-a78d6fac.js');
8
- const fPaginatorUtils = require('./f-paginator-utils-8fa501b3.js');
9
- const utils = require('./utils-6287d878.js');
10
- const fImage = require('./f-image-89f25556.js');
11
- const fChip = require('./f-chip-b00897d7.js');
5
+ const index = require('./index-06b131ea.js');
6
+ const kupManager = require('./kup-manager-2fee8cf3.js');
7
+ const cellUtils = require('./cell-utils-d894e802.js');
8
+ const fPaginatorUtils = require('./f-paginator-utils-c9dd5173.js');
9
+ const utils = require('./utils-8470184d.js');
10
+ const fImage = require('./f-image-0618c795.js');
11
+ const fChip = require('./f-chip-ef81bf51.js');
12
12
  const GenericVariables = require('./GenericVariables-a9ed17ee.js');
13
- const fCell = require('./f-cell-69294bca.js');
14
- require('./f-button-ac179257.js');
13
+ const fCell = require('./f-cell-c8983ec7.js');
14
+ const fTextFieldMdc = require('./f-text-field-mdc-85997738.js');
15
+ require('./f-button-414b3bc3.js');
15
16
  require('./f-button-declarations-b611587f.js');
16
- require('./f-text-field-e1e45ade.js');
17
+ require('./f-checkbox-57443ca3.js');
18
+ require('./f-text-field-7d31190f.js');
19
+ require('./tslib.es6-0ee02c67.js');
20
+ require('./component-72a5b626.js');
17
21
 
18
22
  /**
19
23
  * Props of the kup-box component.
@@ -979,7 +983,7 @@ const KupBox = class {
979
983
  if (!this.kanban.columns || this.kanban.columns.length === 0) {
980
984
  this.kupManager.debug.logMessage(this, 'No columns to group by detected.', kupManager.KupDebugCategory.ERROR);
981
985
  return {
982
- jsx: (index.h("p", { id: "empty-data-message" }, this.kupManager.language.translate(kupManager.KupLanguageGeneric.EMPTY_DATA))),
986
+ jsx: (index.h("div", { id: "empty-data-message", class: "box-wrapper" }, index.h("div", { ref: (el) => this.rowsRefs.push(el) }), this.kupManager.language.translate(kupManager.KupLanguageGeneric.EMPTY_DATA))),
983
987
  style: { 'grid-template-columns': `repeat(1, 1fr)` },
984
988
  };
985
989
  }
@@ -1192,6 +1196,13 @@ const KupBox = class {
1192
1196
  this.kupManager.debug.logRender(this, false);
1193
1197
  }
1194
1198
  componentDidRender() {
1199
+ const root = this.rootElement.shadowRoot;
1200
+ if (root) {
1201
+ const fs = root.querySelectorAll('.f-text-field');
1202
+ for (let index = 0; index < fs.length; index++) {
1203
+ fTextFieldMdc.FTextFieldMDC(fs[index]);
1204
+ }
1205
+ }
1195
1206
  this.checkScrollOnHover();
1196
1207
  this.persistState();
1197
1208
  this.didRenderInteractables();
@@ -1241,7 +1252,7 @@ const KupBox = class {
1241
1252
  let boxContent = null;
1242
1253
  let containerStyle = {};
1243
1254
  if (this.rows.length === 0) {
1244
- boxContent = (index.h("p", { id: "empty-data-message" }, this.kupManager.language.translate(kupManager.KupLanguageGeneric.EMPTY_DATA)));
1255
+ boxContent = (index.h("div", { id: "empty-data-message", class: "box-wrapper" }, index.h("div", { class: "box", ref: (el) => this.rowsRefs.push(el) }, this.kupManager.language.translate(kupManager.KupLanguageGeneric.EMPTY_DATA))));
1245
1256
  containerStyle = { 'grid-template-columns': `repeat(1, 1fr)` };
1246
1257
  }
1247
1258
  else if (isKanban) {
@@ -2,16 +2,16 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-eb556444.js');
5
+ const index = require('./index-06b131ea.js');
6
6
  const tslib_es6 = require('./tslib.es6-0ee02c67.js');
7
- const kupManager = require('./kup-manager-7a941909.js');
8
- const cellUtils = require('./cell-utils-a78d6fac.js');
7
+ const kupManager = require('./kup-manager-2fee8cf3.js');
8
+ const cellUtils = require('./cell-utils-d894e802.js');
9
9
  const GenericVariables = require('./GenericVariables-a9ed17ee.js');
10
- const fButton = require('./f-button-ac179257.js');
11
- const utils = require('./utils-6287d878.js');
12
- const fChip = require('./f-chip-b00897d7.js');
10
+ const fButton = require('./f-button-414b3bc3.js');
11
+ const utils = require('./utils-8470184d.js');
12
+ const fChip = require('./f-chip-ef81bf51.js');
13
13
  require('./f-button-declarations-b611587f.js');
14
- require('./f-image-89f25556.js');
14
+ require('./f-image-0618c795.js');
15
15
 
16
16
  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;
17
17
 
@@ -2,15 +2,16 @@
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-7a941909.js');
7
- const utils = require('./utils-6287d878.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
- const fCell = require('./f-cell-69294bca.js');
10
- require('./cell-utils-a78d6fac.js');
11
- require('./f-text-field-e1e45ade.js');
12
- require('./f-image-89f25556.js');
13
- require('./f-chip-b00897d7.js');
9
+ const fCell = require('./f-cell-c8983ec7.js');
10
+ require('./cell-utils-d894e802.js');
11
+ require('./f-checkbox-57443ca3.js');
12
+ require('./f-text-field-7d31190f.js');
13
+ require('./f-image-0618c795.js');
14
+ require('./f-chip-ef81bf51.js');
14
15
 
15
16
  /**
16
17
  * Props of the kup-cell component.
@@ -46,7 +47,7 @@ const KupCell = class {
46
47
  /**
47
48
  * The density of the cell, defaults at 'dense' and can be also set to 'wide' or 'medium'.
48
49
  */
49
- this.density = fCell.FCellPadding.NONE;
50
+ this.density = kupManager.FCellPadding.NONE;
50
51
  /**
51
52
  * When set to true, the component is draggable.
52
53
  * @default false
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-eb556444.js');
6
- const cellUtils = require('./cell-utils-a78d6fac.js');
7
- const kupManager = require('./kup-manager-7a941909.js');
8
- const utils = require('./utils-6287d878.js');
5
+ const index = require('./index-06b131ea.js');
6
+ const cellUtils = require('./cell-utils-d894e802.js');
7
+ const kupManager = require('./kup-manager-2fee8cf3.js');
8
+ const utils = require('./utils-8470184d.js');
9
9
 
10
10
  const kupDashListCss = ".horizontal{display:inline-block;min-width:300px;max-width:100%;overflow:visible;white-space:nowrap;border:solid;border-width:1px;margin:2px}";
11
11
 
@@ -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-7a941909.js');
7
- const utils = require('./utils-6287d878.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 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}";
@@ -184,10 +184,7 @@ const KupGrid = class {
184
184
  el = index.h("slot", { name: `${i}` });
185
185
  }
186
186
  else {
187
- let span = 1;
188
- if (slots[i]['span']) {
189
- span = slots[i]['span'];
190
- }
187
+ const span = slots[i]['span'] || slots[i].getAttribute('span') || 1;
191
188
  el = (index.h("div", { class: `layout-grid__cell layout-grid__cell--span-${span}` }, index.h("slot", { name: `${i}` })));
192
189
  }
193
190
  content.push(el);
@@ -2,44 +2,36 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-eb556444.js');
6
- const fButton = require('./f-button-ac179257.js');
7
- const kupManager = require('./kup-manager-7a941909.js');
8
- const utils = require('./utils-6287d878.js');
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');
9
12
  const GenericVariables = require('./GenericVariables-a9ed17ee.js');
10
13
  require('./f-button-declarations-b611587f.js');
11
- require('./f-image-89f25556.js');
14
+ require('./f-image-0618c795.js');
15
+ require('./tslib.es6-0ee02c67.js');
16
+ require('./component-72a5b626.js');
12
17
 
13
18
  /**
14
- * Props of the kup-form-editor component.
19
+ * Props of the kup-dashboard component.
15
20
  * Used to export every prop in an object.
16
21
  */
17
- var KupFormEditorProps;
18
- (function (KupFormEditorProps) {
19
- KupFormEditorProps["customStyle"] = "Custom style of the component.";
20
- KupFormEditorProps["data"] = "The data of the component.";
21
- })(KupFormEditorProps || (KupFormEditorProps = {}));
22
- var KupFormEditorDragTypes;
23
- (function (KupFormEditorDragTypes) {
24
- KupFormEditorDragTypes["Components"] = "1";
25
- KupFormEditorDragTypes["Sections"] = "2";
26
- })(KupFormEditorDragTypes || (KupFormEditorDragTypes = {}));
27
- var KupFormEditorLabels;
28
- (function (KupFormEditorLabels) {
29
- KupFormEditorLabels["Loaded"] = "Loaded";
30
- KupFormEditorLabels["Reset"] = "Reset";
31
- KupFormEditorLabels["Save"] = "Save";
32
- KupFormEditorLabels["Components"] = "Components";
33
- KupFormEditorLabels["Sections"] = "Sections";
34
- KupFormEditorLabels["Column"] = "Column";
35
- })(KupFormEditorLabels || (KupFormEditorLabels = {}));
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 = {}));
36
28
 
37
- const kupFormEditorCss = ":host{width:100%;height:100%}.header{display:flex;flex-direction:row;justify-content:center}.header>*{margin-left:0.5em}.form{display:grid;grid-gap:0.5em}.form-dropzone{padding:1em;border:1px solid var(--kup-primary-color)}.section{display:flex;flex-direction:column}.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);min-height:100px}.section-draggable{border:1px solid var(--kup-secondary-color);padding:1em}.component{height:fit-content;padding:1em;margin:0.5em}.component-draggable{border:1px solid var(--kup-secondary-color)}.layout-row{grid-auto-flow:column;grid-template-columns:min-content}.layout-column{grid-auto-flow:row;grid-template-rows:min-content}";
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}";
38
30
 
39
- const KupFormEditor = class {
31
+ const KupDashboard = class {
40
32
  constructor(hostRef) {
41
33
  index.registerInstance(this, hostRef);
42
- this.kupSave = index.createEvent(this, "kup-formeditor-save", 6);
34
+ this.kupSave = index.createEvent(this, "kup-dashboard-save", 6);
43
35
  /*-------------------------------------------------*/
44
36
  /* S t a t e s */
45
37
  /*-------------------------------------------------*/
@@ -58,9 +50,14 @@ const KupFormEditor = class {
58
50
  this.customStyle = '';
59
51
  /**
60
52
  * The data of the component.
61
- * @default false
53
+ * @default null
62
54
  */
63
55
  this.data = null;
56
+ /**
57
+ * Enable drag & drop of the section.
58
+ * @default false
59
+ */
60
+ this.enableDesign = false;
64
61
  /*-------------------------------------------------*/
65
62
  /* I n t e r n a l V a r i a b l e s */
66
63
  /*-------------------------------------------------*/
@@ -68,10 +65,6 @@ const KupFormEditor = class {
68
65
  * Instance of the KupManager class.
69
66
  */
70
67
  this.kupManager = kupManager.kupManagerInstance();
71
- /**
72
- * Draggable type of Form (Components or Sections).
73
- */
74
- this.dragType = KupFormEditorDragTypes.Components;
75
68
  /**
76
69
  * Internal data of the component.
77
70
  */
@@ -103,7 +96,7 @@ const KupFormEditor = class {
103
96
  * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
104
97
  */
105
98
  async getProps(descriptions) {
106
- return utils.getProps(this, KupFormEditorProps, descriptions);
99
+ return utils.getProps(this, KupDashboardProps, descriptions);
107
100
  }
108
101
  /**
109
102
  * This method is used to trigger a new render of the component.
@@ -116,15 +109,21 @@ const KupFormEditor = class {
116
109
  * @param {GenericObject} props - Object containing props that will be set to the component.
117
110
  */
118
111
  async setProps(props) {
119
- utils.setProps(this, KupFormEditorProps, props);
112
+ utils.setProps(this, KupDashboardProps, props);
120
113
  }
121
114
  /*-------------------------------------------------*/
122
115
  /* P r i v a t e M e t h o d s */
123
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
+ }
124
123
  buildHeader() {
125
124
  const clearButtonProp = {
126
125
  icon: 'cancel',
127
- label: KupFormEditorLabels.Reset,
126
+ label: this.kupManager.language.translate(kupManager.KupLanguageDashboard.RESET),
128
127
  secondary: true,
129
128
  onClick: () => {
130
129
  this.resetData();
@@ -132,38 +131,22 @@ const KupFormEditor = class {
132
131
  };
133
132
  const saveButtonProp = {
134
133
  icon: 'save',
135
- label: KupFormEditorLabels.Save,
134
+ label: this.kupManager.language.translate(kupManager.KupLanguageDashboard.SAVE),
136
135
  onClick: () => this.onKupSave(),
137
136
  };
138
- const selRadioProp = [
139
- {
140
- label: KupFormEditorLabels.Components,
141
- value: KupFormEditorDragTypes.Components,
142
- checked: this.dragType == KupFormEditorDragTypes.Components,
143
- },
144
- {
145
- label: KupFormEditorLabels.Sections,
146
- value: KupFormEditorDragTypes.Sections,
147
- checked: this.dragType == KupFormEditorDragTypes.Sections,
148
- },
149
- ];
150
- return (index.h("div", { class: "header" }, index.h("kup-radio", { data: selRadioProp, "onKup-radio-change": (ev) => {
151
- this.dragType = ev.detail
152
- .value;
153
- this.resetData(this.internalData);
154
- } }), index.h(fButton.FButton, Object.assign({}, clearButtonProp)), index.h(fButton.FButton, Object.assign({}, saveButtonProp))));
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));
155
138
  }
156
139
  buildForm(form, parent) {
157
140
  const classes = {
158
141
  form: true,
159
142
  'layout-column': form && form.layout == 'column',
160
143
  'layout-row': form && form.layout == 'row',
161
- 'form-dropzone': form &&
162
- this.dragType == KupFormEditorDragTypes.Sections &&
144
+ 'form-dropzone': this.enableDesign &&
145
+ form &&
163
146
  form.sections != null &&
164
147
  form.sections.length > 0,
165
148
  };
166
- return form ? (index.h("div", { class: classes, ref: (el) => {
149
+ return form ? (index.h("div", { class: classes, style: this.getGridStyle(form), ref: (el) => {
167
150
  if (!el)
168
151
  return;
169
152
  const kel = el;
@@ -171,6 +154,14 @@ const KupFormEditor = class {
171
154
  } }, form.sections.map((section) => this.buildSection(section, form)))) : (index.h("div", null, this.kupManager.language.translate(kupManager.KupLanguageGeneric.EMPTY_DATA)));
172
155
  }
173
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
+ };
174
165
  const addButtonProp = {
175
166
  icon: 'add',
176
167
  slim: true,
@@ -182,12 +173,7 @@ const KupFormEditor = class {
182
173
  id: section.id + (section.sections.length + 1),
183
174
  loaded: section.loaded,
184
175
  layout: section.layout,
185
- components: [],
186
176
  };
187
- if (section.components) {
188
- section.components.forEach((x) => newSec.components.push(x));
189
- section.components.splice(0);
190
- }
191
177
  section.sections.push(newSec);
192
178
  this.resetData(this.internalData);
193
179
  },
@@ -202,75 +188,51 @@ const KupFormEditor = class {
202
188
  this.resetData(this.internalData);
203
189
  },
204
190
  };
205
- return (index.h("div", { class: "section-header" }, index.h("div", null, section.id, ' ', section.dim ? '(' + section.dim + ')' : undefined, " -", ' ', section.layout), index.h("div", null, index.h("div", { class: "section-header-actions" }, index.h("kup-switch", { checked: section.loaded, label: KupFormEditorLabels.Loaded, "onKup-switch-change": (ev) => {
206
- section.loaded = ev.detail.value == 'on';
207
- } }), index.h("kup-switch", { checked: section.layout == 'column', label: KupFormEditorLabels.Column, "onKup-switch-change": (ev) => {
208
- section.layout =
209
- ev.detail.value == 'on' ? 'column' : 'row';
210
- this.resetData(this.internalData);
211
- } }), index.h(fButton.FButton, Object.assign({}, addButtonProp)), index.h(fButton.FButton, Object.assign({}, removeButtonProp)), section.components && section.components.length > 0 ? (index.h("kup-image", { resource: "widgets", sizeX: "24px", sizeY: "24px" })) : undefined))));
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))))));
212
208
  }
213
209
  buildSection(section, parent) {
214
210
  const classes = {
215
211
  section: true,
216
- 'section-draggable': this.dragType == KupFormEditorDragTypes.Sections,
217
- 'section-dropzone': !section.sections ||
218
- section.sections.length == 0 ||
219
- this.dragType == KupFormEditorDragTypes.Sections,
212
+ 'section-draggable': this.enableDesign,
213
+ 'section-dropzone': this.enableDesign,
220
214
  };
221
215
  const bodyClasses = {
222
216
  'section-body': true,
223
217
  'layout-column': section && section.layout == 'column',
224
218
  'layout-row': section && section.layout == 'row',
225
219
  };
226
- let bodyStyles = {};
227
- if (section.sections) {
228
- let gridTemplate = '';
229
- section.sections.forEach((childSection) => {
230
- if (!childSection.dim)
231
- gridTemplate += ' 1fr';
232
- else
233
- gridTemplate +=
234
- childSection.dim.indexOf('%') < 0
235
- ? ' ' + childSection.dim + 'px'
236
- : ' ' + childSection.dim;
237
- });
238
- if (section.layout == 'column')
239
- bodyStyles['gridTemplateRows'] = gridTemplate;
240
- if (section.layout == 'row')
241
- bodyStyles['gridTemplateColumns'] = gridTemplate;
242
- }
243
220
  return (index.h("div", { class: classes, ref: (el) => {
244
221
  if (!el)
245
222
  return;
246
223
  const kel = el;
247
224
  kel.kupData = { parent: parent, section: section };
248
- } }, this.dragType == KupFormEditorDragTypes.Sections
225
+ } }, this.enableDesign
249
226
  ? this.buildSectionHeader(section, parent)
250
- : undefined, index.h("div", { class: bodyClasses, style: bodyStyles }, this.dragType == KupFormEditorDragTypes.Components &&
251
- section.components
252
- ? section.components.map((component) => component.type == 'SCH' ? (this.buildForm(component, section)) : (index.h("div", { class: "component component-draggable", ref: (el) => {
253
- if (!el)
254
- return;
255
- const kel = el;
256
- kel.kupData = {
257
- section: section,
258
- componnent: component,
259
- };
260
- } }, component.id, " - ", component.type, index.h("kup-switch", { checked: component.loaded, label: KupFormEditorLabels.Loaded, "onKup-switch-change": (ev) => {
261
- component.loaded =
262
- ev.detail.value == 'on';
263
- } }))))
264
- : undefined, section.sections
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)
265
230
  ? section.sections.map((childSection) => this.buildSection(childSection, section))
266
231
  : undefined)));
267
232
  }
268
233
  didRenderInteractables() {
269
234
  try {
270
235
  const items = [];
271
- this.rootElement.shadowRoot
272
- .querySelectorAll('.component-draggable')
273
- .forEach((x) => items.push(x));
274
236
  this.rootElement.shadowRoot
275
237
  .querySelectorAll('.section-draggable')
276
238
  .forEach((x) => items.push(x));
@@ -292,7 +254,6 @@ const KupFormEditor = class {
292
254
  items.forEach((item) => {
293
255
  this.kupManager.interact.dropzone(item, null, null, {
294
256
  drop: (ev) => {
295
- ev.currentTarget.appendChild(ev.relatedTarget);
296
257
  this.dropped(ev.currentTarget, ev.relatedTarget);
297
258
  },
298
259
  });
@@ -303,44 +264,51 @@ const KupFormEditor = class {
303
264
  }
304
265
  }
305
266
  dropped(parent, child) {
306
- if (this.dragType == KupFormEditorDragTypes.Components) {
307
- const idx = child.kupData.section.components.indexOf(child.kupData.componnent);
308
- child.kupData.section.components.splice(idx, 1);
309
- parent.kupData.section.components.push(child.kupData.componnent);
310
- child.kupData.section = parent.kupData.section;
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;
311
275
  }
312
- else if (this.dragType == KupFormEditorDragTypes.Sections) {
313
- const idx = child.kupData.parent.sections.indexOf(child.kupData.section);
314
- child.kupData.parent.sections.splice(idx, 1);
315
- if (parent.kupData.form) {
316
- // il nuovo target è la form.
317
- if (!parent.kupData.form.sections)
318
- parent.kupData.form.sections = [];
319
- parent.kupData.form.sections.push(child.kupData.section);
320
- child.kupData.parent = parent.kupData.form;
321
- }
322
- else if (parent.kupData.section) {
323
- // il nuovo target è la section.
324
- if (!parent.kupData.section.sections)
325
- parent.kupData.section.sections = [];
326
- if (parent.kupData.section.components &&
327
- parent.kupData.section.components.length > 0) {
328
- // devo creare una section contenitore e sposare i components
329
- const newSec = {
330
- id: parent.kupData.section.id + '1',
331
- loaded: parent.kupData.section.loaded,
332
- layout: parent.kupData.section.layout,
333
- components: [],
334
- };
335
- parent.kupData.section.components.forEach((x) => newSec.components.push(x));
336
- parent.kupData.section.components.splice(0);
337
- parent.kupData.section.sections.push(newSec);
338
- }
339
- parent.kupData.section.sections.push(child.kupData.section);
340
- child.kupData.parent = parent.kupData.section;
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);
341
287
  }
342
- this.resetData(this.internalData);
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;
343
310
  }
311
+ return bodyStyles;
344
312
  }
345
313
  resetData(form = null) {
346
314
  if (form)
@@ -355,7 +323,6 @@ const KupFormEditor = class {
355
323
  }, 250);
356
324
  }
357
325
  unregisterInteractables() {
358
- this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.component-draggable')));
359
326
  this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.section-dropzone')));
360
327
  this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.section-draggable')));
361
328
  this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll('.form-dropzone')));
@@ -383,6 +350,14 @@ const KupFormEditor = class {
383
350
  }
384
351
  componentDidRender() {
385
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
+ }
386
361
  this.didRenderInteractables();
387
362
  }
388
363
  render() {
@@ -399,6 +374,6 @@ const KupFormEditor = class {
399
374
  "data": ["dataChanged"]
400
375
  }; }
401
376
  };
402
- KupFormEditor.style = kupFormEditorCss;
377
+ KupDashboard.style = kupDashboardCss;
403
378
 
404
- exports.kup_form_editor = KupFormEditor;
379
+ exports.kup_dashboard = KupDashboard;