@sme.up/ketchup 8.3.1 → 8.3.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 (109) hide show
  1. package/dist/cjs/{f-button-d073c79d.js → f-button-be5c564a.js} +2 -2
  2. package/dist/cjs/{f-cell-b7ddd6b3.js → f-cell-d034bcb0.js} +7 -7
  3. package/dist/cjs/{f-checkbox-aa34efd5.js → f-checkbox-cff77b2c.js} +1 -1
  4. package/dist/cjs/{f-chip-e51596be.js → f-chip-bc678bf1.js} +3 -3
  5. package/dist/cjs/{f-image-fb2721a7.js → f-image-8542c984.js} +2 -2
  6. package/dist/cjs/{f-paginator-utils-5bce6819.js → f-paginator-utils-f48afc35.js} +3 -3
  7. package/dist/cjs/{f-text-field-acb225f3.js → f-text-field-acfc1717.js} +2 -2
  8. package/dist/cjs/{index-dd9f2b9b.js → index-a9a3b467.js} +3 -0
  9. package/dist/cjs/ketchup.cjs.js +1 -1
  10. package/dist/cjs/kup-accordion.cjs.entry.js +3 -3
  11. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +10 -10
  12. package/dist/cjs/kup-box.cjs.entry.js +10 -10
  13. package/dist/cjs/kup-calendar.cjs.entry.js +5 -5
  14. package/dist/cjs/kup-cell.cjs.entry.js +7 -7
  15. package/dist/cjs/kup-dash-list.cjs.entry.js +2 -2
  16. package/dist/cjs/kup-dash_2.cjs.entry.js +2 -2
  17. package/dist/cjs/kup-dashboard.cjs.entry.js +6 -6
  18. package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
  19. package/dist/cjs/kup-echart.cjs.entry.js +2 -2
  20. package/dist/cjs/kup-family-tree.cjs.entry.js +4 -4
  21. package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
  22. package/dist/cjs/kup-image-list.cjs.entry.js +8 -8
  23. package/dist/cjs/kup-lazy.cjs.entry.js +2 -2
  24. package/dist/cjs/kup-magic-box.cjs.entry.js +3 -3
  25. package/dist/cjs/{kup-manager-39f99670.js → kup-manager-b3677c1d.js} +1 -1
  26. package/dist/cjs/kup-nav-bar.cjs.entry.js +2 -2
  27. package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
  28. package/dist/cjs/kup-photo-frame.cjs.entry.js +2 -2
  29. package/dist/cjs/kup-planner.cjs.entry.js +3 -3
  30. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  31. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  32. package/dist/cjs/kup-snackbar.cjs.entry.js +4 -4
  33. package/dist/cjs/loader.cjs.js +1 -1
  34. package/dist/collection/assets/data-table.js +44 -0
  35. package/dist/collection/assets/planner.js +0 -2
  36. package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
  37. package/dist/collection/f-components/f-cell/f-cell.js +1 -1
  38. package/dist/components/kup-autocomplete2.js +2 -2
  39. package/dist/esm/{f-button-38ee97e6.js → f-button-3b97025a.js} +2 -2
  40. package/dist/esm/{f-cell-763793f8.js → f-cell-ae537010.js} +7 -7
  41. package/dist/esm/{f-checkbox-11b32f83.js → f-checkbox-91358c27.js} +1 -1
  42. package/dist/esm/{f-chip-010179a2.js → f-chip-69df7df4.js} +3 -3
  43. package/dist/esm/{f-image-77ac3ca0.js → f-image-705c1694.js} +2 -2
  44. package/dist/esm/{f-paginator-utils-32b2c046.js → f-paginator-utils-b7009f00.js} +3 -3
  45. package/dist/esm/{f-text-field-8a683258.js → f-text-field-fa349928.js} +2 -2
  46. package/dist/esm/{index-b45996ce.js → index-bb15ce14.js} +3 -1
  47. package/dist/esm/ketchup.js +2 -2
  48. package/dist/esm/kup-accordion.entry.js +3 -3
  49. package/dist/esm/kup-autocomplete_27.entry.js +10 -10
  50. package/dist/esm/kup-box.entry.js +10 -10
  51. package/dist/esm/kup-calendar.entry.js +5 -5
  52. package/dist/esm/kup-cell.entry.js +7 -7
  53. package/dist/esm/kup-dash-list.entry.js +2 -2
  54. package/dist/esm/kup-dash_2.entry.js +2 -2
  55. package/dist/esm/kup-dashboard.entry.js +6 -6
  56. package/dist/esm/kup-drawer.entry.js +2 -2
  57. package/dist/esm/kup-echart.entry.js +2 -2
  58. package/dist/esm/kup-family-tree.entry.js +4 -4
  59. package/dist/esm/kup-iframe.entry.js +2 -2
  60. package/dist/esm/kup-image-list.entry.js +8 -8
  61. package/dist/esm/kup-lazy.entry.js +2 -2
  62. package/dist/esm/kup-magic-box.entry.js +3 -3
  63. package/dist/esm/{kup-manager-e2f7edf1.js → kup-manager-bad7bec3.js} +1 -1
  64. package/dist/esm/kup-nav-bar.entry.js +2 -2
  65. package/dist/esm/kup-numeric-picker.entry.js +3 -3
  66. package/dist/esm/kup-photo-frame.entry.js +2 -2
  67. package/dist/esm/kup-planner.entry.js +3 -3
  68. package/dist/esm/kup-probe.entry.js +2 -2
  69. package/dist/esm/kup-qlik.entry.js +2 -2
  70. package/dist/esm/kup-snackbar.entry.js +4 -4
  71. package/dist/esm/loader.js +2 -2
  72. package/dist/ketchup/ketchup.esm.js +1 -1
  73. package/dist/ketchup/{p-40312367.entry.js → p-0b24a2ed.entry.js} +1 -1
  74. package/dist/ketchup/p-15e6bfaf.entry.js +1 -0
  75. package/dist/ketchup/{p-4cb43c62.entry.js → p-15ffcd21.entry.js} +1 -1
  76. package/dist/ketchup/{p-3fe1eada.entry.js → p-1ad1cf92.entry.js} +2 -2
  77. package/dist/ketchup/p-2587abcf.entry.js +1 -0
  78. package/dist/ketchup/{p-dd183d2f.entry.js → p-31da4bae.entry.js} +1 -1
  79. package/dist/ketchup/p-3879be61.js +1 -0
  80. package/dist/ketchup/{p-be933dfa.entry.js → p-4c79ea53.entry.js} +1 -1
  81. package/dist/ketchup/{p-d938d1cd.js → p-55182fcf.js} +1 -1
  82. package/dist/ketchup/{p-bab43d3f.entry.js → p-68c5029f.entry.js} +1 -1
  83. package/dist/ketchup/p-68cd7d9a.js +1 -0
  84. package/dist/ketchup/{p-d942bfd3.entry.js → p-6c995fb2.entry.js} +1 -1
  85. package/dist/ketchup/{p-6814b44c.entry.js → p-7664a38d.entry.js} +1 -1
  86. package/dist/ketchup/{p-fe8c8e11.js → p-82b5fac1.js} +1 -1
  87. package/dist/ketchup/{p-9fe8bcf4.entry.js → p-a8eccd10.entry.js} +1 -1
  88. package/dist/ketchup/{p-5d7b542c.entry.js → p-aa373c37.entry.js} +1 -1
  89. package/dist/ketchup/{p-86a3a9ef.entry.js → p-af50bc6b.entry.js} +1 -1
  90. package/dist/ketchup/{p-5b1ae769.js → p-afa2af1e.js} +1 -1
  91. package/dist/ketchup/{p-7c9ca424.entry.js → p-b3eeb140.entry.js} +1 -1
  92. package/dist/ketchup/{p-3da7e4c6.js → p-b5deb573.js} +2 -2
  93. package/dist/ketchup/{p-f520b898.entry.js → p-bd21cdea.entry.js} +1 -1
  94. package/dist/ketchup/{p-2751c4ba.js → p-bd5ece4c.js} +1 -1
  95. package/dist/ketchup/{p-07e56ef4.entry.js → p-be89bc7b.entry.js} +1 -1
  96. package/dist/ketchup/{p-f3c25aae.entry.js → p-c455cc67.entry.js} +1 -1
  97. package/dist/ketchup/{p-eb42d212.entry.js → p-e1f0ade4.entry.js} +1 -1
  98. package/dist/ketchup/{p-e0e4e3e2.entry.js → p-e6cf7db3.entry.js} +1 -1
  99. package/dist/ketchup/{p-166356dc.entry.js → p-ee39977d.entry.js} +1 -1
  100. package/dist/ketchup/{p-3a64fbe0.entry.js → p-ef21d377.entry.js} +1 -1
  101. package/dist/ketchup/{p-79f78bdc.js → p-fb0b5466.js} +1 -1
  102. package/dist/ketchup/{p-90576709.js → p-fd1323da.js} +1 -1
  103. package/dist/ketchup/{p-e96d0d28.entry.js → p-fefa9ae4.entry.js} +1 -1
  104. package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
  105. package/package.json +1 -1
  106. package/dist/ketchup/p-0e961148.js +0 -1
  107. package/dist/ketchup/p-2866e08c.entry.js +0 -1
  108. package/dist/ketchup/p-46ad61d1.entry.js +0 -1
  109. package/dist/ketchup/p-5443df89.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as t,c as i,f as s,h as e,H as o,g as h}from"./p-b5deb573.js";import{k as n,g as r,s as a,c as d}from"./p-bd5ece4c.js";var c;!function(t){t.buttonData="Props of the button (when isButton is set to true).",t.isButton="The component will be rendered as a button, which opens the link associated to the iframe in another tab when clicked.",t.src="The address the iframe should be referencing to."}(c||(c={}));const p=class{constructor(s){t(this,s),this.kupIframeError=i(this,"kup-iframe-error",6),this.kupIframeLoad=i(this,"kup-iframe-load",6),this.kupManager=n(),this.buttonData={},this.isButton=!1,this.src=void 0}onKupIframeError(){this.kupIframeError.emit({comp:this,id:this.rootElement.id})}onKupIframeLoad(){this.kupIframeLoad.emit({comp:this,id:this.rootElement.id})}async getProps(t){return r(this,c,t)}async refresh(){s(this)}async setProps(t){a(this,c,t)}openInNew(){window.open(this.src,"_blank")}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){if(null!=this.src&&""!==this.src)return this.buttonData.icon||(this.buttonData.icon="open_in_new"),this.buttonData.label||(this.buttonData.label="Open in new tab"),this.isButton?e(o,{"is-button":!0},e("kup-button",Object.assign({},this.buttonData,{"onkup-button-click":()=>this.openInNew()}))):e(o,{"is-iframe":!0},e("iframe",{onError:this.onKupIframeError.bind(this),onLoad:this.onKupIframeLoad.bind(this),src:this.src}));this.kupManager.debug.logMessage(this,"Resource undefined, not rendering!",d.WARNING)}get rootElement(){return h(this)}};p.style="iframe{box-sizing:border-box;height:100%;width:100%}:host([is-iframe]){box-sizing:border-box;display:block;height:100%;width:100%}";export{p as kup_iframe}
