@sme.up/ketchup 8.2.1 → 8.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/cjs/{f-cell-a440d744.js → f-cell-6f902849.js} +2 -2
  2. package/dist/cjs/{f-text-field-3868b623.js → f-text-field-865a6386.js} +6 -2
  3. package/dist/cjs/ketchup.cjs.js +1 -1
  4. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +5 -2
  5. package/dist/cjs/kup-box.cjs.entry.js +3 -3
  6. package/dist/cjs/kup-cell.cjs.entry.js +2 -2
  7. package/dist/cjs/kup-dashboard.cjs.entry.js +1 -1
  8. package/dist/cjs/kup-image-list.cjs.entry.js +2 -2
  9. package/dist/cjs/kup-numeric-picker.cjs.entry.js +1 -1
  10. package/dist/cjs/kup-planner.cjs.entry.js +1 -1
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/collection/components/kup-box/kup-box.js +1 -1
  13. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
  14. package/dist/collection/components/kup-text-field/kup-text-field.js +23 -0
  15. package/dist/collection/f-components/f-cell/f-cell.js +1 -1
  16. package/dist/collection/f-components/f-text-field/f-text-field.js +6 -2
  17. package/dist/components/kup-autocomplete2.js +11 -3
  18. package/dist/components/kup-box2.js +1 -1
  19. package/dist/esm/{f-cell-d48502f1.js → f-cell-fbfe9fe0.js} +2 -2
  20. package/dist/esm/{f-text-field-7e2b397b.js → f-text-field-98905f74.js} +6 -2
  21. package/dist/esm/ketchup.js +1 -1
  22. package/dist/esm/kup-autocomplete_27.entry.js +5 -2
  23. package/dist/esm/kup-box.entry.js +3 -3
  24. package/dist/esm/kup-cell.entry.js +2 -2
  25. package/dist/esm/kup-dashboard.entry.js +1 -1
  26. package/dist/esm/kup-image-list.entry.js +2 -2
  27. package/dist/esm/kup-numeric-picker.entry.js +1 -1
  28. package/dist/esm/kup-planner.entry.js +1 -1
  29. package/dist/esm/loader.js +1 -1
  30. package/dist/ketchup/ketchup.esm.js +1 -1
  31. package/dist/ketchup/{p-71f202aa.entry.js → p-2cc57793.entry.js} +1 -1
  32. package/dist/ketchup/{p-ad9b5c06.entry.js → p-487f4a33.entry.js} +2 -2
  33. package/dist/ketchup/{p-e28a3dfb.entry.js → p-6efda31f.entry.js} +1 -1
  34. package/dist/ketchup/{p-c1c49123.entry.js → p-a9151ee8.entry.js} +1 -1
  35. package/dist/ketchup/{p-9cc4dd44.js → p-c20c4f66.js} +1 -1
  36. package/dist/ketchup/{p-afbd769b.entry.js → p-c3e84081.entry.js} +1 -1
  37. package/dist/ketchup/{p-279eab92.js → p-e16c04d8.js} +1 -1
  38. package/dist/ketchup/{p-70a6ab77.entry.js → p-efd07a7f.entry.js} +1 -1
  39. package/dist/ketchup/{p-da0db0a5.entry.js → p-f1da8b9c.entry.js} +1 -1
  40. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +1 -0
  41. package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
  42. package/dist/types/components.d.ts +10 -0
  43. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
  44. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{r as n,c as e,f as t,h as r,H as i,g as u,a as o}from"./p-3da7e4c6.js";import{ao as a,ap as l,k as s,h as c,af as f,g as h,s as d,K as v,I as y}from"./p-46daf529.js";import{c as m}from"./p-ad2e21d2.js";import{F as p}from"./p-9cc4dd44.js";import{F as w}from"./p-fb03f2f5.js";import"./p-6507e9eb.js";var b,g,k;!function(n){n.customStyle="Custom style of the component.",n.data="Dataset containg the tasks list",n.detailData="Dataset containg the details list",n.detailColorCol="Column containing the detail color, in hex format",n.detailColumns="Columns containing informations displayed in the left box, near the gantt of details",n.detailDates="Columns containing detail duration, from (firstDate) to (secondDate)",n.detailFilter="Sets the detail's filter.",n.detailHeight="Height for detail gantt",n.detailIdCol="Column containing unique detail identifier",n.detailNameCol="Column containing detail name displayed",n.detailPrevDates="Columns containing forecast detail duration, from (firstDate) to (secondDate)",n.detailInitialScrollX="Sets the initial scroll X for the detail.",n.detailInitialScrollY="Sets the initial scroll Y for the detail.",n.listCellWidth="Total size of the cells inside to the left box, near the gantt",n.maxWidth="Max width for component",n.phaseColorCol="Column containing the phase color in hex format",n.phaseColumns="Columns containing informations displayed in the left box ,near the gantt of phases",n.phaseColParDep="Column containing the name of the parent phases",n.phaseDates="Columns containing phase duration, from (firstDate) to (secondDate)",n.phaseIdCol="Column containing unique phase identifier",n.phaseNameCol="Column containing phase name displayed",n.phasePrevDates="Columns containing forecast phase duration, from (firstDate) to (secondDate)",n.readOnly="When true, the two gantts are not interactable.",n.showSecondaryDates="Enable/disable display of secondary dates",n.taskColumns="Columns containing informations displayed in the left box, near the gantt",n.taskDates="Columns containing task duration, from (firstDate) to (secondDate)",n.taskFilter="Sets the task's filter.",n.taskHeight="Height for main gantt",n.taskIdCol="Column containing unique task identifier",n.taskNameCol="Column containing task name displayed",n.taskPrevDates="Columns containing forecast task duration, from (firstDate) to (secondDate)",n.taskInitialScrollX="Sets the initial scroll X for the task.",n.taskInitialScrollY="Sets the initial scroll Y for the task.",n.titleMess="Message displayed on top"}(b||(b={})),function(n){n.onTaskOpening="onTaskOpening",n.onTaskClosing="onTaskClosing",n.onClick="onClick",n.onResize="onResize",n.onRightClick="onRightClick"}(g||(g={})),function(n){n.TASK="task",n.PHASE="phase",n.DETAIL="detail"}(k||(k={}));class x{constructor(n,e=100){this.dateTime=new Date,this.event=n,this.threshold=e}isEquivalent(n){const e=(new Date).valueOf()-this.dateTime.valueOf();return JSON.stringify(this.event)===JSON.stringify(n)&&e<this.threshold}resetDateTime(){this.dateTime=new Date}}const S={listCellWidth:"300px",rowHeight:40,barFill:90,projectProgressColor:"#CBCBCB",projectProgressSelectedColor:"#CBCBCB",projectBackgroundColor:"#CBCBCB",projectBackgroundSelectedColor:"#CBCBCB",barProgressColor:"#A2A415",barProgressSelectedColor:"#A2A415",barBackgroundColor:"#A2A415",barBackgroundSelectedColor:"#A2A415"};
