@sme.up/ketchup 11.0.0-SNAPSHOT-20241219114939 → 11.0.0-SNAPSHOT-20241219162247

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 (84) hide show
  1. package/dist/cjs/kup-activity-timeline.cjs.entry.js +1 -1
  2. package/dist/cjs/kup-autocomplete_28.cjs.entry.js +1 -1
  3. package/dist/cjs/kup-box.cjs.entry.js +1 -1
  4. package/dist/cjs/{kup-data-table-helper-a9d48da9.js → kup-data-table-helper-26124c07.js} +0 -5
  5. package/dist/cjs/kup-input-panel.cjs.entry.js +11 -3
  6. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +0 -6
  7. package/dist/collection/components/kup-input-panel/kup-input-panel.js +11 -3
  8. package/dist/components/kup-accordion.js +1 -1
  9. package/dist/components/kup-activity-timeline.js +1 -1
  10. package/dist/components/kup-autocomplete.js +1 -1
  11. package/dist/components/kup-badge.js +1 -1
  12. package/dist/components/kup-box.js +1 -1
  13. package/dist/components/kup-button-list.js +1 -1
  14. package/dist/components/kup-button.js +1 -1
  15. package/dist/components/kup-calendar.js +1 -1
  16. package/dist/components/kup-card-list.js +2 -2
  17. package/dist/components/kup-card.js +1 -1
  18. package/dist/components/kup-cell.js +1 -1
  19. package/dist/components/kup-chart.js +1 -1
  20. package/dist/components/kup-checkbox.js +1 -1
  21. package/dist/components/kup-chip.js +1 -1
  22. package/dist/components/kup-color-picker.js +1 -1
  23. package/dist/components/kup-combobox.js +1 -1
  24. package/dist/components/kup-dashboard.js +1 -1
  25. package/dist/components/kup-data-table.js +1 -1
  26. package/dist/components/kup-date-picker.js +1 -1
  27. package/dist/components/kup-dialog.js +1 -1
  28. package/dist/components/kup-drawer.js +1 -1
  29. package/dist/components/kup-dropdown-button.js +1 -1
  30. package/dist/components/kup-echart.js +1 -1
  31. package/dist/components/kup-editor.js +1 -1
  32. package/dist/components/kup-family-tree.js +2 -2
  33. package/dist/components/kup-form.js +1 -1
  34. package/dist/components/kup-gauge.js +1 -1
  35. package/dist/components/kup-grid.js +1 -1
  36. package/dist/components/kup-htm.js +1 -1
  37. package/dist/components/kup-iframe.js +1 -1
  38. package/dist/components/kup-image-list.js +1 -1
  39. package/dist/components/kup-image.js +1 -1
  40. package/dist/components/kup-input-panel.js +13 -5
  41. package/dist/components/kup-lazy.js +1 -1
  42. package/dist/components/kup-list.js +1 -1
  43. package/dist/components/kup-magic-box.js +3 -3
  44. package/dist/components/kup-nav-bar.js +1 -1
  45. package/dist/components/kup-numeric-picker.js +1 -1
  46. package/dist/components/kup-object-field.js +1 -1
  47. package/dist/components/kup-pdf.js +1 -1
  48. package/dist/components/kup-photo-frame.js +1 -1
  49. package/dist/components/kup-planner.js +1 -1
  50. package/dist/components/kup-probe.js +1 -1
  51. package/dist/components/kup-progress-bar.js +1 -1
  52. package/dist/components/kup-qlik.js +1 -1
  53. package/dist/components/kup-radio.js +1 -1
  54. package/dist/components/kup-rating.js +1 -1
  55. package/dist/components/kup-snackbar.js +1 -1
  56. package/dist/components/kup-spinner.js +1 -1
  57. package/dist/components/kup-switch.js +1 -1
  58. package/dist/components/kup-tab-bar.js +1 -1
  59. package/dist/components/kup-text-field.js +1 -1
  60. package/dist/components/kup-time-picker.js +1 -1
  61. package/dist/components/kup-toolbar.js +1 -1
  62. package/dist/components/kup-tree.js +1 -1
  63. package/dist/components/kup-txt.js +1 -1
  64. package/dist/components/kup-typography-list.js +1 -1
  65. package/dist/components/kup-typography.js +1 -1
  66. package/dist/components/{p-47cc7b08.js → p-4025180d.js} +1 -1
  67. package/dist/components/{p-2b0a0da6.js → p-4238f664.js} +0 -5
  68. package/dist/components/{p-83fd5217.js → p-56f9e078.js} +1 -1
  69. package/dist/components/{p-a86c9cef.js → p-8bbfc57b.js} +1 -1
  70. package/dist/components/{p-2afcf8ed.js → p-939e51f5.js} +1 -1
  71. package/dist/esm/kup-activity-timeline.entry.js +1 -1
  72. package/dist/esm/kup-autocomplete_28.entry.js +1 -1
  73. package/dist/esm/kup-box.entry.js +1 -1
  74. package/dist/esm/{kup-data-table-helper-2961c852.js → kup-data-table-helper-b100ec55.js} +1 -6
  75. package/dist/esm/kup-input-panel.entry.js +11 -3
  76. package/dist/ketchup/ketchup.esm.js +1 -1
  77. package/dist/ketchup/{p-446e2171.entry.js → p-2140d2e2.entry.js} +1 -1
  78. package/dist/ketchup/{p-9796e1bc.entry.js → p-59cdb15a.entry.js} +1 -1
  79. package/dist/ketchup/p-5b74ff2c.entry.js +1 -0
  80. package/dist/ketchup/p-881062e9.js +1 -0
  81. package/dist/ketchup/{p-1dbbe6ad.entry.js → p-c7af2027.entry.js} +1 -1
  82. package/package.json +1 -1
  83. package/dist/ketchup/p-4173c875.entry.js +0 -1
  84. package/dist/ketchup/p-fae98674.js +0 -1
