@sme.up/ketchup 9.6.6 → 9.6.7
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-button-7de4ca64.js → f-button-3cc5c9ba.js} +1 -1
- package/dist/cjs/{f-cell-abe47ff4.js → f-cell-192e5b87.js} +5 -5
- package/dist/cjs/{f-chip-d98809f9.js → f-chip-be2dddb4.js} +2 -2
- package/dist/cjs/{f-image-b22e12c9.js → f-image-98e4e61d.js} +32 -9
- package/dist/cjs/{f-paginator-utils-59c26ee9.js → f-paginator-utils-44d07f52.js} +2 -2
- package/dist/cjs/{f-text-field-4cacd928.js → f-text-field-1efcecb6.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ketchup.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +9 -7
- package/dist/cjs/kup-box.cjs.entry.js +22 -15
- package/dist/cjs/kup-calendar.cjs.entry.js +4 -4
- 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 +4 -4
- 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 +29 -3
- package/dist/cjs/kup-family-tree.cjs.entry.js +3 -3
- package/dist/cjs/kup-grid.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 +70 -40
- package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
- package/dist/cjs/kup-magic-box.cjs.entry.js +2 -2
- package/dist/cjs/{kup-manager-118c4e57.js → kup-manager-72ad15fe.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-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 +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/editor.js +3 -2
- package/dist/collection/assets/input-panel.js +3864 -260
- package/dist/collection/components/kup-box/kup-box.js +15 -8
- package/dist/collection/components/kup-editor/kup-editor-declarations.js +1 -0
- package/dist/collection/components/kup-editor/kup-editor.js +56 -2
- package/dist/collection/components/kup-image/kup-image.js +23 -0
- package/dist/collection/components/kup-input-panel/kup-input-panel.css +12 -0
- package/dist/collection/components/kup-input-panel/kup-input-panel.js +64 -34
- package/dist/collection/f-components/f-image/f-image.js +32 -10
- package/dist/components/kup-autocomplete2.js +35 -9
- package/dist/components/kup-box2.js +15 -8
- package/dist/components/kup-editor.js +30 -2
- package/dist/components/kup-input-panel.js +65 -35
- package/dist/components/kup-manager.js +1 -1
- package/dist/esm/{f-button-e63b4537.js → f-button-07a6ea71.js} +1 -1
- package/dist/esm/{f-cell-262f3239.js → f-cell-819033de.js} +5 -5
- package/dist/esm/{f-chip-eaf517ff.js → f-chip-71ce7cab.js} +2 -2
- package/dist/esm/{f-image-20e217c8.js → f-image-46787842.js} +32 -9
- package/dist/esm/{f-paginator-utils-7ed775bd.js → f-paginator-utils-a8f895d1.js} +2 -2
- package/dist/esm/{f-text-field-17075562.js → f-text-field-52de97f3.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/ketchup.js +1 -1
- package/dist/esm/kup-accordion.entry.js +2 -2
- package/dist/esm/kup-autocomplete_27.entry.js +9 -7
- package/dist/esm/kup-box.entry.js +22 -15
- package/dist/esm/kup-calendar.entry.js +4 -4
- 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 +4 -4
- 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 +29 -3
- package/dist/esm/kup-family-tree.entry.js +3 -3
- package/dist/esm/kup-grid.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 +70 -40
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +2 -2
- package/dist/esm/{kup-manager-c974dda6.js → kup-manager-7b151628.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-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 +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-00a5d02c.js +1 -0
- package/dist/ketchup/{p-fa1f706e.js → p-0787925c.js} +1 -1
- package/dist/ketchup/{p-76f39bd6.entry.js → p-1afe847f.entry.js} +1 -1
- package/dist/ketchup/{p-04d047b1.entry.js → p-1f8d3a1e.entry.js} +1 -1
- package/dist/ketchup/{p-8c7009f6.entry.js → p-20030845.entry.js} +1 -1
- package/dist/ketchup/{p-04e2beb5.js → p-34b51a97.js} +1 -1
- package/dist/ketchup/{p-b169b592.js → p-43a89559.js} +1 -1
- package/dist/ketchup/p-45bb8683.entry.js +1 -0
- package/dist/ketchup/{p-dad18517.entry.js → p-475429a1.entry.js} +1 -1
- package/dist/ketchup/{p-d77fbe3d.entry.js → p-4952eba9.entry.js} +1 -1
- package/dist/ketchup/{p-ca3d9d80.js → p-537f66c5.js} +1 -1
- package/dist/ketchup/{p-f6f30bb4.entry.js → p-58093828.entry.js} +1 -1
- package/dist/ketchup/{p-e7eaa6b3.entry.js → p-64099f8c.entry.js} +2 -2
- package/dist/ketchup/p-66ec0b16.entry.js +1 -0
- package/dist/ketchup/{p-e850bdf3.entry.js → p-791dfc1a.entry.js} +1 -1
- package/dist/ketchup/{p-c7e28520.entry.js → p-7ce691cd.entry.js} +1 -1
- package/dist/ketchup/{p-2ea2fd08.entry.js → p-85d44da6.entry.js} +1 -1
- package/dist/ketchup/{p-cb600014.entry.js → p-9106f511.entry.js} +1 -1
- package/dist/ketchup/{p-9fa95bdb.entry.js → p-a323ff1c.entry.js} +1 -1
- package/dist/ketchup/{p-4f4d4b9d.entry.js → p-b42a37ae.entry.js} +1 -1
- package/dist/ketchup/{p-c0be9b3c.entry.js → p-b58cc563.entry.js} +1 -1
- package/dist/ketchup/p-b8aefc56.entry.js +1 -0
- package/dist/ketchup/{p-4561daec.entry.js → p-bb1b8aac.entry.js} +1 -1
- package/dist/ketchup/{p-d9a4f193.entry.js → p-be0070a2.entry.js} +3 -3
- package/dist/ketchup/{p-1b5eb6f4.entry.js → p-cd0f09b3.entry.js} +1 -1
- package/dist/ketchup/{p-02b017a6.entry.js → p-cea71777.entry.js} +1 -1
- package/dist/ketchup/{p-b6e350b5.entry.js → p-d56677f1.entry.js} +1 -1
- package/dist/ketchup/{p-c58a6b55.entry.js → p-e70ff428.entry.js} +1 -1
- package/dist/ketchup/{p-237f4b66.js → p-ecbd1132.js} +1 -1
- package/dist/ketchup/{p-b5a46daf.entry.js → p-ed99792c.entry.js} +1 -1
- package/dist/ketchup/{p-1fc57b76.entry.js → p-f1aa239b.entry.js} +1 -1
- package/dist/ketchup/{p-75b2681f.js → p-f46c2da6.js} +1 -1
- package/dist/types/components/kup-editor/kup-editor-declarations.d.ts +2 -0
- package/dist/types/components/kup-editor/kup-editor.d.ts +8 -1
- package/dist/types/components/kup-image/kup-image.d.ts +5 -0
- package/dist/types/components/kup-input-panel/kup-input-panel-declarations.d.ts +2 -2
- package/dist/types/components.d.ts +22 -2
- package/dist/types/f-components/f-image/f-image-declarations.d.ts +1 -0
- package/package.json +1 -1
- package/dist/ketchup/p-2c3aff15.js +0 -1
- package/dist/ketchup/p-90b07248.entry.js +0 -1
- package/dist/ketchup/p-b9884b65.entry.js +0 -1
- package/dist/ketchup/p-f943ef5b.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,f as e,h as n,H as a,d as o}from"./p-aa62724a.js";import{F as l}from"./p-537f66c5.js";import{F as s}from"./p-ecbd1132.js";import{k as p,a3 as r,g as u,s as h,l as c}from"./p-34b51a97.js";import{F as f}from"./p-b3577066.js";import{c as d}from"./p-635bb4b3.js";import"./p-c634eb82.js";import"./p-00a5d02c.js";import"./p-9d3a0a51.js";import"./p-f46c2da6.js";import"./p-0787925c.js";import"./p-eb8ea3a6.js";import"./p-d4a879fc.js";var m;!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"}(m||(m={}));var g,k,b,v,_,w,y,x,j,z,O,C,E,M,$,T,W,S,P,D,F,I,R,G,L,V,A,B=function(t,i,e,n){if("a"===e&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!n:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?n:"a"===e?n.call(t):n?n.value:i.get(t)},H=function(t,i,e,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!a:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(t,e):a?a.value=e:i.set(t,e),e};const K=document.documentElement,N=class{constructor(e){t(this,e),this.kupReady=i(this,"kup-input-panel-ready",6),g.add(this),k.set(this,p()),b.set(this,new Map([["SmeupTreeNode",B(this,g,"m",L).bind(this)],["SmeupTable",B(this,g,"m",V).bind(this)]])),v.set(this,null),_.set(this,new Map([[r.AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[r.COMBOBOX,["kup-combobox-iconclick"]]])),w.set(this,[]),this.customStyle="",this.data=null,this.hiddenSubmitButton=!1,this.submitCb=null,this.optionsHandler=null,this.inputPanelCells=[]}onDataChanged(){H(this,v,structuredClone(this.data),"f"),B(this,w,"f").length&&(B(this,w,"f").map((({event:t,handler:i})=>{this.rootElement.removeEventListener(t,i)})),H(this,w,[],"f")),B(this,g,"m",C).call(this,this.data)}async getProps(t){return u(this,m,t)}async refresh(){e(this)}async setProps(t){h(this,m,t)}componentWillLoad(){B(this,k,"f").debug.logLoad(this,!1),B(this,k,"f").language.register(this),B(this,k,"f").theme.register(this),this.onDataChanged()}componentDidLoad(){this.kupReady.emit({comp:this,id:this.rootElement.id}),B(this,k,"f").debug.logLoad(this,!0)}componentWillRender(){B(this,k,"f").debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const i=t.querySelectorAll(".f-text-field");for(let t=0;t<i.length;t++)f(i[t])}B(this,k,"f").debug.logRender(this,!0)}render(){const t=Boolean(!this.inputPanelCells.length)?[n("p",null,B(this,k,"f").language.translate(c.EMPTY_DATA))]:this.inputPanelCells.map((t=>B(this,g,"m",y).call(this,t)));return n(a,{key:"ae9e00db322fcda0ee1f996c5ba7f92d337ab03c"},n("style",{key:"0aea3b4b3c388f5887a5440d05a7cafa1f1c24aa"},B(this,k,"f").theme.setKupStyle(this.rootElement)),n("div",{key:"181bc90607f56adf9b5ee12f0716693ed425cd88",id:d},t))}disconnectedCallback(){B(this,k,"f").language.unregister(this),B(this,k,"f").theme.unregister(this)}get rootElement(){return o(this)}static get watchers(){return{data:["onDataChanged"]}}};k=new WeakMap,b=new WeakMap,v=new WeakMap,_=new WeakMap,w=new WeakMap,g=new WeakSet,y=function(t){var i;const e=t.row.layout,a=(null==e?void 0:e.horizontal)||!1;let o;return o=(null===(i=null==e?void 0:e.sections)||void 0===i?void 0:i.length)?e.sections.map((i=>B(this,g,"m",z).call(this,t,i))):t.cells.map((i=>B(this,g,"m",x).call(this,i.cell,t.row,i.column))),n("form",{class:{"input-panel":!0,"input-panel--column":!a},name:this.rootElement.id,onSubmit:t=>{t.preventDefault(),this.submitCb({before:Object.assign({},B(this,v,"f")),after:B(this,g,"m",E).call(this)})}},o,this.hiddenSubmitButton?null:n(l,{buttonType:"submit",label:B(this,k,"f").language.translate(c.CONFIRM),wrapperClass:"form__submit"}))},x=function(t,i,e){const a={cell:t,column:e,row:i,component:this,editable:!0,renderKup:!0,setSizes:!0},o=B(this,g,"m",j).call(this,t,e.title);return o?n("div",{class:{"input-panel__label_container":!0}},o,n(s,Object.assign({},a))):n(s,Object.assign({},a))},j=function(t,i){return i&&K.ketchup.data.cell.getType(t,t.shape)===r.RADIO?n("span",null,i):null},z=function t(i,e){var a,o,l,s;let p=[];(null===(a=e.sections)||void 0===a?void 0:a.length)?p=e.sections.map((e=>B(this,g,"m",t).call(this,i,e))):(null===(o=e.content)||void 0===o?void 0:o.length)&&(p=e.content.map((t=>B(this,g,"m",O).call(this,i,t))));const r={"input-panel__section":!e.horizontal,"input-panel__horizontal-section":e.horizontal},u={gap:e.gap?`${e.gap}rem`:"","grid-template-columns":e.gridCols?`repeat(${e.gridCols}, 1fr)`:"","grid-template-rows":e.gridRows?`repeat(${e.gridRows}, 1fr)`:""};return(null===(s=null===(l=i.row)||void 0===l?void 0:l.layout)||void 0===s?void 0:s.horizontal)?u.maxWidth=e.dim:u.maxHeight=e.dim,n("div",{class:r,style:u},p)},O=function(t,i){const e=t.cells.find((t=>t.column.name===i.id));return n("div",{style:{"grid-column-start":i.colSpan?`span ${i.colSpan}`:`${i.colStart}`,"grid-column-end":i.colEnd?`${i.colEnd}`:"","grid-row-start":i.rowSpan?`span ${i.rowSpan}`:`${i.rowStart}`,"grid-row-end":i.rowEnd?`${i.rowEnd}`:""}},B(this,g,"m",x).call(this,e.cell,t.row,e.column))},C=function(t){var i;const e=(null===(i=null==t?void 0:t.rows)||void 0===i?void 0:i.length)?t.rows.reduce(((i,e)=>[...i,{cells:t.columns.filter((t=>t.visible)).map((t=>{const i=structuredClone(e.cells[t.name]);return{column:t,cell:Object.assign(Object.assign({},i),{data:Object.assign(Object.assign({},B(this,g,"m",M).call(this,i,t)),{disabled:!i.editable,id:t.name}),slotData:B(this,g,"m",$).call(this,i,t),isEditable:!0})}})),row:e}]),[]):[];this.inputPanelCells=e},E=function(){return this.inputPanelCells.reduce(((t,i)=>{const e=Object.keys(i.row.cells).reduce(((t,e)=>{const n=i.cells.find((t=>t.column.name===e)).cell;return Object.assign(Object.assign({},t),{[e]:Object.assign(Object.assign({},i.row.cells[e]),{value:n.value,obj:n.obj})})}),{});return{columns:[...t.columns,...i.cells.map((t=>t.column))],rows:[...t.rows,{cells:e,layout:i.row.layout}]}}),{columns:[],rows:[]})},M=function(t,i){const e=t.options,n=i.title,a=t.value,o=K.ketchup.data.cell.getType(t,t.shape),l=new Map([[r.AUTOCOMPLETE,B(this,g,"m",P).bind(this)],[r.BUTTON_LIST,B(this,g,"m",S).bind(this)],[r.CHART,B(this,g,"m",W).bind(this)],[r.CHIP,B(this,g,"m",T).bind(this)],[r.CHECKBOX,B(this,g,"m",D).bind(this)],[r.COLOR_PICKER,B(this,g,"m",F).bind(this)],[r.COMBOBOX,B(this,g,"m",P).bind(this)],[r.RADIO,B(this,g,"m",R).bind(this)],[r.STRING,B(this,g,"m",I).bind(this)]]).get(o);return l?l(e,n,a,t,i.name):null},$=function(t,i){const e=K.ketchup.data.cell.getType(t,t.shape);return e===r.CHIP||e===r.MULTI_AUTOCOMPLETE||e===r.MULTI_COMBOBOX||t.editable?{trailingIcon:!0,label:i.title}:null},T=function(t,i,e){return{data:(null==t?void 0:t.length)?t.map((t=>({value:t.label,id:t.id,selected:e===t.id}))):[{id:e,value:e}]}},W=function(){return{data:{sizeX:"50px",offlineMode:{value:"8;4;5"},id:"i1012_GREF_0",cellId:"i1012_GREF_0",sizeY:"50px"}}},S=function(){return{data:[{data:{dropdownOnly:!1,label:"Pier"}},{data:{dropdownOnly:!1,label:"Valerio"}}]}},P=function(t,i,e,n,a){const o={data:{"kup-text-field":{trailingIcon:!0,label:i,icon:"arrow_drop_down"},"kup-list":{showIcons:!0,data:[]}},initialValue:e,label:i};if(n.fun){const t=K.ketchup.data.cell.getType(n,n.shape),i=B(this,_,"f").get(t);if(!i)return;i.map((t=>{const i=t=>{B(this,g,"m",A).call(this,t.detail,n.fun,o,a,e)};this.rootElement.addEventListener(t,i),B(this,w,"f").push({event:t,handler:i})}))}else t&&(o.data["kup-list"].data=B(this,g,"m",G).call(this,t,e));return o},D=function(t,i,e){return{checked:"on"===e||"1"===e,label:i}},F=function(t,i){return{data:{"kup-text-field":{label:i}}}},I=function(t,i){return{label:i}},R=function(t,i,e){return{data:t.map((t=>({value:t.id,label:t.label,checked:t.id===e})))}},G=function(t,i){const e=B(this,b,"f").get(t.type);return e?e(t,i):t.map((t=>({value:t.label,id:t.id,selected:i===t.id})))},L=function t(i,e){return i.children.map((i=>{var n;return{id:i.content.codice,value:i.content.testo,selected:e===i.content.codice,children:(null===(n=i.children)||void 0===n?void 0:n.length)?B(this,g,"m",t).call(this,i,e):[]}}))},V=function(t,i){return t.rows.filter((t=>t.fields)).map((({fields:t})=>Object.keys(t).map((e=>({id:t[e].smeupObject.codice,value:t[e].smeupObject.testo,selected:i===t[e].smeupObject.codice}))))).flat()},A=function(t,i,e,n,a){t.id===n&&!1!==t.open&&this.optionsHandler(i,t.inputValue,B(this,g,"m",E).call(this)).then((i=>{var n;e.data["kup-list"].data=null!==(n=B(this,g,"m",G).call(this,i,a))&&void 0!==n?n:[],t.comp.refresh()}))},N.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);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_input_panel_background_color:var(--kup-input-panel-background-color,\n var(--kup-background-color));--kup_input_panel_color:var(--kup-input-panel-color, var(--kup-text-color));--kup_input_panel_font_family:var(--kup-input-panel-font-family, var(--kup-font-family));--kup_input_panel_font_size:var(--kup-input-panel-font-size, var(--kup-font-size));--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)}: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:2rem}:host .input-panel--column{flex-direction:column}:host .input-panel__section{display:grid}:host .input-panel__section .f-cell__content>*{width:100%}:host .input-panel__horizontal-section{display:inline-grid}: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}";export{N as kup_input_panel}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,f as i,h as a,H as l,d as r}from"./p-aa62724a.js";import{F as o}from"./p-ca3d9d80.js";import{F as n}from"./p-c634eb82.js";import{F as s}from"./p-2c3aff15.js";import{k as f,g as _,s as m,l as p,M as h}from"./p-04e2beb5.js";import{c}from"./p-635bb4b3.js";import"./p-eb8ea3a6.js";var u;!function(t){t.autofitOnExpand="The component will autofit everytime a node is expanded.",t.autofitOnLoad="The component's initial render will fit the container by invoking the runAutofit method.",t.cardData="Used to render the family tree boxes as kup-cards (through kup-box).",t.collapsible="Nodes can be expanded/collapsed.",t.customStyle="Custom style of the component.",t.data="Actual data of the component",t.layout="Layout of the boxes.",t.stackedLeaves="Child nodes that have no children are arranged vertically."}(u||(u={}));var d,y,g,k,x,v,b,w,z,j,C,E,T,W,M,S,D,L,O,P,A,F,R,X,Y,H=function(t,e,i,a){if("a"===i&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?a:"a"===i?a.call(t):a?a.value:e.get(t)},$=function(t,e,i,a,l){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!l:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?l.call(t,i):l?l.value=i:e.set(t,i),i};const B=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),g.set(this,!1),k.set(this,0),x.set(this,0),v.set(this,[]),b.set(this,f()),w.set(this,(t=>{const e=t.clientX-H(this,k,"f"),i=t.clientY-H(this,x,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,k,t.clientX,"f"),$(this,x,t.clientY,"f")})),z.set(this,!1),j.set(this,null),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1}async collapseAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return _(this,u,t)}async refresh(){i(this)}async runAutofit(){const t=H(this,j,"f").clientWidth,e=H(this,j,"f").children[0].clientWidth,i=.01,a=.85*t,l=.95*t;let r=1,o=2e3,n=e;for(;(n<a||n>l)&&o>0&&r>i;)o--,n<a?r+=i:n>l?r-=i:o=0,n=e*r;H(this,j,"f").style.setProperty("--kup_familytree_scale",r<=1?r.toFixed(2):"1")}async setProps(t){m(this,u,t)}componentWillLoad(){H(this,b,"f").debug.logLoad(this,!1),H(this,b,"f").language.register(this),H(this,b,"f").theme.register(this)}componentDidLoad(){H(this,d,"m",X).call(this),this.autofitOnLoad&&this.runAutofit(),H(this,b,"f").debug.logLoad(this,!0)}componentWillRender(){H(this,b,"f").debug.logRender(this,!1)}componentDidRender(){H(this,z,"f")&&($(this,z,!1,"f"),this.runAutofit()),H(this,b,"f").debug.logRender(this,!0)}render(){return a(l,{key:"6d5a1b1f815a7ffa56f54120ad51b9b919650792",onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),H(this,d,"m",O).call(this,t)},onWheel:t=>{H(this,d,"m",Y).call(this,t)}},a("style",{key:"fff5b482e957932f66726457d6fdd12f521c83f4"},H(this,b,"f").theme.setKupStyle(this.rootElement)),a("div",{key:"db11ed9b09b3256eef0f7937caf0b8dc60d00ac9",id:c},H(this,d,"m",D).call(this)))}disconnectedCallback(){H(this,b,"f").language.unregister(this),H(this,b,"f").theme.unregister(this)}get rootElement(){return r(this)}};y=new WeakMap,g=new WeakMap,k=new WeakMap,x=new WeakMap,v=new WeakMap,b=new WeakMap,w=new WeakMap,z=new WeakMap,j=new WeakMap,d=new WeakSet,C=function(t,e,i,l){const r=[];return r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},a("div",{class:"family-tree__line--placeholder"}))),r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||l&&!e}},a("div",{class:"family-tree__line--placeholder"}))),r},E=function t(e){var i;let l=null,r=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(r||(r=[]),r.push(t)):(l||(l=[]),l.push(t))})));const s=this.stackedLeaves&&l&&l.every((t=>!t.children||0==t.children.length)),f=l?2*l.length:1,_={"family-tree__line":!0,"family-tree__line--placeholder":!(!l&&!r),"family-tree__line--vertical":!(!l&&!r)},m={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},h=e.layout||this.layout||1,c={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:n.OUTLINED,title:`${H(this,b,"f").language.translate(p.EXPAND)}/${H(this,b,"f").language.translate(p.COLLAPSE)} (CTRL + Click)`,onClick:t=>{t.ctrlKey&&e.children&&e.children.length>0&&(e.isExpanded?this.collapseAll(e.children):this.expandAll(e.children)),e.isExpanded=!e.isExpanded,this.autofitOnExpand&&$(this,z,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let u=null;H(this,d,"m",L).call(this,h)&&(u=a("kup-box",{class:"kup-borderless kup-paddingless",customStyle:"#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }",data:m,cardData:this.cardData,layout:this.cardData?null:h,showSelection:!1}));const y=a("div",{class:"family-tree__item"},a("div",{class:"family-tree__item__wrapper"},H(this,d,"m",L).call(this,h)?u:H(this,d,"m",T).call(this,e,h),this.collapsible&&e.children&&e.children.length>0?a(o,Object.assign({},c)):void 0)),g={"--kup_familytree_staffchildren":(null==r?void 0:r.length.toString())||"0"};return a("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},a("tr",null,a("td",{"data-row":e,colSpan:f},y)),a("tr",null,a("td",{colSpan:f},a("div",{class:_}))),r?[a("tr",null,a("td",{colSpan:f},a("div",{class:Object.assign(Object.assign({},_),{"family-tree__line--staff":!0}),style:g}),a("div",{class:"family-tree__node__staff",style:g},r.map((e=>[a("div",{class:"family-tree__node__staff__item"},H(this,d,"m",t).call(this,e))])))))]:null,r&&l?[a("tr",null,a("td",{colSpan:f},a("div",{class:_})))]:null,l?[a("tr",null,s?a("td",{colSpan:f},a("div",{class:_})):l.map((t=>H(this,d,"m",C).call(this,0==l.indexOf(t),l.indexOf(t)==l.length-1,1==l.length,l.length>2)))),a("tr",null,s?a("td",{colSpan:f},l.map((e=>H(this,d,"m",t).call(this,e)))):l.map((e=>a("td",{colSpan:2},H(this,d,"m",t).call(this,e)))))]:void 0)},T=function(t,e){return 2===e?H(this,d,"m",M).call(this,t):H(this,d,"m",W).call(this,t)},W=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--1"},a("div",{class:"family-tree__item__layout__text__title"},t.value))},M=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--2"},a("div",{class:"family-tree__item__layout__color"}),a("div",{class:"family-tree__item__layout__image"},a(s,{resource:t.icon,sizeX:"48px",sizeY:"48px"})),a("div",{class:"family-tree__item__layout__text"},a("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?a("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},S=function(t){return t.map((t=>H(this,d,"m",E).call(this,t)))},D=function(){return a("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,j,t,"f")},this.data&&this.data.rows&&this.data.rows.length?H(this,d,"m",S).call(this,this.data.rows):a("div",null,H(this,b,"f").language.translate(p.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){$(this,k,t.clientX,"f"),$(this,x,t.clientY,"f"),H(this,j,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",H(this,w,"f")),document.removeEventListener("pointerup",e),H(this,j,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",H(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t,e){let i,a;if(t)for(let e=t.length-1;e>=0;e--){const l=t[e];l.tagName&&(l.classList.contains("family-tree__item__expand")&&(i=l),"TD"===l.tagName.toUpperCase())&&(a=l)}let l=null,r=null,o=null;return a&&(l=a["data-cell"],r=a["data-column"],o=a["data-row"]),{cell:l||null,column:r||null,expandButton:i||null,originalEvent:e,row:o||null,td:a||null}},A=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},F=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},R=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},X=function(){H(this,v,"f").push(this.rootElement),H(this,b,"f").interact.on(this.rootElement,h.TAP,(t=>{if(H(this,g,"f"))$(this,g,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];H(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.DOUBLETAP,(t=>{if(0===t.button){for(let t=0;t<H(this,y,"f").length;t++)clearTimeout(H(this,y,"f")[t]),H(this,b,"f").debug.logMessage(this,"Cleared clickHandler timeout("+H(this,y,"f")[t]+").");$(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",R).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||($(this,g,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)}))}))},Y=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(H(this,j,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let a=t.deltaY>0?e-i:e+i;a<i&&(a=i),H(this,j,"f").style.setProperty("--kup_familytree_scale",a.toFixed(2))}},B.style='.kup-body-compact-01{font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);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_familytree_item_background_color:var(\n --kup-familytree-item-background-color,\n var(--kup-background-color)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 80px);--kup_familytree_item_h_padding:var(--kup-familytree-item-h-padding, 8px);--kup_familytree_item_v_padding:var(--kup-familytree-item-v-padding, 10px);--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-color)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc((var(--kup_familytree_item_width) + var(--kup_familytree_item_h_padding) * 2) / 2)) translateY(calc(0px - (var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:"";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc(var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);border:1px solid var(--kup_familytree_lines_color);border-radius:8px;box-sizing:border-box;display:flex;height:var(--kup_familytree_item_height);margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup-secondary-color);border-bottom-left-radius:8px;border-top-left-radius:8px;height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto 10px}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';export{B as kup_family_tree}
|
|
1
|
+
import{r as t,c as e,f as i,h as a,H as l,d as r}from"./p-aa62724a.js";import{F as o}from"./p-537f66c5.js";import{F as n}from"./p-c634eb82.js";import{F as s}from"./p-00a5d02c.js";import{k as f,g as _,s as m,l as p,M as h}from"./p-34b51a97.js";import{c}from"./p-635bb4b3.js";import"./p-eb8ea3a6.js";var u;!function(t){t.autofitOnExpand="The component will autofit everytime a node is expanded.",t.autofitOnLoad="The component's initial render will fit the container by invoking the runAutofit method.",t.cardData="Used to render the family tree boxes as kup-cards (through kup-box).",t.collapsible="Nodes can be expanded/collapsed.",t.customStyle="Custom style of the component.",t.data="Actual data of the component",t.layout="Layout of the boxes.",t.stackedLeaves="Child nodes that have no children are arranged vertically."}(u||(u={}));var d,y,g,k,x,v,b,w,z,j,C,E,T,W,M,S,D,L,O,P,A,F,R,X,Y,H=function(t,e,i,a){if("a"===i&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?a:"a"===i?a.call(t):a?a.value:e.get(t)},$=function(t,e,i,a,l){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!l:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?l.call(t,i):l?l.value=i:e.set(t,i),i};const B=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),g.set(this,!1),k.set(this,0),x.set(this,0),v.set(this,[]),b.set(this,f()),w.set(this,(t=>{const e=t.clientX-H(this,k,"f"),i=t.clientY-H(this,x,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,k,t.clientX,"f"),$(this,x,t.clientY,"f")})),z.set(this,!1),j.set(this,null),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1}async collapseAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return _(this,u,t)}async refresh(){i(this)}async runAutofit(){const t=H(this,j,"f").clientWidth,e=H(this,j,"f").children[0].clientWidth,i=.01,a=.85*t,l=.95*t;let r=1,o=2e3,n=e;for(;(n<a||n>l)&&o>0&&r>i;)o--,n<a?r+=i:n>l?r-=i:o=0,n=e*r;H(this,j,"f").style.setProperty("--kup_familytree_scale",r<=1?r.toFixed(2):"1")}async setProps(t){m(this,u,t)}componentWillLoad(){H(this,b,"f").debug.logLoad(this,!1),H(this,b,"f").language.register(this),H(this,b,"f").theme.register(this)}componentDidLoad(){H(this,d,"m",X).call(this),this.autofitOnLoad&&this.runAutofit(),H(this,b,"f").debug.logLoad(this,!0)}componentWillRender(){H(this,b,"f").debug.logRender(this,!1)}componentDidRender(){H(this,z,"f")&&($(this,z,!1,"f"),this.runAutofit()),H(this,b,"f").debug.logRender(this,!0)}render(){return a(l,{key:"6d5a1b1f815a7ffa56f54120ad51b9b919650792",onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),H(this,d,"m",O).call(this,t)},onWheel:t=>{H(this,d,"m",Y).call(this,t)}},a("style",{key:"fff5b482e957932f66726457d6fdd12f521c83f4"},H(this,b,"f").theme.setKupStyle(this.rootElement)),a("div",{key:"db11ed9b09b3256eef0f7937caf0b8dc60d00ac9",id:c},H(this,d,"m",D).call(this)))}disconnectedCallback(){H(this,b,"f").language.unregister(this),H(this,b,"f").theme.unregister(this)}get rootElement(){return r(this)}};y=new WeakMap,g=new WeakMap,k=new WeakMap,x=new WeakMap,v=new WeakMap,b=new WeakMap,w=new WeakMap,z=new WeakMap,j=new WeakMap,d=new WeakSet,C=function(t,e,i,l){const r=[];return r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},a("div",{class:"family-tree__line--placeholder"}))),r.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||l&&!e}},a("div",{class:"family-tree__line--placeholder"}))),r},E=function t(e){var i;let l=null,r=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(r||(r=[]),r.push(t)):(l||(l=[]),l.push(t))})));const s=this.stackedLeaves&&l&&l.every((t=>!t.children||0==t.children.length)),f=l?2*l.length:1,_={"family-tree__line":!0,"family-tree__line--placeholder":!(!l&&!r),"family-tree__line--vertical":!(!l&&!r)},m={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},h=e.layout||this.layout||1,c={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:n.OUTLINED,title:`${H(this,b,"f").language.translate(p.EXPAND)}/${H(this,b,"f").language.translate(p.COLLAPSE)} (CTRL + Click)`,onClick:t=>{t.ctrlKey&&e.children&&e.children.length>0&&(e.isExpanded?this.collapseAll(e.children):this.expandAll(e.children)),e.isExpanded=!e.isExpanded,this.autofitOnExpand&&$(this,z,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let u=null;H(this,d,"m",L).call(this,h)&&(u=a("kup-box",{class:"kup-borderless kup-paddingless",customStyle:"#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }",data:m,cardData:this.cardData,layout:this.cardData?null:h,showSelection:!1}));const y=a("div",{class:"family-tree__item"},a("div",{class:"family-tree__item__wrapper"},H(this,d,"m",L).call(this,h)?u:H(this,d,"m",T).call(this,e,h),this.collapsible&&e.children&&e.children.length>0?a(o,Object.assign({},c)):void 0)),g={"--kup_familytree_staffchildren":(null==r?void 0:r.length.toString())||"0"};return a("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},a("tr",null,a("td",{"data-row":e,colSpan:f},y)),a("tr",null,a("td",{colSpan:f},a("div",{class:_}))),r?[a("tr",null,a("td",{colSpan:f},a("div",{class:Object.assign(Object.assign({},_),{"family-tree__line--staff":!0}),style:g}),a("div",{class:"family-tree__node__staff",style:g},r.map((e=>[a("div",{class:"family-tree__node__staff__item"},H(this,d,"m",t).call(this,e))])))))]:null,r&&l?[a("tr",null,a("td",{colSpan:f},a("div",{class:_})))]:null,l?[a("tr",null,s?a("td",{colSpan:f},a("div",{class:_})):l.map((t=>H(this,d,"m",C).call(this,0==l.indexOf(t),l.indexOf(t)==l.length-1,1==l.length,l.length>2)))),a("tr",null,s?a("td",{colSpan:f},l.map((e=>H(this,d,"m",t).call(this,e)))):l.map((e=>a("td",{colSpan:2},H(this,d,"m",t).call(this,e)))))]:void 0)},T=function(t,e){return 2===e?H(this,d,"m",M).call(this,t):H(this,d,"m",W).call(this,t)},W=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--1"},a("div",{class:"family-tree__item__layout__text__title"},t.value))},M=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--2"},a("div",{class:"family-tree__item__layout__color"}),a("div",{class:"family-tree__item__layout__image"},a(s,{resource:t.icon,sizeX:"48px",sizeY:"48px"})),a("div",{class:"family-tree__item__layout__text"},a("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?a("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},S=function(t){return t.map((t=>H(this,d,"m",E).call(this,t)))},D=function(){return a("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,j,t,"f")},this.data&&this.data.rows&&this.data.rows.length?H(this,d,"m",S).call(this,this.data.rows):a("div",null,H(this,b,"f").language.translate(p.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){$(this,k,t.clientX,"f"),$(this,x,t.clientY,"f"),H(this,j,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",H(this,w,"f")),document.removeEventListener("pointerup",e),H(this,j,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",H(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t,e){let i,a;if(t)for(let e=t.length-1;e>=0;e--){const l=t[e];l.tagName&&(l.classList.contains("family-tree__item__expand")&&(i=l),"TD"===l.tagName.toUpperCase())&&(a=l)}let l=null,r=null,o=null;return a&&(l=a["data-cell"],r=a["data-column"],o=a["data-row"]),{cell:l||null,column:r||null,expandButton:i||null,originalEvent:e,row:o||null,td:a||null}},A=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},F=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},R=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},X=function(){H(this,v,"f").push(this.rootElement),H(this,b,"f").interact.on(this.rootElement,h.TAP,(t=>{if(H(this,g,"f"))$(this,g,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];H(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.DOUBLETAP,(t=>{if(0===t.button){for(let t=0;t<H(this,y,"f").length;t++)clearTimeout(H(this,y,"f")[t]),H(this,b,"f").debug.logMessage(this,"Cleared clickHandler timeout("+H(this,y,"f")[t]+").");$(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",R).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,h.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||($(this,g,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)}))}))},Y=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(H(this,j,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let a=t.deltaY>0?e-i:e+i;a<i&&(a=i),H(this,j,"f").style.setProperty("--kup_familytree_scale",a.toFixed(2))}},B.style='.kup-body-compact-01{font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);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_familytree_item_background_color:var(\n --kup-familytree-item-background-color,\n var(--kup-background-color)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 80px);--kup_familytree_item_h_padding:var(--kup-familytree-item-h-padding, 8px);--kup_familytree_item_v_padding:var(--kup-familytree-item-v-padding, 10px);--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-color)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc((var(--kup_familytree_item_width) + var(--kup_familytree_item_h_padding) * 2) / 2)) translateY(calc(0px - (var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:"";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc(var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);border:1px solid var(--kup_familytree_lines_color);border-radius:8px;box-sizing:border-box;display:flex;height:var(--kup_familytree_item_height);margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup-secondary-color);border-bottom-left-radius:8px;border-top-left-radius:8px;height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto 10px}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';export{B as kup_family_tree}
|