@sme.up/ketchup 6.7.0 → 6.8.0
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-bf76ab95.js → f-button-229c63fd.js} +1 -1
- package/dist/cjs/{f-cell-b7a1524a.js → f-cell-dd006395.js} +5 -5
- package/dist/cjs/{f-chip-a5e100b1.js → f-chip-f2c369fd.js} +2 -2
- package/dist/cjs/{f-image-d80a2749.js → f-image-847a6ddf.js} +1 -1
- package/dist/cjs/{f-paginator-utils-c70812fe.js → f-paginator-utils-cedc4b3e.js} +2 -2
- package/dist/cjs/{f-text-field-48b8bb16.js → f-text-field-fe85187d.js} +1 -1
- package/dist/cjs/ketchup.cjs.js +2 -2
- package/dist/cjs/kup-accordion.cjs.entry.js +6 -29
- package/dist/cjs/{kup-autocomplete_25.cjs.entry.js → kup-autocomplete_26.cjs.entry.js} +3811 -4323
- package/dist/cjs/kup-box.cjs.entry.js +29 -110
- package/dist/cjs/kup-calendar.cjs.entry.js +9 -33
- package/dist/cjs/kup-cell.cjs.entry.js +8 -27
- package/dist/cjs/kup-dash-list.cjs.entry.js +9 -8
- package/dist/cjs/kup-dash_2.cjs.entry.js +6 -34
- package/dist/cjs/kup-dashboard.cjs.entry.js +8 -30
- package/dist/cjs/kup-drawer.cjs.entry.js +3 -18
- package/dist/cjs/kup-echart.cjs.entry.js +15 -76
- package/dist/cjs/kup-family-tree.cjs.entry.js +11 -47
- package/dist/cjs/kup-iframe.cjs.entry.js +4 -16
- package/dist/cjs/kup-image-list.cjs.entry.js +14 -32
- package/dist/cjs/kup-lazy.cjs.entry.js +9 -36
- package/dist/cjs/kup-magic-box.cjs.entry.js +5 -24
- package/dist/cjs/{kup-manager-0e38bf48.js → kup-manager-c53468cd.js} +66 -1
- package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -15
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +13 -56
- package/dist/cjs/kup-photo-frame.cjs.entry.js +8 -30
- package/dist/cjs/kup-probe.cjs.entry.js +12 -32
- package/dist/cjs/kup-qlik.cjs.entry.js +5 -59
- package/dist/cjs/kup-snackbar.cjs.entry.js +6 -37
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/kup-accordion/kup-accordion.js +4 -27
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +15 -64
- package/dist/collection/components/kup-badge/kup-badge.js +3 -19
- package/dist/collection/components/kup-box/kup-box.js +22 -103
- package/dist/collection/components/kup-button/kup-button.js +3 -58
- package/dist/collection/components/kup-button-list/kup-button-list.js +3 -38
- package/dist/collection/components/kup-calendar/kup-calendar.js +5 -29
- package/dist/collection/components/kup-card/box/kup-card-box.js +5 -2
- package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +10 -2
- package/dist/collection/components/kup-card/built-in/kup-card-form.js +11 -0
- package/dist/collection/components/kup-card/kup-card.css +78 -12
- package/dist/collection/components/kup-card/kup-card.js +48 -47
- package/dist/collection/components/kup-cell/kup-cell.js +3 -22
- package/dist/collection/components/kup-chart/kup-chart.js +15 -49
- package/dist/collection/components/kup-checkbox/kup-checkbox.js +3 -38
- package/dist/collection/components/kup-chip/kup-chip.js +3 -19
- package/dist/collection/components/kup-color-picker/kup-color-picker.js +4 -35
- package/dist/collection/components/kup-combobox/kup-combobox.js +10 -42
- package/dist/collection/components/kup-dash/kup-dash.js +2 -14
- package/dist/collection/components/kup-dash-list/kup-dash-list.js +8 -7
- package/dist/collection/components/kup-dashboard/kup-dashboard.js +4 -26
- package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +2 -0
- package/dist/collection/components/kup-data-table/kup-data-table.css +9 -0
- package/dist/collection/components/kup-data-table/kup-data-table.js +3546 -3385
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +7 -35
- package/dist/collection/components/kup-drawer/kup-drawer.js +2 -17
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +12 -63
- package/dist/collection/components/kup-echart/kup-echart.js +14 -75
- package/dist/collection/components/kup-family-tree/kup-family-tree.js +8 -44
- package/dist/collection/components/kup-form/kup-form.js +4 -24
- package/dist/collection/components/kup-gauge/kup-gauge.js +15 -76
- package/dist/collection/components/kup-grid/kup-grid.js +3 -19
- package/dist/collection/components/kup-iframe/kup-iframe.js +3 -15
- package/dist/collection/components/kup-image/kup-image.js +5 -45
- package/dist/collection/components/kup-image-list/kup-image-list.js +8 -26
- package/dist/collection/components/kup-lazy/kup-lazy.js +8 -35
- package/dist/collection/components/kup-list/kup-list.js +5 -68
- package/dist/collection/components/kup-magic-box/kup-magic-box.js +3 -22
- package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +2 -14
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +11 -54
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +7 -29
- package/dist/collection/components/kup-probe/kup-probe.js +11 -31
- package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +3 -35
- package/dist/collection/components/kup-qlik/kup-qlik.js +4 -58
- package/dist/collection/components/kup-radio/kup-radio.js +3 -34
- package/dist/collection/components/kup-rating/kup-rating.js +4 -27
- package/dist/collection/components/kup-snackbar/kup-snackbar.js +3 -34
- package/dist/collection/components/kup-spinner/kup-spinner.js +3 -39
- package/dist/collection/components/kup-switch/kup-switch.js +3 -34
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +4 -24
- package/dist/collection/components/kup-text-field/kup-text-field.js +2 -115
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +8 -43
- package/dist/collection/components/kup-tree/kup-tree.js +39 -129
- package/dist/collection/f-components/f-cell/f-cell.js +1 -1
- package/dist/collection/managers/kup-language/kup-language-declarations.js +6 -0
- package/dist/esm/{f-button-e79f7594.js → f-button-d1aba968.js} +1 -1
- package/dist/esm/{f-cell-9400374e.js → f-cell-646406bb.js} +5 -5
- package/dist/esm/{f-chip-bf740287.js → f-chip-d94e9e81.js} +2 -2
- package/dist/esm/{f-image-ab3dc8cb.js → f-image-57c88302.js} +1 -1
- package/dist/esm/{f-paginator-utils-6909e43b.js → f-paginator-utils-2c865e9a.js} +2 -2
- package/dist/esm/{f-text-field-4841dfea.js → f-text-field-b0a1fea6.js} +1 -1
- package/dist/esm/ketchup.js +2 -2
- package/dist/esm/kup-accordion.entry.js +6 -29
- package/dist/esm/{kup-autocomplete_25.entry.js → kup-autocomplete_26.entry.js} +3811 -4324
- package/dist/esm/kup-box.entry.js +29 -110
- package/dist/esm/kup-calendar.entry.js +9 -33
- package/dist/esm/kup-cell.entry.js +8 -27
- package/dist/esm/kup-dash-list.entry.js +9 -8
- package/dist/esm/kup-dash_2.entry.js +6 -34
- package/dist/esm/kup-dashboard.entry.js +8 -30
- package/dist/esm/kup-drawer.entry.js +3 -18
- package/dist/esm/kup-echart.entry.js +15 -76
- package/dist/esm/kup-family-tree.entry.js +11 -47
- package/dist/esm/kup-iframe.entry.js +4 -16
- package/dist/esm/kup-image-list.entry.js +14 -32
- package/dist/esm/kup-lazy.entry.js +9 -36
- package/dist/esm/kup-magic-box.entry.js +5 -24
- package/dist/esm/{kup-manager-c54e6df5.js → kup-manager-c0fbb180.js} +67 -2
- package/dist/esm/kup-nav-bar.entry.js +3 -15
- package/dist/esm/kup-numeric-picker.entry.js +13 -56
- package/dist/esm/kup-photo-frame.entry.js +8 -30
- package/dist/esm/kup-probe.entry.js +12 -32
- package/dist/esm/kup-qlik.entry.js +5 -59
- package/dist/esm/kup-snackbar.entry.js +6 -37
- package/dist/esm/loader.js +2 -2
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-30a63b85.entry.js → p-1914969e.entry.js} +1 -1
- package/dist/ketchup/{p-859163c2.entry.js → p-250118e3.entry.js} +1 -1
- package/dist/ketchup/{p-2e184b57.entry.js → p-30766296.entry.js} +1 -1
- package/dist/ketchup/{p-182b869e.entry.js → p-351cecba.entry.js} +1 -1
- package/dist/ketchup/{p-758d03f4.entry.js → p-35e16ea2.entry.js} +1 -1
- package/dist/ketchup/{p-e1d0ea71.js → p-395675b8.js} +1 -1
- package/dist/ketchup/p-3cf97e3a.js +1 -0
- package/dist/ketchup/{p-7e7b6127.entry.js → p-596bdc10.entry.js} +1 -1
- package/dist/ketchup/{p-4f0d3062.js → p-61ff1761.js} +1 -1
- package/dist/ketchup/p-72d4fa26.entry.js +1 -0
- package/dist/ketchup/{p-f9d5e553.entry.js → p-738685f9.entry.js} +1 -1
- package/dist/ketchup/{p-fb4d772a.entry.js → p-7c8c5444.entry.js} +1 -1
- package/dist/ketchup/p-86154e2b.js +1 -0
- package/dist/ketchup/{p-41620707.entry.js → p-9214ef33.entry.js} +1 -1
- package/dist/ketchup/{p-1f5c7f21.entry.js → p-980ed953.entry.js} +1 -1
- package/dist/ketchup/p-991bd70d.entry.js +1 -0
- package/dist/ketchup/{p-bffaef6e.entry.js → p-a1fe329f.entry.js} +1 -1
- package/dist/ketchup/p-a740352c.js +30 -0
- package/dist/ketchup/{p-25bf0cb6.js → p-a992cf87.js} +1 -1
- package/dist/ketchup/{p-313e376b.entry.js → p-b1da1ba7.entry.js} +2 -2
- package/dist/ketchup/{p-4a0ccf18.entry.js → p-cee3635a.entry.js} +1 -1
- package/dist/ketchup/p-d05ed931.entry.js +9 -0
- package/dist/ketchup/{p-8e1fa7a8.entry.js → p-d422151a.entry.js} +2 -2
- package/dist/ketchup/p-e6f19333.entry.js +1 -0
- package/dist/ketchup/p-eb10958a.entry.js +1 -0
- package/dist/ketchup/{p-5bea2971.js → p-ecac6269.js} +1 -1
- package/dist/ketchup/p-f43b445e.entry.js +1 -0
- package/dist/ketchup/{p-6bd57787.entry.js → p-fa37e92e.entry.js} +1 -1
- package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +7 -2
- package/dist/types/components/kup-card/built-in/kup-card-form.d.ts +3 -0
- package/dist/types/components/kup-card/kup-card-declarations.d.ts +11 -1
- package/dist/types/components/kup-card/kup-card.d.ts +5 -0
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +9 -0
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +41 -202
- package/dist/types/components/kup-tree/kup-tree.d.ts +0 -1
- package/dist/types/components.d.ts +55 -2
- package/dist/types/managers/kup-data/kup-data-declarations.d.ts +1 -0
- package/dist/types/managers/kup-language/kup-language-declarations.d.ts +7 -1
- package/dist/types/managers/kup-theme/kup-theme-declarations.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +5 -0
- package/package.json +2 -2
- package/dist/cjs/kup-form.cjs.entry.js +0 -486
- package/dist/esm/kup-form.entry.js +0 -482
- package/dist/ketchup/p-1dfd2a51.js +0 -30
- package/dist/ketchup/p-22ec1ba0.entry.js +0 -9
- package/dist/ketchup/p-260ff835.entry.js +0 -1
- package/dist/ketchup/p-53d3ae80.entry.js +0 -1
- package/dist/ketchup/p-60fa0ccf.entry.js +0 -1
- package/dist/ketchup/p-6333388c.js +0 -1
- package/dist/ketchup/p-8386e3db.entry.js +0 -1
- package/dist/ketchup/p-90860d9e.entry.js +0 -1
- package/dist/ketchup/p-b7fdc7aa.entry.js +0 -1
- package/dist/ketchup/p-c35c5e05.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as c}from"./p-4fdb684f.js";import{F as i}from"./p-
|
|
1
|
+
import{h as c}from"./p-4fdb684f.js";import{F as i}from"./p-ecac6269.js";import{K as s,l as e,b as n}from"./p-a740352c.js";var p;!function(c){c.CHOICE="choice",c.FILTER="filter",c.INPUT="input",c.STANDARD="standard"}(p||(p={}));const l=document.documentElement,a=a=>{a.type||(a.type=p.STANDARD);const r=a.type.toLowerCase()===p.CHOICE,t=a.type.toLowerCase()===p.FILTER,o=a.type.toLowerCase()===p.INPUT,d={"chip-set":!0,"chip-set--choice":!!r,"chip-set--filter":!!t,"chip-set--input":!!o};return c("div",Object.assign({class:`f-chip ${a.danger?"kup-danger":""} ${a.info?"kup-info":""} ${a.secondary?"kup-secondary":""} ${a.success?"kup-success":""} ${a.warning?"kup-warning":""} ${a.wrapperClass?a.wrapperClass:""}`},a.dataSet,{id:a.id,title:a.title}),c("div",{class:d,role:"grid"},function(p,a,r,t){const o=[];for(let u=0;p.data&&u<p.data.length;u++){const _=[];function d(n,a){const r=!!(n.children&&n.children.length>0),t=!(!r||!n.isExpanded),o={"--kup_chip_indent_offset":a.toString()};if(_.push(c("div",{class:"chip-set__wrapper "+(r&&!t?"chip-set__wrapper--hidden-children":"")},c("div",{class:"chip-set__indent",style:o}),r?c(i,{onClick:p.onExpansionClick&&p.onExpansionClick[u]?p.onExpansionClick[u].bind(p.onExpansionClick[u],n):null,resource:`${s.DROPDOWN}`,sizeX:"18px",sizeY:"18px",title:l.ketchup.language.translate(e.EXPAND)+"/"+l.ketchup.language.translate(e.COLLAPSE)+" (CTRL + Click)",wrapperClass:"dropdown-icon"}):a?c(i,{resource:"blank",sizeX:"18px",sizeY:"18px",wrapperClass:"dropdown-icon"}):null,h(n))),t)for(let c=0;c<n.children.length;c++)n.children[c]&&d(n.children[c],a+1)}function h(e){let l="chip "+(e.icon&&!e.value?"chip--only-icon":""),o=[],d="chip__icon chip__icon--leading";return(r||a)&&e.checked&&(l+=" chip--selected",r&&(d+=" chip__icon--leading-hidden")),e.icon&&o.push(c(i,Object.assign({},{color:a&&e.checked?`var(${n.PRIMARY})`:`var(${n.TEXT})`,resource:e.icon,sizeX:"18px",sizeY:"18px",wrapperClass:d}))),r&&o.push(c("span",{class:"chip__checkmark"},c("svg",{class:"chip__checkmark-svg",viewBox:"-2 -3 30 30"},c("path",{class:"chip__checkmark-path",fill:"none",stroke:"black",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})))),c("div",{class:l,"data-value":e.id,onClick:p.onClick&&p.onClick[u]?p.onClick[u].bind(p.onClick[u],e):null,role:"row",title:e.title?e.title:""},c("span",{class:"chip-set__indent"}),o,c("span",{role:"gridcell"},c("span",{role:"button",tabindex:u,class:"chip__primary-action",value:e.id,checked:e.checked,onBlur:p.onBlur&&p.onBlur[u]?p.onBlur[u].bind(p.onBlur[u],e):null,onFocus:p.onFocus&&p.onFocus[u]?p.onFocus[u].bind(p.onFocus[u],e):null},c("span",{class:"chip__text"},e.value))),t?c("span",{role:"gridcell"},c("span",{tabindex:"-1",class:`kup-icon chip__icon ${s.CLEAR.replace("--","")}`,onClick:p.onIconClick&&p.onIconClick[u]?p.onIconClick[u].bind(p.onIconClick[u],e):null})):null)}d(p.data[u],0),o.push(c("div",{class:"chip-set__item"},..._))}return o}(a,r,t,o)))};export{p as F,a}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{al as e,am as c,b as t,a7 as a,an as s,ao as n,ai as l,ap as i,aq as r,af as u,ar as o}from"./p-a740352c.js";import{h as p}from"./p-4fdb684f.js";import{F as k}from"./p-23cd5a68.js";import{F as b}from"./p-61ff1761.js";import{F as d}from"./p-ecac6269.js";import{a as f}from"./p-395675b8.js";const h=e=>p("div",Object.assign({class:`f-switch ${e.danger?"kup-danger":""} ${e.info?"kup-info":""} ${e.secondary?"kup-secondary":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),p("div",{class:"form-field "+(e.leadingLabel?"form-field--align-end":"")},p("div",{class:`switch ${e.checked?"switch--checked":""} ${e.disabled?"switch--disabled":""}`},p("div",{class:"switch__track"}),p("div",{class:"switch__thumb-underlay"},p("div",{class:"switch__thumb"},p("input",{type:"checkbox",class:"switch__native-control",role:"switch",checked:e.checked,disabled:e.disabled,value:e.checked?"on":"off",onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus})))),p("label",{onClick:e.onChange},e.label))),m=document.documentElement,j=(n,r)=>{const j=n.cell,O=n.column,y=n.row,_=n.shape?n.shape:j.shape?j.shape:O.shape?O.shape:null,x=!m.ketchup.objects.isEmptyKupObj(j.obj),$=!(!j.isEditable&&!O.isEditable||!n.editable),C=n.previousValue!==j.value?j.value:"",z=m.ketchup.data.cell.getType(j,_),F=Object.assign({},j.data);let V=j.cssClass?j.cssClass:O.cssClass?O.cssClass:"";const H={"f-cell":!0,[i.OBJ]:!!x,[z+"-cell"]:!0,[n.wrapperClass]:!!n.wrapperClass,[n.density]:!(!n.density||z===a.BAR),[V]:!!V};let I=C;$&&e.includes(z)?I=function(e,c,t,s,n){switch(e){case a.AUTOCOMPLETE:return p("kup-autocomplete",Object.assign({key:s.name+n.row.id,initialValue:t.value},t.data,{class:g(n)?"kup-full-width":"","onkup-autocomplete-change":c=>v(c,n,e,o.UPDATE),"onkup-autocomplete-input":c=>v(c,n,e,o.INPUT),"onkup-autocomplete-iconclick":c=>v(c,n,e,o.ICON_CLICK)}));case a.CHECKBOX:return w(n)&&(c[i.C_CENTERED]=!0),p(k,Object.assign({},t.data,{onChange:c=>v(c,n,e,o.UPDATE)}));case a.COLOR_PICKER:return p("kup-color-picker",Object.assign({key:s.name+n.row.id,initialValue:t.value},t.data,{class:g(n)?"kup-full-width":"",disabled:!1,"onkup-colorpicker-change":c=>v(c,n,e,o.UPDATE)}));case a.COMBOBOX:return p("kup-combobox",Object.assign({key:s.name+n.row.id,initialValue:t.value},t.data,{class:g(n)?"kup-full-width":"","onkup-combobox-change":c=>v(c,n,e,o.UPDATE),"onkup-combobox-input":c=>v(c,n,e,o.INPUT),"onkup-combobox-iconclick":c=>v(c,n,e,o.ICON_CLICK)}));case a.DATE:return p("kup-date-picker",Object.assign({key:s.name+n.row.id,initialValue:t.value},t.data,{class:g(n)?"kup-full-width":"","onkup-datepicker-change":c=>v(c,n,e,o.UPDATE),"onkup-datepicker-input":c=>v(c,n,e,o.INPUT)}));case a.RATING:return p("kup-rating",Object.assign({key:s.name+n.row.id},t.data,{disabled:!1,"onkup-rating-click":c=>v(c,n,e,o.UPDATE)}));case a.SWITCH:return p(h,Object.assign({},t.data,{disabled:!1,onChange:c=>v(c,n,e,o.UPDATE)}));case a.TIME:return p("kup-time-picker",Object.assign({key:s.name+n.row.id,initialValue:t.value},t.data,{class:g(n)?"kup-full-width":"","onkup-timepicker-change":c=>v(c,n,e,o.UPDATE),"onkup-timepicker-input":c=>v(c,n,e,o.INPUT)}));case a.NUMBER:c[i.C_RIGHT_ALIGNED]=!0;case a.STRING:return p(b,Object.assign({inputType:e===a.NUMBER?"number":null,fullWidth:!!g(n)},t.data,{icon:t.icon?t.icon:s.icon?s.icon:null,value:e===a.NUMBER?l(t.value).toString():t.value,onChange:c=>v(c,n,e,o.UPDATE),onInput:c=>v(c,n,e,o.INPUT),onIconClick:c=>v(c,n,e,o.ICON_CLICK)}))}}(z,H,j,O,n):j.data&&c.includes(z)?(n.setSizes&&function(e,c,t){switch(e){case a.BAR:c.sizeY||(c.sizeY="26px");break;case a.BUTTON:let e="";c.label&&(e="36px"),t.style?t.style.height||(t.style.minHeight=e):t.style={minHeight:e};break;case a.CHART:c.sizeX||(c.sizeX="100%"),c.sizeY||(c.sizeY="100%");break;case a.CHIP:case a.RADIO:t.style?t.style.height||(t.style.minHeight="40px"):t.style={minHeight:"40px"}}}(z,F,j),I=n.renderKup?function(e,c,t,s,n,r,u){switch(e){case a.BAR:return t.data?p("div",{style:{height:t.sizeY,width:"100%"}},p(d,Object.assign({},t))):p("kup-image",Object.assign({key:r.name+u.row.id},t));case a.BUTTON:return w(u)&&(c[i.C_CENTERED]=!0),p("kup-button",Object.assign({key:r.name+u.row.id},t,{"onkup-button-click":c=>v(c,u,e,o.CLICK)}));case a.BUTTON_LIST:return w(u)&&(c[i.C_CENTERED]=!0),t["data-storage"]={cell:s,row:n,column:r},p("kup-button-list",Object.assign({key:r.name+u.row.id},t));case a.CHART:return w(u)&&(c[i.C_CENTERED]=!0),p("kup-chart",Object.assign({key:r.name+u.row.id},t));case a.CHIP:return p(f,Object.assign({},t));case a.COLOR_PICKER:return p("kup-color-picker",Object.assign({key:r.name+u.row.id},t,{class:g(u)?"kup-full-width":"",disabled:!0}));case a.GAUGE:return p("kup-gauge",Object.assign({key:r.name+u.row.id,value:l(s.value),"width-component":"280px"},t));case a.KNOB:case a.PROGRESS_BAR:return p("kup-progress-bar",Object.assign({key:r.name+u.row.id},t));case a.RADIO:return w(u)&&(c[i.C_CENTERED]=!0),t.disabled=n.readOnly,p("kup-radio",Object.assign({key:r.name+u.row.id},t));case a.RATING:return p("kup-rating",Object.assign({key:r.name+u.row.id},t,{disabled:!0}))}}(z,H,F,j,y,O,n):p("span",{class:"cell-"+z+" placeholder"})):(n.setSizes&&function(e,c,t,n){switch(e){case a.CHECKBOX:case a.ICON:c.sizeX||(c.sizeX="18px"),c.sizeY||(c.sizeY="18px"),t.style?t.style.height||(t.style.minHeight=c.sizeY):t.style={minHeight:c.sizeY};break;case a.IMAGE:n.component.rootElement.tagName===s.BOX?(c.sizeY||(c.sizeY="auto"),void 0===c.fit&&(c.fit=!0)):c.sizeX||(c.sizeX="auto"),c.sizeY||(c.sizeY="64px")}}(z,F,j,n),I=function(e,c,t,s,n,r,o){switch(e){case a.AUTOCOMPLETE:case a.COMBOBOX:case a.DATE:case a.DATETIME:case a.TIME:if(t&&""!=t){const e=u(r,n);return p("div",{class:"f-cell__text"},e)}return t;case a.CHECKBOX:return w(o)&&(s[i.C_CENTERED]=!0),p(d,{resource:c.checked?"check_box":"check_box_outline_blank",sizeX:"18px",sizeY:"18px"});case a.EDITOR:return p("div",{innerHTML:n.value});case a.ICON:case a.IMAGE:return w(o)&&(s[i.C_CENTERED]=!0),c.badgeData&&(s[i.C_PADDED]=!0),p(d,Object.assign({},c));case a.LINK:return p("a",{href:t,target:"_blank"},n.value);case a.NUMBER:if(t&&""!=t){const e=l(n.value),c=u(r,n);return e<0&&(s[i.TEXT_DANGER]=!0),w(o)&&(s[i.C_RIGHT_ALIGNED]=!0),p("div",{class:"f-cell__text"},c)}return p("div",{class:"f-cell__text"},t);case a.SWITCH:return w(o)&&(s[i.C_CENTERED]=!0),c.disabled=!0,p(h,Object.assign({},c));default:return p("div",{class:"f-cell__text"},t)}}(z,F,I,H,j,O,n));let T=null;!$&&(O.icon||j.icon)&&I&&(T=p(d,Object.assign({},{color:`rgba(var(${t.TEXT}-rgb), 0.375)`,resource:j.icon?j.icon:O.icon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"obj-icon"})));let X=null;m.ketchup.debug.isDebug()&&x?X=j.obj.t+"; "+j.obj.p+"; "+j.obj.k+";":null!=j.title&&""!=j.title.trim()&&(X=j.title);let Y=null;if(j.info){const e=Object.assign({},j.info);e.color||(e.color=`var(${t.INFO})`),e.icon||(e.icon="info"),Y=p(d,Object.assign({},{color:e.color,resource:e.icon,sizeX:"1.25em",sizeY:"1.25em",title:e.message?e.message:"",wrapperClass:"cell-info"}))}return p("div",{class:H,"kup-get-cell-props":()=>n,style:j.style},p("div",{class:"f-cell__content",style:j.styleContent,title:X},r&&r.length>0?r:[n.indents,Y,T,I]))};function v(e,c,t,s){const n=c.cell,l=c.column,i=c.component,r=c.row;let p="INPUT"===e.target.tagName?e.target.value:e.detail.value;if(s===o.UPDATE){switch(t){case a.AUTOCOMPLETE:case a.COMBOBOX:case a.DATE:case a.TIME:n.data&&(n.data.initialValue=p);break;case a.CHECKBOX:case a.SWITCH:p="on"===p?"0":"1",n.data&&(n.data.checked="0"!==p)}n.obj&&(n.obj.k=p.toString()),n.value=p.toString(),n.displayedValue=null,n.displayedValue=u(l,n)}if(i&&i.rootElement){const c=new CustomEvent(s,{bubbles:!0,cancelable:!0,composed:!0,detail:{comp:i,id:i.rootElement.id,cell:n,column:l,event:e,row:r,type:t}});i.rootElement.dispatchEvent(c);try{i.refresh()}catch(e){}}}function w(e){var c;return r.includes(null===(c=e.component)||void 0===c?void 0:c.rootElement.tagName)}function g(e){var c;return n.includes(null===(c=e.component)||void 0===c?void 0:c.rootElement.tagName)}export{j as F,h as a}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,c as o,f as t,h as e,H as a,g as i}from"./p-4fdb684f.js";import{k as s,g as p,s as d}from"./p-
|
|
1
|
+
import{r,c as o,f as t,h as e,H as a,g as i}from"./p-4fdb684f.js";import{k as s,g as p,s as d}from"./p-a740352c.js";import{c as n}from"./p-97e8ea42.js";var c;!function(r){r.customStyle="Custom style of the component.",r.opened="Defaults at false. When set to true, the drawer appears."}(c||(c={}));const u=class{constructor(t){r(this,t),this.kupDrawerClose=o(this,"kup-drawer-close",6),this.kupDrawerOpen=o(this,"kup-drawer-open",6),this.kupDrawerReady=o(this,"kup-drawer-ready",6),this.kupManager=s(),this.opened=!1,this.customStyle=""}async close(){this.opened=!1,this.kupDrawerClose.emit({comp:this,id:this.rootElement.id})}async getProps(r){return p(this,c,r)}async isOpened(){return this.opened}async open(){this.opened=!0,this.kupDrawerOpen.emit({comp:this,id:this.rootElement.id})}async refresh(){t(this)}async setProps(r){d(this,c,r)}async toggle(){this.opened?this.close():this.open()}content(){const r=[],o=Array.prototype.slice.call(this.rootElement.children,0),t=[];for(let t=0;t<o.length;t++)r.push(e("slot",null));return t.push(e("div",{class:"drawer__content"},r)),t}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.kupDrawerReady.emit({comp:this,id:this.rootElement.id}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){return e(a,{"kup-opened":this.opened},e("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{class:"backdrop",onClick:r=>{r.preventDefault(),r.stopPropagation()},onPointerDown:r=>{r.preventDefault(),r.stopPropagation(),this.close()},onTouchStart:r=>{r.preventDefault(),r.stopPropagation()}}),e("div",{id:n},e("div",{class:"drawer"},this.content())))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return i(this)}};u.style=":host{--kup_drawer_backdrop:var(--kup-drawer-backdrop, rgba(0, 0, 0, 0.32));--kup_drawer_box_shadow:var(\n --kup-drawer-box-shadow,\n 0 8px 10px -5px rgba(0, 0, 0, 0.2),\n 0 16px 24px 2px rgba(0, 0, 0, 0.14),\n 0 6px 30px 5px rgba(0, 0, 0, 0.12)\n );--kup_drawer_permanent_border:var(\n --kup-drawer-permanent-border,\n 1px solid var(--kup-border-color)\n );--kup_drawer_slide_transition:var(--kup-drawer-slide-transition, 750ms);--kup_drawer_transition:var(--kup-drawer-transition, 250ms);box-shadow:var(--kup_drawer_box_shadow);display:block;font-size:var(--kup-font-size);height:100vh;left:calc(var(--kup-drawer-width) * -1);position:fixed;top:0;transition:left var(--kup_drawer_slide_transition) cubic-bezier(0.4, 0, 0.2, 1), right var(--kup_drawer_slide_transition) cubic-bezier(0.4, 0, 0.2, 1);width:var(--kup-drawer-width);z-index:var(--kup-drawer-zindex)}#kup-component{height:100%;width:100%}.backdrop{background:var(--kup_drawer_backdrop);display:none;height:100%;left:0;position:fixed;top:0;width:100%;z-index:var(--kup-drawer-zindex)}.drawer{height:100%;position:fixed;width:var(--kup-drawer-width);z-index:calc(var(--kup-drawer-zindex) + 1)}.drawer__content{background-color:var(--kup-drawer-background-color);box-sizing:border-box;height:100%;overflow-y:auto;width:100%}.drawer ::slotted(*){--kup-button-primary-color:var(--kup-drawer-color);--kup-button-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-button-primary-color-h:var(--kup-drawer-color-h);--kup-button-primary-color-s:var(--kup-drawer-color-s);--kup-button-primary-color-l:var(--kup-drawer-color-l);--kup-switch-label-color:var(--kup-drawer-color);--kup-switch-primary-color:var(--kup-drawer-color);--kup-switch-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-textfield-color:var(--kup-drawer-color);--kup-textfield-color-rgb:var(--kup-drawer-color-rgb);--kup-textfield-primary-color:var(--kup-drawer-color);--kup-textfield-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-tree-color:var(--kup-drawer-color);--kup-tree-color-rgb:var(--kup-drawer-color-rgb);--kup-tree-filter-background-color:var(--kup-drawer-background-color);--kup-tree-icon-color:var(--kup-drawer-color);color:var(--kup-drawer-color);fill:var(--kup-drawer-color)}:host([kup-opened]){left:0}:host([kup-opened]) .backdrop{display:block}:host(.kup-right){left:unset;right:-100%}:host([kup-opened].kup-right){right:0}:host(.kup-permanent){box-shadow:unset;transition:all 250ms}:host(.kup-permanent) .backdrop{display:none}:host(.kup-permanent) .drawer{position:relative}:host(.kup-permanent) .drawer__content{border-right:var(--kup_drawer_permanent_border)}";export{u as kup_drawer}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,a as t}from"./p-4fdb684f.js";import{K as l}from"./p-
|
|
1
|
+
import{h as e,a as t}from"./p-4fdb684f.js";import{K as l}from"./p-a740352c.js";const i=(t,l)=>e("div",Object.assign({class:`f-text-field ${t.danger?"kup-danger":""} ${t.fullHeight?"kup-full-height":""} ${t.fullWidth?"kup-full-width":""} ${t.info?"kup-info":""} ${t.secondary?"kup-secondary":""} ${t.shaped?"kup-shaped":""} ${t.success?"kup-success":""} ${t.warning?"kup-warning":""} ${t.wrapperClass?t.wrapperClass:""}`},t.dataSet,{id:t.id,title:t.title}),t.leadingLabel||t.trailingLabel?e("div",{class:"mdc-form-field "+(t.leadingLabel?"mdc-form-field--align-end":"")},[d(t),c(t),e("label",null,t.label)]):[d(t),c(t)],l);function d(i){const d=i.textArea||i.outlined;let c,n;if(!i.label||i.leadingLabel||i.trailingLabel||(c=e("label",{class:"mdc-floating-label",htmlFor:"kup-input"},i.label)),i.icon){let d,c="";if(Object.values(l).indexOf(i.icon)>-1)c=i.icon.replace("--","");else{let e=`url('${t(`./assets/svg/${i.icon}.svg`)}') no-repeat center`;d={mask:e,webkitMask:e}}n=e("span",{style:d,onClick:i.onIconClick,class:`mdc-text-field__icon kup-icon action ${c}`})}return e("div",{class:{"is-clearable":i.isClearable,"mdc-text-field":!0,"mdc-text-field--disabled":i.disabled,"mdc-text-field--filled":!i.fullWidth&&!d,"mdc-text-field--no-label":!i.label,"mdc-text-field--fullwidth":i.fullWidth,"mdc-text-field--outlined":d,"mdc-text-field--textarea":i.textArea,"mdc-text-field--with-leading-icon":i.icon&&!i.trailingIcon,"mdc-text-field--with-trailing-icon":i.icon&&i.trailingIcon}},i.textArea&&i.maxLength?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",i.maxLength):void 0,i.trailingIcon?void 0:n,i.textArea?e("span",{class:"mdc-text-field__resizer"},e("textarea",{class:"mdc-text-field__input",disabled:i.disabled,readOnly:i.readOnly,maxlength:i.maxLength,value:i.value,onBlur:i.onBlur,onClick:i.onClick,onChange:i.onChange,onFocus:i.onFocus,onInput:i.onInput,onKeyDown:i.onKeyDown})):e("input",{inputmode:i.inputMode?i.inputMode:void 0,type:i.inputType?i.inputType:"text",step:i.step,min:i.min,max:i.max,name:i.name,class:"mdc-text-field__input",disabled:i.disabled,readOnly:i.readOnly,placeholder:i.fullWidth&&!i.outlined?i.label:void 0,maxlength:i.maxLength,value:i.value,onBlur:i.onBlur,onChange:e=>{null!==i.decimals&&"number"===i.inputType&&(e.target.value=parseFloat(e.target.value).toFixed(i.decimals)),i.onChange&&i.onChange(e)},onClick:i.onClick,onFocus:i.onFocus,onInput:i.onInput,onKeyDown:i.onKeyDown}),i.isClearable?e("span",{class:`mdc-text-field__icon kup-icon ${l.CLEAR.replace("--","")}`,onClick:i.onClearIconClick}):void 0,i.trailingIcon?n:void 0,i.fullWidth||d?void 0:c,d?e("div",{class:"mdc-notched-outline"},e("div",{class:"mdc-notched-outline__leading"}),e("div",{class:"mdc-notched-outline__notch"},c),e("div",{class:"mdc-notched-outline__trailing"})):e("span",{class:"mdc-line-ripple"}))}function c(t){if(!1!==t.helperEnabled){if(t.helper)return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:{"mdc-text-field-helper-text":!0,"mdc-text-field-helper-text--persistent":!t.helperWhenFocused}},t.helper),t.maxLength&&!t.textArea?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",t.maxLength.toString()):void 0);if(t.maxLength&&!t.textArea)return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",t.maxLength))}}export{i as F}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,c as t,h as i}from"./p-4fdb684f.js";import{k as l,af as h,av as e}from"./p-a740352c.js";const o=class{constructor(i){s(this,i),this.dashClick=t(this,"kup-dash-click",7),this.kupManager=l(),this.layout="1",this.fontsize="",this.active=!1,this.columnsNumber=1,this.fullWidth=!0,this.horizontal=!1,this.iconColor=[],this.valueColor=[],this.textColor=[],this.data=void 0}render(){let s=[];var t=0;return this.data.rows.forEach((l=>{let o="",d="",a="",c="",n="",r="",v={color:this.textColor[t]},u={color:this.valueColor[t]};if(o=this.data.columns[0]?i("div",{slot:"icon"},i("icon",{class:l.cells[this.data.columns[0].name].obj.k,style:{color:this.iconColor[t]}})):i("div",{slot:"icon"}),d=this.data.columns[1]?i("div",{slot:"unit",style:u},l.cells[this.data.columns[1].name].obj.k," "):i("div",{slot:"unit"}),a=this.data.columns[2]?i("div",{slot:"descr",style:v},l.cells[this.data.columns[2].name].obj.k):i("div",{slot:"descr"}),this.data.columns[3]){let s=this.data.columns[3];s.obj=l.cells[this.data.columns[3].name].obj;let t=h(s,l.cells[this.data.columns[3].name]);c=i("div",{slot:"value",style:u},t)}else c=i("div",{slot:"value"});if(this.data.columns[5]){let s=this.data.columns[5];s.obj=l.cells[this.data.columns[5].name].obj;let t=h(s,l.cells[this.data.columns[5].name]);this.data.columns[6]&&l.cells[this.data.columns[6].name].obj.k&&(t+=e(this.kupManager.dates.getLocale())),n=i("div",{slot:"value-int",style:u},t)}else n=i("div",{slot:"value-int"});r=this.data.columns[6]?i("div",{slot:"value-dec",style:u},l.cells[this.data.columns[6].name].obj.k):i("div",{slot:"value-dec"});const p=i("kup-dash",{layout:this.layout,fontsize:this.fontsize,index:t,active:this.active,slot:String(t)},o,d,a,c,n,r);s.push(p),t++})),i("div",null,i("link",{href:"https://cdn.materialdesignicons.com/4.5.95/css/materialdesignicons.min.css",rel:"stylesheet",type:"text/css"}),i("kup-grid",{columns:this.columnsNumber,singleLine:this.horizontal,class:this.fullWidth?"kup-full-width":""},s))}};o.style=".horizontal{display:inline-block;min-width:300px;max-width:100%;overflow:visible;white-space:nowrap;border:solid;border-width:1px;margin:2px}";export{o as kup_dash_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,f as i,h as r,H as a,g as l}from"./p-4fdb684f.js";import{F as o}from"./p-25bf0cb6.js";import{F as s}from"./p-6c77a36c.js";import{F as _}from"./p-5bea2971.js";import{k as n,g as m,s as f,l as h,O as c}from"./p-1dfd2a51.js";import{c as u}from"./p-97e8ea42.js";var p;!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."}(p||(p={}));var d,y,k,v,g,b,x,w,j,C,E,T,W,M,S,z,O,D,L,P,A,F,R,X,Y,H,$=function(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)},B=function(t,e,i,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(t,i):a?a.value=i:e.set(t,i),i};const N=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),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1,y.set(this,[]),k.set(this,!1),v.set(this,0),g.set(this,0),b.set(this,[]),x.set(this,n()),w.set(this,(t=>{const e=t.clientX-$(this,v,"f"),i=t.clientY-$(this,g,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,B(this,v,t.clientX,"f"),B(this,g,t.clientY,"f")})),j.set(this,!1),C.set(this,null)}async collapseAll(t=this.data.rows){$(this,x,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){$(this,x,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return m(this,p,t)}async refresh(){i(this)}async runAutofit(){const t=$(this,C,"f").clientWidth,e=$(this,C,"f").children[0].clientWidth,i=.01,r=.85*t,a=.95*t;let l=1,o=2e3,s=e;for(;(s<r||s>a)&&o>0&&l>i;)o--,s<r?l+=i:s>a?l-=i:o=0,s=e*l;$(this,C,"f").style.setProperty("--kup_familytree_scale",l<=1?l.toFixed(2):"1")}async setProps(t){f(this,p,t)}componentWillLoad(){$(this,x,"f").debug.logLoad(this,!1),$(this,x,"f").language.register(this),$(this,x,"f").theme.register(this)}componentDidLoad(){$(this,d,"m",Y).call(this),this.autofitOnLoad&&this.runAutofit(),$(this,x,"f").debug.logLoad(this,!0)}componentWillRender(){$(this,x,"f").debug.logRender(this,!1)}componentDidRender(){$(this,j,"f")&&(B(this,j,!1,"f"),this.runAutofit()),$(this,x,"f").debug.logRender(this,!0)}render(){return r(a,{onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),$(this,d,"m",L).call(this,t)},onWheel:t=>{$(this,d,"m",H).call(this,t)}},r("style",null,$(this,x,"f").theme.setKupStyle(this.rootElement)),r("div",{id:u},$(this,d,"m",O).call(this)))}disconnectedCallback(){$(this,x,"f").language.unregister(this),$(this,x,"f").theme.unregister(this)}get rootElement(){return l(this)}};y=new WeakMap,k=new WeakMap,v=new WeakMap,g=new WeakMap,b=new WeakMap,x=new WeakMap,w=new WeakMap,j=new WeakMap,C=new WeakMap,d=new WeakSet,E=function(t,e,i,a){const l=[];return l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},r("div",{class:"family-tree__line--placeholder"}))),l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||a&&!e}},r("div",{class:"family-tree__line--placeholder"}))),l},T=function t(e){var i;let a=null,l=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(l||(l=[]),l.push(t)):(a||(a=[]),a.push(t))})));const _=this.stackedLeaves&&a&&a.every((t=>!t.children||0==t.children.length)),n=a?2*a.length:1,m={"family-tree__line":!0,"family-tree__line--placeholder":!(!a&&!l),"family-tree__line--vertical":!(!a&&!l)},f={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},c=e.layout||this.layout||1,u={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:s.OUTLINED,title:`${$(this,x,"f").language.translate(h.EXPAND)}/${$(this,x,"f").language.translate(h.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&&B(this,j,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let p=null;$(this,d,"m",D).call(this,c)&&(p=r("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:f,cardData:this.cardData,layout:this.cardData?null:c,showSelection:!1}));const y=r("div",{class:"family-tree__item"},r("div",{class:"family-tree__item__wrapper"},$(this,d,"m",D).call(this,c)?p:$(this,d,"m",W).call(this,e,c),this.collapsible&&e.children&&e.children.length>0?r(o,Object.assign({},u)):void 0)),k={"--kup_familytree_staffchildren":(null==l?void 0:l.length.toString())||"0"};return r("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},r("tr",null,r("td",{"data-row":e,colSpan:n},y)),r("tr",null,r("td",{colSpan:n},r("div",{class:m}))),l?[r("tr",null,r("td",{colSpan:n},r("div",{class:Object.assign(Object.assign({},m),{"family-tree__line--staff":!0}),style:k}),r("div",{class:"family-tree__node__staff",style:k},l.map((e=>[r("div",{class:"family-tree__node__staff__item"},$(this,d,"m",t).call(this,e))])))))]:null,l&&a?[r("tr",null,r("td",{colSpan:n},r("div",{class:m})))]:null,a?[r("tr",null,_?r("td",{colSpan:n},r("div",{class:m})):a.map((t=>$(this,d,"m",E).call(this,0==a.indexOf(t),a.indexOf(t)==a.length-1,1==a.length,a.length>2)))),r("tr",null,_?r("td",{colSpan:n},a.map((e=>$(this,d,"m",t).call(this,e)))):a.map((e=>r("td",{colSpan:2},$(this,d,"m",t).call(this,e)))))]:void 0)},W=function(t,e){switch(e){case 2:return $(this,d,"m",S).call(this,t);default:return $(this,d,"m",M).call(this,t)}},M=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--1"},r("div",{class:"family-tree__item__layout__text__title"},t.value))},S=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--2"},r("div",{class:"family-tree__item__layout__color"}),r("div",{class:"family-tree__item__layout__image"},r(_,{resource:t.icon,sizeX:"48px",sizeY:"48px"})),r("div",{class:"family-tree__item__layout__text"},r("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?r("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},z=function(t){return t.map((t=>$(this,d,"m",T).call(this,t)))},O=function(){return r("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>B(this,C,t,"f")},this.data&&this.data.rows&&this.data.rows.length?$(this,d,"m",z).call(this,this.data.rows):r("div",null,$(this,x,"f").language.translate(h.EMPTY_DATA)))},D=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},L=function(t){B(this,v,t.clientX,"f"),B(this,g,t.clientY,"f"),$(this,C,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",$(this,w,"f")),document.removeEventListener("pointerup",e),$(this,C,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",$(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t){const e=[];for(;t&&t!==this.rootElement&&t!==document.body;)e.push(t),t=t.parentNode?t.parentNode:t.host;return e},A=function(t,e){let i,r;if(t)for(let e=t.length-1;e>=0;e--){const a=t[e];if(a.tagName)switch(a.classList.contains("family-tree__item__expand")&&(i=a),a.tagName.toUpperCase()){case"TD":r=a}}let a=null,l=null,o=null;return r&&(a=r["data-cell"],l=r["data-column"],o=r["data-row"]),{cell:a||null,column:l||null,expandButton:i||null,originalEvent:e,row:o||null,td:r||null}},F=function(t){return $(this,d,"m",A).call(this,$(this,d,"m",P).call(this,t.target),t)},R=function(t){return $(this,d,"m",A).call(this,$(this,d,"m",P).call(this,t.target),t)},X=function(t){return $(this,d,"m",A).call(this,$(this,d,"m",P).call(this,t.target),t)},Y=function(){$(this,b,"f").push(this.rootElement),$(this,x,"f").interact.on(this.rootElement,c.TAP,(t=>{if($(this,k,"f"))B(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];$(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",F).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",R).call(this,t)})}})),$(this,x,"f").interact.on(this.rootElement,c.DOUBLETAP,(t=>{switch(t.button){case 0:for(let t=0;t<$(this,y,"f").length;t++)clearTimeout($(this,y,"f")[t]),$(this,x,"f").debug.logMessage(this,"Cleared clickHandler timeout("+$(this,y,"f")[t]+").");B(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",X).call(this,t)})}})),$(this,x,"f").interact.on(this.rootElement,c.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||(B(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",R).call(this,t)}))}))},H=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat($(this,C,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let r=t.deltaY>0?e-i:e+i;r<i&&(r=i),$(this,C,"f").style.setProperty("--kup_familytree_scale",r.toFixed(2))}},N.style=':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{N as kup_family_tree}
|
|
1
|
+
import{r as t,c as e,f as i,h as r,H as a,g as l}from"./p-4fdb684f.js";import{F as o}from"./p-a992cf87.js";import{F as s}from"./p-6c77a36c.js";import{F as _}from"./p-ecac6269.js";import{k as n,g as m,s as f,l as h,R as c}from"./p-a740352c.js";import{c as u}from"./p-97e8ea42.js";var p;!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."}(p||(p={}));var d,y,k,v,g,x,b,w,j,C,E,T,W,M,S,z,D,L,O,P,R,A,F,X,Y,H,$=function(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)},B=function(t,e,i,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(t,i):a?a.value=i:e.set(t,i),i};const N=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),k.set(this,!1),v.set(this,0),g.set(this,0),x.set(this,[]),b.set(this,n()),w.set(this,(t=>{const e=t.clientX-$(this,v,"f"),i=t.clientY-$(this,g,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,B(this,v,t.clientX,"f"),B(this,g,t.clientY,"f")})),j.set(this,!1),C.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){$(this,b,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){$(this,b,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return m(this,p,t)}async refresh(){i(this)}async runAutofit(){const t=$(this,C,"f").clientWidth,e=$(this,C,"f").children[0].clientWidth,i=.01,r=.85*t,a=.95*t;let l=1,o=2e3,s=e;for(;(s<r||s>a)&&o>0&&l>i;)o--,s<r?l+=i:s>a?l-=i:o=0,s=e*l;$(this,C,"f").style.setProperty("--kup_familytree_scale",l<=1?l.toFixed(2):"1")}async setProps(t){f(this,p,t)}componentWillLoad(){$(this,b,"f").debug.logLoad(this,!1),$(this,b,"f").language.register(this),$(this,b,"f").theme.register(this)}componentDidLoad(){$(this,d,"m",Y).call(this),this.autofitOnLoad&&this.runAutofit(),$(this,b,"f").debug.logLoad(this,!0)}componentWillRender(){$(this,b,"f").debug.logRender(this,!1)}componentDidRender(){$(this,j,"f")&&(B(this,j,!1,"f"),this.runAutofit()),$(this,b,"f").debug.logRender(this,!0)}render(){return r(a,{onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),$(this,d,"m",O).call(this,t)},onWheel:t=>{$(this,d,"m",H).call(this,t)}},r("style",null,$(this,b,"f").theme.setKupStyle(this.rootElement)),r("div",{id:u},$(this,d,"m",D).call(this)))}disconnectedCallback(){$(this,b,"f").language.unregister(this),$(this,b,"f").theme.unregister(this)}get rootElement(){return l(this)}};y=new WeakMap,k=new WeakMap,v=new WeakMap,g=new WeakMap,x=new WeakMap,b=new WeakMap,w=new WeakMap,j=new WeakMap,C=new WeakMap,d=new WeakSet,E=function(t,e,i,a){const l=[];return l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},r("div",{class:"family-tree__line--placeholder"}))),l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||a&&!e}},r("div",{class:"family-tree__line--placeholder"}))),l},T=function t(e){var i;let a=null,l=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(l||(l=[]),l.push(t)):(a||(a=[]),a.push(t))})));const _=this.stackedLeaves&&a&&a.every((t=>!t.children||0==t.children.length)),n=a?2*a.length:1,m={"family-tree__line":!0,"family-tree__line--placeholder":!(!a&&!l),"family-tree__line--vertical":!(!a&&!l)},f={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},c=e.layout||this.layout||1,u={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:s.OUTLINED,title:`${$(this,b,"f").language.translate(h.EXPAND)}/${$(this,b,"f").language.translate(h.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&&B(this,j,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let p=null;$(this,d,"m",L).call(this,c)&&(p=r("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:f,cardData:this.cardData,layout:this.cardData?null:c,showSelection:!1}));const y=r("div",{class:"family-tree__item"},r("div",{class:"family-tree__item__wrapper"},$(this,d,"m",L).call(this,c)?p:$(this,d,"m",W).call(this,e,c),this.collapsible&&e.children&&e.children.length>0?r(o,Object.assign({},u)):void 0)),k={"--kup_familytree_staffchildren":(null==l?void 0:l.length.toString())||"0"};return r("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},r("tr",null,r("td",{"data-row":e,colSpan:n},y)),r("tr",null,r("td",{colSpan:n},r("div",{class:m}))),l?[r("tr",null,r("td",{colSpan:n},r("div",{class:Object.assign(Object.assign({},m),{"family-tree__line--staff":!0}),style:k}),r("div",{class:"family-tree__node__staff",style:k},l.map((e=>[r("div",{class:"family-tree__node__staff__item"},$(this,d,"m",t).call(this,e))])))))]:null,l&&a?[r("tr",null,r("td",{colSpan:n},r("div",{class:m})))]:null,a?[r("tr",null,_?r("td",{colSpan:n},r("div",{class:m})):a.map((t=>$(this,d,"m",E).call(this,0==a.indexOf(t),a.indexOf(t)==a.length-1,1==a.length,a.length>2)))),r("tr",null,_?r("td",{colSpan:n},a.map((e=>$(this,d,"m",t).call(this,e)))):a.map((e=>r("td",{colSpan:2},$(this,d,"m",t).call(this,e)))))]:void 0)},W=function(t,e){switch(e){case 2:return $(this,d,"m",S).call(this,t);default:return $(this,d,"m",M).call(this,t)}},M=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--1"},r("div",{class:"family-tree__item__layout__text__title"},t.value))},S=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--2"},r("div",{class:"family-tree__item__layout__color"}),r("div",{class:"family-tree__item__layout__image"},r(_,{resource:t.icon,sizeX:"48px",sizeY:"48px"})),r("div",{class:"family-tree__item__layout__text"},r("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?r("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},z=function(t){return t.map((t=>$(this,d,"m",T).call(this,t)))},D=function(){return r("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>B(this,C,t,"f")},this.data&&this.data.rows&&this.data.rows.length?$(this,d,"m",z).call(this,this.data.rows):r("div",null,$(this,b,"f").language.translate(h.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){B(this,v,t.clientX,"f"),B(this,g,t.clientY,"f"),$(this,C,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",$(this,w,"f")),document.removeEventListener("pointerup",e),$(this,C,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",$(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t){const e=[];for(;t&&t!==this.rootElement&&t!==document.body;)e.push(t),t=t.parentNode?t.parentNode:t.host;return e},R=function(t,e){let i,r;if(t)for(let e=t.length-1;e>=0;e--){const a=t[e];if(a.tagName)switch(a.classList.contains("family-tree__item__expand")&&(i=a),a.tagName.toUpperCase()){case"TD":r=a}}let a=null,l=null,o=null;return r&&(a=r["data-cell"],l=r["data-column"],o=r["data-row"]),{cell:a||null,column:l||null,expandButton:i||null,originalEvent:e,row:o||null,td:r||null}},A=function(t){return $(this,d,"m",R).call(this,$(this,d,"m",P).call(this,t.target),t)},F=function(t){return $(this,d,"m",R).call(this,$(this,d,"m",P).call(this,t.target),t)},X=function(t){return $(this,d,"m",R).call(this,$(this,d,"m",P).call(this,t.target),t)},Y=function(){$(this,x,"f").push(this.rootElement),$(this,b,"f").interact.on(this.rootElement,c.TAP,(t=>{if($(this,k,"f"))B(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];$(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",A).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",F).call(this,t)})}})),$(this,b,"f").interact.on(this.rootElement,c.DOUBLETAP,(t=>{switch(t.button){case 0:for(let t=0;t<$(this,y,"f").length;t++)clearTimeout($(this,y,"f")[t]),$(this,b,"f").debug.logMessage(this,"Cleared clickHandler timeout("+$(this,y,"f")[t]+").");B(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",X).call(this,t)})}})),$(this,b,"f").interact.on(this.rootElement,c.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||(B(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",F).call(this,t)}))}))},H=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat($(this,C,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let r=t.deltaY>0?e-i:e+i;r<i&&(r=i),$(this,C,"f").style.setProperty("--kup_familytree_scale",r.toFixed(2))}},N.style=':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{N as kup_family_tree}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,f as s,h as i,H as e,g as h}from"./p-4fdb684f.js";import{
|
|
1
|
+
import{r as t,f as s,h as i,H as e,g as h}from"./p-4fdb684f.js";import{k as o,d as n,g as r,s as a,W as l,l as c}from"./p-a740352c.js";import{c as d}from"./p-97e8ea42.js";import{F as p}from"./p-3cf97e3a.js";import"./p-23cd5a68.js";import"./p-61ff1761.js";import"./p-ecac6269.js";import"./p-395675b8.js";var m;!function(t){t.customStyle="Custom style of the component.",t.data="The data of the cell.",t.density="The density of the cell, defaults at 'dense' and can be also set to 'wide' or 'medium'.",t.dragEnabled="When set to true, the component is draggable."}(m||(m={}));const u=class{constructor(s){t(this,s),this.kupManager=o(),this.customStyle="",this.data=null,this.density=n.NONE,this.dragEnabled=!1}async addCssClasses(t){if(this.data.cssClass||(this.data.cssClass=""),t)for(let s=0;s<t.length;s++){const i=t[s];this.data.cssClass.indexOf(i)<0&&(this.data.cssClass+=` ${i}`)}this.refresh()}async getProps(t){return r(this,m,t)}async refresh(){s(this)}async removeCssClasses(t){if(this.data.cssClass){if(t)for(let s=0;s<t.length;s++){const i=t[s];this.data.cssClass.indexOf(i)>0&&(this.data.cssClass=this.data.cssClass.replace(new RegExp(i,"g"),""))}this.refresh()}}async setProps(t){a(this,m,t)}didRenderInteractables(){if(this.dragEnabled){const t=()=>({cell:this.data,column:this.generateColumn(),id:this.rootElement.id,multiple:!1,row:this.generateRow()});this.kupManager.interact.draggable(this.rootElement.shadowRoot.querySelector("#"+d),{cursorChecker:()=>null},{callback:t},l.BADGE)}}generateColumn(){return{name:this.data&&this.data.obj&&this.data.obj.t?this.data.obj.t+";"+this.data.obj.p:"KUPCELL",title:this.data&&this.data.obj&&this.data.obj.t?this.data.obj.t+";"+this.data.obj.p:this.kupManager.language.translate(c.EMPTY_OBJECT)}}generateRow(){const t=this.generateColumn(),s={cells:{}};return s.cells[t.name]=this.data,s}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.didRenderInteractables(),this.kupManager.debug.logRender(this,!0)}render(){const t={cell:this.data,column:this.generateColumn(),component:this,density:this.density,editable:this.data.isEditable,renderKup:!0,row:this.generateRow()};return i(e,null,i("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),i("div",{id:d},i(p,Object.assign({},t))))}disconnectedCallback(){this.kupManager.dates.unregister(this),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return h(this)}};u.style=":host{display:block;height:100%;width:100%}#kup-component{height:100%;width:100%}";export{u as kup_cell}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e,J as t,H as l,C as n,af as r,u as i,y as o,ag as s,ah as a,N as u,ai as c,f,aj as h,a3 as d,ak as p,q as b,l as m}from"./p-a740352c.js";import{h as v}from"./p-4fdb684f.js";import{F}from"./p-a992cf87.js";import{F as x}from"./p-6c77a36c.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,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 g;!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.removableColumns="Sets the possibility to remove the selected column.",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.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."}(g||(g={}));const k="TREE_COLUMN";var T;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(T||(T={}));const y=document.documentElement,C=y.ketchup?y.ketchup.objects:new o,j=y.ketchup?y.ketchup.data:new s;class V 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 w),!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(C.isNumber(r.obj)||C.isDate(r.obj)||C.isTime(r.obj)||C.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let p=s.getCheckBoxFilterValues(t,n);if(0==p.length)continue;let b=!1;for(let e=0;e<p.length;e++){let t=p[e];if(null!=t&&null!=t.value){if(null!=r.value&&r.value.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}}}if(!b)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 w);for(let r=0;r<n.length;r++){let o=n[r],s=null;if(s="TREE_COLUMN"===o?{name:"TREE_COLUMN",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];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 w);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 I(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:d.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=I(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=M(e,n,t[l]);if(0!==r)return r}return 0}return M(e,n,t[0])}))}function M(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 _(e=[],t={},l="",n=[],r,i){return null==i&&(i=new V),i.filterRows(e,t,l,n,r)}function N(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 f={};return t.forEach((t=>{const l=s[0].column,h=t.cells[l];if(h){const d=i(e,l),p=r(d,h),b=h.value;let m=null;for(let e of a)if(e.group.label===p){m=e;break}null===m&&(m={group:{id:b,parent:null,column:l,columnLabel:o[l],expanded:!1,label:p,children:[],obj:h.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}},L(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=O.ketchup.math.numberify(e.group.totals[r]||0),o=l.cells[r];if(o){let l=O.ketchup.objects.isNumber(o.obj);const s=t[r];switch(s){case u.COUNT:e.group.totals[r]=i+1;let t=e.group.parent;for(;null!=t;)t.group.totals[r]=(t.group.totals[r]||0)+1,t=t.group.parent;break;case u.DISTINCT:let a;if(a=l?O.ketchup.math.numberify(c(o.value)):o.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 f=e.group.parent;for(;null!=f;){if(n[f.group.id]){let e=n[f.group.id][r];e?e.push(a):(n[f.group.id][r]=[],n[f.group.id][r].push(a))}else n[f.group.id]={},n[f.group.id][r]=[],n[f.group.id][r].push(a);f=f.group.parent}break;case u.SUM:case u.AVERAGE:if(l){const t=O.ketchup.math.numberify(c(o.value));e.group.totals[r]=t+i;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){const t=e.group.totals[r],l=O.ketchup.math.numberify(c(o.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(O.ketchup.objects.isDate(o.obj)){const t=o.obj?O.ketchup.objects.parseDate(o.obj):O.ketchup.dates.toDayjs(o.value);if(O.ketchup.dates.isValid(t)){const l=O.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(O.ketchup.dates.format(n)),e.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.min(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(O.ketchup.dates.format(e)),i.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.min(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;case u.MAX:if(l){const t=e.group.totals[r],l=O.ketchup.math.numberify(c(o.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(O.ketchup.objects.isDate(o.obj)){const t=o.obj?O.ketchup.objects.parseDate(o.obj):O.ketchup.dates.toDayjs(o.value);if(O.ketchup.dates.isValid(t)){const l=O.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(O.ketchup.dates.format(n)),e.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.max(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(O.ketchup.dates.format(e)),i.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.max(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;default:0!=s.indexOf(u.MATH)&&console.warn(`invalid total mode: ${s}`)}}}))}(m,n,t,f)}})),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=>W(e,r,l)))}(a,n,f),E(a,u.AVERAGE,n),E(a,u.MATH,n),a}function E(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 W(e,t,l){const n=e.group.children;0!==n.length&&(n[0].group&&n.forEach((e=>{W(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]=O.ketchup.math.numberify(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 B(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 D(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(c(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(c(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);const e=O.ketchup.dates.toDayjs(a.value);if(O.ketchup.dates.isValid(e)){const r=O.ketchup.dates.toDate(e),i=n[l]?O.ketchup.dates.toDate(O.ketchup.dates.toDayjs(n[l])):null;switch(!0){case t[l]===u.MIN:if(i){let e=[];e.push(r),e.push(i),n[l]=O.ketchup.dates.format(O.ketchup.dates.min(e),f.ISO_DATE)}else n[l]=O.ketchup.dates.format(r,f.ISO_DATE);break;case t[l]===u.MAX:if(i){let e=[];e.push(r),e.push(i),n[l]=O.ketchup.dates.format(O.ketchup.dates.max(e),f.ISO_DATE)}else n[l]=O.ketchup.dates.format(r,f.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]):h(n[i])&&(n[i]=+n[i].toFixed(2)))}return n}function L(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,t,l,n){const r=t*l-l,i=r+Number(l);if(0==n)return e.slice(r,i);let o=[];return R(e,o,r,Number(l),0),o}function R(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=R(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:U(e.group),readOnly:e.readOnly,cssClass:e.cssClass}}function q(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 U(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:q(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}var z;!function(e){e.SIMPLE="simple",e.FULL="full"}(z||(z={}));const H=document.documentElement,J=e=>{const t=Math.ceil(e.max/e.perPage),l=function(e,t){const l=[];for(let n=1;n<=t;n++){const t=n==e.currentPage;l.push({id:n.toString(),selected:t,value:n.toString()})}return l}(e,t),n=function(e){const t=[];let l=e.perPage;if(0===l)return t;for(;l<e.max;){const n=l==e.perPage;t.push({id:l.toString(),selected:n,value:l.toString()}),l*=2}const n=e.max==e.perPage;return t.push({id:e.max.toString(),selected:n,value:e.max.toString()}),t}(e),r={"kup-list":{data:l},"kup-text-field":{label:H.ketchup.language.translate(p.PAGE),helper:H.ketchup.language.translate(p.TOTAL)+`: ${t}`,helperWhenFocused:!0,inputType:"number",max:t,min:1}},i={"kup-list":{data:n},"kup-text-field":{label:H.ketchup.language.translate(b.ROWS)+" / "+H.ketchup.language.translate(p.PAGE),helper:H.ketchup.language.translate(b.TOTAL)+`: ${e.max}`,helperWhenFocused:!0,inputType:"number",max:e.max,min:1}};return v("div",Object.assign({class:`f-paginator ${e.mode?e.mode:""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),e.mode!==z.SIMPLE?v(F,{icon:"chevron_left",disabled:G(e),onClick:e.onPrevPage,wrapperClass:"prev-page"}):null,v("kup-combobox",{class:"page-selector",data:r,initialValue:e.currentPage.toString(),"onkup-combobox-change":e.onPageChange}),e.mode!==z.SIMPLE?v(F,{icon:"chevron_right",disabled:K(e),onClick:e.onNextPage,wrapperClass:"next-page"}):null,v("kup-combobox",{class:"rows-selector",data:i,initialValue:e.perPage.toString(),"onkup-combobox-change":e.onRowsChange}),e.onLoadMore?v(F,{icon:"plus",onClick:e.onLoadMore,label:H.ketchup.language.translate(m.LOAD_MORE),styling:x.FLAT,wrapperClass:"load-more-button"}):null)};function K(e){return e.currentPage*e.perPage>=e.max}function G(e){return 1==e.currentPage}function P(e,t,l){if(h(e)){const n=Math.ceil(t/l);let r=e;return r>n&&(r=n),r<1&&(r=1),r}return null}function Q(e,t){if(h(e)){let l=e;return l>t&&(l=t),l<1&&(l=1),l}return null}export{w as F,T as K,V as a,J as b,D as c,P as d,g as e,_ as f,N as g,z as h,B as n,$ as p,Q as r,I as s,k as t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,f as i,h as s,H as e,g as o}from"./p-4fdb684f.js";import{k as a,g as c,s as n,l as r,c as h,ax as l,
|
|
1
|
+
import{r as t,f as i,h as s,H as e,g as o}from"./p-4fdb684f.js";import{k as a,g as c,s as n,l as r,c as h,ax as l,U as u,ay as p,Y as d,b}from"./p-a740352c.js";import{F as m}from"./p-6c77a36c.js";import{F as k}from"./p-ecac6269.js";import{c as g}from"./p-97e8ea42.js";var f,x;!function(t){t.customStyle="Custom style of the component.",t.data="Sets the data that will be used to display different components."}(f||(f={})),function(t){t.BOX="Box",t.BUTTON_LIST="Button List",t.CHART="Chart",t.CHIP="Chip",t.ECHART="Echart",t.DATATABLE="Datatable",t.JSON="JSON",t.TREE="Tree"}(x||(x={}));const y=class{constructor(i){t(this,i),this.dragHandler=null,this.kupManager=a(),this.textArea=null,this.wrapperRef=null,this.display=x.DATATABLE,this.customStyle="",this.data=null}async getProps(t){return c(this,f,t)}async refresh(){i(this)}async setProps(t){n(this,f,t)}comboboxProps(){const t=[];for(const i in x)Object.prototype.hasOwnProperty.call(x,i)&&t.push({id:x[i],selected:!1,value:x[i]});return{data:{"kup-list":{data:t,id:"kup-debug-theme-changer-list"},"kup-text-field":{emitSubmitEventOnEnter:!1,inputType:"text",label:this.kupManager.language.translate(r.VIEW_AS)}},id:"comp-switcher",initialValue:this.display,isSelect:!0,"onKup-combobox-itemclick":t=>{this.display=t.detail.value}}}setContent(){const t=!!(this.data&&this.data.columns&&this.data.columns.length>0),i=[],e={};if(this.display===x.JSON)e.initialValue=this.data?JSON.stringify(this.data,null,2):"",e.textArea=!0,i.push(s("kup-text-field",Object.assign({class:"kup-full-width kup-full-height"},e,{ref:t=>this.textArea=t,"onkup-textfield-input":t=>{try{this.data=JSON.parse(t.detail.value)}catch(t){this.data={columns:[{name:"ERROR",title:"Error"}],rows:[{cells:{ERROR:{value:"Invalid JSON:"+t}}}]}}}})));else if(t)switch(this.display){case x.BOX:e.data=this.data,i.push(s("kup-box",Object.assign({},e)));break;case x.BUTTON_LIST:e.data=this.data,i.push(s("kup-button-list",Object.assign({},e)));break;case x.CHIP:e.data=this.data,i.push(s("kup-chip",Object.assign({},e)));break;case x.CHART:case x.ECHART:e.data=this.data,e.series=[],e.axis=null;for(let t=0;t<this.data.columns.length;t++){const i=this.data.columns[t];i.obj&&this.kupManager.objects.isNumber(i.obj)||null!==e.axis?e.series.push(this.display===x.CHART?{code:i.name,decode:i.title}:i.name):e.axis=i.name}0===e.series.length&&this.kupManager.debug.logMessage(this,"Not enough numerical columns to display a chart!",h.WARNING),e.axis||this.kupManager.debug.logMessage(this,"No axis for the chart!",h.WARNING),i.push(s(this.display===x.CHART?"kup-chart":"kup-echart",Object.assign({},e)));break;case x.DATATABLE:e.data=this.data,e.autoFillMissingCells=!0,i.push(s("kup-data-table",Object.assign({},e)));break;case x.TREE:e.data=this.data,i.push(s("kup-tree",Object.assign({class:"kup-full-width"},e)));break;default:return void this.kupManager.debug.logMessage(this,"Display mode not supported ("+this.display+")!",h.ERROR)}else i.push(s("div",{class:"empty"},s(k,{sizeY:"100px",resource:"move_to_inbox"}),s("div",{class:"empty-text"},this.kupManager.language.translate(r.DROP_YOUR_DATA))));return i}updateData(t){{const i=Object.assign({},this.data),s=t.detail.sourceElement&&t.detail.sourceElement.column?t.detail.sourceElement.column:null,e=t.detail.sourceElement&&t.detail.sourceElement.row?t.detail.sourceElement.row:null;if(s&&s.name?i.columns?this.data.columns.find((t=>t.name===s.name))||i.columns.push(s):i.columns=[s]:this.kupManager.debug.logMessage(this,"Invalid column received.",h.WARNING),e&&(i.rows?i.rows.push(e):i.rows=[e]),this.data=i,this.data&&this.textArea)try{this.textArea.setValue(JSON.stringify(this.data,null,2))}catch(t){this.textArea.setValue("Invalid JSON:"+t)}}}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.rootElement.addEventListener(l,(t=>this.updateData(t))),this.dragHandler=this.rootElement.shadowRoot.querySelector("#drag-handle"),this.kupManager.interact.dialogify(this.rootElement,this.dragHandler),this.kupManager.interact.dropzone(this.wrapperRef,{accept:`[${u}],[${p}]`},{dispatcher:this.rootElement,type:d.MAGICBOX}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){return s(e,null,s("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),s("div",{id:g},s("div",{class:"magic-box-wrapper"},s("div",{class:"actions",id:"drag-handle"},s("kup-combobox",Object.assign({},this.comboboxProps())),s("kup-button",{styling:m.FLAT,icon:"delete",label:"Reset","onkup-button-click":()=>{this.data=null}}),s("kup-button",{id:"close-dialog",customStyle:`:host{${b.PRIMARY}: var(${b.TITLE});}`,icon:"clear","onkup-button-click":()=>{this.kupManager.hideMagicBox()}})),s("div",{class:"content",ref:t=>this.wrapperRef=t},this.setContent()))))}disconnectedCallback(){this.kupManager.interact.unregister([this.rootElement,this.wrapperRef]),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return o(this)}};y.style=":host{background-color:var(--kup-background-color);color:var(--kup-text-color);display:block;height:300px;min-width:700px;width:700px}#kup-component,.magic-box-wrapper{height:100%;width:100%}.magic-box-wrapper{border:3px dashed var(--kup-border-color);box-sizing:border-box;display:flex;flex-direction:column}.actions{align-items:center;background-color:var(--kup-title-background-color);display:inline-flex;height:52px;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1}.actions kup-button{margin:0.5em}.actions #comp-switcher{margin:auto 0}.actions #close-dialog{position:absolute;margin:0;top:0;right:0;background-color:var(--kup-title-background-color)}.content{box-sizing:border-box;height:100%;margin-top:52px;overflow:auto;transition:background-color 125ms ease}.empty{flex-direction:column;display:flex;text-align:center;justify-content:center;height:100%;width:100%;opacity:0.5;transition:opacity 0.25s ease-out}.empty .f-image{margin:0}.json{font-family:var(--kup-font-family-monospace);margin:0}[kup-drag-over]{background-color:rgba(var(--kup-success-color-rgb), 0.25)}";export{y as kup_magic_box}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,f as h,h as i,H as s,g as a}from"./p-4fdb684f.js";import{k as o,g as n,s as l}from"./p-
|
|
1
|
+
import{r as t,c as e,f as h,h as i,H as s,g as a}from"./p-4fdb684f.js";import{k as o,g as n,s as l}from"./p-a740352c.js";import{c as p}from"./p-97e8ea42.js";var r,c;!function(t){t.componentName="Sets the tag name of the component to be lazy loaded.",t.customStyle="Custom style of the component.",t.data="Sets the data of the component to be lazy loaded.",t.showPlaceholder="Displays an animated SVG placeholder until the component is loaded."}(r||(r={})),function(t){t.VIEWPORT="viewport",t.PROPS="props",t.BOTH="both"}(c||(c={}));const d=class{constructor(h){t(this,h),this.kupLazyLoaded=e(this,"kup-lazy-loaded",6),this.intObserver=null,this.kupManager=o(),this.lazyComponent=null,this.lazyComponentLoaded=!1,this.isInViewport=!1,this.componentName=null,this.customStyle="",this.data=null,this.renderMode=c.BOTH,this.showPlaceholder=!0}async getProps(t){return n(this,r,t)}async getComponent(){return this.lazyComponent}async refresh(){h(this)}async setProps(t){l(this,r,t)}setObserver(){this.intObserver=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.kupManager.debug.logMessage(this,"kup-lazy entering the viewport, rendering "+this.componentName+"."),this.isInViewport=!0,this.intObserver.unobserve(this.rootElement))}))}),{threshold:.25})}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this),this.setObserver()}componentDidLoad(){this.intObserver.observe(this.rootElement),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.lazyComponent&&!this.lazyComponentLoaded&&(this.lazyComponentLoaded=!0,this.kupLazyLoaded.emit({comp:this,id:this.rootElement.id})),this.kupManager.debug.logRender(this,!0)}render(){let t,e,h=this.componentName;switch(this.componentName){case"kup-button":e=i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{d:"M42 6H6c-2.2 0-4 1.8-4 4v28c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4V10c0-2.2-1.8-4-4-4zm0 32H6v-6h36v6z"}));break;case"kup-card":e=i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{d:"M44 26H28v-4h16v4zm0-12H28v4h16v-4zM28 34h16v-4H28v4zm-4-16v12c0 2.2-1.8 4-4 4H8c-2.2 0-4-1.8-4-4V18c0-2.2 1.8-4 4-4h12c2.2 0 4 1.8 4 4zm-3 12l-4.5-6-3.5 4.51-2.5-3.01L7 30h14z"}));break;case"kup-checkbox":e=i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{d:"M38 10v28H10V10h28m0-4H10c-2.21 0-4 1.79-4 4v28c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4z"}));break;case"kup-chart":e=i("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",viewBox:"0 0 24 24"},i("path",{d:"M22,21H2V3H4V19H6V10H10V19H12V6H16V19H18V14H22V21Z"}));break;case"kup-data-table":e=i("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",viewBox:"0 0 24 24"},i("path",{d:"M4,3H20A2,2 0 0,1 22,5V20A2,2 0 0,1 20,22H4A2,2 0 0,1 2,20V5A2,2 0 0,1 4,3M4,7V10H8V7H4M10,7V10H14V7H10M20,10V7H16V10H20M4,12V15H8V12H4M4,20H8V17H4V20M10,12V15H14V12H10M10,20H14V17H10V20M20,20V17H16V20H20M20,12H16V15H20V12Z"}));break;case"kup-image":e=i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{d:"M42 38V10c0-2.21-1.79-4-4-4H10c-2.21 0-4 1.79-4 4v28c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4zM17 27l5 6.01L29 24l9 12H10l7-9z"}));break;case"kup-progress-bar":e=i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{d:"M39 19c-2.05 0-3.81 1.23-4.58 3h-5.84c-.77-1.77-2.53-3-4.58-3s-3.81 1.23-4.58 3h-5.84c-.77-1.77-2.53-3-4.58-3-2.77 0-5 2.23-5 5s2.23 5 5 5c2.05 0 3.81-1.23 4.58-3h5.84c.77 1.77 2.53 3 4.58 3s3.81-1.23 4.58-3h5.84c.77 1.77 2.53 3 4.58 3 2.77 0 5-2.23 5-5s-2.23-5-5-5z"}));break;case"kup-radio":e=i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{d:"M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.84 0-16-7.16-16-16S15.16 8 24 8s16 7.16 16 16-7.16 16-16 16z"}));break;default:e=i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{d:"M44 26H28v-4h16v4zm0-12H28v4h16v-4zM28 34h16v-4H28v4zm-4-16v12c0 2.2-1.8 4-4 4H8c-2.2 0-4-1.8-4-4V18c0-2.2 1.8-4 4-4h12c2.2 0 4 1.8 4 4zm-3 12l-4.5-6-3.5 4.51-2.5-3.01L7 30h14z"}))}return this.renderMode===c.VIEWPORT&&this.isInViewport||this.renderMode===c.PROPS&&this.data||this.renderMode===c.BOTH&&this.data&&this.isInViewport?(t=i(this.componentName,Object.assign({},this.data,{ref:t=>this.lazyComponent=t})),h+=" kup-loaded"):this.showPlaceholder&&(t=e,h+=" kup-to-be-loaded"),i(s,{class:h},i("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),i("div",{id:p},t))}disconnectedCallback(){var t;this.kupManager.theme.unregister(this),null===(t=this.intObserver)||void 0===t||t.unobserve(this.rootElement)}get rootElement(){return a(this)}};d.style=":host{--kup_lazy_animation_time:var(--kup-lazy-animation-time, 2s);--kup_lazy_hor_alignment:var(--kup-lazy-hor-alignment, center);--kup_lazy_placeholder_color:var(\n --kup-lazy-placeholder-color,\n var(--kup-icon-color)\n );--kup_lazy_height:var(--kup-lazy-height, 100%);--kup_lazy_ver_alignment:var(--kup-lazy-ver-alignment, center);--kup_lazy_width:var(--kup-lazy-width, 100%);display:block;height:var(--kup_lazy_height);width:var(--kup_lazy_width);position:relative}#kup-component{align-items:var(--kup_lazy_ver_alignment);display:flex;justify-content:var(--kup_lazy_hor_alignment);height:var(--kup_lazy_height);width:var(--kup_lazy_width)}#kup-component>*{height:var(--kup_lazy_height)}#kup-component kup-data-table{min-width:100%}.kup-loaded,.kup-to-be-loaded{height:var(--kup_lazy_height);width:var(--kup_lazy_width)}svg{fill:var(--kup_lazy_placeholder_color);animation:shine ease var(--kup_lazy_animation_time) infinite}@keyframes shine{0%{opacity:0.4}50%{opacity:0.8}100%{opacity:0.4}}:host(.kup-bottom-aligned){--kup-lazy-ver-alignment:flex-end}:host(.kup-left-aligned){--kup-lazy-hor-alignment:flex-start}:host(.kup-right-aligned){--kup-lazy-hor-alignment:flex-end}:host(.kup-top-aligned){--kup-lazy-ver-alignment:flex-start}:host(.kup-to-be-loaded) #kup-component{position:absolute}:host(.kup-to-be-loaded) #kup-component>*{margin:auto}";export{d as kup_lazy}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as t,f as e,h as a,H as s,g as r}from"./p-4fdb684f.js";import{k as o,g as n,s as l,l as p,d as m}from"./p-a740352c.js";import{c}from"./p-97e8ea42.js";import{F as h}from"./p-ecac6269.js";import{F as g}from"./p-a992cf87.js";import{F as _}from"./p-6c77a36c.js";import{F as u}from"./p-3cf97e3a.js";import{M as d}from"./p-81605f08.js";import"./p-23cd5a68.js";import"./p-61ff1761.js";import"./p-395675b8.js";import"./p-79b0730b.js";var f;!function(i){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."}(f||(f={}));class k{constructor(){this.load=!1}toDebugString(){return"image-list state"}}var b,v,w,y,x,j,C,M=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)};const W=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 k,this.kupManager=o(),v.set(this,[]),w.set(this,o()),y.set(this,{icon:"arrow_back",onClick:()=>{this.currentNode=M(this,w,"f").data.node.getParent(this.data,this.currentNode),this.currentNode||(this.navigationBarToggled=!1)},styling:_.FLAT,wrapperClass:"navigation-bar__back"}),x.set(this,{icon:"arrow_upward",onClick:()=>{this.currentNode=null,this.navigationBarToggled=!1},styling:_.FLAT,wrapperClass:"navigation-bar__top"}),this.currentNode=null,this.navigationBarToggled=!1,this.customStyle="",this.data=[],this.ripple=!0,this.selectedNode=[],this.stateId="",this.store=void 0}initWithPersistedState(){if(this.store&&this.stateId){const i=this.store.getState(this.stateId);null!=i&&(this.currentNode=this.kupManager.data.node.findByStrTreeNodePath(this.data,i.selectedTreeNodePath))}}persistState(){if(this.store&&this.stateId){let i=!1,t=this.currentNode?this.currentNode.id:"";if(this.kupManager.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)}}onKupClick(i){i.children&&i.children.length>0&&(this.currentNode=i),this.kupClick.emit({comp:this,id:this.rootElement.id,node:i})}onKupContextMenu(i,t){i.preventDefault(),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,node:t})}onKupDblClick(i){for(let i=0;i<M(this,v,"f").length;i++)clearTimeout(M(this,v,"f")[i]);(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");"a"===a?s.call(i,e):s?s.value=e:t.set(i,e)})(this,v,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,node:i})}selectNode(i){i&&0!=i.length&&(this.currentNode=this.kupManager.data.node.find(this.data,i))}async getProps(i){return n(this,f,i)}async refresh(){e(this)}async setProps(i){l(this,f,i)}componentWillLoad(){M(this,w,"f").debug.logLoad(this,!1),M(this,w,"f").language.register(this),M(this,w,"f").theme.register(this)}componentDidLoad(){M(this,w,"f").debug.logLoad(this,!0)}componentWillRender(){M(this,w,"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++)d.attachTo(t[i])}this.persistState(),M(this,w,"f").debug.logRender(this,!0)}render(){const i=!!this.currentNode;return a(s,null,a("style",null,M(this,w,"f").theme.setKupStyle(this.rootElement)),a("div",{id:c},a("div",{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(h,{fit:!0,resource:this.currentNode.icon,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({},M(this,y,"f"),{label:M(this,w,"f").language.translate(p.BACK)})),a(g,Object.assign({},M(this,x,"f"),{label:M(this,w,"f").language.translate(p.TOP)}))):null),a("div",{class:"image-list"},...M(this,b,"m",C).call(this))))}disconnectedCallback(){M(this,w,"f").language.unregister(this),M(this,w,"f").theme.unregister(this)}get rootElement(){return r(this)}static get watchers(){return{selectedNode:["selectNode"]}}};v=new WeakMap,w=new WeakMap,y=new WeakMap,x=new WeakMap,b=new WeakSet,j=function(i){const t=a(h,Object.assign({},{fit:!0,resource:i.icon,title:i.title,wrapperClass:"image-list__image"})),e=a("div",{class:"image-list__label"},i.value);return a(u,{cell:{value:i.value,icon:i.icon,obj:i.obj},column:{name:"IMAGE",title:"Image"},component:this,density:m.NONE,row:Object.assign({},i)},a("div",{class:"image-list__wrapper"},t,e))},C=function(){const i=[],t=this.currentNode?this.currentNode.children:this.data;for(let e=0;t&&e<t.length;e++){const s=t[e],r=a("div",{onClick:()=>{M(this,v,"f").push(setTimeout((()=>this.onKupClick(s)),300))},onContextMenu:i=>this.onKupContextMenu(i,s),onDblClick:()=>this.onKupDblClick(s),class:{"image-list__item":!0,"mdc-ripple-surface":!!this.ripple}},M(this,b,"m",j).call(this,s));i.push(r)}return i},W.style=":host{--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, 0.5em);--kup_imagelist_image_margin:var(--kup-imagelist-image-margin, 1em auto);--kup_imagelist_image_min_height:var(--kup-imagelist-image-min-height, 64px);--kup_imagelist_item_border_radius:var(\n --kup-imagelist-item-border-radius,\n 8px\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-color)\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{font-size:1.2em;font-weight:bold;letter-spacing:0.12em;overflow:hidden;padding:0 0.5em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.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, 4), minmax(0px, 1fr));margin-top:1em;width:100%}.image-list .f-cell{height:100%;width:100%}.image-list__item{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__image.f-image{margin:var(--kup_imagelist_image_margin)}.image-list__image.f-image .f-image__icon{min-height:var(--kup_imagelist_image_min_height)}.image-list__label{color:var(--kup_imagelist_text_color);letter-spacing:0.12em;margin:var(--kup_imagelist_label_margin);overflow:hidden;text-align:center;text-overflow:ellipsis}.image-list .mdc-ripple-surface{--mdc-ripple-fg-opacity:0.24}.image-list .mdc-ripple-surface:before,.image-list .mdc-ripple-surface:after{background-color:var(--kup_imagelist_primary_color)}: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{W as kup_image_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,f as s,h as i,H as e,g as h}from"./p-4fdb684f.js";import{k as o}from"./p-
|
|
1
|
+
import{r as t,f as s,h as i,H as e,g as h}from"./p-4fdb684f.js";import{k as o}from"./p-a740352c.js";import{c as l}from"./p-97e8ea42.js";const n=class{constructor(s){t(this,s),this.kupManager=o(),this.startTime=performance.now(),this.featuresStartTime=null,this.endTime=null,this.content=null,this.customStyle="",this.features={debug:!1,language:!1,longCycleProp:!1,longCycleVar:!1,objects:!1,objectsFunction:!1,theme:!1}}async printLifecycleTime(){const t=this.endTime-this.featuresStartTime,s=this.endTime-this.startTime;return this.content="Full lifecycle of this probe ("+this.rootElement.tagName+"#"+this.rootElement.id+") took "+s+"ms, while features took "+t+"ms.",{id:this.rootElement.id,fullTime:s,featuresTime:t}}async refresh(){s(this)}longCycleProp(){}longCycleVar(){}longCycleObjects(){for(let t=0;t<1e6;t++)this.kupManager.objects.isNumber({t:"NR",p:"",k:""})}longCycleObjectsFunction(){}componentWillLoad(){this.featuresStartTime=performance.now(),this.features.debug&&this.kupManager.debug.logLoad(this,!1),this.features.language&&this.kupManager.language.register(this),this.features.longCycleProp&&this.longCycleProp(),this.features.longCycleVar&&this.longCycleVar(),this.features.objects&&this.longCycleObjects(),this.features.objectsFunction&&this.longCycleObjectsFunction(),this.features.theme&&this.kupManager.theme.register(this)}componentDidLoad(){this.features.debug&&this.kupManager.debug.logLoad(this,!0),this.endTime=performance.now()}componentWillRender(){this.features.debug&&this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.features.debug&&this.kupManager.debug.logRender(this,!0)}render(){let t=null;return this.features.theme&&(t=this.kupManager.theme.setKupStyle(this.rootElement)),i(e,null,t?i("style",null,t):null,i("div",{id:l},this.content))}disconnectedCallback(){this.features.language&&this.kupManager.language.unregister(this),this.features.theme&&this.kupManager.theme.unregister(this)}get rootElement(){return h(this)}};export{n as kup_probe}
|