@@ -1 +0,0 @@
1
- import{r as t,c as i,f as n,h as e,H as l,d as s}from"./p-b0368f88.js";import{F as o}from"./p-1bdc7796.js";import{F as a}from"./p-9127e020.js";import{k as u,a5 as r,F as h,g as c,s as p,h as f,an as d,ac as m,am as v,ab as b,ao as k,e as g,N as _}from"./p-7272d9aa.js";import{F as x}from"./p-7db300e0.js";import{F as y,a as w}from"./p-60cfddce.js";import{c as j}from"./p-635bb4b3.js";import"./p-e3062c19.js";import"./p-d1c818ae.js";import"./p-3913eb45.js";import"./p-65533633.js";import"./p-1cc917f6.js";import"./p-e0678743.js";import"./p-1ee561ba.js";import"./p-c56195a0.js";var O,F,$,T;!function(t){t.TAB="tab"}(O||(O={})),function(t){t.customStyle="Custom style of the component.",t.data="Actual data of the input panel.",t.hiddenSubmitButton="Creates a hidden submit button in order to submit the form with enter.",t.submitCb="Sets the callback function on submit form",t.optionsHandler="Sets the callback function to recieve options",t.buttonPosition="Manage the position of the buttons related to the input panel content. It is an enumeration",t.inputPanelPosition="Manage the global layout of the input panel fields. The default is COLUMNS.",t.autoSkip="Sets the auto skip between input text fields when the value reaches the max length.",t.autoFocus="Sets whether the first input should receive focus."}(F||(F={})),function(t){t.COLUMNS="COLUMNS",t.INLINE="INLINE",t.STRETCHED="STRETCHED",t.UPINLINE="UPINLINE",t.UPCOLUMNS="UPCOLUMNS",t.PLACEHOLDER="PLACEHOLDER"}($||($={})),function(t){t.CENTER="CENTER",t.LEFT="LEFT",t.BOTTOM="BOTTOM",t.RIGHT="RIGHT",t.TOP="TOP"}(T||(T={}));const E={"*F01":"F1","*F02":"F2","*F03":"F3","*F04":"F4","*F05":"F5","*F06":"F6","*F07":"F7","*F08":"F8","*F09":"F9","*F10":"F10","*F11":"F11","*F12":"F12","*F13":"shift+F1","*F14":"shift+F2","*F15":"shift+F3","*F16":"shift+F4","*F17":"shift+F5","*F18":"shift+F6","*F19":"shift+F7","*F20":"shift+F8","*F21":"shift+F9","*F22":"shift+F10","*F23":"shift+F11","*F24":"shift+F12","*ENT":"Enter","*PDN":"PageDown","*PUP":"PageUp"},z=t=>0==t?6:t?1===t?18:12*t:null,M=t=>t?22*t:null,S=t=>t?22*(t-1):null,N=t=>t?12*t:null;var C,I,D,L,P,W,R,H,U,A,K,G,V,B,J,X,Y,q,Q,Z,tt,it,nt,et,lt,st,ot,at,ut,rt,ht,ct,pt,ft,dt,mt,vt,bt,kt,gt,_t,xt,yt,wt,jt,Ot,Ft,$t,Tt,Et,zt,Mt,St,Nt,Ct,It,Dt,Lt,Pt,Wt,Rt,Ht,Ut,At,Kt,Gt,Vt,Bt,Jt=function(t,i,n,e){if("a"===n&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?e:"a"===n?e.call(t):e?e.value:i.get(t)},Xt=function(t,i,n,e,l){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!l:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?l.call(t,n):l?l.value=n:i.set(t,n),n};const Yt=document.documentElement,qt=class{constructor(n){t(this,n),this.kupReady=i(this,"kup-input-panel-ready",6),this.kupDataTableContextMenu=i(this,"kup-inputpanel-contextmenu",6),C.add(this),I.set(this,u()),D.set(this,void 0),L.set(this,new Map([["SmeupTreeNode",Jt(this,C,"m",Nt).bind(this)],["SmeupDataTree",Jt(this,C,"m",Ct).bind(this)],["SmeupTable",Jt(this,C,"m",It).bind(this)],["SmeupDataTable",Jt(this,C,"m",It).bind(this)]])),P.set(this,null),W.set(this,new Map([[r.AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[r.MULTI_AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[r.COMBOBOX,["kup-combobox-iconclick","kup-combobox-blur"]],[r.MULTI_COMBOBOX,["kup-combobox-iconclick"]]])),R.set(this,[]),H.set(this,new Map([[r.DATE,"kup-date-picker"],[r.TIME,"kup-time-picker"]])),U.set(this,new Map([[h.BUTTON_LIST,Jt(this,C,"m",J).bind(this)],[h.EDITOR,Jt(this,C,"m",Y).bind(this)],[h.LABEL,Jt(this,C,"m",Q).bind(this)],[h.TABLE,Jt(this,C,"m",q).bind(this)]])),A.set(this,new Map([[O.TAB,Jt(this,C,"m",st).bind(this)]])),K.set(this,[]),this.buttonPosition=T.BOTTOM,this.customStyle="",this.dashboardMode=!1,this.data=null,this.hiddenSubmitButton=!1,this.inputPanelPosition=$.COLUMNS,this.submitCb=null,this.optionsHandler=null,this.customButtonClickHandler=null,this.checkValidObjCallback=null,this.checkValidValueCallback=null,this.autoFocus=!1,this.autoSkip=!1,this.inputPanelCells=[],this.inputPanelCommands=[],this.tabSelected=null}onDataChanged(){Xt(this,P,structuredClone(this.data),"f"),Jt(this,R,"f").length&&(Jt(this,R,"f").map((({event:t,handler:i})=>{this.rootElement.removeEventListener(t,i)})),Xt(this,R,[],"f")),Jt(this,K,"f").length&&(Jt(this,K,"f").map((t=>{Jt(this,I,"f").keysBinding.unregister(t)})),Xt(this,K,[],"f")),this.data&&Jt(this,C,"m",rt).call(this,this.data)}async getProps(t){return c(this,F,t)}async refresh(){n(this)}async setProps(t){p(this,F,t)}componentWillLoad(){Jt(this,I,"f").debug.logLoad(this,!1),Jt(this,I,"f").language.register(this),Jt(this,I,"f").theme.register(this),this.onDataChanged()}componentDidLoad(){Jt(this,C,"m",Kt).call(this),this.kupReady.emit({comp:this,id:this.rootElement.id}),Jt(this,C,"m",Gt).call(this),Jt(this,I,"f").debug.logLoad(this,!0)}componentWillRender(){Jt(this,I,"f").debug.logRender(this,!1)}componentDidRender(){if(Jt(this,D,"f")){const t=Jt(this,D,"f").querySelectorAll(".f-text-field");for(let i=0;i<t.length;i++)x(t[i])}Jt(this,I,"f").debug.logRender(this,!0)}render(){const t=Boolean(!this.inputPanelCells.length)?[e("p",null,Jt(this,I,"f").language.translate(f.EMPTY_DATA))]:this.inputPanelCells.map((t=>Jt(this,C,"m",V).call(this,t)));return e(l,{key:"6af3e8b407c283a4cce9e6ded8301c76b7f43ae8","onKup-cell-blur":Jt(this,C,"m",Pt).bind(this),"onKup-tabbar-click":t=>{this.tabSelected=t.detail.node.id},"onKup-autocomplete-input":Jt(this,C,"m",gt).bind(this),"onKup-autocomplete-iconclick":Jt(this,C,"m",gt).bind(this),"onKup-combobox-iconclick":Jt(this,C,"m",gt).bind(this)},e("style",{key:"5bfaa0f030f931dbdaa848422158df21dd7ddfdb"},Jt(this,I,"f").theme.setKupStyle(this.rootElement)),e("div",{key:"a744689acab9dbf3d6211c644de7cf536eb16912",id:j},t))}disconnectedCallback(){Jt(this,I,"f").language.unregister(this),Jt(this,I,"f").theme.unregister(this)}get rootElement(){return s(this)}static get watchers(){return{data:["onDataChanged"]}}};I=new WeakMap,D=new WeakMap,L=new WeakMap,P=new WeakMap,W=new WeakMap,R=new WeakMap,H=new WeakMap,U=new WeakMap,A=new WeakMap,K=new WeakMap,C=new WeakSet,G=function(t){return this.inputPanelCells.reduce(((i,{cells:n})=>i||n.find((({column:i})=>i.name===t)).cell),null)},V=function(t){var i,n;const l=t.row.layout,s=(null==l?void 0:l.horizontal)||!1,a={};let u;if(null===(i=null==l?void 0:l.sections)||void 0===i?void 0:i.length)if(l.absolute)u=Jt(this,C,"m",it).call(this,t,l),a.height=22*(t=>{let i=0;return t.sections.forEach((t=>{t.content.forEach((t=>{t.absoluteRow>i&&(i=t.absoluteRow+(t.absoluteHeight>1?t.absoluteHeight:0))}))})),i})(l)+"px";else{if(!l.sectionsType){const i=l.sections.some((t=>t.dim));a.display="grid","INLINE"==this.inputPanelPosition&&(a.display=""),l.horizontal?a.gridTemplateColumns=i?l.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${t.cells.length}, 1fr)`:this.dashboardMode&&(a.gridTemplateRows=i?l.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${l.sections.length}, 1fr)`)}u=Jt(this,C,"m",tt).call(this,t,l)}else u=t.cells.map((i=>Jt(this,C,"m",B).call(this,i.cell,t.row,i.column)));const r={"input-panel-form":!0,"input-panel-form--inline":this.buttonPosition==T.RIGHT},h={"input-panel":!0,"input-panel--column":!s,"input-panel--absolute":null==l?void 0:l.absolute,"input-panel--inline":this.inputPanelPosition==$.INLINE},c={"input-panel__commands":!0,[`input-panel__commands--${this.buttonPosition}`]:!0},p={value:null===(n=null==l?void 0:l.sections[0])||void 0===n?void 0:n.title,type:w.HEADING1};return e("div",null,e("form",{name:this.rootElement.id,id:this.rootElement.id,class:r,ref:t=>Xt(this,D,t,"f"),onSubmit:t=>{t.preventDefault(),this.submitCb({value:{before:Object.assign({},Jt(this,P,"f")),after:Jt(this,C,"m",pt).call(this)}})},onContextMenu:t=>{t.preventDefault()}},e("div",{class:"input-panel__typography"},e(y,Object.assign({},p))),e("div",{class:h,style:a},u),e("div",{class:c},e(o,{buttonType:"submit",label:Jt(this,I,"f").language.translate(f.CONFIRM),wrapperClass:"form__submit",invisible:this.hiddenSubmitButton}),this.inputPanelCommands)))},B=function(t,i,n){var l;if(!t)return;const s=Jt(this,U,"f").get(t.shape);if(void 0!==s)return s(t,n.name,null===(l=i.layout)||void 0===l?void 0:l.absolute);const o={cell:t,column:n,row:i,component:this,editable:!0,renderKup:!0,setSizes:!0},u=Jt(this,C,"m",Z).call(this,t,n.title);return u?e("div",{class:{"input-panel__label_container":!0}},u,e(a,Object.assign({},o))):e(a,Object.assign({},o))},J=function(t,i){return e(o,Object.assign({icon:t.icon,id:i},t.data,{wrapperClass:"form__submit"}))},X=function(t,i){return e("kup-dropdown-button",Object.assign({},t.data,{label:t.value,data:i,"onkup-dropdownbutton-itemclick":t=>{Jt(this,C,"m",Ht).call(this,t.detail.node,t.detail.node.id)}}))},Y=function(t,i){const n="kup-editor-save",l=t=>{const n=this.inputPanelCells.reduce(((t,{cells:n})=>t||n.find((({column:t})=>t.name===i)).cell),null);n.value=t.detail.htmlValue.replace(/\n/g,"<br>")};return this.rootElement.addEventListener(n,l),Jt(this,R,"f").push({event:n,handler:l}),e("kup-editor",Object.assign({},t.data,{id:i,isReadOnly:!t.isEditable,showToolbar:!0}))},q=function(t,i){return e("kup-data-table",Object.assign({id:i,editableData:!0,showGroups:!0,showFilters:!0,showFooter:!0},t.data))},Q=function(t,i,n){return e("span",{class:"input-panel-label"+(n?" input-panel-label--legacy-look":""),id:i},t.value)},Z=function(t,i){return i&&Yt.ketchup.data.cell.getType(t,t.shape)===r.RADIO?e("span",null,i):null},tt=function(t,i){const n=Jt(this,A,"f").get(i.sectionsType);return n?n(t,i.sections):i.sections.map((i=>Jt(this,C,"m",nt).call(this,t,i,!1)))},it=function(t,i){return i.sections.map((i=>Jt(this,C,"m",et).call(this,t,i)))},nt=function t(i,n,l=!1,s={}){var o,a;const u={"input-panel__section":!n.horizontal,"input-panel__horizontal-section":n.horizontal,"input-panel__section-inline":"INLINE"==this.inputPanelPosition};s.gap=+n.gap>0?`${n.gap}rem`:"1rem";let r=[];if(null===(o=n.sections)||void 0===o?void 0:o.length){r=n.sections.map((n=>Jt(this,C,"m",t).call(this,i,n)));const e=n.sections.some((t=>t.dim));!n.gridCols&&n.horizontal&&(s.gridTemplateColumns=e?n.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${n.sections.length}, 1fr)`),n.gridRows||n.horizontal||!this.dashboardMode||(s.gridTemplateRows=e?n.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${n.sections.length}, 1fr)`)}else(null===(a=n.content)||void 0===a?void 0:a.length)&&(r=n.content.map((t=>Jt(this,C,"m",ot).call(this,i,t))),s.gridTemplateColumns=+n.gridCols>0?`repeat(${n.gridCols}, 1fr)`:"",this.dashboardMode&&(s.gridTemplateRows=+n.gridRows>0?`repeat(${n.gridRows}, 1fr)`:""));const h=e("div",{class:u,style:s},r.filter(Boolean));return n.title&&!l?e("div",{class:{"input-panel__section_label_container":!0}},e(y,{type:w.HEADING1,value:n.title}),h):h},et=function t(i,n){var l,s;let o=[];if((null===(l=n.sections)||void 0===l?void 0:l.length)?o=n.sections.map((n=>Jt(this,C,"m",t).call(this,i,n))):(null===(s=n.content)||void 0===s?void 0:s.length)&&(o=n.content.map((t=>Jt(this,C,"m",at).call(this,i,t)))),null==z(n.absoluteWidth))return o;const a=null!=z(n.absoluteWidth)?`${z(n.absoluteWidth)}px`:"100%",u=null!=M(n.absoluteHeight)?`${M(n.absoluteHeight)}px`:"100%",r=`${S(n.absoluteRow)}px`,h=`${N(n.absoluteColumn)}px`;return e("div",{style:{position:"relative",width:a,"min-width":a,"max-width":a,height:u,"min-height":u,"max-height":u,top:r,left:h,overflow:"auto"}},o)},lt=function t(i){var n,e;let l=[];return(null===(n=i.content)||void 0===n?void 0:n.length)&&i.content.forEach((t=>{t.id&&l.push(t.id)})),(null===(e=i.sections)||void 0===e?void 0:e.length)&&i.sections.forEach((i=>{l=l.concat(Jt(this,C,"m",t).call(this,i))})),l},st=function(t,i){this.tabSelected||(this.tabSelected=i[0].id||"0");const n=i.map(((i,n)=>{const e=Jt(this,C,"m",lt).call(this,i),l=t.cells.some((t=>{var i;const n=t.cell;return e.includes(t.column.name)&&!!(null===(i=n.data)||void 0===i?void 0:i.error)}));return{active:(i.id||`${n}`)===this.tabSelected,value:i.title,icon:l?"error":i.icon,id:i.id||`${n}`,danger:l}})),l=i.map(((i,n)=>{const e=i.id||`${n}`;return Jt(this,C,"m",nt).call(this,t,i,!0,{display:this.tabSelected!==e?"none":"grid"})}));return e("div",{class:{"input-panel__tabs_container":!0}},e("kup-tab-bar",{data:n,customStyle:".tab-bar .tab-scroller .tab .tab__content { justify-content: flex-start; }"}),l)},ot=function(t,i){const n=t.cells.find((t=>t.column.name===i.id)),l=+i.colSpan>0?i.colSpan:+i.colSpan>0||+i.colStart>0?null:1,s=+i.rowSpan>0?i.rowSpan:+i.rowSpan>0||+i.rowStart>0?null:1;if(n&&n.cell)return e("div",{style:{"min-width":"0","grid-column-start":l?`span ${l}`:`${i.colStart}`,"grid-column-end":+i.colEnd>0?`${i.colEnd}`:"","grid-row-start":s?`span ${s}`:`${i.rowStart}`,"grid-row-end":+i.rowEnd>0?`${i.rowEnd}`:""}},Jt(this,C,"m",B).call(this,n.cell,t.row,n.column))},at=function(t,i){const n=t.cells.find((t=>t.column.name===i.id));if(!n||!n.cell)return;let l;l=n.cell.shape==h.DATE?i.absoluteLength>8?i.absoluteLength:8:i.absoluteLength,i.absoluteHeight||(i.absoluteHeight=1);const s=z(l),o=M(i.absoluteHeight),a=S(i.absoluteRow),u=N(i.absoluteColumn),r={position:"absolute",width:null!==s?`${s}px`:null,"min-width":null!==s?`${s}px`:null,"max-width":null!==s?`${s}px`:null,height:null!==o?`${o}px`:null,"min-height":null!==o?`${o}px`:null,"max-height":null!==o?`${o}px`:null,top:null!==a?`${S(i.absoluteRow)}px`:null,left:null!==u?`${N(i.absoluteColumn)}px`:null,overflow:"auto"};return n.cell.data=Object.assign(Object.assign(Object.assign({},n.cell.data),{customStyle:(n.cell.data.customStyle||"")+".mdc-text-field {height: unset !important;}",legacyLook:!0,helperEnabled:!1}),n.cell.shape===h.TABLE&&{rowsPerPage:n.cell.data.data.rows.length,showPaginator:!1}),e("div",{style:r},Jt(this,C,"m",B).call(this,n.cell,t.row,n.column))},ut=function(){this.inputPanelCommands=this.data.setup.commands.map((t=>{if((null==t?void 0:t.children)&&(null==t?void 0:t.children.length)>0){const i={"kup-list":{showIcons:!0,data:t.children.map((t=>Jt(this,C,"m",Dt).call(this,t)))}};return Jt(this,C,"m",X).call(this,t,i)}{const i=Jt(this,C,"m",Dt).call(this,t);return Jt(this,C,"m",J).call(this,i,t.value)}})).flat()},rt=function(t){var i,n,e,l;(null===(n=null===(i=t.setup)||void 0===i?void 0:i.commands)||void 0===n?void 0:n.length)&&Jt(this,C,"m",ut).call(this);const s=null===(e=null==t?void 0:t.rows[0])||void 0===e?void 0:e.layout,o=(null===(l=null==t?void 0:t.rows)||void 0===l?void 0:l.length)?t.rows.reduce(((i,n)=>[...i,{cells:t.columns.filter((t=>t.visible)).map((t=>{const i=structuredClone(n.cells[t.name]);return{column:t,cell:i?Object.assign(Object.assign({},i),{data:Jt(this,C,"m",ht).call(this,i,t,s),slotData:Jt(this,C,"m",dt).call(this,i,t),isEditable:!0}):null}})),row:n}]),[]):[];o.map((({cells:t})=>t.map((({cell:t,column:i})=>{const n=Yt.ketchup.data.cell.getType(t,t.shape),e=Jt(this,H,"f").get(n);if(!e)return;const l=this.rootElement.shadowRoot.querySelector(`${e}[id='${i.name.replace(/\//g,"\\$1")}']`);t.value&&(null==l||l.setValue(t.value))})))),this.inputPanelCells=o},ht=function(t,i,n){const e=Object.assign(Object.assign({},Jt(this,C,"m",ft).call(this,t,i,n)),{disabled:!t.editable,id:i.name}),l=Yt.ketchup.data.cell.getType(t,t.shape),s=function(t,i){var n={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(n[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(e=Object.getOwnPropertySymbols(t);l<e.length;l++)i.indexOf(e[l])<0&&Object.prototype.propertyIsEnumerable.call(t,e[l])&&(n[e[l]]=t[e[l]])}return n}(t.data||{},["data"]);return l!==r.MULTI_AUTOCOMPLETE&&l!==r.MULTI_COMBOBOX?Jt(this,C,"m",ct).call(this,e,Object.assign({},t.data)):Object.assign(Object.assign({},e),s)},ct=function t(i,n){for(const e in n)i[e]=n[e]instanceof Object&&!Array.isArray(n[e])&&e in i?Jt(this,C,"m",t).call(this,i[e],n[e]):n[e];return i},pt=function(){return this.inputPanelCells.reduce(((t,i)=>{const n=Object.keys(i.row.cells).reduce(((t,n)=>{var e;const l=null===(e=i.cells.find((t=>t.column.name===n)))||void 0===e?void 0:e.cell;let s=null==l?void 0:l.value;return(null==l?void 0:l.shape)===h.TABLE&&(s=JSON.stringify(Jt(this,C,"m",Mt).call(this,l.data.data,n))),Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({},i.row.cells[n]),{value:s,obj:null==l?void 0:l.obj})})}),{});return{columns:[...t.columns,...i.cells.map((t=>t.column))],rows:[...t.rows,{cells:n,layout:i.row.layout}]}}),{columns:[],rows:[]})},ft=function(t,i,n){if(!t)return null;const e=t.options;let l;l=(null==n?void 0:n.absolute)?null:i.title;const s=t.value,o=Yt.ketchup.data.cell.getType(t,t.shape),a=new Map([[r.AUTOCOMPLETE,Jt(this,C,"m",kt).bind(this)],[r.BUTTON_LIST,Jt(this,C,"m",bt).bind(this)],[r.CHART,Jt(this,C,"m",vt).bind(this)],[r.CHIP,Jt(this,C,"m",mt).bind(this)],[r.CHECKBOX,Jt(this,C,"m",_t).bind(this)],[r.COLOR_PICKER,Jt(this,C,"m",xt).bind(this)],[r.COMBOBOX,Jt(this,C,"m",kt).bind(this)],[r.EDITOR,Jt(this,C,"m",yt).bind(this)],[r.MULTI_AUTOCOMPLETE,Jt(this,C,"m",mt).bind(this)],[r.MULTI_COMBOBOX,Jt(this,C,"m",mt).bind(this)],[r.NUMBER,Jt(this,C,"m",Et).bind(this)],[r.DATE,Jt(this,C,"m",Ft).bind(this)],[r.OBJECT,Jt(this,C,"m",$t).bind(this)],[r.RADIO,Jt(this,C,"m",jt).bind(this)],[r.STRING,Jt(this,C,"m",wt).bind(this)],[r.SWITCH,Jt(this,C,"m",Ot).bind(this)],[r.TABLE,Jt(this,C,"m",zt).bind(this)],[r.TIME,Jt(this,C,"m",Tt).bind(this)]]).get(o);return a?a(e,l,s,t,i.name):null},dt=function(t,i){const n=Yt.ketchup.data.cell.getType(t,t.shape);return t.editable?n===r.CHIP?{trailingIcon:!0,label:i.title,disabled:!t.editable,id:i.name,fullWidth:!1}:n===r.MULTI_AUTOCOMPLETE||n===r.MULTI_COMBOBOX?Object.assign(Object.assign({},Jt(this,C,"m",kt).call(this,t.options,i.title,null)),{showDropDownIcon:!0,class:"",style:{width:"100%"},disabled:!t.editable,id:i.name}):null:null},mt=function(t,i,n){return d(n)},vt=function(){return{data:{sizeX:"50px",offlineMode:{value:"8;4;5"},id:"i1012_GREF_0",cellId:"i1012_GREF_0",sizeY:"50px"}}},bt=function(t,i,n,e,l){var s,o,a,u;return e.data=e.data||{},e.data.onClick=()=>{Jt(this,C,"m",Ht).call(this,e,l)},(null===(s=e.data)||void 0===s?void 0:s.keyShortcut)&&!(null===(o=e.data)||void 0===o?void 0:o.disabled)&&(Jt(this,K,"f").push(null===(a=e.data)||void 0===a?void 0:a.keyShortcut),Jt(this,I,"f").keysBinding.register(null===(u=e.data)||void 0===u?void 0:u.keyShortcut,e.data.onClick.bind(this))),Object.assign({label:e.value,fun:e.fun},e.data)},kt=function(t,i,n){const e=m(n,i,[]);return t&&(e.data["kup-list"].data=Jt(this,C,"m",St).call(this,t,n)),e},gt=function({detail:t}){const i=Jt(this,C,"m",G).call(this,t.id);i.fun&&Jt(this,C,"m",Lt).call(this,t,i)},_t=function(t,i,n){return v(n,i)},xt=function(t,i){return{data:{"kup-text-field":{label:i}}}},yt=function(t,i,n){return{initialValue:n}},wt=function(t,i,n,e,l){var s;const o=Object.assign({label:i},e.data);return this.autoSkip&&(e.isEditable||e.editable)&&(null===(s=e.data)||void 0===s?void 0:s.maxLength)&&(o.onInput=t=>{Jt(this,C,"m",Bt).call(this,l,t)}),o},jt=function(t,i,n){return b(n,t)},Ot=function(t,i,n){return k(n,i)},Ft=function(t,i,n){return{data:{"kup-text-field":{label:i}},initialValue:null!=n?n:""}},$t=function(t,i,n){return{initialValue:n||"",label:i||" ",value:n||""}},Tt=function(t,i,n){return{data:{"kup-text-field":{label:i}},initialValue:n}},Et=function(t,i){return{label:i}},zt=function(t,i,n,e,l){try{let t=JSON.parse(e.value);return t?"SmeupDataTable"!==t.type?(Jt(this,I,"f").debug.logMessage(this,`Wrong data table type for ${l} cell. Type \`SmeupDataTable\` in value expected`,g.ERROR),null):{data:{columns:t.columns.map((i=>{var n;if(t.rows.length>0){const e=null===(n=t.rows[0].cells[i.name])||void 0===n?void 0:n.obj;return!i.obj&&e?Object.assign(Object.assign({},i),{obj:{t:e.t,p:e.p}}):i}return i})),rows:t.rows.map((i=>Object.assign(Object.assign({},i),{cells:Object.keys(i.cells).reduce(((n,e)=>{const l=t.columns.find((t=>t.name===e));return Object.assign(Object.assign({},n),{[e]:Object.assign(Object.assign({},i.cells[e]),{data:Object.assign(Object.assign({},Jt(this,C,"m",ft).call(this,i.cells[e],l)),{disabled:!1===i.cells[e].editable,id:l.id})})})}),{})})))}}:(Jt(this,I,"f").debug.logMessage(this,`Empty value for ${l} cell.`,g.WARNING),null)}catch(t){return Jt(this,I,"f").debug.logMessage(this,`Invalid value for ${l} cell. Type \`SmeupDataTable\` expected`,g.ERROR),null}},Mt=function(t,i){const n=Object.assign(Object.assign({},t),{rows:t.rows.map((t=>Object.assign(Object.assign({},t),{cells:{}})))}),e=t.columns.filter((t=>t.isEditable)).map((t=>t.name));if(!e.length)return n;try{const l=JSON.parse(Jt(this,P,"f").rows[0].cells[i].value);return n.rows=t.rows.map(((t,i)=>e.reduce(((n,e)=>{const s=l.rows[i].cells[e]&&t.cells[e].value!==l.rows[i].cells[e].value;return Object.assign(Object.assign({},l.rows[i]),s?{cells:Object.assign(Object.assign({},n.cells),{[e]:Object.assign(Object.assign({},l.rows[i].cells[e]),{value:t.cells[e].value})})}:{cells:n.cells})}),Object.assign(Object.assign({},l.rows[i]),{cells:{}})))),n}catch(t){return n}},St=function(t,i){const n=Jt(this,L,"f").get(t.type);return n?n(t,i):t.map((t=>({value:t.label,id:t.id,selected:i===t.id})))},Nt=function t(i,n){return i.children.map((i=>{var e;return{id:i.content.codice,value:i.content.testo,selected:n===i.content.codice,children:(null===(e=i.children)||void 0===e?void 0:e.length)?Jt(this,C,"m",t).call(this,i,n):[]}}))},Ct=function t(i,n){return i.children.map((i=>{var e;return{id:i.obj.k,value:i.value,selected:n===i.obj.k,children:(null===(e=i.children)||void 0===e?void 0:e.length)?Jt(this,C,"m",t).call(this,i,n):[]}}))},It=function(t,i){return t.rows.map((t=>{var n;const e=t.fields||t.cells,[l,s]=Object.keys(e);return{id:e[l].value,value:(null===(n=e[s])||void 0===n?void 0:n.value)||e[l].value,selected:i===e[l].value}}))},Dt=function(t){return t.data&&!t.data.keyShortcut&&Jt(this,I,"f").objects.isJ1Key(t.obj?t.obj:{})&&(t.data.keyShortcut=E[t.obj.k]),Object.assign(Object.assign({},t),{data:Jt(this,C,"m",bt).call(this,null,null,t.value,t,t.obj.k),id:t.obj.k})},Lt=function(t,i){this.optionsHandler(i.fun,t.inputValue,Jt(this,C,"m",pt).call(this),t.id).then((n=>{var e;i.data.data["kup-list"].data=null!==(e=Jt(this,C,"m",St).call(this,n,i.value))&&void 0!==e?e:[],t.comp.refresh()}))},Pt=async function(t){var i,n,e,l,s;const{detail:{column:o,cell:a}}=t,u=Jt(this,C,"m",G).call(this,o.name),r=Jt(this,P,"f").rows[0].cells[o.name];if(a.mandatory){if(Jt(this,C,"m",Wt).call(this,o.name,u.value?(null===(i=r.data)||void 0===i?void 0:i.error)||null:Jt(this,I,"f").language.translate(f.REQUIRED_VALUE)),!a.value)return}else Jt(this,C,"m",Wt).call(this,o.name,(null===(n=r.data)||void 0===n?void 0:n.error)||null);if(null===(e=a.inputSettings)||void 0===e?void 0:e.checkObject){const{valid:t}=await this.checkValidObjCallback({obj:a.obj,currentState:Jt(this,C,"m",pt).call(this),fun:a.fun});if(!t)return void Jt(this,C,"m",Wt).call(this,o.name,Jt(this,I,"f").language.translate(f.INVALID_VALUE));Jt(this,C,"m",Wt).call(this,o.name,(null===(l=r.data)||void 0===l?void 0:l.error)||null)}(null===(s=a.inputSettings)||void 0===s?void 0:s.checkValueOnExit)&&Jt(this,C,"m",Rt).call(this)&&this.checkValidValueCallback({before:Object.assign({},Jt(this,P,"f")),after:Jt(this,C,"m",pt).call(this)},o.name)},Wt=function(t,i){this.inputPanelCells=this.inputPanelCells.map((n=>Object.assign(Object.assign({},n),{cells:n.cells.map((({cell:n,column:e})=>{const l=e.name===t?Object.assign(Object.assign({},n.data),{error:i}):n.data;return{column:e,cell:Object.assign(Object.assign({},n),{data:l})}}))})))},Rt=function(){return this.inputPanelCells.some((({cells:t,row:i})=>t.some((({cell:t,column:{name:n}})=>t.value!==i.cells[n].value))))},Ht=function(t,i){t.fun?this.customButtonClickHandler({fun:t.fun,cellId:i,currentState:Jt(this,C,"m",pt).call(this)}):this.submitCb({value:{before:Object.assign({},Jt(this,P,"f")),after:Jt(this,C,"m",pt).call(this)},cell:i})},Ut=function(t,i){const n=t.find((t=>{var i;return null===(i=t.classList)||void 0===i?void 0:i.contains("f-cell")}));if(null==n)return;const e=Jt(this,C,"m",pt).call(this),l=n["kup-get-cell-props"]().column.name;return{anchor:n,cell:e.rows[0].cells[l],column:e.columns.find((t=>t.name==l)),row:e.rows[0],originalEvent:i}},At=function(t){const i=Jt(this,I,"f").getEventPath(t.target,this.rootElement);return Jt(this,C,"m",Ut).call(this,i,t)},Kt=function(){Jt(this,I,"f").interact.managedElements.add(Jt(this,D,"f")),Jt(this,I,"f").interact.on(Jt(this,D,"f"),_.TAP,(t=>{if(2==t.button){const i=Jt(this,C,"m",At).call(this,t);i&&this.kupDataTableContextMenu.emit({comp:this,id:this.rootElement.id,details:i})}}))},Gt=function(){if(!Jt(this,D,"f"))return;const t=Array.from(Jt(this,D,"f").querySelectorAll(".f-cell__content"));for(const i of t){const t=Jt(this,C,"m",Vt).call(this,i,!0);if(t)return void setTimeout((()=>t.focus()),300)}if(!this.autoFocus||0===t.length)return;const i=Jt(this,C,"m",Vt).call(this,t[0]);i&&setTimeout((()=>i.focus()),300)},Vt=function(t,i=!1){if(!(t&&t instanceof HTMLElement))return;const n=".mdc-text-field__input",e=i?`.mdc-text-field--error ${n}`:n,l=t.querySelector(e);if(l)return l;const s=Array.from(t.querySelectorAll("*")).filter((t=>t.shadowRoot));for(const t of s){const i=t.shadowRoot.querySelector(e);if(i)return i}},Bt=function(t,i){var n,e;const l=null==i?void 0:i.target;if(!(l&&l instanceof HTMLInputElement))return;const{maxLength:s,value:o}=l;if(!s||s<0||(null==o?void 0:o.length)<s)return;const a=Array.from(null===(n=Jt(this,D,"f"))||void 0===n?void 0:n.querySelectorAll(".f-text-field")).reduce(((t,i)=>{const n=i.querySelector("input");return n?(t.push({id:(null==i?void 0:i.id)||"",HTMLInputElement:n}),t):t}),[]);if(!a.length)return;const u=a.findIndex((i=>i.id===t));u<0||u===a.length-1||null===(e=a[u+1].HTMLInputElement)||void 0===e||e.focus()},qt.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: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:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);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-fcell-width:fit-content;--kup_input_panel_background_color:var(\n --kup-input-panel-background-color,\n var(--kup-layer-0)\n );--kup_input_panel_color:var(\n --kup-input-panel-color,\n var(--kup-text-secondary)\n );--kup_input_panel_font_family:var(\n --kup-input-panel-font-family,\n var(--kup-font-family)\n );--kup_input_panel_font_size:var(\n --kup-input-panel-font-size,\n var(--kup-font-size)\n );--kup_input_panel_label_alignment:var(--kup-input-panel-label-alignment);--kup_input_panel_label_width:var(--kup-input-panel-label-width);--kup_input_panel_padding:var(--kup-input-panel-padding, 1em 0);--kup_input_panel_padding--inline:var(--kup-input-panel-padding--inline, 0);--kup_input_panel_absolute_max_height:var(\n --kup-input-panel-absolute-max-height,\n 500px\n )}:host .input-panel{background:var(--kup_input_panel_background_color);color:var(--kup_input_panel_color);display:flex;flex-grow:1;overflow:auto;padding:var(--kup_input_panel_padding);position:relative;gap:1rem}:host .input-panel__commands{display:flex;gap:1rem}:host .input-panel__commands.input-panel__commands--right{flex-shrink:0;overflow:hidden}:host .input-panel--inline{flex:1;overflow-x:auto;white-space:nowrap;padding:var(--kup_input_panel_padding--inline)}:host .input-panel--column{flex-direction:column}:host .input-panel__section_label_container{display:flex;flex-direction:column;gap:1rem}:host .input-panel__section{display:grid;min-width:0}:host .input-panel__section .f-cell__content>*{width:100%}:host .input-panel__horizontal-section{display:inline-grid}:host .input-panel__section-inline{display:inline-block;width:max-content}:host .input-panel .f-cell .f-checkbox .checkbox .checkbox__native-control{height:40px;width:40px}:host .input-panel__label_container{display:flex;flex-direction:column;justify-content:center}:host .input-panel__label_container>.f-cell{flex:1}:host .input-panel__tabs_container{display:flex;flex-direction:column;justify-content:center;gap:2rem}:host .input-panel .f-cell.number-cell .f-cell__content{--kup-textfield-font-family:var(--kup_cell_font_family);font-family:var(--kup_cell_font_family)}:host .input-panel .input-panel-label{display:flex;width:100%;height:100%;align-items:center;justify-content:center}:host .input-panel .input-panel-label--legacy-look{font-size:12px;font-family:var(--kup-font-family-monospace);white-space:pre}:host .input-panel--absolute{justify-content:flex-end;padding:var(--kup-space-02);max-height:var(--kup_input_panel_absolute_max_height)}:host .input-panel--absolute .input-panel-label{justify-content:start}:host .input-panel--absolute .mdc-text-field{height:unset !important}:host .input-panel-form--inline{display:flex;align-items:end;gap:1rem}";export{qt as kup_input_panel}
@@ -1 +0,0 @@
1
- import{C as e,H as t,D as l,B as n,ag as r,v as i,x as s,ak as o,al as a,J as u,e as c,F as f,ac as h,ab as d,am as b,an as p,ao as m,a1 as v}from"./p-7272d9aa.js";import{K as F}from"./p-1ee561ba.js";class x extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,l){let n="";if(null==e)return n;let r=e[t];return null==r||(n=l?r.textFieldTmp:r.textField),n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,l){if(!t)return!1;let n=this._getTextFilterValue(e,t.name,l);if(null!=n&&""!=n.trim())return!0;if(this._hasIntervalTextFieldFilterValues(e,t,l))return!0;let r=this.getCheckBoxFilterValues(e,t.name);return!(null==r||r.length<1)}getCheckBoxFilterValues(e={},t){let l=[];if(null==e)return l;let n=e[t];return null==n||null==n.checkBoxes||(l=n.checkBoxes),l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!1)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!0)}_hasIntervalTextFieldFilterValues(e={},l,n){if(null==l)return!1;if(!this.isColumnFiltrableByInterval(l))return!1;let r=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(null!=r&&""!=r.trim())return!0;let i=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);return null!=i&&""!=i.trim()}addCheckboxFilter(t={},l,n){if(null==t)return;let r=t[l];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},t[l]=r),null==r.checkBoxes&&(r.checkBoxes=[]),null==n||null==n.value?r.checkBoxes=[]:e.valuesArrayContainsValue(r.checkBoxes,n.value)||(r.checkBoxes[r.checkBoxes.length]=n)}removeCheckboxFilter(t={},l,n){if(null==t||null==n)return;let r=t[l];if(null==r)return;null==r.checkBoxes&&(r.checkBoxes=[]);let i=e.indexOfValueInValuesArray(r.checkBoxes,n);if(i>=0){let e=[];for(let t=0;t<r.checkBoxes.length;t++)t!=i&&(e[e.length]=r.checkBoxes[t]);r.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!1)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!0)}_getIntervalTextFieldFilterValues(e={},l,n){return this._hasIntervalTextFieldFilterValues(e,l,n)?[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)]:["",""]}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!1)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!0)}_getIntervalTextFieldFilterValue(e={},t,l,n){let r="";if(null==e)return r;let i=e[t];return null==i||n&&null==i.intervalTmp?r:n||null!=i.interval?(r=n?i.intervalTmp[l]:i.interval[l],r):r}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,!0)}_setTextFieldFilterValue(e={},t,l,n){if(null==e)return;let r=e[t];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=r),n?r.textFieldTmp=null!=l?l.trim():l:r.textField=null!=l?l.trim():l}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,!0)}_setIntervalTextFieldFilterValue(e={},t,l,n,r){if(null==e)return;let i=e[t];null==i&&(i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=i),null==i.interval&&(i.interval=[],i.interval.push("","")),null==i.intervalTmp&&(i.intervalTmp=[],i.intervalTmp.push("","")),r?i.intervalTmp[n]=null!=l?l.trim():l:i.interval[n]=null!=l?l.trim():l}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,!1)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,!0)}getFilterValueForTooltip(e={},r){let i=this.getTextFilterValue(e,r.name),s=this.getIntervalTextFieldFilterValues(e,r),o=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=s[t.FROM]&&(u+=a+"(>= "+l(s[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=s[t.TO]&&(u+=a+"(<= "+l(s[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return o.forEach((e=>{c+=a+n(e,r),a=" OR "})),""!=c&&(c="("+c+")",""!=u&&(c=" AND "+c)),c=u+c,c}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var w;!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."}(w||(w={}));const T="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const k=document.documentElement,y=k.ketchup?k.ketchup.objects:new s,j=k.ketchup?k.ketchup.data:new o;class O extends e{isFilterCompliantForCell(e,t,l){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=!1,r=[],i){return this.areCellsCompliant(e.cells,t,l,n,r,i)}areCellsCompliant(e,t={},l="",n=!1,s=[],o){if(n){let t=!0;if(s&&null!=s&&s.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<s.length;i++){if(0==s[i].visible)continue;const o=e[s[i].name];if(null==o)continue;t=this.isFilterCompliantForValue(o.value,l);let a=r(s[i],o);if(a!=o.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==o&&(o=new x),!this.hasFilters(t,s,o))return!0;let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const r=e[n];if(!r)return!1;let u=o.getTextFilterValue(t,n),c=o.getIntervalTextFieldFilterValues(t,i(s,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(y.isNumber(r.obj)||y.isDate(r.obj)||y.isTime(r.obj)||y.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let b=o.getCheckBoxFilterValues(t,n);if(0==b.length)continue;let p=!1;for(let e=0;e<b.length;e++){let t=b[e];if(null!=t&&null!=t.value){if(null!=r.value&&r.value.toLowerCase().trim()==t.value.toLowerCase().trim()){p=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){p=!0;break}}}if(!p)return!1}return!0}hasFilters(e={},t,l){if(null==e)return!1;let n=Object.keys(e);if(null==n||n.length<1)return!1;null==l&&(l=new x);for(let r=0;r<n.length;r++){let s=n[r],o=null;if(o=s===T?{name:T,title:""}:i(t,s),l.hasFiltersForColumn(e,o))return!0}return!1}filterRows(e=[],t={},l="",n=[],r){if(!e||null==e)return[];let i=[];const s=!(!l||!n);if(this.hasFilters(t,n,r)||s)for(let o=0;o<e.length;o++){let a=e[o];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,s,n,r))&&(i[i.length]=a)}else i=[...e];return i}getColumnValues(t,n,r,i){let s=new Array;null==i&&(i=new x);let o=i.getTextFilterValueTmp(t.filters,n.name),a=i.getIntervalTextFieldFilterValuesTmp(t.filters,n),u=i.getCheckBoxFilterValues(t.filters,n.name);if(null!=n.valuesForFilter&&n.valuesForFilter.length>0)return n.valuesForFilter.forEach((t=>{let r=t;(e.valuesArrayContainsValue(u,r)||""==o||i.isFilterCompliantForSimpleValue(r,n.obj,o,a))&&s.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),s;let c=Object.assign({},t.filters);c[n.name]={textField:o,textFieldTmp:o,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)s.push(u[e]);return j.cell.getUnivocalValue({rows:f},n,!0)}}const V=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 l=e[0].group.column;let n=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let l of t)if(l.column===e)return l;return null}(l,t);return n||(n={column:l,sortMode:v.A}),e.sort(((e,t)=>a({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},n.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const r=I(e,n,t[l]);if(0!==r)return r}return 0}return I(e,n,t[0])}))}function I(e,t,l){const n=e.cells[l.column],r=t.cells[l.column];return n||r?n?r?a(n,r,l.sortMode):-1:1:0}function B(e=[],t={},l="",n=[],r,i){return null==i&&(i=new O),i.filterRows(e,t,l,n,r)}function M(e=[],t=[],l=[],n={}){if(!t)return[];if(!l||0===l.length||!e||0===e.length)return t;const s={},o=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return s[l]=n,!0;return!1}));if(0===o.length)return t;const a=[];let c={};return t.forEach((t=>{const l=o[0].column,f=t.cells[l];if(f){const h=i(e,l),d=r(h,f),b=f.value;let p=null;for(let e of a)if(e.group.label===d){p=e;break}null===p&&(p={group:{id:b,parent:null,column:l,columnLabel:s[l],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},a.push(p));for(let l=1;l<o.length;l++){const n=o[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(t,a),o=a.value;let u=null;for(let e=0;e<p.group.children.length;e++){const t=p.group.children[e];if(t.group.label===l){u=t;break}}u||(u={cells:{},group:{id:o,parent:p,column:n.column,columnLabel:s[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},W(u),p.group.children.push(u)),p=u}}p.group.children.push(t),function(e,t,l,n){if(!e||!t)return;const r=Object.keys(t);0!==r.length&&r.forEach((r=>{const i=l.cells[r];if(i){const l=V.ketchup.objects.isNumber(i.obj),s=t[r];switch(s){case u.COUNT:let t=e.group.totals[r]||0;e.group.totals[r]=++t;let o=e.group.parent;for(;null!=o;){let e=o.group.totals[r]||0;o.group.totals[r]=++e,o=o.group.parent}break;case u.DISTINCT:let a;if(a=l?V.ketchup.math.numberify(V.ketchup.math.numberifySafe(i.value)):i.value,n[e.group.id]){let t=n[e.group.id][r];t?t.push(a):(n[e.group.id][r]=[],n[e.group.id][r].push(a))}else n[e.group.id]={},n[e.group.id][r]=[],n[e.group.id][r].push(a);let c=e.group.parent;for(;null!=c;){if(n[c.group.id]){let e=n[c.group.id][r];e?e.push(a):(n[c.group.id][r]=[],n[c.group.id][r].push(a))}else n[c.group.id]={},n[c.group.id][r]=[],n[c.group.id][r].push(a);c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(l&&i.value){const t=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(i.value));e.group.totals[r]=t+(e.group.totals[r]||0);let l=e.group.parent;for(;null!=l;){const e=V.ketchup.math.numberify(l.group.totals[r]||0);l.group.totals[r]=t+e,l=l.group.parent}}break;case u.MIN:if(l&&i.value){const t=e.group.totals[r],l=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(i.value));e.group.totals[r]=t?Math.min(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.min(e,l):l,n=n.group.parent}}else if(i.value&&V.ketchup.objects.isDate(i.obj)&&V.ketchup.dates.isValidFormattedStringDate(i.value)){const t=e.group.totals[r];if(t){let l=[];l.push(a),l.push(V.ketchup.dates.toDayjs(t)),e.group.totals[r]=V.ketchup.dates.format(V.ketchup.dates.min(l),F.ISO_DATE)}else e.group.totals[r]=V.ketchup.dates.format(a,F.ISO_DATE);let l=e.group.parent;for(;null!=l;){const e=l.group.totals[r];if(e){let t=[];t.push(a),t.push(V.ketchup.dates.toDayjs(e)),l.group.totals[r]=V.ketchup.dates.format(V.ketchup.dates.min(t),F.ISO_DATE)}else l.group.totals[r]=V.ketchup.dates.format(a,F.ISO_DATE);l=l.group.parent}}break;case u.MAX:if(l&&i.value){const t=e.group.totals[r],l=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(i.value));e.group.totals[r]=t?Math.max(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.max(e,l):l,n=n.group.parent}}else if(i.value&&V.ketchup.objects.isDate(i.obj)&&V.ketchup.dates.isValidFormattedStringDate(i.value)){const t=e.group.totals[r];if(t){let l=[];l.push(a),l.push(V.ketchup.dates.toDayjs(t)),e.group.totals[r]=V.ketchup.dates.format(V.ketchup.dates.max(l),F.ISO_DATE)}else e.group.totals[r]=V.ketchup.dates.format(a,F.ISO_DATE);let l=e.group.parent;for(;null!=l;){const e=l.group.totals[r];if(e){let t=[];t.push(a),t.push(V.ketchup.dates.toDayjs(e)),l.group.totals[r]=V.ketchup.dates.format(V.ketchup.dates.max(t),F.ISO_DATE)}else l.group.totals[r]=V.ketchup.dates.format(a,F.ISO_DATE);l=l.group.parent}}break;default:0!=s.indexOf(u.MATH)&&console.warn(`invalid total mode: ${s}`)}}}))}(p,n,t,c)}})),function(e,t,l){if(!e||!t)return;const n=Object.keys(t);if(0===e.length||!e[0].group||0===n.length)return;let r=n.filter((e=>u.DISTINCT===t[e]));r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>_(e,r,l)))}(a,n,c),N(a,u.AVERAGE,n),N(a,u.MATH,n),a}function N(e,t,l){if(!e||!l)return;const n=Object.keys(l);if(0===e.length||!e[0].group||0===n.length)return;let r;t==u.AVERAGE&&(r=n.filter((e=>u.AVERAGE===l[e]))),t==u.MATH&&(r=n.filter((e=>0==l[e].indexOf(u.MATH)))),r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>A(e,t,r,l)))}function _(e,t,l){const n=e.group.children;0!==n.length&&(n[0].group&&n.forEach((e=>{_(e,t,l)})),t.forEach((t=>{e.group.totals[t]=new Set(l[e.group.id][t]).size})))}function A(e,t,l,n){const r=e.group.children;if(0===r.length)return 0;let i=0;return r[0].group?r.forEach((e=>{i+=A(e,t,l,n)})):i=r.length,l.forEach((l=>{if(t==u.AVERAGE&&(e.group.totals[l]=e.group.totals[l]/i),t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=V.ketchup.math.formulas.custom(t,e.group.totals)}})),i}function D(e,t){if(t){const l=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const l=t.cells[e.name];l&&e.obj&&!l.obj&&(l.obj={t:e.obj.t,p:e.obj.p,k:l.value})}}))})),l}}function S(e=[],t={}){if(V.ketchup.objects.isEmptyJsObject(e)||V.ketchup.objects.isEmptyJsObject(t))return{};const l=Object.keys(t),n={},r=new Array;if(0===l.length||l.every((e=>t[e]===u.COUNT)))l.forEach((t=>n[t]=e.length));else{let i={};e.forEach(((e,s,o)=>{l.filter((e=>u.COUNT!==t[e]&&0!=t[e].indexOf(u.MATH))).forEach((l=>{const a=e.cells[l];if(a)if(t[l]===u.DISTINCT){let e;e=V.ketchup.objects.isNumber(a.obj)?V.ketchup.math.numberify(V.ketchup.math.numberifySafe(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(V.ketchup.objects.isNumber(a.obj)){const e=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(a.value));let r=n[l];switch(!0){case t[l]===u.MIN:n[l]=r?Math.min(r,e):e;break;case t[l]===u.MAX:n[l]=r?Math.max(r,e):e;break;default:r=n[l]||0,n[l]=e+V.ketchup.math.numberify(r)}}else if(V.ketchup.objects.isDate(a.obj)&&(-1==r.indexOf(l)&&r.push(l),V.ketchup.dates.isValidFormattedStringDate(a.value))){const e=V.ketchup.dates.toDate(V.ketchup.dates.toDayjs(a.value)),r=n[l]?V.ketchup.dates.toDate(V.ketchup.dates.toDayjs(n[l])):null;switch(!0){case t[l]===u.MIN:if(r){let t=[];t.push(e),t.push(r),n[l]=V.ketchup.dates.format(V.ketchup.dates.min(t),F.ISO_DATE)}else n[l]=V.ketchup.dates.format(e,F.ISO_DATE);break;case t[l]===u.MAX:if(r){let t=[];t.push(e),t.push(r),n[l]=V.ketchup.dates.format(V.ketchup.dates.max(t),F.ISO_DATE)}else n[l]=V.ketchup.dates.format(e,F.ISO_DATE)}}s===o.length-1&&t[l]===u.DISTINCT&&(n[l]=new Set(i[l]).size,i[l]=[])}))}))}for(let i of l){switch(!0){case t[i]===u.AVERAGE:const l=n[i];l&&e.length>0&&(n[i]=l/e.length);break;case t[i]===u.COUNT:n[i]=e.length;break;case 0==t[i].indexOf(u.MATH):n[i]=V.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=V.ketchup.dates.format(n[i]):V.ketchup.math.isNumber(n[i])&&(n[i]=+n[i].toFixed(2)))}return n}function W(e){if(!e.group)return;let t=e.group.id,l=e.group.parent;for(;null!==l;)t=`${l.group.id};${t}`,l=l.group.parent;e.group.id=t}function E(e,t,l,n){const r=t*l-l,i=r+Number(l);if(0==n)return e.slice(r,i);let s=[];return L(e,s,r,Number(l),0),s}function L(e,t,l,n,r){let i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=$(e[s]);if(null!=o.group&&null!=o.group.children&&o.group.children.length>0){a.group.children=[];let e=L(o.group.children,a.group.children,l,n,r);r=e.ci,i=e.added,1==i&&(t[t.length]=a)}else r>=l&&(t[t.length]=a,i=!0),r++;if(r>=l+n)break}return{ci:r,added:i}}function $(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:q(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function R(e){if(null==e)return null;let t=[];for(let l=0;l<e.length;l++)t[t.length]=$(e[l]);return t}function q(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:R(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function z(e,t,l=!1){const n={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const r of t.rows){const t={cells:{},id:r.id};for(const l of n.columns){const n=l.name,i=r.cells[n],s=e.rows.find((e=>e.id===r.id)),o=s?s.cells[n]:null;(!o&&i.value||o&&i.value!==o.value)&&(t.cells[n]=i)}(Object.keys(t.cells).length>0||l)&&n.rows.push(t)}return n}function J(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var l;let n=e.cells[t];const r=n.value,i=n.options;n.isEditable=null!==(l=n.isEditable)&&void 0!==l?l:n.editable;const s={[f.AUTOCOMPLETE]:()=>h(r,"",i),[f.COMBOBOX]:()=>h(r,"",i),[f.RADIO]:()=>d(r,i),[f.CHECKBOX]:()=>b(r,""),[f.CHIP]:()=>p(r),[f.SWITCH]:()=>m(r,"")}[n.shape];s?n.data=s():n.shape&&V.ketchup.debug.logMessage("kup-data",`Shape specified ${n.shape} in cell ${JSON.stringify(n)} unsupported`,c.WARNING)}))}))}export{x as F,g as K,O as a,M as b,S as c,J as d,w as e,B as f,z as g,D as n,E as p,C as s,T as t}