@sme.up/ketchup 11.0.0-SNAPSHOT-20250514145941 → 11.0.0-SNAPSHOT-20250515132748

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 (184) hide show
  1. package/dist/cjs/{f-cell-b93cfb95.js → f-cell-db3d9348.js} +4 -4
  2. package/dist/cjs/{f-chip-1c1176f8.js → f-chip-f2d6124b.js} +1 -1
  3. package/dist/cjs/{f-object-field-f97ddafb.js → f-object-field-3810f288.js} +2 -2
  4. package/dist/cjs/{f-paginator-utils-01ad22ba.js → f-paginator-utils-3855e84c.js} +1 -1
  5. package/dist/cjs/{f-text-field-53adaa04.js → f-text-field-a34a5979.js} +1 -1
  6. package/dist/cjs/index.cjs.js +1 -1
  7. package/dist/cjs/kup-accordion.cjs.entry.js +1 -1
  8. package/dist/cjs/kup-activity-timeline.cjs.entry.js +2 -2
  9. package/dist/cjs/kup-autocomplete_29.cjs.entry.js +29 -25
  10. package/dist/cjs/kup-box.cjs.entry.js +7 -7
  11. package/dist/cjs/kup-calendar.cjs.entry.js +2 -2
  12. package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
  13. package/dist/cjs/kup-cell.cjs.entry.js +5 -5
  14. package/dist/cjs/kup-dashboard.cjs.entry.js +2 -2
  15. package/dist/cjs/{kup-data-table-helper-1df2d7c3.js → kup-data-table-helper-f53032e7.js} +1 -1
  16. package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
  17. package/dist/cjs/kup-echart.cjs.entry.js +1 -1
  18. package/dist/cjs/kup-editor.cjs.entry.js +1 -1
  19. package/dist/cjs/kup-family-tree.cjs.entry.js +1 -1
  20. package/dist/cjs/kup-grid.cjs.entry.js +1 -1
  21. package/dist/cjs/kup-htm.cjs.entry.js +1 -1
  22. package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
  23. package/dist/cjs/kup-image-list.cjs.entry.js +5 -5
  24. package/dist/cjs/kup-input-panel.cjs.entry.js +5 -5
  25. package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
  26. package/dist/cjs/kup-magic-box.cjs.entry.js +1 -1
  27. package/dist/cjs/{kup-manager-63a17a45.js → kup-manager-c70d3188.js} +1 -1
  28. package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
  29. package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
  30. package/dist/cjs/kup-object-field.cjs.entry.js +3 -3
  31. package/dist/cjs/kup-pdf.cjs.entry.js +1 -1
  32. package/dist/cjs/kup-planner.cjs.entry.js +2 -2
  33. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  34. package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
  35. package/dist/cjs/kup-snackbar.cjs.entry.js +1 -1
  36. package/dist/cjs/kup-txt.cjs.entry.js +1 -1
  37. package/dist/cjs/kup-typography-list.cjs.entry.js +1 -1
  38. package/dist/cjs/kup-typography.cjs.entry.js +1 -1
  39. package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +22 -18
  40. package/dist/components/index.js +1 -1
  41. package/dist/components/kup-accordion.js +2 -2
  42. package/dist/components/kup-activity-timeline.js +2 -2
  43. package/dist/components/kup-autocomplete.js +1 -1
  44. package/dist/components/kup-badge.js +1 -1
  45. package/dist/components/kup-box.js +1 -1
  46. package/dist/components/kup-button-list.js +1 -1
  47. package/dist/components/kup-button.js +1 -1
  48. package/dist/components/kup-calendar.js +2 -2
  49. package/dist/components/kup-card-list.js +3 -3
  50. package/dist/components/kup-card.js +1 -1
  51. package/dist/components/kup-cell.js +2 -2
  52. package/dist/components/kup-chart.js +1 -1
  53. package/dist/components/kup-checkbox.js +1 -1
  54. package/dist/components/kup-chip.js +1 -1
  55. package/dist/components/kup-color-picker.js +1 -1
  56. package/dist/components/kup-combobox.js +1 -1
  57. package/dist/components/kup-dashboard.js +2 -2
  58. package/dist/components/kup-data-table.js +1 -1
  59. package/dist/components/kup-date-picker.js +1 -1
  60. package/dist/components/kup-dialog.js +1 -1
  61. package/dist/components/kup-drawer.js +2 -2
  62. package/dist/components/kup-dropdown-button.js +1 -1
  63. package/dist/components/kup-echart.js +1 -1
  64. package/dist/components/kup-editor.js +1 -1
  65. package/dist/components/kup-family-tree.js +3 -3
  66. package/dist/components/kup-file-upload.js +1 -1
  67. package/dist/components/kup-form.js +1 -1
  68. package/dist/components/kup-gauge.js +1 -1
  69. package/dist/components/kup-grid.js +1 -1
  70. package/dist/components/kup-htm.js +2 -2
  71. package/dist/components/kup-iframe.js +2 -2
  72. package/dist/components/kup-image-list.js +2 -2
  73. package/dist/components/kup-image.js +1 -1
  74. package/dist/components/kup-input-panel.js +3 -3
  75. package/dist/components/kup-lazy.js +2 -2
  76. package/dist/components/kup-list.js +1 -1
  77. package/dist/components/kup-magic-box.js +4 -4
  78. package/dist/components/kup-nav-bar.js +2 -2
  79. package/dist/components/kup-numeric-picker.js +2 -2
  80. package/dist/components/kup-object-field.js +2 -2
  81. package/dist/components/kup-pdf.js +2 -2
  82. package/dist/components/kup-planner.js +2 -2
  83. package/dist/components/kup-probe.js +2 -2
  84. package/dist/components/kup-progress-bar.js +1 -1
  85. package/dist/components/kup-qlik.js +2 -2
  86. package/dist/components/kup-radio.js +1 -1
  87. package/dist/components/kup-rating.js +1 -1
  88. package/dist/components/kup-snackbar.js +2 -2
  89. package/dist/components/kup-spinner.js +1 -1
  90. package/dist/components/kup-switch.js +1 -1
  91. package/dist/components/kup-tab-bar.js +1 -1
  92. package/dist/components/kup-text-field.js +1 -1
  93. package/dist/components/kup-time-picker.js +1 -1
  94. package/dist/components/kup-toolbar.js +1 -1
  95. package/dist/components/kup-tree.js +1 -1
  96. package/dist/components/kup-txt.js +2 -2
  97. package/dist/components/kup-typography-list.js +2 -2
  98. package/dist/components/kup-typography.js +2 -2
  99. package/dist/components/{p-2b66dd7c.js → p-18c88c2d.js} +2 -2
  100. package/dist/components/{p-a73b0c3d.js → p-4b6f3ecc.js} +2 -2
  101. package/dist/components/{p-b874c62b.js → p-734e3bdc.js} +2 -2
  102. package/dist/components/{p-8c561872.js → p-9859e801.js} +1 -1
  103. package/dist/components/{p-6fc7d944.js → p-c600f978.js} +2 -2
  104. package/dist/components/{p-3bcf4a5e.js → p-e472f1de.js} +23 -19
  105. package/dist/esm/{f-cell-c3bd4ec1.js → f-cell-69a81706.js} +4 -4
  106. package/dist/esm/{f-chip-768658e7.js → f-chip-29242e70.js} +1 -1
  107. package/dist/esm/{f-object-field-45c345f8.js → f-object-field-75069ac2.js} +2 -2
  108. package/dist/esm/{f-paginator-utils-74e92127.js → f-paginator-utils-212f93c3.js} +1 -1
  109. package/dist/esm/{f-text-field-37ada494.js → f-text-field-ebe023fb.js} +1 -1
  110. package/dist/esm/index.js +1 -1
  111. package/dist/esm/kup-accordion.entry.js +1 -1
  112. package/dist/esm/kup-activity-timeline.entry.js +2 -2
  113. package/dist/esm/kup-autocomplete_29.entry.js +29 -25
  114. package/dist/esm/kup-box.entry.js +7 -7
  115. package/dist/esm/kup-calendar.entry.js +2 -2
  116. package/dist/esm/kup-card-list.entry.js +1 -1
  117. package/dist/esm/kup-cell.entry.js +5 -5
  118. package/dist/esm/kup-dashboard.entry.js +2 -2
  119. package/dist/esm/{kup-data-table-helper-6624693e.js → kup-data-table-helper-ca11e6e9.js} +1 -1
  120. package/dist/esm/kup-drawer.entry.js +1 -1
  121. package/dist/esm/kup-echart.entry.js +1 -1
  122. package/dist/esm/kup-editor.entry.js +1 -1
  123. package/dist/esm/kup-family-tree.entry.js +1 -1
  124. package/dist/esm/kup-grid.entry.js +1 -1
  125. package/dist/esm/kup-htm.entry.js +1 -1
  126. package/dist/esm/kup-iframe.entry.js +1 -1
  127. package/dist/esm/kup-image-list.entry.js +5 -5
  128. package/dist/esm/kup-input-panel.entry.js +5 -5
  129. package/dist/esm/kup-lazy.entry.js +1 -1
  130. package/dist/esm/kup-magic-box.entry.js +1 -1
  131. package/dist/esm/{kup-manager-8713d1e0.js → kup-manager-63a8048f.js} +1 -1
  132. package/dist/esm/kup-nav-bar.entry.js +1 -1
  133. package/dist/esm/kup-numeric-picker.entry.js +2 -2
  134. package/dist/esm/kup-object-field.entry.js +3 -3
  135. package/dist/esm/kup-pdf.entry.js +1 -1
  136. package/dist/esm/kup-planner.entry.js +2 -2
  137. package/dist/esm/kup-probe.entry.js +1 -1
  138. package/dist/esm/kup-qlik.entry.js +1 -1
  139. package/dist/esm/kup-snackbar.entry.js +1 -1
  140. package/dist/esm/kup-txt.entry.js +1 -1
  141. package/dist/esm/kup-typography-list.entry.js +1 -1
  142. package/dist/esm/kup-typography.entry.js +1 -1
  143. package/dist/ketchup/index.esm.js +1 -1
  144. package/dist/ketchup/ketchup.esm.js +1 -1
  145. package/dist/ketchup/{p-94e03e62.entry.js → p-0a1ef84d.entry.js} +1 -1
  146. package/dist/ketchup/{p-cc4d68aa.entry.js → p-0e1bf720.entry.js} +1 -1
  147. package/dist/ketchup/{p-0238f33b.entry.js → p-0f9ecf6b.entry.js} +1 -1
  148. package/dist/ketchup/{p-bf93f2ae.entry.js → p-14ff2063.entry.js} +1 -1
  149. package/dist/ketchup/p-1adb5568.entry.js +1 -0
  150. package/dist/ketchup/{p-2c0534ce.entry.js → p-1de8f855.entry.js} +1 -1
  151. package/dist/ketchup/{p-b9328ba3.entry.js → p-2bc38560.entry.js} +1 -1
  152. package/dist/ketchup/{p-26164aca.entry.js → p-35499312.entry.js} +2 -2
  153. package/dist/ketchup/{p-943dd1fb.entry.js → p-434f2c39.entry.js} +1 -1
  154. package/dist/ketchup/{p-e3841731.entry.js → p-447af04c.entry.js} +1 -1
  155. package/dist/ketchup/{p-6e71570e.js → p-4cfa35bc.js} +1 -1
  156. package/dist/ketchup/{p-bf1444dd.entry.js → p-52836ef8.entry.js} +1 -1
  157. package/dist/ketchup/{p-95cfcd46.js → p-610faea9.js} +1 -1
  158. package/dist/ketchup/{p-e5a1007f.entry.js → p-64c26e65.entry.js} +1 -1
  159. package/dist/ketchup/{p-22713989.entry.js → p-6c41cd20.entry.js} +1 -1
  160. package/dist/ketchup/{p-a1ed19dc.entry.js → p-6df4360a.entry.js} +1 -1
  161. package/dist/ketchup/{p-ce39445f.js → p-7375d456.js} +1 -1
  162. package/dist/ketchup/{p-5701a481.entry.js → p-75acf076.entry.js} +1 -1
  163. package/dist/ketchup/{p-a9c20bf8.entry.js → p-782b1b2c.entry.js} +1 -1
  164. package/dist/ketchup/{p-77d2021c.js → p-8610d5b5.js} +1 -1
  165. package/dist/ketchup/{p-875c7cf4.entry.js → p-8d266641.entry.js} +1 -1
  166. package/dist/ketchup/{p-7ff1305e.entry.js → p-94e163ca.entry.js} +1 -1
  167. package/dist/ketchup/{p-a6f8a2ca.js → p-9f4714fd.js} +1 -1
  168. package/dist/ketchup/{p-c796f067.entry.js → p-b047a7f8.entry.js} +1 -1
  169. package/dist/ketchup/{p-c007702f.entry.js → p-b90e1175.entry.js} +1 -1
  170. package/dist/ketchup/p-b9f037c6.entry.js +1 -0
  171. package/dist/ketchup/{p-90054c52.entry.js → p-c79cbd98.entry.js} +1 -1
  172. package/dist/ketchup/{p-8182514a.entry.js → p-c8cd012e.entry.js} +1 -1
  173. package/dist/ketchup/{p-91546f98.entry.js → p-cb0dc4c0.entry.js} +1 -1
  174. package/dist/ketchup/{p-1e2647a8.entry.js → p-cd021910.entry.js} +1 -1
  175. package/dist/ketchup/{p-1e583604.entry.js → p-ce4ab2eb.entry.js} +1 -1
  176. package/dist/ketchup/{p-8bc1f2f1.js → p-da694791.js} +1 -1
  177. package/dist/ketchup/{p-75908a1e.js → p-e705eb4a.js} +1 -1
  178. package/dist/ketchup/{p-34ffccb2.entry.js → p-e720bf8f.entry.js} +1 -1
  179. package/dist/ketchup/{p-8d137b6a.entry.js → p-eb7881fc.entry.js} +1 -1
  180. package/dist/ketchup/{p-a269b9df.entry.js → p-f1b21c30.entry.js} +1 -1
  181. package/dist/ketchup/{p-bcf80fcc.entry.js → p-fe42ae2d.entry.js} +1 -1
  182. package/package.json +1 -1
  183. package/dist/ketchup/p-a547c829.entry.js +0 -1
  184. package/dist/ketchup/p-e73c71dc.entry.js +0 -1
