@sme.up/ketchup 6.2.0 → 6.3.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-5b69d882.js → f-button-94cb5f35.js} +2 -2
- package/dist/cjs/{f-cell-3a740c48.js → f-cell-76830a0d.js} +12 -14
- package/dist/cjs/{f-checkbox-57443ca3.js → f-checkbox-cd977193.js} +1 -1
- package/dist/cjs/{f-chip-02e83f82.js → f-chip-68d45fd3.js} +3 -3
- package/dist/cjs/{f-image-2a61ece2.js → f-image-0e71df7e.js} +2 -2
- package/dist/cjs/{f-paginator-utils-09126bdd.js → f-paginator-utils-46689c0a.js} +80 -403
- package/dist/cjs/{f-text-field-9ee20a67.js → f-text-field-b4229cef.js} +11 -3
- package/dist/cjs/{index-06b131ea.js → index-31125378.js} +9 -4
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +5 -6
- package/dist/cjs/kup-autocomplete_25.cjs.entry.js +116 -111
- package/dist/cjs/kup-box.cjs.entry.js +15 -17
- package/dist/cjs/kup-calendar.cjs.entry.js +9 -11
- package/dist/cjs/kup-cell.cjs.entry.js +9 -11
- package/dist/cjs/kup-dash-list.cjs.entry.js +5 -7
- package/dist/cjs/kup-dash_2.cjs.entry.js +4 -5
- package/dist/cjs/kup-dashboard.cjs.entry.js +76 -17
- package/dist/cjs/kup-drawer.cjs.entry.js +4 -5
- package/dist/cjs/kup-echart.cjs.entry.js +17 -19
- package/dist/cjs/kup-family-tree.cjs.entry.js +140 -64
- package/dist/cjs/kup-form.cjs.entry.js +10 -12
- package/dist/cjs/kup-iframe.cjs.entry.js +4 -5
- package/dist/cjs/kup-image-list.cjs.entry.js +10 -12
- package/dist/cjs/kup-lazy.cjs.entry.js +4 -5
- package/dist/cjs/kup-magic-box.cjs.entry.js +5 -6
- package/dist/cjs/{kup-manager-02acbb37.js → kup-manager-7c514a30.js} +1400 -369
- package/dist/cjs/kup-nav-bar.cjs.entry.js +4 -5
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
- package/dist/cjs/kup-photo-frame.cjs.entry.js +4 -5
- package/dist/cjs/kup-probe.cjs.entry.js +2 -2
- package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
- package/dist/cjs/kup-snackbar.cjs.entry.js +6 -7
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/assets/dashboard.js +48 -0
- package/dist/collection/assets/family-tree.js +236 -19
- package/dist/collection/assets/index.js +4 -0
- package/dist/collection/assets/kupinteract.js +68 -0
- package/dist/collection/collection-manifest.json +5 -5
- package/dist/collection/components/kup-dashboard/kup-dashboard.css +7 -0
- package/dist/collection/components/kup-dashboard/kup-dashboard.js +67 -7
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +42 -30
- package/dist/collection/components/kup-echart/kup-echart.js +9 -9
- package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +3 -1
- package/dist/collection/components/kup-family-tree/kup-family-tree.css +79 -9
- package/dist/collection/components/kup-family-tree/kup-family-tree.js +253 -65
- package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
- package/dist/collection/components/kup-text-field/kup-text-field.js +27 -0
- package/dist/collection/f-components/f-text-field/f-text-field.js +9 -1
- package/dist/collection/managers/kup-data/kup-data-cell-helper.js +48 -15
- package/dist/collection/managers/kup-data/kup-data.js +5 -5
- package/dist/collection/managers/kup-interact/kup-interact.js +3 -5
- package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.js +2 -0
- package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover.js +131 -45
- package/dist/collection/utils/filters/filters-rows.js +4 -23
- package/dist/collection/utils/filters/filters-tree-items.js +2 -1
- package/dist/esm/{f-button-fd44ef70.js → f-button-cd948e50.js} +2 -2
- package/dist/esm/{f-cell-7b159a22.js → f-cell-474dd282.js} +6 -8
- package/dist/esm/{f-checkbox-c51c4a75.js → f-checkbox-e06cf07b.js} +1 -1
- package/dist/esm/{f-chip-c2e4c522.js → f-chip-d6f2eb94.js} +3 -3
- package/dist/esm/{f-image-2ab4b9aa.js → f-image-914a03ef.js} +2 -2
- package/dist/esm/{f-paginator-utils-ef537d82.js → f-paginator-utils-a4a52732.js} +44 -366
- package/dist/esm/{f-text-field-41c575eb.js → f-text-field-76341fe3.js} +11 -3
- package/dist/esm/{index-ad6ab214.js → index-e41330a5.js} +9 -4
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +3 -4
- package/dist/esm/kup-autocomplete_25.entry.js +17 -12
- package/dist/esm/kup-box.entry.js +9 -11
- package/dist/esm/kup-calendar.entry.js +5 -7
- package/dist/esm/kup-cell.entry.js +7 -9
- package/dist/esm/kup-dash-list.entry.js +2 -4
- package/dist/esm/kup-dash_2.entry.js +2 -3
- package/dist/esm/kup-dashboard.entry.js +74 -15
- package/dist/esm/kup-drawer.entry.js +2 -3
- package/dist/esm/kup-echart.entry.js +11 -13
- package/dist/esm/kup-family-tree.entry.js +138 -62
- package/dist/esm/kup-form.entry.js +7 -9
- package/dist/esm/kup-iframe.entry.js +2 -3
- package/dist/esm/kup-image-list.entry.js +8 -10
- package/dist/esm/kup-lazy.entry.js +2 -3
- package/dist/esm/kup-magic-box.entry.js +3 -4
- package/dist/esm/{kup-manager-22a475e6.js → kup-manager-86f440c7.js} +1379 -370
- package/dist/esm/kup-nav-bar.entry.js +2 -3
- package/dist/esm/kup-numeric-picker.entry.js +3 -3
- package/dist/esm/kup-photo-frame.entry.js +2 -3
- package/dist/esm/kup-probe.entry.js +2 -2
- package/dist/esm/kup-qlik.entry.js +2 -2
- package/dist/esm/kup-snackbar.entry.js +4 -5
- package/dist/esm/loader.js +3 -3
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-00e1133d.entry.js +9 -0
- package/dist/ketchup/p-066f344a.entry.js +1 -0
- package/dist/ketchup/p-0c6e0647.entry.js +1 -0
- package/dist/ketchup/p-151f7c17.entry.js +27 -0
- package/dist/ketchup/p-1e9c03b0.entry.js +1 -0
- package/dist/ketchup/{p-fc2b1229.js → p-21ea11cb.js} +3 -3
- package/dist/ketchup/{p-1959f835.entry.js → p-2f4e6c50.entry.js} +1 -1
- package/dist/ketchup/p-3586f59c.js +1 -0
- package/dist/ketchup/p-359fd90d.entry.js +1 -0
- package/dist/ketchup/{p-38d7584e.js → p-389fd0bf.js} +1 -1
- package/dist/ketchup/{p-cd5cfa7c.js → p-5552f156.js} +1 -1
- package/dist/ketchup/{p-264b1b19.entry.js → p-77aff9c1.entry.js} +1 -1
- package/dist/ketchup/{p-e9366aaf.entry.js → p-7cfdf53c.entry.js} +4 -4
- package/dist/ketchup/p-853a5178.entry.js +1 -0
- package/dist/ketchup/{p-edae3076.js → p-8673bd4e.js} +1 -1
- package/dist/ketchup/p-8b55b786.entry.js +1 -0
- package/dist/ketchup/p-95f5834b.entry.js +1 -0
- package/dist/ketchup/p-a2c595c4.js +1 -0
- package/dist/ketchup/p-ae91f27e.entry.js +1 -0
- package/dist/ketchup/{p-928c5c36.js → p-af664379.js} +1 -1
- package/dist/ketchup/p-b0b3989b.js +2 -0
- package/dist/ketchup/p-b3b65a61.entry.js +1 -0
- package/dist/ketchup/p-bc306a53.entry.js +1 -0
- package/dist/ketchup/{p-42080355.entry.js → p-c3783b77.entry.js} +1 -1
- package/dist/ketchup/{p-dc62a30f.js → p-cd4fc3fb.js} +1 -1
- package/dist/ketchup/p-cee76b14.entry.js +1 -0
- package/dist/ketchup/p-cfaea29b.entry.js +1 -0
- package/dist/ketchup/p-d2f51e7b.entry.js +1 -0
- package/dist/ketchup/p-df8e6a4d.entry.js +1 -0
- package/dist/ketchup/p-e60a1170.entry.js +1 -0
- package/dist/ketchup/p-e9a1ba04.entry.js +1 -0
- package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +6 -1
- package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +7 -3
- package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +26 -5
- package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +1 -0
- package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
- package/dist/types/components.d.ts +49 -7
- package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
- package/dist/types/managers/kup-data/kup-data-cell-helper.d.ts +13 -6
- package/dist/types/managers/kup-data/kup-data.d.ts +2 -1
- package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.d.ts +9 -1
- package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover.d.ts +7 -5
- package/dist/types/utils/filters/filters-rows.d.ts +0 -2
- package/package.json +2 -2
- package/dist/cjs/cell-utils-fe64a28c.js +0 -168
- package/dist/cjs/utils-4b208b48.js +0 -447
- package/dist/esm/cell-utils-cb5d4149.js +0 -160
- package/dist/esm/utils-2c1f4122.js +0 -428
- package/dist/ketchup/p-06c6cc68.js +0 -1
- package/dist/ketchup/p-0dacd4bc.entry.js +0 -1
- package/dist/ketchup/p-1c44dc62.entry.js +0 -1
- package/dist/ketchup/p-4bc9f98b.entry.js +0 -1
- package/dist/ketchup/p-578583db.entry.js +0 -1
- package/dist/ketchup/p-5866d507.entry.js +0 -1
- package/dist/ketchup/p-61059e9d.entry.js +0 -9
- package/dist/ketchup/p-664be494.entry.js +0 -1
- package/dist/ketchup/p-67cd575d.entry.js +0 -1
- package/dist/ketchup/p-682a367a.js +0 -1
- package/dist/ketchup/p-6ccf7eb2.entry.js +0 -1
- package/dist/ketchup/p-7230ab97.entry.js +0 -1
- package/dist/ketchup/p-752b4cef.entry.js +0 -1
- package/dist/ketchup/p-7de3e7ac.entry.js +0 -1
- package/dist/ketchup/p-9b36497d.entry.js +0 -1
- package/dist/ketchup/p-b982d137.entry.js +0 -1
- package/dist/ketchup/p-c0219e5e.js +0 -1
- package/dist/ketchup/p-c55fd0a7.entry.js +0 -1
- package/dist/ketchup/p-d154b3a0.entry.js +0 -1
- package/dist/ketchup/p-d2affb6f.entry.js +0 -27
- package/dist/ketchup/p-d3b542b3.js +0 -2
- package/dist/ketchup/p-d6c12c6c.js +0 -1
- package/dist/ketchup/p-da0eab60.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,f as s,h as i,H as e,g as h}from"./p-
|
|
1
|
+
import{r as t,f as s,h as i,H as e,g as h}from"./p-b0b3989b.js";import{k as o}from"./p-21ea11cb.js";import{c as l}from"./p-97e8ea42.js";const n=class{constructor(s){t(this,s),this.content=null,this.customStyle="",this.features={debug:!1,language:!1,longCycleProp:!1,longCycleVar:!1,objects:!1,objectsFunction:!1,theme:!1},this.kupManager=o(),this.startTime=performance.now(),this.featuresStartTime=null,this.endTime=null}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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aj as e,ak as c,b as t,al as a,am as s,an as n,ag as l,ao as i,ap as r,ad as u,aq as o}from"./p-21ea11cb.js";import{h as p}from"./p-b0b3989b.js";import{F as b}from"./p-5552f156.js";import{F as k}from"./p-8673bd4e.js";import{F as d}from"./p-389fd0bf.js";import{a as f}from"./p-cd4fc3fb.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,v=n.column,_=n.row,x=n.shape?n.shape:j.shape?j.shape:v.shape?v.shape:null,$=!m.ketchup.objects.isEmptyKupObj(j.obj),y=!(!j.isEditable||!n.editable),C=n.previousValue!==j.value?j.value:"",z=m.ketchup.data.cell.getType(j,x),F=Object.assign({},j.data);let V=j.cssClass?j.cssClass:v.cssClass?v.cssClass:"";const H={"f-cell":!0,[i.OBJ]:!!$,[z+"-cell"]:!0,[n.wrapperClass]:!!n.wrapperClass,[n.density]:!(!n.density||z===a.BAR),[V]:!!V};let I=C;y&&e.includes(z)?I=function(e,c,t,s,n){switch(e){case a.AUTOCOMPLETE:return p("kup-autocomplete",Object.assign({initialValue:t.value},t.data,{class:O(n)?"kup-full-width":"","onkup-autocomplete-change":c=>w(c,n,e,o.UPDATE),"onkup-autocomplete-input":c=>w(c,n,e,o.INPUT),"onkup-autocomplete-iconclick":c=>w(c,n,e,o.ICON_CLICK)}));case a.CHECKBOX:return g(n)&&(c[i.C_CENTERED]=!0),p(b,Object.assign({},t.data,{onChange:c=>w(c,n,e,o.UPDATE)}));case a.COLOR_PICKER:return p("kup-color-picker",Object.assign({initialValue:t.value},t.data,{class:O(n)?"kup-full-width":"",disabled:!1,"onkup-colorpicker-change":c=>w(c,n,e,o.UPDATE)}));case a.COMBOBOX:return p("kup-combobox",Object.assign({initialValue:t.value},t.data,{class:O(n)?"kup-full-width":"","onkup-combobox-change":c=>w(c,n,e,o.UPDATE),"onkup-combobox-input":c=>w(c,n,e,o.INPUT),"onkup-combobox-iconclick":c=>w(c,n,e,o.ICON_CLICK)}));case a.DATE:return p("kup-date-picker",Object.assign({initialValue:t.value},t.data,{class:O(n)?"kup-full-width":"","onkup-datepicker-change":c=>w(c,n,e,o.UPDATE),"onkup-datepicker-input":c=>w(c,n,e,o.INPUT)}));case a.RATING:return p("kup-rating",Object.assign({},t.data,{disabled:!1,"onkup-rating-click":c=>w(c,n,e,o.UPDATE)}));case a.SWITCH:return p(h,Object.assign({},t.data,{disabled:!1,onChange:c=>w(c,n,e,o.UPDATE)}));case a.TIME:return p("kup-time-picker",Object.assign({initialValue:t.value},t.data,{class:O(n)?"kup-full-width":"","onkup-timepicker-change":c=>w(c,n,e,o.UPDATE),"onkup-timepicker-input":c=>w(c,n,e,o.INPUT)}));case a.NUMBER:c[i.C_RIGHT_ALIGNED]=!0;case a.STRING:return p(k,Object.assign({},t.data,{icon:t.icon?t.icon:s.icon?s.icon:null,fullWidth:!!O(n),inputType:e===a.NUMBER?"number":null,value:e===a.NUMBER?l(t.value).toString():t.value,onChange:c=>w(c,n,e,o.UPDATE),onInput:c=>w(c,n,e,o.INPUT),onIconClick:c=>w(c,n,e,o.ICON_CLICK)}))}}(z,H,j,v,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({},t));case a.BUTTON:return g(u)&&(c[i.C_CENTERED]=!0),p("kup-button",Object.assign({},t,{"onkup-button-click":c=>w(c,u,e,o.CLICK)}));case a.BUTTON_LIST:return g(u)&&(c[i.C_CENTERED]=!0),t["data-storage"]={cell:s,row:n,column:r},p("kup-button-list",Object.assign({},t));case a.CHART:return g(u)&&(c[i.C_CENTERED]=!0),p("kup-chart",Object.assign({},t));case a.CHIP:return p(f,Object.assign({},t));case a.COLOR_PICKER:return p("kup-color-picker",Object.assign({},t,{class:O(u)?"kup-full-width":"",disabled:!0}));case a.GAUGE:return p("kup-gauge",Object.assign({value:l(s.value),"width-component":"280px"},t));case a.KNOB:case a.PROGRESS_BAR:return p("kup-progress-bar",Object.assign({},t));case a.RADIO:return g(u)&&(c[i.C_CENTERED]=!0),t.disabled=n.readOnly,p("kup-radio",Object.assign({},t));case a.RATING:return p("kup-rating",Object.assign({},t,{disabled:!0}))}}(z,H,F,j,_,v,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 g(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 g(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),g(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 g(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,v,n));let T=null;!y&&(v.icon||j.icon)&&I&&(T=p(d,Object.assign({},{color:`rgba(var(${t.TEXT}-rgb), 0.375)`,resource:j.icon?j.icon:v.icon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"obj-icon"})));let X=null;m.ketchup.debug.isDebug()&&$?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 w(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 g(e){return r.includes(e.component.rootElement.tagName)}function O(e){return n.includes(e.component.rootElement.tagName)}export{j as F,h as a}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,f as i,h as r,H as a,g as l}from"./p-b0b3989b.js";import{F as o}from"./p-af664379.js";import{F as s}from"./p-6c77a36c.js";import{F as _}from"./p-389fd0bf.js";import{k as n,g as m,s as f,j as h,N as c}from"./p-21ea11cb.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.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,L,O,P,A,D,F,R,X,Y,H,N=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)},$=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 B=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),this.autofitOnExpand=!0,this.autofitOnLoad=!0,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-N(this,v,"f"),i=t.clientY-N(this,g,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,v,t.clientX,"f"),$(this,g,t.clientY,"f")})),j.set(this,!1),C.set(this,null)}async collapseAll(t=this.data.rows){N(this,x,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){N(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=N(this,C,"f").clientWidth,e=N(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;N(this,C,"f").style.setProperty("--kup_familytree_scale",l<=1?l.toFixed(2):"1")}async setProps(t){f(this,p,t)}componentWillLoad(){N(this,x,"f").debug.logLoad(this,!1),N(this,x,"f").language.register(this),N(this,x,"f").theme.register(this)}componentDidLoad(){N(this,d,"m",Y).call(this),this.autofitOnLoad&&this.runAutofit(),N(this,x,"f").debug.logLoad(this,!0)}componentWillRender(){N(this,x,"f").debug.logRender(this,!1)}componentDidRender(){N(this,j,"f")&&($(this,j,!1,"f"),this.runAutofit()),N(this,x,"f").debug.logRender(this,!0)}render(){return r(a,{onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),N(this,d,"m",P).call(this,t)},onWheel:t=>{N(this,d,"m",H).call(this,t)}},r("style",null,N(this,x,"f").theme.setKupStyle(this.rootElement)),r("div",{id:u},N(this,d,"m",L).call(this)))}disconnectedCallback(){N(this,x,"f").language.unregister(this),N(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"},...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:`${N(this,x,"f").language.translate(h.EXPAND)}/${N(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&&$(this,j,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"},p=r("div",{class:"family-tree__item"},r("div",{class:"family-tree__item__wrapper"},N(this,d,"m",O).call(this,c)?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,layout:c,showSelection:!1}):N(this,d,"m",W).call(this,e,c),this.collapsible&&e.children&&e.children.length>0?r(o,Object.assign({},u)):void 0)),y={"--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},p)),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:y}),r("div",{class:"family-tree__node__staff",style:y},l.map((e=>[r("div",{class:"family-tree__node__staff__item"},N(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=>N(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=>N(this,d,"m",t).call(this,e)))):a.map((e=>r("td",{colSpan:2},N(this,d,"m",t).call(this,e)))))]:void 0)},W=function(t,e){switch(e){case 2:return N(this,d,"m",S).call(this,t);default:return N(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=>N(this,d,"m",T).call(this,t)))},L=function(){return r("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,C,t,"f")},this.data&&this.data.rows&&this.data.rows.length?N(this,d,"m",z).call(this,this.data.rows):r("div",null,N(this,x,"f").language.translate(h.EMPTY_DATA)))},O=function(t){return t&&t.sections&&t.sections.length>0},P=function(t){$(this,v,t.clientX,"f"),$(this,g,t.clientY,"f"),N(this,C,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",N(this,w,"f")),document.removeEventListener("pointerup",e),N(this,C,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",N(this,w,"f")),document.addEventListener("pointerup",e)},A=function(t){const e=[];for(;t&&t!==this.rootElement&&t!==document.body;)e.push(t),t=t.parentNode?t.parentNode:t.host;return e},D=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 N(this,d,"m",D).call(this,N(this,d,"m",A).call(this,t.target),t)},R=function(t){return N(this,d,"m",D).call(this,N(this,d,"m",A).call(this,t.target),t)},X=function(t){return N(this,d,"m",D).call(this,N(this,d,"m",A).call(this,t.target),t)},Y=function(){N(this,b,"f").push(this.rootElement),N(this,x,"f").interact.on(this.rootElement,c.TAP,(t=>{if(N(this,k,"f"))$(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];N(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:N(this,d,"m",F).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:N(this,d,"m",R).call(this,t)})}})),N(this,x,"f").interact.on(this.rootElement,c.DOUBLETAP,(t=>{switch(t.button){case 0:for(let t=0;t<N(this,y,"f").length;t++)clearTimeout(N(this,y,"f")[t]),N(this,x,"f").debug.logMessage(this,"Cleared clickHandler timeout("+N(this,y,"f")[t]+").");$(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:N(this,d,"m",X).call(this,t)})}})),N(this,x,"f").interact.on(this.rootElement,c.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||($(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:N(this,d,"m",R).call(this,t)}))}))},H=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(N(this,C,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let r=t.deltaY>0?e-i:e+i;r<i&&(r=i),N(this,C,"f").style.setProperty("--kup_familytree_scale",r.toFixed(2))}},B.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{B as kup_family_tree}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,a as e}from"./p-
|
|
1
|
+
import{h as t,a as e}from"./p-b0b3989b.js";import{b as s}from"./p-21ea11cb.js";var i;!function(t){t.BAR="bar"}(i||(i={}));const a=a=>{let r,o;a.resource?a.resource.indexOf(".")>-1||a.resource.indexOf("/")>-1||a.resource.indexOf("\\")>-1?(o={"--kup_image_height":a.sizeY?a.sizeY:"auto","--kup_image_width":a.sizeX?a.sizeX:"100%"},r=t("img",{src:a.resource})):(o={"--kup_image_height":a.sizeY?a.sizeY:"100%","--kup_image_width":a.sizeX?a.sizeX:"100%"},r=function(i){const a={"f-image__icon":!0},r={background:i.color?i.color:`var(${s.ICON})`};if(i.resource.indexOf("--kup")>-1){let t=i.resource.replace("--","");a["kup-icon"]=!0,a[t]=!0}else{const t=e(`./assets/svg/${i.resource}.svg`);r.mask=`url('${t}') no-repeat center`,r.webkitMask=`url('${t}') no-repeat center`}return t("div",{class:a,style:r})}(a)):a.data&&(o={"--kup_image_height":a.sizeY?a.sizeY:"100%","--kup_image_width":a.sizeX?a.sizeX:"100%"},r=function(e){const s=[];let a=0;for(let r=0;r<e.length;r++){let o;e[r].shape||(e[r].shape=i.BAR),e[r].color||(e[r].color="transparent"),e[r].height||(e[r].height="100%"),e[r].width||(e[r].width="100%");const n="step-"+r,c="css-step bottom-aligned",l={backgroundColor:e[r].color,left:a+"%",height:e[r].height,width:e[r].width};a+=parseFloat(e[r].width),o=t("span",{id:n,class:c,style:l}),s.push(o)}return t("div",{class:"f-image__css"},s)}(a.data));const n=[];if(a.badgeData)for(let e=0;e<a.badgeData.length;e++)n.push(t("kup-badge",Object.assign({},a.badgeData[e])));return t("div",Object.assign({class:`f-image ${a.wrapperClass?a.wrapperClass:""} ${a.fit?"kup-fit":""}`},a.dataSet,{id:a.id,style:o,title:a.title,onClick:a.onClick}),r,...n)};export{a as F}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as c}from"./p-
|
|
1
|
+
import{h as c}from"./p-b0b3989b.js";const e=e=>{const o={"data-indeterminate":!!e.indeterminate},a={checkbox:!0,"checkbox--checked":!(!e.checked||e.indeterminate),"checkbox--disabled":!!e.disabled,"checkbox--indeterminate":!!e.indeterminate};return c("div",Object.assign({class:`f-checkbox ${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}),c("div",{class:"form-field "+(e.leadingLabel?"form-field--align-end":"")},c("div",{class:a},c("input",Object.assign({type:"checkbox",class:"checkbox__native-control",checked:e.checked,disabled:e.disabled,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus},o,{value:e.checked?"on":"off"})),c("div",{class:"checkbox__background",onClick:e.onChange},c("svg",{class:"checkbox__checkmark",viewBox:"0 0 24 24"},c("path",{class:"checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),c("div",{class:"checkbox__mixedmark"}))),e.label?c("label",null,e.label):void 0))};export{e as F}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,f as s,h as e,H as h,g as o}from"./p-
|
|
1
|
+
import{r as t,c as i,f as s,h as e,H as h,g as o}from"./p-b0b3989b.js";import{k as r,a as l,q as n}from"./p-21ea11cb.js";import{c as u}from"./p-97e8ea42.js";import{F as c}from"./p-8673bd4e.js";import{F as a}from"./p-a203f78b.js";import"./p-79b0730b.js";import"./p-81605f08.js";var p;!function(t){t.customStyle="Custom style of the component.",t.data="Props of the sub-components.",t.decimals="Defaults at false. When set to true, the component has decimals.",t.disabled="Defaults at false. When set to true, the component is disabled.",t.initialValue="Sets the initial value of the component",t.maxDecimals="when set, the component allows you to enter decimals with a maximum of characters.",t.maxIntegers="When set, the component allows you to enter integer numbers with a maximum of characters.",t.maxLength="When set, the component allows you to enter numbers with a maximum of characters, including decimals.",t.negative="Defaults at false. When set to true, the component has negative number."}(p||(p={}));const m=class{constructor(s){t(this,s),this.kupBlur=i(this,"kup-numericpicker-blur",6),this.kupChange=i(this,"kup-numericpicker-change",6),this.kupClick=i(this,"kup-numericpicker-click",6),this.kupFocus=i(this,"kup-numericpicker-focus",6),this.kupInput=i(this,"kup-numericpicker-input",6),this.kupIconClick=i(this,"kup-numericpicker-iconclick",6),this.kupItemClick=i(this,"kup-numericpicker-itemclick",6),this.kupTextFieldSubmit=i(this,"kup-numericpicker-textfieldsubmit",6),this.kupClearIconClick=i(this,"kup-numericpicker-cleariconclick",6),this.stateSwitcher=!1,this.value="",this.customStyle="",this.data=null,this.decimals=!1,this.disabled=!1,this.initialValue="",this.maxDecimals=null,this.maxIntegers=null,this.maxLength=null,this.negative=!1,this.kupManager=r(),this.textfieldEl=null,this.pickerContainerEl=null,this.pickerEl={value:(new Date).toISOString(),date:new Date},this.clickCb=null}onKupPickerItemClick(t){this.setPickerValueSelected(t),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupItemClick.emit({comp:this,id:this.rootElement.id,value:this.value}),this.setFocus()}onKupClearIconClick(){this.setPickerValueSelected(""),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupClearIconClick.emit({comp:this,id:this.rootElement.id})}onKupBlur(){this.kupBlur.emit({id:this.rootElement.id,value:this.value,comp:this})}onKupChange(t){this.refreshPickerValue(t.target.value,this.kupChange)}onKupClick(){this.kupClick.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupFocus(){this.kupFocus.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupInput(t){this.refreshPickerValue(t.target.value,this.kupInput,!0)}onkupTextFieldSubmit(t){"Enter"===t.key&&this.refreshPickerValue(t.target.value,this.kupTextFieldSubmit)}onKupIconClick(){this.isPickerOpened()?this.closePicker():this.openPicker(),this.kupIconClick.emit({comp:this,id:this.rootElement.id,value:this.value})}listenKeyup(t){this.isPickerOpened()&&("Escape"===t.key&&this.closePicker(),"Enter"===t.key&&this.setPickerValueSelected())}async getValue(){return this.value}async getProps(t){let i={};if(t)i=p;else for(const t in p)Object.prototype.hasOwnProperty.call(p,t)&&(i[t]=this[t]);return i}async refresh(){s(this)}async setFocus(){null!=this.textfieldEl&&this.textfieldEl.focus()}async setValue(t){this.value=t}refreshPickerValue(t,i,s){let e=this.kupManager.math.numberify(t,!0);if(e){let t=e.toString();const h=t.indexOf(".");let o=h>-1?t.substring(0,h):t,r=h>-1?t.substring(h+1):"";for(this.maxIntegers&&o.length>this.maxIntegers&&(o=o.substring(o.length-this.maxIntegers)),this.maxDecimals&&r.length>this.maxDecimals&&(r=r.substring(0,this.maxDecimals));this.maxLength&&o.length+r.length>this.maxLength;)r.length>1?r=r.substring(0,r.length-1):o.length>1&&(o=o.substring(1));t=h>-1?`${o}.${r}`:o,1!=s&&this.setValue(t),null!=i&&i.emit({id:this.rootElement.id,value:t})}}setPickerValueSelected(t){1!=this.disabled&&(null==t&&(t=this.getPickerValueSelected()),this.closePicker(),null!=t&&this.setValue(t))}getPickerValueSelected(){return this.pickerEl.value}getValueForPickerComponent(){return this.value}openPicker(){const t=this.textfieldEl;this.pickerContainerEl.menuVisible=!0;const i=this.pickerContainerEl.style;i.height="auto",i.minWidth=this.textfieldEl.parentElement.clientWidth+"px",null!=t&&t.classList.add("toggled"),this.kupManager.dynamicPosition.isRegistered(this.pickerContainerEl)?this.kupManager.dynamicPosition.changeAnchor(this.pickerContainerEl,this.textfieldEl.parentElement):this.kupManager.dynamicPosition.register(this.pickerContainerEl,this.textfieldEl.parentElement,0,l.AUTO,!0),this.kupManager.dynamicPosition.start(this.pickerContainerEl),this.clickCb||(this.clickCb={cb:()=>{this.closePicker()},el:this.pickerContainerEl}),this.kupManager.addClickCallback(this.clickCb,!0)}closePicker(){if(this.kupManager.removeClickCallback(this.clickCb),!this.isPickerOpened())return;let t=this.textfieldEl;null!=t&&t.classList.remove("toggled"),this.pickerContainerEl.menuVisible=!1,this.kupManager.dynamicPosition.stop(this.pickerContainerEl)}isPickerOpened(){return 1==this.pickerContainerEl.menuVisible}getTextFieldId(){return this.textfieldEl.id}prepTextfield(){this.decimals||this.maxIntegers||(this.maxIntegers=17),!this.decimals||this.maxIntegers||this.maxDecimals||(this.maxIntegers=15,this.maxDecimals=2);const t=this.rootElement.classList.contains("kup-full-height"),i=this.rootElement.classList.contains("kup-full-width"),s=Object.assign({},this.data["kup-text-field"]);return s.icon||(s.icon="calculator"),s.icon&&(s.trailingIcon=!0),e(c,Object.assign({},s,{disabled:this.disabled,fullHeight:t,fullWidth:i,id:this.rootElement.id+"_text-field",value:this.kupManager.math.numbers.toLocaleString(this.value),onBlur:()=>this.onKupBlur(),onChange:t=>this.onKupChange(t),onClearIconClick:()=>this.onKupClearIconClick(),onClick:()=>this.onKupClick(),onFocus:()=>this.onKupFocus(),onIconClick:()=>this.onKupIconClick(),onKeyDown:t=>this.onkupTextFieldSubmit(t),onInput:t=>this.onKupInput(t)}),this.prepPicker())}prepPicker(){return e("kup-card",{ref:t=>this.pickerContainerEl=t,data:{options:{decimals:this.decimals,initialValue:this.value,maxDecimals:this.maxDecimals,maxIntegers:this.maxIntegers,maxLength:this.maxLength,negative:this.negative,resetStatus:!0}},layoutFamily:n.BUILT_IN,layoutNumber:5,sizeX:"300px",sizeY:"auto",isMenu:!0,"onkup-card-click":t=>{null!=t.detail.value&&this.onKupPickerItemClick(t.detail.value)}})}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this),this.value=this.initialValue,this.data||(this.data={"kup-text-field":{}})}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const i=t.querySelector(".f-text-field");i&&(this.textfieldEl=i.querySelector("input"),a(i))}this.kupManager.debug.logRender(this,!0)}render(){return e(h,null,e("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{id:u},this.prepTextfield()))}disconnectedCallback(){this.kupManager.dates.unregister(this),this.kupManager.theme.unregister(this),this.pickerContainerEl&&this.pickerContainerEl.remove()}get rootElement(){return o(this)}};m.style=":host{display:block;font-size:var(--kup-font-size)}.f-text-field{position:relative}:host(.kup-full-height){height:100%}:host(.kup-full-height) #kup-component{height:100%}:host(.kup-full-width){width:100%}:host(.kup-full-width) #kup-component{width:100%}:host(.kup-danger){--kup-textfield-primary-color:var(--kup-danger-color);--kup-textfield-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-textfield-primary-color:var(--kup-info-color);--kup-textfield-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-textfield-primary-color:var(--kup-secondary-color);--kup-textfield-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-textfield-primary-color:var(--kup-success-color);--kup-textfield-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-textfield-primary-color:var(--kup-warning-color);--kup-textfield-primary-color-rgb:var(--kup-warning-color-rgb)}";export{m as kup_numeric_picker}
|