1
+ import{r as n,c as e,f as t,h as r,H as i,g as u,a as o}from"./p-3da7e4c6.js";import{ao as a,ap as l,k as s,h as c,af as f,g as h,s as d,K as v,I as y}from"./p-46daf529.js";import{c as m}from"./p-ad2e21d2.js";import{F as p}from"./p-c20c4f66.js";import{F as w}from"./p-fb03f2f5.js";import"./p-6507e9eb.js";var b,g,k;!function(n){n.customStyle="Custom style of the component.",n.data="Dataset containg the tasks list",n.detailData="Dataset containg the details list",n.detailColorCol="Column containing the detail color, in hex format",n.detailColumns="Columns containing informations displayed in the left box, near the gantt of details",n.detailDates="Columns containing detail duration, from (firstDate) to (secondDate)",n.detailFilter="Sets the detail's filter.",n.detailHeight="Height for detail gantt",n.detailIdCol="Column containing unique detail identifier",n.detailNameCol="Column containing detail name displayed",n.detailPrevDates="Columns containing forecast detail duration, from (firstDate) to (secondDate)",n.detailInitialScrollX="Sets the initial scroll X for the detail.",n.detailInitialScrollY="Sets the initial scroll Y for the detail.",n.listCellWidth="Total size of the cells inside to the left box, near the gantt",n.maxWidth="Max width for component",n.phaseColorCol="Column containing the phase color in hex format",n.phaseColumns="Columns containing informations displayed in the left box ,near the gantt of phases",n.phaseColParDep="Column containing the name of the parent phases",n.phaseDates="Columns containing phase duration, from (firstDate) to (secondDate)",n.phaseIdCol="Column containing unique phase identifier",n.phaseNameCol="Column containing phase name displayed",n.phasePrevDates="Columns containing forecast phase duration, from (firstDate) to (secondDate)",n.readOnly="When true, the two gantts are not interactable.",n.showSecondaryDates="Enable/disable display of secondary dates",n.taskColumns="Columns containing informations displayed in the left box, near the gantt",n.taskDates="Columns containing task duration, from (firstDate) to (secondDate)",n.taskFilter="Sets the task's filter.",n.taskHeight="Height for main gantt",n.taskIdCol="Column containing unique task identifier",n.taskNameCol="Column containing task name displayed",n.taskPrevDates="Columns containing forecast task duration, from (firstDate) to (secondDate)",n.taskInitialScrollX="Sets the initial scroll X for the task.",n.taskInitialScrollY="Sets the initial scroll Y for the task.",n.titleMess="Message displayed on top"}(b||(b={})),function(n){n.onTaskOpening="onTaskOpening",n.onTaskClosing="onTaskClosing",n.onClick="onClick",n.onResize="onResize",n.onRightClick="onRightClick"}(g||(g={})),function(n){n.TASK="task",n.PHASE="phase",n.DETAIL="detail"}(k||(k={}));class x{constructor(n,e=100){this.dateTime=new Date,this.event=n,this.threshold=e}isEquivalent(n){const e=(new Date).valueOf()-this.dateTime.valueOf();return JSON.stringify(this.event)===JSON.stringify(n)&&e<this.threshold}resetDateTime(){this.dateTime=new Date}}const S={listCellWidth:"300px",rowHeight:40,barFill:90,projectProgressColor:"#CBCBCB",projectProgressSelectedColor:"#CBCBCB",projectBackgroundColor:"#CBCBCB",projectBackgroundSelectedColor:"#CBCBCB",barProgressColor:"#A2A415",barProgressSelectedColor:"#A2A415",barBackgroundColor:"#A2A415",barBackgroundSelectedColor:"#A2A415"};
2
2
  /**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -1 +1 @@
1
- import{r as t,c as i,f as s,h as e,H as h,g as o}from"./p-3da7e4c6.js";import{k as r,a as l,t as n}from"./p-46daf529.js";import{c as u}from"./p-ad2e21d2.js";import{F as c}from"./p-9cc4dd44.js";import{F as a}from"./p-fb03f2f5.js";import"./p-6507e9eb.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.kupManager=r(),this.textfieldEl=null,this.pickerContainerEl=null,this.pickerEl={value:(new Date).toISOString(),date:new Date},this.clickCb=null,this.stateSwitcher=!1,this.value="",this.customStyle="",this.data=null,this.decimals=!1,this.disabled=!1,this.initialValue="",this.maxDecimals=null,this.maxIntegers=null,this.maxLength=null,this.negative=!1}onKupPickerItemClick(t){this.setPickerValueSelected(t),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupItemClick.emit({comp:this,id:this.rootElement.id,value:this.value}),this.setFocus()}onKupClearIconClick(){this.setPickerValueSelected(""),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupClearIconClick.emit({comp:this,id:this.rootElement.id})}onKupBlur(){this.kupBlur.emit({id:this.rootElement.id,value:this.value,comp:this})}onKupChange(t){this.refreshPickerValue(t.target.value,this.kupChange)}onKupClick(){this.kupClick.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupFocus(){this.kupFocus.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupInput(t){this.refreshPickerValue(t.target.value,this.kupInput,!0)}onkupTextFieldSubmit(t){"Enter"===t.key&&this.refreshPickerValue(t.target.value,this.kupTextFieldSubmit)}onKupIconClick(){this.isPickerOpened()?this.closePicker():this.openPicker(),this.kupIconClick.emit({comp:this,id:this.rootElement.id,value:this.value})}listenKeyup(t){this.isPickerOpened()&&("Escape"===t.key&&this.closePicker(),"Enter"===t.key&&this.setPickerValueSelected())}async getValue(){return this.value}async getProps(t){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}
1
+ import{r as t,c as i,f as s,h as e,H as h,g as o}from"./p-3da7e4c6.js";import{k as r,a as l,t as n}from"./p-46daf529.js";import{c as u}from"./p-ad2e21d2.js";import{F as c}from"./p-c20c4f66.js";import{F as a}from"./p-fb03f2f5.js";import"./p-6507e9eb.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.kupManager=r(),this.textfieldEl=null,this.pickerContainerEl=null,this.pickerEl={value:(new Date).toISOString(),date:new Date},this.clickCb=null,this.stateSwitcher=!1,this.value="",this.customStyle="",this.data=null,this.decimals=!1,this.disabled=!1,this.initialValue="",this.maxDecimals=null,this.maxIntegers=null,this.maxLength=null,this.negative=!1}onKupPickerItemClick(t){this.setPickerValueSelected(t),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupItemClick.emit({comp:this,id:this.rootElement.id,value:this.value}),this.setFocus()}onKupClearIconClick(){this.setPickerValueSelected(""),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupClearIconClick.emit({comp:this,id:this.rootElement.id})}onKupBlur(){this.kupBlur.emit({id:this.rootElement.id,value:this.value,comp:this})}onKupChange(t){this.refreshPickerValue(t.target.value,this.kupChange)}onKupClick(){this.kupClick.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupFocus(){this.kupFocus.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupInput(t){this.refreshPickerValue(t.target.value,this.kupInput,!0)}onkupTextFieldSubmit(t){"Enter"===t.key&&this.refreshPickerValue(t.target.value,this.kupTextFieldSubmit)}onKupIconClick(){this.isPickerOpened()?this.closePicker():this.openPicker(),this.kupIconClick.emit({comp:this,id:this.rootElement.id,value:this.value})}listenKeyup(t){this.isPickerOpened()&&("Escape"===t.key&&this.closePicker(),"Enter"===t.key&&this.setPickerValueSelected())}async getValue(){return this.value}async getProps(t){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}
@@ -1 +1 @@
1
- import{h as e,a as t}from"./p-3da7e4c6.js";import{K as l}from"./p-46daf529.js";const i=document.documentElement,d=(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":"")},[n(t),c(t),e("label",null,t.label)]):[n(t),c(t)],l);function n(d){var n,c;const o=d.textArea||d.outlined;let s,r;if(!d.label||d.leadingLabel||d.trailingLabel||(s=e("label",{class:"mdc-floating-label",htmlFor:"kup-input"},d.label)),d.icon){let i,n="";if(Object.values(l).indexOf(d.icon)>-1)n=d.icon.replace("--","");else{let e=`url('${t(`./assets/svg/${d.icon}.svg`)}') no-repeat center`;i={mask:e,webkitMask:e}}r=e("span",{style:i,onClick:d.onIconClick,class:`mdc-text-field__icon kup-icon action ${n}`})}const u={"is-clearable":d.isClearable,"mdc-text-field":!0,"mdc-text-field--disabled":d.disabled,"mdc-text-field--filled":!d.fullWidth&&!o,"mdc-text-field--no-label":!d.label,"mdc-text-field--fullwidth":d.fullWidth,"mdc-text-field--outlined":o,"mdc-text-field--textarea":d.textArea,"mdc-text-field--with-leading-icon":d.icon&&!d.trailingIcon,"mdc-text-field--with-trailing-icon":d.icon&&d.trailingIcon};let f=d.value,m=null!==(n=d.inputType)&&void 0!==n?n:"text",p=!1;if("number"===d.inputType&&d.decimals&&d.decimals>0&&(m="text",p=!0),"number"===d.inputType){const e={allowNegative:null===(c=d.allowNegative)||void 0===c||c,decimal:d.decimals,group:d.group,integer:d.integers};f=a(f,e,!1)}return e("div",{class:u},d.textArea&&d.maxLength?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",d.maxLength):void 0,d.trailingIcon?void 0:r,d.textArea?e("span",{class:"mdc-text-field__resizer"},e("textarea",{class:"mdc-text-field__input",disabled:d.disabled,readOnly:d.readOnly,maxlength:d.maxLength,value:f,onBlur:d.onBlur,onClick:d.onClick,onChange:d.onChange,onFocus:d.onFocus,onInput:d.onInput,onKeyDown:d.onKeyDown})):e("input",{inputmode:d.inputMode?d.inputMode:void 0,type:m,step:d.step,min:d.min,max:d.max,name:d.name,class:"mdc-text-field__input",disabled:d.disabled,readOnly:d.readOnly,placeholder:d.fullWidth&&!d.outlined?d.label:void 0,maxlength:d.maxLength,size:d.size,value:f,onBlur:e=>{var t;if(p){const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};e.target.value=a(e.target.value,l,!0)}d.onBlur&&d.onBlur(e)},onChange:e=>{var t;if(p){const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};e.target.value=a(e.target.value,l,!0)}d.onChange&&d.onChange(e)},onClick:d.onClick,onFocus:d.onFocus,onInput:d.onInput,onKeyDown:d.onKeyDown,onKeyPress:e=>{var t;if(!p)return;if(e.ctrlKey)return;if(e.key.length>1)return;const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};let n=e.target,c=n.value,a=c.substring(0,n.selectionStart),o=c.substring(n.selectionEnd,n.selectionEnd+c.length-1);i.ketchup.math.matchNumericValueWithOptions(a+e.key+o,l)||e.preventDefault()}}),d.isClearable?e("span",{class:`mdc-text-field__icon kup-icon ${l.CLEAR.replace("--","")}`,onClick:d.onClearIconClick}):void 0,d.trailingIcon?r:void 0,d.fullWidth||o?void 0:s,o?e("div",{class:"mdc-notched-outline"},e("div",{class:"mdc-notched-outline__leading"}),e("div",{class:"mdc-notched-outline__notch"},s),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))}}const a=function(e,t,l){let d=e;return d?"-"==d?"":i.ketchup.math.format(d,i.ketchup.math.createFormatPattern(t.group,t.decimal),l):d};export{d as F}
1
+ import{h as e,a as t}from"./p-3da7e4c6.js";import{K as l}from"./p-46daf529.js";const i=document.documentElement,d=(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":"")},[n(t),c(t),e("label",null,t.label)]):[n(t),c(t)],l);function n(d){var n,c;const o=d.textArea||d.outlined;let s,r;if(!d.label||d.leadingLabel||d.trailingLabel||(s=e("label",{class:"mdc-floating-label",htmlFor:"kup-input"},d.label)),d.icon){let i,n="";if(Object.values(l).indexOf(d.icon)>-1)n=d.icon.replace("--","");else{let e=`url('${t(`./assets/svg/${d.icon}.svg`)}') no-repeat center`;i={mask:e,webkitMask:e}}r=e("span",{style:i,onClick:d.onIconClick,class:`mdc-text-field__icon kup-icon action ${n}`})}const u={"is-clearable":d.isClearable,"mdc-text-field":!0,"mdc-text-field--disabled":d.disabled,"mdc-text-field--filled":!d.fullWidth&&!o,"mdc-text-field--no-label":!d.label,"mdc-text-field--fullwidth":d.fullWidth,"mdc-text-field--outlined":o,"mdc-text-field--textarea":d.textArea,"mdc-text-field--with-leading-icon":d.icon&&!d.trailingIcon,"mdc-text-field--with-trailing-icon":d.icon&&d.trailingIcon};let f=d.value,m=null!==(n=d.inputType)&&void 0!==n?n:"text",p=!1;if("number"===d.inputType&&d.decimals&&d.decimals>0&&(m="text",p=!0),"number"===d.inputType){const e={allowNegative:null===(c=d.allowNegative)||void 0===c||c,decimal:d.decimals,group:d.group,integer:d.integers};f=a(f,e,!1)}return e("div",{class:u},d.textArea&&d.maxLength?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",d.maxLength):void 0,d.trailingIcon?void 0:r,d.textArea?e("span",{class:"mdc-text-field__resizer"},e("textarea",{class:"mdc-text-field__input",disabled:d.disabled,readOnly:d.readOnly,maxlength:d.maxLength,value:f,onBlur:d.onBlur,onClick:d.onClick,onChange:d.onChange,onFocus:d.onFocus,onInput:d.onInput,onKeyDown:d.onKeyDown})):e("input",{inputmode:d.inputMode?d.inputMode:void 0,type:m,step:d.step,min:d.min,max:d.max,name:d.name,class:"mdc-text-field__input",disabled:d.disabled,readOnly:d.readOnly,placeholder:d.fullWidth&&!d.outlined?d.label:void 0,maxlength:d.maxLength,size:d.size,value:f,onBlur:e=>{var t;if(p){const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};e.target.value=a(e.target.value,l,!0)}d.onBlur&&d.onBlur(e)},onChange:e=>{var t;if(p){const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};e.target.value=a(e.target.value,l,!0)}d.onChange&&d.onChange(e)},onClick:d.onClick,onFocus:d.onFocus,onInput:d.onInput,onKeyDown:d.onKeyDown,onKeyPress:e=>{var t;if(!p)return;if(e.ctrlKey)return;if(e.key.length>1)return;const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};let n=e.target,c=n.value,a=c.substring(0,n.selectionStart),o=c.substring(n.selectionEnd,n.selectionEnd+c.length-1);i.ketchup.math.matchNumericValueWithOptions(a+e.key+o,l)||e.preventDefault()}}),d.isClearable?e("span",{class:`mdc-text-field__icon kup-icon ${l.CLEAR.replace("--","")}`,onClick:d.onClearIconClick}):void 0,d.trailingIcon?r:void 0,d.fullWidth||o?void 0:s,o?e("div",{class:"mdc-notched-outline"},e("div",{class:"mdc-notched-outline__leading"}),e("div",{class:"mdc-notched-outline__notch"},s),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),!0!==t.hiddenCounter&&t.maxLength&&!t.textArea?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",t.maxLength.toString()):void 0);if(!0!==t.hiddenCounter&&t.maxLength&&!t.textArea)return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",t.maxLength))}}const a=function(e,t,l){let d=e;return d?"-"==d?"":i.ketchup.math.format(d,i.ketchup.math.createFormatPattern(t.group,t.decimal),l):d};export{d as F}
@@ -1 +1 @@
1
- import{r as i,c as t,f as e,h as a,H as s,g as r}from"./p-3da7e4c6.js";import{k as o,g as n,s as l,m,d as p}from"./p-46daf529.js";import{c}from"./p-ad2e21d2.js";import{F as h}from"./p-9c7b9ff2.js";import{F as g}from"./p-ffbd77d5.js";import{F as _}from"./p-0fd98ab4.js";import{F as u}from"./p-279eab92.js";import{M as d}from"./p-6507e9eb.js";import"./p-90576709.js";import"./p-9cc4dd44.js";import"./p-d5491e4f.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(m.BACK)})),a(g,Object.assign({},M(this,x,"f"),{label:M(this,w,"f").language.translate(m.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:p.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
+ import{r as i,c as t,f as e,h as a,H as s,g as r}from"./p-3da7e4c6.js";import{k as o,g as n,s as l,m,d as p}from"./p-46daf529.js";import{c}from"./p-ad2e21d2.js";import{F as h}from"./p-9c7b9ff2.js";import{F as g}from"./p-ffbd77d5.js";import{F as _}from"./p-0fd98ab4.js";import{F as u}from"./p-e16c04d8.js";import{M as d}from"./p-6507e9eb.js";import"./p-90576709.js";import"./p-c20c4f66.js";import"./p-d5491e4f.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(m.BACK)})),a(g,Object.assign({},M(this,x,"f"),{label:M(this,w,"f").language.translate(m.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:p.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{a9 as e,aa as t,b as c,a6 as s,ab as a,ac as n,ad as i,ae as o,af as l,ag as u}from"./p-46daf529.js";import{h as r}from"./p-3da7e4c6.js";import{F as p}from"./p-90576709.js";import{F as d}from"./p-9cc4dd44.js";import{F as k}from"./p-9c7b9ff2.js";import{F as b,a as h}from"./p-d5491e4f.js";var f,m,w;!function(e){e.customStyle="Custom style of the component.",e.data="The data of the list.",e.displayMode="Selects how the items must display their label and how they can be filtered for.",e.filter="Keeps string for filtering elements when filter mode is active",e.hideText="Hides rows' text, ideally to display a list of icons only.",e.isMenu="Defines whether the list is a menu or not.",e.keyboardNavigation="When true, enables items' navigation through arrow keys.",e.menuVisible="Sets the status of the menu, when false it's hidden otherwise it's visible.",e.roleType="Defines the type of selection. Values accepted: listbox, radiogroup or group.",e.selectable="Defines whether items are selectable or not.",e.showIcons="Displays the icons associated to each row when set to true.",e.twoLine="The list elements descriptions will be arranged in two lines."}(f||(f={})),function(e){e.LISTBOX="listbox",e.RADIOGROUP="radiogroup",e.GROUP="group"}(m||(m={})),function(e){e.CODE="code",e.DESCRIPTION="description",e.DESCRIPTION_AND_CODE="both"}(w||(w={}));const y=e=>r("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}),r("div",{class:"form-field "+(e.leadingLabel?"form-field--align-end":"")},r("div",{class:`switch ${e.checked?"switch--checked":""} ${e.disabled?"switch--disabled":""}`},r("div",{class:"switch__track"}),r("div",{class:"switch__thumb-underlay"},r("div",{class:"switch__thumb"},r("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})))),r("label",{onClick:e.onChange},e.label))),g=document.documentElement,j=(n,o)=>{const f=n.cell,m=n.column,j=n.row,_=n.shape?n.shape:f.shape?f.shape:m.shape?m.shape:null,C=!g.ketchup.objects.isEmptyKupObj(f.obj),I=!(!f.isEditable&&!m.isEditable||!n.editable),$=n.previousValue!==f.value?f.value:"",z=g.ketchup.data.cell.getType(f,_),D=Object.assign({},f.data);let F=f.cssClass?f.cssClass:m.cssClass?m.cssClass:"";const K={"f-cell":!0,[i.OBJ]:!!C,[z+"-cell"]:!0,[n.wrapperClass]:!!n.wrapperClass,[n.density]:!(!n.density||z===s.BAR),[F]:!!F};let V=$;I&&e.includes(z)?V=function(e,t,c,a,n){switch(e){case s.AUTOCOMPLETE:return r("kup-autocomplete",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-autocomplete-change":t=>v(t,n,e,u.UPDATE),"onkup-autocomplete-input":t=>v(t,n,e,u.INPUT),"onkup-autocomplete-iconclick":t=>v(t,n,e,u.ICON_CLICK)}));case s.CHECKBOX:return O(n)&&(t[i.C_CENTERED]=!0),r(p,Object.assign({},c.data,{onChange:t=>v(t,n,e,u.UPDATE)}));case s.CHIP:return r("kup-chip",Object.assign({},c.data,{type:b.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,n,e,u.UPDATE)}),r("kup-text-field",Object.assign({fullWidth:!0,slot:"field"},c.slotData)));case s.COLOR_PICKER:return r("kup-color-picker",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"",disabled:!1,"onkup-colorpicker-change":t=>v(t,n,e,u.UPDATE)}));case s.COMBOBOX:return r("kup-combobox",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-combobox-change":t=>v(t,n,e,u.UPDATE),"onkup-combobox-input":t=>v(t,n,e,u.INPUT),"onkup-combobox-iconclick":t=>v(t,n,e,u.ICON_CLICK)}));case s.DATE:return r("kup-date-picker",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-datepicker-change":t=>v(t,n,e,u.UPDATE),"onkup-datepicker-input":t=>v(t,n,e,u.INPUT)}));case s.MULTI_AUTOCOMPLETE:return r("kup-chip",Object.assign({displayId:!0},c.data,{type:b.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,n,e,u.UPDATE)}),r("kup-autocomplete",Object.assign({class:"kup-full-width",slot:"field",displayMode:w.DESCRIPTION_AND_CODE,selectMode:w.DESCRIPTION_AND_CODE,"onkup-autocomplete-input":t=>v(t,n,e,u.INPUT),"onkup-autocomplete-iconclick":t=>v(t,n,e,u.ICON_CLICK),showDropDownIcon:!1},c.slotData)));case s.MULTI_COMBOBOX:return r("kup-chip",Object.assign({displayId:!0},c.data,{type:b.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,n,e,u.UPDATE)}),r("kup-combobox",Object.assign({class:"kup-full-width",slot:"field",displayMode:w.DESCRIPTION_AND_CODE,selectMode:w.DESCRIPTION_AND_CODE,"onkup-combobox-input":t=>v(t,n,e,u.INPUT),"onkup-combobox-iconclick":t=>v(t,n,e,u.ICON_CLICK)},c.slotData)));case s.RATING:return r("kup-rating",Object.assign({key:a.name+n.row.id},c.data,{disabled:!1,"onkup-rating-click":t=>v(t,n,e,u.UPDATE)}));case s.SWITCH:return r(y,Object.assign({},c.data,{disabled:!1,onChange:t=>v(t,n,e,u.UPDATE)}));case s.TIME:return r("kup-time-picker",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-timepicker-change":t=>v(t,n,e,u.UPDATE),"onkup-timepicker-input":t=>v(t,n,e,u.INPUT)}));case s.NUMBER:t[i.C_RIGHT_ALIGNED]=!0;case s.LINK:case s.STRING:return r(d,Object.assign({inputType:e===s.NUMBER?"number":null,fullWidth:!!x(n)},c.data,{icon:c.data&&c.data.icon?c.data.icon:c.icon?c.icon:a.icon?a.icon:null,value:e===s.NUMBER?g.ketchup.math.numberifySafe(c.value).toString():c.value,onChange:t=>v(t,n,e,u.UPDATE),onInput:t=>v(t,n,e,u.INPUT),onIconClick:t=>v(t,n,e,u.ICON_CLICK)}))}}(z,K,f,m,n):f.data&&t.includes(z)?(n.setSizes&&function(e,t,c){switch(e){case s.BAR:t.sizeY||(t.sizeY="26px");break;case s.BUTTON:let e="";t.label&&(e="36px"),c.style?c.style.height||(c.style.minHeight=e):c.style={minHeight:e};break;case s.CHART:t.sizeX||(t.sizeX="100%"),t.sizeY||(t.sizeY="100%");break;case s.CHIP:case s.RADIO:c.style?c.style.height||(c.style.minHeight="40px"):c.style={minHeight:"40px"}}}(z,D,f),V=n.renderKup?function(e,t,c,a,n,o,l){switch(e){case s.BAR:return c.data?r("div",{style:{height:c.sizeY,width:"100%"}},r(k,Object.assign({},c))):r("kup-image",Object.assign({key:o.name+l.row.id},c));case s.BUTTON:return O(l)&&(t[i.C_CENTERED]=!0),r("kup-button",Object.assign({key:o.name+l.row.id},c,{"onkup-button-click":t=>v(t,l,e,u.CLICK)}));case s.BUTTON_LIST:return O(l)&&(t[i.C_CENTERED]=!0),c["data-storage"]={cell:a,row:n,column:o},r("kup-button-list",Object.assign({key:o.name+l.row.id},c));case s.CHART:return O(l)&&(t[i.C_CENTERED]=!0),r("kup-chart",Object.assign({key:o.name+l.row.id},c));case s.CHIP:return r(h,Object.assign({},c));case s.COLOR_PICKER:return r("kup-color-picker",Object.assign({key:o.name+l.row.id},c,{class:x(l)?"kup-full-width":"",disabled:!0}));case s.GAUGE:return r("kup-gauge",Object.assign({key:o.name+l.row.id,value:g.ketchup.math.numberifySafe(a.value),"width-component":"280px"},c));case s.KNOB:case s.PROGRESS_BAR:return r("kup-progress-bar",Object.assign({key:o.name+l.row.id},c));case s.RADIO:return O(l)&&(t[i.C_CENTERED]=!0),c.disabled=n.readOnly,r("kup-radio",Object.assign({key:o.name+l.row.id},c));case s.RATING:return r("kup-rating",Object.assign({key:o.name+l.row.id},c,{disabled:!0}))}}(z,K,D,f,j,m,n):r("span",{class:"cell-"+z+" placeholder"})):(n.setSizes&&function(e,t,c,n){switch(e){case s.CHECKBOX:case s.ICON:t.sizeX||(t.sizeX="18px"),t.sizeY||(t.sizeY="18px"),c.style?c.style.height||(c.style.minHeight=t.sizeY):c.style={minHeight:t.sizeY};break;case s.IMAGE:n.component.rootElement.tagName===a.BOX?(t.sizeY||(t.sizeY="auto"),void 0===t.fit&&(t.fit=!0)):t.sizeX||(t.sizeX="auto"),t.sizeY||(t.sizeY="64px")}}(z,D,f,n),V=function(e,t,c,a,n,o,u){switch(e){case s.AUTOCOMPLETE:case s.COMBOBOX:case s.DATE:case s.DATETIME:case s.TIME:if(c&&""!=c){const e=l(o,n);return r("div",{class:"f-cell__text"},e)}return c;case s.CHECKBOX:return O(u)&&(a[i.C_CENTERED]=!0),r(k,{resource:t.checked?"check_box":"check_box_outline_blank",sizeX:"18px",sizeY:"18px"});case s.EDITOR:return r("div",{innerHTML:n.value});case s.ICON:case s.IMAGE:return O(u)&&(a[i.C_CENTERED]=!0),t.badgeData&&(a[i.C_PADDED]=!0),r(k,Object.assign({},t));case s.LINK:return r("a",{href:c,target:"_blank"},n.value);case s.NUMBER:if(c&&""!=c){const e=g.ketchup.math.numberifySafe(n.value),t=l(o,n);return e<0&&(a[i.TEXT_DANGER]=!0),O(u)&&(a[i.C_RIGHT_ALIGNED]=!0),r("div",{class:"f-cell__text"},t)}return r("div",{class:"f-cell__text"},c);case s.SWITCH:return O(u)&&(a[i.C_CENTERED]=!0),t.disabled=!0,r(y,Object.assign({},t));default:return r("div",{class:"f-cell__text"},c)}}(z,D,V,K,f,m,n));let H=null;!I&&(m.icon||f.icon)&&V&&(H=r(k,Object.assign({},{color:`rgba(var(${c.TEXT}-rgb), 0.375)`,resource:f.icon?f.icon:m.icon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"obj-icon"})));let M=null;g.ketchup.debug.isDebug()&&C?M=f.obj.t+"; "+f.obj.p+"; "+f.obj.k+";":null!=f.title&&""!=f.title.trim()&&(M=f.title);let T=null;if(f.info){const e=Object.assign({},f.info);e.color||(e.color=`var(${c.INFO})`),e.icon||(e.icon="info"),T=r(k,Object.assign({},{color:e.color,resource:e.icon,sizeX:"1.25em",sizeY:"1.25em",title:e.message?e.message:"",wrapperClass:"cell-info"}))}return r("div",{onKeyUp:e=>v(e,n,z,u.KEYUP),class:K,"kup-get-cell-props":()=>n,ref:e=>f.element=e,style:f.style},r("div",{class:"f-cell__content",style:f.styleContent,title:M},o&&o.length>0?o:[n.indents,T,H,V]))};function v(e,t,c,a){const n=t.cell,i=t.column,o=t.component,r=t.row;let p=function(e,t){const c=!("INPUT"!==e.target.tagName);let a=c?e.target.value:e.detail.value;return t===s.NUMBER&&c&&(a=g.ketchup.math.formattedStringToNumberString(a,"")),a}(e,c);if(a===u.UPDATE){switch(c){case s.AUTOCOMPLETE:case s.COMBOBOX:case s.DATE:case s.TIME:n.data&&(n.data.initialValue=p);break;case s.CHECKBOX:case s.SWITCH:p="on"===p?"0":"1",n.data&&(n.data.checked="0"!==p);break;case s.CHIP:case s.MULTI_AUTOCOMPLETE:case s.MULTI_COMBOBOX:p=e.detail.stringifiedValues,n.data&&(n.data.data=e.detail.comp.data)}n.obj&&(n.obj.k=p.toString()),n.value=p.toString(),n.displayedValue=null,n.displayedValue=l(i,n)}if(o&&o.rootElement){const t=new CustomEvent(a,{bubbles:!0,cancelable:!0,composed:!0,detail:{comp:o,id:o.rootElement.id,cell:n,column:i,event:e,row:r,type:c}});if(o.rootElement.dispatchEvent(t),a===u.UPDATE)try{o.refresh()}catch(e){}}}function O(e){var t;return o.includes(null===(t=e.component)||void 0===t?void 0:t.rootElement.tagName)}function x(e){var t;return n.includes(null===(t=e.component)||void 0===t?void 0:t.rootElement.tagName)}export{j as F,w as I,m as K,f as a,y as b}
1
+ import{a9 as e,aa as t,b as c,a6 as s,ab as a,ac as n,ad as i,ae as o,af as l,ag as u}from"./p-46daf529.js";import{h as r}from"./p-3da7e4c6.js";import{F as p}from"./p-90576709.js";import{F as d}from"./p-c20c4f66.js";import{F as k}from"./p-9c7b9ff2.js";import{F as b,a as h}from"./p-d5491e4f.js";var f,m,w;!function(e){e.customStyle="Custom style of the component.",e.data="The data of the list.",e.displayMode="Selects how the items must display their label and how they can be filtered for.",e.filter="Keeps string for filtering elements when filter mode is active",e.hideText="Hides rows' text, ideally to display a list of icons only.",e.isMenu="Defines whether the list is a menu or not.",e.keyboardNavigation="When true, enables items' navigation through arrow keys.",e.menuVisible="Sets the status of the menu, when false it's hidden otherwise it's visible.",e.roleType="Defines the type of selection. Values accepted: listbox, radiogroup or group.",e.selectable="Defines whether items are selectable or not.",e.showIcons="Displays the icons associated to each row when set to true.",e.twoLine="The list elements descriptions will be arranged in two lines."}(f||(f={})),function(e){e.LISTBOX="listbox",e.RADIOGROUP="radiogroup",e.GROUP="group"}(m||(m={})),function(e){e.CODE="code",e.DESCRIPTION="description",e.DESCRIPTION_AND_CODE="both"}(w||(w={}));const y=e=>r("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}),r("div",{class:"form-field "+(e.leadingLabel?"form-field--align-end":"")},r("div",{class:`switch ${e.checked?"switch--checked":""} ${e.disabled?"switch--disabled":""}`},r("div",{class:"switch__track"}),r("div",{class:"switch__thumb-underlay"},r("div",{class:"switch__thumb"},r("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})))),r("label",{onClick:e.onChange},e.label))),g=document.documentElement,j=(n,o)=>{const f=n.cell,m=n.column,j=n.row,_=n.shape?n.shape:f.shape?f.shape:m.shape?m.shape:null,C=!g.ketchup.objects.isEmptyKupObj(f.obj),I=!(!f.isEditable&&!m.isEditable||!n.editable),$=n.previousValue!==f.value?f.value:"",z=g.ketchup.data.cell.getType(f,_),D=Object.assign({},f.data);let F=f.cssClass?f.cssClass:m.cssClass?m.cssClass:"";const K={"f-cell":!0,[i.OBJ]:!!C,[z+"-cell"]:!0,[n.wrapperClass]:!!n.wrapperClass,[n.density]:!(!n.density||z===s.BAR),[F]:!!F};let V=$;I&&e.includes(z)?V=function(e,t,c,a,n){switch(e){case s.AUTOCOMPLETE:return r("kup-autocomplete",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-autocomplete-change":t=>v(t,n,e,u.UPDATE),"onkup-autocomplete-input":t=>v(t,n,e,u.INPUT),"onkup-autocomplete-iconclick":t=>v(t,n,e,u.ICON_CLICK)}));case s.CHECKBOX:return O(n)&&(t[i.C_CENTERED]=!0),r(p,Object.assign({},c.data,{onChange:t=>v(t,n,e,u.UPDATE)}));case s.CHIP:return r("kup-chip",Object.assign({},c.data,{type:b.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,n,e,u.UPDATE)}),r("kup-text-field",Object.assign({fullWidth:!0,slot:"field"},c.slotData)));case s.COLOR_PICKER:return r("kup-color-picker",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"",disabled:!1,"onkup-colorpicker-change":t=>v(t,n,e,u.UPDATE)}));case s.COMBOBOX:return r("kup-combobox",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-combobox-change":t=>v(t,n,e,u.UPDATE),"onkup-combobox-input":t=>v(t,n,e,u.INPUT),"onkup-combobox-iconclick":t=>v(t,n,e,u.ICON_CLICK)}));case s.DATE:return r("kup-date-picker",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-datepicker-change":t=>v(t,n,e,u.UPDATE),"onkup-datepicker-input":t=>v(t,n,e,u.INPUT)}));case s.MULTI_AUTOCOMPLETE:return r("kup-chip",Object.assign({displayId:!0},c.data,{type:b.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,n,e,u.UPDATE)}),r("kup-autocomplete",Object.assign({class:"kup-full-width",slot:"field",displayMode:w.DESCRIPTION_AND_CODE,selectMode:w.DESCRIPTION_AND_CODE,"onkup-autocomplete-input":t=>v(t,n,e,u.INPUT),"onkup-autocomplete-iconclick":t=>v(t,n,e,u.ICON_CLICK),showDropDownIcon:!1},c.slotData)));case s.MULTI_COMBOBOX:return r("kup-chip",Object.assign({displayId:!0},c.data,{type:b.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,n,e,u.UPDATE)}),r("kup-combobox",Object.assign({class:"kup-full-width",slot:"field",displayMode:w.DESCRIPTION_AND_CODE,selectMode:w.DESCRIPTION_AND_CODE,"onkup-combobox-input":t=>v(t,n,e,u.INPUT),"onkup-combobox-iconclick":t=>v(t,n,e,u.ICON_CLICK)},c.slotData)));case s.RATING:return r("kup-rating",Object.assign({key:a.name+n.row.id},c.data,{disabled:!1,"onkup-rating-click":t=>v(t,n,e,u.UPDATE)}));case s.SWITCH:return r(y,Object.assign({},c.data,{disabled:!1,onChange:t=>v(t,n,e,u.UPDATE)}));case s.TIME:return r("kup-time-picker",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-timepicker-change":t=>v(t,n,e,u.UPDATE),"onkup-timepicker-input":t=>v(t,n,e,u.INPUT)}));case s.NUMBER:t[i.C_RIGHT_ALIGNED]=!0;case s.LINK:case s.STRING:return r(d,Object.assign({inputType:e===s.NUMBER?"number":null,fullWidth:!!x(n)},c.data,{icon:c.data&&c.data.icon?c.data.icon:c.icon?c.icon:a.icon?a.icon:null,value:e===s.NUMBER&&c.value?g.ketchup.math.numberifySafe(c.value).toString():c.value,onChange:t=>v(t,n,e,u.UPDATE),onInput:t=>v(t,n,e,u.INPUT),onIconClick:t=>v(t,n,e,u.ICON_CLICK)}))}}(z,K,f,m,n):f.data&&t.includes(z)?(n.setSizes&&function(e,t,c){switch(e){case s.BAR:t.sizeY||(t.sizeY="26px");break;case s.BUTTON:let e="";t.label&&(e="36px"),c.style?c.style.height||(c.style.minHeight=e):c.style={minHeight:e};break;case s.CHART:t.sizeX||(t.sizeX="100%"),t.sizeY||(t.sizeY="100%");break;case s.CHIP:case s.RADIO:c.style?c.style.height||(c.style.minHeight="40px"):c.style={minHeight:"40px"}}}(z,D,f),V=n.renderKup?function(e,t,c,a,n,o,l){switch(e){case s.BAR:return c.data?r("div",{style:{height:c.sizeY,width:"100%"}},r(k,Object.assign({},c))):r("kup-image",Object.assign({key:o.name+l.row.id},c));case s.BUTTON:return O(l)&&(t[i.C_CENTERED]=!0),r("kup-button",Object.assign({key:o.name+l.row.id},c,{"onkup-button-click":t=>v(t,l,e,u.CLICK)}));case s.BUTTON_LIST:return O(l)&&(t[i.C_CENTERED]=!0),c["data-storage"]={cell:a,row:n,column:o},r("kup-button-list",Object.assign({key:o.name+l.row.id},c));case s.CHART:return O(l)&&(t[i.C_CENTERED]=!0),r("kup-chart",Object.assign({key:o.name+l.row.id},c));case s.CHIP:return r(h,Object.assign({},c));case s.COLOR_PICKER:return r("kup-color-picker",Object.assign({key:o.name+l.row.id},c,{class:x(l)?"kup-full-width":"",disabled:!0}));case s.GAUGE:return r("kup-gauge",Object.assign({key:o.name+l.row.id,value:g.ketchup.math.numberifySafe(a.value),"width-component":"280px"},c));case s.KNOB:case s.PROGRESS_BAR:return r("kup-progress-bar",Object.assign({key:o.name+l.row.id},c));case s.RADIO:return O(l)&&(t[i.C_CENTERED]=!0),c.disabled=n.readOnly,r("kup-radio",Object.assign({key:o.name+l.row.id},c));case s.RATING:return r("kup-rating",Object.assign({key:o.name+l.row.id},c,{disabled:!0}))}}(z,K,D,f,j,m,n):r("span",{class:"cell-"+z+" placeholder"})):(n.setSizes&&function(e,t,c,n){switch(e){case s.CHECKBOX:case s.ICON:t.sizeX||(t.sizeX="18px"),t.sizeY||(t.sizeY="18px"),c.style?c.style.height||(c.style.minHeight=t.sizeY):c.style={minHeight:t.sizeY};break;case s.IMAGE:n.component.rootElement.tagName===a.BOX?(t.sizeY||(t.sizeY="auto"),void 0===t.fit&&(t.fit=!0)):t.sizeX||(t.sizeX="auto"),t.sizeY||(t.sizeY="64px")}}(z,D,f,n),V=function(e,t,c,a,n,o,u){switch(e){case s.AUTOCOMPLETE:case s.COMBOBOX:case s.DATE:case s.DATETIME:case s.TIME:if(c&&""!=c){const e=l(o,n);return r("div",{class:"f-cell__text"},e)}return c;case s.CHECKBOX:return O(u)&&(a[i.C_CENTERED]=!0),r(k,{resource:t.checked?"check_box":"check_box_outline_blank",sizeX:"18px",sizeY:"18px"});case s.EDITOR:return r("div",{innerHTML:n.value});case s.ICON:case s.IMAGE:return O(u)&&(a[i.C_CENTERED]=!0),t.badgeData&&(a[i.C_PADDED]=!0),r(k,Object.assign({},t));case s.LINK:return r("a",{href:c,target:"_blank"},n.value);case s.NUMBER:if(c&&""!=c){const e=g.ketchup.math.numberifySafe(n.value),t=l(o,n);return e<0&&(a[i.TEXT_DANGER]=!0),O(u)&&(a[i.C_RIGHT_ALIGNED]=!0),r("div",{class:"f-cell__text"},t)}return r("div",{class:"f-cell__text"},c);case s.SWITCH:return O(u)&&(a[i.C_CENTERED]=!0),t.disabled=!0,r(y,Object.assign({},t));default:return r("div",{class:"f-cell__text"},c)}}(z,D,V,K,f,m,n));let H=null;!I&&(m.icon||f.icon)&&V&&(H=r(k,Object.assign({},{color:`rgba(var(${c.TEXT}-rgb), 0.375)`,resource:f.icon?f.icon:m.icon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"obj-icon"})));let M=null;g.ketchup.debug.isDebug()&&C?M=f.obj.t+"; "+f.obj.p+"; "+f.obj.k+";":null!=f.title&&""!=f.title.trim()&&(M=f.title);let T=null;if(f.info){const e=Object.assign({},f.info);e.color||(e.color=`var(${c.INFO})`),e.icon||(e.icon="info"),T=r(k,Object.assign({},{color:e.color,resource:e.icon,sizeX:"1.25em",sizeY:"1.25em",title:e.message?e.message:"",wrapperClass:"cell-info"}))}return r("div",{onKeyUp:e=>v(e,n,z,u.KEYUP),class:K,"kup-get-cell-props":()=>n,ref:e=>f.element=e,style:f.style},r("div",{class:"f-cell__content",style:f.styleContent,title:M},o&&o.length>0?o:[n.indents,T,H,V]))};function v(e,t,c,a){const n=t.cell,i=t.column,o=t.component,r=t.row;let p=function(e,t){const c=!("INPUT"!==e.target.tagName);let a=c?e.target.value:e.detail.value;return t===s.NUMBER&&c&&(a=g.ketchup.math.formattedStringToNumberString(a,"")),a}(e,c);if(a===u.UPDATE){switch(c){case s.AUTOCOMPLETE:case s.COMBOBOX:case s.DATE:case s.TIME:n.data&&(n.data.initialValue=p);break;case s.CHECKBOX:case s.SWITCH:p="on"===p?"0":"1",n.data&&(n.data.checked="0"!==p);break;case s.CHIP:case s.MULTI_AUTOCOMPLETE:case s.MULTI_COMBOBOX:p=e.detail.stringifiedValues,n.data&&(n.data.data=e.detail.comp.data)}n.obj&&(n.obj.k=p.toString()),n.value=p.toString(),n.displayedValue=null,n.displayedValue=l(i,n)}if(o&&o.rootElement){const t=new CustomEvent(a,{bubbles:!0,cancelable:!0,composed:!0,detail:{comp:o,id:o.rootElement.id,cell:n,column:i,event:e,row:r,type:c}});if(o.rootElement.dispatchEvent(t),a===u.UPDATE)try{o.refresh()}catch(e){}}}function O(e){var t;return o.includes(null===(t=e.component)||void 0===t?void 0:t.rootElement.tagName)}function x(e){var t;return n.includes(null===(t=e.component)||void 0===t?void 0:t.rootElement.tagName)}export{j as F,w as I,m as K,f as a,y as b}
@@ -1 +1 @@
1
- import{r as t,f as s,h as i,H as e,g as h}from"./p-3da7e4c6.js";import{k as o,d as n,g as r,s as a,V as l,m as c}from"./p-46daf529.js";import{c as d}from"./p-ad2e21d2.js";import{F as p}from"./p-279eab92.js";import"./p-90576709.js";import"./p-9cc4dd44.js";import"./p-9c7b9ff2.js";import"./p-d5491e4f.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}
1
+ import{r as t,f as s,h as i,H as e,g as h}from"./p-3da7e4c6.js";import{k as o,d as n,g as r,s as l,V as a,m as c}from"./p-46daf529.js";import{c as d}from"./p-ad2e21d2.js";import{F as p}from"./p-e16c04d8.js";import"./p-90576709.js";import"./p-c20c4f66.js";import"./p-9c7b9ff2.js";import"./p-d5491e4f.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){l(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},a.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}
@@ -1 +1 @@
1
- import{r as t,c as i,f as s,h as e,H as o,g as n}from"./p-3da7e4c6.js";import{F as r}from"./p-ffbd77d5.js";import{F as a}from"./p-90576709.js";import{F as h}from"./p-9cc4dd44.js";import{F as c}from"./p-fb03f2f5.js";import{k as l,g as d,s as u,al as m,m as p,V as f,c as g}from"./p-46daf529.js";import{c as x}from"./p-ad2e21d2.js";import"./p-0fd98ab4.js";import"./p-9c7b9ff2.js";import"./p-6507e9eb.js";var b;!function(t){t.customStyle="Custom style of the component.",t.data="The data of the component.",t.enableDesign="When set to true, the component is in design mode and it is draggable."}(b||(b={}));const y=class{constructor(s){t(this,s),this.kupSave=i(this,"kup-dashboard-save",6),this.kupManager=l(),this.internalData=null,this.internalDataBackup=null,this.resetInternalData=!1,this.customStyle="",this.data=null,this.enableDesign=!1}onKupSave(){this.kupSave.emit({comp:this,id:this.rootElement.id,data:this.internalData})}dataChanged(){this.resetData()}async getProps(t){return d(this,b,t)}async refresh(){s(this)}async setProps(t){u(this,b,t)}buildGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=16*Math.random()|0;return("x"===t?i:3&i|8).toString(16)}))}buildHeader(){const t={icon:"cancel",label:this.kupManager.language.translate(m.RESET),secondary:!0,onClick:()=>{this.resetData()}},i={icon:"save",label:this.kupManager.language.translate(m.SAVE),onClick:()=>this.onKupSave()};return e("div",{class:"header"},this.enableDesign?e(r,Object.assign({},t)):void 0,this.enableDesign?e(r,Object.assign({},i)):void 0)}buildForm(t,i){return t?e("div",{class:{form:!0,"layout-column":t&&"column"==t.layout,"layout-row":t&&"row"==t.layout,"form-dropzone":this.enableDesign&&t&&null!=t.sections&&t.sections.length>0},style:this.getGridStyle(t),ref:s=>{s&&(s.kupData={parent:i,form:t})}},t.sections.map((i=>this.buildSection(i,t)))):e("div",null,this.kupManager.language.translate(p.EMPTY_DATA))}buildSectionHeader(t,i){const s={value:t.dim,label:this.kupManager.language.translate(m.DIMENSION),onChange:i=>{const{target:s}=i;t.dim=s.value,this.refresh()}},o={icon:"add",slim:!0,onClick:()=>{t.sections||(t.sections=[]),t.sections.push({id:t.id+(t.sections.length+1),loaded:t.loaded,layout:t.layout}),this.resetData(this.internalData)}},n={icon:"remove",slim:!0,secondary:!0,onClick:()=>{const s=i.sections.indexOf(t);i.sections.splice(s,1),this.resetData(this.internalData)}},c={checked:t.loaded,label:this.kupManager.language.translate(m.LOADED),onChange:()=>{t.loaded=!t.loaded,this.refresh()}},l={checked:"column"==t.layout,label:this.kupManager.language.translate(m.VERTICAL),onChange:()=>{t.layout="column"==t.layout?"row":"column",this.refresh()}};return e("div",{class:"section-header"},e("div",null,t.id," - ",t.layout),e("div",null,e("div",{class:"section-header-actions"},e(h,Object.assign({},s)),e(a,Object.assign({},c)),e(a,Object.assign({},l)),e(r,Object.assign({},o)),e(r,Object.assign({},n)))))}buildSection(t,i){const s={"section-body":!0,"layout-column":t&&"column"==t.layout,"layout-row":t&&"row"==t.layout};return e("div",{class:{section:!0,"section-draggable":this.enableDesign,"section-dropzone":this.enableDesign},ref:s=>{s&&(s.kupData={parent:i,section:t})}},this.enableDesign?this.buildSectionHeader(t,i):void 0,e("div",{class:s,style:this.getGridStyle(t)},this.enableDesign||!t.loaded||t.sections&&0!=t.sections.length?void 0:e("slot",{name:t.id}),t.sections&&(t.loaded||this.enableDesign)?t.sections.map((i=>this.buildSection(i,t))):void 0))}calcSectionPosition(t,i,s,e,o){let n=e;for(let e=0;e<o.length;e++){const r=o[e].getBoundingClientRect();if(s&&t<r.y){n=e;break}if(!s&&i<r.x){n=e;break}}return n}didRenderInteractables(){try{const t=[];this.rootElement.shadowRoot.querySelectorAll(".section-draggable").forEach((i=>t.push(i))),t.forEach((t=>{this.kupManager.interact.draggable(t,null,null,f.CLONE)}))}catch(t){this.kupManager.debug.logMessage(this,t,g.ERROR)}try{const t=[];this.rootElement.shadowRoot.querySelectorAll(".section-dropzone").forEach((i=>t.push(i))),this.rootElement.shadowRoot.querySelectorAll(".form-dropzone").forEach((i=>t.push(i))),t.forEach((t=>{this.kupManager.interact.dropzone(t,{ondropdeactivate:()=>{this.removeSectionPlaceHolder()},ondropmove:t=>{this.removeSectionPlaceHolder(),this.dragEnter(t.dragEvent.clientY,t.dragEvent.clientX,t.currentTarget)}},null,{drop:t=>{this.dropped(t,t.currentTarget,t.relatedTarget)}})}))}catch(t){this.kupManager.debug.logMessage(this,t,g.ERROR)}}dragEnter(t,i,s){if(s.kupData.form){const e=this.calcSectionPosition(t,i,"column"==s.kupData.form.layout,s.kupData.form.sections.length,s.children);this.setSectionPlaceHolder(s,e)}else if(s.kupData.section){const e=this.calcSectionPosition(t,i,"column"==s.kupData.section.layout,s.kupData.section.sections.length,s.lastElementChild.children);this.setSectionPlaceHolder(s.lastElementChild,e)}}dropped(t,i,s){const e=s.kupData.parent.sections.indexOf(s.kupData.section);if(s.kupData.parent.sections.splice(e,1),i.kupData.form){i.kupData.form.sections||(i.kupData.form.sections=[]);const e=this.calcSectionPosition(t.dragEvent.clientY,t.dragEvent.clientX,"column"==i.kupData.form.layout,i.kupData.form.sections.length,i.children);i.kupData.form.sections.splice(e,0,s.kupData.section),s.kupData.parent=i.kupData.form}else if(i.kupData.section){if(!i.kupData.section.sections||0==i.kupData.section.sections.length){const t=JSON.parse(JSON.stringify(i.kupData.section));t.dim=null,s.kupData.section.dim=null,i.kupData.section.id=this.buildGuid(),i.kupData.section.sections=[],i.kupData.section.sections.push(t)}const e=this.calcSectionPosition(t.dragEvent.clientY,t.dragEvent.clientX,"column"==i.kupData.section.layout,i.kupData.section.sections.length,i.lastElementChild.children);i.kupData.section.sections.splice(e,0,s.kupData.section),s.kupData.parent=i.kupData.section}this.resetData(this.internalData)}getGridStyle(t){let i={};if(t.sections){let s="";t.sections.forEach((t=>{s+=this.enableDesign||!t.dim?" 1fr":t.dim.indexOf("%")<0?" "+t.dim+"px":" "+t.dim})),"column"==t.layout&&(i.gridTemplateRows=s),"row"==t.layout&&(i.gridTemplateColumns=s)}return i}setSectionPlaceHolder(t,i){const s=document.createElement("div");s.className="section-placeholder",t.insertBefore(s,t.childNodes[i])}removeSectionPlaceHolder(){const t=this.rootElement.shadowRoot.querySelector(".section-placeholder");t&&t.parentElement.removeChild(t)}resetData(t=null){t&&(this.internalDataBackup=t),this.resetInternalData=!0,setTimeout((()=>{this.internalDataBackup&&(this.internalData=this.internalDataBackup,this.internalDataBackup=null),this.resetInternalData=!1}),250)}unregisterInteractables(){this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".section-dropzone"))),this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".section-draggable"))),this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".form-dropzone")))}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),this.resetInternalData?(this.internalData=null,this.unregisterInteractables()):this.internalData||(this.internalData=JSON.parse(JSON.stringify(this.data)))}componentDidRender(){this.kupManager.debug.logRender(this,!0);const t=this.rootElement.shadowRoot;if(t){const i=t.querySelectorAll(".f-text-field");i&&i.forEach((t=>{c(t)}))}this.didRenderInteractables()}render(){return e(o,null,e("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{id:x},this.buildHeader(),this.buildForm(this.internalData,null)))}disconnectedCallback(){this.unregisterInteractables(),this.kupManager.dates.unregister(this),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return n(this)}static get watchers(){return{data:["dataChanged"]}}};y.style=":host{width:100%;height:100%}#kup-component{height:100%}.header{display:flex;flex-direction:row;justify-content:center}.header>*{margin-left:0.5em}.form{display:grid;height:100%}.form-dropzone{padding:1em;grid-gap:0.5em;border:1px solid var(--kup-primary-color);height:auto}.section{display:flex;flex-direction:column;overflow:auto}.section-header{display:flex;flex-direction:column}.section-header>*{width:100%;display:flex;flex-direction:row}.section-header>*>.section-header-actions{display:flex;justify-content:end}.section-header>*>.section-header-actions>*{margin-top:auto;margin-bottom:auto}.section-body{display:grid}.section-dropzone{border:1px solid var(--kup-primary-color)}.section-draggable{border:1px solid var(--kup-secondary-color);padding:1em}.section-placeholder{background-color:rgba(var(--kup-secondary-color-rgb), 0.5);min-height:1em;min-width:1em}.component{height:fit-content;padding:1em;margin:0.5em}.layout-row{grid-auto-flow:column;grid-template-columns:min-content}.layout-column{grid-auto-flow:row;grid-template-rows:min-content}";export{y as kup_dashboard}
1
+ import{r as t,c as i,f as s,h as e,H as o,g as n}from"./p-3da7e4c6.js";import{F as r}from"./p-ffbd77d5.js";import{F as a}from"./p-90576709.js";import{F as h}from"./p-c20c4f66.js";import{F as c}from"./p-fb03f2f5.js";import{k as l,g as d,s as u,al as m,m as p,V as f,c as g}from"./p-46daf529.js";import{c as x}from"./p-ad2e21d2.js";import"./p-0fd98ab4.js";import"./p-9c7b9ff2.js";import"./p-6507e9eb.js";var b;!function(t){t.customStyle="Custom style of the component.",t.data="The data of the component.",t.enableDesign="When set to true, the component is in design mode and it is draggable."}(b||(b={}));const y=class{constructor(s){t(this,s),this.kupSave=i(this,"kup-dashboard-save",6),this.kupManager=l(),this.internalData=null,this.internalDataBackup=null,this.resetInternalData=!1,this.customStyle="",this.data=null,this.enableDesign=!1}onKupSave(){this.kupSave.emit({comp:this,id:this.rootElement.id,data:this.internalData})}dataChanged(){this.resetData()}async getProps(t){return d(this,b,t)}async refresh(){s(this)}async setProps(t){u(this,b,t)}buildGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=16*Math.random()|0;return("x"===t?i:3&i|8).toString(16)}))}buildHeader(){const t={icon:"cancel",label:this.kupManager.language.translate(m.RESET),secondary:!0,onClick:()=>{this.resetData()}},i={icon:"save",label:this.kupManager.language.translate(m.SAVE),onClick:()=>this.onKupSave()};return e("div",{class:"header"},this.enableDesign?e(r,Object.assign({},t)):void 0,this.enableDesign?e(r,Object.assign({},i)):void 0)}buildForm(t,i){return t?e("div",{class:{form:!0,"layout-column":t&&"column"==t.layout,"layout-row":t&&"row"==t.layout,"form-dropzone":this.enableDesign&&t&&null!=t.sections&&t.sections.length>0},style:this.getGridStyle(t),ref:s=>{s&&(s.kupData={parent:i,form:t})}},t.sections.map((i=>this.buildSection(i,t)))):e("div",null,this.kupManager.language.translate(p.EMPTY_DATA))}buildSectionHeader(t,i){const s={value:t.dim,label:this.kupManager.language.translate(m.DIMENSION),onChange:i=>{const{target:s}=i;t.dim=s.value,this.refresh()}},o={icon:"add",slim:!0,onClick:()=>{t.sections||(t.sections=[]),t.sections.push({id:t.id+(t.sections.length+1),loaded:t.loaded,layout:t.layout}),this.resetData(this.internalData)}},n={icon:"remove",slim:!0,secondary:!0,onClick:()=>{const s=i.sections.indexOf(t);i.sections.splice(s,1),this.resetData(this.internalData)}},c={checked:t.loaded,label:this.kupManager.language.translate(m.LOADED),onChange:()=>{t.loaded=!t.loaded,this.refresh()}},l={checked:"column"==t.layout,label:this.kupManager.language.translate(m.VERTICAL),onChange:()=>{t.layout="column"==t.layout?"row":"column",this.refresh()}};return e("div",{class:"section-header"},e("div",null,t.id," - ",t.layout),e("div",null,e("div",{class:"section-header-actions"},e(h,Object.assign({},s)),e(a,Object.assign({},c)),e(a,Object.assign({},l)),e(r,Object.assign({},o)),e(r,Object.assign({},n)))))}buildSection(t,i){const s={"section-body":!0,"layout-column":t&&"column"==t.layout,"layout-row":t&&"row"==t.layout};return e("div",{class:{section:!0,"section-draggable":this.enableDesign,"section-dropzone":this.enableDesign},ref:s=>{s&&(s.kupData={parent:i,section:t})}},this.enableDesign?this.buildSectionHeader(t,i):void 0,e("div",{class:s,style:this.getGridStyle(t)},this.enableDesign||!t.loaded||t.sections&&0!=t.sections.length?void 0:e("slot",{name:t.id}),t.sections&&(t.loaded||this.enableDesign)?t.sections.map((i=>this.buildSection(i,t))):void 0))}calcSectionPosition(t,i,s,e,o){let n=e;for(let e=0;e<o.length;e++){const r=o[e].getBoundingClientRect();if(s&&t<r.y){n=e;break}if(!s&&i<r.x){n=e;break}}return n}didRenderInteractables(){try{const t=[];this.rootElement.shadowRoot.querySelectorAll(".section-draggable").forEach((i=>t.push(i))),t.forEach((t=>{this.kupManager.interact.draggable(t,null,null,f.CLONE)}))}catch(t){this.kupManager.debug.logMessage(this,t,g.ERROR)}try{const t=[];this.rootElement.shadowRoot.querySelectorAll(".section-dropzone").forEach((i=>t.push(i))),this.rootElement.shadowRoot.querySelectorAll(".form-dropzone").forEach((i=>t.push(i))),t.forEach((t=>{this.kupManager.interact.dropzone(t,{ondropdeactivate:()=>{this.removeSectionPlaceHolder()},ondropmove:t=>{this.removeSectionPlaceHolder(),this.dragEnter(t.dragEvent.clientY,t.dragEvent.clientX,t.currentTarget)}},null,{drop:t=>{this.dropped(t,t.currentTarget,t.relatedTarget)}})}))}catch(t){this.kupManager.debug.logMessage(this,t,g.ERROR)}}dragEnter(t,i,s){if(s.kupData.form){const e=this.calcSectionPosition(t,i,"column"==s.kupData.form.layout,s.kupData.form.sections.length,s.children);this.setSectionPlaceHolder(s,e)}else if(s.kupData.section){const e=this.calcSectionPosition(t,i,"column"==s.kupData.section.layout,s.kupData.section.sections.length,s.lastElementChild.children);this.setSectionPlaceHolder(s.lastElementChild,e)}}dropped(t,i,s){const e=s.kupData.parent.sections.indexOf(s.kupData.section);if(s.kupData.parent.sections.splice(e,1),i.kupData.form){i.kupData.form.sections||(i.kupData.form.sections=[]);const e=this.calcSectionPosition(t.dragEvent.clientY,t.dragEvent.clientX,"column"==i.kupData.form.layout,i.kupData.form.sections.length,i.children);i.kupData.form.sections.splice(e,0,s.kupData.section),s.kupData.parent=i.kupData.form}else if(i.kupData.section){if(!i.kupData.section.sections||0==i.kupData.section.sections.length){const t=JSON.parse(JSON.stringify(i.kupData.section));t.dim=null,s.kupData.section.dim=null,i.kupData.section.id=this.buildGuid(),i.kupData.section.sections=[],i.kupData.section.sections.push(t)}const e=this.calcSectionPosition(t.dragEvent.clientY,t.dragEvent.clientX,"column"==i.kupData.section.layout,i.kupData.section.sections.length,i.lastElementChild.children);i.kupData.section.sections.splice(e,0,s.kupData.section),s.kupData.parent=i.kupData.section}this.resetData(this.internalData)}getGridStyle(t){let i={};if(t.sections){let s="";t.sections.forEach((t=>{s+=this.enableDesign||!t.dim?" 1fr":t.dim.indexOf("%")<0?" "+t.dim+"px":" "+t.dim})),"column"==t.layout&&(i.gridTemplateRows=s),"row"==t.layout&&(i.gridTemplateColumns=s)}return i}setSectionPlaceHolder(t,i){const s=document.createElement("div");s.className="section-placeholder",t.insertBefore(s,t.childNodes[i])}removeSectionPlaceHolder(){const t=this.rootElement.shadowRoot.querySelector(".section-placeholder");t&&t.parentElement.removeChild(t)}resetData(t=null){t&&(this.internalDataBackup=t),this.resetInternalData=!0,setTimeout((()=>{this.internalDataBackup&&(this.internalData=this.internalDataBackup,this.internalDataBackup=null),this.resetInternalData=!1}),250)}unregisterInteractables(){this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".section-dropzone"))),this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".section-draggable"))),this.kupManager.interact.unregister(Array.from(this.rootElement.shadowRoot.querySelectorAll(".form-dropzone")))}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),this.resetInternalData?(this.internalData=null,this.unregisterInteractables()):this.internalData||(this.internalData=JSON.parse(JSON.stringify(this.data)))}componentDidRender(){this.kupManager.debug.logRender(this,!0);const t=this.rootElement.shadowRoot;if(t){const i=t.querySelectorAll(".f-text-field");i&&i.forEach((t=>{c(t)}))}this.didRenderInteractables()}render(){return e(o,null,e("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{id:x},this.buildHeader(),this.buildForm(this.internalData,null)))}disconnectedCallback(){this.unregisterInteractables(),this.kupManager.dates.unregister(this),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return n(this)}static get watchers(){return{data:["dataChanged"]}}};y.style=":host{width:100%;height:100%}#kup-component{height:100%}.header{display:flex;flex-direction:row;justify-content:center}.header>*{margin-left:0.5em}.form{display:grid;height:100%}.form-dropzone{padding:1em;grid-gap:0.5em;border:1px solid var(--kup-primary-color);height:auto}.section{display:flex;flex-direction:column;overflow:auto}.section-header{display:flex;flex-direction:column}.section-header>*{width:100%;display:flex;flex-direction:row}.section-header>*>.section-header-actions{display:flex;justify-content:end}.section-header>*>.section-header-actions>*{margin-top:auto;margin-bottom:auto}.section-body{display:grid}.section-dropzone{border:1px solid var(--kup-primary-color)}.section-draggable{border:1px solid var(--kup-secondary-color);padding:1em}.section-placeholder{background-color:rgba(var(--kup-secondary-color-rgb), 0.5);min-height:1em;min-width:1em}.component{height:fit-content;padding:1em;margin:0.5em}.layout-row{grid-auto-flow:column;grid-template-columns:min-content}.layout-column{grid-auto-flow:row;grid-template-rows:min-content}";export{y as kup_dashboard}
@@ -14,6 +14,7 @@ export declare enum KupTextFieldProps {
14
14
  helper = "When set, its content will be shown as a help text below the field.",
15
15
  helperEnabled = "When true, the helper will be displayed.",
16
16
  helperWhenFocused = "When set, the helper will be shown only when the field is focused.",
17
+ hiddenCounter = "Hides the character counter.",
17
18
  icon = "When set, the text-field will show this icon.",
18
19
  initialValue = "Sets the initial value of the component",
19
20
  inputMode = "The HTML inputmode of the input element. It has no effect on text areas.",
@@ -63,6 +63,11 @@ export declare class KupTextField {
63
63
  * @default false
64
64
  */