@@ -1 +1 @@
1
- import{r as t,c as s,f as i,h as o,H as a,g as n}from"./p-3da7e4c6.js";import{k as e,g as r,s as c}from"./p-2751c4ba.js";import{c as l}from"./p-ad2e21d2.js";import{F as p}from"./p-fe8c8e11.js";import"./p-0fd98ab4.js";import"./p-0e961148.js";const h="snackbar";var u;!function(t){t.actionButton="Set of FButton props to set the action button.",t.closeButton="When true, the hide button will be displayed.",t.customStyle="Custom style of the component.",t.text="Sets the textual content of the snackbar.",t.timeout="Defaults at null, when set the snackbar will automatically disappear after the specified amount of milliseconds."}(u||(u={}));const b=class{constructor(i){t(this,i),this.kupActionClick=s(this,"kup-snackbar-actionclick",6),this.kupTimeoutComplete=s(this,"kup-snackbar-timeoutcomplete",6),this.kupManager=e(),this.visible=!1,this.actionButton=null,this.closeButton=!0,this.customStyle="",this.text="",this.timeout=null}onKupActionClick(){this.hide(),this.kupActionClick.emit({comp:this,id:this.rootElement.id})}onKupTimeoutComplete(){this.kupTimeoutComplete.emit({comp:this,id:this.rootElement.id})}async getProps(t){return r(this,u,t)}async hide(){this.visible=!1}async refresh(){i(this)}async setProps(t){c(this,u,t)}async show(){this.visible=!0}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.timeout&&this.visible&&setTimeout((()=>{this.hide(),this.onKupTimeoutComplete()}),this.timeout),this.kupManager.debug.logRender(this,!0)}render(){return o(a,{"kup-visible":this.visible},o("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),o("div",{id:l},o("div",{class:h},o("div",{class:`${h}__text`},this.text),this.actionButton||this.closeButton?o("div",{class:`${h}__buttons`},this.actionButton?o("div",{class:`${h}__action`},o(p,Object.assign({},this.actionButton,{onClick:()=>this.onKupActionClick()}))):null,this.closeButton?o("div",{class:`${h}__close`},o(p,{icon:"close",onClick:()=>this.hide()})):null):null)))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return n(this)}};b.style=":host{animation:snackbar-show 125ms;bottom:0;box-sizing:border-box;display:block;left:0;outline:none;pointer-events:none;position:fixed;transition:opacity 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms, transform 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms, -webkit-transform 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms;width:100%;z-index:calc(var(--kup-navbar-zindex) + 1)}:host(:not([kup-visible])){display:none}#kup-component{box-sizing:border-box;display:flex;justify-content:center;height:100%;padding:8px;width:100%}.snackbar{align-items:center;background:var(--kup-navbar-background-color);border-radius:5px;box-shadow:var(--kup-box-shadow);color:var(--kup-navbar-color);display:flex;justify-content:space-between;max-width:672px;min-height:48px;min-width:344px}.snackbar__text{padding:14px 16px;pointer-events:all;word-break:break-word}.snackbar__buttons{--kup-button-primary-color:var(--kup-navbar-color);--kup-button-primary-color-rgb:var(--kup-navbar-color-rgb);--kup-button-primary-color-h:var(--kup-navbar-color-h);--kup-button-primary-color-s:var(--kup-navbar-color-s);--kup-button-primary-color-l:var(--kup-navbar-color-l);align-items:center;display:flex;justify-content:flex-end;margin-right:8px;pointer-events:all;width:max-content}.snackbar__close{--kup-button-font-size:11px;margin-left:8px;pointer-events:all}@keyframes snackbar-show{from{transform:scale(0.5);opacity:0}to{transform:scale(1);opacity:1}}:host(.kup-top){bottom:unset;top:var(--kup-navbar-height, 0)}";export{b as kup_snackbar}
1
+ import{r as t,c as s,f as i,h as o,H as a,g as n}from"./p-b5deb573.js";import{k as e,g as r,s as c}from"./p-bd5ece4c.js";import{c as l}from"./p-ad2e21d2.js";import{F as p}from"./p-82b5fac1.js";import"./p-0fd98ab4.js";import"./p-3879be61.js";const h="snackbar";var b;!function(t){t.actionButton="Set of FButton props to set the action button.",t.closeButton="When true, the hide button will be displayed.",t.customStyle="Custom style of the component.",t.text="Sets the textual content of the snackbar.",t.timeout="Defaults at null, when set the snackbar will automatically disappear after the specified amount of milliseconds."}(b||(b={}));const u=class{constructor(i){t(this,i),this.kupActionClick=s(this,"kup-snackbar-actionclick",6),this.kupTimeoutComplete=s(this,"kup-snackbar-timeoutcomplete",6),this.kupManager=e(),this.visible=!1,this.actionButton=null,this.closeButton=!0,this.customStyle="",this.text="",this.timeout=null}onKupActionClick(){this.hide(),this.kupActionClick.emit({comp:this,id:this.rootElement.id})}onKupTimeoutComplete(){this.kupTimeoutComplete.emit({comp:this,id:this.rootElement.id})}async getProps(t){return r(this,b,t)}async hide(){this.visible=!1}async refresh(){i(this)}async setProps(t){c(this,b,t)}async show(){this.visible=!0}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.timeout&&this.visible&&setTimeout((()=>{this.hide(),this.onKupTimeoutComplete()}),this.timeout),this.kupManager.debug.logRender(this,!0)}render(){return o(a,{"kup-visible":this.visible},o("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),o("div",{id:l},o("div",{class:h},o("div",{class:`${h}__text`},this.text),this.actionButton||this.closeButton?o("div",{class:`${h}__buttons`},this.actionButton?o("div",{class:`${h}__action`},o(p,Object.assign({},this.actionButton,{onClick:()=>this.onKupActionClick()}))):null,this.closeButton?o("div",{class:`${h}__close`},o(p,{icon:"close",onClick:()=>this.hide()})):null):null)))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return n(this)}};u.style=":host{animation:snackbar-show 125ms;bottom:0;box-sizing:border-box;display:block;left:0;outline:none;pointer-events:none;position:fixed;transition:opacity 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms, transform 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms, -webkit-transform 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms;width:100%;z-index:calc(var(--kup-navbar-zindex) + 1)}:host(:not([kup-visible])){display:none}#kup-component{box-sizing:border-box;display:flex;justify-content:center;height:100%;padding:8px;width:100%}.snackbar{align-items:center;background:var(--kup-navbar-background-color);border-radius:5px;box-shadow:var(--kup-box-shadow);color:var(--kup-navbar-color);display:flex;justify-content:space-between;max-width:672px;min-height:48px;min-width:344px}.snackbar__text{padding:14px 16px;pointer-events:all;word-break:break-word}.snackbar__buttons{--kup-button-primary-color:var(--kup-navbar-color);--kup-button-primary-color-rgb:var(--kup-navbar-color-rgb);--kup-button-primary-color-h:var(--kup-navbar-color-h);--kup-button-primary-color-s:var(--kup-navbar-color-s);--kup-button-primary-color-l:var(--kup-navbar-color-l);align-items:center;display:flex;justify-content:flex-end;margin-right:8px;pointer-events:all;width:max-content}.snackbar__close{--kup-button-font-size:11px;margin-left:8px;pointer-events:all}@keyframes snackbar-show{from{transform:scale(0.5);opacity:0}to{transform:scale(1);opacity:1}}:host(.kup-top){bottom:unset;top:var(--kup-navbar-height, 0)}";export{u as kup_snackbar}
@@ -0,0 +1 @@
1
+ import{h as t,a as e}from"./p-b5deb573.js";import{b as s}from"./p-bd5ece4c.js";var i;!function(t){t.BAR="bar"}(i||(i={}));const a=a=>{let n,o;a.resource?a.resource.indexOf(".")>-1||a.resource.indexOf("/")>-1||a.resource.indexOf("\\")>-1?(o={"--kup_image_height":a.sizeY?a.sizeY:"auto","--kup_image_width":a.sizeX?a.sizeX:"100%"},n=function(e){return t("img",{onLoad:e.onLoad,src:e.resource})}(a)):(o={"--kup_image_height":a.sizeY?a.sizeY:"100%","--kup_image_width":a.sizeX?a.sizeX:"100%"},n=function(i){const a={"f-image__icon":!0},n={background:i.color?i.color:`var(${s.ICON})`};if(i.resource.indexOf("--kup")>-1){let t=i.resource.replace("--","");a["kup-icon"]=!0,a[t]=!0}else{const t=e(`./assets/svg/${i.resource}.svg`);n.mask=`url('${t}') no-repeat center`,n.webkitMask=`url('${t}') no-repeat center`}return t("div",{class:a,style:n})}(a)):a.data&&(o={"--kup_image_height":a.sizeY?a.sizeY:"100%","--kup_image_width":a.sizeX?a.sizeX:"100%"},n=function(e){const s=[];let a=0;for(let n=0;n<e.length;n++){let o;e[n].shape||(e[n].shape=i.BAR),e[n].color||(e[n].color="transparent"),e[n].height||(e[n].height="100%"),e[n].width||(e[n].width="100%");const r="step-"+n,c="css-step bottom-aligned",l={backgroundColor:e[n].color,left:a+"%",height:e[n].height,width:e[n].width};a+=parseFloat(e[n].width),o=t("span",{id:r,class:c,style:l}),s.push(o)}return t("div",{class:"f-image__css"},s)}(a.data));const r=[];if(a.badgeData)for(let e=0;e<a.badgeData.length;e++)r.push(t("kup-badge",Object.assign({},a.badgeData[e])));return t("div",Object.assign({class:`f-image ${a.wrapperClass?a.wrapperClass:""} ${a.fit?"kup-fit":""}`},a.dataSet,{id:a.id,style:o,title:a.title,onClick:a.onClick}),n,...r)};export{a as F}
@@ -1 +1 @@
1
- import{r as t,c as e,f as i,h as r,H as a,g as l}from"./p-3da7e4c6.js";import{F as o}from"./p-fe8c8e11.js";import{F as s}from"./p-0fd98ab4.js";import{F as _}from"./p-0e961148.js";import{k as n,g as m,s as f,m as h,Q as c}from"./p-2751c4ba.js";import{c as u}from"./p-ad2e21d2.js";var p;!function(t){t.autofitOnExpand="The component will autofit everytime a node is expanded.",t.autofitOnLoad="The component's initial render will fit the container by invoking the runAutofit method.",t.cardData="Used to render the family tree boxes as kup-cards (through kup-box).",t.collapsible="Nodes can be expanded/collapsed.",t.customStyle="Custom style of the component.",t.data="Actual data of the component",t.layout="Layout of the boxes.",t.stackedLeaves="Child nodes that have no children are arranged vertically."}(p||(p={}));var d,y,k,v,g,x,b,w,j,C,E,T,W,M,S,z,D,L,O,P,A,F,R,X,Y,H=function(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)},$=function(t,e,i,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(t,i):a?a.value=i:e.set(t,i),i};const B=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),k.set(this,!1),v.set(this,0),g.set(this,0),x.set(this,[]),b.set(this,n()),w.set(this,(t=>{const e=t.clientX-H(this,v,"f"),i=t.clientY-H(this,g,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,v,t.clientX,"f"),$(this,g,t.clientY,"f")})),j.set(this,!1),C.set(this,null),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1}async collapseAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){H(this,b,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return m(this,p,t)}async refresh(){i(this)}async runAutofit(){const t=H(this,C,"f").clientWidth,e=H(this,C,"f").children[0].clientWidth,i=.01,r=.85*t,a=.95*t;let l=1,o=2e3,s=e;for(;(s<r||s>a)&&o>0&&l>i;)o--,s<r?l+=i:s>a?l-=i:o=0,s=e*l;H(this,C,"f").style.setProperty("--kup_familytree_scale",l<=1?l.toFixed(2):"1")}async setProps(t){f(this,p,t)}componentWillLoad(){H(this,b,"f").debug.logLoad(this,!1),H(this,b,"f").language.register(this),H(this,b,"f").theme.register(this)}componentDidLoad(){H(this,d,"m",X).call(this),this.autofitOnLoad&&this.runAutofit(),H(this,b,"f").debug.logLoad(this,!0)}componentWillRender(){H(this,b,"f").debug.logRender(this,!1)}componentDidRender(){H(this,j,"f")&&($(this,j,!1,"f"),this.runAutofit()),H(this,b,"f").debug.logRender(this,!0)}render(){return r(a,{onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),H(this,d,"m",O).call(this,t)},onWheel:t=>{H(this,d,"m",Y).call(this,t)}},r("style",null,H(this,b,"f").theme.setKupStyle(this.rootElement)),r("div",{id:u},H(this,d,"m",D).call(this)))}disconnectedCallback(){H(this,b,"f").language.unregister(this),H(this,b,"f").theme.unregister(this)}get rootElement(){return l(this)}};y=new WeakMap,k=new WeakMap,v=new WeakMap,g=new WeakMap,x=new WeakMap,b=new WeakMap,w=new WeakMap,j=new WeakMap,C=new WeakMap,d=new WeakSet,E=function(t,e,i,a){const l=[];return l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},r("div",{class:"family-tree__line--placeholder"}))),l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||a&&!e}},r("div",{class:"family-tree__line--placeholder"}))),l},T=function t(e){var i;let a=null,l=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(l||(l=[]),l.push(t)):(a||(a=[]),a.push(t))})));const _=this.stackedLeaves&&a&&a.every((t=>!t.children||0==t.children.length)),n=a?2*a.length:1,m={"family-tree__line":!0,"family-tree__line--placeholder":!(!a&&!l),"family-tree__line--vertical":!(!a&&!l)},f={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},c=e.layout||this.layout||1,u={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:s.OUTLINED,title:`${H(this,b,"f").language.translate(h.EXPAND)}/${H(this,b,"f").language.translate(h.COLLAPSE)} (CTRL + Click)`,onClick:t=>{t.ctrlKey&&e.children&&e.children.length>0&&(e.isExpanded?this.collapseAll(e.children):this.expandAll(e.children)),e.isExpanded=!e.isExpanded,this.autofitOnExpand&&$(this,j,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let p=null;H(this,d,"m",L).call(this,c)&&(p=r("kup-box",{class:"kup-borderless kup-paddingless",customStyle:"#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }",data:f,cardData:this.cardData,layout:this.cardData?null:c,showSelection:!1}));const y=r("div",{class:"family-tree__item"},r("div",{class:"family-tree__item__wrapper"},H(this,d,"m",L).call(this,c)?p:H(this,d,"m",W).call(this,e,c),this.collapsible&&e.children&&e.children.length>0?r(o,Object.assign({},u)):void 0)),k={"--kup_familytree_staffchildren":(null==l?void 0:l.length.toString())||"0"};return r("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},r("tr",null,r("td",{"data-row":e,colSpan:n},y)),r("tr",null,r("td",{colSpan:n},r("div",{class:m}))),l?[r("tr",null,r("td",{colSpan:n},r("div",{class:Object.assign(Object.assign({},m),{"family-tree__line--staff":!0}),style:k}),r("div",{class:"family-tree__node__staff",style:k},l.map((e=>[r("div",{class:"family-tree__node__staff__item"},H(this,d,"m",t).call(this,e))])))))]:null,l&&a?[r("tr",null,r("td",{colSpan:n},r("div",{class:m})))]:null,a?[r("tr",null,_?r("td",{colSpan:n},r("div",{class:m})):a.map((t=>H(this,d,"m",E).call(this,0==a.indexOf(t),a.indexOf(t)==a.length-1,1==a.length,a.length>2)))),r("tr",null,_?r("td",{colSpan:n},a.map((e=>H(this,d,"m",t).call(this,e)))):a.map((e=>r("td",{colSpan:2},H(this,d,"m",t).call(this,e)))))]:void 0)},W=function(t,e){return 2===e?H(this,d,"m",S).call(this,t):H(this,d,"m",M).call(this,t)},M=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--1"},r("div",{class:"family-tree__item__layout__text__title"},t.value))},S=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--2"},r("div",{class:"family-tree__item__layout__color"}),r("div",{class:"family-tree__item__layout__image"},r(_,{resource:t.icon,sizeX:"48px",sizeY:"48px"})),r("div",{class:"family-tree__item__layout__text"},r("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?r("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},z=function(t){return t.map((t=>H(this,d,"m",T).call(this,t)))},D=function(){return r("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,C,t,"f")},this.data&&this.data.rows&&this.data.rows.length?H(this,d,"m",z).call(this,this.data.rows):r("div",null,H(this,b,"f").language.translate(h.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){$(this,v,t.clientX,"f"),$(this,g,t.clientY,"f"),H(this,C,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",H(this,w,"f")),document.removeEventListener("pointerup",e),H(this,C,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",H(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t,e){let i,r;if(t)for(let e=t.length-1;e>=0;e--){const a=t[e];a.tagName&&(a.classList.contains("family-tree__item__expand")&&(i=a),"TD"===a.tagName.toUpperCase())&&(r=a)}let a=null,l=null,o=null;return r&&(a=r["data-cell"],l=r["data-column"],o=r["data-row"]),{cell:a||null,column:l||null,expandButton:i||null,originalEvent:e,row:o||null,td:r||null}},A=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},F=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},R=function(t){return H(this,d,"m",P).call(this,H(this,b,"f").getEventPath(t.target,this.rootElement),t)},X=function(){H(this,x,"f").push(this.rootElement),H(this,b,"f").interact.on(this.rootElement,c.TAP,(t=>{if(H(this,k,"f"))$(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];H(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,c.DOUBLETAP,(t=>{if(0===t.button){for(let t=0;t<H(this,y,"f").length;t++)clearTimeout(H(this,y,"f")[t]),H(this,b,"f").debug.logMessage(this,"Cleared clickHandler timeout("+H(this,y,"f")[t]+").");$(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",R).call(this,t)})}})),H(this,b,"f").interact.on(this.rootElement,c.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||($(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)}))}))},Y=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(H(this,C,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let r=t.deltaY>0?e-i:e+i;r<i&&(r=i),H(this,C,"f").style.setProperty("--kup_familytree_scale",r.toFixed(2))}},B.style=':host{--kup_familytree_item_background_color:var(\n --kup-familytree-item-background-color,\n var(--kup-background-color)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 80px);--kup_familytree_item_h_padding:var(--kup-familytree-item-h-padding, 8px);--kup_familytree_item_v_padding:var(--kup-familytree-item-v-padding, 10px);--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-color)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc((var(--kup_familytree_item_width) + var(--kup_familytree_item_h_padding) * 2) / 2)) translateY(calc(0px - (var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:"";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc(var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);border:1px solid var(--kup_familytree_lines_color);border-radius:8px;box-sizing:border-box;display:flex;height:var(--kup_familytree_item_height);margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup-secondary-color);border-bottom-left-radius:8px;border-top-left-radius:8px;height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto 10px}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';export{B as kup_family_tree}
1
+ import{r as t,c as e,f as i,h as r,H as a,g as l}from"./p-b5deb573.js";import{F as o}from"./p-82b5fac1.js";import{F as s}from"./p-0fd98ab4.js";import{F as _}from"./p-3879be61.js";import{k as n,g as m,s as f,m as h,Q as c}from"./p-bd5ece4c.js";import{c as u}from"./p-ad2e21d2.js";var p;!function(t){t.autofitOnExpand="The component will autofit everytime a node is expanded.",t.autofitOnLoad="The component's initial render will fit the container by invoking the runAutofit method.",t.cardData="Used to render the family tree boxes as kup-cards (through kup-box).",t.collapsible="Nodes can be expanded/collapsed.",t.customStyle="Custom style of the component.",t.data="Actual data of the component",t.layout="Layout of the boxes.",t.stackedLeaves="Child nodes that have no children are arranged vertically."}(p||(p={}));var d,y,k,v,g,b,x,w,j,C,E,T,W,M,S,z,D,L,O,P,A,F,R,X,Y,H=function(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)},$=function(t,e,i,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(t,i):a?a.value=i:e.set(t,i),i};const B=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),k.set(this,!1),v.set(this,0),g.set(this,0),b.set(this,[]),x.set(this,n()),w.set(this,(t=>{const e=t.clientX-H(this,v,"f"),i=t.clientY-H(this,g,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,$(this,v,t.clientX,"f"),$(this,g,t.clientY,"f")})),j.set(this,!1),C.set(this,null),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1}async collapseAll(t=this.data.rows){H(this,x,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){H(this,x,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return m(this,p,t)}async refresh(){i(this)}async runAutofit(){const t=H(this,C,"f").clientWidth,e=H(this,C,"f").children[0].clientWidth,i=.01,r=.85*t,a=.95*t;let l=1,o=2e3,s=e;for(;(s<r||s>a)&&o>0&&l>i;)o--,s<r?l+=i:s>a?l-=i:o=0,s=e*l;H(this,C,"f").style.setProperty("--kup_familytree_scale",l<=1?l.toFixed(2):"1")}async setProps(t){f(this,p,t)}componentWillLoad(){H(this,x,"f").debug.logLoad(this,!1),H(this,x,"f").language.register(this),H(this,x,"f").theme.register(this)}componentDidLoad(){H(this,d,"m",X).call(this),this.autofitOnLoad&&this.runAutofit(),H(this,x,"f").debug.logLoad(this,!0)}componentWillRender(){H(this,x,"f").debug.logRender(this,!1)}componentDidRender(){H(this,j,"f")&&($(this,j,!1,"f"),this.runAutofit()),H(this,x,"f").debug.logRender(this,!0)}render(){return r(a,{onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),H(this,d,"m",O).call(this,t)},onWheel:t=>{H(this,d,"m",Y).call(this,t)}},r("style",null,H(this,x,"f").theme.setKupStyle(this.rootElement)),r("div",{id:u},H(this,d,"m",D).call(this)))}disconnectedCallback(){H(this,x,"f").language.unregister(this),H(this,x,"f").theme.unregister(this)}get rootElement(){return l(this)}};y=new WeakMap,k=new WeakMap,v=new WeakMap,g=new WeakMap,b=new WeakMap,x=new WeakMap,w=new WeakMap,j=new WeakMap,C=new WeakMap,d=new WeakSet,E=function(t,e,i,a){const l=[];return l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},r("div",{class:"family-tree__line--placeholder"}))),l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||a&&!e}},r("div",{class:"family-tree__line--placeholder"}))),l},T=function t(e){var i;let a=null,l=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(l||(l=[]),l.push(t)):(a||(a=[]),a.push(t))})));const _=this.stackedLeaves&&a&&a.every((t=>!t.children||0==t.children.length)),n=a?2*a.length:1,m={"family-tree__line":!0,"family-tree__line--placeholder":!(!a&&!l),"family-tree__line--vertical":!(!a&&!l)},f={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},c=e.layout||this.layout||1,u={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:s.OUTLINED,title:`${H(this,x,"f").language.translate(h.EXPAND)}/${H(this,x,"f").language.translate(h.COLLAPSE)} (CTRL + Click)`,onClick:t=>{t.ctrlKey&&e.children&&e.children.length>0&&(e.isExpanded?this.collapseAll(e.children):this.expandAll(e.children)),e.isExpanded=!e.isExpanded,this.autofitOnExpand&&$(this,j,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let p=null;H(this,d,"m",L).call(this,c)&&(p=r("kup-box",{class:"kup-borderless kup-paddingless",customStyle:"#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }",data:f,cardData:this.cardData,layout:this.cardData?null:c,showSelection:!1}));const y=r("div",{class:"family-tree__item"},r("div",{class:"family-tree__item__wrapper"},H(this,d,"m",L).call(this,c)?p:H(this,d,"m",W).call(this,e,c),this.collapsible&&e.children&&e.children.length>0?r(o,Object.assign({},u)):void 0)),k={"--kup_familytree_staffchildren":(null==l?void 0:l.length.toString())||"0"};return r("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},r("tr",null,r("td",{"data-row":e,colSpan:n},y)),r("tr",null,r("td",{colSpan:n},r("div",{class:m}))),l?[r("tr",null,r("td",{colSpan:n},r("div",{class:Object.assign(Object.assign({},m),{"family-tree__line--staff":!0}),style:k}),r("div",{class:"family-tree__node__staff",style:k},l.map((e=>[r("div",{class:"family-tree__node__staff__item"},H(this,d,"m",t).call(this,e))])))))]:null,l&&a?[r("tr",null,r("td",{colSpan:n},r("div",{class:m})))]:null,a?[r("tr",null,_?r("td",{colSpan:n},r("div",{class:m})):a.map((t=>H(this,d,"m",E).call(this,0==a.indexOf(t),a.indexOf(t)==a.length-1,1==a.length,a.length>2)))),r("tr",null,_?r("td",{colSpan:n},a.map((e=>H(this,d,"m",t).call(this,e)))):a.map((e=>r("td",{colSpan:2},H(this,d,"m",t).call(this,e)))))]:void 0)},W=function(t,e){return 2===e?H(this,d,"m",S).call(this,t):H(this,d,"m",M).call(this,t)},M=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--1"},r("div",{class:"family-tree__item__layout__text__title"},t.value))},S=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--2"},r("div",{class:"family-tree__item__layout__color"}),r("div",{class:"family-tree__item__layout__image"},r(_,{resource:t.icon,sizeX:"48px",sizeY:"48px"})),r("div",{class:"family-tree__item__layout__text"},r("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?r("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},z=function(t){return t.map((t=>H(this,d,"m",T).call(this,t)))},D=function(){return r("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>$(this,C,t,"f")},this.data&&this.data.rows&&this.data.rows.length?H(this,d,"m",z).call(this,this.data.rows):r("div",null,H(this,x,"f").language.translate(h.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){$(this,v,t.clientX,"f"),$(this,g,t.clientY,"f"),H(this,C,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",H(this,w,"f")),document.removeEventListener("pointerup",e),H(this,C,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",H(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t,e){let i,r;if(t)for(let e=t.length-1;e>=0;e--){const a=t[e];a.tagName&&(a.classList.contains("family-tree__item__expand")&&(i=a),"TD"===a.tagName.toUpperCase())&&(r=a)}let a=null,l=null,o=null;return r&&(a=r["data-cell"],l=r["data-column"],o=r["data-row"]),{cell:a||null,column:l||null,expandButton:i||null,originalEvent:e,row:o||null,td:r||null}},A=function(t){return H(this,d,"m",P).call(this,H(this,x,"f").getEventPath(t.target,this.rootElement),t)},F=function(t){return H(this,d,"m",P).call(this,H(this,x,"f").getEventPath(t.target,this.rootElement),t)},R=function(t){return H(this,d,"m",P).call(this,H(this,x,"f").getEventPath(t.target,this.rootElement),t)},X=function(){H(this,b,"f").push(this.rootElement),H(this,x,"f").interact.on(this.rootElement,c.TAP,(t=>{if(H(this,k,"f"))$(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];H(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",A).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)})}})),H(this,x,"f").interact.on(this.rootElement,c.DOUBLETAP,(t=>{if(0===t.button){for(let t=0;t<H(this,y,"f").length;t++)clearTimeout(H(this,y,"f")[t]),H(this,x,"f").debug.logMessage(this,"Cleared clickHandler timeout("+H(this,y,"f")[t]+").");$(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",R).call(this,t)})}})),H(this,x,"f").interact.on(this.rootElement,c.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||($(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:H(this,d,"m",F).call(this,t)}))}))},Y=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat(H(this,C,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let r=t.deltaY>0?e-i:e+i;r<i&&(r=i),H(this,C,"f").style.setProperty("--kup_familytree_scale",r.toFixed(2))}},B.style=':host{--kup_familytree_item_background_color:var(\n --kup-familytree-item-background-color,\n var(--kup-background-color)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 80px);--kup_familytree_item_h_padding:var(--kup-familytree-item-h-padding, 8px);--kup_familytree_item_v_padding:var(--kup-familytree-item-v-padding, 10px);--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-color)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc((var(--kup_familytree_item_width) + var(--kup_familytree_item_h_padding) * 2) / 2)) translateY(calc(0px - (var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:"";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc(var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) * 2)}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);border:1px solid var(--kup_familytree_lines_color);border-radius:8px;box-sizing:border-box;display:flex;height:var(--kup_familytree_item_height);margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup-secondary-color);border-bottom-left-radius:8px;border-top-left-radius:8px;height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto 10px}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';export{B as kup_family_tree}
@@ -1 +1 @@
1
- import{h as c}from"./p-3da7e4c6.js";import{F as i}from"./p-0e961148.js";import{K as s,m as e,b as n}from"./p-2751c4ba.js";var p;!function(c){c.CHOICE="choice",c.FILTER="filter",c.INPUT="input",c.STANDARD="standard"}(p||(p={}));const l=document.documentElement,a=a=>{a.type||(a.type=p.STANDARD);const r=a.type.toLowerCase()===p.CHOICE,t=a.type.toLowerCase()===p.FILTER,o=a.type.toLowerCase()===p.INPUT,d={"chip-set":!0,"chip-set--choice":!!r,"chip-set--filter":!!t,"chip-set--input":!!o};return c("div",Object.assign({class:`f-chip ${a.danger?"kup-danger":""} ${a.info?"kup-info":""} ${a.secondary?"kup-secondary":""} ${a.success?"kup-success":""} ${a.warning?"kup-warning":""} ${a.wrapperClass?a.wrapperClass:""}`},a.dataSet,{id:a.id,title:a.title}),c("div",{class:d,role:"grid"},function(p,a,r,t){const o=[];for(let u=0;p.data&&u<p.data.length;u++){const _=[];function d(n,a){const r=!!(n.children&&n.children.length>0),t=!(!r||!n.isExpanded),o={"--kup_chip_indent_offset":a.toString()};if(_.push(c("div",{class:"chip-set__wrapper "+(r&&!t?"chip-set__wrapper--hidden-children":"")},c("div",{class:"chip-set__indent",style:o}),r?c(i,{onClick:p.onExpansionClick&&p.onExpansionClick[u]?p.onExpansionClick[u].bind(p.onExpansionClick[u],n):null,resource:`${s.DROPDOWN}`,sizeX:"18px",sizeY:"18px",title:l.ketchup.language.translate(e.EXPAND)+"/"+l.ketchup.language.translate(e.COLLAPSE)+" (CTRL + Click)",wrapperClass:"dropdown-icon"}):a?c(i,{resource:"blank",sizeX:"18px",sizeY:"18px",wrapperClass:"dropdown-icon"}):null,h(n))),t)for(let c=0;c<n.children.length;c++)n.children[c]&&d(n.children[c],a+1)}function h(e){let l="chip "+(e.icon&&!e.value?"chip--only-icon":""),o=[],d="chip__icon chip__icon--leading";return(r||a)&&e.checked&&(l+=" chip--selected",r&&(d+=" chip__icon--leading-hidden")),e.icon&&o.push(c(i,Object.assign({},{color:a&&e.checked?`var(${n.PRIMARY})`:`var(${n.TEXT})`,resource:e.icon,sizeX:"18px",sizeY:"18px",wrapperClass:d}))),r&&o.push(c("span",{class:"chip__checkmark"},c("svg",{class:"chip__checkmark-svg",viewBox:"-2 -3 30 30"},c("path",{class:"chip__checkmark-path",fill:"none",stroke:"black",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})))),c("div",{class:l,"data-value":e.id,onClick:p.onClick&&p.onClick[u]?p.onClick[u].bind(p.onClick[u],e):null,role:"row",title:e.title?e.title:""},c("span",{class:"chip-set__indent"}),o,c("span",{role:"gridcell"},c("span",{role:"button",tabindex:u,class:"chip__primary-action",value:e.id,checked:e.checked,onBlur:p.onBlur&&p.onBlur[u]?p.onBlur[u].bind(p.onBlur[u],e):null,onFocus:p.onFocus&&p.onFocus[u]?p.onFocus[u].bind(p.onFocus[u],e):null},c("span",{class:"chip__text"},p.displayId?e.id+" - "+e.value:e.value))),t?c("span",{role:"gridcell"},c("span",{tabindex:"-1",class:`kup-icon chip__icon ${s.CLEAR.replace("--","")}`,onClick:p.onIconClick&&p.onIconClick[u]?p.onIconClick[u].bind(p.onIconClick[u],e):null})):null)}d(p.data[u],0),o.push(c("div",{class:"chip-set__item"},..._))}return o}(a,r,t,o)))};export{p as F,a}
1
+ import{h as c}from"./p-b5deb573.js";import{F as i}from"./p-3879be61.js";import{K as e,m as s,b as n}from"./p-bd5ece4c.js";var p;!function(c){c.CHOICE="choice",c.FILTER="filter",c.INPUT="input",c.STANDARD="standard"}(p||(p={}));const l=document.documentElement,a=a=>{a.type||(a.type=p.STANDARD);const r=a.type.toLowerCase()===p.CHOICE,t=a.type.toLowerCase()===p.FILTER,o=a.type.toLowerCase()===p.INPUT,d={"chip-set":!0,"chip-set--choice":!!r,"chip-set--filter":!!t,"chip-set--input":!!o};return c("div",Object.assign({class:`f-chip ${a.danger?"kup-danger":""} ${a.info?"kup-info":""} ${a.secondary?"kup-secondary":""} ${a.success?"kup-success":""} ${a.warning?"kup-warning":""} ${a.wrapperClass?a.wrapperClass:""}`},a.dataSet,{id:a.id,title:a.title}),c("div",{class:d,role:"grid"},function(p,a,r,t){const o=[];for(let u=0;p.data&&u<p.data.length;u++){const _=[];function d(n,a){const r=!!(n.children&&n.children.length>0),t=!(!r||!n.isExpanded),o={"--kup_chip_indent_offset":a.toString()};if(_.push(c("div",{class:"chip-set__wrapper "+(r&&!t?"chip-set__wrapper--hidden-children":"")},c("div",{class:"chip-set__indent",style:o}),r?c(i,{onClick:p.onExpansionClick&&p.onExpansionClick[u]?p.onExpansionClick[u].bind(p.onExpansionClick[u],n):null,resource:`${e.DROPDOWN}`,sizeX:"18px",sizeY:"18px",title:l.ketchup.language.translate(s.EXPAND)+"/"+l.ketchup.language.translate(s.COLLAPSE)+" (CTRL + Click)",wrapperClass:"dropdown-icon"}):a?c(i,{resource:"blank",sizeX:"18px",sizeY:"18px",wrapperClass:"dropdown-icon"}):null,h(n))),t)for(let c=0;c<n.children.length;c++)n.children[c]&&d(n.children[c],a+1)}function h(s){let l="chip "+(s.icon&&!s.value?"chip--only-icon":""),o=[],d="chip__icon chip__icon--leading";return(r||a)&&s.checked&&(l+=" chip--selected",r&&(d+=" chip__icon--leading-hidden")),s.icon&&o.push(c(i,Object.assign({},{color:a&&s.checked?`var(${n.PRIMARY})`:`var(${n.TEXT})`,resource:s.icon,sizeX:"18px",sizeY:"18px",wrapperClass:d}))),r&&o.push(c("span",{class:"chip__checkmark"},c("svg",{class:"chip__checkmark-svg",viewBox:"-2 -3 30 30"},c("path",{class:"chip__checkmark-path",fill:"none",stroke:"black",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})))),c("div",{class:l,"data-value":s.id,onClick:p.onClick&&p.onClick[u]?p.onClick[u].bind(p.onClick[u],s):null,role:"row",title:s.title?s.title:""},c("span",{class:"chip-set__indent"}),o,c("span",{role:"gridcell"},c("span",{role:"button",tabindex:u,class:"chip__primary-action",value:s.id,checked:s.checked,onBlur:p.onBlur&&p.onBlur[u]?p.onBlur[u].bind(p.onBlur[u],s):null,onFocus:p.onFocus&&p.onFocus[u]?p.onFocus[u].bind(p.onFocus[u],s):null},c("span",{class:"chip__text"},p.displayId?s.id+" - "+s.value:s.value))),t?c("span",{role:"gridcell"},c("span",{tabindex:"-1",class:`kup-icon chip__icon ${e.CLEAR.replace("--","")}`,onClick:p.onIconClick&&p.onIconClick[u]?p.onIconClick[u].bind(p.onIconClick[u],s):null})):null)}d(p.data[u],0),o.push(c("div",{class:"chip-set__item"},..._))}return o}(a,r,t,o)))};export{p as F,a}
@@ -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-2751c4ba.js";import{c}from"./p-ad2e21d2.js";import{F as h}from"./p-0e961148.js";import{F as g}from"./p-fe8c8e11.js";import{F as _}from"./p-0fd98ab4.js";import{F as u}from"./p-5443df89.js";import{M as d}from"./p-6507e9eb.js";import"./p-90576709.js";import"./p-79f78bdc.js";import"./p-d938d1cd.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-b5deb573.js";import{k as o,g as n,s as l,m,d as p}from"./p-bd5ece4c.js";import{c}from"./p-ad2e21d2.js";import{F as h}from"./p-3879be61.js";import{F as g}from"./p-82b5fac1.js";import{F as _}from"./p-0fd98ab4.js";import{F as u}from"./p-68cd7d9a.js";import{M as d}from"./p-6507e9eb.js";import"./p-fd1323da.js";import"./p-fb0b5466.js";import"./p-55182fcf.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}
@@ -0,0 +1 @@
1
+ import{a9 as e,aa as t,b as c,a6 as s,ab as a,ac as i,ad as n,ae as o,af as l,ag as u}from"./p-bd5ece4c.js";import{h as r}from"./p-b5deb573.js";import{F as p}from"./p-fd1323da.js";import{F as b}from"./p-fb0b5466.js";import{F as d}from"./p-3879be61.js";import{F as k,a as h}from"./p-55182fcf.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=(i,o)=>{const f=i.cell,m=i.column,j=i.row,_=i.shape?i.shape:f.shape?f.shape:m.shape?m.shape:null,C=!g.ketchup.objects.isEmptyKupObj(f.obj),I=!(!f.isEditable&&!m.isEditable||!i.editable),$=i.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,[n.OBJ]:!!C,[z+"-cell"]:!0,[i.wrapperClass]:!!i.wrapperClass,[i.density]:!(!i.density||z===s.BAR),[F]:!!F};let V=$;I&&e.includes(z)?V=function(e,t,c,a,i){switch(e){case s.AUTOCOMPLETE:return r("kup-autocomplete",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:x(i)?"kup-full-width":"","onkup-autocomplete-change":t=>v(t,i,e,u.UPDATE),"onkup-autocomplete-input":t=>v(t,i,e,u.INPUT),"onkup-autocomplete-iconclick":t=>v(t,i,e,u.ICON_CLICK)}));case s.CHECKBOX:return O(i)&&(t[n.C_CENTERED]=!0),r(p,Object.assign({},c.data,{onChange:t=>v(t,i,e,u.UPDATE)}));case s.CHIP:return r("kup-chip",Object.assign({},c.data,{type:k.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,i,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+i.row.id,initialValue:c.value},c.data,{class:x(i)?"kup-full-width":"",disabled:!1,"onkup-colorpicker-change":t=>v(t,i,e,u.UPDATE)}));case s.COMBOBOX:return r("kup-combobox",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:x(i)?"kup-full-width":"","onkup-combobox-change":t=>v(t,i,e,u.UPDATE),"onkup-combobox-input":t=>v(t,i,e,u.INPUT),"onkup-combobox-iconclick":t=>v(t,i,e,u.ICON_CLICK)}));case s.DATE:return r("kup-date-picker",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:x(i)?"kup-full-width":"","onkup-datepicker-change":t=>v(t,i,e,u.UPDATE),"onkup-datepicker-input":t=>v(t,i,e,u.INPUT)}));case s.MULTI_AUTOCOMPLETE:return r("kup-chip",Object.assign({displayId:!0},c.data,{type:k.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,i,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,i,e,u.INPUT),"onkup-autocomplete-iconclick":t=>v(t,i,e,u.ICON_CLICK),showDropDownIcon:!1},c.slotData)));case s.MULTI_COMBOBOX:return r("kup-chip",Object.assign({displayId:!0},c.data,{type:k.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,i,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,i,e,u.INPUT),"onkup-combobox-iconclick":t=>v(t,i,e,u.ICON_CLICK)},c.slotData)));case s.RATING:return r("kup-rating",Object.assign({key:a.name+i.row.id},c.data,{disabled:!1,"onkup-rating-click":t=>v(t,i,e,u.UPDATE)}));case s.SWITCH:return r(y,Object.assign({},c.data,{disabled:!1,onChange:t=>v(t,i,e,u.UPDATE)}));case s.TIME:return r("kup-time-picker",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:x(i)?"kup-full-width":"","onkup-timepicker-change":t=>v(t,i,e,u.UPDATE),"onkup-timepicker-input":t=>v(t,i,e,u.INPUT)}));case s.NUMBER:t[n.C_RIGHT_ALIGNED]=!0;case s.LINK:case s.STRING:return r(b,Object.assign({inputType:e===s.NUMBER?"number":null,fullWidth:!!x(i)},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,i,e,u.UPDATE),onInput:t=>v(t,i,e,u.INPUT),onIconClick:t=>v(t,i,e,u.ICON_CLICK)}))}}(z,K,f,m,i):f.data&&t.includes(z)?(i.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=i.renderKup?function(e,t,c,a,i,o,l){switch(e){case s.BAR:return c.data?r("div",{style:{height:c.sizeY,width:"100%"}},r(d,Object.assign({},c))):r("kup-image",Object.assign({key:o.name+l.row.id,sizeX:"250px"},c));case s.BUTTON:return O(l)&&(t[n.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[n.C_CENTERED]=!0),c["data-storage"]={cell:a,row:i,column:o},r("kup-button-list",Object.assign({key:o.name+l.row.id},c));case s.CHART:return O(l)&&(t[n.C_CENTERED]=!0),r("kup-chart",Object.assign({key:o.name+l.row.id},c));case s.MULTI_AUTOCOMPLETE:case s.MULTI_COMBOBOX: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[n.C_CENTERED]=!0),c.disabled=i.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,i):r("span",{class:"cell-"+z+" placeholder"})):(i.setSizes&&function(e,t,c,i){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:i.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,i),V=function(e,t,c,a,i,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,i);return r("div",{class:"f-cell__text"},e)}return c;case s.CHECKBOX:return O(u)&&(a[n.C_CENTERED]=!0),r(d,{resource:t.checked?"check_box":"check_box_outline_blank",sizeX:"18px",sizeY:"18px"});case s.EDITOR:return r("div",{innerHTML:i.value});case s.ICON:case s.IMAGE:return O(u)&&(a[n.C_CENTERED]=!0),t.badgeData&&(a[n.C_PADDED]=!0),r(d,Object.assign({},t));case s.LINK:return r("a",{href:c,target:"_blank"},i.value);case s.NUMBER:if(c&&""!=c){const e=g.ketchup.math.numberifySafe(i.value),t=l(o,i);return e<0&&(a[n.TEXT_DANGER]=!0),O(u)&&(a[n.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[n.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,i));let H=null;!I&&(m.icon||f.icon)&&V&&(H=r(d,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(d,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,i,z,u.KEYUP),class:K,"kup-get-cell-props":()=>i,ref:e=>f.element=e,style:f.style},r("div",{class:"f-cell__content",style:f.styleContent,title:M},o&&o.length>0?o:[i.indents,T,H,V]))};function v(e,t,c,a){const i=t.cell,n=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:i.data&&(i.data.initialValue=p);break;case s.CHECKBOX:case s.SWITCH:p="on"===p?"0":"1",i.data&&(i.data.checked="0"!==p);break;case s.CHIP:case s.MULTI_AUTOCOMPLETE:case s.MULTI_COMBOBOX:p=e.detail.stringifiedValues,i.data&&(i.data.data=e.detail.comp.data)}i.obj&&(i.obj.k=p.toString()),i.value=p.toString(),i.displayedValue=null,i.displayedValue=l(n,i)}if(o&&o.rootElement){const t=new CustomEvent(a,{bubbles:!0,cancelable:!0,composed:!0,detail:{comp:o,id:o.rootElement.id,cell:i,column:n,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 i.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 i,h as s,H as e,g as o}from"./p-3da7e4c6.js";import{k as a,g as n,s as c,m as r,c as h,am as l,R as u,an as p,X as d,b}from"./p-2751c4ba.js";import{F as m}from"./p-0fd98ab4.js";import{F as k}from"./p-0e961148.js";import{c as g}from"./p-ad2e21d2.js";var f,x;!function(t){t.customStyle="Custom style of the component.",t.data="Sets the data that will be used to display different components."}(f||(f={})),function(t){t.BOX="Box",t.BUTTON_LIST="Button List",t.CHART="Chart",t.CHIP="Chip",t.ECHART="Echart",t.DATATABLE="Datatable",t.JSON="JSON",t.TREE="Tree"}(x||(x={}));const y=class{constructor(i){t(this,i),this.dragHandler=null,this.kupManager=a(),this.textArea=null,this.wrapperRef=null,this.display=x.DATATABLE,this.customStyle="",this.data=null}async getProps(t){return n(this,f,t)}async refresh(){i(this)}async setProps(t){c(this,f,t)}comboboxProps(){const t=[];for(const i in x)Object.prototype.hasOwnProperty.call(x,i)&&t.push({id:x[i],selected:!1,value:x[i]});return{data:{"kup-list":{data:t,id:"kup-debug-theme-changer-list"},"kup-text-field":{emitSubmitEventOnEnter:!1,inputType:"text",label:this.kupManager.language.translate(r.VIEW_AS)}},id:"comp-switcher",initialValue:this.display,isSelect:!0,"onKup-combobox-itemclick":t=>{this.display=t.detail.value}}}setContent(){const t=!!(this.data&&this.data.columns&&this.data.columns.length>0),i=[],e={};if(this.display===x.JSON)e.initialValue=this.data?JSON.stringify(this.data,null,2):"",e.textArea=!0,i.push(s("kup-text-field",Object.assign({class:"kup-full-width kup-full-height"},e,{ref:t=>this.textArea=t,"onkup-textfield-input":t=>{try{this.data=JSON.parse(t.detail.value)}catch(t){this.data={columns:[{name:"ERROR",title:"Error"}],rows:[{cells:{ERROR:{value:"Invalid JSON:"+t}}}]}}}})));else if(t)switch(this.display){case x.BOX:e.data=this.data,i.push(s("kup-box",Object.assign({},e)));break;case x.BUTTON_LIST:e.data=this.data,i.push(s("kup-button-list",Object.assign({},e)));break;case x.CHIP:e.data=this.data,i.push(s("kup-chip",Object.assign({},e)));break;case x.CHART:case x.ECHART:e.data=this.data,e.series=[],e.axis=null;for(let t=0;t<this.data.columns.length;t++){const i=this.data.columns[t];i.obj&&this.kupManager.objects.isNumber(i.obj)||null!==e.axis?e.series.push(this.display===x.CHART?{code:i.name,decode:i.title}:i.name):e.axis=i.name}0===e.series.length&&this.kupManager.debug.logMessage(this,"Not enough numerical columns to display a chart!",h.WARNING),e.axis||this.kupManager.debug.logMessage(this,"No axis for the chart!",h.WARNING),i.push(s(this.display===x.CHART?"kup-chart":"kup-echart",Object.assign({},e)));break;case x.DATATABLE:e.data=this.data,e.autoFillMissingCells=!0,i.push(s("kup-data-table",Object.assign({},e)));break;case x.TREE:e.data=this.data,i.push(s("kup-tree",Object.assign({class:"kup-full-width"},e)));break;default:return void this.kupManager.debug.logMessage(this,"Display mode not supported ("+this.display+")!",h.ERROR)}else i.push(s("div",{class:"empty"},s(k,{sizeY:"100px",resource:"move_to_inbox"}),s("div",{class:"empty-text"},this.kupManager.language.translate(r.DROP_YOUR_DATA))));return i}updateData(t){{const i=Object.assign({},this.data),s=t.detail.sourceElement&&t.detail.sourceElement.column?t.detail.sourceElement.column:null,e=t.detail.sourceElement&&t.detail.sourceElement.row?t.detail.sourceElement.row:null;if(s&&s.name?i.columns?this.data.columns.find((t=>t.name===s.name))||i.columns.push(s):i.columns=[s]:this.kupManager.debug.logMessage(this,"Invalid column received.",h.WARNING),e&&(i.rows?i.rows.push(e):i.rows=[e]),this.data=i,this.data&&this.textArea)try{this.textArea.setValue(JSON.stringify(this.data,null,2))}catch(t){this.textArea.setValue("Invalid JSON:"+t)}}}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.rootElement.addEventListener(l,(t=>this.updateData(t))),this.dragHandler=this.rootElement.shadowRoot.querySelector("#drag-handle"),this.kupManager.interact.dialogify(this.rootElement,this.dragHandler),this.kupManager.interact.dropzone(this.wrapperRef,{accept:`[${u}],[${p}]`},{dispatcher:this.rootElement,type:d.MAGICBOX}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){return s(e,null,s("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),s("div",{id:g},s("div",{class:"magic-box-wrapper"},s("div",{class:"actions",id:"drag-handle"},s("kup-combobox",Object.assign({},this.comboboxProps())),s("kup-button",{styling:m.FLAT,icon:"delete",label:"Reset","onkup-button-click":()=>{this.data=null}}),s("kup-button",{id:"close-dialog",customStyle:`:host{${b.PRIMARY}: var(${b.TITLE});}`,icon:"clear","onkup-button-click":()=>{this.kupManager.hideMagicBox()}})),s("div",{class:"content",ref:t=>this.wrapperRef=t},this.setContent()))))}disconnectedCallback(){this.kupManager.interact.unregister([this.rootElement,this.wrapperRef]),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return o(this)}};y.style=":host{background-color:var(--kup-background-color);color:var(--kup-text-color);display:block;height:300px;min-width:700px;width:700px}#kup-component,.magic-box-wrapper{height:100%;width:100%}.magic-box-wrapper{border:3px dashed var(--kup-border-color);box-sizing:border-box;display:flex;flex-direction:column}.actions{align-items:center;background-color:var(--kup-title-background-color);display:inline-flex;height:52px;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1}.actions kup-button{margin:0.5em}.actions #comp-switcher{margin:auto 0}.actions #close-dialog{position:absolute;margin:0;top:0;right:0;background-color:var(--kup-title-background-color)}.content{box-sizing:border-box;height:100%;margin-top:52px;overflow:auto;transition:background-color 125ms ease}.empty{flex-direction:column;display:flex;text-align:center;justify-content:center;height:100%;width:100%;opacity:0.5;transition:opacity 0.25s ease-out}.empty .f-image{margin:0}.json{font-family:var(--kup-font-family-monospace);margin:0}[kup-drag-over]{background-color:rgba(var(--kup-success-color-rgb), 0.25)}";export{y as kup_magic_box}
1
+ import{r as t,f as i,h as s,H as e,g as o}from"./p-b5deb573.js";import{k as a,g as n,s as c,m as r,c as h,am as l,R as u,an as p,X as d,b}from"./p-bd5ece4c.js";import{F as m}from"./p-0fd98ab4.js";import{F as k}from"./p-3879be61.js";import{c as g}from"./p-ad2e21d2.js";var f,x;!function(t){t.customStyle="Custom style of the component.",t.data="Sets the data that will be used to display different components."}(f||(f={})),function(t){t.BOX="Box",t.BUTTON_LIST="Button List",t.CHART="Chart",t.CHIP="Chip",t.ECHART="Echart",t.DATATABLE="Datatable",t.JSON="JSON",t.TREE="Tree"}(x||(x={}));const y=class{constructor(i){t(this,i),this.dragHandler=null,this.kupManager=a(),this.textArea=null,this.wrapperRef=null,this.display=x.DATATABLE,this.customStyle="",this.data=null}async getProps(t){return n(this,f,t)}async refresh(){i(this)}async setProps(t){c(this,f,t)}comboboxProps(){const t=[];for(const i in x)Object.prototype.hasOwnProperty.call(x,i)&&t.push({id:x[i],selected:!1,value:x[i]});return{data:{"kup-list":{data:t,id:"kup-debug-theme-changer-list"},"kup-text-field":{emitSubmitEventOnEnter:!1,inputType:"text",label:this.kupManager.language.translate(r.VIEW_AS)}},id:"comp-switcher",initialValue:this.display,isSelect:!0,"onKup-combobox-itemclick":t=>{this.display=t.detail.value}}}setContent(){const t=!!(this.data&&this.data.columns&&this.data.columns.length>0),i=[],e={};if(this.display===x.JSON)e.initialValue=this.data?JSON.stringify(this.data,null,2):"",e.textArea=!0,i.push(s("kup-text-field",Object.assign({class:"kup-full-width kup-full-height"},e,{ref:t=>this.textArea=t,"onkup-textfield-input":t=>{try{this.data=JSON.parse(t.detail.value)}catch(t){this.data={columns:[{name:"ERROR",title:"Error"}],rows:[{cells:{ERROR:{value:"Invalid JSON:"+t}}}]}}}})));else if(t)switch(this.display){case x.BOX:e.data=this.data,i.push(s("kup-box",Object.assign({},e)));break;case x.BUTTON_LIST:e.data=this.data,i.push(s("kup-button-list",Object.assign({},e)));break;case x.CHIP:e.data=this.data,i.push(s("kup-chip",Object.assign({},e)));break;case x.CHART:case x.ECHART:e.data=this.data,e.series=[],e.axis=null;for(let t=0;t<this.data.columns.length;t++){const i=this.data.columns[t];i.obj&&this.kupManager.objects.isNumber(i.obj)||null!==e.axis?e.series.push(this.display===x.CHART?{code:i.name,decode:i.title}:i.name):e.axis=i.name}0===e.series.length&&this.kupManager.debug.logMessage(this,"Not enough numerical columns to display a chart!",h.WARNING),e.axis||this.kupManager.debug.logMessage(this,"No axis for the chart!",h.WARNING),i.push(s(this.display===x.CHART?"kup-chart":"kup-echart",Object.assign({},e)));break;case x.DATATABLE:e.data=this.data,e.autoFillMissingCells=!0,i.push(s("kup-data-table",Object.assign({},e)));break;case x.TREE:e.data=this.data,i.push(s("kup-tree",Object.assign({class:"kup-full-width"},e)));break;default:return void this.kupManager.debug.logMessage(this,"Display mode not supported ("+this.display+")!",h.ERROR)}else i.push(s("div",{class:"empty"},s(k,{sizeY:"100px",resource:"move_to_inbox"}),s("div",{class:"empty-text"},this.kupManager.language.translate(r.DROP_YOUR_DATA))));return i}updateData(t){{const i=Object.assign({},this.data),s=t.detail.sourceElement&&t.detail.sourceElement.column?t.detail.sourceElement.column:null,e=t.detail.sourceElement&&t.detail.sourceElement.row?t.detail.sourceElement.row:null;if(s&&s.name?i.columns?this.data.columns.find((t=>t.name===s.name))||i.columns.push(s):i.columns=[s]:this.kupManager.debug.logMessage(this,"Invalid column received.",h.WARNING),e&&(i.rows?i.rows.push(e):i.rows=[e]),this.data=i,this.data&&this.textArea)try{this.textArea.setValue(JSON.stringify(this.data,null,2))}catch(t){this.textArea.setValue("Invalid JSON:"+t)}}}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.rootElement.addEventListener(l,(t=>this.updateData(t))),this.dragHandler=this.rootElement.shadowRoot.querySelector("#drag-handle"),this.kupManager.interact.dialogify(this.rootElement,this.dragHandler),this.kupManager.interact.dropzone(this.wrapperRef,{accept:`[${u}],[${p}]`},{dispatcher:this.rootElement,type:d.MAGICBOX}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){return s(e,null,s("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),s("div",{id:g},s("div",{class:"magic-box-wrapper"},s("div",{class:"actions",id:"drag-handle"},s("kup-combobox",Object.assign({},this.comboboxProps())),s("kup-button",{styling:m.FLAT,icon:"delete",label:"Reset","onkup-button-click":()=>{this.data=null}}),s("kup-button",{id:"close-dialog",customStyle:`:host{${b.PRIMARY}: var(${b.TITLE});}`,icon:"clear","onkup-button-click":()=>{this.kupManager.hideMagicBox()}})),s("div",{class:"content",ref:t=>this.wrapperRef=t},this.setContent()))))}disconnectedCallback(){this.kupManager.interact.unregister([this.rootElement,this.wrapperRef]),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return o(this)}};y.style=":host{background-color:var(--kup-background-color);color:var(--kup-text-color);display:block;height:300px;min-width:700px;width:700px}#kup-component,.magic-box-wrapper{height:100%;width:100%}.magic-box-wrapper{border:3px dashed var(--kup-border-color);box-sizing:border-box;display:flex;flex-direction:column}.actions{align-items:center;background-color:var(--kup-title-background-color);display:inline-flex;height:52px;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1}.actions kup-button{margin:0.5em}.actions #comp-switcher{margin:auto 0}.actions #close-dialog{position:absolute;margin:0;top:0;right:0;background-color:var(--kup-title-background-color)}.content{box-sizing:border-box;height:100%;margin-top:52px;overflow:auto;transition:background-color 125ms ease}.empty{flex-direction:column;display:flex;text-align:center;justify-content:center;height:100%;width:100%;opacity:0.5;transition:opacity 0.25s ease-out}.empty .f-image{margin:0}.json{font-family:var(--kup-font-family-monospace);margin:0}[kup-drag-over]{background-color:rgba(var(--kup-success-color-rgb), 0.25)}";export{y as kup_magic_box}
@@ -1,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-2751c4ba.js";import{c as m}from"./p-ad2e21d2.js";import{F as p}from"./p-79f78bdc.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-b5deb573.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-bd5ece4c.js";import{c as m}from"./p-ad2e21d2.js";import{F as p}from"./p-fb0b5466.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{h as n}from"./p-3da7e4c6.js";import{F as t}from"./p-0fd98ab4.js";import{F as o}from"./p-0e961148.js";const e=(e,u)=>{if(e.styling||(e.styling=t.RAISED),!e.label&&!e.icon)return;const i=!!(e.styling.toLowerCase()===t.ICON||e.styling.toLowerCase()===t.RAISED&&e.icon&&null==e.label);return n("div",Object.assign({class:`f-button ${e.danger?"kup-danger":""} ${e.fullHeight?"kup-full-height":""} ${e.fullWidth?"kup-full-width":""} ${e.info?"kup-info":""} ${e.large?"kup-large":""} ${e.pulsating?"kup-pulsating":""} ${e.shaped?"kup-shaped":""} ${e.secondary?"kup-secondary":""} ${e.slim?"kup-slim":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),i?function(t){const e={color:t.disabled?"var(--kup_button_disabled_color)":"var(--kup_button_primary_color)",sizeX:t.large?"calc(1.75em * 1.5)":"1.75em",sizeY:t.large?"calc(1.75em * 1.5)":"1.75em"};return n("button",{type:t.buttonType?t.buttonType:"button",class:{"icon-button":!0,"button--disabled":!!t.disabled,"icon-button--on":!(!t.toggable||!t.checked),toggable:!!t.toggable,"button--with-spinner":!(!t.showSpinner||t.disabled)},disabled:t.disabled,onClick:t.onClick,style:{"--kup_button_spinner_height":e.sizeY,"--kup_button_spinner_width":e.sizeX},value:t.checked?"on":"off","aria-label":t.title},!t.showSpinner||t.disabled?n(o,Object.assign({},e,{resource:t.toggable&&!t.checked?t.iconOff?t.iconOff:t.icon+"_border":t.icon,wrapperClass:"icon-button__icon kup-icon"})):null,t.toggable&&!t.showSpinner?n(o,Object.assign({},e,{resource:t.icon,wrapperClass:"icon-button__icon icon-button__icon--on kup-icon"})):null,t.showSpinner&&!t.disabled?n("div",{class:"icon-button__spinner-container"},n("slot",{name:"spinner"})):void 0)}(e):function(e){const u=e.styling.toLowerCase()===t.FLAT,i=e.styling.toLowerCase()===t.FLOATING,s=e.styling.toLowerCase()===t.ICON,r=e.styling.toLowerCase()===t.OUTLINED,a=!(u||i||r||s),l={color:e.disabled?"var(--kup_button_disabled_color)":r||u?"var(--kup_button_primary_color)":"var(--kup_button_text_on_primary_color)",resource:e.icon,sizeX:i?"1.75em":"1.475em",sizeY:i?"1.75em":"1.475em",wrapperClass:"button__icon kup-icon"};e.showSpinner&&(l.wrapperClass+=" content--hidden");const c={button__label:!0,"content--hidden":!(!e.showSpinner||e.disabled)};return n("button",{type:e.buttonType?e.buttonType:"button",class:{button:!0,"button--disabled":!!e.disabled,"button--floating":!!i,"button--outlined":!!r,"button--raised":!!a,"button--no-label":!e.label||" "===e.label,"button--with-spinner":!(!e.showSpinner||e.disabled)},disabled:e.disabled,onBlur:e.onBlur,onClick:e.onClick,onFocus:e.onFocus,style:{"--kup_button_spinner_height":l.sizeY},"aria-label":e.title},e.trailingIcon?[n("span",{class:c},e.label),e.icon?n(o,Object.assign({},l)):void 0]:[e.icon?n(o,Object.assign({},l)):void 0,n("span",{class:c},e.label)],e.showSpinner&&!e.disabled?n("div",{class:"button__spinner-container"},n("slot",{name:"spinner"})):void 0)}(e),u)};export{e as F}
1
+ import{h as n}from"./p-b5deb573.js";import{F as t}from"./p-0fd98ab4.js";import{F as o}from"./p-3879be61.js";const e=(e,u)=>{if(e.styling||(e.styling=t.RAISED),!e.label&&!e.icon)return;const i=!!(e.styling.toLowerCase()===t.ICON||e.styling.toLowerCase()===t.RAISED&&e.icon&&null==e.label);return n("div",Object.assign({class:`f-button ${e.danger?"kup-danger":""} ${e.fullHeight?"kup-full-height":""} ${e.fullWidth?"kup-full-width":""} ${e.info?"kup-info":""} ${e.large?"kup-large":""} ${e.pulsating?"kup-pulsating":""} ${e.shaped?"kup-shaped":""} ${e.secondary?"kup-secondary":""} ${e.slim?"kup-slim":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),i?function(t){const e={color:t.disabled?"var(--kup_button_disabled_color)":"var(--kup_button_primary_color)",sizeX:t.large?"calc(1.75em * 1.5)":"1.75em",sizeY:t.large?"calc(1.75em * 1.5)":"1.75em"};return n("button",{type:t.buttonType?t.buttonType:"button",class:{"icon-button":!0,"button--disabled":!!t.disabled,"icon-button--on":!(!t.toggable||!t.checked),toggable:!!t.toggable,"button--with-spinner":!(!t.showSpinner||t.disabled)},disabled:t.disabled,onClick:t.onClick,style:{"--kup_button_spinner_height":e.sizeY,"--kup_button_spinner_width":e.sizeX},value:t.checked?"on":"off","aria-label":t.title},!t.showSpinner||t.disabled?n(o,Object.assign({},e,{resource:t.toggable&&!t.checked?t.iconOff?t.iconOff:t.icon+"_border":t.icon,wrapperClass:"icon-button__icon kup-icon"})):null,t.toggable&&!t.showSpinner?n(o,Object.assign({},e,{resource:t.icon,wrapperClass:"icon-button__icon icon-button__icon--on kup-icon"})):null,t.showSpinner&&!t.disabled?n("div",{class:"icon-button__spinner-container"},n("slot",{name:"spinner"})):void 0)}(e):function(e){const u=e.styling.toLowerCase()===t.FLAT,i=e.styling.toLowerCase()===t.FLOATING,s=e.styling.toLowerCase()===t.ICON,r=e.styling.toLowerCase()===t.OUTLINED,l=!(u||i||r||s),a={color:e.disabled?"var(--kup_button_disabled_color)":r||u?"var(--kup_button_primary_color)":"var(--kup_button_text_on_primary_color)",resource:e.icon,sizeX:i?"1.75em":"1.475em",sizeY:i?"1.75em":"1.475em",wrapperClass:"button__icon kup-icon"};e.showSpinner&&(a.wrapperClass+=" content--hidden");const c={button__label:!0,"content--hidden":!(!e.showSpinner||e.disabled)};return n("button",{type:e.buttonType?e.buttonType:"button",class:{button:!0,"button--disabled":!!e.disabled,"button--floating":!!i,"button--outlined":!!r,"button--raised":!!l,"button--no-label":!e.label||" "===e.label,"button--with-spinner":!(!e.showSpinner||e.disabled)},disabled:e.disabled,onBlur:e.onBlur,onClick:e.onClick,onFocus:e.onFocus,style:{"--kup_button_spinner_height":a.sizeY},"aria-label":e.title},e.trailingIcon?[n("span",{class:c},e.label),e.icon?n(o,Object.assign({},a)):void 0]:[e.icon?n(o,Object.assign({},a)):void 0,n("span",{class:c},e.label)],e.showSpinner&&!e.disabled?n("div",{class:"button__spinner-container"},n("slot",{name:"spinner"})):void 0)}(e),u)};export{e as F}
@@ -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 l,V as a,m as c}from"./p-2751c4ba.js";import{c as d}from"./p-ad2e21d2.js";import{F as p}from"./p-5443df89.js";import"./p-90576709.js";import"./p-79f78bdc.js";import"./p-0e961148.js";import"./p-d938d1cd.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
+ import{r as t,f as s,h as i,H as e,g as h}from"./p-b5deb573.js";import{k as o,d as n,g as r,s as l,V as a,m as c}from"./p-bd5ece4c.js";import{c as d}from"./p-ad2e21d2.js";import{F as p}from"./p-68cd7d9a.js";import"./p-fd1323da.js";import"./p-fb0b5466.js";import"./p-3879be61.js";import"./p-55182fcf.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 e,f as i,h as o,H as s,g as r}from"./p-3da7e4c6.js";import{k as a,g as h,s as n}from"./p-2751c4ba.js";import{c as p}from"./p-ad2e21d2.js";var l;!function(t){t.customStyle="Custom style of the component.",t.placeholderAttrs="Html attributes of the picture before the component enters the viewport.",t.resourceAttrs="Html attributes of the picture after the component enters the viewport."}(l||(l={}));var f,c,d,u,m,w,b=function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)},v=function(t,e,i,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(t,i):s?s.value=i:e.set(t,i),i};const k=class{constructor(i){t(this,i),this.kupPhotoFramePlaceholderLoad=e(this,"kup-photoframe-placeholderload",6),this.kupPhotoFrameResourceLoad=e(this,"kup-photoframe-resourceload",6),f.set(this,null),c.set(this,a()),d.set(this,null),u.set(this,null),m.set(this,!1),w.set(this,null),this.isInViewport=!1,this.customStyle="",this.placeholderAttrs={},this.resourceAttrs={},this.threshold=.25}async getProps(t){return h(this,l,t)}async refresh(){i(this)}async setProps(t){n(this,l,t)}setObserver(){v(this,f,new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.isInViewport=!0,b(this,f,"f").unobserve(this.rootElement))}))}),{threshold:this.threshold}),"f")}componentWillLoad(){b(this,c,"f").debug.logLoad(this,!1),b(this,c,"f").theme.register(this),this.setObserver()}componentDidLoad(){b(this,c,"f").debug.logLoad(this,!0)}componentWillRender(){b(this,c,"f").debug.logRender(this,!1)}componentDidRender(){b(this,c,"f").debug.logRender(this,!0)}render(){return this.isInViewport&&!b(this,m,"f")&&v(this,m,!0,"f"),o(s,null,o("style",null,b(this,c,"f").theme.setKupStyle(this.rootElement)),o("div",{id:p,ref:t=>{v(this,w,t,"f")}},o("img",Object.assign({},this.placeholderAttrs,{class:"placeholder",ref:t=>v(this,d,t,"f"),onLoad:()=>{b(this,d,"f").naturalWidth>b(this,d,"f").naturalHeight?b(this,w,"f").classList.add("horizontal"):b(this,w,"f").classList.add("vertical"),b(this,f,"f").observe(this.rootElement),b(this,d,"f").classList.add("placeholder--loaded"),this.kupPhotoFramePlaceholderLoad.emit({comp:this,id:this.rootElement.id})}})),b(this,m,"f")?o("img",Object.assign({},this.resourceAttrs,{class:"resource",ref:t=>v(this,u,t,"f"),onLoad:()=>{b(this,d,"f").classList.add("placeholder--fade-out"),b(this,u,"f").classList.add("resource--fade-in"),this.kupPhotoFrameResourceLoad.emit({comp:this,id:this.rootElement.id})}})):null))}disconnectedCallback(){var t;b(this,c,"f").theme.unregister(this),null===(t=b(this,f,"f"))||void 0===t||t.unobserve(this.rootElement)}get rootElement(){return r(this)}};f=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,m=new WeakMap,w=new WeakMap,k.style=":host{--kup_photoframe_border:var(\n --kup-photoframe-border,\n 1px inset var(--kup-border-color)\n );--kup_photoframe_fade_out_time:var(--kup-photoframe-fade-out-time, 2000ms);border:var(--kup_photoframe_border);display:block;height:100%;position:relative;width:100%}#kup-component{position:relative;height:100%;width:100%}img{max-height:100%;max-width:100%}.horizontal img{width:100%}.vertical img{height:100%}.placeholder{display:none;transition:opacity var(--kup_photoframe_fade_out_time) ease-out;will-change:opacity;z-index:1}.placeholder--loaded{display:block}.placeholder--fade-out{opacity:0;position:absolute}.resource{display:none;left:0;position:absolute;top:0;z-index:0}.resource--fade-in{display:block;position:relative}:host(.kup-fit) img{height:100%;object-fit:cover;width:100%}";export{k as kup_photo_frame}
1
+ import{r as t,c as e,f as i,h as o,H as s,g as r}from"./p-b5deb573.js";import{k as h,g as a,s as n}from"./p-bd5ece4c.js";import{c as p}from"./p-ad2e21d2.js";var l;!function(t){t.customStyle="Custom style of the component.",t.placeholderAttrs="Html attributes of the picture before the component enters the viewport.",t.resourceAttrs="Html attributes of the picture after the component enters the viewport."}(l||(l={}));var f,c,d,u,m,w,b=function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)},v=function(t,e,i,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(t,i):s?s.value=i:e.set(t,i),i};const k=class{constructor(i){t(this,i),this.kupPhotoFramePlaceholderLoad=e(this,"kup-photoframe-placeholderload",6),this.kupPhotoFrameResourceLoad=e(this,"kup-photoframe-resourceload",6),f.set(this,null),c.set(this,h()),d.set(this,null),u.set(this,null),m.set(this,!1),w.set(this,null),this.isInViewport=!1,this.customStyle="",this.placeholderAttrs={},this.resourceAttrs={},this.threshold=.25}async getProps(t){return a(this,l,t)}async refresh(){i(this)}async setProps(t){n(this,l,t)}setObserver(){v(this,f,new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.isInViewport=!0,b(this,f,"f").unobserve(this.rootElement))}))}),{threshold:this.threshold}),"f")}componentWillLoad(){b(this,c,"f").debug.logLoad(this,!1),b(this,c,"f").theme.register(this),this.setObserver()}componentDidLoad(){b(this,c,"f").debug.logLoad(this,!0)}componentWillRender(){b(this,c,"f").debug.logRender(this,!1)}componentDidRender(){b(this,c,"f").debug.logRender(this,!0)}render(){return this.isInViewport&&!b(this,m,"f")&&v(this,m,!0,"f"),o(s,null,o("style",null,b(this,c,"f").theme.setKupStyle(this.rootElement)),o("div",{id:p,ref:t=>{v(this,w,t,"f")}},o("img",Object.assign({},this.placeholderAttrs,{class:"placeholder",ref:t=>v(this,d,t,"f"),onLoad:()=>{b(this,d,"f").naturalWidth>b(this,d,"f").naturalHeight?b(this,w,"f").classList.add("horizontal"):b(this,w,"f").classList.add("vertical"),b(this,f,"f").observe(this.rootElement),b(this,d,"f").classList.add("placeholder--loaded"),this.kupPhotoFramePlaceholderLoad.emit({comp:this,id:this.rootElement.id})}})),b(this,m,"f")?o("img",Object.assign({},this.resourceAttrs,{class:"resource",ref:t=>v(this,u,t,"f"),onLoad:()=>{b(this,d,"f").classList.add("placeholder--fade-out"),b(this,u,"f").classList.add("resource--fade-in"),this.kupPhotoFrameResourceLoad.emit({comp:this,id:this.rootElement.id})}})):null))}disconnectedCallback(){var t;b(this,c,"f").theme.unregister(this),null===(t=b(this,f,"f"))||void 0===t||t.unobserve(this.rootElement)}get rootElement(){return r(this)}};f=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,m=new WeakMap,w=new WeakMap,k.style=":host{--kup_photoframe_border:var(\n --kup-photoframe-border,\n 1px inset var(--kup-border-color)\n );--kup_photoframe_fade_out_time:var(--kup-photoframe-fade-out-time, 2000ms);border:var(--kup_photoframe_border);display:block;height:100%;position:relative;width:100%}#kup-component{position:relative;height:100%;width:100%}img{max-height:100%;max-width:100%}.horizontal img{width:100%}.vertical img{height:100%}.placeholder{display:none;transition:opacity var(--kup_photoframe_fade_out_time) ease-out;will-change:opacity;z-index:1}.placeholder--loaded{display:block}.placeholder--fade-out{opacity:0;position:absolute}.resource{display:none;left:0;position:absolute;top:0;z-index:0}.resource--fade-in{display:block;position:relative}:host(.kup-fit) img{height:100%;object-fit:cover;width:100%}";export{k as kup_photo_frame}
@@ -1 +1 @@
1
- import{r as i,h as t,g as h}from"./p-3da7e4c6.js";import{k as o}from"./p-2751c4ba.js";const e=class{constructor(t){i(this,t),this.kupManager=o(),this.config=void 0,this.qlik=void 0,this.appid="",this.app=!1,this.grid=[],this.debug=!1,this.fluid=!1,this.bordered=!1,this.defobjsize="400px",this.divlist=[]}getObjects(i){let t;return new Promise((h=>{i.rows.forEach((i=>{i.columns.forEach((i=>{t=!1,i.noSelections&&(t=i.noSelections),this.app.getObject(i.obj,i.obj,{noInteraction:!1,noSelections:t})}))})),h(!0)}))}doSelection(i){return new Promise((t=>{i.selections&&i.selections.forEach((i=>{this.app.field(i.field).selectValues(i.values,!1,!0)})),t(!0)}))}setRender(i){return new Promise((h=>{this.divlist=[],i.rows.forEach((i=>{let h=[];i.columns.forEach((i=>{let o="qvobject ";this.bordered&&(o+="bordered "),o=o+"width-"+i.colDim+" size-"+i.size,h.push(t("div",""!=i.obj?{id:i.obj,class:o}:{class:o}))})),this.divlist.push(t("div",{class:"kup-qlik-row"},h))})),h(!0)}))}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1),this.setRender(this.grid)}render(){let i=null,h=null;return i=this.fluid?{"kup-qlik-container-fluid":!0}:{"kup-qlik-container":!0},h={"--lyo_obj-height":this.defobjsize},t("div",{class:i,style:h},this.divlist)}componentDidRender(){this.debug&&console.log("Grid",this.grid),this.qlik&&(""==this.appid||this.app?this.debug&&console.log("App already open:",this.app):this.app=this.qlik.openApp(this.appid,this.config),this.app&&this.getObjects(this.grid).then((()=>{this.doSelection(this.grid)}))),this.kupManager.debug.logRender(this,!0)}get rootElement(){return h(this)}};e.style=".kup-qlik-container-fluid{width:100%}.kup-qlik-container{width:100%}@media (min-width: 576px){.kup-qlik-container{width:576px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 768px){.kup-qlik-container{width:768px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 992px){.kup-qlik-container{width:992px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 1200px){.kup-qlik-container{width:1200px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}.kup-qlik-row{display:flex;display:ms-flexbox;flex-wrap:wrap;-ms-flex-wrap:wrap;margin-bottom:5px}.kup-qlik-row .size-M{height:var(--lyo_obj-height)}.kup-qlik-row .size-S{height:calc(var(--lyo_obj-height) / 2)}.kup-qlik-row .size-XS{height:calc(var(--lyo_obj-height) / 3)}.kup-qlik-row .size-L{height:calc(var(--lyo_obj-height) * 2)}.kup-qlik-row .size-XL{height:calc(var(--lyo_obj-height) * 3)}.kup-qlik-row .bordered{border:1px solid var(--kup-border-color, #969696)}.kup-qlik-row .width-1{width:8.3333%}.kup-qlik-row .width-2{width:16.6666%}.kup-qlik-row .width-3{width:25%}.kup-qlik-row .width-4{width:33.3333%}.kup-qlik-row .width-5{width:41.6666%}.kup-qlik-row .width-6{width:50%}.kup-qlik-row .width-7{width:58.3333%}.kup-qlik-row .width-8{width:66.6666%}.kup-qlik-row .width-9{width:75%}.kup-qlik-row .width-10{width:83.3333%}.kup-qlik-row .width-11{width:91.6666%}.kup-qlik-row .width-12{width:100%}";export{e as kup_qlik}
1
+ import{r as i,h as t,g as h}from"./p-b5deb573.js";import{k as o}from"./p-bd5ece4c.js";const e=class{constructor(t){i(this,t),this.kupManager=o(),this.config=void 0,this.qlik=void 0,this.appid="",this.app=!1,this.grid=[],this.debug=!1,this.fluid=!1,this.bordered=!1,this.defobjsize="400px",this.divlist=[]}getObjects(i){let t;return new Promise((h=>{i.rows.forEach((i=>{i.columns.forEach((i=>{t=!1,i.noSelections&&(t=i.noSelections),this.app.getObject(i.obj,i.obj,{noInteraction:!1,noSelections:t})}))})),h(!0)}))}doSelection(i){return new Promise((t=>{i.selections&&i.selections.forEach((i=>{this.app.field(i.field).selectValues(i.values,!1,!0)})),t(!0)}))}setRender(i){return new Promise((h=>{this.divlist=[],i.rows.forEach((i=>{let h=[];i.columns.forEach((i=>{let o="qvobject ";this.bordered&&(o+="bordered "),o=o+"width-"+i.colDim+" size-"+i.size,h.push(t("div",""!=i.obj?{id:i.obj,class:o}:{class:o}))})),this.divlist.push(t("div",{class:"kup-qlik-row"},h))})),h(!0)}))}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1),this.setRender(this.grid)}render(){let i=null,h=null;return i=this.fluid?{"kup-qlik-container-fluid":!0}:{"kup-qlik-container":!0},h={"--lyo_obj-height":this.defobjsize},t("div",{class:i,style:h},this.divlist)}componentDidRender(){this.debug&&console.log("Grid",this.grid),this.qlik&&(""==this.appid||this.app?this.debug&&console.log("App already open:",this.app):this.app=this.qlik.openApp(this.appid,this.config),this.app&&this.getObjects(this.grid).then((()=>{this.doSelection(this.grid)}))),this.kupManager.debug.logRender(this,!0)}get rootElement(){return h(this)}};e.style=".kup-qlik-container-fluid{width:100%}.kup-qlik-container{width:100%}@media (min-width: 576px){.kup-qlik-container{width:576px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 768px){.kup-qlik-container{width:768px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 992px){.kup-qlik-container{width:992px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 1200px){.kup-qlik-container{width:1200px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}.kup-qlik-row{display:flex;display:ms-flexbox;flex-wrap:wrap;-ms-flex-wrap:wrap;margin-bottom:5px}.kup-qlik-row .size-M{height:var(--lyo_obj-height)}.kup-qlik-row .size-S{height:calc(var(--lyo_obj-height) / 2)}.kup-qlik-row .size-XS{height:calc(var(--lyo_obj-height) / 3)}.kup-qlik-row .size-L{height:calc(var(--lyo_obj-height) * 2)}.kup-qlik-row .size-XL{height:calc(var(--lyo_obj-height) * 3)}.kup-qlik-row .bordered{border:1px solid var(--kup-border-color, #969696)}.kup-qlik-row .width-1{width:8.3333%}.kup-qlik-row .width-2{width:16.6666%}.kup-qlik-row .width-3{width:25%}.kup-qlik-row .width-4{width:33.3333%}.kup-qlik-row .width-5{width:41.6666%}.kup-qlik-row .width-6{width:50%}.kup-qlik-row .width-7{width:58.3333%}.kup-qlik-row .width-8{width:66.6666%}.kup-qlik-row .width-9{width:75%}.kup-qlik-row .width-10{width:83.3333%}.kup-qlik-row .width-11{width:91.6666%}.kup-qlik-row .width-12{width:100%}";export{e as kup_qlik}
@@ -1 +1 @@
1
- import{E as e,J as t,H as l,D as n,af as r,v as i,z as o,ah as s,ai as a,N as u,h as c,a2 as f,aj as h,r as d,m as p}from"./p-2751c4ba.js";import{h as b}from"./p-3da7e4c6.js";import{F as m}from"./p-fe8c8e11.js";import{F as v}from"./p-0fd98ab4.js";class F extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,l){let n="";if(null==e)return n;let r=e[t];return null==r||(n=l?r.textFieldTmp:r.textField),n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,l){if(!t)return!1;let n=this._getTextFilterValue(e,t.name,l);if(null!=n&&""!=n.trim())return!0;if(this._hasIntervalTextFieldFilterValues(e,t,l))return!0;let r=this.getCheckBoxFilterValues(e,t.name);return!(null==r||r.length<1)}getCheckBoxFilterValues(e={},t){let l=[];if(null==e)return l;let n=e[t];return null==n||null==n.checkBoxes||(l=n.checkBoxes),l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!1)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!0)}_hasIntervalTextFieldFilterValues(e={},l,n){if(null==l)return!1;if(!this.isColumnFiltrableByInterval(l))return!1;let r=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(null!=r&&""!=r.trim())return!0;let i=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);return null!=i&&""!=i.trim()}addCheckboxFilter(t={},l,n){if(null==t)return;let r=t[l];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},t[l]=r),null==r.checkBoxes&&(r.checkBoxes=[]),null==n||null==n.value?r.checkBoxes=[]:e.valuesArrayContainsValue(r.checkBoxes,n.value)||(r.checkBoxes[r.checkBoxes.length]=n)}removeCheckboxFilter(t={},l,n){if(null==t||null==n)return;let r=t[l];if(null==r)return;null==r.checkBoxes&&(r.checkBoxes=[]);let i=e.indexOfValueInValuesArray(r.checkBoxes,n);if(i>=0){let e=[];for(let t=0;t<r.checkBoxes.length;t++)t!=i&&(e[e.length]=r.checkBoxes[t]);r.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!1)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!0)}_getIntervalTextFieldFilterValues(e={},l,n){return this._hasIntervalTextFieldFilterValues(e,l,n)?[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)]:["",""]}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!1)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!0)}_getIntervalTextFieldFilterValue(e={},t,l,n){let r="";if(null==e)return r;let i=e[t];return null==i||n&&null==i.intervalTmp?r:n||null!=i.interval?(r=n?i.intervalTmp[l]:i.interval[l],r):r}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,!0)}_setTextFieldFilterValue(e={},t,l,n){if(null==e)return;let r=e[t];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=r),n?r.textFieldTmp=null!=l?l.trim():l:r.textField=null!=l?l.trim():l}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,!0)}_setIntervalTextFieldFilterValue(e={},t,l,n,r){if(null==e)return;let i=e[t];null==i&&(i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=i),null==i.interval&&(i.interval=[],i.interval.push("","")),null==i.intervalTmp&&(i.intervalTmp=[],i.intervalTmp.push("","")),r?i.intervalTmp[n]=null!=l?l.trim():l:i.interval[n]=null!=l?l.trim():l}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,!1)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,!0)}getFilterValueForTooltip(e={},r){let i=this.getTextFilterValue(e,r.name),o=this.getIntervalTextFieldFilterValues(e,r),s=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=o[t.FROM]&&(u+=a+"(>= "+l(o[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=o[t.TO]&&(u+=a+"(<= "+l(o[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return s.forEach((e=>{c+=a+n(e,r),a=" OR "})),""!=c&&(c="("+c+")",""!=u&&(c=" AND "+c)),c=u+c,c}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var x;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.removableColumns="Sets the possibility to remove the selected column.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(x||(x={}));const w="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const k=document.documentElement,T=k.ketchup?k.ketchup.objects:new o,y=k.ketchup?k.ketchup.data:new s;class j extends e{isFilterCompliantForCell(e,t,l){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=!1,r=[],i){return this.areCellsCompliant(e.cells,t,l,n,r,i)}areCellsCompliant(e,t={},l="",n=!1,o=[],s){if(n){let t=!0;if(o&&null!=o&&o.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<o.length;i++){if(0==o[i].visible)continue;const s=e[o[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,l);let a=r(o[i],s);if(a!=s.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==s&&(s=new F),!this.hasFilters(t,o,s))return!0;let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const r=e[n];if(!r)return!1;let u=s.getTextFilterValue(t,n),c=s.getIntervalTextFieldFilterValues(t,i(o,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(T.isNumber(r.obj)||T.isDate(r.obj)||T.isTime(r.obj)||T.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let p=s.getCheckBoxFilterValues(t,n);if(0==p.length)continue;let b=!1;for(let e=0;e<p.length;e++){let t=p[e];if(null!=t&&null!=t.value){if(null!=r.value&&r.value.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}}}if(!b)return!1}return!0}hasFilters(e={},t,l){if(null==e)return!1;let n=Object.keys(e);if(null==n||n.length<1)return!1;null==l&&(l=new F);for(let r=0;r<n.length;r++){let o=n[r],s=null;if(s=o===w?{name:w,title:""}:i(t,o),l.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},l="",n=[],r){if(!e||null==e)return[];let i=[];const o=!(!l||!n);if(this.hasFilters(t,n,r)||o)for(let s=0;s<e.length;s++){let a=e[s];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,o,n,r))&&(i[i.length]=a)}else i=[...e];return i}getColumnValues(t,n,r,i){let o=new Array;null==i&&(i=new F);let s=i.getTextFilterValueTmp(t.filters,n.name),a=i.getIntervalTextFieldFilterValuesTmp(t.filters,n),u=i.getCheckBoxFilterValues(t.filters,n.name);if(null!=n.valuesForFilter&&n.valuesForFilter.length>0)return n.valuesForFilter.forEach((t=>{let r=t;(e.valuesArrayContainsValue(u,r)||""==s||i.isFilterCompliantForSimpleValue(r,n.obj,s,a))&&o.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),o;let c=Object.assign({},t.filters);c[n.name]={textField:s,textFieldTmp:s,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)o.push(u[e]);return y.cell.getUnivocalValue({rows:f},n,!0)}}const C=document.documentElement;function V(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const l=e[0].group.column;let n=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let l of t)if(l.column===e)return l;return null}(l,t);return n||(n={column:l,sortMode:f.A}),e.sort(((e,t)=>a({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},n.sortMode))),e.forEach((e=>{e.group.children=V(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const r=O(e,n,t[l]);if(0!==r)return r}return 0}return O(e,n,t[0])}))}function O(e,t,l){const n=e.cells[l.column],r=t.cells[l.column];return n||r?n?r?a(n,r,l.sortMode):-1:1:0}function I(e=[],t={},l="",n=[],r,i){return null==i&&(i=new j),i.filterRows(e,t,l,n,r)}function M(e=[],t=[],l=[],n={}){if(!t)return[];if(!l||0===l.length||!e||0===e.length)return t;const o={},s=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return o[l]=n,!0;return!1}));if(0===s.length)return t;const a=[];let c={};return t.forEach((t=>{const l=s[0].column,f=t.cells[l];if(f){const h=i(e,l),d=r(h,f),p=f.value;let b=null;for(let e of a)if(e.group.label===d){b=e;break}null===b&&(b={group:{id:p,parent:null,column:l,columnLabel:o[l],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},a.push(b));for(let l=1;l<s.length;l++){const n=s[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(t,a),s=a.value;let u=null;for(let e=0;e<b.group.children.length;e++){const t=b.group.children[e];if(t.group.label===l){u=t;break}}u||(u={cells:{},group:{id:s,parent:b,column:n.column,columnLabel:o[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},D(u),b.group.children.push(u)),b=u}}b.group.children.push(t),function(e,t,l,n){if(!e||!t)return;const r=Object.keys(t);0!==r.length&&r.forEach((r=>{const i=C.ketchup.math.numberify(e.group.totals[r]||0),o=l.cells[r];if(o){let l=C.ketchup.objects.isNumber(o.obj);const s=t[r];switch(s){case u.COUNT:e.group.totals[r]=i+1;let t=e.group.parent;for(;null!=t;)t.group.totals[r]=(t.group.totals[r]||0)+1,t=t.group.parent;break;case u.DISTINCT:let a;if(a=l?C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value)):o.value,n[e.group.id]){let t=n[e.group.id][r];t?t.push(a):(n[e.group.id][r]=[],n[e.group.id][r].push(a))}else n[e.group.id]={},n[e.group.id][r]=[],n[e.group.id][r].push(a);let c=e.group.parent;for(;null!=c;){if(n[c.group.id]){let e=n[c.group.id][r];e?e.push(a):(n[c.group.id][r]=[],n[c.group.id][r].push(a))}else n[c.group.id]={},n[c.group.id][r]=[],n[c.group.id][r].push(a);c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(l){const t=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t+i;let l=e.group.parent;for(;null!=l;){const e=C.ketchup.math.numberify(l.group.totals[r]||0);l.group.totals[r]=t+e,l=l.group.parent}}break;case u.MIN:if(l){const t=e.group.totals[r],l=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t?Math.min(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.min(e,l):l,n=n.group.parent}}else if(C.ketchup.objects.isDate(o.obj)){const t=o.obj?C.ketchup.objects.parseDate(o.obj):C.ketchup.dates.toDayjs(o.value);if(C.ketchup.dates.isValid(t)){const l=C.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(C.ketchup.dates.format(n)),e.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.min(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(C.ketchup.dates.format(e)),i.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.min(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;case u.MAX:if(l){const t=e.group.totals[r],l=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t?Math.max(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.max(e,l):l,n=n.group.parent}}else if(C.ketchup.objects.isDate(o.obj)){const t=o.obj?C.ketchup.objects.parseDate(o.obj):C.ketchup.dates.toDayjs(o.value);if(C.ketchup.dates.isValid(t)){const l=C.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(C.ketchup.dates.format(n)),e.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.max(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(C.ketchup.dates.format(e)),i.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.max(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;default:0!=s.indexOf(u.MATH)&&console.warn(`invalid total mode: ${s}`)}}}))}(b,n,t,c)}})),function(e,t,l){if(!e||!t)return;const n=Object.keys(t);if(0===e.length||!e[0].group||0===n.length)return;let r=n.filter((e=>u.DISTINCT===t[e]));r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>N(e,r,l)))}(a,n,c),_(a,u.AVERAGE,n),_(a,u.MATH,n),a}function _(e,t,l){if(!e||!l)return;const n=Object.keys(l);if(0===e.length||!e[0].group||0===n.length)return;let r;t==u.AVERAGE&&(r=n.filter((e=>u.AVERAGE===l[e]))),t==u.MATH&&(r=n.filter((e=>0==l[e].indexOf(u.MATH)))),r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>W(e,t,r,l)))}function N(e,t,l){const n=e.group.children;0!==n.length&&(n[0].group&&n.forEach((e=>{N(e,t,l)})),t.forEach((t=>{e.group.totals[t]=new Set(l[e.group.id][t]).size})))}function W(e,t,l,n){const r=e.group.children;if(0===r.length)return 0;let i=0;return r[0].group?r.forEach((e=>{i+=W(e,t,l,n)})):i=r.length,l.forEach((l=>{if(t==u.AVERAGE&&(e.group.totals[l]=C.ketchup.math.numberify(e.group.totals[l])/i),t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=C.ketchup.math.formulas.custom(t,e.group.totals)}})),i}function A(e,t){if(t){const l=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const l=t.cells[e.name];l&&e.obj&&!l.obj&&(l.obj={t:e.obj.t,p:e.obj.p,k:l.value})}}))})),l}}function B(e=[],t={}){if(C.ketchup.objects.isEmptyJsObject(e)||C.ketchup.objects.isEmptyJsObject(t))return{};const l=Object.keys(t),n={},r=new Array;if(0===l.length||l.every((e=>t[e]===u.COUNT)))l.forEach((t=>n[t]=e.length));else{let i={};e.forEach(((e,o,s)=>{l.filter((e=>u.COUNT!==t[e]&&0!=t[e].indexOf(u.MATH))).forEach((l=>{const a=e.cells[l];if(a)if(t[l]===u.DISTINCT){let e;e=C.ketchup.objects.isNumber(a.obj)?C.ketchup.math.numberify(C.ketchup.math.numberifySafe(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(C.ketchup.objects.isNumber(a.obj)){const e=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(a.value));let r=n[l];switch(!0){case t[l]===u.MIN:n[l]=r?Math.min(r,e):e;break;case t[l]===u.MAX:n[l]=r?Math.max(r,e):e;break;default:r=n[l]||0,n[l]=e+C.ketchup.math.numberify(r)}}else if(C.ketchup.objects.isDate(a.obj)){-1==r.indexOf(l)&&r.push(l);const e=C.ketchup.dates.toDayjs(a.value);if(C.ketchup.dates.isValid(e)){const r=C.ketchup.dates.toDate(e),i=n[l]?C.ketchup.dates.toDate(C.ketchup.dates.toDayjs(n[l])):null;switch(!0){case t[l]===u.MIN:if(i){let e=[];e.push(r),e.push(i),n[l]=C.ketchup.dates.format(C.ketchup.dates.min(e),c.ISO_DATE)}else n[l]=C.ketchup.dates.format(r,c.ISO_DATE);break;case t[l]===u.MAX:if(i){let e=[];e.push(r),e.push(i),n[l]=C.ketchup.dates.format(C.ketchup.dates.max(e),c.ISO_DATE)}else n[l]=C.ketchup.dates.format(r,c.ISO_DATE)}}}o===s.length-1&&t[l]===u.DISTINCT&&(n[l]=new Set(i[l]).size,i[l]=[])}))}))}for(let i of l){switch(!0){case t[i]===u.AVERAGE:const l=n[i];l&&e.length>0&&(n[i]=l/e.length);break;case t[i]===u.COUNT:n[i]=e.length;break;case 0==t[i].indexOf(u.MATH):n[i]=C.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=C.ketchup.dates.format(n[i]):C.ketchup.math.isNumber(n[i])&&(n[i]=+n[i].toFixed(2)))}return n}function D(e){if(!e.group)return;let t=e.group.id,l=e.group.parent;for(;null!==l;)t=`${l.group.id};${t}`,l=l.group.parent;e.group.id=t}function $(e,t,l,n){const r=t*l-l,i=r+Number(l);if(0==n)return e.slice(r,i);let o=[];return E(e,o,r,Number(l),0),o}function E(e,t,l,n,r){let i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=L(e[o]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=E(s.group.children,a.group.children,l,n,r);r=e.ci,i=e.added,1==i&&(t[t.length]=a)}else r>=l&&(t[t.length]=a,i=!0),r++;if(r>=l+n)break}return{ci:r,added:i}}function L(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:R(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function S(e){if(null==e)return null;let t=[];for(let l=0;l<e.length;l++)t[t.length]=L(e[l]);return t}function R(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:S(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}var z;!function(e){e.SIMPLE="simple",e.FULL="full"}(z||(z={}));const q=document.documentElement,H=e=>{const t=Math.ceil(e.max/e.perPage),l=function(e,t){const l=[];for(let n=1;n<=t;n++){const t=n==e.currentPage;l.push({id:n.toString(),selected:t,value:n.toString()})}return l}(e,t),n=function(e){const t=[];let l=e.perPage;if(0===l)return t;for(;l<e.max;){const n=l==e.perPage;t.push({id:l.toString(),selected:n,value:l.toString()}),l*=2}const n=e.max==e.perPage;return t.push({id:e.max.toString(),selected:n,value:e.max.toString()}),t}(e),r={"kup-list":{data:l},"kup-text-field":{label:q.ketchup.language.translate(h.PAGE),helper:q.ketchup.language.translate(h.TOTAL)+`: ${t}`,helperWhenFocused:!0,inputType:"number",max:t,min:1}},i={"kup-list":{data:n},"kup-text-field":{label:q.ketchup.language.translate(d.ROWS)+" / "+q.ketchup.language.translate(h.PAGE),helper:q.ketchup.language.translate(d.TOTAL)+`: ${e.max}`,helperWhenFocused:!0,inputType:"number",max:e.max,min:1}};return b("div",Object.assign({class:`f-paginator ${e.mode?e.mode:""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),e.mode!==z.SIMPLE?b(m,{icon:"chevron_left",disabled:K(e),onClick:e.onPrevPage,wrapperClass:"prev-page"}):null,b("kup-combobox",{class:"page-selector",data:r,initialValue:e.currentPage.toString(),"onkup-combobox-change":e.onPageChange}),e.mode!==z.SIMPLE?b(m,{icon:"chevron_right",disabled:J(e),onClick:e.onNextPage,wrapperClass:"next-page"}):null,b("kup-combobox",{class:"rows-selector",data:i,initialValue:e.perPage.toString(),"onkup-combobox-change":e.onRowsChange}),e.onLoadMore?b(m,{icon:"plus",onClick:e.onLoadMore,label:q.ketchup.language.translate(p.LOAD_MORE),styling:v.FLAT,wrapperClass:"load-more-button"}):null)};function J(e){return e.currentPage*e.perPage>=e.max}function K(e){return 1==e.currentPage}const U=document.documentElement;function G(e,t,l){if(U.ketchup.math.isNumber(e)){const n=Math.ceil(t/l);let r=e;return r>n&&(r=n),r<1&&(r=1),r}return null}function P(e,t){if(U.ketchup.math.isNumber(e)){let l=e;return l>t&&(l=t),l<1&&(l=1),l}return null}export{F,g as K,j as a,H as b,B as c,G as d,x as e,I as f,M as g,z as h,A as n,$ as p,P as r,V as s,w as t}
1
+ import{E as e,J as t,H as l,D as n,af as r,v as i,z as o,ah as s,ai as a,N as u,h as c,a2 as f,aj as h,r as d,m as p}from"./p-bd5ece4c.js";import{h as b}from"./p-b5deb573.js";import{F as m}from"./p-82b5fac1.js";import{F as v}from"./p-0fd98ab4.js";class F extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,l){let n="";if(null==e)return n;let r=e[t];return null==r||(n=l?r.textFieldTmp:r.textField),n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,l){if(!t)return!1;let n=this._getTextFilterValue(e,t.name,l);if(null!=n&&""!=n.trim())return!0;if(this._hasIntervalTextFieldFilterValues(e,t,l))return!0;let r=this.getCheckBoxFilterValues(e,t.name);return!(null==r||r.length<1)}getCheckBoxFilterValues(e={},t){let l=[];if(null==e)return l;let n=e[t];return null==n||null==n.checkBoxes||(l=n.checkBoxes),l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!1)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!0)}_hasIntervalTextFieldFilterValues(e={},l,n){if(null==l)return!1;if(!this.isColumnFiltrableByInterval(l))return!1;let r=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(null!=r&&""!=r.trim())return!0;let i=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);return null!=i&&""!=i.trim()}addCheckboxFilter(t={},l,n){if(null==t)return;let r=t[l];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},t[l]=r),null==r.checkBoxes&&(r.checkBoxes=[]),null==n||null==n.value?r.checkBoxes=[]:e.valuesArrayContainsValue(r.checkBoxes,n.value)||(r.checkBoxes[r.checkBoxes.length]=n)}removeCheckboxFilter(t={},l,n){if(null==t||null==n)return;let r=t[l];if(null==r)return;null==r.checkBoxes&&(r.checkBoxes=[]);let i=e.indexOfValueInValuesArray(r.checkBoxes,n);if(i>=0){let e=[];for(let t=0;t<r.checkBoxes.length;t++)t!=i&&(e[e.length]=r.checkBoxes[t]);r.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!1)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!0)}_getIntervalTextFieldFilterValues(e={},l,n){return this._hasIntervalTextFieldFilterValues(e,l,n)?[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)]:["",""]}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!1)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!0)}_getIntervalTextFieldFilterValue(e={},t,l,n){let r="";if(null==e)return r;let i=e[t];return null==i||n&&null==i.intervalTmp?r:n||null!=i.interval?(r=n?i.intervalTmp[l]:i.interval[l],r):r}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,!0)}_setTextFieldFilterValue(e={},t,l,n){if(null==e)return;let r=e[t];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=r),n?r.textFieldTmp=null!=l?l.trim():l:r.textField=null!=l?l.trim():l}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,!0)}_setIntervalTextFieldFilterValue(e={},t,l,n,r){if(null==e)return;let i=e[t];null==i&&(i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=i),null==i.interval&&(i.interval=[],i.interval.push("","")),null==i.intervalTmp&&(i.intervalTmp=[],i.intervalTmp.push("","")),r?i.intervalTmp[n]=null!=l?l.trim():l:i.interval[n]=null!=l?l.trim():l}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,!1)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,!0)}getFilterValueForTooltip(e={},r){let i=this.getTextFilterValue(e,r.name),o=this.getIntervalTextFieldFilterValues(e,r),s=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=o[t.FROM]&&(u+=a+"(>= "+l(o[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=o[t.TO]&&(u+=a+"(<= "+l(o[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return s.forEach((e=>{c+=a+n(e,r),a=" OR "})),""!=c&&(c="("+c+")",""!=u&&(c=" AND "+c)),c=u+c,c}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var x;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.removableColumns="Sets the possibility to remove the selected column.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(x||(x={}));const w="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const k=document.documentElement,T=k.ketchup?k.ketchup.objects:new o,y=k.ketchup?k.ketchup.data:new s;class j extends e{isFilterCompliantForCell(e,t,l){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=!1,r=[],i){return this.areCellsCompliant(e.cells,t,l,n,r,i)}areCellsCompliant(e,t={},l="",n=!1,o=[],s){if(n){let t=!0;if(o&&null!=o&&o.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<o.length;i++){if(0==o[i].visible)continue;const s=e[o[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,l);let a=r(o[i],s);if(a!=s.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==s&&(s=new F),!this.hasFilters(t,o,s))return!0;let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const r=e[n];if(!r)return!1;let u=s.getTextFilterValue(t,n),c=s.getIntervalTextFieldFilterValues(t,i(o,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(T.isNumber(r.obj)||T.isDate(r.obj)||T.isTime(r.obj)||T.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let p=s.getCheckBoxFilterValues(t,n);if(0==p.length)continue;let b=!1;for(let e=0;e<p.length;e++){let t=p[e];if(null!=t&&null!=t.value){if(null!=r.value&&r.value.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}}}if(!b)return!1}return!0}hasFilters(e={},t,l){if(null==e)return!1;let n=Object.keys(e);if(null==n||n.length<1)return!1;null==l&&(l=new F);for(let r=0;r<n.length;r++){let o=n[r],s=null;if(s=o===w?{name:w,title:""}:i(t,o),l.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},l="",n=[],r){if(!e||null==e)return[];let i=[];const o=!(!l||!n);if(this.hasFilters(t,n,r)||o)for(let s=0;s<e.length;s++){let a=e[s];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,o,n,r))&&(i[i.length]=a)}else i=[...e];return i}getColumnValues(t,n,r,i){let o=new Array;null==i&&(i=new F);let s=i.getTextFilterValueTmp(t.filters,n.name),a=i.getIntervalTextFieldFilterValuesTmp(t.filters,n),u=i.getCheckBoxFilterValues(t.filters,n.name);if(null!=n.valuesForFilter&&n.valuesForFilter.length>0)return n.valuesForFilter.forEach((t=>{let r=t;(e.valuesArrayContainsValue(u,r)||""==s||i.isFilterCompliantForSimpleValue(r,n.obj,s,a))&&o.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),o;let c=Object.assign({},t.filters);c[n.name]={textField:s,textFieldTmp:s,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)o.push(u[e]);return y.cell.getUnivocalValue({rows:f},n,!0)}}const C=document.documentElement;function V(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const l=e[0].group.column;let n=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let l of t)if(l.column===e)return l;return null}(l,t);return n||(n={column:l,sortMode:f.A}),e.sort(((e,t)=>a({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},n.sortMode))),e.forEach((e=>{e.group.children=V(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const r=O(e,n,t[l]);if(0!==r)return r}return 0}return O(e,n,t[0])}))}function O(e,t,l){const n=e.cells[l.column],r=t.cells[l.column];return n||r?n?r?a(n,r,l.sortMode):-1:1:0}function I(e=[],t={},l="",n=[],r,i){return null==i&&(i=new j),i.filterRows(e,t,l,n,r)}function M(e=[],t=[],l=[],n={}){if(!t)return[];if(!l||0===l.length||!e||0===e.length)return t;const o={},s=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return o[l]=n,!0;return!1}));if(0===s.length)return t;const a=[];let c={};return t.forEach((t=>{const l=s[0].column,f=t.cells[l];if(f){const h=i(e,l),d=r(h,f),p=f.value;let b=null;for(let e of a)if(e.group.label===d){b=e;break}null===b&&(b={group:{id:p,parent:null,column:l,columnLabel:o[l],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},a.push(b));for(let l=1;l<s.length;l++){const n=s[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(t,a),s=a.value;let u=null;for(let e=0;e<b.group.children.length;e++){const t=b.group.children[e];if(t.group.label===l){u=t;break}}u||(u={cells:{},group:{id:s,parent:b,column:n.column,columnLabel:o[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},D(u),b.group.children.push(u)),b=u}}b.group.children.push(t),function(e,t,l,n){if(!e||!t)return;const r=Object.keys(t);0!==r.length&&r.forEach((r=>{const i=C.ketchup.math.numberify(e.group.totals[r]||0),o=l.cells[r];if(o){let l=C.ketchup.objects.isNumber(o.obj);const s=t[r];switch(s){case u.COUNT:e.group.totals[r]=i+1;let t=e.group.parent;for(;null!=t;)t.group.totals[r]=(t.group.totals[r]||0)+1,t=t.group.parent;break;case u.DISTINCT:let a;if(a=l?C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value)):o.value,n[e.group.id]){let t=n[e.group.id][r];t?t.push(a):(n[e.group.id][r]=[],n[e.group.id][r].push(a))}else n[e.group.id]={},n[e.group.id][r]=[],n[e.group.id][r].push(a);let c=e.group.parent;for(;null!=c;){if(n[c.group.id]){let e=n[c.group.id][r];e?e.push(a):(n[c.group.id][r]=[],n[c.group.id][r].push(a))}else n[c.group.id]={},n[c.group.id][r]=[],n[c.group.id][r].push(a);c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(l){const t=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t+i;let l=e.group.parent;for(;null!=l;){const e=C.ketchup.math.numberify(l.group.totals[r]||0);l.group.totals[r]=t+e,l=l.group.parent}}break;case u.MIN:if(l){const t=e.group.totals[r],l=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t?Math.min(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.min(e,l):l,n=n.group.parent}}else if(C.ketchup.objects.isDate(o.obj)){const t=o.obj?C.ketchup.objects.parseDate(o.obj):C.ketchup.dates.toDayjs(o.value);if(C.ketchup.dates.isValid(t)){const l=C.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(C.ketchup.dates.format(n)),e.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.min(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(C.ketchup.dates.format(e)),i.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.min(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;case u.MAX:if(l){const t=e.group.totals[r],l=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t?Math.max(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.max(e,l):l,n=n.group.parent}}else if(C.ketchup.objects.isDate(o.obj)){const t=o.obj?C.ketchup.objects.parseDate(o.obj):C.ketchup.dates.toDayjs(o.value);if(C.ketchup.dates.isValid(t)){const l=C.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(C.ketchup.dates.format(n)),e.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.max(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(C.ketchup.dates.format(e)),i.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.max(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;default:0!=s.indexOf(u.MATH)&&console.warn(`invalid total mode: ${s}`)}}}))}(b,n,t,c)}})),function(e,t,l){if(!e||!t)return;const n=Object.keys(t);if(0===e.length||!e[0].group||0===n.length)return;let r=n.filter((e=>u.DISTINCT===t[e]));r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>N(e,r,l)))}(a,n,c),_(a,u.AVERAGE,n),_(a,u.MATH,n),a}function _(e,t,l){if(!e||!l)return;const n=Object.keys(l);if(0===e.length||!e[0].group||0===n.length)return;let r;t==u.AVERAGE&&(r=n.filter((e=>u.AVERAGE===l[e]))),t==u.MATH&&(r=n.filter((e=>0==l[e].indexOf(u.MATH)))),r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>W(e,t,r,l)))}function N(e,t,l){const n=e.group.children;0!==n.length&&(n[0].group&&n.forEach((e=>{N(e,t,l)})),t.forEach((t=>{e.group.totals[t]=new Set(l[e.group.id][t]).size})))}function W(e,t,l,n){const r=e.group.children;if(0===r.length)return 0;let i=0;return r[0].group?r.forEach((e=>{i+=W(e,t,l,n)})):i=r.length,l.forEach((l=>{if(t==u.AVERAGE&&(e.group.totals[l]=C.ketchup.math.numberify(e.group.totals[l])/i),t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=C.ketchup.math.formulas.custom(t,e.group.totals)}})),i}function A(e,t){if(t){const l=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const l=t.cells[e.name];l&&e.obj&&!l.obj&&(l.obj={t:e.obj.t,p:e.obj.p,k:l.value})}}))})),l}}function B(e=[],t={}){if(C.ketchup.objects.isEmptyJsObject(e)||C.ketchup.objects.isEmptyJsObject(t))return{};const l=Object.keys(t),n={},r=new Array;if(0===l.length||l.every((e=>t[e]===u.COUNT)))l.forEach((t=>n[t]=e.length));else{let i={};e.forEach(((e,o,s)=>{l.filter((e=>u.COUNT!==t[e]&&0!=t[e].indexOf(u.MATH))).forEach((l=>{const a=e.cells[l];if(a)if(t[l]===u.DISTINCT){let e;e=C.ketchup.objects.isNumber(a.obj)?C.ketchup.math.numberify(C.ketchup.math.numberifySafe(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(C.ketchup.objects.isNumber(a.obj)){const e=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(a.value));let r=n[l];switch(!0){case t[l]===u.MIN:n[l]=r?Math.min(r,e):e;break;case t[l]===u.MAX:n[l]=r?Math.max(r,e):e;break;default:r=n[l]||0,n[l]=e+C.ketchup.math.numberify(r)}}else if(C.ketchup.objects.isDate(a.obj)){-1==r.indexOf(l)&&r.push(l);const e=C.ketchup.dates.toDayjs(a.value);if(C.ketchup.dates.isValid(e)){const r=C.ketchup.dates.toDate(e),i=n[l]?C.ketchup.dates.toDate(C.ketchup.dates.toDayjs(n[l])):null;switch(!0){case t[l]===u.MIN:if(i){let e=[];e.push(r),e.push(i),n[l]=C.ketchup.dates.format(C.ketchup.dates.min(e),c.ISO_DATE)}else n[l]=C.ketchup.dates.format(r,c.ISO_DATE);break;case t[l]===u.MAX:if(i){let e=[];e.push(r),e.push(i),n[l]=C.ketchup.dates.format(C.ketchup.dates.max(e),c.ISO_DATE)}else n[l]=C.ketchup.dates.format(r,c.ISO_DATE)}}}o===s.length-1&&t[l]===u.DISTINCT&&(n[l]=new Set(i[l]).size,i[l]=[])}))}))}for(let i of l){switch(!0){case t[i]===u.AVERAGE:const l=n[i];l&&e.length>0&&(n[i]=l/e.length);break;case t[i]===u.COUNT:n[i]=e.length;break;case 0==t[i].indexOf(u.MATH):n[i]=C.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=C.ketchup.dates.format(n[i]):C.ketchup.math.isNumber(n[i])&&(n[i]=+n[i].toFixed(2)))}return n}function D(e){if(!e.group)return;let t=e.group.id,l=e.group.parent;for(;null!==l;)t=`${l.group.id};${t}`,l=l.group.parent;e.group.id=t}function $(e,t,l,n){const r=t*l-l,i=r+Number(l);if(0==n)return e.slice(r,i);let o=[];return E(e,o,r,Number(l),0),o}function E(e,t,l,n,r){let i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=L(e[o]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=E(s.group.children,a.group.children,l,n,r);r=e.ci,i=e.added,1==i&&(t[t.length]=a)}else r>=l&&(t[t.length]=a,i=!0),r++;if(r>=l+n)break}return{ci:r,added:i}}function L(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:R(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function S(e){if(null==e)return null;let t=[];for(let l=0;l<e.length;l++)t[t.length]=L(e[l]);return t}function R(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:S(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}var z;!function(e){e.SIMPLE="simple",e.FULL="full"}(z||(z={}));const q=document.documentElement,H=e=>{const t=Math.ceil(e.max/e.perPage),l=function(e,t){const l=[];for(let n=1;n<=t;n++){const t=n==e.currentPage;l.push({id:n.toString(),selected:t,value:n.toString()})}return l}(e,t),n=function(e){const t=[];let l=e.perPage;if(0===l)return t;for(;l<e.max;){const n=l==e.perPage;t.push({id:l.toString(),selected:n,value:l.toString()}),l*=2}const n=e.max==e.perPage;return t.push({id:e.max.toString(),selected:n,value:e.max.toString()}),t}(e),r={"kup-list":{data:l},"kup-text-field":{label:q.ketchup.language.translate(h.PAGE),helper:q.ketchup.language.translate(h.TOTAL)+`: ${t}`,helperWhenFocused:!0,inputType:"number",max:t,min:1}},i={"kup-list":{data:n},"kup-text-field":{label:q.ketchup.language.translate(d.ROWS)+" / "+q.ketchup.language.translate(h.PAGE),helper:q.ketchup.language.translate(d.TOTAL)+`: ${e.max}`,helperWhenFocused:!0,inputType:"number",max:e.max,min:1}};return b("div",Object.assign({class:`f-paginator ${e.mode?e.mode:""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),e.mode!==z.SIMPLE?b(m,{icon:"chevron_left",disabled:K(e),onClick:e.onPrevPage,wrapperClass:"prev-page"}):null,b("kup-combobox",{class:"page-selector",data:r,initialValue:e.currentPage.toString(),"onkup-combobox-change":e.onPageChange}),e.mode!==z.SIMPLE?b(m,{icon:"chevron_right",disabled:J(e),onClick:e.onNextPage,wrapperClass:"next-page"}):null,b("kup-combobox",{class:"rows-selector",data:i,initialValue:e.perPage.toString(),"onkup-combobox-change":e.onRowsChange}),e.onLoadMore?b(m,{icon:"plus",onClick:e.onLoadMore,label:q.ketchup.language.translate(p.LOAD_MORE),styling:v.FLAT,wrapperClass:"load-more-button"}):null)};function J(e){return e.currentPage*e.perPage>=e.max}function K(e){return 1==e.currentPage}const U=document.documentElement;function G(e,t,l){if(U.ketchup.math.isNumber(e)){const n=Math.ceil(t/l);let r=e;return r>n&&(r=n),r<1&&(r=1),r}return null}function P(e,t){if(U.ketchup.math.isNumber(e)){let l=e;return l>t&&(l=t),l<1&&(l=1),l}return null}export{F,g as K,j as a,H as b,B as c,G as d,x as e,I as f,M as g,z as h,A as n,$ as p,P as r,V as s,w as t}
@@ -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-2751c4ba.js";import{c as u}from"./p-ad2e21d2.js";import{F as c}from"./p-79f78bdc.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-b5deb573.js";import{k as r,a as l,t as n}from"./p-bd5ece4c.js";import{c as u}from"./p-ad2e21d2.js";import{F as c}from"./p-fb0b5466.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}