@sme.up/ketchup 7.4.0 → 7.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{f-button-daddd700.js → f-button-5856cd74.js} +2 -2
- package/dist/cjs/{f-cell-3682fad4.js → f-cell-9d7a9e97.js} +6 -6
- package/dist/cjs/{f-checkbox-593f72c3.js → f-checkbox-1148e791.js} +1 -1
- package/dist/cjs/{f-chip-9d540d94.js → f-chip-675ed121.js} +3 -3
- package/dist/cjs/{f-image-7b42d149.js → f-image-48facc89.js} +2 -2
- package/dist/cjs/{f-paginator-utils-1baeba0f.js → f-paginator-utils-0c1227f6.js} +3 -3
- package/dist/cjs/{f-text-field-a6ed2d22.js → f-text-field-3d8e7417.js} +2 -2
- package/dist/cjs/{index-74433248.js → index-1f177abc.js} +0 -3
- package/dist/cjs/ketchup.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +3 -3
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +9 -9
- package/dist/cjs/kup-box.cjs.entry.js +10 -10
- package/dist/cjs/kup-calendar.cjs.entry.js +5 -5
- package/dist/cjs/kup-cell.cjs.entry.js +7 -7
- package/dist/cjs/kup-dash-list.cjs.entry.js +2 -2
- package/dist/cjs/kup-dash_2.cjs.entry.js +2 -2
- package/dist/cjs/kup-dashboard.cjs.entry.js +6 -6
- package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
- package/dist/cjs/kup-echart.cjs.entry.js +2 -2
- package/dist/cjs/kup-family-tree.cjs.entry.js +4 -4
- package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
- package/dist/cjs/kup-image-list.cjs.entry.js +8 -8
- package/dist/cjs/kup-lazy.cjs.entry.js +2 -2
- package/dist/cjs/kup-magic-box.cjs.entry.js +3 -3
- package/dist/cjs/{kup-manager-10351449.js → kup-manager-22bb9699.js} +1 -1
- package/dist/cjs/kup-nav-bar.cjs.entry.js +2 -2
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
- package/dist/cjs/kup-photo-frame.cjs.entry.js +2 -2
- package/dist/cjs/kup-planner.cjs.entry.js +48 -16
- package/dist/cjs/kup-probe.cjs.entry.js +2 -2
- package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
- package/dist/cjs/kup-snackbar.cjs.entry.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/kup-planner/kup-planner-declarations.js +15 -0
- package/dist/collection/components/kup-planner/kup-planner.js +31 -14
- package/dist/components/kup-planner.js +46 -14
- package/dist/esm/{f-button-8d15b5a0.js → f-button-eedbdba1.js} +2 -2
- package/dist/esm/{f-cell-7b706e57.js → f-cell-90a418d2.js} +6 -6
- package/dist/esm/{f-checkbox-ec85b437.js → f-checkbox-9b3f5f5b.js} +1 -1
- package/dist/esm/{f-chip-c671fe90.js → f-chip-45e7b3f6.js} +3 -3
- package/dist/esm/{f-image-21451b15.js → f-image-3026f0fe.js} +2 -2
- package/dist/esm/{f-paginator-utils-92bbf277.js → f-paginator-utils-6369da7c.js} +3 -3
- package/dist/esm/{f-text-field-0bb2d109.js → f-text-field-3b70a6f0.js} +2 -2
- package/dist/esm/{index-b326ffc9.js → index-8bd38435.js} +1 -3
- package/dist/esm/ketchup.js +2 -2
- package/dist/esm/kup-accordion.entry.js +3 -3
- package/dist/esm/kup-autocomplete_27.entry.js +9 -9
- package/dist/esm/kup-box.entry.js +10 -10
- package/dist/esm/kup-calendar.entry.js +5 -5
- package/dist/esm/kup-cell.entry.js +7 -7
- package/dist/esm/kup-dash-list.entry.js +2 -2
- package/dist/esm/kup-dash_2.entry.js +2 -2
- package/dist/esm/kup-dashboard.entry.js +6 -6
- package/dist/esm/kup-drawer.entry.js +2 -2
- package/dist/esm/kup-echart.entry.js +2 -2
- package/dist/esm/kup-family-tree.entry.js +4 -4
- package/dist/esm/kup-iframe.entry.js +2 -2
- package/dist/esm/kup-image-list.entry.js +8 -8
- package/dist/esm/kup-lazy.entry.js +2 -2
- package/dist/esm/kup-magic-box.entry.js +3 -3
- package/dist/esm/{kup-manager-6145d980.js → kup-manager-cad802b1.js} +1 -1
- package/dist/esm/kup-nav-bar.entry.js +2 -2
- package/dist/esm/kup-numeric-picker.entry.js +3 -3
- package/dist/esm/kup-photo-frame.entry.js +2 -2
- package/dist/esm/kup-planner.entry.js +48 -16
- package/dist/esm/kup-probe.entry.js +2 -2
- package/dist/esm/kup-qlik.entry.js +2 -2
- package/dist/esm/kup-snackbar.entry.js +4 -4
- package/dist/esm/loader.js +2 -2
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-1242366a.entry.js → p-138ac8b9.entry.js} +1 -1
- package/dist/ketchup/{p-0c1cbf8b.entry.js → p-1ad48de4.entry.js} +1 -1
- package/dist/ketchup/{p-e4975ffa.entry.js → p-1cd45a72.entry.js} +1 -1
- package/dist/ketchup/p-2217be0a.entry.js +1 -0
- package/dist/ketchup/{p-a641780a.entry.js → p-23288eed.entry.js} +1 -1
- package/dist/ketchup/{p-76bf53df.entry.js → p-263b2c73.entry.js} +1 -1
- package/dist/ketchup/{p-d87fb5ff.entry.js → p-2d8b5bba.entry.js} +1 -1
- package/dist/ketchup/{p-ae4fffe0.js → p-32dc31ad.js} +1 -1
- package/dist/ketchup/{p-826c91d7.js → p-4505a48d.js} +1 -1
- package/dist/ketchup/{p-e83e70e2.entry.js → p-4e68f629.entry.js} +1 -1
- package/dist/ketchup/{p-2915a66a.entry.js → p-73becdb8.entry.js} +1 -1
- package/dist/ketchup/{p-c4d9e3e2.js → p-7bd28eac.js} +1 -1
- package/dist/ketchup/{p-0c9b7c80.entry.js → p-97afbd71.entry.js} +1 -1
- package/dist/ketchup/{p-d4ece435.js → p-9dcfbb1e.js} +2 -2
- package/dist/ketchup/{p-c1137ffd.entry.js → p-9f1184cd.entry.js} +1 -1
- package/dist/ketchup/{p-c26975bf.js → p-9f9b6656.js} +1 -1
- package/dist/ketchup/{p-7cfdce27.js → p-a1adab40.js} +1 -1
- package/dist/ketchup/p-a7ae0b4d.js +1 -0
- package/dist/ketchup/{p-32517a99.entry.js → p-a89f0884.entry.js} +1 -1
- package/dist/ketchup/{p-ea16ddc0.js → p-ae3e0d31.js} +1 -1
- package/dist/ketchup/{p-da37c417.entry.js → p-b0675bce.entry.js} +1 -1
- package/dist/ketchup/{p-c222d070.entry.js → p-b1da7902.entry.js} +1 -1
- package/dist/ketchup/{p-5292ef67.js → p-b63a5a44.js} +1 -1
- package/dist/ketchup/{p-c022824e.entry.js → p-bb6921bc.entry.js} +1 -1
- package/dist/ketchup/{p-89ac80c1.entry.js → p-c1d8fd43.entry.js} +1 -1
- package/dist/ketchup/p-cb6c8417.entry.js +10 -0
- package/dist/ketchup/{p-2a2dc2a8.entry.js → p-d0f4457e.entry.js} +1 -1
- package/dist/ketchup/{p-439ac105.entry.js → p-eea29062.entry.js} +1 -1
- package/dist/ketchup/{p-d5200264.entry.js → p-fd948af0.entry.js} +1 -1
- package/dist/ketchup/{p-281cff81.entry.js → p-fe34fa6e.entry.js} +1 -1
- package/dist/ketchup/{p-4fa7bffd.entry.js → p-ff11d6d0.entry.js} +1 -1
- package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +12 -0
- package/package.json +1 -1
- package/dist/ketchup/p-849ad5d8.entry.js +0 -1
- package/dist/ketchup/p-8826f5d6.entry.js +0 -11
- package/dist/ketchup/p-9f00ad0f.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,c as a,f as o,h as t,H as n,g as i}from"./p-
|
|
1
|
+
import{r,c as a,f as o,h as t,H as n,g as i}from"./p-9dcfbb1e.js";import{k as s,g as p,s as e}from"./p-b63a5a44.js";import{c as b}from"./p-97e8ea42.js";const l="nav-bar";var v,u;!function(r){r.customStyle="Custom style of the component.",r.image="Image displayed by the nav bar, uses the kup-image component's props.",r.label="Text displayed by the nav bar.",r.showMenuButton="When true, the menu button will be displayed on the left of the nav bar.",r.styling="Defines the style of the nav bar"}(v||(v={})),function(r){r.SHORT="short",r.STANDARD="standard"}(u||(u={}));const c=class{constructor(o){r(this,o),this.kupNavbarReady=a(this,"kup-navbar-ready",6),this.kupNavbarResize=a(this,"kup-navbar-resize",6),this.kupManager=s(),this.customStyle="",this.styling=u.STANDARD}async getProps(r){return p(this,v,r)}async refresh(){o(this)}async resizeCallback(){window.clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout((()=>{this.kupNavbarResize.emit({comp:this,id:this.rootElement.id})}),300)}async setProps(r){e(this,v,r)}content(){const r=Array.prototype.slice.call(this.rootElement.children,0),a=[],o=[];for(let n=0;n<r.length;n++)"left"===r[n].slot?a.push(t("slot",{name:"left"})):o.push(t("slot",{name:"right"}));return[a.length?t("section",{class:`${l}__section ${l}__section--align-start`},a):null,o.length?t("section",{class:`${l}__section ${l}__section--align-end`,role:"toolbar"},o):null]}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.kupNavbarReady.emit({comp:this,id:this.rootElement.id}),this.kupManager.resize.observe(this.rootElement),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){return t(n,{class:"header"},t("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),t("div",{id:b},t("header",{class:`${l} ${l}--${this.styling.toLowerCase()} `},t("div",{class:`${l}__row`},this.content()))))}disconnectedCallback(){this.kupManager.language.unregister(this),this.kupManager.resize.unobserve(this.rootElement),this.kupManager.theme.unregister(this)}get rootElement(){return i(this)}};c.style=":host{--kup_navbar_box_shadow:var(\n --kup-navbar-box-shadow,\n 0 2px 4px -1px rgba(128, 128, 128, 0.2),\n 0 4px 5px 0 rgba(128, 128, 128, 0.14),\n 0 1px 10px 0 rgba(128, 128, 128, 0.12)\n );--kup_navbar_padding:var(--kup-navbar-padding, 8px 12px);--kup_navbar_position:var(--kup-navbar-position, fixed);--kup_navbar_short_border_radius:var(\n --kup-navbar-short-border-radius,\n 0px 0px 24px\n );--kup_navbar_short_box_shadow:var(\n --kup-navbar-short-box-shadow,\n rgba(128, 128, 128, 0.2) 0px 2px 4px -1px,\n rgba(128, 128, 128, 0.14) 0px 4px 5px 0px,\n rgba(128, 128, 128, 0.12) 0px 1px 10px 0px\n );--kup_navbar_short_width:var(--kup-navbar-short-width, 9em);--kup_navbar_transition:var(--kup-navbar-transition, 250ms);--kup_navbar_width:var(--kup-navbar-width, 100%);box-sizing:border-box;font-size:var(--kup-font-size);left:0;position:var(--kup_navbar_position);top:0;transition:all var(--kup_navbar_transition);width:var(--kup_navbar_width);z-index:var(--kup-navbar-zindex)}#kup-component{width:var(--kup_navbar_width)}.nav-bar{background-color:var(--kup-navbar-background-color);box-shadow:var(--kup_navbar_box_shadow);box-sizing:border-box;color:var(--kup-navbar-color);display:flex;flex-direction:column;justify-content:space-between;width:var(--kup_navbar_width)}.nav-bar--short{border-radius:var(--kup_navbar_short_border_radius);box-shadow:var(--kup_navbar_short_box_shadow);width:var(--kup_navbar_short_width)}.nav-bar--short .nav-bar__section{padding:0 0.5em}.nav-bar--short section{overflow:hidden}.nav-bar ::slotted(*){--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);--kup-switch-label-color:var(--kup-navbar-color);--kup-switch-primary-color:var(--kup-navbar-color);--kup-switch-primary-color-rgb:var(--kup-navbar-color-rgb);--kup-textfield-color:var(--kup-navbar-color);--kup-textfield-color-rgb:var(--kup-navbar-color-rgb);--kup-tree-color:var(--kup-navbar-color);--kup-tree-color-rgb:var(--kup-navbar-color-rgb);color:var(--kup-navbar-color);fill:var(--kup-navbar-color);margin:0}.nav-bar__row{box-sizing:border-box;display:flex;height:var(--kup-navbar-height);position:relative;width:var(--kup_navbar_width)}.nav-bar__section{align-items:center;display:inline-flex;flex:1 1 auto;min-width:0;padding:var(--kup_navbar_padding)}.nav-bar__section--align-start{flex-shrink:5;justify-content:flex-start;order:-1}.nav-bar__section--align-end{justify-content:flex-end;order:1;overflow:hidden}::slotted(*){--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);--kup-switch-label-color:var(--kup-navbar-color);--kup-switch-primary-color:var(--kup-navbar-color);--kup-switch-primary-color-rgb:var(--kup-navbar-color-rgb);--kup-textfield-color:var(--kup-navbar-color);--kup-textfield-color-rgb:var(--kup-navbar-color-rgb);--kup-textfield-primary-color:var(--kup-navbar-color);--kup-textfield-primary-color-rgb:var(--kup-navbar-color-rgb);--kup-tree-color:var(--kup-navbar-color);--kup-tree-color-rgb:var(--kup-navbar-color-rgb);color:var(--kup-navbar-color);fill:var(--kup-navbar-color);margin:0}";export{c as kup_nav_bar}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,f as s,h as e,H as h,g as o}from"./p-
|
|
1
|
+
import{r as t,c as i,f as s,h as e,H as h,g as o}from"./p-9dcfbb1e.js";import{k as r,a as l,r as n}from"./p-b63a5a44.js";import{c as u}from"./p-97e8ea42.js";import{F as c}from"./p-ae3e0d31.js";import{F as a}from"./p-a203f78b.js";import"./p-79b0730b.js";import"./p-81605f08.js";var p;!function(t){t.customStyle="Custom style of the component.",t.data="Props of the sub-components.",t.decimals="Defaults at false. When set to true, the component has decimals.",t.disabled="Defaults at false. When set to true, the component is disabled.",t.initialValue="Sets the initial value of the component",t.maxDecimals="when set, the component allows you to enter decimals with a maximum of characters.",t.maxIntegers="When set, the component allows you to enter integer numbers with a maximum of characters.",t.maxLength="When set, the component allows you to enter numbers with a maximum of characters, including decimals.",t.negative="Defaults at false. When set to true, the component has negative number."}(p||(p={}));const m=class{constructor(s){t(this,s),this.kupBlur=i(this,"kup-numericpicker-blur",6),this.kupChange=i(this,"kup-numericpicker-change",6),this.kupClick=i(this,"kup-numericpicker-click",6),this.kupFocus=i(this,"kup-numericpicker-focus",6),this.kupInput=i(this,"kup-numericpicker-input",6),this.kupIconClick=i(this,"kup-numericpicker-iconclick",6),this.kupItemClick=i(this,"kup-numericpicker-itemclick",6),this.kupTextFieldSubmit=i(this,"kup-numericpicker-textfieldsubmit",6),this.kupClearIconClick=i(this,"kup-numericpicker-cleariconclick",6),this.kupManager=r(),this.textfieldEl=null,this.pickerContainerEl=null,this.pickerEl={value:(new Date).toISOString(),date:new Date},this.clickCb=null,this.stateSwitcher=!1,this.value="",this.customStyle="",this.data=null,this.decimals=!1,this.disabled=!1,this.initialValue="",this.maxDecimals=null,this.maxIntegers=null,this.maxLength=null,this.negative=!1}onKupPickerItemClick(t){this.setPickerValueSelected(t),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupItemClick.emit({comp:this,id:this.rootElement.id,value:this.value}),this.setFocus()}onKupClearIconClick(){this.setPickerValueSelected(""),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupClearIconClick.emit({comp:this,id:this.rootElement.id})}onKupBlur(){this.kupBlur.emit({id:this.rootElement.id,value:this.value,comp:this})}onKupChange(t){this.refreshPickerValue(t.target.value,this.kupChange)}onKupClick(){this.kupClick.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupFocus(){this.kupFocus.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupInput(t){this.refreshPickerValue(t.target.value,this.kupInput,!0)}onkupTextFieldSubmit(t){"Enter"===t.key&&this.refreshPickerValue(t.target.value,this.kupTextFieldSubmit)}onKupIconClick(){this.isPickerOpened()?this.closePicker():this.openPicker(),this.kupIconClick.emit({comp:this,id:this.rootElement.id,value:this.value})}listenKeyup(t){this.isPickerOpened()&&("Escape"===t.key&&this.closePicker(),"Enter"===t.key&&this.setPickerValueSelected())}async getValue(){return this.value}async getProps(t){let i={};if(t)i=p;else for(const t in p)Object.prototype.hasOwnProperty.call(p,t)&&(i[t]=this[t]);return i}async refresh(){s(this)}async setFocus(){null!=this.textfieldEl&&this.textfieldEl.focus()}async setValue(t){this.value=t}refreshPickerValue(t,i,s){let e=this.kupManager.math.numberify(t,!0);if(e){let t=e.toString();const h=t.indexOf(".");let o=h>-1?t.substring(0,h):t,r=h>-1?t.substring(h+1):"";for(this.maxIntegers&&o.length>this.maxIntegers&&(o=o.substring(o.length-this.maxIntegers)),this.maxDecimals&&r.length>this.maxDecimals&&(r=r.substring(0,this.maxDecimals));this.maxLength&&o.length+r.length>this.maxLength;)r.length>1?r=r.substring(0,r.length-1):o.length>1&&(o=o.substring(1));t=h>-1?`${o}.${r}`:o,1!=s&&this.setValue(t),null!=i&&i.emit({id:this.rootElement.id,value:t})}}setPickerValueSelected(t){1!=this.disabled&&(null==t&&(t=this.getPickerValueSelected()),this.closePicker(),null!=t&&this.setValue(t))}getPickerValueSelected(){return this.pickerEl.value}getValueForPickerComponent(){return this.value}openPicker(){const t=this.textfieldEl;this.pickerContainerEl.menuVisible=!0;const i=this.pickerContainerEl.style;i.height="auto",i.minWidth=this.textfieldEl.parentElement.clientWidth+"px",null!=t&&t.classList.add("toggled"),this.kupManager.dynamicPosition.isRegistered(this.pickerContainerEl)?this.kupManager.dynamicPosition.changeAnchor(this.pickerContainerEl,this.textfieldEl.parentElement):this.kupManager.dynamicPosition.register(this.pickerContainerEl,this.textfieldEl.parentElement,0,l.AUTO,!0),this.kupManager.dynamicPosition.start(this.pickerContainerEl),this.clickCb||(this.clickCb={cb:()=>{this.closePicker()},el:this.pickerContainerEl}),this.kupManager.addClickCallback(this.clickCb,!0)}closePicker(){if(this.kupManager.removeClickCallback(this.clickCb),!this.isPickerOpened())return;let t=this.textfieldEl;null!=t&&t.classList.remove("toggled"),this.pickerContainerEl.menuVisible=!1,this.kupManager.dynamicPosition.stop(this.pickerContainerEl)}isPickerOpened(){return 1==this.pickerContainerEl.menuVisible}getTextFieldId(){return this.textfieldEl.id}prepTextfield(){this.decimals||this.maxIntegers||(this.maxIntegers=17),!this.decimals||this.maxIntegers||this.maxDecimals||(this.maxIntegers=15,this.maxDecimals=2);const t=this.rootElement.classList.contains("kup-full-height"),i=this.rootElement.classList.contains("kup-full-width"),s=Object.assign({},this.data["kup-text-field"]);return s.icon||(s.icon="calculator"),s.icon&&(s.trailingIcon=!0),e(c,Object.assign({},s,{disabled:this.disabled,fullHeight:t,fullWidth:i,id:this.rootElement.id+"_text-field",value:this.kupManager.math.numbers.toLocaleString(this.value),onBlur:()=>this.onKupBlur(),onChange:t=>this.onKupChange(t),onClearIconClick:()=>this.onKupClearIconClick(),onClick:()=>this.onKupClick(),onFocus:()=>this.onKupFocus(),onIconClick:()=>this.onKupIconClick(),onKeyDown:t=>this.onkupTextFieldSubmit(t),onInput:t=>this.onKupInput(t)}),this.prepPicker())}prepPicker(){return e("kup-card",{ref:t=>this.pickerContainerEl=t,data:{options:{decimals:this.decimals,initialValue:this.value,maxDecimals:this.maxDecimals,maxIntegers:this.maxIntegers,maxLength:this.maxLength,negative:this.negative,resetStatus:!0}},layoutFamily:n.BUILT_IN,layoutNumber:5,sizeX:"300px",sizeY:"auto",isMenu:!0,"onkup-card-click":t=>{null!=t.detail.value&&this.onKupPickerItemClick(t.detail.value)}})}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this),this.value=this.initialValue,this.data||(this.data={"kup-text-field":{}})}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const i=t.querySelector(".f-text-field");i&&(this.textfieldEl=i.querySelector("input"),a(i))}this.kupManager.debug.logRender(this,!0)}render(){return e(h,null,e("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{id:u},this.prepTextfield()))}disconnectedCallback(){this.kupManager.dates.unregister(this),this.kupManager.theme.unregister(this),this.pickerContainerEl&&this.pickerContainerEl.remove()}get rootElement(){return o(this)}};m.style=":host{display:block;font-size:var(--kup-font-size)}.f-text-field{position:relative}:host(.kup-full-height){height:100%}:host(.kup-full-height) #kup-component{height:100%}:host(.kup-full-width){width:100%}:host(.kup-full-width) #kup-component{width:100%}:host(.kup-danger){--kup-textfield-primary-color:var(--kup-danger-color);--kup-textfield-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-textfield-primary-color:var(--kup-info-color);--kup-textfield-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-textfield-primary-color:var(--kup-secondary-color);--kup-textfield-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-textfield-primary-color:var(--kup-success-color);--kup-textfield-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-textfield-primary-color:var(--kup-warning-color);--kup-textfield-primary-color-rgb:var(--kup-warning-color-rgb)}";export{m as kup_numeric_picker}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{af as e,ag as t,b as c,a7 as s,ah as a,ai as i,aj as n,ak as o,al as l,am as u,an as r}from"./p-5292ef67.js";import{h as p}from"./p-d4ece435.js";import{F as d}from"./p-c26975bf.js";import{F as k}from"./p-ea16ddc0.js";import{F as b}from"./p-9f00ad0f.js";import{F as h,a as f}from"./p-c4d9e3e2.js";var m,w,j;!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."}(m||(m={})),function(e){e.LISTBOX="listbox",e.RADIOGROUP="radiogroup",e.GROUP="group"}(w||(w={})),function(e){e.CODE="code",e.DESCRIPTION="description",e.DESCRIPTION_AND_CODE="both"}(j||(j={}));const y=e=>p("div",Object.assign({class:`f-switch ${e.danger?"kup-danger":""} ${e.info?"kup-info":""} ${e.secondary?"kup-secondary":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),p("div",{class:"form-field "+(e.leadingLabel?"form-field--align-end":"")},p("div",{class:`switch ${e.checked?"switch--checked":""} ${e.disabled?"switch--disabled":""}`},p("div",{class:"switch__track"}),p("div",{class:"switch__thumb-underlay"},p("div",{class:"switch__thumb"},p("input",{type:"checkbox",class:"switch__native-control",role:"switch",checked:e.checked,disabled:e.disabled,value:e.checked?"on":"off",onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus})))),p("label",{onClick:e.onChange},e.label))),g=document.documentElement,v=(i,l)=>{const m=i.cell,w=i.column,v=i.row,C=i.shape?i.shape:m.shape?m.shape:w.shape?w.shape:null,I=!g.ketchup.objects.isEmptyKupObj(m.obj),$=!(!m.isEditable&&!w.isEditable||!i.editable),z=i.previousValue!==m.value?m.value:"",D=g.ketchup.data.cell.getType(m,C),F=Object.assign({},m.data);let K=m.cssClass?m.cssClass:w.cssClass?w.cssClass:"";const V={"f-cell":!0,[o.OBJ]:!!I,[D+"-cell"]:!0,[i.wrapperClass]:!!i.wrapperClass,[i.density]:!(!i.density||D===s.BAR),[K]:!!K};let H=z;$&&e.includes(D)?H=function(e,t,c,a,i){switch(e){case s.AUTOCOMPLETE:return p("kup-autocomplete",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"","onkup-autocomplete-change":t=>O(t,i,e,r.UPDATE),"onkup-autocomplete-input":t=>O(t,i,e,r.INPUT),"onkup-autocomplete-iconclick":t=>O(t,i,e,r.ICON_CLICK)}));case s.CHECKBOX:return x(i)&&(t[o.C_CENTERED]=!0),p(d,Object.assign({},c.data,{onChange:t=>O(t,i,e,r.UPDATE)}));case s.CHIP:return p("kup-chip",Object.assign({},c.data,{type:h.INPUT,enableInput:!0,"onKup-chip-change":t=>O(t,i,e,r.UPDATE)}),p("kup-text-field",Object.assign({fullWidth:!0,slot:"field"},c.slotData)));case s.COLOR_PICKER:return p("kup-color-picker",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"",disabled:!1,"onkup-colorpicker-change":t=>O(t,i,e,r.UPDATE)}));case s.COMBOBOX:return p("kup-combobox",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"","onkup-combobox-change":t=>O(t,i,e,r.UPDATE),"onkup-combobox-input":t=>O(t,i,e,r.INPUT),"onkup-combobox-iconclick":t=>O(t,i,e,r.ICON_CLICK)}));case s.DATE:return p("kup-date-picker",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"","onkup-datepicker-change":t=>O(t,i,e,r.UPDATE),"onkup-datepicker-input":t=>O(t,i,e,r.INPUT)}));case s.MULTI_AUTOCOMPLETE:return p("kup-chip",Object.assign({displayId:!0},c.data,{type:h.INPUT,enableInput:!0,"onKup-chip-change":t=>O(t,i,e,r.UPDATE)}),p("kup-autocomplete",Object.assign({class:"kup-full-width",slot:"field",displayMode:j.DESCRIPTION_AND_CODE,selectMode:j.DESCRIPTION_AND_CODE,"onkup-autocomplete-input":t=>O(t,i,e,r.INPUT),"onkup-autocomplete-iconclick":t=>O(t,i,e,r.ICON_CLICK),showDropDownIcon:!1},c.slotData)));case s.MULTI_COMBOBOX:return p("kup-chip",Object.assign({displayId:!0},c.data,{type:h.INPUT,enableInput:!0,"onKup-chip-change":t=>O(t,i,e,r.UPDATE)}),p("kup-combobox",Object.assign({class:"kup-full-width",slot:"field",displayMode:j.DESCRIPTION_AND_CODE,selectMode:j.DESCRIPTION_AND_CODE,"onkup-combobox-input":t=>O(t,i,e,r.INPUT),"onkup-combobox-iconclick":t=>O(t,i,e,r.ICON_CLICK)},c.slotData)));case s.RATING:return p("kup-rating",Object.assign({key:a.name+i.row.id},c.data,{disabled:!1,"onkup-rating-click":t=>O(t,i,e,r.UPDATE)}));case s.SWITCH:return p(y,Object.assign({},c.data,{disabled:!1,onChange:t=>O(t,i,e,r.UPDATE)}));case s.TIME:return p("kup-time-picker",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"","onkup-timepicker-change":t=>O(t,i,e,r.UPDATE),"onkup-timepicker-input":t=>O(t,i,e,r.INPUT)}));case s.NUMBER:t[o.C_RIGHT_ALIGNED]=!0;case s.LINK:case s.STRING:return p(k,Object.assign({inputType:e===s.NUMBER?"number":null,fullWidth:!!_(i)},c.data,{icon:c.icon?c.icon:a.icon?a.icon:null,value:e===s.NUMBER?n(c.value).toString():c.value,onChange:t=>O(t,i,e,r.UPDATE),onInput:t=>O(t,i,e,r.INPUT),onIconClick:t=>O(t,i,e,r.ICON_CLICK)}))}}(D,V,m,w,i):m.data&&t.includes(D)?(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"}}}(D,F,m),H=i.renderKup?function(e,t,c,a,i,l,u){switch(e){case s.BAR:return c.data?p("div",{style:{height:c.sizeY,width:"100%"}},p(b,Object.assign({},c))):p("kup-image",Object.assign({key:l.name+u.row.id},c));case s.BUTTON:return x(u)&&(t[o.C_CENTERED]=!0),p("kup-button",Object.assign({key:l.name+u.row.id},c,{"onkup-button-click":t=>O(t,u,e,r.CLICK)}));case s.BUTTON_LIST:return x(u)&&(t[o.C_CENTERED]=!0),c["data-storage"]={cell:a,row:i,column:l},p("kup-button-list",Object.assign({key:l.name+u.row.id},c));case s.CHART:return x(u)&&(t[o.C_CENTERED]=!0),p("kup-chart",Object.assign({key:l.name+u.row.id},c));case s.CHIP:return p(f,Object.assign({},c));case s.COLOR_PICKER:return p("kup-color-picker",Object.assign({key:l.name+u.row.id},c,{class:_(u)?"kup-full-width":"",disabled:!0}));case s.GAUGE:return p("kup-gauge",Object.assign({key:l.name+u.row.id,value:n(a.value),"width-component":"280px"},c));case s.KNOB:case s.PROGRESS_BAR:return p("kup-progress-bar",Object.assign({key:l.name+u.row.id},c));case s.RADIO:return x(u)&&(t[o.C_CENTERED]=!0),c.disabled=i.readOnly,p("kup-radio",Object.assign({key:l.name+u.row.id},c));case s.RATING:return p("kup-rating",Object.assign({key:l.name+u.row.id},c,{disabled:!0}))}}(D,V,F,m,v,w,i):p("span",{class:"cell-"+D+" 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")}}(D,F,m,i),H=function(e,t,c,a,i,l,r){switch(e){case s.AUTOCOMPLETE:case s.COMBOBOX:case s.DATE:case s.DATETIME:case s.TIME:if(c&&""!=c){const e=u(l,i);return p("div",{class:"f-cell__text"},e)}return c;case s.CHECKBOX:return x(r)&&(a[o.C_CENTERED]=!0),p(b,{resource:t.checked?"check_box":"check_box_outline_blank",sizeX:"18px",sizeY:"18px"});case s.EDITOR:return p("div",{innerHTML:i.value});case s.ICON:case s.IMAGE:return x(r)&&(a[o.C_CENTERED]=!0),t.badgeData&&(a[o.C_PADDED]=!0),p(b,Object.assign({},t));case s.LINK:return p("a",{href:c,target:"_blank"},i.value);case s.NUMBER:if(c&&""!=c){const e=n(i.value),t=u(l,i);return e<0&&(a[o.TEXT_DANGER]=!0),x(r)&&(a[o.C_RIGHT_ALIGNED]=!0),p("div",{class:"f-cell__text"},t)}return p("div",{class:"f-cell__text"},c);case s.SWITCH:return x(r)&&(a[o.C_CENTERED]=!0),t.disabled=!0,p(y,Object.assign({},t));default:return p("div",{class:"f-cell__text"},c)}}(D,F,H,V,m,w,i));let M=null;!$&&(w.icon||m.icon)&&H&&(M=p(b,Object.assign({},{color:`rgba(var(${c.TEXT}-rgb), 0.375)`,resource:m.icon?m.icon:w.icon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"obj-icon"})));let T=null;g.ketchup.debug.isDebug()&&I?T=m.obj.t+"; "+m.obj.p+"; "+m.obj.k+";":null!=m.title&&""!=m.title.trim()&&(T=m.title);let W=null;if(m.info){const e=Object.assign({},m.info);e.color||(e.color=`var(${c.INFO})`),e.icon||(e.icon="info"),W=p(b,Object.assign({},{color:e.color,resource:e.icon,sizeX:"1.25em",sizeY:"1.25em",title:e.message?e.message:"",wrapperClass:"cell-info"}))}return p("div",{onKeyUp:e=>O(e,i,D,r.KEYUP),class:V,"kup-get-cell-props":()=>i,style:m.style},p("div",{class:"f-cell__content",style:m.styleContent,title:T},l&&l.length>0?l:[i.indents,W,M,H]))};function O(e,t,c,a){const i=t.cell,n=t.column,o=t.component,l=t.row;let p="INPUT"===e.target.tagName?e.target.value:e.detail.value;if(a===r.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=u(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:l,type:c}});if(o.rootElement.dispatchEvent(t),a===r.UPDATE)try{o.refresh()}catch(e){}}}function x(e){var t;return l.includes(null===(t=e.component)||void 0===t?void 0:t.rootElement.tagName)}function _(e){var t;return i.includes(null===(t=e.component)||void 0===t?void 0:t.rootElement.tagName)}export{v as F,j as I,w as K,m as a,y as b}
|
|
1
|
+
import{af as e,ag as t,b as c,a7 as s,ah as a,ai as i,aj as n,ak as o,al as l,am as u,an as r}from"./p-b63a5a44.js";import{h as p}from"./p-9dcfbb1e.js";import{F as b}from"./p-9f9b6656.js";import{F as d}from"./p-ae3e0d31.js";import{F as k}from"./p-a7ae0b4d.js";import{F as h,a as f}from"./p-7bd28eac.js";var m,w,j;!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."}(m||(m={})),function(e){e.LISTBOX="listbox",e.RADIOGROUP="radiogroup",e.GROUP="group"}(w||(w={})),function(e){e.CODE="code",e.DESCRIPTION="description",e.DESCRIPTION_AND_CODE="both"}(j||(j={}));const y=e=>p("div",Object.assign({class:`f-switch ${e.danger?"kup-danger":""} ${e.info?"kup-info":""} ${e.secondary?"kup-secondary":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),p("div",{class:"form-field "+(e.leadingLabel?"form-field--align-end":"")},p("div",{class:`switch ${e.checked?"switch--checked":""} ${e.disabled?"switch--disabled":""}`},p("div",{class:"switch__track"}),p("div",{class:"switch__thumb-underlay"},p("div",{class:"switch__thumb"},p("input",{type:"checkbox",class:"switch__native-control",role:"switch",checked:e.checked,disabled:e.disabled,value:e.checked?"on":"off",onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus})))),p("label",{onClick:e.onChange},e.label))),g=document.documentElement,v=(i,l)=>{const m=i.cell,w=i.column,v=i.row,C=i.shape?i.shape:m.shape?m.shape:w.shape?w.shape:null,I=!g.ketchup.objects.isEmptyKupObj(m.obj),$=!(!m.isEditable&&!w.isEditable||!i.editable),z=i.previousValue!==m.value?m.value:"",D=g.ketchup.data.cell.getType(m,C),F=Object.assign({},m.data);let K=m.cssClass?m.cssClass:w.cssClass?w.cssClass:"";const V={"f-cell":!0,[o.OBJ]:!!I,[D+"-cell"]:!0,[i.wrapperClass]:!!i.wrapperClass,[i.density]:!(!i.density||D===s.BAR),[K]:!!K};let H=z;$&&e.includes(D)?H=function(e,t,c,a,i){switch(e){case s.AUTOCOMPLETE:return p("kup-autocomplete",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"","onkup-autocomplete-change":t=>O(t,i,e,r.UPDATE),"onkup-autocomplete-input":t=>O(t,i,e,r.INPUT),"onkup-autocomplete-iconclick":t=>O(t,i,e,r.ICON_CLICK)}));case s.CHECKBOX:return x(i)&&(t[o.C_CENTERED]=!0),p(b,Object.assign({},c.data,{onChange:t=>O(t,i,e,r.UPDATE)}));case s.CHIP:return p("kup-chip",Object.assign({},c.data,{type:h.INPUT,enableInput:!0,"onKup-chip-change":t=>O(t,i,e,r.UPDATE)}),p("kup-text-field",Object.assign({fullWidth:!0,slot:"field"},c.slotData)));case s.COLOR_PICKER:return p("kup-color-picker",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"",disabled:!1,"onkup-colorpicker-change":t=>O(t,i,e,r.UPDATE)}));case s.COMBOBOX:return p("kup-combobox",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"","onkup-combobox-change":t=>O(t,i,e,r.UPDATE),"onkup-combobox-input":t=>O(t,i,e,r.INPUT),"onkup-combobox-iconclick":t=>O(t,i,e,r.ICON_CLICK)}));case s.DATE:return p("kup-date-picker",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"","onkup-datepicker-change":t=>O(t,i,e,r.UPDATE),"onkup-datepicker-input":t=>O(t,i,e,r.INPUT)}));case s.MULTI_AUTOCOMPLETE:return p("kup-chip",Object.assign({displayId:!0},c.data,{type:h.INPUT,enableInput:!0,"onKup-chip-change":t=>O(t,i,e,r.UPDATE)}),p("kup-autocomplete",Object.assign({class:"kup-full-width",slot:"field",displayMode:j.DESCRIPTION_AND_CODE,selectMode:j.DESCRIPTION_AND_CODE,"onkup-autocomplete-input":t=>O(t,i,e,r.INPUT),"onkup-autocomplete-iconclick":t=>O(t,i,e,r.ICON_CLICK),showDropDownIcon:!1},c.slotData)));case s.MULTI_COMBOBOX:return p("kup-chip",Object.assign({displayId:!0},c.data,{type:h.INPUT,enableInput:!0,"onKup-chip-change":t=>O(t,i,e,r.UPDATE)}),p("kup-combobox",Object.assign({class:"kup-full-width",slot:"field",displayMode:j.DESCRIPTION_AND_CODE,selectMode:j.DESCRIPTION_AND_CODE,"onkup-combobox-input":t=>O(t,i,e,r.INPUT),"onkup-combobox-iconclick":t=>O(t,i,e,r.ICON_CLICK)},c.slotData)));case s.RATING:return p("kup-rating",Object.assign({key:a.name+i.row.id},c.data,{disabled:!1,"onkup-rating-click":t=>O(t,i,e,r.UPDATE)}));case s.SWITCH:return p(y,Object.assign({},c.data,{disabled:!1,onChange:t=>O(t,i,e,r.UPDATE)}));case s.TIME:return p("kup-time-picker",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"","onkup-timepicker-change":t=>O(t,i,e,r.UPDATE),"onkup-timepicker-input":t=>O(t,i,e,r.INPUT)}));case s.NUMBER:t[o.C_RIGHT_ALIGNED]=!0;case s.LINK:case s.STRING:return p(d,Object.assign({inputType:e===s.NUMBER?"number":null,fullWidth:!!_(i)},c.data,{icon:c.icon?c.icon:a.icon?a.icon:null,value:e===s.NUMBER?n(c.value).toString():c.value,onChange:t=>O(t,i,e,r.UPDATE),onInput:t=>O(t,i,e,r.INPUT),onIconClick:t=>O(t,i,e,r.ICON_CLICK)}))}}(D,V,m,w,i):m.data&&t.includes(D)?(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"}}}(D,F,m),H=i.renderKup?function(e,t,c,a,i,l,u){switch(e){case s.BAR:return c.data?p("div",{style:{height:c.sizeY,width:"100%"}},p(k,Object.assign({},c))):p("kup-image",Object.assign({key:l.name+u.row.id},c));case s.BUTTON:return x(u)&&(t[o.C_CENTERED]=!0),p("kup-button",Object.assign({key:l.name+u.row.id},c,{"onkup-button-click":t=>O(t,u,e,r.CLICK)}));case s.BUTTON_LIST:return x(u)&&(t[o.C_CENTERED]=!0),c["data-storage"]={cell:a,row:i,column:l},p("kup-button-list",Object.assign({key:l.name+u.row.id},c));case s.CHART:return x(u)&&(t[o.C_CENTERED]=!0),p("kup-chart",Object.assign({key:l.name+u.row.id},c));case s.CHIP:return p(f,Object.assign({},c));case s.COLOR_PICKER:return p("kup-color-picker",Object.assign({key:l.name+u.row.id},c,{class:_(u)?"kup-full-width":"",disabled:!0}));case s.GAUGE:return p("kup-gauge",Object.assign({key:l.name+u.row.id,value:n(a.value),"width-component":"280px"},c));case s.KNOB:case s.PROGRESS_BAR:return p("kup-progress-bar",Object.assign({key:l.name+u.row.id},c));case s.RADIO:return x(u)&&(t[o.C_CENTERED]=!0),c.disabled=i.readOnly,p("kup-radio",Object.assign({key:l.name+u.row.id},c));case s.RATING:return p("kup-rating",Object.assign({key:l.name+u.row.id},c,{disabled:!0}))}}(D,V,F,m,v,w,i):p("span",{class:"cell-"+D+" 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")}}(D,F,m,i),H=function(e,t,c,a,i,l,r){switch(e){case s.AUTOCOMPLETE:case s.COMBOBOX:case s.DATE:case s.DATETIME:case s.TIME:if(c&&""!=c){const e=u(l,i);return p("div",{class:"f-cell__text"},e)}return c;case s.CHECKBOX:return x(r)&&(a[o.C_CENTERED]=!0),p(k,{resource:t.checked?"check_box":"check_box_outline_blank",sizeX:"18px",sizeY:"18px"});case s.EDITOR:return p("div",{innerHTML:i.value});case s.ICON:case s.IMAGE:return x(r)&&(a[o.C_CENTERED]=!0),t.badgeData&&(a[o.C_PADDED]=!0),p(k,Object.assign({},t));case s.LINK:return p("a",{href:c,target:"_blank"},i.value);case s.NUMBER:if(c&&""!=c){const e=n(i.value),t=u(l,i);return e<0&&(a[o.TEXT_DANGER]=!0),x(r)&&(a[o.C_RIGHT_ALIGNED]=!0),p("div",{class:"f-cell__text"},t)}return p("div",{class:"f-cell__text"},c);case s.SWITCH:return x(r)&&(a[o.C_CENTERED]=!0),t.disabled=!0,p(y,Object.assign({},t));default:return p("div",{class:"f-cell__text"},c)}}(D,F,H,V,m,w,i));let M=null;!$&&(w.icon||m.icon)&&H&&(M=p(k,Object.assign({},{color:`rgba(var(${c.TEXT}-rgb), 0.375)`,resource:m.icon?m.icon:w.icon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"obj-icon"})));let T=null;g.ketchup.debug.isDebug()&&I?T=m.obj.t+"; "+m.obj.p+"; "+m.obj.k+";":null!=m.title&&""!=m.title.trim()&&(T=m.title);let W=null;if(m.info){const e=Object.assign({},m.info);e.color||(e.color=`var(${c.INFO})`),e.icon||(e.icon="info"),W=p(k,Object.assign({},{color:e.color,resource:e.icon,sizeX:"1.25em",sizeY:"1.25em",title:e.message?e.message:"",wrapperClass:"cell-info"}))}return p("div",{onKeyUp:e=>O(e,i,D,r.KEYUP),class:V,"kup-get-cell-props":()=>i,style:m.style},p("div",{class:"f-cell__content",style:m.styleContent,title:T},l&&l.length>0?l:[i.indents,W,M,H]))};function O(e,t,c,a){const i=t.cell,n=t.column,o=t.component,l=t.row;let p="INPUT"===e.target.tagName?e.target.value:e.detail.value;if(a===r.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=u(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:l,type:c}});if(o.rootElement.dispatchEvent(t),a===r.UPDATE)try{o.refresh()}catch(e){}}}function x(e){var t;return l.includes(null===(t=e.component)||void 0===t?void 0:t.rootElement.tagName)}function _(e){var t;return i.includes(null===(t=e.component)||void 0===t?void 0:t.rootElement.tagName)}export{v as F,j as I,w as K,m as a,y as b}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as e,J as t,H as l,C as n,am as r,u as i,y as o,ao as s,ap as a,N as u,aj as c,f,aq as h,a3 as d,ar as p,q as b,l as m}from"./p-5292ef67.js";import{h as v}from"./p-d4ece435.js";import{F}from"./p-7cfdce27.js";import{F as x}from"./p-6c77a36c.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,l){let n="";if(null==e)return n;let r=e[t];return null==r||(n=l?r.textFieldTmp:r.textField),n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,l){if(!t)return!1;let n=this._getTextFilterValue(e,t.name,l);if(null!=n&&""!=n.trim())return!0;if(this._hasIntervalTextFieldFilterValues(e,t,l))return!0;let r=this.getCheckBoxFilterValues(e,t.name);return!(null==r||r.length<1)}getCheckBoxFilterValues(e={},t){let l=[];if(null==e)return l;let n=e[t];return null==n||null==n.checkBoxes||(l=n.checkBoxes),l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!1)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!0)}_hasIntervalTextFieldFilterValues(e={},l,n){if(null==l)return!1;if(!this.isColumnFiltrableByInterval(l))return!1;let r=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(null!=r&&""!=r.trim())return!0;let i=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);return null!=i&&""!=i.trim()}addCheckboxFilter(t={},l,n){if(null==t)return;let r=t[l];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},t[l]=r),null==r.checkBoxes&&(r.checkBoxes=[]),null==n||null==n.value?r.checkBoxes=[]:e.valuesArrayContainsValue(r.checkBoxes,n.value)||(r.checkBoxes[r.checkBoxes.length]=n)}removeCheckboxFilter(t={},l,n){if(null==t||null==n)return;let r=t[l];if(null==r)return;null==r.checkBoxes&&(r.checkBoxes=[]);let i=e.indexOfValueInValuesArray(r.checkBoxes,n);if(i>=0){let e=[];for(let t=0;t<r.checkBoxes.length;t++)t!=i&&(e[e.length]=r.checkBoxes[t]);r.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!1)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!0)}_getIntervalTextFieldFilterValues(e={},l,n){return this._hasIntervalTextFieldFilterValues(e,l,n)?[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)]:["",""]}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!1)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!0)}_getIntervalTextFieldFilterValue(e={},t,l,n){let r="";if(null==e)return r;let i=e[t];return null==i||n&&null==i.intervalTmp?r:n||null!=i.interval?(r=n?i.intervalTmp[l]:i.interval[l],r):r}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,!0)}_setTextFieldFilterValue(e={},t,l,n){if(null==e)return;let r=e[t];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=r),n?r.textFieldTmp=null!=l?l.trim():l:r.textField=null!=l?l.trim():l}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,!0)}_setIntervalTextFieldFilterValue(e={},t,l,n,r){if(null==e)return;let i=e[t];null==i&&(i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=i),null==i.interval&&(i.interval=[],i.interval.push("","")),null==i.intervalTmp&&(i.intervalTmp=[],i.intervalTmp.push("","")),r?i.intervalTmp[n]=null!=l?l.trim():l:i.interval[n]=null!=l?l.trim():l}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,!1)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,!0)}getFilterValueForTooltip(e={},r){let i=this.getTextFilterValue(e,r.name),o=this.getIntervalTextFieldFilterValues(e,r),s=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=o[t.FROM]&&(u+=a+"(>= "+l(o[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=o[t.TO]&&(u+=a+"(<= "+l(o[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return s.forEach((e=>{c+=a+n(e,r),a=" OR "})),""!=c&&(c="("+c+")",""!=u&&(c=" AND "+c)),c=u+c,c}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var g;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.removableColumns="Sets the possibility to remove the selected column.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(g||(g={}));const k="TREE_COLUMN";var T;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(T||(T={}));const y=document.documentElement,j=y.ketchup?y.ketchup.objects:new o,C=y.ketchup?y.ketchup.data:new s;class V extends e{isFilterCompliantForCell(e,t,l){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=!1,r=[],i){return this.areCellsCompliant(e.cells,t,l,n,r,i)}areCellsCompliant(e,t={},l="",n=!1,o=[],s){if(n){let t=!0;if(o&&null!=o&&o.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<o.length;i++){if(0==o[i].visible)continue;const s=e[o[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,l);let a=r(o[i],s);if(a!=s.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==s&&(s=new w),!this.hasFilters(t,o,s))return!0;let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const r=e[n];if(!r)return!1;let u=s.getTextFilterValue(t,n),c=s.getIntervalTextFieldFilterValues(t,i(o,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(j.isNumber(r.obj)||j.isDate(r.obj)||j.isTime(r.obj)||j.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let p=s.getCheckBoxFilterValues(t,n);if(0==p.length)continue;let b=!1;for(let e=0;e<p.length;e++){let t=p[e];if(null!=t&&null!=t.value){if(null!=r.value&&r.value.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}}}if(!b)return!1}return!0}hasFilters(e={},t,l){if(null==e)return!1;let n=Object.keys(e);if(null==n||n.length<1)return!1;null==l&&(l=new w);for(let r=0;r<n.length;r++){let o=n[r],s=null;if(s=o===k?{name:k,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 w);let s=i.getTextFilterValueTmp(t.filters,n.name),a=i.getIntervalTextFieldFilterValuesTmp(t.filters,n),u=i.getCheckBoxFilterValues(t.filters,n.name);if(null!=n.valuesForFilter&&n.valuesForFilter.length>0)return n.valuesForFilter.forEach((t=>{let r=t;(e.valuesArrayContainsValue(u,r)||""==s||i.isFilterCompliantForSimpleValue(r,n.obj,s,a))&&o.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),o;let c=Object.assign({},t.filters);c[n.name]={textField:s,textFieldTmp:s,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)o.push(u[e]);return C.cell.getUnivocalValue({rows:f},n,!0)}}const O=document.documentElement;function I(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const l=e[0].group.column;let n=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let l of t)if(l.column===e)return l;return null}(l,t);return n||(n={column:l,sortMode:d.A}),e.sort(((e,t)=>a({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},n.sortMode))),e.forEach((e=>{e.group.children=I(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const r=M(e,n,t[l]);if(0!==r)return r}return 0}return M(e,n,t[0])}))}function M(e,t,l){const n=e.cells[l.column],r=t.cells[l.column];return n||r?n?r?a(n,r,l.sortMode):-1:1:0}function _(e=[],t={},l="",n=[],r,i){return null==i&&(i=new V),i.filterRows(e,t,l,n,r)}function N(e=[],t=[],l=[],n={}){if(!t)return[];if(!l||0===l.length||!e||0===e.length)return t;const o={},s=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return o[l]=n,!0;return!1}));if(0===s.length)return t;const a=[];let f={};return t.forEach((t=>{const l=s[0].column,h=t.cells[l];if(h){const d=i(e,l),p=r(d,h),b=h.value;let m=null;for(let e of a)if(e.group.label===p){m=e;break}null===m&&(m={group:{id:b,parent:null,column:l,columnLabel:o[l],expanded:!1,label:p,children:[],obj:h.obj,totals:{}},cells:{}},a.push(m));for(let l=1;l<s.length;l++){const n=s[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(t,a),s=a.value;let u=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===l){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:n.column,columnLabel:o[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},E(u),m.group.children.push(u)),m=u}}m.group.children.push(t),function(e,t,l,n){if(!e||!t)return;const r=Object.keys(t);0!==r.length&&r.forEach((r=>{const i=O.ketchup.math.numberify(e.group.totals[r]||0),o=l.cells[r];if(o){let l=O.ketchup.objects.isNumber(o.obj);const s=t[r];switch(s){case u.COUNT:e.group.totals[r]=i+1;let t=e.group.parent;for(;null!=t;)t.group.totals[r]=(t.group.totals[r]||0)+1,t=t.group.parent;break;case u.DISTINCT:let a;if(a=l?O.ketchup.math.numberify(c(o.value)):o.value,n[e.group.id]){let t=n[e.group.id][r];t?t.push(a):(n[e.group.id][r]=[],n[e.group.id][r].push(a))}else n[e.group.id]={},n[e.group.id][r]=[],n[e.group.id][r].push(a);let f=e.group.parent;for(;null!=f;){if(n[f.group.id]){let e=n[f.group.id][r];e?e.push(a):(n[f.group.id][r]=[],n[f.group.id][r].push(a))}else n[f.group.id]={},n[f.group.id][r]=[],n[f.group.id][r].push(a);f=f.group.parent}break;case u.SUM:case u.AVERAGE:if(l){const t=O.ketchup.math.numberify(c(o.value));e.group.totals[r]=t+i;let l=e.group.parent;for(;null!=l;){const e=O.ketchup.math.numberify(l.group.totals[r]||0);l.group.totals[r]=t+e,l=l.group.parent}}break;case u.MIN:if(l){const t=e.group.totals[r],l=O.ketchup.math.numberify(c(o.value));e.group.totals[r]=t?Math.min(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.min(e,l):l,n=n.group.parent}}else if(O.ketchup.objects.isDate(o.obj)){const t=o.obj?O.ketchup.objects.parseDate(o.obj):O.ketchup.dates.toDayjs(o.value);if(O.ketchup.dates.isValid(t)){const l=O.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(O.ketchup.dates.format(n)),e.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.min(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(O.ketchup.dates.format(e)),i.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.min(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;case u.MAX:if(l){const t=e.group.totals[r],l=O.ketchup.math.numberify(c(o.value));e.group.totals[r]=t?Math.max(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.max(e,l):l,n=n.group.parent}}else if(O.ketchup.objects.isDate(o.obj)){const t=o.obj?O.ketchup.objects.parseDate(o.obj):O.ketchup.dates.toDayjs(o.value);if(O.ketchup.dates.isValid(t)){const l=O.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(O.ketchup.dates.format(n)),e.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.max(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(O.ketchup.dates.format(e)),i.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.max(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;default:0!=s.indexOf(u.MATH)&&console.warn(`invalid total mode: ${s}`)}}}))}(m,n,t,f)}})),function(e,t,l){if(!e||!t)return;const n=Object.keys(t);if(0===e.length||!e[0].group||0===n.length)return;let r=n.filter((e=>u.DISTINCT===t[e]));r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>A(e,r,l)))}(a,n,f),W(a,u.AVERAGE,n),W(a,u.MATH,n),a}function W(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=>B(e,t,r,l)))}function A(e,t,l){const n=e.group.children;0!==n.length&&(n[0].group&&n.forEach((e=>{A(e,t,l)})),t.forEach((t=>{e.group.totals[t]=new Set(l[e.group.id][t]).size})))}function B(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+=B(e,t,l,n)})):i=r.length,l.forEach((l=>{if(t==u.AVERAGE&&(e.group.totals[l]=O.ketchup.math.numberify(e.group.totals[l])/i),t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=O.ketchup.math.formulas.custom(t,e.group.totals)}})),i}function D(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 $(e=[],t={}){if(O.ketchup.objects.isEmptyJsObject(e)||O.ketchup.objects.isEmptyJsObject(t))return{};const l=Object.keys(t),n={},r=new Array;if(0===l.length||l.every((e=>t[e]===u.COUNT)))l.forEach((t=>n[t]=e.length));else{let i={};e.forEach(((e,o,s)=>{l.filter((e=>u.COUNT!==t[e]&&0!=t[e].indexOf(u.MATH))).forEach((l=>{const a=e.cells[l];if(a)if(t[l]===u.DISTINCT){let e;e=O.ketchup.objects.isNumber(a.obj)?O.ketchup.math.numberify(c(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(O.ketchup.objects.isNumber(a.obj)){const e=O.ketchup.math.numberify(c(a.value));let r=n[l];switch(!0){case t[l]===u.MIN:n[l]=r?Math.min(r,e):e;break;case t[l]===u.MAX:n[l]=r?Math.max(r,e):e;break;default:r=n[l]||0,n[l]=e+O.ketchup.math.numberify(r)}}else if(O.ketchup.objects.isDate(a.obj)){-1==r.indexOf(l)&&r.push(l);const e=O.ketchup.dates.toDayjs(a.value);if(O.ketchup.dates.isValid(e)){const r=O.ketchup.dates.toDate(e),i=n[l]?O.ketchup.dates.toDate(O.ketchup.dates.toDayjs(n[l])):null;switch(!0){case t[l]===u.MIN:if(i){let e=[];e.push(r),e.push(i),n[l]=O.ketchup.dates.format(O.ketchup.dates.min(e),f.ISO_DATE)}else n[l]=O.ketchup.dates.format(r,f.ISO_DATE);break;case t[l]===u.MAX:if(i){let e=[];e.push(r),e.push(i),n[l]=O.ketchup.dates.format(O.ketchup.dates.max(e),f.ISO_DATE)}else n[l]=O.ketchup.dates.format(r,f.ISO_DATE)}}}o===s.length-1&&t[l]===u.DISTINCT&&(n[l]=new Set(i[l]).size,i[l]=[])}))}))}for(let i of l){switch(!0){case t[i]===u.AVERAGE:const l=n[i];l&&e.length>0&&(n[i]=l/e.length);break;case t[i]===u.COUNT:n[i]=e.length;break;case 0==t[i].indexOf(u.MATH):n[i]=O.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=O.ketchup.dates.format(n[i]):h(n[i])&&(n[i]=+n[i].toFixed(2)))}return n}function E(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 L(e,t,l,n){const r=t*l-l,i=r+Number(l);if(0==n)return e.slice(r,i);let o=[];return S(e,o,r,Number(l),0),o}function S(e,t,l,n,r){let i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=q(e[o]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=S(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 q(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:z(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function R(e){if(null==e)return null;let t=[];for(let l=0;l<e.length;l++)t[t.length]=q(e[l]);return t}function z(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:R(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}var H;!function(e){e.SIMPLE="simple",e.FULL="full"}(H||(H={}));const J=document.documentElement,K=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:J.ketchup.language.translate(p.PAGE),helper:J.ketchup.language.translate(p.TOTAL)+`: ${t}`,helperWhenFocused:!0,inputType:"number",max:t,min:1}},i={"kup-list":{data:n},"kup-text-field":{label:J.ketchup.language.translate(b.ROWS)+" / "+J.ketchup.language.translate(p.PAGE),helper:J.ketchup.language.translate(b.TOTAL)+`: ${e.max}`,helperWhenFocused:!0,inputType:"number",max:e.max,min:1}};return v("div",Object.assign({class:`f-paginator ${e.mode?e.mode:""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),e.mode!==H.SIMPLE?v(F,{icon:"chevron_left",disabled:G(e),onClick:e.onPrevPage,wrapperClass:"prev-page"}):null,v("kup-combobox",{class:"page-selector",data:r,initialValue:e.currentPage.toString(),"onkup-combobox-change":e.onPageChange}),e.mode!==H.SIMPLE?v(F,{icon:"chevron_right",disabled:U(e),onClick:e.onNextPage,wrapperClass:"next-page"}):null,v("kup-combobox",{class:"rows-selector",data:i,initialValue:e.perPage.toString(),"onkup-combobox-change":e.onRowsChange}),e.onLoadMore?v(F,{icon:"plus",onClick:e.onLoadMore,label:J.ketchup.language.translate(m.LOAD_MORE),styling:x.FLAT,wrapperClass:"load-more-button"}):null)};function U(e){return e.currentPage*e.perPage>=e.max}function G(e){return 1==e.currentPage}function P(e,t,l){if(h(e)){const n=Math.ceil(t/l);let r=e;return r>n&&(r=n),r<1&&(r=1),r}return null}function Q(e,t){if(h(e)){let l=e;return l>t&&(l=t),l<1&&(l=1),l}return null}export{w as F,T as K,V as a,K as b,$ as c,P as d,g as e,_ as f,N as g,H as h,D as n,L as p,Q as r,I as s,k as t}
|
|
1
|
+
import{E as e,J as t,H as l,C as n,am as r,u as i,y as o,ao as s,ap as a,N as u,aj as c,f,aq as h,a3 as d,ar as p,q as b,l as m}from"./p-b63a5a44.js";import{h as v}from"./p-9dcfbb1e.js";import{F}from"./p-a1adab40.js";import{F as x}from"./p-6c77a36c.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,l){let n="";if(null==e)return n;let r=e[t];return null==r||(n=l?r.textFieldTmp:r.textField),n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,l){if(!t)return!1;let n=this._getTextFilterValue(e,t.name,l);if(null!=n&&""!=n.trim())return!0;if(this._hasIntervalTextFieldFilterValues(e,t,l))return!0;let r=this.getCheckBoxFilterValues(e,t.name);return!(null==r||r.length<1)}getCheckBoxFilterValues(e={},t){let l=[];if(null==e)return l;let n=e[t];return null==n||null==n.checkBoxes||(l=n.checkBoxes),l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!1)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!0)}_hasIntervalTextFieldFilterValues(e={},l,n){if(null==l)return!1;if(!this.isColumnFiltrableByInterval(l))return!1;let r=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(null!=r&&""!=r.trim())return!0;let i=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);return null!=i&&""!=i.trim()}addCheckboxFilter(t={},l,n){if(null==t)return;let r=t[l];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},t[l]=r),null==r.checkBoxes&&(r.checkBoxes=[]),null==n||null==n.value?r.checkBoxes=[]:e.valuesArrayContainsValue(r.checkBoxes,n.value)||(r.checkBoxes[r.checkBoxes.length]=n)}removeCheckboxFilter(t={},l,n){if(null==t||null==n)return;let r=t[l];if(null==r)return;null==r.checkBoxes&&(r.checkBoxes=[]);let i=e.indexOfValueInValuesArray(r.checkBoxes,n);if(i>=0){let e=[];for(let t=0;t<r.checkBoxes.length;t++)t!=i&&(e[e.length]=r.checkBoxes[t]);r.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!1)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!0)}_getIntervalTextFieldFilterValues(e={},l,n){return this._hasIntervalTextFieldFilterValues(e,l,n)?[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)]:["",""]}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!1)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!0)}_getIntervalTextFieldFilterValue(e={},t,l,n){let r="";if(null==e)return r;let i=e[t];return null==i||n&&null==i.intervalTmp?r:n||null!=i.interval?(r=n?i.intervalTmp[l]:i.interval[l],r):r}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,!0)}_setTextFieldFilterValue(e={},t,l,n){if(null==e)return;let r=e[t];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=r),n?r.textFieldTmp=null!=l?l.trim():l:r.textField=null!=l?l.trim():l}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,!0)}_setIntervalTextFieldFilterValue(e={},t,l,n,r){if(null==e)return;let i=e[t];null==i&&(i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=i),null==i.interval&&(i.interval=[],i.interval.push("","")),null==i.intervalTmp&&(i.intervalTmp=[],i.intervalTmp.push("","")),r?i.intervalTmp[n]=null!=l?l.trim():l:i.interval[n]=null!=l?l.trim():l}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,!1)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,!0)}getFilterValueForTooltip(e={},r){let i=this.getTextFilterValue(e,r.name),o=this.getIntervalTextFieldFilterValues(e,r),s=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=o[t.FROM]&&(u+=a+"(>= "+l(o[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=o[t.TO]&&(u+=a+"(<= "+l(o[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return s.forEach((e=>{c+=a+n(e,r),a=" OR "})),""!=c&&(c="("+c+")",""!=u&&(c=" AND "+c)),c=u+c,c}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var g;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.removableColumns="Sets the possibility to remove the selected column.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(g||(g={}));const k="TREE_COLUMN";var T;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(T||(T={}));const y=document.documentElement,j=y.ketchup?y.ketchup.objects:new o,C=y.ketchup?y.ketchup.data:new s;class V extends e{isFilterCompliantForCell(e,t,l){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=!1,r=[],i){return this.areCellsCompliant(e.cells,t,l,n,r,i)}areCellsCompliant(e,t={},l="",n=!1,o=[],s){if(n){let t=!0;if(o&&null!=o&&o.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<o.length;i++){if(0==o[i].visible)continue;const s=e[o[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,l);let a=r(o[i],s);if(a!=s.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==s&&(s=new w),!this.hasFilters(t,o,s))return!0;let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const r=e[n];if(!r)return!1;let u=s.getTextFilterValue(t,n),c=s.getIntervalTextFieldFilterValues(t,i(o,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(j.isNumber(r.obj)||j.isDate(r.obj)||j.isTime(r.obj)||j.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let p=s.getCheckBoxFilterValues(t,n);if(0==p.length)continue;let b=!1;for(let e=0;e<p.length;e++){let t=p[e];if(null!=t&&null!=t.value){if(null!=r.value&&r.value.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}}}if(!b)return!1}return!0}hasFilters(e={},t,l){if(null==e)return!1;let n=Object.keys(e);if(null==n||n.length<1)return!1;null==l&&(l=new w);for(let r=0;r<n.length;r++){let o=n[r],s=null;if(s=o===k?{name:k,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 w);let s=i.getTextFilterValueTmp(t.filters,n.name),a=i.getIntervalTextFieldFilterValuesTmp(t.filters,n),u=i.getCheckBoxFilterValues(t.filters,n.name);if(null!=n.valuesForFilter&&n.valuesForFilter.length>0)return n.valuesForFilter.forEach((t=>{let r=t;(e.valuesArrayContainsValue(u,r)||""==s||i.isFilterCompliantForSimpleValue(r,n.obj,s,a))&&o.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),o;let c=Object.assign({},t.filters);c[n.name]={textField:s,textFieldTmp:s,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)o.push(u[e]);return C.cell.getUnivocalValue({rows:f},n,!0)}}const O=document.documentElement;function I(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const l=e[0].group.column;let n=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let l of t)if(l.column===e)return l;return null}(l,t);return n||(n={column:l,sortMode:d.A}),e.sort(((e,t)=>a({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},n.sortMode))),e.forEach((e=>{e.group.children=I(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const r=M(e,n,t[l]);if(0!==r)return r}return 0}return M(e,n,t[0])}))}function M(e,t,l){const n=e.cells[l.column],r=t.cells[l.column];return n||r?n?r?a(n,r,l.sortMode):-1:1:0}function _(e=[],t={},l="",n=[],r,i){return null==i&&(i=new V),i.filterRows(e,t,l,n,r)}function N(e=[],t=[],l=[],n={}){if(!t)return[];if(!l||0===l.length||!e||0===e.length)return t;const o={},s=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return o[l]=n,!0;return!1}));if(0===s.length)return t;const a=[];let f={};return t.forEach((t=>{const l=s[0].column,h=t.cells[l];if(h){const d=i(e,l),p=r(d,h),b=h.value;let m=null;for(let e of a)if(e.group.label===p){m=e;break}null===m&&(m={group:{id:b,parent:null,column:l,columnLabel:o[l],expanded:!1,label:p,children:[],obj:h.obj,totals:{}},cells:{}},a.push(m));for(let l=1;l<s.length;l++){const n=s[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(t,a),s=a.value;let u=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===l){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:n.column,columnLabel:o[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},E(u),m.group.children.push(u)),m=u}}m.group.children.push(t),function(e,t,l,n){if(!e||!t)return;const r=Object.keys(t);0!==r.length&&r.forEach((r=>{const i=O.ketchup.math.numberify(e.group.totals[r]||0),o=l.cells[r];if(o){let l=O.ketchup.objects.isNumber(o.obj);const s=t[r];switch(s){case u.COUNT:e.group.totals[r]=i+1;let t=e.group.parent;for(;null!=t;)t.group.totals[r]=(t.group.totals[r]||0)+1,t=t.group.parent;break;case u.DISTINCT:let a;if(a=l?O.ketchup.math.numberify(c(o.value)):o.value,n[e.group.id]){let t=n[e.group.id][r];t?t.push(a):(n[e.group.id][r]=[],n[e.group.id][r].push(a))}else n[e.group.id]={},n[e.group.id][r]=[],n[e.group.id][r].push(a);let f=e.group.parent;for(;null!=f;){if(n[f.group.id]){let e=n[f.group.id][r];e?e.push(a):(n[f.group.id][r]=[],n[f.group.id][r].push(a))}else n[f.group.id]={},n[f.group.id][r]=[],n[f.group.id][r].push(a);f=f.group.parent}break;case u.SUM:case u.AVERAGE:if(l){const t=O.ketchup.math.numberify(c(o.value));e.group.totals[r]=t+i;let l=e.group.parent;for(;null!=l;){const e=O.ketchup.math.numberify(l.group.totals[r]||0);l.group.totals[r]=t+e,l=l.group.parent}}break;case u.MIN:if(l){const t=e.group.totals[r],l=O.ketchup.math.numberify(c(o.value));e.group.totals[r]=t?Math.min(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.min(e,l):l,n=n.group.parent}}else if(O.ketchup.objects.isDate(o.obj)){const t=o.obj?O.ketchup.objects.parseDate(o.obj):O.ketchup.dates.toDayjs(o.value);if(O.ketchup.dates.isValid(t)){const l=O.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(O.ketchup.dates.format(n)),e.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.min(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(O.ketchup.dates.format(e)),i.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.min(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;case u.MAX:if(l){const t=e.group.totals[r],l=O.ketchup.math.numberify(c(o.value));e.group.totals[r]=t?Math.max(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.max(e,l):l,n=n.group.parent}}else if(O.ketchup.objects.isDate(o.obj)){const t=o.obj?O.ketchup.objects.parseDate(o.obj):O.ketchup.dates.toDayjs(o.value);if(O.ketchup.dates.isValid(t)){const l=O.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(O.ketchup.dates.format(n)),e.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.max(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(O.ketchup.dates.format(e)),i.group.totals[r]=O.ketchup.dates.format(O.ketchup.dates.max(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;default:0!=s.indexOf(u.MATH)&&console.warn(`invalid total mode: ${s}`)}}}))}(m,n,t,f)}})),function(e,t,l){if(!e||!t)return;const n=Object.keys(t);if(0===e.length||!e[0].group||0===n.length)return;let r=n.filter((e=>u.DISTINCT===t[e]));r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>A(e,r,l)))}(a,n,f),W(a,u.AVERAGE,n),W(a,u.MATH,n),a}function W(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=>B(e,t,r,l)))}function A(e,t,l){const n=e.group.children;0!==n.length&&(n[0].group&&n.forEach((e=>{A(e,t,l)})),t.forEach((t=>{e.group.totals[t]=new Set(l[e.group.id][t]).size})))}function B(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+=B(e,t,l,n)})):i=r.length,l.forEach((l=>{if(t==u.AVERAGE&&(e.group.totals[l]=O.ketchup.math.numberify(e.group.totals[l])/i),t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=O.ketchup.math.formulas.custom(t,e.group.totals)}})),i}function D(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 $(e=[],t={}){if(O.ketchup.objects.isEmptyJsObject(e)||O.ketchup.objects.isEmptyJsObject(t))return{};const l=Object.keys(t),n={},r=new Array;if(0===l.length||l.every((e=>t[e]===u.COUNT)))l.forEach((t=>n[t]=e.length));else{let i={};e.forEach(((e,o,s)=>{l.filter((e=>u.COUNT!==t[e]&&0!=t[e].indexOf(u.MATH))).forEach((l=>{const a=e.cells[l];if(a)if(t[l]===u.DISTINCT){let e;e=O.ketchup.objects.isNumber(a.obj)?O.ketchup.math.numberify(c(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(O.ketchup.objects.isNumber(a.obj)){const e=O.ketchup.math.numberify(c(a.value));let r=n[l];switch(!0){case t[l]===u.MIN:n[l]=r?Math.min(r,e):e;break;case t[l]===u.MAX:n[l]=r?Math.max(r,e):e;break;default:r=n[l]||0,n[l]=e+O.ketchup.math.numberify(r)}}else if(O.ketchup.objects.isDate(a.obj)){-1==r.indexOf(l)&&r.push(l);const e=O.ketchup.dates.toDayjs(a.value);if(O.ketchup.dates.isValid(e)){const r=O.ketchup.dates.toDate(e),i=n[l]?O.ketchup.dates.toDate(O.ketchup.dates.toDayjs(n[l])):null;switch(!0){case t[l]===u.MIN:if(i){let e=[];e.push(r),e.push(i),n[l]=O.ketchup.dates.format(O.ketchup.dates.min(e),f.ISO_DATE)}else n[l]=O.ketchup.dates.format(r,f.ISO_DATE);break;case t[l]===u.MAX:if(i){let e=[];e.push(r),e.push(i),n[l]=O.ketchup.dates.format(O.ketchup.dates.max(e),f.ISO_DATE)}else n[l]=O.ketchup.dates.format(r,f.ISO_DATE)}}}o===s.length-1&&t[l]===u.DISTINCT&&(n[l]=new Set(i[l]).size,i[l]=[])}))}))}for(let i of l){switch(!0){case t[i]===u.AVERAGE:const l=n[i];l&&e.length>0&&(n[i]=l/e.length);break;case t[i]===u.COUNT:n[i]=e.length;break;case 0==t[i].indexOf(u.MATH):n[i]=O.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=O.ketchup.dates.format(n[i]):h(n[i])&&(n[i]=+n[i].toFixed(2)))}return n}function E(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 L(e,t,l,n){const r=t*l-l,i=r+Number(l);if(0==n)return e.slice(r,i);let o=[];return S(e,o,r,Number(l),0),o}function S(e,t,l,n,r){let i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=q(e[o]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=S(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 q(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:z(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function R(e){if(null==e)return null;let t=[];for(let l=0;l<e.length;l++)t[t.length]=q(e[l]);return t}function z(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:R(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}var H;!function(e){e.SIMPLE="simple",e.FULL="full"}(H||(H={}));const J=document.documentElement,K=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:J.ketchup.language.translate(p.PAGE),helper:J.ketchup.language.translate(p.TOTAL)+`: ${t}`,helperWhenFocused:!0,inputType:"number",max:t,min:1}},i={"kup-list":{data:n},"kup-text-field":{label:J.ketchup.language.translate(b.ROWS)+" / "+J.ketchup.language.translate(p.PAGE),helper:J.ketchup.language.translate(b.TOTAL)+`: ${e.max}`,helperWhenFocused:!0,inputType:"number",max:e.max,min:1}};return v("div",Object.assign({class:`f-paginator ${e.mode?e.mode:""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),e.mode!==H.SIMPLE?v(F,{icon:"chevron_left",disabled:G(e),onClick:e.onPrevPage,wrapperClass:"prev-page"}):null,v("kup-combobox",{class:"page-selector",data:r,initialValue:e.currentPage.toString(),"onkup-combobox-change":e.onPageChange}),e.mode!==H.SIMPLE?v(F,{icon:"chevron_right",disabled:U(e),onClick:e.onNextPage,wrapperClass:"next-page"}):null,v("kup-combobox",{class:"rows-selector",data:i,initialValue:e.perPage.toString(),"onkup-combobox-change":e.onRowsChange}),e.onLoadMore?v(F,{icon:"plus",onClick:e.onLoadMore,label:J.ketchup.language.translate(m.LOAD_MORE),styling:x.FLAT,wrapperClass:"load-more-button"}):null)};function U(e){return e.currentPage*e.perPage>=e.max}function G(e){return 1==e.currentPage}function P(e,t,l){if(h(e)){const n=Math.ceil(t/l);let r=e;return r>n&&(r=n),r<1&&(r=1),r}return null}function Q(e,t){if(h(e)){let l=e;return l>t&&(l=t),l<1&&(l=1),l}return null}export{w as F,T as K,V as a,K as b,$ as c,P as d,g as e,_ as f,N as g,H as h,D as n,L as p,Q as r,I as s,k as t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,f as i,h as r,H as a,g as l}from"./p-d4ece435.js";import{F as o}from"./p-7cfdce27.js";import{F as s}from"./p-6c77a36c.js";import{F as _}from"./p-9f00ad0f.js";import{k as n,g as m,s as f,l as h,R as c}from"./p-5292ef67.js";import{c as u}from"./p-97e8ea42.js";var p;!function(t){t.autofitOnExpand="The component will autofit everytime a node is expanded.",t.autofitOnLoad="The component's initial render will fit the container by invoking the runAutofit method.",t.cardData="Used to render the family tree boxes as kup-cards (through kup-box).",t.collapsible="Nodes can be expanded/collapsed.",t.customStyle="Custom style of the component.",t.data="Actual data of the component",t.layout="Layout of the boxes.",t.stackedLeaves="Child nodes that have no children are arranged vertically."}(p||(p={}));var d,y,k,v,g,x,b,w,j,C,E,T,W,M,S,z,D,L,O,P,R,A,F,X,Y,H,$=function(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)},B=function(t,e,i,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(t,i):a?a.value=i:e.set(t,i),i};const N=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),k.set(this,!1),v.set(this,0),g.set(this,0),x.set(this,[]),b.set(this,n()),w.set(this,(t=>{const e=t.clientX-$(this,v,"f"),i=t.clientY-$(this,g,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,B(this,v,t.clientX,"f"),B(this,g,t.clientY,"f")})),j.set(this,!1),C.set(this,null),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1}async collapseAll(t=this.data.rows){$(this,b,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){$(this,b,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return m(this,p,t)}async refresh(){i(this)}async runAutofit(){const t=$(this,C,"f").clientWidth,e=$(this,C,"f").children[0].clientWidth,i=.01,r=.85*t,a=.95*t;let l=1,o=2e3,s=e;for(;(s<r||s>a)&&o>0&&l>i;)o--,s<r?l+=i:s>a?l-=i:o=0,s=e*l;$(this,C,"f").style.setProperty("--kup_familytree_scale",l<=1?l.toFixed(2):"1")}async setProps(t){f(this,p,t)}componentWillLoad(){$(this,b,"f").debug.logLoad(this,!1),$(this,b,"f").language.register(this),$(this,b,"f").theme.register(this)}componentDidLoad(){$(this,d,"m",Y).call(this),this.autofitOnLoad&&this.runAutofit(),$(this,b,"f").debug.logLoad(this,!0)}componentWillRender(){$(this,b,"f").debug.logRender(this,!1)}componentDidRender(){$(this,j,"f")&&(B(this,j,!1,"f"),this.runAutofit()),$(this,b,"f").debug.logRender(this,!0)}render(){return r(a,{onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),$(this,d,"m",O).call(this,t)},onWheel:t=>{$(this,d,"m",H).call(this,t)}},r("style",null,$(this,b,"f").theme.setKupStyle(this.rootElement)),r("div",{id:u},$(this,d,"m",D).call(this)))}disconnectedCallback(){$(this,b,"f").language.unregister(this),$(this,b,"f").theme.unregister(this)}get rootElement(){return l(this)}};y=new WeakMap,k=new WeakMap,v=new WeakMap,g=new WeakMap,x=new WeakMap,b=new WeakMap,w=new WeakMap,j=new WeakMap,C=new WeakMap,d=new WeakSet,E=function(t,e,i,a){const l=[];return l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},r("div",{class:"family-tree__line--placeholder"}))),l.push(r("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||a&&!e}},r("div",{class:"family-tree__line--placeholder"}))),l},T=function t(e){var i;let a=null,l=null;(!this.collapsible||this.collapsible&&e.isExpanded)&&(null===(i=e.children)||void 0===i||i.forEach((t=>{t.isStaff?(l||(l=[]),l.push(t)):(a||(a=[]),a.push(t))})));const _=this.stackedLeaves&&a&&a.every((t=>!t.children||0==t.children.length)),n=a?2*a.length:1,m={"family-tree__line":!0,"family-tree__line--placeholder":!(!a&&!l),"family-tree__line--vertical":!(!a&&!l)},f={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},c=e.layout||this.layout||1,u={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:s.OUTLINED,title:`${$(this,b,"f").language.translate(h.EXPAND)}/${$(this,b,"f").language.translate(h.COLLAPSE)} (CTRL + Click)`,onClick:t=>{t.ctrlKey&&e.children&&e.children.length>0&&(e.isExpanded?this.collapseAll(e.children):this.expandAll(e.children)),e.isExpanded=!e.isExpanded,this.autofitOnExpand&&B(this,j,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let p=null;$(this,d,"m",L).call(this,c)&&(p=r("kup-box",{class:"kup-borderless kup-paddingless",customStyle:"#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }",data:f,cardData:this.cardData,layout:this.cardData?null:c,showSelection:!1}));const y=r("div",{class:"family-tree__item"},r("div",{class:"family-tree__item__wrapper"},$(this,d,"m",L).call(this,c)?p:$(this,d,"m",W).call(this,e,c),this.collapsible&&e.children&&e.children.length>0?r(o,Object.assign({},u)):void 0)),k={"--kup_familytree_staffchildren":(null==l?void 0:l.length.toString())||"0"};return r("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},r("tr",null,r("td",{"data-row":e,colSpan:n},y)),r("tr",null,r("td",{colSpan:n},r("div",{class:m}))),l?[r("tr",null,r("td",{colSpan:n},r("div",{class:Object.assign(Object.assign({},m),{"family-tree__line--staff":!0}),style:k}),r("div",{class:"family-tree__node__staff",style:k},l.map((e=>[r("div",{class:"family-tree__node__staff__item"},$(this,d,"m",t).call(this,e))])))))]:null,l&&a?[r("tr",null,r("td",{colSpan:n},r("div",{class:m})))]:null,a?[r("tr",null,_?r("td",{colSpan:n},r("div",{class:m})):a.map((t=>$(this,d,"m",E).call(this,0==a.indexOf(t),a.indexOf(t)==a.length-1,1==a.length,a.length>2)))),r("tr",null,_?r("td",{colSpan:n},a.map((e=>$(this,d,"m",t).call(this,e)))):a.map((e=>r("td",{colSpan:2},$(this,d,"m",t).call(this,e)))))]:void 0)},W=function(t,e){return 2===e?$(this,d,"m",S).call(this,t):$(this,d,"m",M).call(this,t)},M=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--1"},r("div",{class:"family-tree__item__layout__text__title"},t.value))},S=function(t){return r("div",{class:"family-tree__item__layout family-tree__item__layout--2"},r("div",{class:"family-tree__item__layout__color"}),r("div",{class:"family-tree__item__layout__image"},r(_,{resource:t.icon,sizeX:"48px",sizeY:"48px"})),r("div",{class:"family-tree__item__layout__text"},r("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?r("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},z=function(t){return t.map((t=>$(this,d,"m",T).call(this,t)))},D=function(){return r("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>B(this,C,t,"f")},this.data&&this.data.rows&&this.data.rows.length?$(this,d,"m",z).call(this,this.data.rows):r("div",null,$(this,b,"f").language.translate(h.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){B(this,v,t.clientX,"f"),B(this,g,t.clientY,"f"),$(this,C,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",$(this,w,"f")),document.removeEventListener("pointerup",e),$(this,C,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",$(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t){const e=[];for(;t&&t!==this.rootElement&&t!==document.body;)e.push(t),t=t.parentNode?t.parentNode:t.host;return e},R=function(t,e){let i,r;if(t)for(let e=t.length-1;e>=0;e--){const a=t[e];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 $(this,d,"m",R).call(this,$(this,d,"m",P).call(this,t.target),t)},F=function(t){return $(this,d,"m",R).call(this,$(this,d,"m",P).call(this,t.target),t)},X=function(t){return $(this,d,"m",R).call(this,$(this,d,"m",P).call(this,t.target),t)},Y=function(){$(this,x,"f").push(this.rootElement),$(this,b,"f").interact.on(this.rootElement,c.TAP,(t=>{if($(this,k,"f"))B(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];$(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",A).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",F).call(this,t)})}})),$(this,b,"f").interact.on(this.rootElement,c.DOUBLETAP,(t=>{if(0===t.button){for(let t=0;t<$(this,y,"f").length;t++)clearTimeout($(this,y,"f")[t]),$(this,b,"f").debug.logMessage(this,"Cleared clickHandler timeout("+$(this,y,"f")[t]+").");B(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",X).call(this,t)})}})),$(this,b,"f").interact.on(this.rootElement,c.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||(B(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",F).call(this,t)}))}))},H=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat($(this,C,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let r=t.deltaY>0?e-i:e+i;r<i&&(r=i),$(this,C,"f").style.setProperty("--kup_familytree_scale",r.toFixed(2))}},N.style=':host{--kup_familytree_item_background_color:var(\n --kup-familytree-item-background-color,\n var(--kup-background-color)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 80px);--kup_familytree_item_h_padding:var(--kup-familytree-item-h-padding, 8px);--kup_familytree_item_v_padding:var(--kup-familytree-item-v-padding, 10px);--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-color)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc( ( var(--kup_familytree_item_width) + (var(--kup_familytree_item_h_padding) * 2) ) / 2 )) translateY(calc( 0px - ( var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * (var(--kup_familytree_item_v_padding) * 2) ) ))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:"";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc( var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * (var(--kup_familytree_item_v_padding) * 2) )}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);border:1px solid var(--kup_familytree_lines_color);border-radius:8px;box-sizing:border-box;display:flex;height:var(--kup_familytree_item_height);margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup-secondary-color);border-bottom-left-radius:8px;border-top-left-radius:8px;height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto 10px}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';export{N as kup_family_tree}
|
|
1
|
+
import{r as t,c as e,f as i,h as a,H as r,g as l}from"./p-9dcfbb1e.js";import{F as o}from"./p-a1adab40.js";import{F as s}from"./p-6c77a36c.js";import{F as _}from"./p-a7ae0b4d.js";import{k as n,g as m,s as f,l as h,R as c}from"./p-b63a5a44.js";import{c as u}from"./p-97e8ea42.js";var p;!function(t){t.autofitOnExpand="The component will autofit everytime a node is expanded.",t.autofitOnLoad="The component's initial render will fit the container by invoking the runAutofit method.",t.cardData="Used to render the family tree boxes as kup-cards (through kup-box).",t.collapsible="Nodes can be expanded/collapsed.",t.customStyle="Custom style of the component.",t.data="Actual data of the component",t.layout="Layout of the boxes.",t.stackedLeaves="Child nodes that have no children are arranged vertically."}(p||(p={}));var d,y,k,v,g,b,x,w,j,C,E,T,W,M,S,z,D,L,O,P,R,A,F,X,Y,H,$=function(t,e,i,a){if("a"===i&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?a:"a"===i?a.call(t):a?a.value:e.get(t)},B=function(t,e,i,a,r){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?r.call(t,i):r?r.value=i:e.set(t,i),i};const N=class{constructor(i){t(this,i),this.kupClick=e(this,"kup-familytree-click",6),this.kupContextMenu=e(this,"kup-familytree-contextmenu",6),this.kupDblClick=e(this,"kup-familytree-dblclick",6),d.add(this),y.set(this,[]),k.set(this,!1),v.set(this,0),g.set(this,0),b.set(this,[]),x.set(this,n()),w.set(this,(t=>{const e=t.clientX-$(this,v,"f"),i=t.clientY-$(this,g,"f");this.rootElement.scrollTop-=i,this.rootElement.scrollLeft-=e,B(this,v,t.clientX,"f"),B(this,g,t.clientY,"f")})),j.set(this,!1),C.set(this,null),this.autofitOnExpand=!0,this.autofitOnLoad=!0,this.cardData=null,this.collapsible=!0,this.customStyle="",this.data=null,this.layout=null,this.stackedLeaves=!1}async collapseAll(t=this.data.rows){$(this,x,"f").data.node.setProperties(t,{isExpanded:!1},!0),this.refresh()}async expandAll(t=this.data.rows){$(this,x,"f").data.node.setProperties(t,{isExpanded:!0},!0),this.refresh()}async getProps(t){return m(this,p,t)}async refresh(){i(this)}async runAutofit(){const t=$(this,C,"f").clientWidth,e=$(this,C,"f").children[0].clientWidth,i=.01,a=.85*t,r=.95*t;let l=1,o=2e3,s=e;for(;(s<a||s>r)&&o>0&&l>i;)o--,s<a?l+=i:s>r?l-=i:o=0,s=e*l;$(this,C,"f").style.setProperty("--kup_familytree_scale",l<=1?l.toFixed(2):"1")}async setProps(t){f(this,p,t)}componentWillLoad(){$(this,x,"f").debug.logLoad(this,!1),$(this,x,"f").language.register(this),$(this,x,"f").theme.register(this)}componentDidLoad(){$(this,d,"m",Y).call(this),this.autofitOnLoad&&this.runAutofit(),$(this,x,"f").debug.logLoad(this,!0)}componentWillRender(){$(this,x,"f").debug.logRender(this,!1)}componentDidRender(){$(this,j,"f")&&(B(this,j,!1,"f"),this.runAutofit()),$(this,x,"f").debug.logRender(this,!0)}render(){return a(r,{onDrag:t=>t.preventDefault(),onPointerDown:t=>{t.preventDefault(),$(this,d,"m",O).call(this,t)},onWheel:t=>{$(this,d,"m",H).call(this,t)}},a("style",null,$(this,x,"f").theme.setKupStyle(this.rootElement)),a("div",{id:u},$(this,d,"m",D).call(this)))}disconnectedCallback(){$(this,x,"f").language.unregister(this),$(this,x,"f").theme.unregister(this)}get rootElement(){return l(this)}};y=new WeakMap,k=new WeakMap,v=new WeakMap,g=new WeakMap,b=new WeakMap,x=new WeakMap,w=new WeakMap,j=new WeakMap,C=new WeakMap,d=new WeakSet,E=function(t,e,i,r){const l=[];return l.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--right":!t,"family-tree__line--top":!t}},a("div",{class:"family-tree__line--placeholder"}))),l.push(a("td",{class:{"family-tree__line":!0,"family-tree__line--left":t,"family-tree__line--top":t&&!i||r&&!e}},a("div",{class:"family-tree__line--placeholder"}))),l},T=function t(e){var i;let r=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)):(r||(r=[]),r.push(t))})));const _=this.stackedLeaves&&r&&r.every((t=>!t.children||0==t.children.length)),n=r?2*r.length:1,m={"family-tree__line":!0,"family-tree__line--placeholder":!(!r&&!l),"family-tree__line--vertical":!(!r&&!l)},f={columns:[{name:"*TREECOL",title:"Fake column",visible:!1},...this.data.columns],rows:[{cells:Object.assign({"*TREECOL":e},e.cells)}]},c=e.layout||this.layout||1,u={icon:e.isExpanded?"remove":"plus",shaped:!0,slim:!0,styling:s.OUTLINED,title:`${$(this,x,"f").language.translate(h.EXPAND)}/${$(this,x,"f").language.translate(h.COLLAPSE)} (CTRL + Click)`,onClick:t=>{t.ctrlKey&&e.children&&e.children.length>0&&(e.isExpanded?this.collapseAll(e.children):this.expandAll(e.children)),e.isExpanded=!e.isExpanded,this.autofitOnExpand&&B(this,j,!0,"f"),this.refresh()},wrapperClass:"family-tree__item__expand"};let p=null;$(this,d,"m",L).call(this,c)&&(p=a("kup-box",{class:"kup-borderless kup-paddingless",customStyle:"#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }",data:f,cardData:this.cardData,layout:this.cardData?null:c,showSelection:!1}));const y=a("div",{class:"family-tree__item"},a("div",{class:"family-tree__item__wrapper"},$(this,d,"m",L).call(this,c)?p:$(this,d,"m",W).call(this,e,c),this.collapsible&&e.children&&e.children.length>0?a(o,Object.assign({},u)):void 0)),k={"--kup_familytree_staffchildren":(null==l?void 0:l.length.toString())||"0"};return a("table",{class:{"family-tree__node":!0,"family-tree__node--stacked":this.stackedLeaves&&!e.isStaff&&(!e.children||0==e.children.length)}},a("tr",null,a("td",{"data-row":e,colSpan:n},y)),a("tr",null,a("td",{colSpan:n},a("div",{class:m}))),l?[a("tr",null,a("td",{colSpan:n},a("div",{class:Object.assign(Object.assign({},m),{"family-tree__line--staff":!0}),style:k}),a("div",{class:"family-tree__node__staff",style:k},l.map((e=>[a("div",{class:"family-tree__node__staff__item"},$(this,d,"m",t).call(this,e))])))))]:null,l&&r?[a("tr",null,a("td",{colSpan:n},a("div",{class:m})))]:null,r?[a("tr",null,_?a("td",{colSpan:n},a("div",{class:m})):r.map((t=>$(this,d,"m",E).call(this,0==r.indexOf(t),r.indexOf(t)==r.length-1,1==r.length,r.length>2)))),a("tr",null,_?a("td",{colSpan:n},r.map((e=>$(this,d,"m",t).call(this,e)))):r.map((e=>a("td",{colSpan:2},$(this,d,"m",t).call(this,e)))))]:void 0)},W=function(t,e){return 2===e?$(this,d,"m",S).call(this,t):$(this,d,"m",M).call(this,t)},M=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--1"},a("div",{class:"family-tree__item__layout__text__title"},t.value))},S=function(t){return a("div",{class:"family-tree__item__layout family-tree__item__layout--2"},a("div",{class:"family-tree__item__layout__color"}),a("div",{class:"family-tree__item__layout__image"},a(_,{resource:t.icon,sizeX:"48px",sizeY:"48px"})),a("div",{class:"family-tree__item__layout__text"},a("div",{class:"family-tree__item__layout__text__title"},t.value),t.title?a("div",{class:"family-tree__item__layout__text__subtitle"},t.title):null))},z=function(t){return t.map((t=>$(this,d,"m",T).call(this,t)))},D=function(){return a("div",{class:"family-tree",onContextMenu:t=>{t.preventDefault()},ref:t=>B(this,C,t,"f")},this.data&&this.data.rows&&this.data.rows.length?$(this,d,"m",z).call(this,this.data.rows):a("div",null,$(this,x,"f").language.translate(h.EMPTY_DATA)))},L=function(t){return!!this.cardData||t&&t.sections&&t.sections.length>0},O=function(t){B(this,v,t.clientX,"f"),B(this,g,t.clientY,"f"),$(this,C,"f").classList.add("family-tree--dragging");const e=()=>{document.removeEventListener("pointermove",$(this,w,"f")),document.removeEventListener("pointerup",e),$(this,C,"f").classList.remove("family-tree--dragging")};document.addEventListener("pointermove",$(this,w,"f")),document.addEventListener("pointerup",e)},P=function(t){const e=[];for(;t&&t!==this.rootElement&&t!==document.body;)e.push(t),t=t.parentNode?t.parentNode:t.host;return e},R=function(t,e){let i,a;if(t)for(let e=t.length-1;e>=0;e--){const r=t[e];r.tagName&&(r.classList.contains("family-tree__item__expand")&&(i=r),"TD"===r.tagName.toUpperCase())&&(a=r)}let r=null,l=null,o=null;return a&&(r=a["data-cell"],l=a["data-column"],o=a["data-row"]),{cell:r||null,column:l||null,expandButton:i||null,originalEvent:e,row:o||null,td:a||null}},A=function(t){return $(this,d,"m",R).call(this,$(this,d,"m",P).call(this,t.target),t)},F=function(t){return $(this,d,"m",R).call(this,$(this,d,"m",P).call(this,t.target),t)},X=function(t){return $(this,d,"m",R).call(this,$(this,d,"m",P).call(this,t.target),t)},Y=function(){$(this,b,"f").push(this.rootElement),$(this,x,"f").interact.on(this.rootElement,c.TAP,(t=>{if($(this,k,"f"))B(this,k,!1,"f");else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];$(this,y,"f").push(setTimeout((()=>{this.kupClick.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",A).call(this,e)})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",F).call(this,t)})}})),$(this,x,"f").interact.on(this.rootElement,c.DOUBLETAP,(t=>{if(0===t.button){for(let t=0;t<$(this,y,"f").length;t++)clearTimeout($(this,y,"f")[t]),$(this,x,"f").debug.logMessage(this,"Cleared clickHandler timeout("+$(this,y,"f")[t]+").");B(this,y,[],"f"),this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",X).call(this,t)})}})),$(this,x,"f").interact.on(this.rootElement,c.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||(B(this,k,!0,"f"),this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:$(this,d,"m",F).call(this,t)}))}))},H=function(t){if(t.ctrlKey){t.preventDefault();const e=parseFloat($(this,C,"f").style.getPropertyValue("--kup_familytree_scale"))||1,i=.05;let a=t.deltaY>0?e-i:e+i;a<i&&(a=i),$(this,C,"f").style.setProperty("--kup_familytree_scale",a.toFixed(2))}},N.style=':host{--kup_familytree_item_background_color:var(\n --kup-familytree-item-background-color,\n var(--kup-background-color)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 80px);--kup_familytree_item_h_padding:var(--kup-familytree-item-h-padding, 8px);--kup_familytree_item_v_padding:var(--kup-familytree-item-v-padding, 10px);--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-color)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc( ( var(--kup_familytree_item_width) + (var(--kup_familytree_item_h_padding) * 2) ) / 2 )) translateY(calc( 0px - ( var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * (var(--kup_familytree_item_v_padding) * 2) ) ))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:"";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc( var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * (var(--kup_familytree_item_v_padding) * 2) )}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);border:1px solid var(--kup_familytree_lines_color);border-radius:8px;box-sizing:border-box;display:flex;height:var(--kup_familytree_item_height);margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup-secondary-color);border-bottom-left-radius:8px;border-top-left-radius:8px;height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto 10px}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';export{N as kup_family_tree}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,c as o,f as t,h as e,H as a,g as i}from"./p-
|
|
1
|
+
import{r,c as o,f as t,h as e,H as a,g as i}from"./p-9dcfbb1e.js";import{k as s,g as p,s as d}from"./p-b63a5a44.js";import{c as n}from"./p-97e8ea42.js";const c="drawer";var u;!function(r){r.customStyle="Custom style of the component.",r.opened="Defaults at false. When set to true, the drawer appears."}(u||(u={}));const l=class{constructor(t){r(this,t),this.kupDrawerClose=o(this,"kup-drawer-close",6),this.kupDrawerOpen=o(this,"kup-drawer-open",6),this.kupDrawerReady=o(this,"kup-drawer-ready",6),this.kupManager=s(),this.opened=!1,this.customStyle=""}async close(){this.opened=!1,this.kupDrawerClose.emit({comp:this,id:this.rootElement.id})}async getProps(r){return p(this,u,r)}async isOpened(){return this.opened}async open(){this.opened=!0,this.kupDrawerOpen.emit({comp:this,id:this.rootElement.id})}async refresh(){t(this)}async setProps(r){d(this,u,r)}async toggle(){this.opened?this.close():this.open()}content(){const r=[],o=Array.prototype.slice.call(this.rootElement.children,0),t=[];for(let t=0;t<o.length;t++)r.push(e("slot",null));return t.push(e("div",{class:`${c}__content`},r)),t}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.kupDrawerReady.emit({comp:this,id:this.rootElement.id}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){return e(a,{"kup-opened":this.opened},e("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{class:"backdrop",onClick:r=>{r.preventDefault(),r.stopPropagation()},onPointerDown:r=>{r.preventDefault(),r.stopPropagation(),this.close()},onTouchStart:r=>{r.preventDefault(),r.stopPropagation()}}),e("div",{id:n},e("div",{class:c},this.content())))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return i(this)}};l.style=":host{--kup_drawer_backdrop:var(--kup-drawer-backdrop, rgba(0, 0, 0, 0.32));--kup_drawer_box_shadow:var(\n --kup-drawer-box-shadow,\n 0 8px 10px -5px rgba(0, 0, 0, 0.2),\n 0 16px 24px 2px rgba(0, 0, 0, 0.14),\n 0 6px 30px 5px rgba(0, 0, 0, 0.12)\n );--kup_drawer_permanent_border:var(\n --kup-drawer-permanent-border,\n 1px solid var(--kup-border-color)\n );--kup_drawer_slide_transition:var(--kup-drawer-slide-transition, 750ms);--kup_drawer_transition:var(--kup-drawer-transition, 250ms);box-shadow:var(--kup_drawer_box_shadow);display:block;font-size:var(--kup-font-size);height:100vh;left:calc(var(--kup-drawer-width) * -1);position:fixed;top:0;transition:left var(--kup_drawer_slide_transition) cubic-bezier(0.4, 0, 0.2, 1), right var(--kup_drawer_slide_transition) cubic-bezier(0.4, 0, 0.2, 1);width:var(--kup-drawer-width);z-index:var(--kup-drawer-zindex)}#kup-component{height:100%;width:100%}.backdrop{background:var(--kup_drawer_backdrop);display:none;height:100%;left:0;position:fixed;top:0;width:100%;z-index:var(--kup-drawer-zindex)}.drawer{height:100%;position:fixed;width:var(--kup-drawer-width);z-index:calc(var(--kup-drawer-zindex) + 1)}.drawer__content{background-color:var(--kup-drawer-background-color);box-sizing:border-box;height:100%;overflow-y:auto;width:100%}.drawer ::slotted(*){--kup-button-primary-color:var(--kup-drawer-color);--kup-button-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-button-primary-color-h:var(--kup-drawer-color-h);--kup-button-primary-color-s:var(--kup-drawer-color-s);--kup-button-primary-color-l:var(--kup-drawer-color-l);--kup-switch-label-color:var(--kup-drawer-color);--kup-switch-primary-color:var(--kup-drawer-color);--kup-switch-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-textfield-color:var(--kup-drawer-color);--kup-textfield-color-rgb:var(--kup-drawer-color-rgb);--kup-textfield-primary-color:var(--kup-drawer-color);--kup-textfield-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-tree-color:var(--kup-drawer-color);--kup-tree-color-rgb:var(--kup-drawer-color-rgb);--kup-tree-filter-background-color:var(--kup-drawer-background-color);--kup-tree-icon-color:var(--kup-drawer-color);color:var(--kup-drawer-color);fill:var(--kup-drawer-color)}:host([kup-opened]){left:0}:host([kup-opened]) .backdrop{display:block}:host(.kup-right){left:unset;right:-100%}:host([kup-opened].kup-right){right:0}:host(.kup-permanent){box-shadow:unset;transition:all 250ms}:host(.kup-permanent) .backdrop{display:none}:host(.kup-permanent) .drawer{position:relative}:host(.kup-permanent) .drawer__content{border-right:var(--kup_drawer_permanent_border)}";export{l as kup_drawer}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as c}from"./p-
|
|
1
|
+
import{h as c}from"./p-9dcfbb1e.js";import{F as i}from"./p-a7ae0b4d.js";import{K as s,l as e,b as n}from"./p-b63a5a44.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 +1 @@
|
|
|
1
|
-
import{r as t,c as e,f as i,h as o,H as s,g as r}from"./p-
|
|
1
|
+
import{r as t,c as e,f as i,h as o,H as s,g as r}from"./p-9dcfbb1e.js";import{k as a,g as h,s as n}from"./p-b63a5a44.js";import{c as p}from"./p-97e8ea42.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,2 +1,2 @@
|
|
|
1
|
-
let e,t,n=!1,l=!1;const o=e=>{const t=new URL(e,
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},le=new Map,oe="undefined"!=typeof window?window:{},se=oe.document||{head:{}},ie=
|
|
1
|
+
let e,t,n=!1,l=!1;const o=e=>{const t=new URL(e,ie.t);return t.origin!==oe.location.origin?t.href:t.pathname},s=e=>ie.t=e,i="http://www.w3.org/1999/xlink",c={},r=e=>"object"==(e=typeof e)||"function"===e;function u(e){var t,n,l;return null!==(l=null===(n=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==l?l:void 0}const a=(e,t,...n)=>{let l=null,o=null,s=!1,i=!1;const c=[],u=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!r(l))&&(l+=""),s&&i?c[c.length-1].l+=l:c.push(s?f(null,l):l),i=s)};if(u(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,c,p);const a=f(e,null);return a.o=t,c.length>0&&(a.i=c),a.u=o,a},f=(e,t)=>({p:0,h:e,l:t,m:null,i:null,o:null,u:null}),d={},p={forEach:(e,t)=>e.map(h).forEach(t),map:(e,t)=>e.map(h).map(t).map(m)},h=e=>({vattrs:e.o,vchildren:e.i,vkey:e.u,vname:e.$,vtag:e.h,vtext:e.l}),m=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),a(e.vtag,t,...e.vchildren||[])}const t=f(e.vtag,e.vtext);return t.o=e.vattrs,t.i=e.vchildren,t.u=e.vkey,t.$=e.vname,t},y=e=>Q(e).v,$=(e,t,n)=>{const l=y(e);return{emit:e=>w(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},w=(e,t,n)=>{const l=ie.ce(t,n);return e.dispatchEvent(l),l},b=new WeakMap,v=e=>"sc-"+e.g,g=(e,t,n,l,o,s)=>{if(n!==l){let c=Z(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,o=k(n),s=k(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(c||"o"!==t[0]||"n"!==t[1]){const a=r(l);if((c||a&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?c=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}let f=!1;u!==(u=u.replace(/^xlink\:?/,""))&&(t=u,f=!0),null==l||!1===l?!1===l&&""!==e.getAttribute(t)||(f?e.removeAttributeNS(i,t):e.removeAttribute(t)):(!c||4&s||o)&&!a&&(l=!0===l?"":l,f?e.setAttributeNS(i,t,l):e.setAttribute(t,l))}else t="-"===t[2]?t.slice(3):Z(oe,u)?u.slice(2):u[2]+t.slice(3),n&&ie.rel(e,t,n,!1),l&&ie.ael(e,t,l,!1)}},j=/\s/,k=e=>e?e.split(j):[],S=(e,t,n,l)=>{const o=11===t.m.nodeType&&t.m.host?t.m.host:t.m,s=e&&e.o||c,i=t.o||c;for(l in s)l in i||g(o,l,s[l],void 0,n,t.p);for(l in i)g(o,l,s[l],i[l],n,t.p)},O=(t,l,o)=>{const s=l.i[o];let i,c,r=0;if(null!==s.l)i=s.m=se.createTextNode(s.l);else{if(n||(n="svg"===s.h),i=s.m=se.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s.h),n&&"foreignObject"===s.h&&(n=!1),S(null,s,n),null!=e&&i["s-si"]!==e&&i.classList.add(i["s-si"]=e),s.i)for(r=0;r<s.i.length;++r)c=O(t,s,r),c&&i.appendChild(c);"svg"===s.h?n=!1:"foreignObject"===i.tagName&&(n=!0)}return i},M=(e,n,l,o,s,i)=>{let c,r=e;for(r.shadowRoot&&r.tagName===t&&(r=r.shadowRoot);s<=i;++s)o[s]&&(c=O(null,l,s),c&&(o[s].m=c,r.insertBefore(c,n)))},x=(e,t,n,l,o)=>{for(;t<=n;++t)(l=e[t])&&(o=l.m,P(l),o.remove())},C=(e,t)=>e.h===t.h&&e.u===t.u,L=(e,t)=>{const l=t.m=e.m,o=e.i,s=t.i,i=t.h,c=t.l;null===c?(n="svg"===i||"foreignObject"!==i&&n,"slot"===i||S(e,t,n),null!==o&&null!==s?((e,t,n,l)=>{let o,s,i=0,c=0,r=0,u=0,a=t.length-1,f=t[0],d=t[a],p=l.length-1,h=l[0],m=l[p];for(;i<=a&&c<=p;)if(null==f)f=t[++i];else if(null==d)d=t[--a];else if(null==h)h=l[++c];else if(null==m)m=l[--p];else if(C(f,h))L(f,h),f=t[++i],h=l[++c];else if(C(d,m))L(d,m),d=t[--a],m=l[--p];else if(C(f,m))L(f,m),e.insertBefore(f.m,d.m.nextSibling),f=t[++i],m=l[--p];else if(C(d,h))L(d,h),e.insertBefore(d.m,f.m),d=t[--a],h=l[++c];else{for(r=-1,u=i;u<=a;++u)if(t[u]&&null!==t[u].u&&t[u].u===h.u){r=u;break}r>=0?(s=t[r],s.h!==h.h?o=O(t&&t[c],n,r):(L(s,h),t[r]=void 0,o=s.m),h=l[++c]):(o=O(t&&t[c],n,c),h=l[++c]),o&&f.m.parentNode.insertBefore(o,f.m)}i>a?M(e,null==l[p+1]?null:l[p+1].m,n,l,c,p):c>p&&x(t,i,a)})(l,o,t,s):null!==s?(null!==e.l&&(l.textContent=""),M(l,null,t,s,0,s.length-1)):null!==o&&x(o,0,o.length-1),n&&"svg"===i&&(n=!1)):e.l!==c&&(l.data=c)},P=e=>{e.o&&e.o.ref&&e.o.ref(null),e.i&&e.i.map(P)},R=(e,t)=>{t&&!e.j&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.j=t)))},U=(e,t)=>{if(e.p|=16,!(4&e.p))return R(e,e.k),me((()=>W(e,t)));e.p|=512},W=(e,t)=>{const n=e.S;let l;return t?(e.p|=256,e.O&&(e.O.map((([e,t])=>F(n,e,t))),e.O=null),l=F(n,"componentWillLoad")):l=F(n,"componentWillUpdate"),l=H(l,(()=>F(n,"componentWillRender"))),H(l,(()=>E(e,n,t)))},E=async(e,t,n)=>{const l=e.v,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.v,l=t.p,o=((e,t)=>{var n;let l=v(t);const o=le.get(l);if(e=11===e.nodeType?e:se,o)if("string"==typeof o){let t,s=b.get(e=e.head||e);if(s||b.set(e,s=new Set),!s.has(l)){{t=se.createElement("style"),t.innerHTML=o;const l=null!==(n=ie.C)&&void 0!==n?n:u(se);null!=l&&t.setAttribute("nonce",l),e.insertBefore(t,e.querySelector("link"))}s&&s.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);D(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>N(e);0===t.length?n():(Promise.all(t).then(n),e.p|=4,t.length=0)}},D=(n,l)=>{try{l=l.render(),n.p&=-17,n.p|=2,((n,l)=>{const o=n.v,s=n.M,i=n.L||f(null,null),c=(e=>e&&e.h===d)(l)?l:a(null,null,l);t=o.tagName,s.P&&(c.o=c.o||{},s.P.map((([e,t])=>c.o[t]=o[e]))),c.h=null,c.p|=4,n.L=c,c.m=i.m=o.shadowRoot||o,e=o["s-sc"],L(i,c)})(n,l)}catch(e){ee(e,n.v)}return null},N=e=>{const t=e.v,n=e.S,l=e.k;F(n,"componentDidRender"),64&e.p?F(n,"componentDidUpdate"):(e.p|=64,q(t),F(n,"componentDidLoad"),e.R(t),l||A()),e.U(t),e.j&&(e.j(),e.j=void 0),512&e.p&&he((()=>U(e,!1))),e.p&=-517},T=e=>{{const t=Q(e),n=t.v.isConnected;return n&&2==(18&t.p)&&U(t,!1),n}},A=()=>{q(se.documentElement),he((()=>w(oe,"appload",{detail:{namespace:"ketchup"}})))},F=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){ee(e)}},H=(e,t)=>e&&e.then?e.then(t):t(),q=e=>e.classList.add("hydrated"),V=(e,t,n)=>{if(t.W){e.watchers&&(t.D=e.watchers);const l=Object.entries(t.W),o=e.prototype;if(l.map((([e,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(o,e,{get(){return((e,t)=>Q(this).N.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=Q(e),s=o.v,i=o.N.get(t),c=o.p,u=o.S;if(n=((e,t)=>null==e||r(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.W[t][0]),(!(8&c)||void 0===i)&&n!==i&&(!Number.isNaN(i)||!Number.isNaN(n))&&(o.N.set(t,n),u)){if(l.D&&128&c){const e=l.D[t];e&&e.map((e=>{try{u[e](n,i,t)}catch(e){ee(e,s)}}))}2==(18&c)&&U(o,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,e,{value(...t){const n=Q(this);return n.T.then((()=>n.S[e](...t)))}})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,l){ie.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(o.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const o=l[1]||e;return n.set(o,e),512&l[0]&&t.P.push([e,o]),o}))}}return e},_=(e,t={})=>{var n;const l=[],o=t.exclude||[],s=oe.customElements,i=se.head,c=i.querySelector("meta[charset]"),r=se.createElement("style"),a=[];let f,d=!0;Object.assign(ie,t),ie.t=new URL(t.resourcesUrl||"./",se.baseURI).href,e.map((e=>{e[1].map((t=>{const n={p:t[0],g:t[1],W:t[2],A:t[3]};n.W=t[2],n.A=t[3],n.P=[],n.D={};const i=n.g,c=class extends HTMLElement{constructor(e){super(e),Y(e=this,n),1&n.p&&e.attachShadow({mode:"open"})}connectedCallback(){f&&(clearTimeout(f),f=null),d?a.push(this):ie.jmp((()=>(e=>{if(0==(1&ie.p)){const t=Q(e),n=t.M,l=()=>{};if(1&t.p)z(e,t,n.A);else{t.p|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){R(t,t.k=n);break}}n.W&&Object.entries(n.W).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,o)=>{if(0==(32&t.p)){{if(t.p|=32,(o=ne(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(n.D=o.watchers,V(o,n,2),o.isProxied=!0);const e=()=>{};t.p|=8;try{new o(t)}catch(e){ee(e)}t.p&=-9,t.p|=128,e()}if(o.style){let e=o.style;const t=v(n);if(!le.has(t)){const l=()=>{};((e,t,n)=>{let l=le.get(e);re&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,le.set(e,l)})(t,e,!!(1&n.p)),l()}}}const s=t.k,i=()=>U(t,!0);s&&s["s-rc"]?s["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){ie.jmp((()=>(()=>{if(0==(1&ie.p)){const e=Q(this),t=e.S;e.F&&(e.F.map((e=>e())),e.F=void 0),F(t,"disconnectedCallback")}})()))}componentOnReady(){return Q(this).H}};n.q=e[0],o.includes(i)||s.get(i)||(l.push(i),s.define(i,V(c,n,1)))}))}));{r.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",r.setAttribute("data-styles","");const e=null!==(n=ie.C)&&void 0!==n?n:u(se);null!=e&&r.setAttribute("nonce",e),i.insertBefore(r,c?c.nextSibling:i.firstChild)}d=!1,a.length?a.map((e=>e.connectedCallback())):ie.jmp((()=>f=setTimeout(A,30)))},z=(e,t,n)=>{n&&n.map((([n,l,o])=>{const s=G(e,n),i=B(t,o),c=I(n);ie.ael(s,l,i,c),(t.F=t.F||[]).push((()=>ie.rel(s,l,i,c)))}))},B=(e,t)=>n=>{try{256&e.p?e.S[t](n):(e.O=e.O||[]).push([t,n])}catch(e){ee(e)}},G=(e,t)=>4&t?se:e,I=e=>0!=(2&e),J=e=>ie.C=e,K=new WeakMap,Q=e=>K.get(e),X=(e,t)=>K.set(t.S=e,t),Y=(e,t)=>{const n={p:0,v:e,M:t,N:new Map};return n.T=new Promise((e=>n.U=e)),n.H=new Promise((e=>n.R=e)),e["s-p"]=[],e["s-rc"]=[],z(e,n,t.A),K.set(e,n)},Z=(e,t)=>t in e,ee=(e,t)=>(0,console.error)(e,t),te=new Map,ne=e=>{const t=e.g.replace(/-/g,"_"),n=e.q,l=te.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(te.set(n,e),e[t])),ee)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},le=new Map,oe="undefined"!=typeof window?window:{},se=oe.document||{head:{}},ie={p:0,t:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},ce=e=>Promise.resolve(e),re=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),ue=[],ae=[],fe=(e,t)=>n=>{e.push(n),l||(l=!0,t&&4&ie.p?he(pe):ie.raf(pe))},de=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){ee(e)}e.length=0},pe=()=>{de(ue),de(ae),(l=ue.length>0)&&ie.raf(pe)},he=e=>ce().then(e),me=fe(ae,!0);export{d as H,o as a,_ as b,$ as c,s as d,T as f,y as g,a as h,ce as p,X as r,J as s}
|