@sme.up/ketchup 11.0.0-SNAPSHOT-20250107095515 → 11.0.0-SNAPSHOT-20250107141846
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.
- package/dist/cjs/{f-cell-96beb1c9.js → f-cell-7b755680.js} +9 -8
- package/dist/cjs/{f-checkbox-084d7e00.js → f-checkbox-989b9645.js} +1 -0
- package/dist/cjs/{f-chip-0a8616b9.js → f-chip-6e268510.js} +1 -1
- package/dist/cjs/{f-object-field-ecf6723c.js → f-object-field-d63e632e.js} +2 -2
- package/dist/cjs/{f-paginator-utils-05ebf67d.js → f-paginator-utils-55d3f22b.js} +1 -1
- package/dist/cjs/{f-text-field-b98570d2.js → f-text-field-3f1b2dd2.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +1 -1
- package/dist/cjs/kup-activity-timeline.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_28.cjs.entry.js +8 -8
- package/dist/cjs/kup-box.cjs.entry.js +8 -8
- package/dist/cjs/kup-calendar.cjs.entry.js +2 -2
- package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-cell.cjs.entry.js +6 -6
- package/dist/cjs/kup-dashboard.cjs.entry.js +3 -3
- package/dist/cjs/{kup-data-table-helper-7a64e65d.js → kup-data-table-helper-7d6b8d9c.js} +1 -1
- package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kup-echart.cjs.entry.js +1 -1
- package/dist/cjs/kup-editor.cjs.entry.js +1 -1
- package/dist/cjs/kup-family-tree.cjs.entry.js +1 -1
- package/dist/cjs/kup-grid.cjs.entry.js +1 -1
- package/dist/cjs/kup-htm.cjs.entry.js +1 -1
- package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
- package/dist/cjs/kup-image-list.cjs.entry.js +6 -6
- package/dist/cjs/kup-input-panel.cjs.entry.js +6 -6
- package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
- package/dist/cjs/kup-magic-box.cjs.entry.js +1 -1
- package/dist/cjs/{kup-manager-51f1619f.js → kup-manager-54961dbb.js} +1 -1
- package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
- package/dist/cjs/kup-object-field.cjs.entry.js +3 -3
- package/dist/cjs/kup-pdf.cjs.entry.js +1 -1
- package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
- package/dist/cjs/kup-planner.cjs.entry.js +2 -2
- package/dist/cjs/kup-probe.cjs.entry.js +1 -1
- package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
- package/dist/cjs/kup-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/kup-txt.cjs.entry.js +1 -1
- package/dist/cjs/kup-typography-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-typography.cjs.entry.js +1 -1
- package/dist/collection/f-components/f-cell/f-cell.js +4 -3
- package/dist/collection/f-components/f-checkbox/f-checkbox.js +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/kup-accordion.js +2 -2
- package/dist/components/kup-activity-timeline.js +2 -2
- package/dist/components/kup-autocomplete.js +1 -1
- package/dist/components/kup-badge.js +1 -1
- package/dist/components/kup-box.js +1 -1
- package/dist/components/kup-button-list.js +1 -1
- package/dist/components/kup-button.js +1 -1
- package/dist/components/kup-calendar.js +2 -2
- package/dist/components/kup-card-list.js +3 -3
- package/dist/components/kup-card.js +1 -1
- package/dist/components/kup-cell.js +2 -2
- package/dist/components/kup-chart.js +1 -1
- package/dist/components/kup-checkbox.js +1 -1
- package/dist/components/kup-chip.js +1 -1
- package/dist/components/kup-color-picker.js +1 -1
- package/dist/components/kup-combobox.js +1 -1
- package/dist/components/kup-dashboard.js +2 -2
- package/dist/components/kup-data-table.js +1 -1
- package/dist/components/kup-date-picker.js +1 -1
- package/dist/components/kup-dialog.js +1 -1
- package/dist/components/kup-drawer.js +2 -2
- package/dist/components/kup-dropdown-button.js +1 -1
- package/dist/components/kup-echart.js +1 -1
- package/dist/components/kup-editor.js +1 -1
- package/dist/components/kup-family-tree.js +3 -3
- package/dist/components/kup-form.js +1 -1
- package/dist/components/kup-gauge.js +1 -1
- package/dist/components/kup-grid.js +1 -1
- package/dist/components/kup-htm.js +2 -2
- package/dist/components/kup-iframe.js +2 -2
- package/dist/components/kup-image-list.js +2 -2
- package/dist/components/kup-image.js +1 -1
- package/dist/components/kup-input-panel.js +3 -3
- package/dist/components/kup-lazy.js +2 -2
- package/dist/components/kup-list.js +1 -1
- package/dist/components/kup-magic-box.js +4 -4
- package/dist/components/kup-nav-bar.js +2 -2
- package/dist/components/kup-numeric-picker.js +2 -2
- package/dist/components/kup-object-field.js +2 -2
- package/dist/components/kup-pdf.js +2 -2
- package/dist/components/kup-photo-frame.js +2 -2
- package/dist/components/kup-planner.js +2 -2
- package/dist/components/kup-probe.js +2 -2
- package/dist/components/kup-progress-bar.js +1 -1
- package/dist/components/kup-qlik.js +2 -2
- package/dist/components/kup-radio.js +1 -1
- package/dist/components/kup-rating.js +1 -1
- package/dist/components/kup-snackbar.js +2 -2
- package/dist/components/kup-spinner.js +1 -1
- package/dist/components/kup-switch.js +1 -1
- package/dist/components/kup-tab-bar.js +1 -1
- package/dist/components/kup-text-field.js +1 -1
- package/dist/components/kup-time-picker.js +1 -1
- package/dist/components/kup-toolbar.js +1 -1
- package/dist/components/kup-tree.js +1 -1
- package/dist/components/kup-txt.js +2 -2
- package/dist/components/kup-typography-list.js +2 -2
- package/dist/components/kup-typography.js +2 -2
- package/dist/components/{p-8783e6cc.js → p-07b27ea9.js} +2 -2
- package/dist/components/{p-5428692b.js → p-621f0bbd.js} +2 -2
- package/dist/components/{p-d79a8f97.js → p-9a575a64.js} +2 -2
- package/dist/components/{p-c9644dba.js → p-e080670d.js} +1 -1
- package/dist/components/{p-4246d872.js → p-e2706fe7.js} +6 -4
- package/dist/components/{p-e886d2ef.js → p-f6a3ea61.js} +2 -2
- package/dist/esm/{f-cell-91f1cec7.js → f-cell-591f1f12.js} +9 -8
- package/dist/esm/{f-checkbox-d839ff5d.js → f-checkbox-b8f2f9c4.js} +1 -0
- package/dist/esm/{f-chip-ea3436a1.js → f-chip-1248516a.js} +1 -1
- package/dist/esm/{f-object-field-c6a800e8.js → f-object-field-b16254a9.js} +2 -2
- package/dist/esm/{f-paginator-utils-ec3eb2f7.js → f-paginator-utils-8aa20dfc.js} +1 -1
- package/dist/esm/{f-text-field-da3e5404.js → f-text-field-92942ecf.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/kup-accordion.entry.js +1 -1
- package/dist/esm/kup-activity-timeline.entry.js +2 -2
- package/dist/esm/kup-autocomplete_28.entry.js +8 -8
- package/dist/esm/kup-box.entry.js +8 -8
- package/dist/esm/kup-calendar.entry.js +2 -2
- package/dist/esm/kup-card-list.entry.js +1 -1
- package/dist/esm/kup-cell.entry.js +6 -6
- package/dist/esm/kup-dashboard.entry.js +3 -3
- package/dist/esm/{kup-data-table-helper-ab1fc74e.js → kup-data-table-helper-49f2c189.js} +1 -1
- package/dist/esm/kup-drawer.entry.js +1 -1
- package/dist/esm/kup-echart.entry.js +1 -1
- package/dist/esm/kup-editor.entry.js +1 -1
- package/dist/esm/kup-family-tree.entry.js +1 -1
- package/dist/esm/kup-grid.entry.js +1 -1
- package/dist/esm/kup-htm.entry.js +1 -1
- package/dist/esm/kup-iframe.entry.js +1 -1
- package/dist/esm/kup-image-list.entry.js +6 -6
- package/dist/esm/kup-input-panel.entry.js +6 -6
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +1 -1
- package/dist/esm/{kup-manager-fc73576b.js → kup-manager-9ea618cf.js} +1 -1
- package/dist/esm/kup-nav-bar.entry.js +1 -1
- package/dist/esm/kup-numeric-picker.entry.js +2 -2
- package/dist/esm/kup-object-field.entry.js +3 -3
- package/dist/esm/kup-pdf.entry.js +1 -1
- package/dist/esm/kup-photo-frame.entry.js +1 -1
- package/dist/esm/kup-planner.entry.js +2 -2
- package/dist/esm/kup-probe.entry.js +1 -1
- package/dist/esm/kup-qlik.entry.js +1 -1
- package/dist/esm/kup-snackbar.entry.js +1 -1
- package/dist/esm/kup-txt.entry.js +1 -1
- package/dist/esm/kup-typography-list.entry.js +1 -1
- package/dist/esm/kup-typography.entry.js +1 -1
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-0603a2d2.js +1 -0
- package/dist/ketchup/{p-495f036d.entry.js → p-129f55ab.entry.js} +1 -1
- package/dist/ketchup/{p-89faf85f.entry.js → p-15759c11.entry.js} +1 -1
- package/dist/ketchup/{p-9a60137a.js → p-1a8b9bc6.js} +1 -1
- package/dist/ketchup/{p-516f41a0.entry.js → p-1dbe390d.entry.js} +1 -1
- package/dist/ketchup/{p-e8ec3b1b.entry.js → p-2c99c1dd.entry.js} +1 -1
- package/dist/ketchup/{p-494e2ac1.entry.js → p-2dd6e0a1.entry.js} +1 -1
- package/dist/ketchup/{p-cd67dc43.entry.js → p-30809bee.entry.js} +1 -1
- package/dist/ketchup/p-3d221df1.entry.js +1 -0
- package/dist/ketchup/{p-a358e1a2.js → p-4508907e.js} +1 -1
- package/dist/ketchup/{p-21d2b3ea.entry.js → p-4613ff5f.entry.js} +1 -1
- package/dist/ketchup/{p-f887cd1c.entry.js → p-515f975a.entry.js} +1 -1
- package/dist/ketchup/{p-19330abe.entry.js → p-5e784686.entry.js} +1 -1
- package/dist/ketchup/{p-24fae583.js → p-6b5ee00f.js} +1 -1
- package/dist/ketchup/{p-f568ff90.entry.js → p-6c2058a5.entry.js} +1 -1
- package/dist/ketchup/{p-9fe71e92.entry.js → p-7040ddc0.entry.js} +1 -1
- package/dist/ketchup/{p-0de33a4c.entry.js → p-7e0747d4.entry.js} +1 -1
- package/dist/ketchup/{p-18951df6.entry.js → p-7f574ecd.entry.js} +1 -1
- package/dist/ketchup/p-808c46cf.js +1 -0
- package/dist/ketchup/{p-09bd4d52.entry.js → p-86ece599.entry.js} +1 -1
- package/dist/ketchup/{p-4e458e5d.js → p-95dddc38.js} +1 -1
- package/dist/ketchup/p-982a5cfc.js +1 -0
- package/dist/ketchup/{p-0d10a2ab.entry.js → p-9eff2437.entry.js} +1 -1
- package/dist/ketchup/{p-9450969f.entry.js → p-9f4e7404.entry.js} +1 -1
- package/dist/ketchup/{p-98340bca.entry.js → p-9fbcac86.entry.js} +1 -1
- package/dist/ketchup/{p-257f33ee.entry.js → p-a7cd2d27.entry.js} +1 -1
- package/dist/ketchup/{p-6bdf7bb8.entry.js → p-c24bb0e2.entry.js} +1 -1
- package/dist/ketchup/{p-08163923.entry.js → p-c6f045ac.entry.js} +1 -1
- package/dist/ketchup/{p-82f28bb0.entry.js → p-cbd22d9c.entry.js} +1 -1
- package/dist/ketchup/{p-2d00cfbf.entry.js → p-dc66522b.entry.js} +1 -1
- package/dist/ketchup/{p-34c9d486.entry.js → p-dc9816a2.entry.js} +1 -1
- package/dist/ketchup/{p-ad753296.entry.js → p-ded20d72.entry.js} +1 -1
- package/dist/ketchup/{p-7932ecdc.entry.js → p-e095d994.entry.js} +1 -1
- package/dist/ketchup/{p-e7077172.entry.js → p-e0ce09a4.entry.js} +1 -1
- package/dist/ketchup/{p-7549b068.js → p-e1eedb80.js} +1 -1
- package/dist/ketchup/{p-427bc664.entry.js → p-ebd275f7.entry.js} +1 -1
- package/dist/ketchup/{p-3001b267.entry.js → p-ec442d8b.entry.js} +1 -1
- package/dist/ketchup/{p-c5fbab94.entry.js → p-f72fd2ab.entry.js} +1 -1
- package/dist/ketchup/{p-087cae27.entry.js → p-f9c0266f.entry.js} +1 -1
- package/dist/types/f-components/f-checkbox/f-checkbox-declarations.d.ts +1 -0
- package/package.json +1 -1
- package/dist/ketchup/p-627af48a.js +0 -1
- package/dist/ketchup/p-b8573ab4.js +0 -1
- package/dist/ketchup/p-e80f3c2b.entry.js +0 -1
- package/dist/ketchup/p-f4cd1e9b.js +0 -1
|
@@ -1 +1 @@
|
|
|
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-504fe614.js";import{F as a}from"./p-f4cd1e9b.js";import{k as u,a6 as h,F as r,g as c,s as p,h as f,ah as d,ae as m,ag as v,af as b,ai as g,e as k,O as _}from"./p-a358e1a2.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-f2213e00.js";import"./p-627af48a.js";import"./p-4e458e5d.js";import"./p-9a60137a.js";import"./p-24fae583.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 z={"*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"},E=t=>0==t?6:t?1===t?18:12*t:null,M=t=>t?22*t:null,S=t=>t?22*(t-1):null,C=t=>t?12*t:null;var D,P,L,W,I,N,R,H,A,U,K,G,V,B,J,X,Y,q,Q,Z,tt,it,nt,et,lt,st,ot,at,ut,ht,rt,ct,pt,ft,dt,mt,vt,bt,gt,kt,_t,xt,yt,wt,jt,Ot,Ft,$t,Tt,zt,Et,Mt,St,Ct,Dt,Pt,Lt,Wt,It,Nt,Rt,Ht,At,Ut,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),D.add(this),P.set(this,u()),L.set(this,void 0),W.set(this,new Map([["SmeupTreeNode",Jt(this,D,"m",Ct).bind(this)],["SmeupDataTree",Jt(this,D,"m",Dt).bind(this)],["SmeupTable",Jt(this,D,"m",Pt).bind(this)],["SmeupDataTable",Jt(this,D,"m",Pt).bind(this)]])),I.set(this,null),N.set(this,new Map([[h.AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[h.MULTI_AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[h.COMBOBOX,["kup-combobox-iconclick","kup-combobox-blur"]],[h.MULTI_COMBOBOX,["kup-combobox-iconclick"]]])),R.set(this,[]),H.set(this,new Map([[h.DATE,"kup-date-picker"],[h.TIME,"kup-time-picker"]])),A.set(this,new Map([[r.BUTTON_LIST,Jt(this,D,"m",J).bind(this)],[r.EDITOR,Jt(this,D,"m",Y).bind(this)],[r.LABEL,Jt(this,D,"m",Q).bind(this)],[r.TABLE,Jt(this,D,"m",q).bind(this)]])),U.set(this,new Map([[O.TAB,Jt(this,D,"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,I,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,P,"f").keysBinding.unregister(t)})),Xt(this,K,[],"f")),this.data&&Jt(this,D,"m",ht).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,P,"f").debug.logLoad(this,!1),Jt(this,P,"f").language.register(this),Jt(this,P,"f").theme.register(this),this.onDataChanged()}componentDidLoad(){Jt(this,D,"m",Kt).call(this),this.kupReady.emit({comp:this,id:this.rootElement.id}),Jt(this,D,"m",Gt).call(this),Jt(this,P,"f").debug.logLoad(this,!0)}componentWillRender(){Jt(this,P,"f").debug.logRender(this,!1)}componentDidRender(){if(Jt(this,L,"f")){const t=Jt(this,L,"f").querySelectorAll(".f-text-field");for(let i=0;i<t.length;i++)x(t[i])}Jt(this,P,"f").debug.logRender(this,!0)}render(){const t=Boolean(!this.inputPanelCells.length)?[e("p",null,Jt(this,P,"f").language.translate(f.EMPTY_DATA))]:this.inputPanelCells.map((t=>Jt(this,D,"m",V).call(this,t)));return e(l,{key:"16518bbef7bd41b36c6c2f8ab6f9b400ad6a1fdd","onKup-cell-blur":Jt(this,D,"m",It).bind(this),"onKup-tabbar-click":t=>{this.tabSelected=t.detail.node.id},"onKup-autocomplete-input":Jt(this,D,"m",kt).bind(this),"onKup-autocomplete-iconclick":Jt(this,D,"m",kt).bind(this),"onKup-combobox-iconclick":Jt(this,D,"m",kt).bind(this)},e("style",{key:"e3939c0397bda17f0e4639466128788a61a17555"},Jt(this,P,"f").theme.setKupStyle(this.rootElement)),e("div",{key:"a0104309e691d9f3e8e167ed5c66be4da359e9ec",id:j},t))}disconnectedCallback(){Jt(this,P,"f").language.unregister(this),Jt(this,P,"f").theme.unregister(this)}get rootElement(){return s(this)}static get watchers(){return{data:["onDataChanged"]}}};P=new WeakMap,L=new WeakMap,W=new WeakMap,I=new WeakMap,N=new WeakMap,R=new WeakMap,H=new WeakMap,A=new WeakMap,U=new WeakMap,K=new WeakMap,D=new WeakSet,G=function(t){return this.inputPanelCells.reduce(((i,{cells:n})=>{if(!i){const i=n.find((({column:i})=>i.name===t));return i?i.cell:null}return i}),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,D,"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",this.inputPanelPosition!==$.INLINE&&this.inputPanelPosition!==$.UPINLINE||(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,D,"m",tt).call(this,t,l)}else u=t.cells.map((i=>Jt(this,D,"m",B).call(this,i.cell,t.row,i.column)));const h={"input-panel-form":!0,"input-panel-form--inline":this.buttonPosition==T.RIGHT},r={"input-panel":!0,"input-panel--column":!s,"input-panel--absolute":null==l?void 0:l.absolute,"input-panel--inline":this.inputPanelPosition===$.INLINE||this.inputPanelPosition===$.UPINLINE},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:h,ref:t=>Xt(this,L,t,"f"),onSubmit:t=>{t.preventDefault(),this.submitCb({value:{before:Object.assign({},Jt(this,I,"f")),after:Jt(this,D,"m",pt).call(this)}})},onContextMenu:t=>{t.preventDefault()}},e("div",{class:"input-panel__typography"},e(y,Object.assign({},p))),e("div",{class:r,style:a},u),e("div",{class:c},e(o,{buttonType:"submit",label:Jt(this,P,"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,A,"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,D,"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,D,"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},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)===h.RADIO?e("span",null,i):null},tt=function(t,i){const n=Jt(this,U,"f").get(i.sectionsType);return n?n(t,i.sections):i.sections.map((i=>Jt(this,D,"m",nt).call(this,t,i,!1)))},it=function(t,i){return i.sections.map((i=>Jt(this,D,"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":this.inputPanelPosition===$.INLINE||this.inputPanelPosition===$.UPINLINE};s.gap=+n.gap>0?`${n.gap}rem`:"1rem";let h=[];if(null===(o=n.sections)||void 0===o?void 0:o.length){h=n.sections.map((n=>Jt(this,D,"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)&&(h=n.content.map((t=>Jt(this,D,"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 r=e("div",{class:u,style:s},h.filter(Boolean));return n.title&&!l?e("div",{class:{"input-panel__section_label_container":!0}},e(y,{type:w.HEADING1,value:n.title}),r):r},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,D,"m",t).call(this,i,n))):(null===(s=n.content)||void 0===s?void 0:s.length)&&(o=n.content.map((t=>Jt(this,D,"m",at).call(this,i,t)))),null==E(n.absoluteWidth))return o;const a=null!=E(n.absoluteWidth)?`${E(n.absoluteWidth)}px`:"100%",u=null!=M(n.absoluteHeight)?`${M(n.absoluteHeight)}px`:"100%",h=`${S(n.absoluteRow)}px`,r=`${C(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:h,left:r,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,D,"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,D,"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,D,"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,D,"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==r.DATE?i.absoluteLength>8?i.absoluteLength:8:i.absoluteLength,i.absoluteHeight||(i.absoluteHeight=1);const s=E(l),o=M(i.absoluteHeight),a=S(i.absoluteRow),u=C(i.absoluteColumn),h={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?`${C(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===r.TABLE&&{rowsPerPage:n.cell.data.data.rows.length,showPaginator:!1,showFooter:!1,tableHeight:`${o}px`}),e("div",{style:h},Jt(this,D,"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,D,"m",Lt).call(this,t)))}};return Jt(this,D,"m",X).call(this,t,i)}{const i=Jt(this,D,"m",Lt).call(this,t);return Jt(this,D,"m",J).call(this,i,t.value)}})).flat()},ht=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,D,"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,D,"m",rt).call(this,i,t,s),slotData:Jt(this,D,"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},rt=function(t,i,n){const e=Object.assign(Object.assign({},Jt(this,D,"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!==h.MULTI_AUTOCOMPLETE&&l!==h.MULTI_COMBOBOX?Jt(this,D,"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,D,"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)===r.TABLE&&(s=JSON.stringify(Jt(this,D,"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([[h.AUTOCOMPLETE,Jt(this,D,"m",gt).bind(this)],[h.BUTTON_LIST,Jt(this,D,"m",bt).bind(this)],[h.CHART,Jt(this,D,"m",vt).bind(this)],[h.CHIP,Jt(this,D,"m",mt).bind(this)],[h.CHECKBOX,Jt(this,D,"m",_t).bind(this)],[h.COLOR_PICKER,Jt(this,D,"m",xt).bind(this)],[h.COMBOBOX,Jt(this,D,"m",gt).bind(this)],[h.EDITOR,Jt(this,D,"m",yt).bind(this)],[h.MULTI_AUTOCOMPLETE,Jt(this,D,"m",mt).bind(this)],[h.MULTI_COMBOBOX,Jt(this,D,"m",mt).bind(this)],[h.NUMBER,Jt(this,D,"m",zt).bind(this)],[h.DATE,Jt(this,D,"m",Ft).bind(this)],[h.OBJECT,Jt(this,D,"m",$t).bind(this)],[h.RADIO,Jt(this,D,"m",jt).bind(this)],[h.STRING,Jt(this,D,"m",wt).bind(this)],[h.SWITCH,Jt(this,D,"m",Ot).bind(this)],[h.TABLE,Jt(this,D,"m",Et).bind(this)],[h.TIME,Jt(this,D,"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===h.CHIP?{trailingIcon:!0,label:i.title,disabled:!t.editable,id:i.name,fullWidth:!1}:n===h.MULTI_AUTOCOMPLETE||n===h.MULTI_COMBOBOX?Object.assign(Object.assign({},Jt(this,D,"m",gt).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,D,"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,P,"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)},gt=function(t,i,n){const e=m(n,i,[]);return t&&(e.data["kup-list"].data=Jt(this,D,"m",St).call(this,t,n)),e},kt=function({detail:t}){const i=Jt(this,D,"m",G).call(this,t.id);i.fun&&Jt(this,D,"m",Wt).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,D,"m",Bt).call(this,l,t)}),o},jt=function(t,i,n){return b(n,t)},Ot=function(t,i,n){return g(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}},zt=function(t,i){return{label:i}},Et=function(t,i,n,e,l){try{let t=JSON.parse(e.value);return t?"SmeupDataTable"!==t.type?(Jt(this,P,"f").debug.logMessage(this,`Wrong data table type for ${l} cell. Type \`SmeupDataTable\` in value expected`,k.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,D,"m",ft).call(this,i.cells[e],l)),{disabled:!1===i.cells[e].editable,id:l.id})})})}),{})})))}}:(Jt(this,P,"f").debug.logMessage(this,`Empty value for ${l} cell.`,k.WARNING),null)}catch(t){return Jt(this,P,"f").debug.logMessage(this,`Invalid value for ${l} cell. Type \`SmeupDataTable\` expected`,k.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,I,"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,W,"f").get(t.type);return n?n(t,i):t.map((t=>({value:t.label,id:t.id,selected:i===t.id})))},Ct=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,D,"m",t).call(this,i,n):[]}}))},Dt=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,D,"m",t).call(this,i,n):[]}}))},Pt=function(t,i){return t.rows.map((t=>{const n=t.fields||t.cells,[e,l]=Object.keys(n);return{id:n[e].value,value:n[l].value||n[e].value,selected:i===n[e].value}}))},Lt=function(t){return t.data&&!t.data.keyShortcut&&Jt(this,P,"f").objects.isJ1Key(t.obj?t.obj:{})&&(t.data.keyShortcut=z[t.obj.k]),Object.assign(Object.assign({},t),{data:Jt(this,D,"m",bt).call(this,null,null,t.value,t,t.obj.k),id:t.obj.k})},Wt=function(t,i){this.optionsHandler(i.fun,t.inputValue,Jt(this,D,"m",pt).call(this),t.id).then((n=>{var e,l,s,o,a;const u=(null===(e=null==n?void 0:n.columns)||void 0===e?void 0:e.filter((t=>(null==t?void 0:t.visible)||!("visible"in t))).map((t=>t.name)))||[],h=null===(l=null==n?void 0:n.rows)||void 0===l?void 0:l.map((t=>{const{cells:i}=t,n=u.reduce(((n,e)=>(t.cells.hasOwnProperty(e)&&(n[e]=i[e]),n)),{});return Object.assign(Object.assign({},t),{cells:n})})),r=Object.assign(Object.assign({},n),{rows:h}),c=null===(o=null===(s=i.data)||void 0===s?void 0:s.data)||void 0===o?void 0:o["kup-list"];c?c.data=(null==h?void 0:h.length)&&null!==(a=Jt(this,D,"m",St).call(this,r,i.value))&&void 0!==a?a:[]:Jt(this,P,"f").debug.logMessage(this,'getAutocompleteEventCallback() - "kup-list" not found in cell.data.data',k.WARNING),t.comp.refresh()}))},It=async function(t){var i,n,e,l,s;const{detail:{column:o,cell:a}}=t,u=Jt(this,D,"m",G).call(this,o.name),h=Jt(this,I,"f").rows[0].cells[o.name];if(u){if(a.mandatory){if(Jt(this,D,"m",Nt).call(this,o.name,u.value?(null===(i=h.data)||void 0===i?void 0:i.error)||null:Jt(this,P,"f").language.translate(f.REQUIRED_VALUE)),!a.value)return}else Jt(this,D,"m",Nt).call(this,o.name,(null===(n=h.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,D,"m",pt).call(this),fun:a.fun});if(!t)return void Jt(this,D,"m",Nt).call(this,o.name,Jt(this,P,"f").language.translate(f.INVALID_VALUE));Jt(this,D,"m",Nt).call(this,o.name,(null===(l=h.data)||void 0===l?void 0:l.error)||null)}(null===(s=a.inputSettings)||void 0===s?void 0:s.checkValueOnExit)&&Jt(this,D,"m",Rt).call(this)&&this.checkValidValueCallback({before:Object.assign({},Jt(this,I,"f")),after:Jt(this,D,"m",pt).call(this)},o.name)}},Nt=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,D,"m",pt).call(this)}):this.submitCb({value:{before:Object.assign({},Jt(this,I,"f")),after:Jt(this,D,"m",pt).call(this)},cell:i})},At=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,D,"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}},Ut=function(t){const i=Jt(this,P,"f").getEventPath(t.target,this.rootElement);return Jt(this,D,"m",At).call(this,i,t)},Kt=function(){Jt(this,P,"f").interact.managedElements.add(Jt(this,L,"f")),Jt(this,P,"f").interact.on(Jt(this,L,"f"),_.TAP,(t=>{if(2==t.button){const i=Jt(this,D,"m",Ut).call(this,t);i&&this.kupDataTableContextMenu.emit({comp:this,id:this.rootElement.id,details:i})}}))},Gt=function(){if(!Jt(this,L,"f"))return;const t=Array.from(Jt(this,L,"f").querySelectorAll(".f-cell__content"));for(const i of t){const t=Jt(this,D,"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,D,"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,L,"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);display:inline-flex}: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
|
+
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-504fe614.js";import{F as a}from"./p-0603a2d2.js";import{k as u,a6 as h,F as r,g as c,s as p,h as f,ah as d,ae as m,ag as v,af as b,ai as g,e as k,O as _}from"./p-4508907e.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-f2213e00.js";import"./p-982a5cfc.js";import"./p-95dddc38.js";import"./p-1a8b9bc6.js";import"./p-6b5ee00f.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 z={"*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"},E=t=>0==t?6:t?1===t?18:12*t:null,M=t=>t?22*t:null,S=t=>t?22*(t-1):null,C=t=>t?12*t:null;var D,P,L,W,I,N,R,H,A,U,K,G,V,B,J,X,Y,q,Q,Z,tt,it,nt,et,lt,st,ot,at,ut,ht,rt,ct,pt,ft,dt,mt,vt,bt,gt,kt,_t,xt,yt,wt,jt,Ot,Ft,$t,Tt,zt,Et,Mt,St,Ct,Dt,Pt,Lt,Wt,It,Nt,Rt,Ht,At,Ut,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),D.add(this),P.set(this,u()),L.set(this,void 0),W.set(this,new Map([["SmeupTreeNode",Jt(this,D,"m",Ct).bind(this)],["SmeupDataTree",Jt(this,D,"m",Dt).bind(this)],["SmeupTable",Jt(this,D,"m",Pt).bind(this)],["SmeupDataTable",Jt(this,D,"m",Pt).bind(this)]])),I.set(this,null),N.set(this,new Map([[h.AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[h.MULTI_AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[h.COMBOBOX,["kup-combobox-iconclick","kup-combobox-blur"]],[h.MULTI_COMBOBOX,["kup-combobox-iconclick"]]])),R.set(this,[]),H.set(this,new Map([[h.DATE,"kup-date-picker"],[h.TIME,"kup-time-picker"]])),A.set(this,new Map([[r.BUTTON_LIST,Jt(this,D,"m",J).bind(this)],[r.EDITOR,Jt(this,D,"m",Y).bind(this)],[r.LABEL,Jt(this,D,"m",Q).bind(this)],[r.TABLE,Jt(this,D,"m",q).bind(this)]])),U.set(this,new Map([[O.TAB,Jt(this,D,"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,I,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,P,"f").keysBinding.unregister(t)})),Xt(this,K,[],"f")),this.data&&Jt(this,D,"m",ht).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,P,"f").debug.logLoad(this,!1),Jt(this,P,"f").language.register(this),Jt(this,P,"f").theme.register(this),this.onDataChanged()}componentDidLoad(){Jt(this,D,"m",Kt).call(this),this.kupReady.emit({comp:this,id:this.rootElement.id}),Jt(this,D,"m",Gt).call(this),Jt(this,P,"f").debug.logLoad(this,!0)}componentWillRender(){Jt(this,P,"f").debug.logRender(this,!1)}componentDidRender(){if(Jt(this,L,"f")){const t=Jt(this,L,"f").querySelectorAll(".f-text-field");for(let i=0;i<t.length;i++)x(t[i])}Jt(this,P,"f").debug.logRender(this,!0)}render(){const t=Boolean(!this.inputPanelCells.length)?[e("p",null,Jt(this,P,"f").language.translate(f.EMPTY_DATA))]:this.inputPanelCells.map((t=>Jt(this,D,"m",V).call(this,t)));return e(l,{key:"16518bbef7bd41b36c6c2f8ab6f9b400ad6a1fdd","onKup-cell-blur":Jt(this,D,"m",It).bind(this),"onKup-tabbar-click":t=>{this.tabSelected=t.detail.node.id},"onKup-autocomplete-input":Jt(this,D,"m",kt).bind(this),"onKup-autocomplete-iconclick":Jt(this,D,"m",kt).bind(this),"onKup-combobox-iconclick":Jt(this,D,"m",kt).bind(this)},e("style",{key:"e3939c0397bda17f0e4639466128788a61a17555"},Jt(this,P,"f").theme.setKupStyle(this.rootElement)),e("div",{key:"a0104309e691d9f3e8e167ed5c66be4da359e9ec",id:j},t))}disconnectedCallback(){Jt(this,P,"f").language.unregister(this),Jt(this,P,"f").theme.unregister(this)}get rootElement(){return s(this)}static get watchers(){return{data:["onDataChanged"]}}};P=new WeakMap,L=new WeakMap,W=new WeakMap,I=new WeakMap,N=new WeakMap,R=new WeakMap,H=new WeakMap,A=new WeakMap,U=new WeakMap,K=new WeakMap,D=new WeakSet,G=function(t){return this.inputPanelCells.reduce(((i,{cells:n})=>{if(!i){const i=n.find((({column:i})=>i.name===t));return i?i.cell:null}return i}),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,D,"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",this.inputPanelPosition!==$.INLINE&&this.inputPanelPosition!==$.UPINLINE||(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,D,"m",tt).call(this,t,l)}else u=t.cells.map((i=>Jt(this,D,"m",B).call(this,i.cell,t.row,i.column)));const h={"input-panel-form":!0,"input-panel-form--inline":this.buttonPosition==T.RIGHT},r={"input-panel":!0,"input-panel--column":!s,"input-panel--absolute":null==l?void 0:l.absolute,"input-panel--inline":this.inputPanelPosition===$.INLINE||this.inputPanelPosition===$.UPINLINE},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:h,ref:t=>Xt(this,L,t,"f"),onSubmit:t=>{t.preventDefault(),this.submitCb({value:{before:Object.assign({},Jt(this,I,"f")),after:Jt(this,D,"m",pt).call(this)}})},onContextMenu:t=>{t.preventDefault()}},e("div",{class:"input-panel__typography"},e(y,Object.assign({},p))),e("div",{class:r,style:a},u),e("div",{class:c},e(o,{buttonType:"submit",label:Jt(this,P,"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,A,"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,D,"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,D,"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},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)===h.RADIO?e("span",null,i):null},tt=function(t,i){const n=Jt(this,U,"f").get(i.sectionsType);return n?n(t,i.sections):i.sections.map((i=>Jt(this,D,"m",nt).call(this,t,i,!1)))},it=function(t,i){return i.sections.map((i=>Jt(this,D,"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":this.inputPanelPosition===$.INLINE||this.inputPanelPosition===$.UPINLINE};s.gap=+n.gap>0?`${n.gap}rem`:"1rem";let h=[];if(null===(o=n.sections)||void 0===o?void 0:o.length){h=n.sections.map((n=>Jt(this,D,"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)&&(h=n.content.map((t=>Jt(this,D,"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 r=e("div",{class:u,style:s},h.filter(Boolean));return n.title&&!l?e("div",{class:{"input-panel__section_label_container":!0}},e(y,{type:w.HEADING1,value:n.title}),r):r},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,D,"m",t).call(this,i,n))):(null===(s=n.content)||void 0===s?void 0:s.length)&&(o=n.content.map((t=>Jt(this,D,"m",at).call(this,i,t)))),null==E(n.absoluteWidth))return o;const a=null!=E(n.absoluteWidth)?`${E(n.absoluteWidth)}px`:"100%",u=null!=M(n.absoluteHeight)?`${M(n.absoluteHeight)}px`:"100%",h=`${S(n.absoluteRow)}px`,r=`${C(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:h,left:r,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,D,"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,D,"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,D,"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,D,"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==r.DATE?i.absoluteLength>8?i.absoluteLength:8:i.absoluteLength,i.absoluteHeight||(i.absoluteHeight=1);const s=E(l),o=M(i.absoluteHeight),a=S(i.absoluteRow),u=C(i.absoluteColumn),h={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?`${C(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===r.TABLE&&{rowsPerPage:n.cell.data.data.rows.length,showPaginator:!1,showFooter:!1,tableHeight:`${o}px`}),e("div",{style:h},Jt(this,D,"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,D,"m",Lt).call(this,t)))}};return Jt(this,D,"m",X).call(this,t,i)}{const i=Jt(this,D,"m",Lt).call(this,t);return Jt(this,D,"m",J).call(this,i,t.value)}})).flat()},ht=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,D,"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,D,"m",rt).call(this,i,t,s),slotData:Jt(this,D,"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},rt=function(t,i,n){const e=Object.assign(Object.assign({},Jt(this,D,"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!==h.MULTI_AUTOCOMPLETE&&l!==h.MULTI_COMBOBOX?Jt(this,D,"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,D,"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)===r.TABLE&&(s=JSON.stringify(Jt(this,D,"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([[h.AUTOCOMPLETE,Jt(this,D,"m",gt).bind(this)],[h.BUTTON_LIST,Jt(this,D,"m",bt).bind(this)],[h.CHART,Jt(this,D,"m",vt).bind(this)],[h.CHIP,Jt(this,D,"m",mt).bind(this)],[h.CHECKBOX,Jt(this,D,"m",_t).bind(this)],[h.COLOR_PICKER,Jt(this,D,"m",xt).bind(this)],[h.COMBOBOX,Jt(this,D,"m",gt).bind(this)],[h.EDITOR,Jt(this,D,"m",yt).bind(this)],[h.MULTI_AUTOCOMPLETE,Jt(this,D,"m",mt).bind(this)],[h.MULTI_COMBOBOX,Jt(this,D,"m",mt).bind(this)],[h.NUMBER,Jt(this,D,"m",zt).bind(this)],[h.DATE,Jt(this,D,"m",Ft).bind(this)],[h.OBJECT,Jt(this,D,"m",$t).bind(this)],[h.RADIO,Jt(this,D,"m",jt).bind(this)],[h.STRING,Jt(this,D,"m",wt).bind(this)],[h.SWITCH,Jt(this,D,"m",Ot).bind(this)],[h.TABLE,Jt(this,D,"m",Et).bind(this)],[h.TIME,Jt(this,D,"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===h.CHIP?{trailingIcon:!0,label:i.title,disabled:!t.editable,id:i.name,fullWidth:!1}:n===h.MULTI_AUTOCOMPLETE||n===h.MULTI_COMBOBOX?Object.assign(Object.assign({},Jt(this,D,"m",gt).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,D,"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,P,"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)},gt=function(t,i,n){const e=m(n,i,[]);return t&&(e.data["kup-list"].data=Jt(this,D,"m",St).call(this,t,n)),e},kt=function({detail:t}){const i=Jt(this,D,"m",G).call(this,t.id);i.fun&&Jt(this,D,"m",Wt).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,D,"m",Bt).call(this,l,t)}),o},jt=function(t,i,n){return b(n,t)},Ot=function(t,i,n){return g(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}},zt=function(t,i){return{label:i}},Et=function(t,i,n,e,l){try{let t=JSON.parse(e.value);return t?"SmeupDataTable"!==t.type?(Jt(this,P,"f").debug.logMessage(this,`Wrong data table type for ${l} cell. Type \`SmeupDataTable\` in value expected`,k.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,D,"m",ft).call(this,i.cells[e],l)),{disabled:!1===i.cells[e].editable,id:l.id})})})}),{})})))}}:(Jt(this,P,"f").debug.logMessage(this,`Empty value for ${l} cell.`,k.WARNING),null)}catch(t){return Jt(this,P,"f").debug.logMessage(this,`Invalid value for ${l} cell. Type \`SmeupDataTable\` expected`,k.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,I,"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,W,"f").get(t.type);return n?n(t,i):t.map((t=>({value:t.label,id:t.id,selected:i===t.id})))},Ct=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,D,"m",t).call(this,i,n):[]}}))},Dt=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,D,"m",t).call(this,i,n):[]}}))},Pt=function(t,i){return t.rows.map((t=>{const n=t.fields||t.cells,[e,l]=Object.keys(n);return{id:n[e].value,value:n[l].value||n[e].value,selected:i===n[e].value}}))},Lt=function(t){return t.data&&!t.data.keyShortcut&&Jt(this,P,"f").objects.isJ1Key(t.obj?t.obj:{})&&(t.data.keyShortcut=z[t.obj.k]),Object.assign(Object.assign({},t),{data:Jt(this,D,"m",bt).call(this,null,null,t.value,t,t.obj.k),id:t.obj.k})},Wt=function(t,i){this.optionsHandler(i.fun,t.inputValue,Jt(this,D,"m",pt).call(this),t.id).then((n=>{var e,l,s,o,a;const u=(null===(e=null==n?void 0:n.columns)||void 0===e?void 0:e.filter((t=>(null==t?void 0:t.visible)||!("visible"in t))).map((t=>t.name)))||[],h=null===(l=null==n?void 0:n.rows)||void 0===l?void 0:l.map((t=>{const{cells:i}=t,n=u.reduce(((n,e)=>(t.cells.hasOwnProperty(e)&&(n[e]=i[e]),n)),{});return Object.assign(Object.assign({},t),{cells:n})})),r=Object.assign(Object.assign({},n),{rows:h}),c=null===(o=null===(s=i.data)||void 0===s?void 0:s.data)||void 0===o?void 0:o["kup-list"];c?c.data=(null==h?void 0:h.length)&&null!==(a=Jt(this,D,"m",St).call(this,r,i.value))&&void 0!==a?a:[]:Jt(this,P,"f").debug.logMessage(this,'getAutocompleteEventCallback() - "kup-list" not found in cell.data.data',k.WARNING),t.comp.refresh()}))},It=async function(t){var i,n,e,l,s;const{detail:{column:o,cell:a}}=t,u=Jt(this,D,"m",G).call(this,o.name),h=Jt(this,I,"f").rows[0].cells[o.name];if(u){if(a.mandatory){if(Jt(this,D,"m",Nt).call(this,o.name,u.value?(null===(i=h.data)||void 0===i?void 0:i.error)||null:Jt(this,P,"f").language.translate(f.REQUIRED_VALUE)),!a.value)return}else Jt(this,D,"m",Nt).call(this,o.name,(null===(n=h.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,D,"m",pt).call(this),fun:a.fun});if(!t)return void Jt(this,D,"m",Nt).call(this,o.name,Jt(this,P,"f").language.translate(f.INVALID_VALUE));Jt(this,D,"m",Nt).call(this,o.name,(null===(l=h.data)||void 0===l?void 0:l.error)||null)}(null===(s=a.inputSettings)||void 0===s?void 0:s.checkValueOnExit)&&Jt(this,D,"m",Rt).call(this)&&this.checkValidValueCallback({before:Object.assign({},Jt(this,I,"f")),after:Jt(this,D,"m",pt).call(this)},o.name)}},Nt=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,D,"m",pt).call(this)}):this.submitCb({value:{before:Object.assign({},Jt(this,I,"f")),after:Jt(this,D,"m",pt).call(this)},cell:i})},At=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,D,"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}},Ut=function(t){const i=Jt(this,P,"f").getEventPath(t.target,this.rootElement);return Jt(this,D,"m",At).call(this,i,t)},Kt=function(){Jt(this,P,"f").interact.managedElements.add(Jt(this,L,"f")),Jt(this,P,"f").interact.on(Jt(this,L,"f"),_.TAP,(t=>{if(2==t.button){const i=Jt(this,D,"m",Ut).call(this,t);i&&this.kupDataTableContextMenu.emit({comp:this,id:this.rootElement.id,details:i})}}))},Gt=function(){if(!Jt(this,L,"f"))return;const t=Array.from(Jt(this,L,"f").querySelectorAll(".f-cell__content"));for(const i of t){const t=Jt(this,D,"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,D,"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,L,"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);display:inline-flex}: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 +1 @@
|
|
|
1
|
-
import{r as t,c as e,f as i,h as a,H as s,d as o}from"./p-b0368f88.js";import{k as n,g as h,s as r,t as c,ab as l}from"./p-
|
|
1
|
+
import{r as t,c as e,f as i,h as a,H as s,d as o}from"./p-b0368f88.js";import{k as n,g as h,s as r,t as c,ab as l}from"./p-4508907e.js";import{c as p}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var f;!function(t){t.columnsNumber="Sets the number of columns.",t.customStyle="Custom style of the component.",t.data="Actual data of the component.",t.decvalueCol="Sets the decimal value column.",t.descrCol="Sets the description column.",t.fullWidth="Sets whether the component occupies all available width.",t.horizontal="Sets whether the cards are placed horizontally or not.",t.iconCol="Sets the icon column.",t.iconcolorCol="Sets the icon color column.",t.intvalueCol="Sets the integer value column.",t.isClickable="Sets whether a single card is clickable or not.",t.layoutCol="Sets the layout column.",t.measureCol="Sets the unit of measure column.",t.textcolorCol="Sets the text color column.",t.valueCol="Sets the value column.",t.valuecolorCol="Sets the value color column."}(f||(f={}));var u,m=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)};const d=class{constructor(i){t(this,i),this.kupCardListClickEvent=e(this,"kup-cardlist-click",7),u.set(this,n()),this.columnsNumber=1,this.customStyle="",this.data=null,this.fullWidth=!0,this.horizontal=!1,this.descrCol="",this.iconCol="",this.valueCol="",this.measureCol="",this.intvalueCol="",this.decvalueCol="",this.textcolorCol="",this.valuecolorCol="",this.iconcolorCol="",this.layoutCol="",this.isClickable=!1}async getProps(t){return h(this,f,t)}async refresh(){i(this)}async setProps(t){r(this,f,t)}componentWillLoad(){m(this,u,"f").debug.logLoad(this,!1),m(this,u,"f").theme.register(this)}componentDidLoad(){m(this,u,"f").debug.logLoad(this,!0)}componentDidRender(){m(this,u,"f").debug.logRender(this,!0)}render(){if(!this.data||!this.data.columns||!this.data.columns.length)return;const t=[];let e,i,o,n,h,r,f,d,g,k;for(let t=0;t<this.data.columns.length;t++){const a=this.data.columns[t];if(a.name)switch(a.name){case this.decvalueCol:e=a;break;case this.descrCol:i=a;break;case this.iconCol:o=a;break;case this.iconcolorCol:n=a;break;case this.intvalueCol:h=a;break;case this.layoutCol:r=a;break;case this.measureCol:f=a;break;case this.textcolorCol:d=a;break;case this.valueCol:g=a;break;case this.valuecolorCol:k=a}}for(let s=0;s<this.data.rows.length;s++){const p=this.data.rows[s],x={color:[],image:[],text:[]},y=r&&p.cells[r.name].value?parseInt(p.cells[r.name].value):1,w=a("kup-card",{class:this.isClickable?"is-clickable":"",customStyle:"#kup-component, .scalable-card { min-height: var(--kup_cardlist_cardsminheight) }",data:x,layoutFamily:c.SCALABLE,layoutNumber:y,key:s,"onKup-card-click":()=>{this.isClickable&&this.kupCardListClickEvent.emit({comp:this,id:this.rootElement.id,index:s,row:p})},slot:s.toString()}),b=(t,e,i)=>{if(t){const a=p.cells[t.name];if(a){const s=a.value;switch(e){case"color":x[e][i]=m(this,u,"f").theme.colorCheck(s).hexColor;break;case"image":x[e][i]={resource:s};break;default:x[e][i]=l(t,a)}}}};switch(y){case 1:b(d,"color",0),b(k,"color",1),b(i,"text",0),b(g,"text",1);break;case 2:b(n,"color",0),b(k,"color",1),b(o,"image",0),b(h,"text",0),b(e,"text",1),b(f,"text",2);break;case 3:b(k,"color",0),b(d,"color",1),b(g,"text",0),b(i,"text",1);break;case 4:b(n,"color",0),b(k,"color",1),b(d,"color",2),b(o,"image",0),b(h,"text",0),b(e,"text",1),b(f,"text",2),b(i,"text",3);break;case 5:b(n,"color",0),b(d,"color",1),b(k,"color",2),b(o,"image",0),b(i,"text",0),b(g,"text",1);break;case 6:case 7:case 8:b(n,"color",0),b(k,"color",1),b(d,"color",2),b(o,"image",0),b(g,"text",0),b(i,"text",1)}t.push(w)}return a(s,null,a("style",null,m(this,u,"f").theme.setKupStyle(this.rootElement)),a("div",{id:p},a("kup-grid",{class:(this.fullWidth?"kup-full-width":"")+" scalable-cards",columns:this.columnsNumber,singleLine:this.horizontal},t)))}disconnectedCallback(){m(this,u,"f").theme.unregister(this)}get rootElement(){return o(this)}};u=new WeakMap,d.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_cardlist_cards_max_height:var(--kup-cardlist-cards-max-height, unset);--kup_cardlist_cards_min_height:var(--kup-cardlist-cards-min-height, unset);--kup_cardlist_cards_max_width:var(--kup-cardlist-cards-max-width, unset);--kup_cardlist_cards_min_width:var(--kup-cardlist-cards-min-width, unset);display:block;height:fit-content;width:100%}#kup-component{height:100%;width:100%}kup-card{max-height:var(--kup_cardlist_cards_max_height);min-height:var(--kup_cardlist_cards_min_height);max-width:var(--kup_cardlist_cards_max_width);min-width:var(--kup_cardlist_cards_min_width)}kup-card.is-clickable{cursor:pointer}kup-grid{--kup-grid-padding:0}";export{d as kup_card_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,H as t,D as l,B as n,ab as r,v as i,x as o,ac as s,ad as a,M as u,F as c,ae as f,af as h,ag as d,ah as b,ai as m,a2 as p}from"./p-a358e1a2.js";import{K as v}from"./p-1ee561ba.js";class F 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),o=this.getIntervalTextFieldFilterValues(e,r),s=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=o[t.FROM]&&(u+=a+"(>= "+l(o[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=o[t.TO]&&(u+=a+"(<= "+l(o[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return s.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 x;!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."}(x||(x={}));const w="TREE_COLUMN";var T;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(T||(T={}));const g=document.documentElement,k=g.ketchup?g.ketchup.objects:new o,j=g.ketchup?g.ketchup.data:new s;class y 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,o=[],s){if(n){let t=!0;if(o&&null!=o&&o.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<o.length;i++){if(0==o[i].visible)continue;const s=e[o[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,l);let a=r(o[i],s);if(a!=s.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==s&&(s=new F),!this.hasFilters(t,o,s))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=s.getTextFilterValue(t,n),c=s.getIntervalTextFieldFilterValues(t,i(o,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(k.isNumber(r.obj)||k.isDate(r.obj)||k.isTime(r.obj)||k.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let b=s.getCheckBoxFilterValues(t,n);if(0==b.length)continue;let m=!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()){m=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){m=!0;break}}}if(!m)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 F);for(let r=0;r<n.length;r++){let o=n[r],s=null;if(s=o===w?{name:w,title:""}:i(t,o),l.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},l="",n=[],r){if(!e||null==e)return[];let i=[];const o=!(!l||!n);if(this.hasFilters(t,n,r)||o)for(let s=0;s<e.length;s++){let a=e[s];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,o,n,r))&&(i[i.length]=a)}else i=[...e];return i}getColumnValues(t,n,r,i){let o=new Array;null==i&&(i=new F);let s=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)||""==s||i.isFilterCompliantForSimpleValue(r,n.obj,s,a))&&o.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),o;let c=Object.assign({},t.filters);c[n.name]={textField:s,textFieldTmp:s,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)o.push(u[e]);return j.cell.getUnivocalValue({rows:f},n,!0)}}const O=document.documentElement;function V(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:p.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=V(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=C(e,n,t[l]);if(0!==r)return r}return 0}return C(e,n,t[0])}))}function C(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 I(e=[],t={},l="",n=[],r,i){return null==i&&(i=new y),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 o={},s=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return o[l]=n,!0;return!1}));if(0===s.length)return t;const a=[];let c={};return t.forEach((t=>{const l=s[0].column,f=t.cells[l];if(f){const h=i(e,l),d=r(h,f),b=f.value;let m=null;for(let e of a)if(e.group.label===d){m=e;break}null===m&&(m={group:{id:b,parent:null,column:l,columnLabel:o[l],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},a.push(m));for(let l=1;l<s.length;l++){const n=s[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(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===l){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:n.column,columnLabel:o[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},W(u),m.group.children.push(u)),m=u}}m.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=O.ketchup.objects.isNumber(i.obj),o=t[r];switch(o){case u.COUNT:let t=e.group.totals[r]||0;e.group.totals[r]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[r]||0;s.group.totals[r]=++e,s=s.group.parent}break;case u.DISTINCT:let a;if(a=l?O.ketchup.math.numberify(O.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=O.ketchup.math.numberify(O.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=O.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=O.ketchup.math.numberify(O.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&&O.ketchup.objects.isDate(i.obj)&&O.ketchup.dates.isValidFormattedStringDate(i.value)){const t=e.group.totals[r];if(t){let l=[];l.push(a),l.push(O.ketchup.dates.toDayjs(t)),e.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.min(l),v.ISO_DATE)}else e.group.totals[r]=O.ketchup.dates.format(a,v.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(O.ketchup.dates.toDayjs(e)),l.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.min(t),v.ISO_DATE)}else l.group.totals[r]=O.ketchup.dates.format(a,v.ISO_DATE);l=l.group.parent}}break;case u.MAX:if(l&&i.value){const t=e.group.totals[r],l=O.ketchup.math.numberify(O.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&&O.ketchup.objects.isDate(i.obj)&&O.ketchup.dates.isValidFormattedStringDate(i.value)){const t=e.group.totals[r];if(t){let l=[];l.push(a),l.push(O.ketchup.dates.toDayjs(t)),e.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.max(l),v.ISO_DATE)}else e.group.totals[r]=O.ketchup.dates.format(a,v.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(O.ketchup.dates.toDayjs(e)),l.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.max(t),v.ISO_DATE)}else l.group.totals[r]=O.ketchup.dates.format(a,v.ISO_DATE);l=l.group.parent}}break;default:0!=o.indexOf(u.MATH)&&console.warn(`invalid total mode: ${o}`)}}}))}(m,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),B(a,u.AVERAGE,n),B(a,u.MATH,n),a}function B(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]=O.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 N(e=[],t={}){if(O.ketchup.objects.isEmptyJsObject(e)||O.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,o,s)=>{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=O.ketchup.objects.isNumber(a.obj)?O.ketchup.math.numberify(O.ketchup.math.numberifySafe(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(O.ketchup.objects.isNumber(a.obj)){const e=O.ketchup.math.numberify(O.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+O.ketchup.math.numberify(r)}}else if(O.ketchup.objects.isDate(a.obj)&&(-1==r.indexOf(l)&&r.push(l),O.ketchup.dates.isValidFormattedStringDate(a.value))){const e=O.ketchup.dates.toDate(O.ketchup.dates.toDayjs(a.value)),r=n[l]?O.ketchup.dates.toDate(O.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]=O.ketchup.dates.format(O.ketchup.dates.min(t),v.ISO_DATE)}else n[l]=O.ketchup.dates.format(e,v.ISO_DATE);break;case t[l]===u.MAX:if(r){let t=[];t.push(e),t.push(r),n[l]=O.ketchup.dates.format(O.ketchup.dates.max(t),v.ISO_DATE)}else n[l]=O.ketchup.dates.format(e,v.ISO_DATE)}}o===s.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]=O.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=O.ketchup.dates.format(n[i]):O.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 o=[];return L(e,o,r,Number(l),0),o}function L(e,t,l,n,r){let i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=S(e[o]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=L(s.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 S(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:$(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]=S(e[l]);return t}function $(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 q(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],o=e.rows.find((e=>e.id===r.id)),s=o?o.cells[n]:null;(!s&&i.value||s&&i.value!==s.value)&&(t.cells[n]=i)}(Object.keys(t.cells).length>0||l)&&n.rows.push(t)}return n}function z(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 o={[c.AUTOCOMPLETE]:()=>f(r,"",i),[c.COMBOBOX]:()=>f(r,"",i),[c.RADIO]:()=>h(r,i),[c.CHECKBOX]:()=>d(r,""),[c.CHIP]:()=>b(r),[c.SWITCH]:()=>m(r,"")}[n.shape];o&&(n.data=Object.assign(Object.assign({},o()),n.data))}))}))}export{F,T as K,y as a,M as b,N as c,z as d,x as e,I as f,q as g,D as n,E as p,V as s,w as t}
|
|
1
|
+
import{C as e,H as t,D as l,B as n,ab as r,v as i,x as o,ac as s,ad as a,M as u,F as c,ae as f,af as h,ag as d,ah as b,ai as m,a2 as p}from"./p-4508907e.js";import{K as v}from"./p-1ee561ba.js";class F 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),o=this.getIntervalTextFieldFilterValues(e,r),s=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=o[t.FROM]&&(u+=a+"(>= "+l(o[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=o[t.TO]&&(u+=a+"(<= "+l(o[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return s.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 x;!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."}(x||(x={}));const w="TREE_COLUMN";var T;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(T||(T={}));const g=document.documentElement,k=g.ketchup?g.ketchup.objects:new o,j=g.ketchup?g.ketchup.data:new s;class y 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,o=[],s){if(n){let t=!0;if(o&&null!=o&&o.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<o.length;i++){if(0==o[i].visible)continue;const s=e[o[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,l);let a=r(o[i],s);if(a!=s.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==s&&(s=new F),!this.hasFilters(t,o,s))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=s.getTextFilterValue(t,n),c=s.getIntervalTextFieldFilterValues(t,i(o,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(k.isNumber(r.obj)||k.isDate(r.obj)||k.isTime(r.obj)||k.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let b=s.getCheckBoxFilterValues(t,n);if(0==b.length)continue;let m=!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()){m=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){m=!0;break}}}if(!m)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 F);for(let r=0;r<n.length;r++){let o=n[r],s=null;if(s=o===w?{name:w,title:""}:i(t,o),l.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},l="",n=[],r){if(!e||null==e)return[];let i=[];const o=!(!l||!n);if(this.hasFilters(t,n,r)||o)for(let s=0;s<e.length;s++){let a=e[s];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,o,n,r))&&(i[i.length]=a)}else i=[...e];return i}getColumnValues(t,n,r,i){let o=new Array;null==i&&(i=new F);let s=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)||""==s||i.isFilterCompliantForSimpleValue(r,n.obj,s,a))&&o.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),o;let c=Object.assign({},t.filters);c[n.name]={textField:s,textFieldTmp:s,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)o.push(u[e]);return j.cell.getUnivocalValue({rows:f},n,!0)}}const O=document.documentElement;function V(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:p.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=V(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=C(e,n,t[l]);if(0!==r)return r}return 0}return C(e,n,t[0])}))}function C(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 I(e=[],t={},l="",n=[],r,i){return null==i&&(i=new y),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 o={},s=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return o[l]=n,!0;return!1}));if(0===s.length)return t;const a=[];let c={};return t.forEach((t=>{const l=s[0].column,f=t.cells[l];if(f){const h=i(e,l),d=r(h,f),b=f.value;let m=null;for(let e of a)if(e.group.label===d){m=e;break}null===m&&(m={group:{id:b,parent:null,column:l,columnLabel:o[l],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},a.push(m));for(let l=1;l<s.length;l++){const n=s[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(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===l){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:n.column,columnLabel:o[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},W(u),m.group.children.push(u)),m=u}}m.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=O.ketchup.objects.isNumber(i.obj),o=t[r];switch(o){case u.COUNT:let t=e.group.totals[r]||0;e.group.totals[r]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[r]||0;s.group.totals[r]=++e,s=s.group.parent}break;case u.DISTINCT:let a;if(a=l?O.ketchup.math.numberify(O.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=O.ketchup.math.numberify(O.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=O.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=O.ketchup.math.numberify(O.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&&O.ketchup.objects.isDate(i.obj)&&O.ketchup.dates.isValidFormattedStringDate(i.value)){const t=e.group.totals[r];if(t){let l=[];l.push(a),l.push(O.ketchup.dates.toDayjs(t)),e.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.min(l),v.ISO_DATE)}else e.group.totals[r]=O.ketchup.dates.format(a,v.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(O.ketchup.dates.toDayjs(e)),l.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.min(t),v.ISO_DATE)}else l.group.totals[r]=O.ketchup.dates.format(a,v.ISO_DATE);l=l.group.parent}}break;case u.MAX:if(l&&i.value){const t=e.group.totals[r],l=O.ketchup.math.numberify(O.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&&O.ketchup.objects.isDate(i.obj)&&O.ketchup.dates.isValidFormattedStringDate(i.value)){const t=e.group.totals[r];if(t){let l=[];l.push(a),l.push(O.ketchup.dates.toDayjs(t)),e.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.max(l),v.ISO_DATE)}else e.group.totals[r]=O.ketchup.dates.format(a,v.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(O.ketchup.dates.toDayjs(e)),l.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.max(t),v.ISO_DATE)}else l.group.totals[r]=O.ketchup.dates.format(a,v.ISO_DATE);l=l.group.parent}}break;default:0!=o.indexOf(u.MATH)&&console.warn(`invalid total mode: ${o}`)}}}))}(m,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),B(a,u.AVERAGE,n),B(a,u.MATH,n),a}function B(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]=O.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 N(e=[],t={}){if(O.ketchup.objects.isEmptyJsObject(e)||O.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,o,s)=>{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=O.ketchup.objects.isNumber(a.obj)?O.ketchup.math.numberify(O.ketchup.math.numberifySafe(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(O.ketchup.objects.isNumber(a.obj)){const e=O.ketchup.math.numberify(O.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+O.ketchup.math.numberify(r)}}else if(O.ketchup.objects.isDate(a.obj)&&(-1==r.indexOf(l)&&r.push(l),O.ketchup.dates.isValidFormattedStringDate(a.value))){const e=O.ketchup.dates.toDate(O.ketchup.dates.toDayjs(a.value)),r=n[l]?O.ketchup.dates.toDate(O.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]=O.ketchup.dates.format(O.ketchup.dates.min(t),v.ISO_DATE)}else n[l]=O.ketchup.dates.format(e,v.ISO_DATE);break;case t[l]===u.MAX:if(r){let t=[];t.push(e),t.push(r),n[l]=O.ketchup.dates.format(O.ketchup.dates.max(t),v.ISO_DATE)}else n[l]=O.ketchup.dates.format(e,v.ISO_DATE)}}o===s.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]=O.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=O.ketchup.dates.format(n[i]):O.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 o=[];return L(e,o,r,Number(l),0),o}function L(e,t,l,n,r){let i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=S(e[o]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=L(s.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 S(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:$(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]=S(e[l]);return t}function $(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 q(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],o=e.rows.find((e=>e.id===r.id)),s=o?o.cells[n]:null;(!s&&i.value||s&&i.value!==s.value)&&(t.cells[n]=i)}(Object.keys(t.cells).length>0||l)&&n.rows.push(t)}return n}function z(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 o={[c.AUTOCOMPLETE]:()=>f(r,"",i),[c.COMBOBOX]:()=>f(r,"",i),[c.RADIO]:()=>h(r,i),[c.CHECKBOX]:()=>d(r,""),[c.CHIP]:()=>b(r),[c.SWITCH]:()=>m(r,"")}[n.shape];o&&(n.data=Object.assign(Object.assign({},o()),n.data))}))}))}export{F,T as K,y as a,M as b,N as c,z as d,x as e,I as f,q as g,D as n,E as p,V as s,w as t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as t,f as e,h as a,H as s,d as o}from"./p-b0368f88.js";import{k as n,g as l,s as r,h as p,O as m,f as h}from"./p-a358e1a2.js";import{c}from"./p-635bb4b3.js";import{F as f}from"./p-f2213e00.js";import{F as g}from"./p-504fe614.js";import{a as u}from"./p-e3062c19.js";import{F as d}from"./p-f4cd1e9b.js";import{M as _}from"./p-c56195a0.js";import"./p-1ee561ba.js";import"./p-627af48a.js";import"./p-4e458e5d.js";import"./p-9a60137a.js";import"./p-24fae583.js";var k;!function(i){i.columns="Can set a specific number of columns",i.customStyle="Custom style of the component.",i.data="Actual data of the component",i.ripple="When enabled displays Material's ripple effect on clicked items.",i.rows="Cam set a specific number of rows. It overwrite the columns flow into rows flow",i.showFullDescription="When enabled, image descriptions will always be displayed entirely and not cut or truncated."}(k||(k={}));class v{constructor(){this.load=!1}toDebugString(){return"image-list state"}}var b,w,y,x,j,z,C,W,M,$,E,O,T,P,D,I=function(i,t,e,a){if("a"===e&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?i!==t||!a:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?a:"a"===e?a.call(i):a?a.value:t.get(i)},R=function(i,t,e,a,s){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?i!==t||!s:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?s.call(i,e):s?s.value=e:t.set(i,e),e};const S=class{constructor(e){i(this,e),this.kupClick=t(this,"kup-imagelist-click",6),this.kupContextMenu=t(this,"kup-imagelist-contextmenu",6),this.kupDblClick=t(this,"kup-imagelist-dblclick",6),b.add(this),this.state=new v,w.set(this,[]),y.set(this,n()),x.set(this,{icon:"arrow_back",onClick:()=>{this.currentNode=I(this,y,"f").data.node.getParent(this.data,this.currentNode),this.currentNode||(this.navigationBarToggled=!1)},styling:u.FLAT,wrapperClass:"navigation-bar__back"}),j.set(this,{icon:"arrow_upward",onClick:()=>{this.currentNode=null,this.navigationBarToggled=!1},styling:u.FLAT,wrapperClass:"navigation-bar__top"}),z.set(this,void 0),C.set(this,!1),W.set(this,[]),this.currentNode=null,this.navigationBarToggled=!1,this.columns=[],this.customStyle="",this.data=[],this.ripple=!1,this.rows=null,this.selectedNode=[],this.stateId="",this.store=void 0,this.showFullDescription=!1}initWithPersistedState(){if(this.store&&this.stateId){const i=this.store.getState(this.stateId);null!=i&&(this.currentNode=I(this,y,"f").data.node.findByStrTreeNodePath(this.data,i.selectedTreeNodePath))}}persistState(){if(this.store&&this.stateId){let i=!1,t=this.currentNode?this.currentNode.id:"";if(I(this,y,"f").objects.deepEqual(this.state.selectedTreeNodePath,t)||(this.state.selectedTreeNodePath=t,i=!0),!this.state.load)return void(this.state.load=!0);i&&this.store.persistState(this.stateId,this.state)}}selectNode(i){i&&0!=i.length&&(this.currentNode=I(this,y,"f").data.node.find(this.data,i))}async getProps(i){return l(this,k,i)}async refresh(){e(this)}async setProps(i){r(this,k,i)}componentWillLoad(){I(this,y,"f").debug.logLoad(this,!1),I(this,y,"f").language.register(this),I(this,y,"f").theme.register(this)}componentDidLoad(){I(this,b,"m",D).call(this),I(this,y,"f").debug.logLoad(this,!0)}componentWillRender(){I(this,y,"f").debug.logRender(this,!1)}componentDidRender(){const i=this.rootElement.shadowRoot;if(i&&this.ripple){const t=i.querySelectorAll(".mdc-ripple-surface:not(.mdc-ripple-upgraded)");if(t)for(let i=0;i<t.length;i++)_.attachTo(t[i])}this.persistState(),I(this,y,"f").debug.logRender(this,!0)}render(){const i=!!this.currentNode;let t={};this.columns&&(1===this.columns.length?t={"--kup-imagelist-columns-mobile":`${this.columns[0]}`,"--kup-imagelist-columns-tablet":`${this.columns[0]}`,"--kup-imagelist-columns-desktop":`${this.columns[0]}`}:2===this.columns.length?t={"--kup-imagelist-columns-mobile":`${this.columns[0]}`,"--kup-imagelist-columns-tablet":`${this.columns[0]}`,"--kup-imagelist-columns-desktop":`${this.columns[1]}`}:3===this.columns.length&&(t={"--kup-imagelist-columns-mobile":`${this.columns[0]}`,"--kup-imagelist-columns-tablet":`${this.columns[1]}`,"--kup-imagelist-columns-desktop":`${this.columns[2]}`}));let e=Object.assign({},t);if(null!=this.rows&&this.rows>0){const i={"grid-template-rows":`repeat(${this.rows}, minmax(0px, 1fr))`,"grid-auto-flow":"column"};e=Object.assign(Object.assign({},e),i)}const o="image-list"+(this.showFullDescription?" full-description":"");return a(s,{key:"fc9dede25393c4124c50cf79ec668e76f4ef36ee"},a("style",{key:"784928f6c2c07e3e4d5bd570dadf6e9552a9320a"},I(this,y,"f").theme.setKupStyle(this.rootElement)),a("div",{key:"490448ffb258388f237239b2e4648d11d165f0a1",id:c,ref:i=>{R(this,z,i,"f")}},a("div",{key:"6d1d5ee2288c5a7c401bb78e304ba4501284ae20",class:"navigation-bar"},i?a("div",{class:"navigation-bar__wrapper "+(this.navigationBarToggled?"navigation-bar__wrapper--active":"")},a("div",{class:"navigation-bar__title",onClick:()=>{this.navigationBarToggled=!this.navigationBarToggled}},a(f,{fit:!0,resource:this.currentNode.icon,placeholderResource:this.currentNode.placeholderIcon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"navigation-bar__title__image"}),a("div",{class:"navigation-bar__title__label"},this.currentNode.value)),a(g,Object.assign({},I(this,x,"f"),{label:I(this,y,"f").language.translate(p.BACK)})),a(g,Object.assign({},I(this,j,"f"),{label:I(this,y,"f").language.translate(p.TOP)}))):null),a("div",{key:"6b085d0b583433b38a29c9142dd811681585949b",class:o,style:e},...I(this,b,"m",$).call(this))))}disconnectedCallback(){I(this,y,"f").interact.unregister(I(this,W,"f")),I(this,y,"f").language.unregister(this),I(this,y,"f").theme.unregister(this)}get rootElement(){return o(this)}static get watchers(){return{selectedNode:["selectNode"]}}};w=new WeakMap,y=new WeakMap,x=new WeakMap,j=new WeakMap,z=new WeakMap,C=new WeakMap,W=new WeakMap,b=new WeakSet,M=function(i){const t={fit:!0,resource:i.icon,placeholderResource:i.placeholderIcon,title:i.title,wrapperClass:"image-list__image",badgeData:i.badgeData},e=a(f,Object.assign({},t)),s=a("div",{class:"image-list__label"},i.value),o=t.resource.indexOf(".")>-1||t.resource.indexOf("/")>-1||t.resource.indexOf("\\")>-1;return a(d,{cell:{value:i.value,icon:i.icon,placeholderIcon:i.placeholderIcon,obj:i.obj},column:{name:"IMAGE",title:"Image"},component:this,density:h.NONE,row:Object.assign({},i)},a("div",{class:"image-list__wrapper"+(o?" images":"")},!o&&a("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 24 24"}),e,s))},$=function(){const i=[],t=this.currentNode?this.currentNode.children:this.data;for(let e=0;t&&e<t.length;e++){const s=t[e],o=a("div",{onContextMenu:i=>{i.preventDefault()},class:{"image-list__item":!0,"mdc-ripple-surface":!!this.ripple}},I(this,b,"m",M).call(this,s));i.push(o)}return i},E=function(i,t){let e;if(i)for(let t=i.length-1;t>=0;t--){let a=i[t];a.tagName&&a.classList.contains("f-cell")&&(e=a["kup-get-cell-props"]())}return{cell:null==e?void 0:e.cell,column:null==e?void 0:e.column,originalEvent:t,row:null==e?void 0:e.row}},O=function(i){return I(this,b,"m",E).call(this,I(this,y,"f").getEventPath(i.target,this.rootElement),i)},T=function(i){return I(this,b,"m",E).call(this,I(this,y,"f").getEventPath(i.target,this.rootElement),i)},P=function(i){return I(this,b,"m",E).call(this,I(this,y,"f").getEventPath(i.target,this.rootElement),i)},D=function(){I(this,W,"f").push(I(this,z,"f")),I(this,y,"f").interact.on(I(this,z,"f"),m.HOLD,(i=>{"pen"!==i.pointerType&&"touch"!==i.pointerType||(R(this,C,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:I(this,b,"m",T).call(this,i)}))})),I(this,y,"f").interact.on(I(this,z,"f"),m.TAP,(i=>{if(I(this,C,"f"))R(this,C,!1,"f");else switch(i.button){case 0:const t={};for(const e in i)t[e]=i[e];I(this,w,"f").push(setTimeout((()=>{var i;const e=I(this,b,"m",O).call(this,t),a=e.row;(null===(i=null==a?void 0:a.children)||void 0===i?void 0:i.length)>0&&(this.currentNode=a),this.kupClick.emit({comp:this,id:this.rootElement.id,details:e})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:I(this,b,"m",T).call(this,i)})}})),I(this,y,"f").interact.on(I(this,z,"f"),m.DOUBLETAP,(i=>{if(0===i.button){for(let i=0;i<I(this,w,"f").length;i++)clearTimeout(I(this,w,"f")[i]),I(this,y,"f").debug.logMessage(this,"Cleared clickHandler timeout("+I(this,w,"f")[i]+").");R(this,w,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:I(this,b,"m",P).call(this,i)})}}))},S.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_imagelist_columns_mobile:var(--kup-imagelist-columns-mobile, 4);--kup_imagelist_columns_tablet:var(--kup-imagelist-columns-tablet, 6);--kup_imagelist_columns_desktop:var(--kup-imagelist-columns-desktop, 8);--kup_imagelist_background_color:var(\n --kup-imagelist-background-color,\n transparent\n );--kup_imagelist_columns:var(--kup-imagelist-columns, 4);--kup_imagelist_grid_gap:var(--kup-imagelist-grid-gap, var(--kup-space-03));--kup_imagelist_image_min_height:var(\n --kup-imagelist-image-min-height,\n var(--kup-space-09)\n );--kup_imagelist_item_border_radius:var(\n --kup-imagelist-item-border-radius,\n var(--kup-radius-00)\n );--kup_imagelist_item_height:var(--kup-imagelist-item-height, auto);--kup_imagelist_item_padding:var(--kup-imagelist-item-padding, 0);--kup_imagelist_item_width:var(--kup-imagelist-item-width, auto);--kup_imagelist_label_margin:var(\n --kup-imagelist-label-margin,\n 0 auto 1em auto\n );--kup_imagelist_navbar_background_color:var(\n --kup-imagelist-navbar-background-color,\n transparent\n );--kup_imagelist_primary_color:var(\n --kup-imagelist-primary-color,\n var(--kup-primary-color)\n );--kup_imagelist_primary_color_rgb:var(\n --kup-imagelist-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_imagelist_text_color:var(\n --kup-imagelist-text-color,\n var(--kup-text-secondary)\n );--kup_imagelist_item_background_color:var(\n --kup-imagelist-item-background-color,\n var(--kup-layer-1)\n );--kup_imagelist_item_background_color_hover:var(\n --kup-imagelist-item-background-color-hover,\n var(--kup-layer-1-hover)\n );display:block}.navigation-bar{align-items:center;background-color:var(--kup_imagelist_navbar_background_color);display:flex;justify-content:center}.navigation-bar__wrapper{align-items:center;display:flex;flex-wrap:wrap;justify-content:center;max-width:100%;position:relative}.navigation-bar__wrapper--active .navigation-bar__title{background-color:rgba(var(--kup_imagelist_primary_color_rgb), 0.15);color:var(--kup_imagelist_primary_color)}.navigation-bar__back,.navigation-bar__top{--kup-button-primary-color-rgb:0}.navigation-bar__title{border-radius:16px;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;padding:0.75em 1em;user-select:none;transition:background-color 125ms, color 125ms;width:100%}.navigation-bar__title__image.f-image{margin:0}.navigation-bar__title__label{overflow:hidden;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap;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}.image-list{background-color:var(--kup_imagelist_background_color);display:grid;grid-gap:var(--kup_imagelist_grid_gap);grid-template-columns:repeat(var(--kup-imagelist-columns-mobile, var(--kup_imagelist_columns_mobile)), minmax(0px, 1fr));margin-top:1em;width:100%;grid-auto-flow:row}.image-list.full-description .f-cell .f-cell__content .image-list__wrapper .f-image.image-list__image{display:flow-root}.image-list.full-description .image-list__label{overflow:unset;text-align:center;text-overflow:unset;white-space:normal;overflow-wrap:break-word}.image-list .f-cell{height:100%;width:100%}.image-list .f-cell .f-cell__content{height:100%}.image-list .f-cell .f-cell__content .image-list__wrapper{display:flex;flex-direction:column;justify-content:space-between;box-sizing:border-box;position:relative;height:100%}.image-list .f-cell .f-cell__content .image-list__wrapper.images{height:100%;justify-content:flex-end}.image-list .f-cell .f-cell__content .image-list__wrapper.images .f-image{position:unset;overflow:auto;height:100%;display:flex}.image-list__item{background-color:var(--kup_imagelist_item_background_color);border-radius:var(--kup_imagelist_item_border_radius);cursor:pointer;height:var(--kup_imagelist_item_height);padding:var(--kup_imagelist_item_padding);width:var(--kup_imagelist_item_width)}.image-list__item:hover{background-color:var(--kup_imagelist_item_background_color_hover)}.image-list__image.f-image{position:absolute;padding:var(--kup-space-03);padding-bottom:0px;box-sizing:border-box;width:100%;height:calc(100% - 16px - var(--kup-space-03) * 2);overflow:hidden}.image-list__image.f-image .f-image__icon{mask-size:100% !important}.image-list__label{overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap;padding:var(--kup-space-03);font-family:var(--kup-font-family);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}@media screen and (min-width: 678px){.image-list{grid-template-columns:repeat(var(--kup-imagelist-columns-tablet, var(--kup_imagelist_columns_tablet)), minmax(0px, 1fr));grid-gap:var(--kup-space-05)}}@media screen and (min-width: 1024px){.image-list{grid-template-columns:repeat(var(--kup-imagelist-columns-desktop, var(--kup_imagelist_columns_desktop)), minmax(0px, 1fr));grid-gap:var(--kup-space-05)}}:host(.kup-full-height){height:100%}:host(.kup-full-width){width:100%}:host(.kup-horizontal) .image-list{display:flex}:host(.kup-auto-grid) .image-list{display:flex;flex-wrap:wrap;justify-content:center}";export{S as kup_image_list}
|
|
1
|
+
import{r as i,c as t,f as e,h as a,H as s,d as o}from"./p-b0368f88.js";import{k as n,g as l,s as r,h as p,O as m,f as h}from"./p-4508907e.js";import{c}from"./p-635bb4b3.js";import{F as g}from"./p-f2213e00.js";import{F as f}from"./p-504fe614.js";import{a as u}from"./p-e3062c19.js";import{F as d}from"./p-0603a2d2.js";import{M as _}from"./p-c56195a0.js";import"./p-1ee561ba.js";import"./p-982a5cfc.js";import"./p-95dddc38.js";import"./p-1a8b9bc6.js";import"./p-6b5ee00f.js";var k;!function(i){i.columns="Can set a specific number of columns",i.customStyle="Custom style of the component.",i.data="Actual data of the component",i.ripple="When enabled displays Material's ripple effect on clicked items.",i.rows="Cam set a specific number of rows. It overwrite the columns flow into rows flow",i.showFullDescription="When enabled, image descriptions will always be displayed entirely and not cut or truncated."}(k||(k={}));class v{constructor(){this.load=!1}toDebugString(){return"image-list state"}}var b,w,y,x,j,z,C,W,M,$,E,O,T,P,D,I=function(i,t,e,a){if("a"===e&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?i!==t||!a:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?a:"a"===e?a.call(i):a?a.value:t.get(i)},R=function(i,t,e,a,s){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?i!==t||!s:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?s.call(i,e):s?s.value=e:t.set(i,e),e};const S=class{constructor(e){i(this,e),this.kupClick=t(this,"kup-imagelist-click",6),this.kupContextMenu=t(this,"kup-imagelist-contextmenu",6),this.kupDblClick=t(this,"kup-imagelist-dblclick",6),b.add(this),this.state=new v,w.set(this,[]),y.set(this,n()),x.set(this,{icon:"arrow_back",onClick:()=>{this.currentNode=I(this,y,"f").data.node.getParent(this.data,this.currentNode),this.currentNode||(this.navigationBarToggled=!1)},styling:u.FLAT,wrapperClass:"navigation-bar__back"}),j.set(this,{icon:"arrow_upward",onClick:()=>{this.currentNode=null,this.navigationBarToggled=!1},styling:u.FLAT,wrapperClass:"navigation-bar__top"}),z.set(this,void 0),C.set(this,!1),W.set(this,[]),this.currentNode=null,this.navigationBarToggled=!1,this.columns=[],this.customStyle="",this.data=[],this.ripple=!1,this.rows=null,this.selectedNode=[],this.stateId="",this.store=void 0,this.showFullDescription=!1}initWithPersistedState(){if(this.store&&this.stateId){const i=this.store.getState(this.stateId);null!=i&&(this.currentNode=I(this,y,"f").data.node.findByStrTreeNodePath(this.data,i.selectedTreeNodePath))}}persistState(){if(this.store&&this.stateId){let i=!1,t=this.currentNode?this.currentNode.id:"";if(I(this,y,"f").objects.deepEqual(this.state.selectedTreeNodePath,t)||(this.state.selectedTreeNodePath=t,i=!0),!this.state.load)return void(this.state.load=!0);i&&this.store.persistState(this.stateId,this.state)}}selectNode(i){i&&0!=i.length&&(this.currentNode=I(this,y,"f").data.node.find(this.data,i))}async getProps(i){return l(this,k,i)}async refresh(){e(this)}async setProps(i){r(this,k,i)}componentWillLoad(){I(this,y,"f").debug.logLoad(this,!1),I(this,y,"f").language.register(this),I(this,y,"f").theme.register(this)}componentDidLoad(){I(this,b,"m",D).call(this),I(this,y,"f").debug.logLoad(this,!0)}componentWillRender(){I(this,y,"f").debug.logRender(this,!1)}componentDidRender(){const i=this.rootElement.shadowRoot;if(i&&this.ripple){const t=i.querySelectorAll(".mdc-ripple-surface:not(.mdc-ripple-upgraded)");if(t)for(let i=0;i<t.length;i++)_.attachTo(t[i])}this.persistState(),I(this,y,"f").debug.logRender(this,!0)}render(){const i=!!this.currentNode;let t={};this.columns&&(1===this.columns.length?t={"--kup-imagelist-columns-mobile":`${this.columns[0]}`,"--kup-imagelist-columns-tablet":`${this.columns[0]}`,"--kup-imagelist-columns-desktop":`${this.columns[0]}`}:2===this.columns.length?t={"--kup-imagelist-columns-mobile":`${this.columns[0]}`,"--kup-imagelist-columns-tablet":`${this.columns[0]}`,"--kup-imagelist-columns-desktop":`${this.columns[1]}`}:3===this.columns.length&&(t={"--kup-imagelist-columns-mobile":`${this.columns[0]}`,"--kup-imagelist-columns-tablet":`${this.columns[1]}`,"--kup-imagelist-columns-desktop":`${this.columns[2]}`}));let e=Object.assign({},t);if(null!=this.rows&&this.rows>0){const i={"grid-template-rows":`repeat(${this.rows}, minmax(0px, 1fr))`,"grid-auto-flow":"column"};e=Object.assign(Object.assign({},e),i)}const o="image-list"+(this.showFullDescription?" full-description":"");return a(s,{key:"fc9dede25393c4124c50cf79ec668e76f4ef36ee"},a("style",{key:"784928f6c2c07e3e4d5bd570dadf6e9552a9320a"},I(this,y,"f").theme.setKupStyle(this.rootElement)),a("div",{key:"490448ffb258388f237239b2e4648d11d165f0a1",id:c,ref:i=>{R(this,z,i,"f")}},a("div",{key:"6d1d5ee2288c5a7c401bb78e304ba4501284ae20",class:"navigation-bar"},i?a("div",{class:"navigation-bar__wrapper "+(this.navigationBarToggled?"navigation-bar__wrapper--active":"")},a("div",{class:"navigation-bar__title",onClick:()=>{this.navigationBarToggled=!this.navigationBarToggled}},a(g,{fit:!0,resource:this.currentNode.icon,placeholderResource:this.currentNode.placeholderIcon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"navigation-bar__title__image"}),a("div",{class:"navigation-bar__title__label"},this.currentNode.value)),a(f,Object.assign({},I(this,x,"f"),{label:I(this,y,"f").language.translate(p.BACK)})),a(f,Object.assign({},I(this,j,"f"),{label:I(this,y,"f").language.translate(p.TOP)}))):null),a("div",{key:"6b085d0b583433b38a29c9142dd811681585949b",class:o,style:e},...I(this,b,"m",$).call(this))))}disconnectedCallback(){I(this,y,"f").interact.unregister(I(this,W,"f")),I(this,y,"f").language.unregister(this),I(this,y,"f").theme.unregister(this)}get rootElement(){return o(this)}static get watchers(){return{selectedNode:["selectNode"]}}};w=new WeakMap,y=new WeakMap,x=new WeakMap,j=new WeakMap,z=new WeakMap,C=new WeakMap,W=new WeakMap,b=new WeakSet,M=function(i){const t={fit:!0,resource:i.icon,placeholderResource:i.placeholderIcon,title:i.title,wrapperClass:"image-list__image",badgeData:i.badgeData},e=a(g,Object.assign({},t)),s=a("div",{class:"image-list__label"},i.value),o=t.resource.indexOf(".")>-1||t.resource.indexOf("/")>-1||t.resource.indexOf("\\")>-1;return a(d,{cell:{value:i.value,icon:i.icon,placeholderIcon:i.placeholderIcon,obj:i.obj},column:{name:"IMAGE",title:"Image"},component:this,density:h.NONE,row:Object.assign({},i)},a("div",{class:"image-list__wrapper"+(o?" images":"")},!o&&a("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 24 24"}),e,s))},$=function(){const i=[],t=this.currentNode?this.currentNode.children:this.data;for(let e=0;t&&e<t.length;e++){const s=t[e],o=a("div",{onContextMenu:i=>{i.preventDefault()},class:{"image-list__item":!0,"mdc-ripple-surface":!!this.ripple}},I(this,b,"m",M).call(this,s));i.push(o)}return i},E=function(i,t){let e;if(i)for(let t=i.length-1;t>=0;t--){let a=i[t];a.tagName&&a.classList.contains("f-cell")&&(e=a["kup-get-cell-props"]())}return{cell:null==e?void 0:e.cell,column:null==e?void 0:e.column,originalEvent:t,row:null==e?void 0:e.row}},O=function(i){return I(this,b,"m",E).call(this,I(this,y,"f").getEventPath(i.target,this.rootElement),i)},T=function(i){return I(this,b,"m",E).call(this,I(this,y,"f").getEventPath(i.target,this.rootElement),i)},P=function(i){return I(this,b,"m",E).call(this,I(this,y,"f").getEventPath(i.target,this.rootElement),i)},D=function(){I(this,W,"f").push(I(this,z,"f")),I(this,y,"f").interact.on(I(this,z,"f"),m.HOLD,(i=>{"pen"!==i.pointerType&&"touch"!==i.pointerType||(R(this,C,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:I(this,b,"m",T).call(this,i)}))})),I(this,y,"f").interact.on(I(this,z,"f"),m.TAP,(i=>{if(I(this,C,"f"))R(this,C,!1,"f");else switch(i.button){case 0:const t={};for(const e in i)t[e]=i[e];I(this,w,"f").push(setTimeout((()=>{var i;const e=I(this,b,"m",O).call(this,t),a=e.row;(null===(i=null==a?void 0:a.children)||void 0===i?void 0:i.length)>0&&(this.currentNode=a),this.kupClick.emit({comp:this,id:this.rootElement.id,details:e})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:I(this,b,"m",T).call(this,i)})}})),I(this,y,"f").interact.on(I(this,z,"f"),m.DOUBLETAP,(i=>{if(0===i.button){for(let i=0;i<I(this,w,"f").length;i++)clearTimeout(I(this,w,"f")[i]),I(this,y,"f").debug.logMessage(this,"Cleared clickHandler timeout("+I(this,w,"f")[i]+").");R(this,w,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:I(this,b,"m",P).call(this,i)})}}))},S.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_imagelist_columns_mobile:var(--kup-imagelist-columns-mobile, 4);--kup_imagelist_columns_tablet:var(--kup-imagelist-columns-tablet, 6);--kup_imagelist_columns_desktop:var(--kup-imagelist-columns-desktop, 8);--kup_imagelist_background_color:var(\n --kup-imagelist-background-color,\n transparent\n );--kup_imagelist_columns:var(--kup-imagelist-columns, 4);--kup_imagelist_grid_gap:var(--kup-imagelist-grid-gap, var(--kup-space-03));--kup_imagelist_image_min_height:var(\n --kup-imagelist-image-min-height,\n var(--kup-space-09)\n );--kup_imagelist_item_border_radius:var(\n --kup-imagelist-item-border-radius,\n var(--kup-radius-00)\n );--kup_imagelist_item_height:var(--kup-imagelist-item-height, auto);--kup_imagelist_item_padding:var(--kup-imagelist-item-padding, 0);--kup_imagelist_item_width:var(--kup-imagelist-item-width, auto);--kup_imagelist_label_margin:var(\n --kup-imagelist-label-margin,\n 0 auto 1em auto\n );--kup_imagelist_navbar_background_color:var(\n --kup-imagelist-navbar-background-color,\n transparent\n );--kup_imagelist_primary_color:var(\n --kup-imagelist-primary-color,\n var(--kup-primary-color)\n );--kup_imagelist_primary_color_rgb:var(\n --kup-imagelist-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_imagelist_text_color:var(\n --kup-imagelist-text-color,\n var(--kup-text-secondary)\n );--kup_imagelist_item_background_color:var(\n --kup-imagelist-item-background-color,\n var(--kup-layer-1)\n );--kup_imagelist_item_background_color_hover:var(\n --kup-imagelist-item-background-color-hover,\n var(--kup-layer-1-hover)\n );display:block}.navigation-bar{align-items:center;background-color:var(--kup_imagelist_navbar_background_color);display:flex;justify-content:center}.navigation-bar__wrapper{align-items:center;display:flex;flex-wrap:wrap;justify-content:center;max-width:100%;position:relative}.navigation-bar__wrapper--active .navigation-bar__title{background-color:rgba(var(--kup_imagelist_primary_color_rgb), 0.15);color:var(--kup_imagelist_primary_color)}.navigation-bar__back,.navigation-bar__top{--kup-button-primary-color-rgb:0}.navigation-bar__title{border-radius:16px;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;padding:0.75em 1em;user-select:none;transition:background-color 125ms, color 125ms;width:100%}.navigation-bar__title__image.f-image{margin:0}.navigation-bar__title__label{overflow:hidden;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap;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}.image-list{background-color:var(--kup_imagelist_background_color);display:grid;grid-gap:var(--kup_imagelist_grid_gap);grid-template-columns:repeat(var(--kup-imagelist-columns-mobile, var(--kup_imagelist_columns_mobile)), minmax(0px, 1fr));margin-top:1em;width:100%;grid-auto-flow:row}.image-list.full-description .f-cell .f-cell__content .image-list__wrapper .f-image.image-list__image{display:flow-root}.image-list.full-description .image-list__label{overflow:unset;text-align:center;text-overflow:unset;white-space:normal;overflow-wrap:break-word}.image-list .f-cell{height:100%;width:100%}.image-list .f-cell .f-cell__content{height:100%}.image-list .f-cell .f-cell__content .image-list__wrapper{display:flex;flex-direction:column;justify-content:space-between;box-sizing:border-box;position:relative;height:100%}.image-list .f-cell .f-cell__content .image-list__wrapper.images{height:100%;justify-content:flex-end}.image-list .f-cell .f-cell__content .image-list__wrapper.images .f-image{position:unset;overflow:auto;height:100%;display:flex}.image-list__item{background-color:var(--kup_imagelist_item_background_color);border-radius:var(--kup_imagelist_item_border_radius);cursor:pointer;height:var(--kup_imagelist_item_height);padding:var(--kup_imagelist_item_padding);width:var(--kup_imagelist_item_width)}.image-list__item:hover{background-color:var(--kup_imagelist_item_background_color_hover)}.image-list__image.f-image{position:absolute;padding:var(--kup-space-03);padding-bottom:0px;box-sizing:border-box;width:100%;height:calc(100% - 16px - var(--kup-space-03) * 2);overflow:hidden}.image-list__image.f-image .f-image__icon{mask-size:100% !important}.image-list__label{overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap;padding:var(--kup-space-03);font-family:var(--kup-font-family);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}@media screen and (min-width: 678px){.image-list{grid-template-columns:repeat(var(--kup-imagelist-columns-tablet, var(--kup_imagelist_columns_tablet)), minmax(0px, 1fr));grid-gap:var(--kup-space-05)}}@media screen and (min-width: 1024px){.image-list{grid-template-columns:repeat(var(--kup-imagelist-columns-desktop, var(--kup_imagelist_columns_desktop)), minmax(0px, 1fr));grid-gap:var(--kup-space-05)}}:host(.kup-full-height){height:100%}:host(.kup-full-width){width:100%}:host(.kup-horizontal) .image-list{display:flex}:host(.kup-auto-grid) .image-list{display:flex;flex-wrap:wrap;justify-content:center}";export{S as kup_image_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,f as e,h as s,H as h,d as n}from"./p-b0368f88.js";import{k as o,g as l,c as p,t as a}from"./p-a358e1a2.js";import{c as r}from"./p-635bb4b3.js";import{F as u}from"./p-24fae583.js";import{F as c}from"./p-7db300e0.js";import"./p-1ee561ba.js";import"./p-f2213e00.js";import"./p-c56195a0.js";var f;!function(t){t.customStyle="Custom style of the component.",t.data="Props of the sub-components.",t.decimals="Defaults at false. When set to true, the component has decimals.",t.disabled="Defaults at false. When set to true, the component is disabled.",t.initialValue="Sets the initial value of the component",t.maxDecimals="when set, the component allows you to enter decimals with a maximum of characters.",t.maxIntegers="When set, the component allows you to enter integer numbers with a maximum of characters.",t.maxLength="When set, the component allows you to enter numbers with a maximum of characters, including decimals.",t.negative="Defaults at false. When set to true, the component has negative number."}(f||(f={}));const m=class{constructor(e){t(this,e),this.kupBlur=i(this,"kup-numericpicker-blur",6),this.kupChange=i(this,"kup-numericpicker-change",6),this.kupClick=i(this,"kup-numericpicker-click",6),this.kupFocus=i(this,"kup-numericpicker-focus",6),this.kupInput=i(this,"kup-numericpicker-input",6),this.kupIconClick=i(this,"kup-numericpicker-iconclick",6),this.kupItemClick=i(this,"kup-numericpicker-itemclick",6),this.kupTextFieldSubmit=i(this,"kup-numericpicker-textfieldsubmit",6),this.kupClearIconClick=i(this,"kup-numericpicker-cleariconclick",6),this.kupManager=o(),this.textfieldEl=null,this.pickerContainerEl=null,this.pickerEl={value:(new Date).toISOString(),date:new Date},this.clickCb=null,this.stateSwitcher=!1,this.value="",this.customStyle="",this.data=null,this.decimals=!1,this.disabled=!1,this.initialValue="",this.maxDecimals=null,this.maxIntegers=null,this.maxLength=null,this.negative=!1}onKupPickerItemClick(t){this.setPickerValueSelected(t),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupItemClick.emit({comp:this,id:this.rootElement.id,value:this.value}),this.setFocus()}onKupClearIconClick(){this.setPickerValueSelected(""),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupClearIconClick.emit({comp:this,id:this.rootElement.id})}onKupBlur(){this.kupBlur.emit({id:this.rootElement.id,value:this.value,comp:this})}onKupChange(t){this.refreshPickerValue(t.target.value,this.kupChange)}onKupClick(){this.kupClick.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupFocus(){this.kupFocus.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupInput(t){this.refreshPickerValue(t.target.value,this.kupInput,!0)}onkupTextFieldSubmit(t){"Enter"===t.key&&this.refreshPickerValue(t.target.value,this.kupTextFieldSubmit)}onKupIconClick(){this.isPickerOpened()?this.closePicker():this.openPicker(),this.kupIconClick.emit({comp:this,id:this.rootElement.id,value:this.value})}listenKeyup(t){this.isPickerOpened()&&("Escape"===t.key&&this.closePicker(),"Enter"===t.key&&this.setPickerValueSelected())}async getValue(){return this.value}async getProps(t){return l(this,f,t)}async refresh(){e(this)}async setFocus(){null!=this.textfieldEl&&this.textfieldEl.focus()}async setValue(t){this.value=t}refreshPickerValue(t,i,e){let s=this.kupManager.math.numberify(t,!0);if(s){let t=s.toString();const h=t.indexOf(".");let n=h>-1?t.substring(0,h):t,o=h>-1?t.substring(h+1):"";for(this.maxIntegers&&n.length>this.maxIntegers&&(n=n.substring(n.length-this.maxIntegers)),this.maxDecimals&&o.length>this.maxDecimals&&(o=o.substring(0,this.maxDecimals));this.maxLength&&n.length+o.length>this.maxLength;)o.length>1?o=o.substring(0,o.length-1):n.length>1&&(n=n.substring(1));t=h>-1?`${n}.${o}`:n,1!=e&&this.setValue(t),null!=i&&i.emit({id:this.rootElement.id,value:t})}}setPickerValueSelected(t){1!=this.disabled&&(null==t&&(t=this.getPickerValueSelected()),this.closePicker(),null!=t&&this.setValue(t))}getPickerValueSelected(){return this.pickerEl.value}getValueForPickerComponent(){return this.value}openPicker(){const t=this.textfieldEl;this.pickerContainerEl.menuVisible=!0;const i=this.pickerContainerEl.style;i.height="auto",i.minWidth=this.textfieldEl.parentElement.clientWidth+"px",null!=t&&t.classList.add("toggled"),this.kupManager.dynamicPosition.isRegistered(this.pickerContainerEl)?this.kupManager.dynamicPosition.changeAnchor(this.pickerContainerEl,this.textfieldEl.parentElement):this.kupManager.dynamicPosition.register(this.pickerContainerEl,this.textfieldEl.parentElement,0,p.AUTO,!0),this.kupManager.dynamicPosition.start(this.pickerContainerEl),this.clickCb||(this.clickCb={cb:()=>{this.closePicker()},el:this.pickerContainerEl}),this.kupManager.addClickCallback(this.clickCb,!0)}closePicker(){if(this.kupManager.removeClickCallback(this.clickCb),!this.isPickerOpened())return;let t=this.textfieldEl;null!=t&&t.classList.remove("toggled"),this.pickerContainerEl.menuVisible=!1,this.kupManager.dynamicPosition.stop(this.pickerContainerEl)}isPickerOpened(){return 1==this.pickerContainerEl.menuVisible}getTextFieldId(){return this.textfieldEl.id}prepTextfield(){this.decimals||this.maxIntegers||(this.maxIntegers=17),!this.decimals||this.maxIntegers||this.maxDecimals||(this.maxIntegers=15,this.maxDecimals=2);const t=this.rootElement.classList.contains("kup-full-height"),i=this.rootElement.classList.contains("kup-full-width"),e=Object.assign({},this.data["kup-text-field"]);return e.icon||(e.icon="calculator"),e.icon&&(e.trailingIcon=!0),s(u,Object.assign({},e,{disabled:this.disabled,fullHeight:t,fullWidth:i,id:this.rootElement.id+"_text-field",value:this.kupManager.math.numbers.toLocaleString(this.value),onBlur:()=>this.onKupBlur(),onChange:t=>this.onKupChange(t),onClearIconClick:()=>this.onKupClearIconClick(),onClick:()=>this.onKupClick(),onFocus:()=>this.onKupFocus(),onIconClick:()=>this.onKupIconClick(),onKeyDown:t=>this.onkupTextFieldSubmit(t),onInput:t=>this.onKupInput(t)}),this.prepPicker())}prepPicker(){return s("kup-card",{ref:t=>this.pickerContainerEl=t,data:{options:{decimals:this.decimals,initialValue:this.value,maxDecimals:this.maxDecimals,maxIntegers:this.maxIntegers,maxLength:this.maxLength,negative:this.negative,resetStatus:!0}},layoutFamily:a.BUILT_IN,layoutNumber:5,sizeX:"300px",sizeY:"auto",isMenu:!0,"onkup-card-click":t=>{null!=t.detail.value&&this.onKupPickerItemClick(t.detail.value)}})}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this),this.value=this.initialValue,this.data||(this.data={"kup-text-field":{}})}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const i=t.querySelector(".f-text-field");i&&(this.textfieldEl=i.querySelector("input"),c(i))}this.kupManager.debug.logRender(this,!0)}render(){return s(h,{key:"0aad1000f311db36077d1bf807535e1244079b13"},s("style",{key:"f4f0ed18d4502d3e1df8a4fce1146a6432887cb1"},this.kupManager.theme.setKupStyle(this.rootElement)),s("div",{key:"cb9d73dfc0317ba669c981720f48bacb474072d0",id:r},this.prepTextfield()))}disconnectedCallback(){this.kupManager.dates.unregister(this),this.kupManager.theme.unregister(this),this.pickerContainerEl&&this.pickerContainerEl.remove()}get rootElement(){return n(this)}};m.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{display:block;font-size:var(--kup-font-size)}.f-text-field{position:relative}:host(.kup-full-height){height:100%}:host(.kup-full-height) #kup-component{height:100%}:host(.kup-full-width){width:100%}:host(.kup-full-width) #kup-component{width:100%}:host(.kup-danger){--kup-textfield-primary-color:var(--kup-danger-color-60);--kup-textfield-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-textfield-primary-color:var(--kup-info-color);--kup-textfield-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-textfield-primary-color:var(--kup-secondary-color);--kup-textfield-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-textfield-primary-color:var(--kup-success-color);--kup-textfield-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-textfield-primary-color:var(--kup-warning-color-50);--kup-textfield-primary-color-rgb:var(--kup-warning-color-rgb)}";export{m as kup_numeric_picker}
|
|
1
|
+
import{r as t,c as i,f as e,h as s,H as h,d as n}from"./p-b0368f88.js";import{k as o,g as l,c as p,t as a}from"./p-4508907e.js";import{c as r}from"./p-635bb4b3.js";import{F as u}from"./p-6b5ee00f.js";import{F as c}from"./p-7db300e0.js";import"./p-1ee561ba.js";import"./p-f2213e00.js";import"./p-c56195a0.js";var f;!function(t){t.customStyle="Custom style of the component.",t.data="Props of the sub-components.",t.decimals="Defaults at false. When set to true, the component has decimals.",t.disabled="Defaults at false. When set to true, the component is disabled.",t.initialValue="Sets the initial value of the component",t.maxDecimals="when set, the component allows you to enter decimals with a maximum of characters.",t.maxIntegers="When set, the component allows you to enter integer numbers with a maximum of characters.",t.maxLength="When set, the component allows you to enter numbers with a maximum of characters, including decimals.",t.negative="Defaults at false. When set to true, the component has negative number."}(f||(f={}));const m=class{constructor(e){t(this,e),this.kupBlur=i(this,"kup-numericpicker-blur",6),this.kupChange=i(this,"kup-numericpicker-change",6),this.kupClick=i(this,"kup-numericpicker-click",6),this.kupFocus=i(this,"kup-numericpicker-focus",6),this.kupInput=i(this,"kup-numericpicker-input",6),this.kupIconClick=i(this,"kup-numericpicker-iconclick",6),this.kupItemClick=i(this,"kup-numericpicker-itemclick",6),this.kupTextFieldSubmit=i(this,"kup-numericpicker-textfieldsubmit",6),this.kupClearIconClick=i(this,"kup-numericpicker-cleariconclick",6),this.kupManager=o(),this.textfieldEl=null,this.pickerContainerEl=null,this.pickerEl={value:(new Date).toISOString(),date:new Date},this.clickCb=null,this.stateSwitcher=!1,this.value="",this.customStyle="",this.data=null,this.decimals=!1,this.disabled=!1,this.initialValue="",this.maxDecimals=null,this.maxIntegers=null,this.maxLength=null,this.negative=!1}onKupPickerItemClick(t){this.setPickerValueSelected(t),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupItemClick.emit({comp:this,id:this.rootElement.id,value:this.value}),this.setFocus()}onKupClearIconClick(){this.setPickerValueSelected(""),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupClearIconClick.emit({comp:this,id:this.rootElement.id})}onKupBlur(){this.kupBlur.emit({id:this.rootElement.id,value:this.value,comp:this})}onKupChange(t){this.refreshPickerValue(t.target.value,this.kupChange)}onKupClick(){this.kupClick.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupFocus(){this.kupFocus.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupInput(t){this.refreshPickerValue(t.target.value,this.kupInput,!0)}onkupTextFieldSubmit(t){"Enter"===t.key&&this.refreshPickerValue(t.target.value,this.kupTextFieldSubmit)}onKupIconClick(){this.isPickerOpened()?this.closePicker():this.openPicker(),this.kupIconClick.emit({comp:this,id:this.rootElement.id,value:this.value})}listenKeyup(t){this.isPickerOpened()&&("Escape"===t.key&&this.closePicker(),"Enter"===t.key&&this.setPickerValueSelected())}async getValue(){return this.value}async getProps(t){return l(this,f,t)}async refresh(){e(this)}async setFocus(){null!=this.textfieldEl&&this.textfieldEl.focus()}async setValue(t){this.value=t}refreshPickerValue(t,i,e){let s=this.kupManager.math.numberify(t,!0);if(s){let t=s.toString();const h=t.indexOf(".");let n=h>-1?t.substring(0,h):t,o=h>-1?t.substring(h+1):"";for(this.maxIntegers&&n.length>this.maxIntegers&&(n=n.substring(n.length-this.maxIntegers)),this.maxDecimals&&o.length>this.maxDecimals&&(o=o.substring(0,this.maxDecimals));this.maxLength&&n.length+o.length>this.maxLength;)o.length>1?o=o.substring(0,o.length-1):n.length>1&&(n=n.substring(1));t=h>-1?`${n}.${o}`:n,1!=e&&this.setValue(t),null!=i&&i.emit({id:this.rootElement.id,value:t})}}setPickerValueSelected(t){1!=this.disabled&&(null==t&&(t=this.getPickerValueSelected()),this.closePicker(),null!=t&&this.setValue(t))}getPickerValueSelected(){return this.pickerEl.value}getValueForPickerComponent(){return this.value}openPicker(){const t=this.textfieldEl;this.pickerContainerEl.menuVisible=!0;const i=this.pickerContainerEl.style;i.height="auto",i.minWidth=this.textfieldEl.parentElement.clientWidth+"px",null!=t&&t.classList.add("toggled"),this.kupManager.dynamicPosition.isRegistered(this.pickerContainerEl)?this.kupManager.dynamicPosition.changeAnchor(this.pickerContainerEl,this.textfieldEl.parentElement):this.kupManager.dynamicPosition.register(this.pickerContainerEl,this.textfieldEl.parentElement,0,p.AUTO,!0),this.kupManager.dynamicPosition.start(this.pickerContainerEl),this.clickCb||(this.clickCb={cb:()=>{this.closePicker()},el:this.pickerContainerEl}),this.kupManager.addClickCallback(this.clickCb,!0)}closePicker(){if(this.kupManager.removeClickCallback(this.clickCb),!this.isPickerOpened())return;let t=this.textfieldEl;null!=t&&t.classList.remove("toggled"),this.pickerContainerEl.menuVisible=!1,this.kupManager.dynamicPosition.stop(this.pickerContainerEl)}isPickerOpened(){return 1==this.pickerContainerEl.menuVisible}getTextFieldId(){return this.textfieldEl.id}prepTextfield(){this.decimals||this.maxIntegers||(this.maxIntegers=17),!this.decimals||this.maxIntegers||this.maxDecimals||(this.maxIntegers=15,this.maxDecimals=2);const t=this.rootElement.classList.contains("kup-full-height"),i=this.rootElement.classList.contains("kup-full-width"),e=Object.assign({},this.data["kup-text-field"]);return e.icon||(e.icon="calculator"),e.icon&&(e.trailingIcon=!0),s(u,Object.assign({},e,{disabled:this.disabled,fullHeight:t,fullWidth:i,id:this.rootElement.id+"_text-field",value:this.kupManager.math.numbers.toLocaleString(this.value),onBlur:()=>this.onKupBlur(),onChange:t=>this.onKupChange(t),onClearIconClick:()=>this.onKupClearIconClick(),onClick:()=>this.onKupClick(),onFocus:()=>this.onKupFocus(),onIconClick:()=>this.onKupIconClick(),onKeyDown:t=>this.onkupTextFieldSubmit(t),onInput:t=>this.onKupInput(t)}),this.prepPicker())}prepPicker(){return s("kup-card",{ref:t=>this.pickerContainerEl=t,data:{options:{decimals:this.decimals,initialValue:this.value,maxDecimals:this.maxDecimals,maxIntegers:this.maxIntegers,maxLength:this.maxLength,negative:this.negative,resetStatus:!0}},layoutFamily:a.BUILT_IN,layoutNumber:5,sizeX:"300px",sizeY:"auto",isMenu:!0,"onkup-card-click":t=>{null!=t.detail.value&&this.onKupPickerItemClick(t.detail.value)}})}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this),this.value=this.initialValue,this.data||(this.data={"kup-text-field":{}})}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const i=t.querySelector(".f-text-field");i&&(this.textfieldEl=i.querySelector("input"),c(i))}this.kupManager.debug.logRender(this,!0)}render(){return s(h,{key:"0aad1000f311db36077d1bf807535e1244079b13"},s("style",{key:"f4f0ed18d4502d3e1df8a4fce1146a6432887cb1"},this.kupManager.theme.setKupStyle(this.rootElement)),s("div",{key:"cb9d73dfc0317ba669c981720f48bacb474072d0",id:r},this.prepTextfield()))}disconnectedCallback(){this.kupManager.dates.unregister(this),this.kupManager.theme.unregister(this),this.pickerContainerEl&&this.pickerContainerEl.remove()}get rootElement(){return n(this)}};m.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{display:block;font-size:var(--kup-font-size)}.f-text-field{position:relative}:host(.kup-full-height){height:100%}:host(.kup-full-height) #kup-component{height:100%}:host(.kup-full-width){width:100%}:host(.kup-full-width) #kup-component{width:100%}:host(.kup-danger){--kup-textfield-primary-color:var(--kup-danger-color-60);--kup-textfield-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-textfield-primary-color:var(--kup-info-color);--kup-textfield-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-textfield-primary-color:var(--kup-secondary-color);--kup-textfield-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-textfield-primary-color:var(--kup-success-color);--kup-textfield-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-textfield-primary-color:var(--kup-warning-color-50);--kup-textfield-primary-color-rgb:var(--kup-warning-color-rgb)}";export{m as kup_numeric_picker}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,h as t,d as e}from"./p-b0368f88.js";import{k as o}from"./p-
|
|
1
|
+
import{r as i,h as t,d as e}from"./p-b0368f88.js";import{k as o}from"./p-4508907e.js";import"./p-1ee561ba.js";const p=class{constructor(t){i(this,t),this.kupManager=o(),this.config=void 0,this.qlik=void 0,this.appid="",this.app=!1,this.grid=[],this.debug=!1,this.fluid=!1,this.bordered=!1,this.defobjsize="400px",this.divlist=[]}getObjects(i){let t;return new Promise((e=>{i.rows.forEach((i=>{i.columns.forEach((i=>{t=!1,i.noSelections&&(t=i.noSelections),this.app.getObject(i.obj,i.obj,{noInteraction:!1,noSelections:t})}))})),e(!0)}))}doSelection(i){return new Promise((t=>{i.selections&&i.selections.forEach((i=>{this.app.field(i.field).selectValues(i.values,!1,!0)})),t(!0)}))}setRender(i){return new Promise((e=>{this.divlist=[],i.rows.forEach((i=>{let e=[];i.columns.forEach((i=>{let o="qvobject ";this.bordered&&(o+="bordered "),o=o+"width-"+i.colDim+" size-"+i.size,e.push(t("div",""!=i.obj?{id:i.obj,class:o}:{class:o}))})),this.divlist.push(t("div",{class:"kup-qlik-row"},e))})),e(!0)}))}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1),this.setRender(this.grid)}render(){let i=null,e=null;return i=this.fluid?{"kup-qlik-container-fluid":!0}:{"kup-qlik-container":!0},e={"--lyo_obj-height":this.defobjsize},t("div",{key:"953275d575be5cce36f0331d7b0c40de0e1b678d",class:i,style:e},this.divlist)}componentDidRender(){this.debug&&console.log("Grid",this.grid),this.qlik&&(""==this.appid||this.app?this.debug&&console.log("App already open:",this.app):this.app=this.qlik.openApp(this.appid,this.config),this.app&&this.getObjects(this.grid).then((()=>{this.doSelection(this.grid)}))),this.kupManager.debug.logRender(this,!0)}get rootElement(){return e(this)}};p.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}.kup-qlik-container-fluid{width:100%}.kup-qlik-container{width:100%}@media (min-width: 576px){.kup-qlik-container{width:576px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 768px){.kup-qlik-container{width:768px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 992px){.kup-qlik-container{width:992px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 1200px){.kup-qlik-container{width:1200px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}.kup-qlik-row{display:flex;display:ms-flexbox;flex-wrap:wrap;-ms-flex-wrap:wrap;margin-bottom:5px}.kup-qlik-row .size-M{height:var(--lyo_obj-height)}.kup-qlik-row .size-S{height:calc(var(--lyo_obj-height) / 2)}.kup-qlik-row .size-XS{height:calc(var(--lyo_obj-height) / 3)}.kup-qlik-row .size-L{height:calc(var(--lyo_obj-height) * 2)}.kup-qlik-row .size-XL{height:calc(var(--lyo_obj-height) * 3)}.kup-qlik-row .bordered{border:1px solid var(--kup-border-subtle, #969696)}.kup-qlik-row .width-1{width:8.3333%}.kup-qlik-row .width-2{width:16.6666%}.kup-qlik-row .width-3{width:25%}.kup-qlik-row .width-4{width:33.3333%}.kup-qlik-row .width-5{width:41.6666%}.kup-qlik-row .width-6{width:50%}.kup-qlik-row .width-7{width:58.3333%}.kup-qlik-row .width-8{width:66.6666%}.kup-qlik-row .width-9{width:75%}.kup-qlik-row .width-10{width:83.3333%}.kup-qlik-row .width-11{width:91.6666%}.kup-qlik-row .width-12{width:100%}";export{p as kup_qlik}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as n,f as e,h as i,H as a,d as p}from"./p-b0368f88.js";import{k as o,e as s,g as h,s as l}from"./p-
|
|
1
|
+
import{r as t,c as n,f as e,h as i,H as a,d as p}from"./p-b0368f88.js";import{k as o,e as s,g as h,s as l}from"./p-4508907e.js";import{a as f,F as r}from"./p-60cfddce.js";import{c}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var u;!function(t){t.data="prop of the sub compoennt",t.Style="it is the style of the text",t.Border="when true it will appear a border",t.BorderWidth="it is the width of the border",t.Align="text alignment",t.FontBold="when true it will display the bold font",t.FontItalic="when true it will display the italic ( cursive )",t.FontName="it is the name of the font",t.FontSize="it is the size of the font of the text",t.FontULine="when true it will show the underline",t.FontColor="it is the color of the font of the text",t.BackColor="it is the background color of the text",t.Type="it is the type of the font. It is an enum that can take from different variant such as body, heading1, caption and so on"}(u||(u={}));const g=class{constructor(e){t(this,e),this.kupIconClick=n(this,"kup-typographylist-icon-click",6),this.KupClick=n(this,"kup-typographylist-click",6),this.kupManager=o(),this.customStyle="",this.data=[],this.type=f.BODY_COMPACT,this.toolbar=!1}onKupClick(t,n){this.KupClick.emit({comp:this,id:this.rootElement.id,index:t,subIndex:n,obj:this.getObjForEvent(t,n)})}onKupIconClick(t,n){this.kupIconClick.emit({comp:this,id:this.rootElement.id,index:t,node:n})}checkDataset(t){t||(t=[]),t.columns&&(this.kupManager.debug.logMessage(this,"Detected KupDataDataset: converting rows to nodes.",s.WARNING),this.data=this.kupManager.data.row.toNode(this.data))}async getProps(t){return h(this,u,t)}async refresh(){e(this)}async setProps(t){l(this,u,t)}renderTypography(t,n){if(null===t)return this.kupManager.debug.logMessage(this,"Empty data text.",s.WARNING),null;const e=this.prepareDataFromTreeNode(t,n);return e.value?i(r,Object.assign({},{value:e.value,type:e.type,toolbar:e.toolbar})):(this.kupManager.debug.logMessage(this,"Empty text.",s.WARNING),null)}prepareDataFromTreeNode(t,n){const e=null!=t.data?Object.assign({},t.data):{};return null!=this.customStyle&&""!=this.customStyle.trim()&&(e.customStyle=this.customStyle),null==e.value&&(e.value=t.value),e.wrapperClass||(e.wrapperClass=""),null!=this.type&&(e.type=this.type),null!=this.toolbar&&(e.toolbar=this.toolbar),e.id=n.toString(),e}renderTypographys(){if(null==this.data||this.data.length<1)return null;const t=[];for(let n=0;n<this.data.length;n++){let e=null;e=this.renderTypography(this.data[n],n),e&&t.push(e)}return t}getObjForEvent(t,n){let e=Number(t),i=-1;null!=n&&""!=n.trim()&&(i=Number(n));let a=this.data[e];return-1!=i?a.children[i].obj:a.obj}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.checkDataset(this.data),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 t=this.renderTypographys();return i(a,{key:"8f26e4a08f8e7d6f1817e9438d1564c9d96df79a"},i("style",{key:"3eaac8b78691e9d0e0d46998cc412f3f9ac5a448"},this.kupManager.theme.setKupStyle(this.rootElement)),i("div",{key:"d95cbe2301b7cb41056c15de94cd90db27d44d38",id:c},i("div",{key:"f51149ee4665b2987a70344071de5a73e4c9b229",class:"typographies-wrapper"},t)))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return p(this)}static get watchers(){return{data:["checkDataset"]}}};g.style=".kup-body-compact-01 {\n font-family: var(--kup-font-family);\n font-size: var(--kup-body-compact-01-font-size, 14px);\n line-height: 18px;\n font-weight: 400;\n letter-spacing: 0.16px;\n}\n\n.kup-body-01 {\n font-family: var(--kup-font-family);\n font-size: var(--kup-body-01-font-size, 14px);\n line-height: 20px;\n font-weight: 400;\n letter-spacing: 0.16px;\n}\n\n.kup-code-01 {\n font-family: var(--kup-font-family-monospace);\n font-size: 12px;\n line-height: 16px;\n font-weight: 400;\n letter-spacing: 0.32px;\n}\n\n.kup-label-01 {\n font-family: var(--kup-font-family);\n font-size: 12px;\n line-height: 16px;\n font-weight: 400;\n letter-spacing: 0.32px;\n}\n\n.kup-caption-02 {\n font-family: var(--kup-font-family);\n font-size: 12px;\n line-height: 15px;\n font-weight: 500;\n letter-spacing: 1px;\n}\n\n.kup-caption-01 {\n font-family: var(--kup-font-family);\n font-size: 10px;\n line-height: 13px;\n font-weight: 400;\n letter-spacing: 1px;\n}\n\n.kup-small-label-01 {\n font-family: var(--kup-font-family);\n font-size: 6px;\n line-height: 9px;\n font-weight: 400;\n letter-spacing: 1px;\n}\n\n.kup-heading-compact-01 {\n font-family: var(--kup-font-family);\n font-size: 14px;\n line-height: 18px;\n font-weight: 600;\n letter-spacing: 0.16px;\n}\n\n.kup-heading-01 {\n font-family: var(--kup-font-family);\n font-size: 14px;\n line-height: 20px;\n font-weight: 600;\n letter-spacing: 0.16px;\n}\n\n.kup-heading-02 {\n font-family: var(--kup-font-family);\n font-size: 16px;\n line-height: 24px;\n font-weight: 500;\n letter-spacing: 0;\n}\n\n.kup-heading-03 {\n font-family: var(--kup-font-family);\n font-size: 20px;\n line-height: 28px;\n font-weight: 400;\n letter-spacing: 0;\n}\n\n.kup-heading-04 {\n font-family: var(--kup-font-family);\n font-size: 28px;\n line-height: 36px;\n font-weight: 400;\n letter-spacing: 0;\n}\n\n.kup-heading-05 {\n font-family: var(--kup-font-family);\n font-size: 32px;\n line-height: 40px;\n font-weight: 300;\n letter-spacing: 0;\n}\n\n.kup-heading-06 {\n font-family: var(--kup-font-family);\n font-size: 42px;\n line-height: 50px;\n font-weight: 300;\n letter-spacing: 0;\n}\n\n.kup-heading-07 {\n font-family: var(--kup-font-family);\n font-size: 54px;\n line-height: 64px;\n font-weight: 300;\n letter-spacing: 0;\n}\n\n.kup-heading-08 {\n font-family: var(--kup-font-family);\n font-size: 54px;\n line-height: 64px;\n font-weight: 600;\n letter-spacing: 0;\n}\n\n:host {\n --kup_typographylist_wrapper_gap: var(\n --kup-typographylist-wrapper-gap,\n var(--kup-space-00) ;\n );\n}\n\n.typographies-wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--kup_typographylist_wrapper_gap);\n}\n\n:host {\n display: block;\n}";export{g as kup_typography_list}
|
|
@@ -10,6 +10,7 @@ export interface FCheckboxProps extends FComponent {
|
|
|
10
10
|
indeterminate?: boolean;
|
|
11
11
|
label?: string;
|
|
12
12
|
leadingLabel?: boolean;
|
|
13
|
+
legacyLook?: boolean;
|
|
13
14
|
onClick?: (event: MouseEvent) => void;
|
|
14
15
|
onBlur?: (event: FocusEvent) => void;
|
|
15
16
|
onFocus?: (event: FocusEvent) => void;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as c}from"./p-f2213e00.js";import{h as e}from"./p-b0368f88.js";const o=o=>{const r={"data-indeterminate":!!o.indeterminate},s={checkbox:!0,"checkbox--checked":!(!o.checked||o.indeterminate),"checkbox--disabled":!!o.disabled,"checkbox--indeterminate":!!o.indeterminate},a={color:o.error?"var(--kup_danger_icon_color)":"var(--kup_warning_icon_color)",resource:o.error?"error":"warning",sizeX:"1.15em",sizeY:"1.15em",wrapperClass:"kup-icon"};return e("div",Object.assign({class:`f-checkbox ${o.danger?"kup-danger":""} ${o.error?"checkbox--error":""} ${o.info?"kup-info":""} ${o.secondary?"kup-secondary":""} ${o.success?"kup-success":""} ${o.warning?"kup-warning":""} ${o.wrapperClass?o.wrapperClass:""}`},o.dataSet,{id:o.id,title:o.title}),e("div",{class:"form-field "+(o.leadingLabel?"form-field--align-end":"")},e("div",{class:s},e("input",Object.assign({type:"checkbox",class:"checkbox__native-control",checked:o.checked,disabled:o.disabled,onBlur:o.onBlur,onChange:o.onChange,onFocus:o.onFocus},r,{value:o.checked?"on":"off"})),e("div",{class:"checkbox__background",onClick:o.onChange},e("svg",{class:"checkbox__checkmark",viewBox:"0 0 24 24"},e("path",{class:"checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),e("div",{class:"checkbox__mixedmark"}))),o.label?e("label",{htmlFor:o.id,onClick:o.onChange},o.label):void 0),o.error?e("div",{class:"checkbox__error-message"},e(c,Object.assign({},a)),o.error):o.alert?e("div",{class:"checkbox__alert-message"},e(c,Object.assign({},a)),o.alert):void 0)};export{o as F}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e}from"./p-b0368f88.js";import{at as n,r as t,a as l,h as a}from"./p-a358e1a2.js";import{F as r}from"./p-504fe614.js";import{a as o}from"./p-e3062c19.js";var s;!function(e){e.SIMPLE="simple",e.FULL="full"}(s||(s={}));const i=document.documentElement,u=u=>{u.perPage||(u.perPage=10);const d=Math.ceil(u.max/u.perPage),f=function(e,n){const t=[];for(let l=1;l<=n;l++){const n=l==e.currentPage;t.push({id:l.toString(),selected:n,value:l.toString()})}return t}(u,d),m=function(e){const n=[];let t=e.perPage;if(0===t)return n;for(;t<e.max;){const l=t==e.perPage;n.push({id:t.toString(),selected:l,value:t.toString()}),t*=2}const l=e.max==e.perPage;return n.push({id:e.max.toString(),selected:l,value:e.max.toString()}),n}(u),b={"kup-list":{data:f},"kup-text-field":{label:i.ketchup.language.translate(n.PAGE),helper:i.ketchup.language.translate(n.TOTAL)+`: ${d}`,helperWhenFocused:!0,inputType:"number",max:d,min:1}},h={"kup-list":{data:m},"kup-text-field":{label:i.ketchup.language.translate(t.ROWS)+" / "+i.ketchup.language.translate(n.PAGE),helper:i.ketchup.language.translate(t.TOTAL)+`: ${u.max}`,helperWhenFocused:!0,inputType:"number",max:u.max,min:1}};return e("div",Object.assign({class:`f-paginator ${u.mode?u.mode:""} ${u.wrapperClass?u.wrapperClass:""}`},u.dataSet,{id:u.id,title:u.title}),u.onLoadMore?e(r,{icon:"plus",onClick:u.onLoadMore,label:i.ketchup.language.translate(a.LOAD_MORE),sizing:l.SMALL,styling:o.FLAT,wrapperClass:"load-more-button kup-neutral"}):null,e("kup-combobox",{class:"rows-selector",data:h,initialValue:u.perPage.toString(),"onkup-combobox-change":u.onRowsChange}),e("kup-combobox",{class:"page-selector",data:b,initialValue:u.currentPage.toString(),"onkup-combobox-change":u.onPageChange}),e("div",{class:"arrow-wrapper"},u.mode!==s.SIMPLE?e(r,{icon:"chevron_left",disabled:p(u),onClick:u.onPrevPage,sizing:l.SMALL,styling:o.FLAT,wrapperClass:"kup-neutral prev-page"}):null,u.mode!==s.SIMPLE?e(r,{icon:"chevron_right",disabled:c(u),onClick:u.onNextPage,sizing:l.SMALL,styling:o.FLAT,wrapperClass:"kup-neutral next-page"}):null))};function c(e){return e.currentPage*e.perPage>=e.max}function p(e){return 1==e.currentPage}const d=document.documentElement;function f(e,n,t){if(d.ketchup.math.isNumber(e)){const l=Math.ceil(n/t);let a=e;return a>l&&(a=l),a<1&&(a=1),a}return null}function m(e,n){if(d.ketchup.math.isNumber(e)){let t=e;return t>n&&(t=n),t<1&&(t=1),t}return null}export{u as F,f as p,m as r}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,f as e,h as s,H as a,d as o}from"./p-b0368f88.js";import{F as i}from"./p-9a60137a.js";import{k as r,g as n}from"./p-a358e1a2.js";import{c as f}from"./p-635bb4b3.js";import"./p-504fe614.js";import"./p-e3062c19.js";import"./p-f2213e00.js";import"./p-24fae583.js";import"./p-1ee561ba.js";var c;!function(t){t.customStyle="Custom style of the component.",t.data="Actual data of the component."}(c||(c={}));var h,p=function(t,e,s,a){if("a"===s&&!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"===s?a:"a"===s?a.call(t):a?a.value:e.get(t)};const d=class{constructor(e){t(this,e),h.set(this,r()),this.inputValue="",this.customStyle="",this.data={}}async getValue(){return this.inputValue}async getProps(t){return n(this,c,t)}async refresh(){e(this)}async setValue(t){this.inputValue=t}componentWillLoad(){p(this,h,"f").debug.logLoad(this,!1),p(this,h,"f").theme.register(this)}componentDidLoad(){p(this,h,"f").debug.logLoad(this,!0)}componentWillRender(){p(this,h,"f").debug.logRender(this,!1)}componentDidRender(){p(this,h,"f").debug.logRender(this,!0)}render(){var t;const e={data:null!==(t=this.data)&&void 0!==t?t:{},inputValue:this.inputValue,onChange:null};return s(a,{key:"f3c9567c118b3ef39f24a7b89a0852379b5b50d3"},s("style",{key:"10b4329a4934fecca877b99814846422b162f4ff"},p(this,h,"f").theme.setKupStyle(this.rootElement)),s("div",{key:"054e8a048364d488fe117131fa0699c3d8e05d85",id:f},s(i,Object.assign({key:"4a28a96a773e739adc954fcee4a429633e00f5d4"},e))))}disconnectedCallback(){p(this,h,"f").theme.unregister(this)}get rootElement(){return o(this)}};h=new WeakMap,d.style="";export{d as kup_object_field}
|