@@ -1 +1 @@
1
- import{h as e}from"./p-710d0a7d.js";import{I as l,ay as t,t as a,a as n,b as o}from"./p-77d2021c.js";import{F as i}from"./p-c4224227.js";import{a as s}from"./p-e3062c19.js";var r;!function(e){e.SIMPLE="simple",e.FULL="full"}(r||(r={}));const u=document.documentElement,p=p=>{p.perPage||(p.perPage=1e3),p.perPage>p.max&&(p.perPage=p.max);const m=Math.ceil(p.max/p.perPage),f=function(e,l){const t=[];for(let a=1;a<=l;a++){const l=a==e.currentPage;t.push({id:a.toString(),selected:l,value:a.toString()})}return t}(p,m),b=function(e){const l=[],t=Math.min(e.max,e.maxRowsPerPage);let a=e.perPage;if(0===a)return l;for(;a<t;){const t=a==e.perPage;l.push({id:a.toString(),selected:t,value:a.toString()}),a*=2}const n=t==e.perPage;return l.push({id:t.toString(),selected:n,value:t.toString()}),l}(p),g={"kup-list":{data:f,displayMode:l.CODE},"kup-text-field":{label:u.ketchup.language.translate(t.PAGE),helper:u.ketchup.language.translate(t.TOTAL)+`: ${m}`,helperWhenFocused:!0,inputType:"number",max:m,min:1,size:5}},h={"kup-list":{data:b,displayMode:l.CODE},"kup-text-field":{label:u.ketchup.language.translate(a.ROWS)+" / "+u.ketchup.language.translate(t.PAGE),helper:u.ketchup.language.translate(a.TOTAL)+`: ${p.max}`,helperWhenFocused:!0,inputType:"number",max:p.max,min:1,size:5}};return e("div",Object.assign({class:`f-paginator ${p.mode?p.mode:""} ${p.wrapperClass?p.wrapperClass:""}`},p.dataSet,{id:p.id,title:p.title}),p.onLoadMore?e(i,{icon:"plus",onClick:p.onLoadMore,label:u.ketchup.language.translate(o.LOAD_MORE),sizing:n.SMALL,styling:s.FLAT,wrapperClass:"load-more-button kup-neutral"}):null,e("kup-combobox",{class:"rows-selector",data:h,displayMode:l.CODE,initialValue:p.perPage.toString(),initialValueDecode:p.perPage.toString(),"onkup-combobox-change":p.onRowsChange}),e("kup-combobox",{class:"page-selector",data:g,displayMode:l.CODE,initialValue:p.currentPage.toString(),initialValueDecode:p.currentPage.toString(),"onkup-combobox-change":p.onPageChange}),p.showMaxPages?e("div",{class:"max-page-wrapper"},e("label",{htmlFor:"page-selector"},"/ "+m)):null,e("div",{class:"arrow-wrapper"},p.mode!==r.SIMPLE?e(i,{icon:"chevron_left",disabled:d(p),onClick:p.onPrevPage,sizing:n.SMALL,styling:s.FLAT,wrapperClass:"kup-neutral prev-page"}):null,p.mode!==r.SIMPLE?e(i,{icon:"chevron_right",disabled:c(p),onClick:p.onNextPage,sizing:n.SMALL,styling:s.FLAT,wrapperClass:"kup-neutral next-page"}):null))};function c(e){return e.currentPage*e.perPage>=e.max}function d(e){return 1==e.currentPage}const m=document.documentElement;function f(e,l,t){if(m.ketchup.math.isNumber(e)){const a=Math.ceil(l/t);let n=e;return n>a&&(n=a),n<1&&(n=1),n}return null}function b(e,l){if(m.ketchup.math.isNumber(e)){let t=e;return t>l&&(t=l),t<1&&(t=1),t}return null}export{p as F,f as p,b as r}
1
+ import{h as e}from"./p-710d0a7d.js";import{I as l,ay as t,t as a,a as n,b as o}from"./p-8610d5b5.js";import{F as i}from"./p-c4224227.js";import{a as s}from"./p-e3062c19.js";var r;!function(e){e.SIMPLE="simple",e.FULL="full"}(r||(r={}));const u=document.documentElement,p=p=>{p.perPage||(p.perPage=1e3),p.perPage>p.max&&(p.perPage=p.max);const m=Math.ceil(p.max/p.perPage),f=function(e,l){const t=[];for(let a=1;a<=l;a++){const l=a==e.currentPage;t.push({id:a.toString(),selected:l,value:a.toString()})}return t}(p,m),b=function(e){const l=[],t=Math.min(e.max,e.maxRowsPerPage);let a=e.perPage;if(0===a)return l;for(;a<t;){const t=a==e.perPage;l.push({id:a.toString(),selected:t,value:a.toString()}),a*=2}const n=t==e.perPage;return l.push({id:t.toString(),selected:n,value:t.toString()}),l}(p),g={"kup-list":{data:f,displayMode:l.CODE},"kup-text-field":{label:u.ketchup.language.translate(t.PAGE),helper:u.ketchup.language.translate(t.TOTAL)+`: ${m}`,helperWhenFocused:!0,inputType:"number",max:m,min:1,size:5}},h={"kup-list":{data:b,displayMode:l.CODE},"kup-text-field":{label:u.ketchup.language.translate(a.ROWS)+" / "+u.ketchup.language.translate(t.PAGE),helper:u.ketchup.language.translate(a.TOTAL)+`: ${p.max}`,helperWhenFocused:!0,inputType:"number",max:p.max,min:1,size:5}};return e("div",Object.assign({class:`f-paginator ${p.mode?p.mode:""} ${p.wrapperClass?p.wrapperClass:""}`},p.dataSet,{id:p.id,title:p.title}),p.onLoadMore?e(i,{icon:"plus",onClick:p.onLoadMore,label:u.ketchup.language.translate(o.LOAD_MORE),sizing:n.SMALL,styling:s.FLAT,wrapperClass:"load-more-button kup-neutral"}):null,e("kup-combobox",{class:"rows-selector",data:h,displayMode:l.CODE,initialValue:p.perPage.toString(),initialValueDecode:p.perPage.toString(),"onkup-combobox-change":p.onRowsChange}),e("kup-combobox",{class:"page-selector",data:g,displayMode:l.CODE,initialValue:p.currentPage.toString(),initialValueDecode:p.currentPage.toString(),"onkup-combobox-change":p.onPageChange}),p.showMaxPages?e("div",{class:"max-page-wrapper"},e("label",{htmlFor:"page-selector"},"/ "+m)):null,e("div",{class:"arrow-wrapper"},p.mode!==r.SIMPLE?e(i,{icon:"chevron_left",disabled:d(p),onClick:p.onPrevPage,sizing:n.SMALL,styling:s.FLAT,wrapperClass:"kup-neutral prev-page"}):null,p.mode!==r.SIMPLE?e(i,{icon:"chevron_right",disabled:c(p),onClick:p.onNextPage,sizing:n.SMALL,styling:s.FLAT,wrapperClass:"kup-neutral next-page"}):null))};function c(e){return e.currentPage*e.perPage>=e.max}function d(e){return 1==e.currentPage}const m=document.documentElement;function f(e,l,t){if(m.ketchup.math.isNumber(e)){const a=Math.ceil(l/t);let n=e;return n>a&&(n=a),n<1&&(n=1),n}return null}function b(e,l){if(m.ketchup.math.isNumber(e)){let t=e;return t>l&&(t=l),t<1&&(t=1),t}return null}export{p as F,f as p,b as r}
@@ -1 +1 @@
1
- import{r as t,c as i,f as e,h as n,F as a,H as o,d as f}from"./p-710d0a7d.js";import{k as p,g as s,s as h,b as r}from"./p-77d2021c.js";import{c as l}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var m;!function(t){t.data="Data of the component containing url or html"}(m||(m={}));var c,g,d,u=function(t,i,e,n){if("a"===e&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!n:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?n:"a"===e?n.call(t):n?n.value:i.get(t)};const k=class{constructor(e){t(this,e),this.kupReady=i(this,"kup-htm-ready",6),c.add(this),g.set(this,p()),this.data=void 0}async getProps(t){return s(this,m,t)}async refresh(){e(this)}async setProps(t){h(this,m,t)}componentWillLoad(){u(this,g,"f").debug.logLoad(this,!1),u(this,g,"f").theme.register(this),u(this,g,"f").language.register(this)}componentDidLoad(){this.kupReady.emit({comp:this,id:this.rootElement.id}),u(this,g,"f").debug.logLoad(this,!0)}componentWillRender(){u(this,g,"f").debug.logRender(this,!1)}componentDidRender(){u(this,g,"f").debug.logRender(this,!0)}render(){var t;const i=u(this,c,"m",d).call(this,null===(t=null==this?void 0:this.data)||void 0===t?void 0:t.obj);return n(o,{key:"128d8986f162aa072d5b81db7f3f070115b19fa0"},n("style",{key:"aa84ccbba625c205995fddf63dd0af6da98c1fc5"},u(this,g,"f").theme.setKupStyle(this.rootElement)),n("div",{key:"800b7ab6281db49fefe696b606eef763c7314d4d",id:l},n("div",{key:"56e9a84d1ad20f5717d5192f1181e131208757e3",class:"kup-htm "+(i?"is-link":"")},i?n(a,null,n("a",{href:this.data.value,target:"_blank",rel:"noopener noreferrer"},u(this,g,"f").language.translate(r.OPEN_IN_NEW_TAB)),n("iframe",{src:this.data.value,frameBorder:"0"})):n("div",{innerHTML:this.data.value}))))}disconnectedCallback(){u(this,g,"f").theme.unregister(this),u(this,g,"f").language.unregister(this)}get rootElement(){return f(this)}};g=new WeakMap,c=new WeakSet,d=function(t){return u(this,g,"f").objects.isLink(t)||u(this,g,"f").objects.isJ1Pathfile(t)},k.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{height:100%;width:100%;display:block}#kup-component{height:100%}#kup-component .kup-htm.is-link{height:100%}#kup-component .kup-htm.is-link a{float:left}#kup-component .kup-htm.is-link iframe{min-height:600px;width:100%}";export{k as kup_htm}
1
+ import{r as t,c as i,f as e,h as n,F as a,H as o,d as f}from"./p-710d0a7d.js";import{k as p,g as s,s as h,b as r}from"./p-8610d5b5.js";import{c as l}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var m;!function(t){t.data="Data of the component containing url or html"}(m||(m={}));var c,g,d,u=function(t,i,e,n){if("a"===e&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!n:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?n:"a"===e?n.call(t):n?n.value:i.get(t)};const k=class{constructor(e){t(this,e),this.kupReady=i(this,"kup-htm-ready",6),c.add(this),g.set(this,p()),this.data=void 0}async getProps(t){return s(this,m,t)}async refresh(){e(this)}async setProps(t){h(this,m,t)}componentWillLoad(){u(this,g,"f").debug.logLoad(this,!1),u(this,g,"f").theme.register(this),u(this,g,"f").language.register(this)}componentDidLoad(){this.kupReady.emit({comp:this,id:this.rootElement.id}),u(this,g,"f").debug.logLoad(this,!0)}componentWillRender(){u(this,g,"f").debug.logRender(this,!1)}componentDidRender(){u(this,g,"f").debug.logRender(this,!0)}render(){var t;const i=u(this,c,"m",d).call(this,null===(t=null==this?void 0:this.data)||void 0===t?void 0:t.obj);return n(o,{key:"128d8986f162aa072d5b81db7f3f070115b19fa0"},n("style",{key:"aa84ccbba625c205995fddf63dd0af6da98c1fc5"},u(this,g,"f").theme.setKupStyle(this.rootElement)),n("div",{key:"800b7ab6281db49fefe696b606eef763c7314d4d",id:l},n("div",{key:"56e9a84d1ad20f5717d5192f1181e131208757e3",class:"kup-htm "+(i?"is-link":"")},i?n(a,null,n("a",{href:this.data.value,target:"_blank",rel:"noopener noreferrer"},u(this,g,"f").language.translate(r.OPEN_IN_NEW_TAB)),n("iframe",{src:this.data.value,frameBorder:"0"})):n("div",{innerHTML:this.data.value}))))}disconnectedCallback(){u(this,g,"f").theme.unregister(this),u(this,g,"f").language.unregister(this)}get rootElement(){return f(this)}};g=new WeakMap,c=new WeakSet,d=function(t){return u(this,g,"f").objects.isLink(t)||u(this,g,"f").objects.isJ1Pathfile(t)},k.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{height:100%;width:100%;display:block}#kup-component{height:100%}#kup-component .kup-htm.is-link{height:100%}#kup-component .kup-htm.is-link a{float:left}#kup-component .kup-htm.is-link iframe{min-height:600px;width:100%}";export{k as kup_htm}
@@ -1 +1 @@
1
- import{E as e,H as t,D as n,ah as l,x as o,z as r,ai as i,aj as s,N as a,O as u,F as c,ak as f,al as h,am as d,an as b,ao as m,a7 as p}from"./p-77d2021c.js";import{K as v}from"./p-1ee561ba.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,n){let l="";if(null==e)return l;let o=e[t];return null==o||(l=n?o.textFieldTmp:o.textField),l}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,n){if(!t)return!1;let l=this._getTextFilterValue(e,t.name,n);if(null!=l&&""!=l.trim())return!0;let o=this.getCheckBoxFilterValues(e,t.name);return!(null==o||o.length<1)}getCheckBoxFilterValues(e={},t){let n=[];if(null==e)return n;let l=e[t];return null==l||null==l.checkBoxes||(n=l.checkBoxes),n}addCheckboxFilter(t={},n,l){if(null==t)return;let o=t[n];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},t[n]=o),null==o.checkBoxes&&(o.checkBoxes=[]),null==l||null==l.value?o.checkBoxes=[]:e.valuesArrayContainsValue(o.checkBoxes,l.value)||(o.checkBoxes[o.checkBoxes.length]=l)}removeCheckboxFilter(e={},t,n){var l;if(!e||null==n||!e[t])return;const o=e[t];o.checkBoxes=null!==(l=o.checkBoxes)&&void 0!==l?l:[],o.checkBoxes=o.checkBoxes.filter((e=>e.value!==n)),0===o.checkBoxes.length&&delete e[t]}isColumnNumeric(e){return this.isObjNumeric(e.obj)}setTextFieldFilterValue(e={},t,n){this._setTextFieldFilterValue(e,t,n,!0)}_setTextFieldFilterValue(e={},t,n,l){if(null==e)return;let o=e[t];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},e[t]=o),l?o.textFieldTmp=null!=n?n.trim():n:o.textField=null!=n?n.trim():n}saveTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValueTmp(e,t),!1)}resetTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValue(e,t),!0)}getFilterValueForTooltip(e={},l){let o=this.getTextFilterValue(e,l.name),r=this.getCheckBoxFilterValues(e,l.name),i="",s=t(o,l.obj,l.decimals);""!=o&&(i=" AND "),i="";let a="";return r.forEach((e=>{a+=i+n(e,l),i=" OR "})),""!=a&&(a="("+a+")",""!=s&&(a=" AND "+a)),a=s+a,a}removeFilter(e={},t){delete e[t]}}var F;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.removableColumns="Sets the possibility to remove the selected column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(F||(F={}));const x="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const j=document.documentElement,k=j.ketchup?j.ketchup.objects:new r,O=j.ketchup?j.ketchup.data:new i;class y extends e{isFilterCompliantForCell(e,t,n){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,n)}isFilterCompliantForCellObj(e,t,n){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,n)}isRowCompliant(e,t={},n="",l=!1,o=[],r,i){return this.areCellsCompliant(e.cells,t,n,l,o,r,i)}areCellsCompliant(e,t={},n="",r=!1,i=[],s,a){if(r){let t=!0;if(i&&null!=i&&i.length>0){t=!1;let o=this.filterIsNegative(n);for(let s=0;s<i.length;s++){if(!1===i[s].visible&&!a||(null==a?void 0:a.length)>0&&!a.includes(i[s].name))continue;const u=e[i[s].name];if(null==u)continue;t=this.isFilterCompliantForValue(u.value,n,r);let c=l(i[s],u);if(c!=u.value&&(t=t||this.isFilterCompliantForValue(c,n,r)),1==t&&!o)break;if(0==t&&o)break}}if(!t)return!1}return null==s&&(s=new w),!this.hasFilters(t,i,s)||Object.keys(t).every((n=>{const l=e[n],r=o(i,n);if(!l)return!1;let a=s.getTextFilterValue(t,n),u=s.getCheckBoxFilterValues(t,n);const c=this.filterIsNegative(a);let f=""!==a&&this.isFilterCompliantForCell(l,a,!0)||u.some((e=>this.isFilterCompliantForCell(l,e.value)))||u.some((e=>this.isFilterCompliantForCell(l,e.displayedValue)))||!s.hasFiltersForColumn(t,r),h=c;return k.isNumber(l.obj)||k.isDate(l.obj)||k.isTime(l.obj)||k.isTimestamp(l.obj)||(h=""!==a&&this.isFilterCompliantForCellObj(l,a,!0)||u.some((e=>this.isFilterCompliantForCellObj(l,e.value)))||!s.hasFiltersForColumn(t,r)),c?f&&h:f||h}))}hasFilters(e={},t,n){if(null==e)return!1;let l=Object.keys(e);if(null==l||l.length<1)return!1;null==n&&(n=new w);for(let r=0;r<l.length;r++){let i=l[r],s=null;if(s=i===x?{name:x,title:""}:o(t,i),n.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},n="",l=[],o,r){if(!e||null==e)return[];let i=[];const s=!(!n||!l);if(this.hasFilters(t,l,o)||s)for(let a=0;a<e.length;a++){let u=e[a];(u.id&&u.id.indexOf("insert_")>-1||this.isRowCompliant(u,t,n,s,l,o,r))&&(i[i.length]=u)}else i=[...e];return i}getColumnValues(n,l,o,r){let i=new Array;null==r&&(r=new w);let s=r.getTextFilterValueTmp(n.filters,l.name),a=r.getCheckBoxFilterValues(n.filters,l.name);if(null!=l.valuesForFilter&&l.valuesForFilter.length>0)return l.valuesForFilter.forEach((n=>{let o=n;(e.valuesArrayContainsValue(a,o)||""==s||r.isFilterCompliantForSimpleValue(o,l.obj,s))&&i.push({value:o,displayedValue:t(o,l.obj,l.decimals)})})),i;let u=Object.assign({},n.filters);u[l.name]={textField:s,textFieldTmp:s,checkBoxes:[]};let c=this.filterRows(n.getRows(),u,o,n.getVisibleColumns(),r);for(let e=0;e<a.length;e++)i.push(a[e]);return O.cell.getUnivocalValue({rows:c},l,!0)}}const T=document.documentElement;function C(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const n=e[0].group.column;let l=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let n of t)if(n.column===e)return n;return null}(n,t);return l||(l={column:n,sortMode:p.A}),e.sort(((e,t)=>s({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},l.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const n=t.length>1;return e.slice(0).sort(((e,l)=>{if(n){for(let n=0;n<t.length;n++){const o=V(e,l,t[n]);if(0!==o)return o}return 0}return V(e,l,t[0])}))}function V(e,t,n){const l=e.cells[n.column],o=t.cells[n.column];return l||o?l?o?s(l,o,n.sortMode):-1:1:0}function M(e=[],t={},n="",l=[],o,r,i){return null==r&&(r=new y),r.filterRows(e,t,n,l,o,i)}function N(e=[],t=[],n=[],r={}){if(!t)return[];if(!n||0===n.length||!e||0===e.length)return t;const i={},s=n.filter((({column:t})=>{for(let{name:n,title:l}of e)if(n===t)return i[n]=l,!0;return!1}));if(0===s.length)return t;const u=[];let c={};return t.forEach((t=>{const n=s[0].column,f=t.cells[n];if(f){const h=o(e,n),d=l(h,f),b=f.value;let m=null;for(let e of u)if(e.group.label===d){m=e;break}null===m&&(m={group:{id:b,parent:null,column:n,columnLabel:i[n],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},u.push(m));for(let n=1;n<s.length;n++){const r=s[n],a=t.cells[r.column];if(a){const t=o(e,r.column),n=l(t,a),s=a.value;let u=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===n){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:r.column,columnLabel:i[r.column],children:[],expanded:!1,label:n,totals:{},obj:a.obj}},L(u),m.group.children.push(u)),m=u}}m.group.children.push(t),function(e,t,n,l){if(!e||!t)return;const o=Object.keys(t);0!==o.length&&o.forEach((o=>{const r=n.cells[o];if(r){const n=T.ketchup.objects.isNumber(r.obj),i=t[o];switch(i){case a.COUNT:let t=e.group.totals[o]||0;e.group.totals[o]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[o]||0;s.group.totals[o]=++e,s=s.group.parent}break;case a.DISTINCT:let u;if(u=n?T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value)):r.value,l[e.group.id]){let t=l[e.group.id][o];t?t.push(u):(l[e.group.id][o]=[],l[e.group.id][o].push(u))}else l[e.group.id]={},l[e.group.id][o]=[],l[e.group.id][o].push(u);let c=e.group.parent;for(;null!=c;){if(l[c.group.id]){let e=l[c.group.id][o];e?e.push(u):(l[c.group.id][o]=[],l[c.group.id][o].push(u))}else l[c.group.id]={},l[c.group.id][o]=[],l[c.group.id][o].push(u);c=c.group.parent}break;case a.SUM:case a.AVERAGE:if(n&&r.value){const t=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t+(e.group.totals[o]||0);let n=e.group.parent;for(;null!=n;){const e=T.ketchup.math.numberify(n.group.totals[o]||0);n.group.totals[o]=t+e,n=n.group.parent}}break;case a.MIN:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.min(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.min(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;case a.MAX:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.max(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.max(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;default:0!=i.indexOf(a.MATH)&&console.warn(`invalid total mode: ${i}`)}}}))}(m,r,t,c)}})),function(e,t,n){if(!e||!t)return;const l=Object.keys(t);if(0===e.length||!e[0].group||0===l.length)return;let o=l.filter((e=>a.DISTINCT===t[e]));o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>D(e,o,n)))}(u,r,c),W(u,a.AVERAGE,r),W(u,a.MATH,r),u}function W(e,t,n){if(!e||!n)return;const l=Object.keys(n);if(0===e.length||!e[0].group||0===l.length)return;let o;t==a.AVERAGE&&(o=l.filter((e=>a.AVERAGE===n[e]))),t==a.MATH&&(o=l.filter((e=>0==n[e].indexOf(a.MATH)))),o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>E(e,t,o,n)))}function D(e,t,n){const l=e.group.children;0!==l.length&&(l[0].group&&l.forEach((e=>{D(e,t,n)})),t.forEach((t=>{e.group.totals[t]=new Set(n[e.group.id][t]).size})))}function E(e,t,n,l){const o=e.group.children;if(0===o.length)return 0;let r=0;return o[0].group?o.forEach((e=>{r+=E(e,t,n,l)})):r=o.length,n.forEach((n=>{if(t==a.AVERAGE&&(e.group.totals[n]=e.group.totals[n]/r),t==a.MATH){let t=l[n].substring(a.MATH.length);e.group.totals[n]=T.ketchup.math.formulas.custom(t,e.group.totals)}})),r}function A(e,t){if(t){const n=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const n=t.cells[e.name];n&&e.obj&&!n.obj&&(n.obj={t:e.obj.t,p:e.obj.p,k:n.value})}}))})),n}}function B(e,t,n){if(T.ketchup.objects.isEmptyJsObject(n)||T.ketchup.objects.isEmptyJsObject(e))return{};const l={},o=[],r=t.reduce(((t,r)=>{if(!e[r.name])return t;const i=e[r.name];return i===a.COUNT?(l[r.name]=n.length.toString(),t):0===i.indexOf(a.MATH)?(o.push([r.name,i]),t):(t.push({totalOperation:i,totalColumn:r,columnValues:n.map((e=>e.cells[r.name].value))}),t)}),[]);return r||o?(null==r||r.forEach((({totalOperation:e,totalColumn:t,columnValues:o})=>{if(T.ketchup.objects.isNumber(t.obj)){if(e===a.SUM)return void(l[t.name]=o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0).toString());if(e===a.AVERAGE)return void(l[t.name]=(o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0)/n.length).toString());if(e===a.MIN)return void(l[t.name]=Math.min(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString());if(e===a.MAX)return void(l[t.name]=Math.max(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString())}if(T.ketchup.objects.isDate(t.obj)){const n=o.filter((e=>T.ketchup.dates.isIsoDate(e))).map((e=>T.ketchup.dates.toDate(e,v.ISO_DATE)));if(!n)return;if(e===a.MIN)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE));if(e===a.MAX)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE))}e===a.DISTINCT&&(l[t.name]=new Set(o).size.toString())})),null==o||o.forEach((([e,t])=>{const n=null==t?void 0:t.replace(u(a.MATH,"g"),"");l[e]=T.ketchup.math.formulas.custom(n,function(e){var t;return Object.fromEntries(null===(t=Object.entries(e))||void 0===t?void 0:t.reduce(((e,[t,n])=>(T.ketchup.math.isNumber(n)&&e.push([t,Number(n)]),e)),[]))}(l)).toString()})),l):l}function L(e){if(!e.group)return;let t=e.group.id,n=e.group.parent;for(;null!==n;)t=`${n.group.id};${t}`,n=n.group.parent;e.group.id=t}function S(e,t,n,l){const o=t*n-n,r=o+Number(n);if(0==l)return e.slice(o,r);let i=[];return _(e,i,o,Number(n),0),i}function _(e,t,n,l,o){let r=!1;for(let i=0;i<e.length;i++){let s=e[i],a=R(e[i]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=_(s.group.children,a.group.children,n,l,o);o=e.ci,r=e.added,1==r&&(t[t.length]=a)}else o>=n&&(t[t.length]=a,r=!0),o++;if(o>=n+l)break}return{ci:o,added:r}}function R(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:I(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function z(e){if(null==e)return null;let t=[];for(let n=0;n<e.length;n++)t[t.length]=R(e[n]);return t}function I(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:z(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function $(e,t,n=!1){const l={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const o of t.rows){const t={cells:{},id:o.id};for(const n of l.columns){const l=n.name,r=o.cells[l],i=e.rows.find((e=>e.id===o.id)),s=i?i.cells[l]:null;(!s&&r.value||s&&r.value!==s.value)&&(t.cells[l]=r)}(Object.keys(t.cells).length>0||n)&&l.rows.push(t)}return l}function q(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var n;let l=e.cells[t];const o=l.value,r=l.decode,i=l.options;l.isEditable=null!==(n=l.isEditable)&&void 0!==n?n:l.editable;const s={[c.AUTOCOMPLETE]:()=>f(o,"",i),[c.COMBOBOX]:()=>f(o,"",i),[c.RADIO]:()=>h(o,i),[c.CHECKBOX]:()=>d(o,""),[c.CHIP]:()=>b(o,r),[c.SWITCH]:()=>m(o,""),[c.MULTI_AUTOCOMPLETE]:()=>b(o,r),[c.MULTI_COMBOBOX]:()=>b(o,r)}[l.shape];s&&(l.data=Object.assign(Object.assign({},s()),l.data))}))}))}export{w as F,g as K,y as a,N as b,B as c,q as d,F as e,M as f,$ as g,A as n,S as p,C as s,x as t}
1
+ import{E as e,H as t,D as n,ah as l,x as o,z as r,ai as i,aj as s,N as a,O as u,F as c,ak as f,al as h,am as d,an as b,ao as m,a7 as p}from"./p-8610d5b5.js";import{K as v}from"./p-1ee561ba.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,n){let l="";if(null==e)return l;let o=e[t];return null==o||(l=n?o.textFieldTmp:o.textField),l}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,n){if(!t)return!1;let l=this._getTextFilterValue(e,t.name,n);if(null!=l&&""!=l.trim())return!0;let o=this.getCheckBoxFilterValues(e,t.name);return!(null==o||o.length<1)}getCheckBoxFilterValues(e={},t){let n=[];if(null==e)return n;let l=e[t];return null==l||null==l.checkBoxes||(n=l.checkBoxes),n}addCheckboxFilter(t={},n,l){if(null==t)return;let o=t[n];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},t[n]=o),null==o.checkBoxes&&(o.checkBoxes=[]),null==l||null==l.value?o.checkBoxes=[]:e.valuesArrayContainsValue(o.checkBoxes,l.value)||(o.checkBoxes[o.checkBoxes.length]=l)}removeCheckboxFilter(e={},t,n){var l;if(!e||null==n||!e[t])return;const o=e[t];o.checkBoxes=null!==(l=o.checkBoxes)&&void 0!==l?l:[],o.checkBoxes=o.checkBoxes.filter((e=>e.value!==n)),0===o.checkBoxes.length&&delete e[t]}isColumnNumeric(e){return this.isObjNumeric(e.obj)}setTextFieldFilterValue(e={},t,n){this._setTextFieldFilterValue(e,t,n,!0)}_setTextFieldFilterValue(e={},t,n,l){if(null==e)return;let o=e[t];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},e[t]=o),l?o.textFieldTmp=null!=n?n.trim():n:o.textField=null!=n?n.trim():n}saveTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValueTmp(e,t),!1)}resetTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValue(e,t),!0)}getFilterValueForTooltip(e={},l){let o=this.getTextFilterValue(e,l.name),r=this.getCheckBoxFilterValues(e,l.name),i="",s=t(o,l.obj,l.decimals);""!=o&&(i=" AND "),i="";let a="";return r.forEach((e=>{a+=i+n(e,l),i=" OR "})),""!=a&&(a="("+a+")",""!=s&&(a=" AND "+a)),a=s+a,a}removeFilter(e={},t){delete e[t]}}var F;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.removableColumns="Sets the possibility to remove the selected column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(F||(F={}));const x="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const j=document.documentElement,k=j.ketchup?j.ketchup.objects:new r,O=j.ketchup?j.ketchup.data:new i;class y extends e{isFilterCompliantForCell(e,t,n){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,n)}isFilterCompliantForCellObj(e,t,n){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,n)}isRowCompliant(e,t={},n="",l=!1,o=[],r,i){return this.areCellsCompliant(e.cells,t,n,l,o,r,i)}areCellsCompliant(e,t={},n="",r=!1,i=[],s,a){if(r){let t=!0;if(i&&null!=i&&i.length>0){t=!1;let o=this.filterIsNegative(n);for(let s=0;s<i.length;s++){if(!1===i[s].visible&&!a||(null==a?void 0:a.length)>0&&!a.includes(i[s].name))continue;const u=e[i[s].name];if(null==u)continue;t=this.isFilterCompliantForValue(u.value,n,r);let c=l(i[s],u);if(c!=u.value&&(t=t||this.isFilterCompliantForValue(c,n,r)),1==t&&!o)break;if(0==t&&o)break}}if(!t)return!1}return null==s&&(s=new w),!this.hasFilters(t,i,s)||Object.keys(t).every((n=>{const l=e[n],r=o(i,n);if(!l)return!1;let a=s.getTextFilterValue(t,n),u=s.getCheckBoxFilterValues(t,n);const c=this.filterIsNegative(a);let f=""!==a&&this.isFilterCompliantForCell(l,a,!0)||u.some((e=>this.isFilterCompliantForCell(l,e.value)))||u.some((e=>this.isFilterCompliantForCell(l,e.displayedValue)))||!s.hasFiltersForColumn(t,r),h=c;return k.isNumber(l.obj)||k.isDate(l.obj)||k.isTime(l.obj)||k.isTimestamp(l.obj)||(h=""!==a&&this.isFilterCompliantForCellObj(l,a,!0)||u.some((e=>this.isFilterCompliantForCellObj(l,e.value)))||!s.hasFiltersForColumn(t,r)),c?f&&h:f||h}))}hasFilters(e={},t,n){if(null==e)return!1;let l=Object.keys(e);if(null==l||l.length<1)return!1;null==n&&(n=new w);for(let r=0;r<l.length;r++){let i=l[r],s=null;if(s=i===x?{name:x,title:""}:o(t,i),n.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},n="",l=[],o,r){if(!e||null==e)return[];let i=[];const s=!(!n||!l);if(this.hasFilters(t,l,o)||s)for(let a=0;a<e.length;a++){let u=e[a];(u.id&&u.id.indexOf("insert_")>-1||this.isRowCompliant(u,t,n,s,l,o,r))&&(i[i.length]=u)}else i=[...e];return i}getColumnValues(n,l,o,r){let i=new Array;null==r&&(r=new w);let s=r.getTextFilterValueTmp(n.filters,l.name),a=r.getCheckBoxFilterValues(n.filters,l.name);if(null!=l.valuesForFilter&&l.valuesForFilter.length>0)return l.valuesForFilter.forEach((n=>{let o=n;(e.valuesArrayContainsValue(a,o)||""==s||r.isFilterCompliantForSimpleValue(o,l.obj,s))&&i.push({value:o,displayedValue:t(o,l.obj,l.decimals)})})),i;let u=Object.assign({},n.filters);u[l.name]={textField:s,textFieldTmp:s,checkBoxes:[]};let c=this.filterRows(n.getRows(),u,o,n.getVisibleColumns(),r);for(let e=0;e<a.length;e++)i.push(a[e]);return O.cell.getUnivocalValue({rows:c},l,!0)}}const T=document.documentElement;function C(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const n=e[0].group.column;let l=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let n of t)if(n.column===e)return n;return null}(n,t);return l||(l={column:n,sortMode:p.A}),e.sort(((e,t)=>s({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},l.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const n=t.length>1;return e.slice(0).sort(((e,l)=>{if(n){for(let n=0;n<t.length;n++){const o=V(e,l,t[n]);if(0!==o)return o}return 0}return V(e,l,t[0])}))}function V(e,t,n){const l=e.cells[n.column],o=t.cells[n.column];return l||o?l?o?s(l,o,n.sortMode):-1:1:0}function M(e=[],t={},n="",l=[],o,r,i){return null==r&&(r=new y),r.filterRows(e,t,n,l,o,i)}function N(e=[],t=[],n=[],r={}){if(!t)return[];if(!n||0===n.length||!e||0===e.length)return t;const i={},s=n.filter((({column:t})=>{for(let{name:n,title:l}of e)if(n===t)return i[n]=l,!0;return!1}));if(0===s.length)return t;const u=[];let c={};return t.forEach((t=>{const n=s[0].column,f=t.cells[n];if(f){const h=o(e,n),d=l(h,f),b=f.value;let m=null;for(let e of u)if(e.group.label===d){m=e;break}null===m&&(m={group:{id:b,parent:null,column:n,columnLabel:i[n],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},u.push(m));for(let n=1;n<s.length;n++){const r=s[n],a=t.cells[r.column];if(a){const t=o(e,r.column),n=l(t,a),s=a.value;let u=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===n){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:r.column,columnLabel:i[r.column],children:[],expanded:!1,label:n,totals:{},obj:a.obj}},L(u),m.group.children.push(u)),m=u}}m.group.children.push(t),function(e,t,n,l){if(!e||!t)return;const o=Object.keys(t);0!==o.length&&o.forEach((o=>{const r=n.cells[o];if(r){const n=T.ketchup.objects.isNumber(r.obj),i=t[o];switch(i){case a.COUNT:let t=e.group.totals[o]||0;e.group.totals[o]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[o]||0;s.group.totals[o]=++e,s=s.group.parent}break;case a.DISTINCT:let u;if(u=n?T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value)):r.value,l[e.group.id]){let t=l[e.group.id][o];t?t.push(u):(l[e.group.id][o]=[],l[e.group.id][o].push(u))}else l[e.group.id]={},l[e.group.id][o]=[],l[e.group.id][o].push(u);let c=e.group.parent;for(;null!=c;){if(l[c.group.id]){let e=l[c.group.id][o];e?e.push(u):(l[c.group.id][o]=[],l[c.group.id][o].push(u))}else l[c.group.id]={},l[c.group.id][o]=[],l[c.group.id][o].push(u);c=c.group.parent}break;case a.SUM:case a.AVERAGE:if(n&&r.value){const t=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t+(e.group.totals[o]||0);let n=e.group.parent;for(;null!=n;){const e=T.ketchup.math.numberify(n.group.totals[o]||0);n.group.totals[o]=t+e,n=n.group.parent}}break;case a.MIN:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.min(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.min(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;case a.MAX:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.max(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.max(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;default:0!=i.indexOf(a.MATH)&&console.warn(`invalid total mode: ${i}`)}}}))}(m,r,t,c)}})),function(e,t,n){if(!e||!t)return;const l=Object.keys(t);if(0===e.length||!e[0].group||0===l.length)return;let o=l.filter((e=>a.DISTINCT===t[e]));o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>D(e,o,n)))}(u,r,c),W(u,a.AVERAGE,r),W(u,a.MATH,r),u}function W(e,t,n){if(!e||!n)return;const l=Object.keys(n);if(0===e.length||!e[0].group||0===l.length)return;let o;t==a.AVERAGE&&(o=l.filter((e=>a.AVERAGE===n[e]))),t==a.MATH&&(o=l.filter((e=>0==n[e].indexOf(a.MATH)))),o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>E(e,t,o,n)))}function D(e,t,n){const l=e.group.children;0!==l.length&&(l[0].group&&l.forEach((e=>{D(e,t,n)})),t.forEach((t=>{e.group.totals[t]=new Set(n[e.group.id][t]).size})))}function E(e,t,n,l){const o=e.group.children;if(0===o.length)return 0;let r=0;return o[0].group?o.forEach((e=>{r+=E(e,t,n,l)})):r=o.length,n.forEach((n=>{if(t==a.AVERAGE&&(e.group.totals[n]=e.group.totals[n]/r),t==a.MATH){let t=l[n].substring(a.MATH.length);e.group.totals[n]=T.ketchup.math.formulas.custom(t,e.group.totals)}})),r}function A(e,t){if(t){const n=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const n=t.cells[e.name];n&&e.obj&&!n.obj&&(n.obj={t:e.obj.t,p:e.obj.p,k:n.value})}}))})),n}}function B(e,t,n){if(T.ketchup.objects.isEmptyJsObject(n)||T.ketchup.objects.isEmptyJsObject(e))return{};const l={},o=[],r=t.reduce(((t,r)=>{if(!e[r.name])return t;const i=e[r.name];return i===a.COUNT?(l[r.name]=n.length.toString(),t):0===i.indexOf(a.MATH)?(o.push([r.name,i]),t):(t.push({totalOperation:i,totalColumn:r,columnValues:n.map((e=>e.cells[r.name].value))}),t)}),[]);return r||o?(null==r||r.forEach((({totalOperation:e,totalColumn:t,columnValues:o})=>{if(T.ketchup.objects.isNumber(t.obj)){if(e===a.SUM)return void(l[t.name]=o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0).toString());if(e===a.AVERAGE)return void(l[t.name]=(o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0)/n.length).toString());if(e===a.MIN)return void(l[t.name]=Math.min(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString());if(e===a.MAX)return void(l[t.name]=Math.max(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString())}if(T.ketchup.objects.isDate(t.obj)){const n=o.filter((e=>T.ketchup.dates.isIsoDate(e))).map((e=>T.ketchup.dates.toDate(e,v.ISO_DATE)));if(!n)return;if(e===a.MIN)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE));if(e===a.MAX)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE))}e===a.DISTINCT&&(l[t.name]=new Set(o).size.toString())})),null==o||o.forEach((([e,t])=>{const n=null==t?void 0:t.replace(u(a.MATH,"g"),"");l[e]=T.ketchup.math.formulas.custom(n,function(e){var t;return Object.fromEntries(null===(t=Object.entries(e))||void 0===t?void 0:t.reduce(((e,[t,n])=>(T.ketchup.math.isNumber(n)&&e.push([t,Number(n)]),e)),[]))}(l)).toString()})),l):l}function L(e){if(!e.group)return;let t=e.group.id,n=e.group.parent;for(;null!==n;)t=`${n.group.id};${t}`,n=n.group.parent;e.group.id=t}function S(e,t,n,l){const o=t*n-n,r=o+Number(n);if(0==l)return e.slice(o,r);let i=[];return _(e,i,o,Number(n),0),i}function _(e,t,n,l,o){let r=!1;for(let i=0;i<e.length;i++){let s=e[i],a=R(e[i]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=_(s.group.children,a.group.children,n,l,o);o=e.ci,r=e.added,1==r&&(t[t.length]=a)}else o>=n&&(t[t.length]=a,r=!0),o++;if(o>=n+l)break}return{ci:o,added:r}}function R(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:I(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function z(e){if(null==e)return null;let t=[];for(let n=0;n<e.length;n++)t[t.length]=R(e[n]);return t}function I(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:z(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function $(e,t,n=!1){const l={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const o of t.rows){const t={cells:{},id:o.id};for(const n of l.columns){const l=n.name,r=o.cells[l],i=e.rows.find((e=>e.id===o.id)),s=i?i.cells[l]:null;(!s&&r.value||s&&r.value!==s.value)&&(t.cells[l]=r)}(Object.keys(t.cells).length>0||n)&&l.rows.push(t)}return l}function q(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var n;let l=e.cells[t];const o=l.value,r=l.decode,i=l.options;l.isEditable=null!==(n=l.isEditable)&&void 0!==n?n:l.editable;const s={[c.AUTOCOMPLETE]:()=>f(o,"",i),[c.COMBOBOX]:()=>f(o,"",i),[c.RADIO]:()=>h(o,i),[c.CHECKBOX]:()=>d(o,""),[c.CHIP]:()=>b(o,r),[c.SWITCH]:()=>m(o,""),[c.MULTI_AUTOCOMPLETE]:()=>b(o,r),[c.MULTI_COMBOBOX]:()=>b(o,r)}[l.shape];s&&(l.data=Object.assign(Object.assign({},s()),l.data))}))}))}export{w as F,g as K,y as a,N as b,B as c,q as d,F as e,M as f,$ as g,A as n,S as p,C as s,x as t}
@@ -1 +1 @@
1
- import{r as t,c as e,f as i,h as a,H as l,d as r}from"./p-710d0a7d.js";import{F as o}from"./p-c4224227.js";import{a as n}from"./p-e3062c19.js";import{F as s}from"./p-3cab6420.js";import{k as f,g as _,s as p,b as m,V as h}from"./p-77d2021c.js";import{c}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var u;!function(t){t.autofitOnExpand="The component will autofit everytime a node is expanded.",t.autofitOnLoad="The component's initial render will fit the container by invoking the runAutofit method.",t.cardData="Used to render the family tree boxes as kup-cards (through kup-box).",t.collapsible="Nodes can be expanded/collapsed.",t.customStyle="Custom style of the component.",t.data="Actual data of the component",t.layout="Layout of the boxes.",t.stackedLeaves="Child nodes that have no children are arranged vertically."}(u||(u={}));var d,y,k,g,v,x,b,w,z,j,C,E,T,W,M,S,D,L,O,P,R,A,F,X,Y,H=function(t,e,i,a){if("a"===i&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?a:"a"===i?a.call(t):a?a.value:e.get(t)},$=function(t,e,i,a,l){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!l:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?l.call(t,i):l?l.value=i:e.set(t,i),i};const B=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),k.set(this,!1),g.set(this,0),v.set(this,0),x.set(this,[]),b.set(this,f()),w.set(this,(t=>{const e=t.clientX-H(this,g,"f"),i=t.clientY-H(this,v,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,g,t.clientX,"f"),$(this,v,t.clientY,"f")})),z.set(this,!1),j.set(this,null),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1}async collapseAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return _(this,u,t)}async refresh(){i(this)}async runAutofit(){const t=H(this,j,"f").clientWidth,e=H(this,j,"f").children[0].clientWidth,i=.01,a=.85*t,l=.95*t;let r=1,o=2e3,n=e;for(;(n<a||n>l)&&o>0&&r>i;)o--,n<a?r+=i:n>l?r-=i:o=0,n=e*r;H(this,j,"f").style.setProperty("--kup_familytree_scale",r<=1?r.toFixed(2):"1")}async setProps(t){p(this,u,t)}componentWillLoad(){H(this,b,"f").debug.logLoad(this,!1),H(this,b,"f").language.register(this),H(this,b,"f").theme.register(this)}componentDidLoad(){H(this,d,"m",X).call(this),this.autofitOnLoad&&this.runAutofit(),H(this,b,"f").debug.logLoad(this,!0)}componentWillRender(){H(this,b,"f").debug.logRender(this,!1)}componentDidRender(){H(this,z,"f")&&($(this,z,!1,"f"),this.runAutofit()),H(this,b,"f").debug.logRender(this,!0)}render(){return a(l,{key:"09a067148b3438469a9773c276c6aaddecda73fa",onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),H(this,d,"m",O).call(this,t)},onWheel:t=>{H(this,d,"m",Y).call(this,t)}},a("style",{key:"dbae8f187ff51f8168d4df72de2ba563ef7a9d7c"},H(this,b,"f").theme.setKupStyle(this.rootElement)),a("div",{key:"cf23802e9e58e68d0c89ee7fdd13fde331a04705",id:c},H(this,d,"m",D).call(this)))}disconnectedCallback(){H(this,b,"f").language.unregister(this),H(this,b,"f").theme.unregister(this)}get rootElement(){return r(this)}};y=new WeakMap,k=new WeakMap,g=new WeakMap,v=new WeakMap,x=new WeakMap,b=new WeakMap,w=new WeakMap,z=new WeakMap,j=new WeakMap,d=new WeakSet,C=function(t,e,i,l){const r=[];return r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},a("div",{class:"family-tree__line--placeholder"}))),r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||l&&!e}},a("div",{class:"family-tree__line--placeholder"}))),r},E=function t(e){var i;let l=null,r=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(r||(r=[]),r.push(t)):(l||(l=[]),l.push(t))})));const s=this.stackedLeaves&&l&&l.every((t=>!t.children||0==t.children.length)),f=l?2*l.length:1,_={"family-tree__line":!0,"family-tree__line--placeholder":!(!l&&!r),"family-tree__line--vertical":!(!l&&!r)},p={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},h=e.layout||this.layout||1,c={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:n.OUTLINED,title:`${H(this,b,"f").language.translate(m.EXPAND)}/${H(this,b,"f").language.translate(m.COLLAPSE)} (CTRL + Click)`,onClick:t=>{t.ctrlKey&&e.children&&e.children.length>0&&(e.isExpanded?this.collapseAll(e.children):this.expandAll(e.children)),e.isExpanded=!e.isExpanded,this.autofitOnExpand&&$(this,z,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let u=null;H(this,d,"m",L).call(this,h)&&(u=a("kup-box",{class:"kup-borderless kup-paddingless",customStyle:"#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }",data:p,cardData:this.cardData,layout:this.cardData?null:h,showSelection:!1}));const y=a("div",{class:"family-tree__item"},a("div",{class:"family-tree__item__wrapper"},H(this,d,"m",L).call(this,h)?u:H(this,d,"m",T).call(this,e,h),this.collapsible&&e.children&&e.children.length>0?a(o,Object.assign({},c)):void 0)),k={"--kup_familytree_staffchildren":(null==r?void 0:r.length.toString())||"0"};return a("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},a("tr",null,a("td",{"data-row":e,colSpan:f},y)),a("tr",null,a("td",{colSpan:f},a("div",{class:_}))),r?[a("tr",null,a("td",{colSpan:f},a("div",{class:Object.assign(Object.assign({},_),{"family-tree__line--staff":!0}),style:k}),a("div",{class:"family-tree__node__staff",style:k},r.map((e=>[a("div",{class:"family-tree__node__staff__item"},H(this,d,"m",t).call(this,e))])))))]:null,r&&l?[a("tr",null,a("td",{colSpan:f},a("div",{class:_})))]:null,l?[a("tr",null,s?a("td",{colSpan:f},a("div",{class:_})):l.map((t=>H(this,d,"m",C).call(this,0==l.indexOf(t),l.indexOf(t)==l.length-1,1==l.length,l.length>2)))),a("tr",null,s?a("td",{colSpan:f},l.map((e=>H(this,d,"m",t).call(this,e)))):l.map((e=>a("td",{colSpan:2},H(this,d,"m",t).call(this,e)))))]:void 0)},T=function(t,e){return 2===e?H(this,d,"m",M).call(this,t):H(this,d,"m",W).call(this,t)},W=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--1"},a("div",{class:"family-tree__item__layout__text__title"},t.value))},M=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--2"},a("div",{class:"family-tree__item__layout__color"}),a("div",{class:"family-tree__item__layout__image"},a(s,{resource:t.icon,placeholderResource:t.placeholderIcon,sizeX:"48px",sizeY:"48px"})),a("div",{class:"family-tree__item__layout__text"},a("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?a("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},S=function(t){return t.map((t=>H(this,d,"m",E).call(this,t)))},D=function(){return a("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,j,t,"f")},this.data&&this.data.rows&&this.data.rows.length?H(this,d,"m",S).call(this,this.data.rows):a("div",null,H(this,b,"f").language.translate(m.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){$(this,g,t.clientX,"f"),$(this,v,t.clientY,"f"),H(this,j,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",H(this,w,"f")),document.removeEventListener("pointerup",e),H(this,j,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",H(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t,e){let i,a;if(t)for(let e=t.length-1;e>=0;e--){const l=t[e];l.tagName&&(l.classList.contains("family-tree__item__expand")&&(i=l),"TD"===l.tagName.toUpperCase())&&(a=l)}let l=null,r=null,o=null;return a&&(l=a["data-cell"],r=a["data-column"],o=a["data-row"]),{cell:l||null,column:r||null,expandButton:i||null,originalEvent:e,row:o||null,td:a||null}},R=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},A=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},F=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},X=function(){H(this,x,"f").push(this.rootElement),H(this,b,"f").interact.on(this.rootElement,h.TAP,(t=>{if(H(this,k,"f"))$(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];H(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",R).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.DOUBLETAP,(t=>{if(0===t.button){for(let t=0;t<H(this,y,"f").length;t++)clearTimeout(H(this,y,"f")[t]),H(this,b,"f").debug.logMessage(this,"Cleared clickHandler timeout("+H(this,y,"f")[t]+").");$(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||($(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,t)}))}))},Y=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(H(this,j,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let a=t.deltaY>0?e-i:e+i;a<i&&(a=i),H(this,j,"f").style.setProperty("--kup_familytree_scale",a.toFixed(2))}},B.style='.kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_familytree_item_background_color:var(\n --kup-layer-1,\n var(--kup-layer-1)\n );--kup_familytree_border_color:var(\n --kup-familytree-border-color,\n var(--kup-info-color-50)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_minheight:var(--kup-familytree-item-minheight, 32px);--kup_familytree_item_height:var(--kup-familytree-item-height, 100%);--kup_familytree_item_h_padding:var(\n --kup-familytree-item-h-padding,\n var(--kup-space-00)\n );--kup_familytree_item_v_padding:var(\n --kup-familytree-item-v-padding,\n var(--kup-space-03)\n );--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-subtle)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc((var(--kup_familytree_item_width) + var(--kup_familytree_item_h_padding) * 2) / 2)) translateY(calc(0px - (var(--kup_familytree_staffchildren) * var(--kup_familytree_item_minheight) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:"";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_minheight) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:32px}.family-tree__line--staff{height:calc(var(--kup_familytree_staffchildren) * var(--kup_familytree_item_minheight) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto;display:flex;flex-direction:column}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 var(--kup-space-05);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);box-sizing:border-box;display:flex;height:--kup_familytree_item_minheight;min-height:32px;margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup_familytree_border_color);height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto var(--kup-space-03)}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';export{B as kup_family_tree}
1
+ import{r as t,c as e,f as i,h as a,H as l,d as r}from"./p-710d0a7d.js";import{F as o}from"./p-c4224227.js";import{a as n}from"./p-e3062c19.js";import{F as s}from"./p-3cab6420.js";import{k as f,g as _,s as p,b as m,V as h}from"./p-8610d5b5.js";import{c}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var u;!function(t){t.autofitOnExpand="The component will autofit everytime a node is expanded.",t.autofitOnLoad="The component's initial render will fit the container by invoking the runAutofit method.",t.cardData="Used to render the family tree boxes as kup-cards (through kup-box).",t.collapsible="Nodes can be expanded/collapsed.",t.customStyle="Custom style of the component.",t.data="Actual data of the component",t.layout="Layout of the boxes.",t.stackedLeaves="Child nodes that have no children are arranged vertically."}(u||(u={}));var d,y,k,g,v,x,b,w,z,j,C,E,T,W,M,S,D,L,O,P,R,A,F,X,Y,H=function(t,e,i,a){if("a"===i&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?a:"a"===i?a.call(t):a?a.value:e.get(t)},$=function(t,e,i,a,l){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!l:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?l.call(t,i):l?l.value=i:e.set(t,i),i};const B=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),k.set(this,!1),g.set(this,0),v.set(this,0),x.set(this,[]),b.set(this,f()),w.set(this,(t=>{const e=t.clientX-H(this,g,"f"),i=t.clientY-H(this,v,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,g,t.clientX,"f"),$(this,v,t.clientY,"f")})),z.set(this,!1),j.set(this,null),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1}async collapseAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return _(this,u,t)}async refresh(){i(this)}async runAutofit(){const t=H(this,j,"f").clientWidth,e=H(this,j,"f").children[0].clientWidth,i=.01,a=.85*t,l=.95*t;let r=1,o=2e3,n=e;for(;(n<a||n>l)&&o>0&&r>i;)o--,n<a?r+=i:n>l?r-=i:o=0,n=e*r;H(this,j,"f").style.setProperty("--kup_familytree_scale",r<=1?r.toFixed(2):"1")}async setProps(t){p(this,u,t)}componentWillLoad(){H(this,b,"f").debug.logLoad(this,!1),H(this,b,"f").language.register(this),H(this,b,"f").theme.register(this)}componentDidLoad(){H(this,d,"m",X).call(this),this.autofitOnLoad&&this.runAutofit(),H(this,b,"f").debug.logLoad(this,!0)}componentWillRender(){H(this,b,"f").debug.logRender(this,!1)}componentDidRender(){H(this,z,"f")&&($(this,z,!1,"f"),this.runAutofit()),H(this,b,"f").debug.logRender(this,!0)}render(){return a(l,{key:"09a067148b3438469a9773c276c6aaddecda73fa",onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),H(this,d,"m",O).call(this,t)},onWheel:t=>{H(this,d,"m",Y).call(this,t)}},a("style",{key:"dbae8f187ff51f8168d4df72de2ba563ef7a9d7c"},H(this,b,"f").theme.setKupStyle(this.rootElement)),a("div",{key:"cf23802e9e58e68d0c89ee7fdd13fde331a04705",id:c},H(this,d,"m",D).call(this)))}disconnectedCallback(){H(this,b,"f").language.unregister(this),H(this,b,"f").theme.unregister(this)}get rootElement(){return r(this)}};y=new WeakMap,k=new WeakMap,g=new WeakMap,v=new WeakMap,x=new WeakMap,b=new WeakMap,w=new WeakMap,z=new WeakMap,j=new WeakMap,d=new WeakSet,C=function(t,e,i,l){const r=[];return r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},a("div",{class:"family-tree__line--placeholder"}))),r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||l&&!e}},a("div",{class:"family-tree__line--placeholder"}))),r},E=function t(e){var i;let l=null,r=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(r||(r=[]),r.push(t)):(l||(l=[]),l.push(t))})));const s=this.stackedLeaves&&l&&l.every((t=>!t.children||0==t.children.length)),f=l?2*l.length:1,_={"family-tree__line":!0,"family-tree__line--placeholder":!(!l&&!r),"family-tree__line--vertical":!(!l&&!r)},p={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},h=e.layout||this.layout||1,c={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:n.OUTLINED,title:`${H(this,b,"f").language.translate(m.EXPAND)}/${H(this,b,"f").language.translate(m.COLLAPSE)} (CTRL + Click)`,onClick:t=>{t.ctrlKey&&e.children&&e.children.length>0&&(e.isExpanded?this.collapseAll(e.children):this.expandAll(e.children)),e.isExpanded=!e.isExpanded,this.autofitOnExpand&&$(this,z,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let u=null;H(this,d,"m",L).call(this,h)&&(u=a("kup-box",{class:"kup-borderless kup-paddingless",customStyle:"#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }",data:p,cardData:this.cardData,layout:this.cardData?null:h,showSelection:!1}));const y=a("div",{class:"family-tree__item"},a("div",{class:"family-tree__item__wrapper"},H(this,d,"m",L).call(this,h)?u:H(this,d,"m",T).call(this,e,h),this.collapsible&&e.children&&e.children.length>0?a(o,Object.assign({},c)):void 0)),k={"--kup_familytree_staffchildren":(null==r?void 0:r.length.toString())||"0"};return a("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},a("tr",null,a("td",{"data-row":e,colSpan:f},y)),a("tr",null,a("td",{colSpan:f},a("div",{class:_}))),r?[a("tr",null,a("td",{colSpan:f},a("div",{class:Object.assign(Object.assign({},_),{"family-tree__line--staff":!0}),style:k}),a("div",{class:"family-tree__node__staff",style:k},r.map((e=>[a("div",{class:"family-tree__node__staff__item"},H(this,d,"m",t).call(this,e))])))))]:null,r&&l?[a("tr",null,a("td",{colSpan:f},a("div",{class:_})))]:null,l?[a("tr",null,s?a("td",{colSpan:f},a("div",{class:_})):l.map((t=>H(this,d,"m",C).call(this,0==l.indexOf(t),l.indexOf(t)==l.length-1,1==l.length,l.length>2)))),a("tr",null,s?a("td",{colSpan:f},l.map((e=>H(this,d,"m",t).call(this,e)))):l.map((e=>a("td",{colSpan:2},H(this,d,"m",t).call(this,e)))))]:void 0)},T=function(t,e){return 2===e?H(this,d,"m",M).call(this,t):H(this,d,"m",W).call(this,t)},W=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--1"},a("div",{class:"family-tree__item__layout__text__title"},t.value))},M=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--2"},a("div",{class:"family-tree__item__layout__color"}),a("div",{class:"family-tree__item__layout__image"},a(s,{resource:t.icon,placeholderResource:t.placeholderIcon,sizeX:"48px",sizeY:"48px"})),a("div",{class:"family-tree__item__layout__text"},a("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?a("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},S=function(t){return t.map((t=>H(this,d,"m",E).call(this,t)))},D=function(){return a("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,j,t,"f")},this.data&&this.data.rows&&this.data.rows.length?H(this,d,"m",S).call(this,this.data.rows):a("div",null,H(this,b,"f").language.translate(m.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){$(this,g,t.clientX,"f"),$(this,v,t.clientY,"f"),H(this,j,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",H(this,w,"f")),document.removeEventListener("pointerup",e),H(this,j,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",H(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t,e){let i,a;if(t)for(let e=t.length-1;e>=0;e--){const l=t[e];l.tagName&&(l.classList.contains("family-tree__item__expand")&&(i=l),"TD"===l.tagName.toUpperCase())&&(a=l)}let l=null,r=null,o=null;return a&&(l=a["data-cell"],r=a["data-column"],o=a["data-row"]),{cell:l||null,column:r||null,expandButton:i||null,originalEvent:e,row:o||null,td:a||null}},R=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},A=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},F=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},X=function(){H(this,x,"f").push(this.rootElement),H(this,b,"f").interact.on(this.rootElement,h.TAP,(t=>{if(H(this,k,"f"))$(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];H(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",R).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.DOUBLETAP,(t=>{if(0===t.button){for(let t=0;t<H(this,y,"f").length;t++)clearTimeout(H(this,y,"f")[t]),H(this,b,"f").debug.logMessage(this,"Cleared clickHandler timeout("+H(this,y,"f")[t]+").");$(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||($(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,t)}))}))},Y=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(H(this,j,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let a=t.deltaY>0?e-i:e+i;a<i&&(a=i),H(this,j,"f").style.setProperty("--kup_familytree_scale",a.toFixed(2))}},B.style='.kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_familytree_item_background_color:var(\n --kup-layer-1,\n var(--kup-layer-1)\n );--kup_familytree_border_color:var(\n --kup-familytree-border-color,\n var(--kup-info-color-50)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_minheight:var(--kup-familytree-item-minheight, 32px);--kup_familytree_item_height:var(--kup-familytree-item-height, 100%);--kup_familytree_item_h_padding:var(\n --kup-familytree-item-h-padding,\n var(--kup-space-00)\n );--kup_familytree_item_v_padding:var(\n --kup-familytree-item-v-padding,\n var(--kup-space-03)\n );--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-subtle)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc((var(--kup_familytree_item_width) + var(--kup_familytree_item_h_padding) * 2) / 2)) translateY(calc(0px - (var(--kup_familytree_staffchildren) * var(--kup_familytree_item_minheight) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:"";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_minheight) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:32px}.family-tree__line--staff{height:calc(var(--kup_familytree_staffchildren) * var(--kup_familytree_item_minheight) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto;display:flex;flex-direction:column}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 var(--kup-space-05);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);box-sizing:border-box;display:flex;height:--kup_familytree_item_minheight;min-height:32px;margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup_familytree_border_color);height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto var(--kup-space-03)}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';export{B as kup_family_tree}
@@ -1 +1 @@
1
- import{r as i,f as n,h as t,H as e,d as a}from"./p-710d0a7d.js";import{k as l,g as o,s as p,h as r}from"./p-77d2021c.js";import{c as s}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var d;!function(i){i.columns="The number of columns displayed by the grid, the default behavior is 12.",i.customStyle="Custom style of the component. For more information: https://smeup.github.io/ketchup/#/customization",i.singleLine="When set to true, forces the content on a single line."}(d||(d={}));const g=class{constructor(n){i(this,n),this.kupManager=l(),this.columns=12,this.customStyle="",this.singleLine=!1}async getProps(i){return o(this,d,i)}async refresh(){n(this)}async setProps(i){p(this,d,i)}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){const i=this.rootElement.children;if(!i||0===i.length)return void this.kupManager.debug.logMessage(this,"Missing slots, not rendering!",r.WARNING);const n=[];for(let e=0;e<i.length;e++){let a=null;if(this.singleLine)a=t("slot",{name:`${e}`});else{const n=i[e].span||i[e].getAttribute("span")||1;a=t("div",{class:`layout-grid__cell layout-grid__cell--span-${n}`},t("slot",{name:`${e}`}))}n.push(a)}const a={};return this.columns&&12!==this.columns&&(a["--kup_grid_columns"]=this.columns),t(e,{style:a},t("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),t("div",{id:s},t("div",{class:this.singleLine?"flex-layout":"layout-grid"},t("div",{class:this.singleLine?"flex-layout__inner":"layout-grid__inner"},n))))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return a(this)}};g.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_grid_font_size:var(--kup-grid-font-size, var(--kup-font-size));--kup_grid_gap:var(--kup-grid-gap, 24px);--kup_grid_gap_mobile:var(--kup-grid-gap-mobile, 16px);--kup_grid_padding:var(--kup-grid-padding, 24px);display:block;font-size:var(--kup_grid_font_size);height:100%;width:100%}#kup-component{height:100%;width:100%}.layout-grid{box-sizing:border-box;margin:0px auto;padding:var(--kup_grid_padding)}.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap);grid-template-columns:repeat(var(--kup_grid_columns, 12), minmax(0px, 1fr))}.layout-grid .layout-grid__inner .layout-grid__cell{box-sizing:border-box;display:flex;justify-content:center;margin:0px;width:auto}.layout-grid__cell--span-1{grid-column-end:span 1}.layout-grid__cell--span-2{grid-column-end:span 2}.layout-grid__cell--span-3{grid-column-end:span 3}.layout-grid__cell--span-4{grid-column-end:span 4}.layout-grid__cell--span-5{grid-column-end:span 5}.layout-grid__cell--span-6{grid-column-end:span 6}.layout-grid__cell--span-7{grid-column-end:span 7}.layout-grid__cell--span-8{grid-column-end:span 8}.layout-grid__cell--span-9{grid-column-end:span 9}.layout-grid__cell--span-10{grid-column-end:span 10}.layout-grid__cell--span-11{grid-column-end:span 11}.layout-grid__cell--span-12{grid-column-end:span 12}.layout-grid__cell--span-13{grid-column-end:span 13}.layout-grid__cell--span-14{grid-column-end:span 14}.layout-grid__cell--span-15{grid-column-end:span 15}.layout-grid__cell--span-16{grid-column-end:span 16}.layout-grid__cell--span-17{grid-column-end:span 17}.layout-grid__cell--span-18{grid-column-end:span 18}.layout-grid__cell--span-19{grid-column-end:span 19}.layout-grid__cell--span-20{grid-column-end:span 20}.layout-grid__cell--span-21{grid-column-end:span 21}.layout-grid__cell--span-22{grid-column-end:span 22}.layout-grid__cell--span-23{grid-column-end:span 23}.layout-grid__cell--span-24{grid-column-end:span 24}.flex-layout,.flex-layout__inner{height:100%;align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap}.flex-layout__inner{width:auto}.flex-layout__inner *{display:block;margin:0 1.5em}.flex-layout__inner .flex-layout__cell{display:flex}.flex-layout__inner .flex-layout__cell *{justify-content:center;margin:auto}@media (min-width: 600px) and (max-width: 839px){.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap_mobile);grid-template-columns:repeat(var(--kup_grid_columns, 8), minmax(0px, 1fr))}}@media (max-width: 599px){.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap_mobile);grid-template-columns:repeat(var(--kup_grid_columns, 4), minmax(0px, 1fr))}}:host(.kup-full-width) .flex-layout__inner{width:100%}:host(.kup-full-width) .flex-layout__inner *{margin:auto}:host(.kup-full-width.scalable-cards) .flex-layout__inner{width:100%}:host(.kup-full-width.scalable-cards) .flex-layout__inner *{margin:0;height:100%;width:100%}";export{g as kup_grid}
1
+ import{r as i,f as n,h as t,H as e,d as a}from"./p-710d0a7d.js";import{k as l,g as o,s as p,h as r}from"./p-8610d5b5.js";import{c as s}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var d;!function(i){i.columns="The number of columns displayed by the grid, the default behavior is 12.",i.customStyle="Custom style of the component. For more information: https://smeup.github.io/ketchup/#/customization",i.singleLine="When set to true, forces the content on a single line."}(d||(d={}));const g=class{constructor(n){i(this,n),this.kupManager=l(),this.columns=12,this.customStyle="",this.singleLine=!1}async getProps(i){return o(this,d,i)}async refresh(){n(this)}async setProps(i){p(this,d,i)}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){const i=this.rootElement.children;if(!i||0===i.length)return void this.kupManager.debug.logMessage(this,"Missing slots, not rendering!",r.WARNING);const n=[];for(let e=0;e<i.length;e++){let a=null;if(this.singleLine)a=t("slot",{name:`${e}`});else{const n=i[e].span||i[e].getAttribute("span")||1;a=t("div",{class:`layout-grid__cell layout-grid__cell--span-${n}`},t("slot",{name:`${e}`}))}n.push(a)}const a={};return this.columns&&12!==this.columns&&(a["--kup_grid_columns"]=this.columns),t(e,{style:a},t("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),t("div",{id:s},t("div",{class:this.singleLine?"flex-layout":"layout-grid"},t("div",{class:this.singleLine?"flex-layout__inner":"layout-grid__inner"},n))))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return a(this)}};g.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_grid_font_size:var(--kup-grid-font-size, var(--kup-font-size));--kup_grid_gap:var(--kup-grid-gap, 24px);--kup_grid_gap_mobile:var(--kup-grid-gap-mobile, 16px);--kup_grid_padding:var(--kup-grid-padding, 24px);display:block;font-size:var(--kup_grid_font_size);height:100%;width:100%}#kup-component{height:100%;width:100%}.layout-grid{box-sizing:border-box;margin:0px auto;padding:var(--kup_grid_padding)}.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap);grid-template-columns:repeat(var(--kup_grid_columns, 12), minmax(0px, 1fr))}.layout-grid .layout-grid__inner .layout-grid__cell{box-sizing:border-box;display:flex;justify-content:center;margin:0px;width:auto}.layout-grid__cell--span-1{grid-column-end:span 1}.layout-grid__cell--span-2{grid-column-end:span 2}.layout-grid__cell--span-3{grid-column-end:span 3}.layout-grid__cell--span-4{grid-column-end:span 4}.layout-grid__cell--span-5{grid-column-end:span 5}.layout-grid__cell--span-6{grid-column-end:span 6}.layout-grid__cell--span-7{grid-column-end:span 7}.layout-grid__cell--span-8{grid-column-end:span 8}.layout-grid__cell--span-9{grid-column-end:span 9}.layout-grid__cell--span-10{grid-column-end:span 10}.layout-grid__cell--span-11{grid-column-end:span 11}.layout-grid__cell--span-12{grid-column-end:span 12}.layout-grid__cell--span-13{grid-column-end:span 13}.layout-grid__cell--span-14{grid-column-end:span 14}.layout-grid__cell--span-15{grid-column-end:span 15}.layout-grid__cell--span-16{grid-column-end:span 16}.layout-grid__cell--span-17{grid-column-end:span 17}.layout-grid__cell--span-18{grid-column-end:span 18}.layout-grid__cell--span-19{grid-column-end:span 19}.layout-grid__cell--span-20{grid-column-end:span 20}.layout-grid__cell--span-21{grid-column-end:span 21}.layout-grid__cell--span-22{grid-column-end:span 22}.layout-grid__cell--span-23{grid-column-end:span 23}.layout-grid__cell--span-24{grid-column-end:span 24}.flex-layout,.flex-layout__inner{height:100%;align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap}.flex-layout__inner{width:auto}.flex-layout__inner *{display:block;margin:0 1.5em}.flex-layout__inner .flex-layout__cell{display:flex}.flex-layout__inner .flex-layout__cell *{justify-content:center;margin:auto}@media (min-width: 600px) and (max-width: 839px){.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap_mobile);grid-template-columns:repeat(var(--kup_grid_columns, 8), minmax(0px, 1fr))}}@media (max-width: 599px){.layout-grid .layout-grid__inner{display:grid;margin:0px;grid-gap:var(--kup_grid_gap_mobile);grid-template-columns:repeat(var(--kup_grid_columns, 4), minmax(0px, 1fr))}}:host(.kup-full-width) .flex-layout__inner{width:100%}:host(.kup-full-width) .flex-layout__inner *{margin:auto}:host(.kup-full-width.scalable-cards) .flex-layout__inner{width:100%}:host(.kup-full-width.scalable-cards) .flex-layout__inner *{margin:0;height:100%;width:100%}";export{g as kup_grid}
@@ -1 +1 @@
1
- import{r as i,c as o,f as t,h as e,H as r,d as n}from"./p-710d0a7d.js";import{k as a,a as c,g as s,s as p,d as h,f as l,e as d}from"./p-77d2021c.js";import{F as u}from"./p-3cab6420.js";import{c as f}from"./p-635bb4b3.js";import{M as m}from"./p-c56195a0.js";import"./p-1ee561ba.js";var k;!function(i){i.customStyle="Custom style of the component. For more information: https://smeup.github.io/ketchup/#/customization",i.data="List of elements.",i.infoIcon="When true, it will show the info activation icon",i.ripple="When enabled displays Material's ripple effect on item headers.",i.toolbar="When true, it will show the toolbar activation icon",i.sizing="Sets the type of the component sizing.",i.toolbarCallback="Callback to be called when the toolbar icon is clicked",i.infoCallback="Callback to be called when the info icon is clicked"}(k||(k={}));var _,g,v=function(i,o,t,e,r){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof o?i!==o||!r:!o.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?r.call(i,t):r?r.value=t:o.set(i,t),t},b=function(i,o,t,e){if("a"===t&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof o?i!==o||!e:!o.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?e:"a"===t?e.call(i):e?e.value:o.get(i)};const y=class{constructor(t){i(this,t),this.kupBlur=o(this,"kup-accordion-blur",6),this.kupClick=o(this,"kup-accordion-click",6),this.kupIconClick=o(this,"kup-accordion-iconclick",6),this.kupInfoIconClick=o(this,"kup-accordion-infoiconclick",6),this.kupFocus=o(this,"kup-accordion-focus",6),this.kupToolbarItemClick=o(this,"kup-accordion-toolbaritemclick",6),this.toolbarState=[],this.infoState=[],this.kupManager=a(),_.set(this,null),this.slotsNames=[],g.set(this,null),this.selectedItems=[],this.customStyle="",this.data=null,this.infoIcon=!1,this.ripple=!1,this.toolbar=!1,this.sizing=c.SMALL,this.toolbarCallback=void 0,this.infoCallback=void 0}onKupBlur(i){this.kupBlur.emit({comp:this,id:this.rootElement.id,node:i})}onKupClick(i,o){this.data[i].contentVisible=!this.data[i].contentVisible,this.updateSelectedItems(),this.kupClick.emit({comp:this,id:this.rootElement.id,node:o})}onKupIconClick(i){i?(v(this,g,i,"f"),this.createDropDownToolbarList()):this.kupManager.debug.logMessage(this,"onKupIconClick: Element is null")}onKupInfoIconClick(i){i?(v(this,g,i,"f"),this.createDropDownInfoList()):this.kupManager.debug.logMessage(this,"onKupIconClick: Element is null")}onKupFocus(i){this.kupFocus.emit({comp:this,id:this.rootElement.id,node:i})}onKupToolbarItemClick(i){this.kupToolbarItemClick.emit({comp:this,id:this.rootElement.id,node:i.detail.selected})}applyRipple(){const i=this.rootElement.shadowRoot;if(i&&this.ripple){const o=i.querySelectorAll(".mdc-ripple-surface:not(.mdc-ripple-upgraded)");if(o)for(let i=0;i<o.length;i++)m.attachTo(o[i])}}updateSelectedItems(){var i;const o=[];if(null===(i=this.data)||void 0===i?void 0:i.length)for(let i=0;i<this.data.length;i++){const t=this.data[i];t.contentVisible&&o.push(t.id)}this.selectedItems=o}async collapseAll(){const i=[];for(let o=0;o<this.data.length;o++){const t=this.data[o].id;!this.isItemExpandible(t)&&this.isItemSelected(t)&&i.push(t)}this.selectedItems=i}async expandAll(){const i=[];for(let o=0;o<this.data.length;o++){const t=this.data[o].id;this.isItemExpandible(t)&&i.push(t)}this.selectedItems=i}async getProps(i){return s(this,k,i)}async refresh(){t(this)}async setProps(i){p(this,k,i)}async toggleItem(i){const o=[...this.selectedItems];o.includes(i.id)?o.splice(o.indexOf(i.id),1):o.push(i.id),this.selectedItems=o,this.kupClick.emit({comp:this,id:this.rootElement.id,node:i})}isItemExpandible(i){return this.slotsNames.includes(i)}isItemSelected(i){return this.selectedItems.includes(i)}renderItems(){var i,o;const t=[],r=Array.prototype.slice.call(this.rootElement.children,0);this.slotsNames=[];for(let i=0;i<r.length;i++)this.slotsNames.push(r[i].slot);for(let r=0;r<this.data.length;r++){const n=this.data[r],a=n.id,c=this.isItemSelected(a),s=this.isItemExpandible(a),p={"accordion-item__header":!0,"accordion-item__header--selected":!(s||!c),"accordion-item__header--expanded":!(!s||!c),"mdc-ripple-surface":!!this.ripple,[`accordion-item--${this.sizing}`]:!!this.sizing},d={"accordion-item__content":!0,"accordion-item__content--selected":!!c},f=e("div",{class:"accordion-rigtbuttons"},this.infoIcon&&e(u,{resource:"info_outline",sizeX:"16px",sizeY:"16px",onClick:async i=>{i.stopPropagation();const o=i.currentTarget,t=await this.infoCallback();this.infoState=t,this.infoState.length>0?this.onKupInfoIconClick(o):this.kupManager.debug.logMessage(this,"InfoIcon data is empty, not opening dropdown.")},wrapperClass:"tab__iconToolbar iconInfo"}),this.toolbar&&e(u,{resource:"more_vert",sizeX:"16px",sizeY:"16px",onClick:async i=>{i.stopPropagation();const o=i.currentTarget,t=await this.toolbarCallback();this.toolbarState=t,this.toolbarState.length>0?this.onKupIconClick(o):this.kupManager.debug.logMessage(this,"Toolbar data is empty, not opening dropdown.")},wrapperClass:"tab__iconToolbar iconToolbar"}),s?e("div",{class:`accordion-item__dropdown kup-icon ${h.DROPDOWN.replace("--","")}`}):null);t.push(e("div",{class:"accordion-item"},e("div",{tabindex:r,title:null!==(i=n.title)&&void 0!==i?i:null,class:p,onClick:()=>this.toggleItem(n),onBlur:()=>this.onKupBlur(n),onFocus:()=>this.onKupFocus(n)},n.icon?e(u,{color:`var(${l.PRIMARY})`,resource:n.icon,placeholderResource:n.placeholderIcon,sizeX:"1.5em",sizeY:"1.5em",wrapperClass:"accordion-item__icon"}):null,n.value?e("span",{class:"accordion-item__text"},null!==(o=n.value)&&void 0!==o?o:""):null,f),e("div",{class:d},e("slot",{name:n.id}))))}return t}closeRowToolbarList(){this.toolbarList&&(this.kupManager.dynamicPosition.stop(this.toolbarList),this.kupManager.removeClickCallback(b(this,_,"f")),this.toolbarList.remove(),this.kupManager.dynamicPosition.unregister([this.toolbarList]),this.toolbarList=null)}createDropDownToolbarList(){if(!b(this,g,"f"))return void this.kupManager.debug.logMessage(this,"createDropDownToolbarList: Anchor is null!");if(this.toolbarList&&this.closeRowToolbarList(),0===this.toolbarState.length)return void this.kupManager.debug.logMessage(this,"No toolbar state available.");const i=document.createElement("kup-toolbar");i.data=this.toolbarState,i.addEventListener("kup-toolbar-click",(i=>{this.onKupToolbarItemClick(i),setTimeout((()=>{this.closeRowToolbarList()}),0)})),this.toolbarList=i,v(this,_,{cb:()=>{this.closeRowToolbarList()},el:this.toolbarList},"f"),this.kupManager.addClickCallback(b(this,_,"f"),!0),this.rootElement.shadowRoot.appendChild(this.toolbarList),requestAnimationFrame((()=>{b(this,g,"f")?(this.kupManager.dynamicPosition.register(this.toolbarList,b(this,g,"f"),0,d.AUTO,!0),this.kupManager.dynamicPosition.start(this.toolbarList)):this.kupManager.debug.logMessage(this,"DropDown anchor is still null after delay!")}))}createDropDownInfoList(){if(!b(this,g,"f"))return void this.kupManager.debug.logMessage(this,"createDropDownToolbarList: Anchor is null!");if(this.infoList&&this.closeInfoDataList(),0===this.infoState.length)return void this.kupManager.debug.logMessage(this,"No toolbar state available.");const i=document.createElement("kup-list");i.data=this.infoState,this.infoList=i,v(this,_,{cb:()=>{this.closeInfoDataList()},el:this.infoList},"f"),this.kupManager.addClickCallback(b(this,_,"f"),!0),this.rootElement.shadowRoot.appendChild(this.infoList),requestAnimationFrame((()=>{this.kupManager.dynamicPosition.register(this.infoList,b(this,g,"f"),0,d.AUTO,!0),this.kupManager.dynamicPosition.start(this.infoList)}))}closeInfoDataList(){this.infoList&&(this.kupManager.dynamicPosition.stop(this.infoList),this.kupManager.removeClickCallback(b(this,_,"f")),this.infoList.remove(),this.kupManager.dynamicPosition.unregister([this.infoList]),this.infoList=null)}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.updateSelectedItems(),this.applyRipple(),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const i=this.rootElement.shadowRoot;if(i){const o=i.querySelectorAll(".mdc-ripple-surface");if(o)for(let i=0;i<o.length;i++)m.attachTo(o[i])}this.kupManager.debug.logRender(this,!0)}render(){const i=this.data&&this.data.length?this.renderItems():null;return e(r,{key:"3f9af91ddcf48e60b8ac506dfbc7991eea418f70"},e("style",{key:"3179a55c30b7a726f2f6cc20f15fd4c3003160c5"},this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{key:"f7f9910a40af9bb7f0891523d1b30e3d7677c5b6",id:f},e("div",{key:"c267fd8005f786b4a0e9207ab553b12a7044cc46",class:"accordion"},i)))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return n(this)}static get watchers(){return{ripple:["applyRipple"],data:["updateSelectedItems"]}}};_=new WeakMap,g=new WeakMap,y.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_accordion_border_top_color:var(\n --kup-accordion-border-top-color,\n var(--kup-border-subtle)\n );--kup_accordion_item_small_height:var(\n --kup-accordion-item-small-height,\n 32px\n );--kup_accordion_item_medium_height:var(\n --kup-accordion-item-medium-height,\n 40px\n );--kup_accordion_item_outline_color_active:var(\n --kup-accordion-item-outline-color-focus,\n var(--kup-border-interactive)\n );--kup_accordion_item_large_height:var(\n --kup-accordion-item-medium-height,\n 48px\n );--kup_accordion_header_background_color:var(\n --kup-accordion-header-background-color,\n var(--kup-layer-0)\n );--kup_accordion_header_background_color_hover:var(\n --kup-accordion-header-background-color-hover,\n var(--kup-layer-0-hover)\n );--kup_accordion_header_padding:var(\n --kup-accordion-header-padding,\n var(--kup-space-05)\n );--kup_accordion_dropdown_icon_color:var(\n --kup-accordio-dropdown-icon-color,\n var(--kup-text-primary)\n );--kup_accordion_transition:var(--kup-accordion-transition, 80ms);display:block;font-family:var(--kup_accordion_font_family);font-size:var(--kup_accordion_font_size)}.accordion{border-radius:var(--kup_accordion_border_radius);display:flex;flex-wrap:wrap;flex-direction:column;width:100%}.accordion-item{border-top:1px solid var(--kup_accordion_border_top_color);box-sizing:border-box;width:100%}.accordion-item--visible{display:block}.accordion-item:is(:last-of-type){border-bottom:1px solid var(--kup_accordion_border_top_color)}.accordion-item__header{height:var(--kup_accordion_item_medium_height);align-items:center;border:none;box-sizing:border-box;color:var(--kup_accordion_text_color);cursor:pointer;display:flex;line-height:1.75em;outline:none;padding:var(--kup_accordion_padding);text-align:left;transition:background-color var(--kup_accordion_transition), color var(--kup_accordion_transition);width:100%;outline:2px solid transparent;outline-offset:-2px;padding-left:16px;padding-right:16px;gap:var(--kup-space-03)}.accordion-item__header:focus{outline:2px solid var(--kup_accordion_item_outline_color_active)}.accordion-item__header.accordion-item--small{height:var(--kup_accordion_item_small_height)}.accordion-item__header.accordion-item--large{height:var(--kup_accordion_item_large_height)}.accordion-item__header:hover:not(.accordion-item__header--selected){background-color:var(--kup_accordion_header_background_color_hover)}.accordion-item__header:focus(.accordion-item__header--selected){outline:2px solid var(--kup_accordion_item_outline_color_active)}.accordion-item__header--expanded{background-color:var(--kup_accordion_background_color)}.accordion-item__header--expanded .accordion-item__dropdown{transform:rotate(-180deg)}.accordion-item__header .f-image{margin:0}.accordion-item__header .accordion-rigtbuttons{margin-left:auto;margin-right:0;display:flex;gap:var(--kup-space-03)}.accordion-item__text{margin-right:0.5em;overflow:hidden;text-overflow:ellipsis;white-space:pre}.accordion-item__text--highlighted{color:var(--kup_accordion_text_on_primary_color);background-color:var(--kup_accordion_primary_color)}.accordion-item__icon{margin-left:0;margin-right:0.5em}.accordion-item__dropdown{background-color:var(--kup_accordion_dropdown_icon_color);height:1.5em;min-width:1.5em;width:1.5em;transition:transform var(--kup_accordion_transition)}.accordion-item__content{padding-left:16px;padding-top:8px;padding-bottom:24px;padding-right:80px;animation:fade-in 0.25s ease-out;display:none;font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.accordion-item__content--selected{display:block}.mdc-ripple-surface{--mdc-ripple-fg-opacity:0.24}.mdc-ripple-surface:before,.mdc-ripple-surface:after{background-color:var(--kup_accordion_primary_color)}.kup-icon.kup-dropdown-icon{-webkit-mask:var(--kup-dropdown-icon);mask:var(--kup-dropdown-icon)}:host(.kup-borderless){--kup-accordion-border:none}:host(.kup-full-height){height:100%}:host(.kup-full-width){width:100%}:host(.kup-danger){--kup-accordion-primary-color:var(--kup-danger-color-60);--kup-accordion-primary-color-rgb:var(--kup-danger-color-60-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-info){--kup-accordion-primary-color:var(--kup-info-50-color);--kup-accordion-primary-color-rgb:var(--kup-info-color-50-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-secondary){--kup-accordion-primary-color:var(--kup-secondary-color);--kup-accordion-primary-color-rgb:var(--kup-secondary-color-rgb);--kup-accordion-text-on-primary-color:var(--kup-text-on-secondary-color)}:host(.kup-success){--kup-accordion-primary-color:var(--kup-success-color-40);--kup-accordion-primary-color-rgb:var(--kup-success-color-40-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-warning){--kup-accordion-primary-color:var(--kup-warning-color-50);--kup-accordion-primary-color-rgb:var(--kup-warning-color-50-rgb);--kup-accordion-text-on-primary-color:white}";export{y as kup_accordion}
1
+ import{r as i,c as o,f as t,h as e,H as r,d as n}from"./p-710d0a7d.js";import{k as a,a as c,g as s,s as p,d as h,f as l,e as d}from"./p-8610d5b5.js";import{F as u}from"./p-3cab6420.js";import{c as f}from"./p-635bb4b3.js";import{M as m}from"./p-c56195a0.js";import"./p-1ee561ba.js";var k;!function(i){i.customStyle="Custom style of the component. For more information: https://smeup.github.io/ketchup/#/customization",i.data="List of elements.",i.infoIcon="When true, it will show the info activation icon",i.ripple="When enabled displays Material's ripple effect on item headers.",i.toolbar="When true, it will show the toolbar activation icon",i.sizing="Sets the type of the component sizing.",i.toolbarCallback="Callback to be called when the toolbar icon is clicked",i.infoCallback="Callback to be called when the info icon is clicked"}(k||(k={}));var _,g,v=function(i,o,t,e,r){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof o?i!==o||!r:!o.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?r.call(i,t):r?r.value=t:o.set(i,t),t},b=function(i,o,t,e){if("a"===t&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof o?i!==o||!e:!o.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?e:"a"===t?e.call(i):e?e.value:o.get(i)};const y=class{constructor(t){i(this,t),this.kupBlur=o(this,"kup-accordion-blur",6),this.kupClick=o(this,"kup-accordion-click",6),this.kupIconClick=o(this,"kup-accordion-iconclick",6),this.kupInfoIconClick=o(this,"kup-accordion-infoiconclick",6),this.kupFocus=o(this,"kup-accordion-focus",6),this.kupToolbarItemClick=o(this,"kup-accordion-toolbaritemclick",6),this.toolbarState=[],this.infoState=[],this.kupManager=a(),_.set(this,null),this.slotsNames=[],g.set(this,null),this.selectedItems=[],this.customStyle="",this.data=null,this.infoIcon=!1,this.ripple=!1,this.toolbar=!1,this.sizing=c.SMALL,this.toolbarCallback=void 0,this.infoCallback=void 0}onKupBlur(i){this.kupBlur.emit({comp:this,id:this.rootElement.id,node:i})}onKupClick(i,o){this.data[i].contentVisible=!this.data[i].contentVisible,this.updateSelectedItems(),this.kupClick.emit({comp:this,id:this.rootElement.id,node:o})}onKupIconClick(i){i?(v(this,g,i,"f"),this.createDropDownToolbarList()):this.kupManager.debug.logMessage(this,"onKupIconClick: Element is null")}onKupInfoIconClick(i){i?(v(this,g,i,"f"),this.createDropDownInfoList()):this.kupManager.debug.logMessage(this,"onKupIconClick: Element is null")}onKupFocus(i){this.kupFocus.emit({comp:this,id:this.rootElement.id,node:i})}onKupToolbarItemClick(i){this.kupToolbarItemClick.emit({comp:this,id:this.rootElement.id,node:i.detail.selected})}applyRipple(){const i=this.rootElement.shadowRoot;if(i&&this.ripple){const o=i.querySelectorAll(".mdc-ripple-surface:not(.mdc-ripple-upgraded)");if(o)for(let i=0;i<o.length;i++)m.attachTo(o[i])}}updateSelectedItems(){var i;const o=[];if(null===(i=this.data)||void 0===i?void 0:i.length)for(let i=0;i<this.data.length;i++){const t=this.data[i];t.contentVisible&&o.push(t.id)}this.selectedItems=o}async collapseAll(){const i=[];for(let o=0;o<this.data.length;o++){const t=this.data[o].id;!this.isItemExpandible(t)&&this.isItemSelected(t)&&i.push(t)}this.selectedItems=i}async expandAll(){const i=[];for(let o=0;o<this.data.length;o++){const t=this.data[o].id;this.isItemExpandible(t)&&i.push(t)}this.selectedItems=i}async getProps(i){return s(this,k,i)}async refresh(){t(this)}async setProps(i){p(this,k,i)}async toggleItem(i){const o=[...this.selectedItems];o.includes(i.id)?o.splice(o.indexOf(i.id),1):o.push(i.id),this.selectedItems=o,this.kupClick.emit({comp:this,id:this.rootElement.id,node:i})}isItemExpandible(i){return this.slotsNames.includes(i)}isItemSelected(i){return this.selectedItems.includes(i)}renderItems(){var i,o;const t=[],r=Array.prototype.slice.call(this.rootElement.children,0);this.slotsNames=[];for(let i=0;i<r.length;i++)this.slotsNames.push(r[i].slot);for(let r=0;r<this.data.length;r++){const n=this.data[r],a=n.id,c=this.isItemSelected(a),s=this.isItemExpandible(a),p={"accordion-item__header":!0,"accordion-item__header--selected":!(s||!c),"accordion-item__header--expanded":!(!s||!c),"mdc-ripple-surface":!!this.ripple,[`accordion-item--${this.sizing}`]:!!this.sizing},d={"accordion-item__content":!0,"accordion-item__content--selected":!!c},f=e("div",{class:"accordion-rigtbuttons"},this.infoIcon&&e(u,{resource:"info_outline",sizeX:"16px",sizeY:"16px",onClick:async i=>{i.stopPropagation();const o=i.currentTarget,t=await this.infoCallback();this.infoState=t,this.infoState.length>0?this.onKupInfoIconClick(o):this.kupManager.debug.logMessage(this,"InfoIcon data is empty, not opening dropdown.")},wrapperClass:"tab__iconToolbar iconInfo"}),this.toolbar&&e(u,{resource:"more_vert",sizeX:"16px",sizeY:"16px",onClick:async i=>{i.stopPropagation();const o=i.currentTarget,t=await this.toolbarCallback();this.toolbarState=t,this.toolbarState.length>0?this.onKupIconClick(o):this.kupManager.debug.logMessage(this,"Toolbar data is empty, not opening dropdown.")},wrapperClass:"tab__iconToolbar iconToolbar"}),s?e("div",{class:`accordion-item__dropdown kup-icon ${h.DROPDOWN.replace("--","")}`}):null);t.push(e("div",{class:"accordion-item"},e("div",{tabindex:r,title:null!==(i=n.title)&&void 0!==i?i:null,class:p,onClick:()=>this.toggleItem(n),onBlur:()=>this.onKupBlur(n),onFocus:()=>this.onKupFocus(n)},n.icon?e(u,{color:`var(${l.PRIMARY})`,resource:n.icon,placeholderResource:n.placeholderIcon,sizeX:"1.5em",sizeY:"1.5em",wrapperClass:"accordion-item__icon"}):null,n.value?e("span",{class:"accordion-item__text"},null!==(o=n.value)&&void 0!==o?o:""):null,f),e("div",{class:d},e("slot",{name:n.id}))))}return t}closeRowToolbarList(){this.toolbarList&&(this.kupManager.dynamicPosition.stop(this.toolbarList),this.kupManager.removeClickCallback(b(this,_,"f")),this.toolbarList.remove(),this.kupManager.dynamicPosition.unregister([this.toolbarList]),this.toolbarList=null)}createDropDownToolbarList(){if(!b(this,g,"f"))return void this.kupManager.debug.logMessage(this,"createDropDownToolbarList: Anchor is null!");if(this.toolbarList&&this.closeRowToolbarList(),0===this.toolbarState.length)return void this.kupManager.debug.logMessage(this,"No toolbar state available.");const i=document.createElement("kup-toolbar");i.data=this.toolbarState,i.addEventListener("kup-toolbar-click",(i=>{this.onKupToolbarItemClick(i),setTimeout((()=>{this.closeRowToolbarList()}),0)})),this.toolbarList=i,v(this,_,{cb:()=>{this.closeRowToolbarList()},el:this.toolbarList},"f"),this.kupManager.addClickCallback(b(this,_,"f"),!0),this.rootElement.shadowRoot.appendChild(this.toolbarList),requestAnimationFrame((()=>{b(this,g,"f")?(this.kupManager.dynamicPosition.register(this.toolbarList,b(this,g,"f"),0,d.AUTO,!0),this.kupManager.dynamicPosition.start(this.toolbarList)):this.kupManager.debug.logMessage(this,"DropDown anchor is still null after delay!")}))}createDropDownInfoList(){if(!b(this,g,"f"))return void this.kupManager.debug.logMessage(this,"createDropDownToolbarList: Anchor is null!");if(this.infoList&&this.closeInfoDataList(),0===this.infoState.length)return void this.kupManager.debug.logMessage(this,"No toolbar state available.");const i=document.createElement("kup-list");i.data=this.infoState,this.infoList=i,v(this,_,{cb:()=>{this.closeInfoDataList()},el:this.infoList},"f"),this.kupManager.addClickCallback(b(this,_,"f"),!0),this.rootElement.shadowRoot.appendChild(this.infoList),requestAnimationFrame((()=>{this.kupManager.dynamicPosition.register(this.infoList,b(this,g,"f"),0,d.AUTO,!0),this.kupManager.dynamicPosition.start(this.infoList)}))}closeInfoDataList(){this.infoList&&(this.kupManager.dynamicPosition.stop(this.infoList),this.kupManager.removeClickCallback(b(this,_,"f")),this.infoList.remove(),this.kupManager.dynamicPosition.unregister([this.infoList]),this.infoList=null)}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.updateSelectedItems(),this.applyRipple(),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const i=this.rootElement.shadowRoot;if(i){const o=i.querySelectorAll(".mdc-ripple-surface");if(o)for(let i=0;i<o.length;i++)m.attachTo(o[i])}this.kupManager.debug.logRender(this,!0)}render(){const i=this.data&&this.data.length?this.renderItems():null;return e(r,{key:"3f9af91ddcf48e60b8ac506dfbc7991eea418f70"},e("style",{key:"3179a55c30b7a726f2f6cc20f15fd4c3003160c5"},this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{key:"f7f9910a40af9bb7f0891523d1b30e3d7677c5b6",id:f},e("div",{key:"c267fd8005f786b4a0e9207ab553b12a7044cc46",class:"accordion"},i)))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return n(this)}static get watchers(){return{ripple:["applyRipple"],data:["updateSelectedItems"]}}};_=new WeakMap,g=new WeakMap,y.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_accordion_border_top_color:var(\n --kup-accordion-border-top-color,\n var(--kup-border-subtle)\n );--kup_accordion_item_small_height:var(\n --kup-accordion-item-small-height,\n 32px\n );--kup_accordion_item_medium_height:var(\n --kup-accordion-item-medium-height,\n 40px\n );--kup_accordion_item_outline_color_active:var(\n --kup-accordion-item-outline-color-focus,\n var(--kup-border-interactive)\n );--kup_accordion_item_large_height:var(\n --kup-accordion-item-medium-height,\n 48px\n );--kup_accordion_header_background_color:var(\n --kup-accordion-header-background-color,\n var(--kup-layer-0)\n );--kup_accordion_header_background_color_hover:var(\n --kup-accordion-header-background-color-hover,\n var(--kup-layer-0-hover)\n );--kup_accordion_header_padding:var(\n --kup-accordion-header-padding,\n var(--kup-space-05)\n );--kup_accordion_dropdown_icon_color:var(\n --kup-accordio-dropdown-icon-color,\n var(--kup-text-primary)\n );--kup_accordion_transition:var(--kup-accordion-transition, 80ms);display:block;font-family:var(--kup_accordion_font_family);font-size:var(--kup_accordion_font_size)}.accordion{border-radius:var(--kup_accordion_border_radius);display:flex;flex-wrap:wrap;flex-direction:column;width:100%}.accordion-item{border-top:1px solid var(--kup_accordion_border_top_color);box-sizing:border-box;width:100%}.accordion-item--visible{display:block}.accordion-item:is(:last-of-type){border-bottom:1px solid var(--kup_accordion_border_top_color)}.accordion-item__header{height:var(--kup_accordion_item_medium_height);align-items:center;border:none;box-sizing:border-box;color:var(--kup_accordion_text_color);cursor:pointer;display:flex;line-height:1.75em;outline:none;padding:var(--kup_accordion_padding);text-align:left;transition:background-color var(--kup_accordion_transition), color var(--kup_accordion_transition);width:100%;outline:2px solid transparent;outline-offset:-2px;padding-left:16px;padding-right:16px;gap:var(--kup-space-03)}.accordion-item__header:focus{outline:2px solid var(--kup_accordion_item_outline_color_active)}.accordion-item__header.accordion-item--small{height:var(--kup_accordion_item_small_height)}.accordion-item__header.accordion-item--large{height:var(--kup_accordion_item_large_height)}.accordion-item__header:hover:not(.accordion-item__header--selected){background-color:var(--kup_accordion_header_background_color_hover)}.accordion-item__header:focus(.accordion-item__header--selected){outline:2px solid var(--kup_accordion_item_outline_color_active)}.accordion-item__header--expanded{background-color:var(--kup_accordion_background_color)}.accordion-item__header--expanded .accordion-item__dropdown{transform:rotate(-180deg)}.accordion-item__header .f-image{margin:0}.accordion-item__header .accordion-rigtbuttons{margin-left:auto;margin-right:0;display:flex;gap:var(--kup-space-03)}.accordion-item__text{margin-right:0.5em;overflow:hidden;text-overflow:ellipsis;white-space:pre}.accordion-item__text--highlighted{color:var(--kup_accordion_text_on_primary_color);background-color:var(--kup_accordion_primary_color)}.accordion-item__icon{margin-left:0;margin-right:0.5em}.accordion-item__dropdown{background-color:var(--kup_accordion_dropdown_icon_color);height:1.5em;min-width:1.5em;width:1.5em;transition:transform var(--kup_accordion_transition)}.accordion-item__content{padding-left:16px;padding-top:8px;padding-bottom:24px;padding-right:80px;animation:fade-in 0.25s ease-out;display:none;font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.accordion-item__content--selected{display:block}.mdc-ripple-surface{--mdc-ripple-fg-opacity:0.24}.mdc-ripple-surface:before,.mdc-ripple-surface:after{background-color:var(--kup_accordion_primary_color)}.kup-icon.kup-dropdown-icon{-webkit-mask:var(--kup-dropdown-icon);mask:var(--kup-dropdown-icon)}:host(.kup-borderless){--kup-accordion-border:none}:host(.kup-full-height){height:100%}:host(.kup-full-width){width:100%}:host(.kup-danger){--kup-accordion-primary-color:var(--kup-danger-color-60);--kup-accordion-primary-color-rgb:var(--kup-danger-color-60-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-info){--kup-accordion-primary-color:var(--kup-info-50-color);--kup-accordion-primary-color-rgb:var(--kup-info-color-50-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-secondary){--kup-accordion-primary-color:var(--kup-secondary-color);--kup-accordion-primary-color-rgb:var(--kup-secondary-color-rgb);--kup-accordion-text-on-primary-color:var(--kup-text-on-secondary-color)}:host(.kup-success){--kup-accordion-primary-color:var(--kup-success-color-40);--kup-accordion-primary-color-rgb:var(--kup-success-color-40-rgb);--kup-accordion-text-on-primary-color:white}:host(.kup-warning){--kup-accordion-primary-color:var(--kup-warning-color-50);--kup-accordion-primary-color-rgb:var(--kup-warning-color-50-rgb);--kup-accordion-text-on-primary-color:white}";export{y as kup_accordion}
@@ -1 +1 @@
1
- import{h as e}from"./p-710d0a7d.js";import{F as l}from"./p-3cab6420.js";import{I as n,d as i,b as c}from"./p-77d2021c.js";function r(e,l,i){const{id:c,value:r}=e;if(null==c&&r)return r;if(c&&null==r)return c;switch(l){case n.CODE:return c;case n.DESCRIPTION:return r;case n.CODE_AND_DESC:case n.CODE_AND_DESC_ALIAS:return c&&r?c+i+r:c||r;case n.DESC_AND_CODE:return r&&c?r+i+c:r||c;default:return c}}function s(e,l,i,c,s,t){const a=!!(i&&l&&l.data);let u="",o="",p=null;null!=t&&(p=t.detail.selected),null==p&&null!=e&&a&&(p=function(e,l,i){if(e&&e.data){let c=!1,s=null;for(let t=0;t<e.data.length;t++){let a=r(e.data[t],""==l?n.DESCRIPTION:i," - ");e.data[t].selected=!1,c||a.toString().toLowerCase()!=l.toString().toLowerCase()||(s=e.data[t],s.selected=!0,c=!0)}if(1==c)return s}return function(e,l){if(e&&e.data){let n=!1,i=null;for(let c=0;c<e.data.length;c++)e.data[c].selected=!1,n||e.data[c].id.toString().toLowerCase()!=l.toString().toLowerCase()||(i=e.data[c],i.selected=!0,n=!0);if(1==n)return i;for(let c=0;c<e.data.length;c++)if(e.data[c].value.toString().toLowerCase()==l.toString().toLowerCase()){i=e.data[c],i.selected=!0,n=!0;break}if(1==n)return i}return null}(e,l)}(l,e,s),i.data=[...l.data]),null==p&&null==e&&l&&(p=function(e){if(e.data)for(let l=0;l<e.data.length;l++)if(e.data[l].selected)return e.data[l];return null}(l));let d=null;null==p?(p={id:null==e?"":e,value:null==e?"":e},u=p.id,o=p.id,d=p.id):(u=r(p,c," - "),o=r(p,""==u?n.DESCRIPTION:s," - "),d=r(p,n.CODE," - "));const h=a?l.data.find((e=>e.id===d)):null;return{value:u,displayedValue:o,node:h,exists:!!h}}var t,a,u;!function(e){e.CHOICE="choice",e.FILTER="filter",e.INPUT="input",e.STANDARD="standard"}(t||(t={})),function(e){e.OUTLINED="outlined",e.RAISED="raised"}(a||(a={})),function(e){e.SMALL="small",e.MEDIUM="medium"}(u||(u={}));const o=document.documentElement,p=s=>{s.styling||(s.styling=a.RAISED),s.type||(s.type=t.STANDARD),s.displayMode||(s.displayMode=n.DESCRIPTION);const u=s.type.toLowerCase()===t.CHOICE,p=s.type.toLowerCase()===t.FILTER,d=s.type.toLowerCase()===t.INPUT,h=s.styling.toLowerCase()===a.OUTLINED,f={"chip-set":!0,"chip-set--choice":!!u,"chip-set--filter":!!p,"chip-set--input":!!d,"chip--outlined":!!h,"chip--raised":!h,[`chip--${s.sizing||"extra-small"}`]:!0};return e("div",Object.assign({class:`f-chip ${s.danger?"kup-danger":""} ${s.info?"kup-info":""} ${s.secondary?"kup-secondary":""} ${s.success?"kup-success":""} ${s.warning?"kup-warning":""} ${s.wrapperClass?s.wrapperClass:""} ${s.primary?"kup-primary":""}`},s.dataSet,{id:s.id,title:s.title}),e("div",{class:f,role:"grid"},function(s,t,a,u){const p=[];for(let d=0;s.data&&d<s.data.length;d++){const h=[];function f(n,r){const t=!!(n.children&&n.children.length>0),a=!(!t||!n.isExpanded),u={"--kup_chip_indent_offset":r.toString()},p=s.disabled;if(h.push(e("div",{class:"chip-set__wrapper "+(t&&!a?"chip-set__wrapper--hidden-children":"")},e("div",{class:"chip-set__indent",style:u}),t?e(l,{onClick:s.onExpansionClick&&s.onExpansionClick[d]?s.onExpansionClick[d].bind(s.onExpansionClick[d],n):null,resource:`${i.DROPDOWN}`,sizeX:"16px",sizeY:"16px",title:o.ketchup.language.translate(c.EXPAND)+"/"+o.ketchup.language.translate(c.COLLAPSE)+" (CTRL + Click)",wrapperClass:"dropdown-icon"}):r?e(l,{resource:"blank",sizeX:"16px",sizeY:"16px",wrapperClass:"dropdown-icon"}):null,_(n,p))),a)for(let e=0;e<n.children.length;e++)n.children[e]&&f(n.children[e],r+1)}function _(c,o){let p=`chip ${c.icon&&!c.value?"chip--only-icon":""} ${o&&"chip--disabled"}`,h=[],f="chip__icon chip__icon--leading";(a||t)&&c.checked&&(p+=" chip--selected",a&&(f+=" chip__icon--leading-hidden")),c.icon&&h.push(e(l,Object.assign({},{color:t&&c.checked?"var(--kup_chip_primary_color)":"var(--kup_chip_text_color)",resource:c.icon,placeholderResource:c.placeholderIcon,sizeX:"16px",sizeY:"16px",wrapperClass:f}))),a&&h.push(e("span",{class:"chip__checkmark"},e("svg",{class:"chip__checkmark-svg",viewBox:"-2 -3 30 30"},e("path",{class:"chip__checkmark-path",fill:"none",stroke:"black",d:"M1.73,12.91 8.1,19.28 22.79,4.59"}))));let _=r(c,""==c.value?n.CODE:s.displayMode," - ");return e("div",{class:p,"data-value":c.id,onClick:s.onClick&&s.onClick[d]?s.onClick[d].bind(s.onClick[d],c):null,role:"row",title:c.title?c.title:""},e("span",{class:"chip-set__indent"}),h,e("span",{role:"gridcell"},e("span",{role:"button",tabindex:d,class:"chip__primary-action",value:c.id,checked:c.checked,onBlur:s.onBlur&&s.onBlur[d]?s.onBlur[d].bind(s.onBlur[d],c):null,onFocus:s.onFocus&&s.onFocus[d]?s.onFocus[d].bind(s.onFocus[d],c):null},e("span",{class:"chip__text"},_))),u?e("span",{role:"gridcell"},e("span",{tabindex:"-1",class:`kup-icon chip__icon ${i.CLEAR.replace("--","")}`,onClick:s.onIconClick&&s.onIconClick[d]?s.onIconClick[d].bind(s.onIconClick[d],c):null})):null)}f(s.data[d],0),p.push(e("div",{class:"chip-set__item"},...h))}return p}(s,u,p,d)))};export{t as F,u as a,a as b,s as c,p as d,r as g}
1
+ import{h as e}from"./p-710d0a7d.js";import{F as l}from"./p-3cab6420.js";import{I as n,d as i,b as c}from"./p-8610d5b5.js";function r(e,l,i){const{id:c,value:r}=e;if(null==c&&r)return r;if(c&&null==r)return c;switch(l){case n.CODE:return c;case n.DESCRIPTION:return r;case n.CODE_AND_DESC:case n.CODE_AND_DESC_ALIAS:return c&&r?c+i+r:c||r;case n.DESC_AND_CODE:return r&&c?r+i+c:r||c;default:return c}}function s(e,l,i,c,s,t){const a=!!(i&&l&&l.data);let u="",o="",p=null;null!=t&&(p=t.detail.selected),null==p&&null!=e&&a&&(p=function(e,l,i){if(e&&e.data){let c=!1,s=null;for(let t=0;t<e.data.length;t++){let a=r(e.data[t],""==l?n.DESCRIPTION:i," - ");e.data[t].selected=!1,c||a.toString().toLowerCase()!=l.toString().toLowerCase()||(s=e.data[t],s.selected=!0,c=!0)}if(1==c)return s}return function(e,l){if(e&&e.data){let n=!1,i=null;for(let c=0;c<e.data.length;c++)e.data[c].selected=!1,n||e.data[c].id.toString().toLowerCase()!=l.toString().toLowerCase()||(i=e.data[c],i.selected=!0,n=!0);if(1==n)return i;for(let c=0;c<e.data.length;c++)if(e.data[c].value.toString().toLowerCase()==l.toString().toLowerCase()){i=e.data[c],i.selected=!0,n=!0;break}if(1==n)return i}return null}(e,l)}(l,e,s),i.data=[...l.data]),null==p&&null==e&&l&&(p=function(e){if(e.data)for(let l=0;l<e.data.length;l++)if(e.data[l].selected)return e.data[l];return null}(l));let d=null;null==p?(p={id:null==e?"":e,value:null==e?"":e},u=p.id,o=p.id,d=p.id):(u=r(p,c," - "),o=r(p,""==u?n.DESCRIPTION:s," - "),d=r(p,n.CODE," - "));const h=a?l.data.find((e=>e.id===d)):null;return{value:u,displayedValue:o,node:h,exists:!!h}}var t,a,u;!function(e){e.CHOICE="choice",e.FILTER="filter",e.INPUT="input",e.STANDARD="standard"}(t||(t={})),function(e){e.OUTLINED="outlined",e.RAISED="raised"}(a||(a={})),function(e){e.SMALL="small",e.MEDIUM="medium"}(u||(u={}));const o=document.documentElement,p=s=>{s.styling||(s.styling=a.RAISED),s.type||(s.type=t.STANDARD),s.displayMode||(s.displayMode=n.DESCRIPTION);const u=s.type.toLowerCase()===t.CHOICE,p=s.type.toLowerCase()===t.FILTER,d=s.type.toLowerCase()===t.INPUT,h=s.styling.toLowerCase()===a.OUTLINED,f={"chip-set":!0,"chip-set--choice":!!u,"chip-set--filter":!!p,"chip-set--input":!!d,"chip--outlined":!!h,"chip--raised":!h,[`chip--${s.sizing||"extra-small"}`]:!0};return e("div",Object.assign({class:`f-chip ${s.danger?"kup-danger":""} ${s.info?"kup-info":""} ${s.secondary?"kup-secondary":""} ${s.success?"kup-success":""} ${s.warning?"kup-warning":""} ${s.wrapperClass?s.wrapperClass:""} ${s.primary?"kup-primary":""}`},s.dataSet,{id:s.id,title:s.title}),e("div",{class:f,role:"grid"},function(s,t,a,u){const p=[];for(let d=0;s.data&&d<s.data.length;d++){const h=[];function f(n,r){const t=!!(n.children&&n.children.length>0),a=!(!t||!n.isExpanded),u={"--kup_chip_indent_offset":r.toString()},p=s.disabled;if(h.push(e("div",{class:"chip-set__wrapper "+(t&&!a?"chip-set__wrapper--hidden-children":"")},e("div",{class:"chip-set__indent",style:u}),t?e(l,{onClick:s.onExpansionClick&&s.onExpansionClick[d]?s.onExpansionClick[d].bind(s.onExpansionClick[d],n):null,resource:`${i.DROPDOWN}`,sizeX:"16px",sizeY:"16px",title:o.ketchup.language.translate(c.EXPAND)+"/"+o.ketchup.language.translate(c.COLLAPSE)+" (CTRL + Click)",wrapperClass:"dropdown-icon"}):r?e(l,{resource:"blank",sizeX:"16px",sizeY:"16px",wrapperClass:"dropdown-icon"}):null,_(n,p))),a)for(let e=0;e<n.children.length;e++)n.children[e]&&f(n.children[e],r+1)}function _(c,o){let p=`chip ${c.icon&&!c.value?"chip--only-icon":""} ${o&&"chip--disabled"}`,h=[],f="chip__icon chip__icon--leading";(a||t)&&c.checked&&(p+=" chip--selected",a&&(f+=" chip__icon--leading-hidden")),c.icon&&h.push(e(l,Object.assign({},{color:t&&c.checked?"var(--kup_chip_primary_color)":"var(--kup_chip_text_color)",resource:c.icon,placeholderResource:c.placeholderIcon,sizeX:"16px",sizeY:"16px",wrapperClass:f}))),a&&h.push(e("span",{class:"chip__checkmark"},e("svg",{class:"chip__checkmark-svg",viewBox:"-2 -3 30 30"},e("path",{class:"chip__checkmark-path",fill:"none",stroke:"black",d:"M1.73,12.91 8.1,19.28 22.79,4.59"}))));let _=r(c,""==c.value?n.CODE:s.displayMode," - ");return e("div",{class:p,"data-value":c.id,onClick:s.onClick&&s.onClick[d]?s.onClick[d].bind(s.onClick[d],c):null,role:"row",title:c.title?c.title:""},e("span",{class:"chip-set__indent"}),h,e("span",{role:"gridcell"},e("span",{role:"button",tabindex:d,class:"chip__primary-action",value:c.id,checked:c.checked,onBlur:s.onBlur&&s.onBlur[d]?s.onBlur[d].bind(s.onBlur[d],c):null,onFocus:s.onFocus&&s.onFocus[d]?s.onFocus[d].bind(s.onFocus[d],c):null},e("span",{class:"chip__text"},_))),u?e("span",{role:"gridcell"},e("span",{tabindex:"-1",class:`kup-icon chip__icon ${i.CLEAR.replace("--","")}`,onClick:s.onIconClick&&s.onIconClick[d]?s.onIconClick[d].bind(s.onIconClick[d],c):null})):null)}f(s.data[d],0),p.push(e("div",{class:"chip-set__item"},...h))}return p}(s,u,p,d)))};export{t as F,u as a,a as b,s as c,p as d,r as g}
@@ -1,4 +1,4 @@
1
- import{r as t,c as n,f as i,h as r,H as e,d as o,g as a}from"./p-710d0a7d.js";import{k as s,g as u,s as l,f,h,x as c,p as v}from"./p-77d2021c.js";import{c as d}from"./p-635bb4b3.js";import"./p-1ee561ba.js";
1
+ import{r as t,c as n,f as i,h as r,H as e,d as o,g as a}from"./p-710d0a7d.js";import{k as s,g as u,s as l,f,h,x as c,p as v}from"./p-8610d5b5.js";import{c as d}from"./p-635bb4b3.js";import"./p-1ee561ba.js";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4