65
65
  helperWhenFocused: boolean;
66
+ /**
67
+ * Hides the character counter.
68
+ * @default false
69
+ */
70
+ hiddenCounter: boolean;
66
71
  /**
67
72
  * When set, the text-field will show this icon.
68
73
  * @default null
@@ -3109,6 +3109,11 @@ export namespace Components {
3109
3109
  * @default false
3110
3110
  */
3111
3111
  "helperWhenFocused": boolean;
3112
+ /**
3113
+ * Hides the character counter.
3114
+ * @default false
3115
+ */
3116
+ "hiddenCounter": boolean;
3112
3117
  /**
3113
3118
  * When set, the text-field will show this icon.
3114
3119
  * @default null
@@ -6407,6 +6412,11 @@ declare namespace LocalJSX {
6407
6412
  * @default false
6408
6413
  */
6409
6414
  "helperWhenFocused"?: boolean;
6415
+ /**
6416
+ * Hides the character counter.
6417
+ * @default false
6418
+ */
6419
+ "hiddenCounter"?: boolean;
6410
6420
  /**
6411
6421
  * When set, the text-field will show this icon.
6412
6422
  * @default null
@@ -12,6 +12,7 @@ export interface FTextFieldProps extends FComponent {
12
12
  helper?: string;
13
13
  helperEnabled?: boolean;
14
14
  helperWhenFocused?: boolean;
15
+ hiddenCounter?: boolean;
15
16
  icon?: string;
16
17
  inputMode?: string;
17
18
  inputType?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sme.up/ketchup",
3
- "version": "8.2.1",
3
+ "version": "8.2.2",
4
4
  "keywords": [
5
5
  "smeup",
6
6
  "KetchUP",