@sme.up/ketchup 11.0.0-SNAPSHOT-20241105144724 → 11.0.0-SNAPSHOT-20241107091530
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-cell-ccde7158.js → f-cell-32c25f65.js} +4 -4
- package/dist/cjs/{f-cell-ccde7158.js.map → f-cell-32c25f65.js.map} +1 -1
- package/dist/cjs/{f-chip-dbe137ed.js → f-chip-3118b9ba.js} +2 -2
- package/dist/cjs/{f-chip-dbe137ed.js.map → f-chip-3118b9ba.js.map} +1 -1
- package/dist/cjs/{f-paginator-utils-4cf8ac1e.js → f-paginator-utils-3099b4b3.js} +2 -2
- package/dist/cjs/{f-paginator-utils-4cf8ac1e.js.map → f-paginator-utils-3099b4b3.js.map} +1 -1
- package/dist/cjs/{f-text-field-8b373b26.js → f-text-field-1ced2cfa.js} +2 -2
- package/dist/cjs/{f-text-field-8b373b26.js.map → f-text-field-1ced2cfa.js.map} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +1 -1
- package/dist/cjs/kup-activity-timeline.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_28.cjs.entry.js +6 -6
- package/dist/cjs/kup-box.cjs.entry.js +6 -6
- package/dist/cjs/kup-calendar.cjs.entry.js +2 -2
- package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-cell.cjs.entry.js +4 -4
- package/dist/cjs/kup-dashboard.cjs.entry.js +2 -2
- package/dist/cjs/{kup-data-table-helper-bef7a94e.js → kup-data-table-helper-457ee6aa.js} +2 -2
- package/dist/cjs/{kup-data-table-helper-bef7a94e.js.map → kup-data-table-helper-457ee6aa.js.map} +1 -1
- package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kup-echart.cjs.entry.js +1 -1
- package/dist/cjs/kup-editor.cjs.entry.js +1 -1
- package/dist/cjs/kup-family-tree.cjs.entry.js +1 -1
- package/dist/cjs/kup-grid.cjs.entry.js +1 -1
- package/dist/cjs/kup-htm.cjs.entry.js +1 -1
- package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
- package/dist/cjs/kup-image-list.cjs.entry.js +4 -4
- package/dist/cjs/kup-input-panel.cjs.entry.js +12 -6
- package/dist/cjs/kup-input-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
- package/dist/cjs/kup-magic-box.cjs.entry.js +1 -1
- package/dist/cjs/{kup-manager-6e414e08.js → kup-manager-65839aad.js} +3 -3
- package/dist/cjs/{kup-manager-6e414e08.js.map → kup-manager-65839aad.js.map} +1 -1
- package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
- package/dist/cjs/kup-pdf.cjs.entry.js +1 -1
- package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
- package/dist/cjs/kup-planner.cjs.entry.js +2 -2
- package/dist/cjs/kup-probe.cjs.entry.js +1 -1
- package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
- package/dist/cjs/kup-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/kup-typography-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-typography.cjs.entry.js +1 -1
- package/dist/collection/components/kup-input-panel/kup-input-panel.js +8 -2
- package/dist/collection/components/kup-input-panel/kup-input-panel.js.map +1 -1
- package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js +1 -1
- package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js.map +1 -1
- package/dist/collection/managers/kup-interact/kup-interact.js +1 -1
- package/dist/collection/managers/kup-interact/kup-interact.js.map +1 -1
- package/dist/components/kup-input-panel.js +8 -2
- package/dist/components/kup-input-panel.js.map +1 -1
- package/dist/components/kup-manager.js +2 -2
- package/dist/components/kup-manager.js.map +1 -1
- package/dist/esm/{f-cell-e6b53a87.js → f-cell-678a99c3.js} +4 -4
- package/dist/esm/{f-cell-e6b53a87.js.map → f-cell-678a99c3.js.map} +1 -1
- package/dist/esm/{f-chip-ebf776f3.js → f-chip-b0b7b121.js} +2 -2
- package/dist/esm/{f-chip-ebf776f3.js.map → f-chip-b0b7b121.js.map} +1 -1
- package/dist/esm/{f-paginator-utils-2aac0d1a.js → f-paginator-utils-56f66406.js} +2 -2
- package/dist/esm/{f-paginator-utils-2aac0d1a.js.map → f-paginator-utils-56f66406.js.map} +1 -1
- package/dist/esm/{f-text-field-ca6c5386.js → f-text-field-73c20614.js} +2 -2
- package/dist/esm/{f-text-field-ca6c5386.js.map → f-text-field-73c20614.js.map} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/kup-accordion.entry.js +1 -1
- package/dist/esm/kup-activity-timeline.entry.js +2 -2
- package/dist/esm/kup-autocomplete_28.entry.js +6 -6
- package/dist/esm/kup-box.entry.js +6 -6
- package/dist/esm/kup-calendar.entry.js +2 -2
- package/dist/esm/kup-card-list.entry.js +1 -1
- package/dist/esm/kup-cell.entry.js +4 -4
- package/dist/esm/kup-dashboard.entry.js +2 -2
- package/dist/esm/{kup-data-table-helper-2ff0b12a.js → kup-data-table-helper-1333a2f8.js} +2 -2
- package/dist/esm/{kup-data-table-helper-2ff0b12a.js.map → kup-data-table-helper-1333a2f8.js.map} +1 -1
- package/dist/esm/kup-drawer.entry.js +1 -1
- package/dist/esm/kup-echart.entry.js +1 -1
- package/dist/esm/kup-editor.entry.js +1 -1
- package/dist/esm/kup-family-tree.entry.js +1 -1
- package/dist/esm/kup-grid.entry.js +1 -1
- package/dist/esm/kup-htm.entry.js +1 -1
- package/dist/esm/kup-iframe.entry.js +1 -1
- package/dist/esm/kup-image-list.entry.js +4 -4
- package/dist/esm/kup-input-panel.entry.js +12 -6
- package/dist/esm/kup-input-panel.entry.js.map +1 -1
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +1 -1
- package/dist/esm/{kup-manager-1d6b8b1a.js → kup-manager-c6f89439.js} +3 -3
- package/dist/esm/{kup-manager-1d6b8b1a.js.map → kup-manager-c6f89439.js.map} +1 -1
- package/dist/esm/kup-nav-bar.entry.js +1 -1
- package/dist/esm/kup-numeric-picker.entry.js +2 -2
- package/dist/esm/kup-pdf.entry.js +1 -1
- package/dist/esm/kup-photo-frame.entry.js +1 -1
- package/dist/esm/kup-planner.entry.js +2 -2
- package/dist/esm/kup-probe.entry.js +1 -1
- package/dist/esm/kup-qlik.entry.js +1 -1
- package/dist/esm/kup-snackbar.entry.js +1 -1
- package/dist/esm/kup-typography-list.entry.js +1 -1
- package/dist/esm/kup-typography.entry.js +1 -1
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-a3ace76e.entry.js → p-00286291.entry.js} +2 -2
- package/dist/ketchup/{p-cc901eb3.entry.js → p-07e7fade.entry.js} +2 -2
- package/dist/ketchup/{p-f607dc0d.entry.js → p-0efc24e7.entry.js} +2 -2
- package/dist/ketchup/p-197aa6ed.entry.js +2 -0
- package/dist/ketchup/{p-853e2b1d.entry.js.map → p-197aa6ed.entry.js.map} +1 -1
- package/dist/ketchup/{p-196f3059.entry.js → p-256ca361.entry.js} +2 -2
- package/dist/ketchup/{p-a16707d1.js → p-2b14f215.js} +2 -2
- package/dist/ketchup/{p-2389ccc1.entry.js → p-31d98241.entry.js} +2 -2
- package/dist/ketchup/{p-8e844b9d.entry.js → p-3e9957c1.entry.js} +2 -2
- package/dist/ketchup/{p-16e93198.entry.js → p-42ea84f3.entry.js} +2 -2
- package/dist/ketchup/{p-7d7b8718.js → p-49485bbf.js} +2 -2
- package/dist/ketchup/{p-25345be4.entry.js → p-4d6644f0.entry.js} +2 -2
- package/dist/ketchup/{p-25345be4.entry.js.map → p-4d6644f0.entry.js.map} +1 -1
- package/dist/ketchup/{p-587e12b4.entry.js → p-5184497b.entry.js} +2 -2
- package/dist/ketchup/{p-67763e23.entry.js → p-634b3510.entry.js} +2 -2
- package/dist/ketchup/{p-d6243c07.entry.js → p-65780ddc.entry.js} +2 -2
- package/dist/ketchup/{p-7cdceaea.entry.js → p-69ada7f9.entry.js} +2 -2
- package/dist/ketchup/{p-23e745f1.entry.js → p-6e4b8f6d.entry.js} +2 -2
- package/dist/ketchup/{p-d5325eb6.entry.js → p-784120c9.entry.js} +2 -2
- package/dist/ketchup/{p-c4ae346f.entry.js → p-7f762e33.entry.js} +2 -2
- package/dist/ketchup/{p-fe31a004.js → p-9b0551b5.js} +2 -2
- package/dist/ketchup/{p-b0ca996f.entry.js → p-a3b1896e.entry.js} +2 -2
- package/dist/ketchup/{p-0b4f6874.entry.js → p-a496ba6a.entry.js} +2 -2
- package/dist/ketchup/{p-62596f5d.entry.js → p-b05c0af5.entry.js} +2 -2
- package/dist/ketchup/{p-9da57972.entry.js → p-b947f411.entry.js} +2 -2
- package/dist/ketchup/{p-deb86dcb.entry.js → p-d1fc3c35.entry.js} +2 -2
- package/dist/ketchup/{p-e9388650.js → p-d336255f.js} +2 -2
- package/dist/ketchup/{p-bbc10d85.entry.js → p-dd816cfe.entry.js} +2 -2
- package/dist/ketchup/{p-f59fb7d0.entry.js → p-ddc78c64.entry.js} +2 -2
- package/dist/ketchup/{p-18481eec.entry.js → p-dfaaabb5.entry.js} +2 -2
- package/dist/ketchup/{p-affd9a2c.entry.js → p-e34f8755.entry.js} +2 -2
- package/dist/ketchup/{p-192c022f.entry.js → p-e545ca7b.entry.js} +2 -2
- package/dist/ketchup/p-e9985f62.js +2 -0
- package/dist/ketchup/{p-e036c5cd.entry.js → p-ebdf1442.entry.js} +2 -2
- package/dist/ketchup/{p-8ab1203f.entry.js → p-f073ce49.entry.js} +2 -2
- package/dist/ketchup/{p-607b83f5.entry.js → p-f8fe5435.entry.js} +2 -2
- package/dist/ketchup/p-f98dc5f6.js +29 -0
- package/dist/ketchup/{p-86b6489e.js.map → p-f98dc5f6.js.map} +1 -1
- package/package.json +1 -1
- package/dist/ketchup/p-853e2b1d.entry.js +0 -2
- package/dist/ketchup/p-86b6489e.js +0 -29
- package/dist/ketchup/p-f3f54269.js +0 -2
- /package/dist/ketchup/{p-a3ace76e.entry.js.map → p-00286291.entry.js.map} +0 -0
- /package/dist/ketchup/{p-cc901eb3.entry.js.map → p-07e7fade.entry.js.map} +0 -0
- /package/dist/ketchup/{p-f607dc0d.entry.js.map → p-0efc24e7.entry.js.map} +0 -0
- /package/dist/ketchup/{p-196f3059.entry.js.map → p-256ca361.entry.js.map} +0 -0
- /package/dist/ketchup/{p-a16707d1.js.map → p-2b14f215.js.map} +0 -0
- /package/dist/ketchup/{p-2389ccc1.entry.js.map → p-31d98241.entry.js.map} +0 -0
- /package/dist/ketchup/{p-8e844b9d.entry.js.map → p-3e9957c1.entry.js.map} +0 -0
- /package/dist/ketchup/{p-16e93198.entry.js.map → p-42ea84f3.entry.js.map} +0 -0
- /package/dist/ketchup/{p-7d7b8718.js.map → p-49485bbf.js.map} +0 -0
- /package/dist/ketchup/{p-587e12b4.entry.js.map → p-5184497b.entry.js.map} +0 -0
- /package/dist/ketchup/{p-67763e23.entry.js.map → p-634b3510.entry.js.map} +0 -0
- /package/dist/ketchup/{p-d6243c07.entry.js.map → p-65780ddc.entry.js.map} +0 -0
- /package/dist/ketchup/{p-7cdceaea.entry.js.map → p-69ada7f9.entry.js.map} +0 -0
- /package/dist/ketchup/{p-23e745f1.entry.js.map → p-6e4b8f6d.entry.js.map} +0 -0
- /package/dist/ketchup/{p-d5325eb6.entry.js.map → p-784120c9.entry.js.map} +0 -0
- /package/dist/ketchup/{p-c4ae346f.entry.js.map → p-7f762e33.entry.js.map} +0 -0
- /package/dist/ketchup/{p-fe31a004.js.map → p-9b0551b5.js.map} +0 -0
- /package/dist/ketchup/{p-b0ca996f.entry.js.map → p-a3b1896e.entry.js.map} +0 -0
- /package/dist/ketchup/{p-0b4f6874.entry.js.map → p-a496ba6a.entry.js.map} +0 -0
- /package/dist/ketchup/{p-62596f5d.entry.js.map → p-b05c0af5.entry.js.map} +0 -0
- /package/dist/ketchup/{p-9da57972.entry.js.map → p-b947f411.entry.js.map} +0 -0
- /package/dist/ketchup/{p-deb86dcb.entry.js.map → p-d1fc3c35.entry.js.map} +0 -0
- /package/dist/ketchup/{p-e9388650.js.map → p-d336255f.js.map} +0 -0
- /package/dist/ketchup/{p-bbc10d85.entry.js.map → p-dd816cfe.entry.js.map} +0 -0
- /package/dist/ketchup/{p-f59fb7d0.entry.js.map → p-ddc78c64.entry.js.map} +0 -0
- /package/dist/ketchup/{p-18481eec.entry.js.map → p-dfaaabb5.entry.js.map} +0 -0
- /package/dist/ketchup/{p-affd9a2c.entry.js.map → p-e34f8755.entry.js.map} +0 -0
- /package/dist/ketchup/{p-192c022f.entry.js.map → p-e545ca7b.entry.js.map} +0 -0
- /package/dist/ketchup/{p-f3f54269.js.map → p-e9985f62.js.map} +0 -0
- /package/dist/ketchup/{p-e036c5cd.entry.js.map → p-ebdf1442.entry.js.map} +0 -0
- /package/dist/ketchup/{p-8ab1203f.entry.js.map → p-f073ce49.entry.js.map} +0 -0
- /package/dist/ketchup/{p-607b83f5.entry.js.map → p-f8fe5435.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a8 as e,a9 as t,d as s,a5 as n,aa as i,ab as c,ac as a,F as l,ad as o,ae as r,af as u,ag as d,ah as f,e as p}from"./p-86b6489e.js";import{h as b,g as k,F as h}from"./p-d7c15b0e.js";import{F as v}from"./p-5d03c077.js";import{F as m}from"./p-fe31a004.js";import{F as g}from"./p-2b519589.js";import{F as w,c as j}from"./p-a16707d1.js";import{F as O}from"./p-cc32b7a2.js";var y;(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."})(y||(y={}));var $;(function(e){e["LISTBOX"]="listbox";e["RADIOGROUP"]="radiogroup";e["GROUP"]="group"})($||($={}));var x;(function(e){e["CODE"]="code";e["DESCRIPTION"]="description";e["DESCRIPTION_AND_CODE"]="both"})(x||(x={}));var _;(function(e){e["SMALL"]="small";e["MEDIUM"]="medium"})(_||(_={}));const I=e=>{if(!e.sizing){e.sizing=_.MEDIUM}e.sizing.toLowerCase()===_.SMALL;const t={switch:true,"switch--checked":e.checked,"switch--disabled":e.disabled,[`switch--${e.sizing}`]:e.sizing?true:false};return b("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}),b("div",{class:`form-field ${e.leadingLabel?"form-field--align-end":""}`},b("div",{class:t},b("div",{class:"switch__track"}),b("div",{class:"switch__thumb-underlay"},b("div",{class:"switch__thumb"},b("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})))),b("label",{onClick:e.onChange},e.label)))};const C=e=>{if(!e.centeredLabel&&!e.centeredLabel!==false){e.centeredLabel=true}let t=`f-progress-bar ${e.danger?"kup-danger":""} ${e.animated?"kup-animated":""} ${e.padded?"kup-padded":""} ${e.info?"kup-info":""} ${e.slim?"kup-slim":""} ${e.striped?"kup-striped":""} ${e.secondary?"kup-secondary":""} ${e.slim?"kup-slim":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`;let s="pie";let n=undefined;if(e.isRadial){t+=" pie-wrapper is-radial"}else{t+=" progress-bar"}let i=undefined;const c={width:`${e.value}%`};if(!e.centeredLabel){i=c;if(e.value>2){t+=" text-color-on-primary"}}else if(e.value>49){t+=" text-color-on-primary"}let a=null;if(e.icon){a=z(e)}else{if(!e.hideLabel){if(e.isRadial){if(e.label){a=b("span",{class:"label"},e.label)}else{a=b("span",{class:"label"},e.value,b("span",{class:"smaller"},"%"))}}else{if(e.label){a=e.label}else{a=e.value+"%"}}}}if(e.value>0){s+=" has-value";if(e.value>50){s+=" is-more-than-half"}else{s+=" is-less-than-half"}}if(e.isRadial){return b("div",{class:t},a,b("div",{class:s},b("div",{style:n,class:"left-side half-circle"}),b("div",{class:"right-side half-circle"})),b("div",{class:"shadow"}))}else{return b("div",{class:t},b("div",{class:"progress-bar-percentage",style:c},b("span",{style:i},a)))}};function z(e){if(!e.icon){return undefined}if(e.icon.indexOf(".")>-1||e.icon.indexOf("/")>-1||e.icon.indexOf("\\")>-1){return b("span",{class:"label kup-icon is-image"},b("img",{src:e.icon}))}else{let t=`url('${k(`./assets/svg/${e.icon}.svg`)}') no-repeat center`;let s={mask:t,webkitMask:t};return b("span",{style:s,class:"label kup-icon"})}}var N;(function(e){e["RADIO"]="radio";e["CHEVRON"]="chevron"})(N||(N={}));const F=e=>{var t;const s=!!e.columns;const n=[];const i=e.type||N.RADIO;for(let s=0;s<((t=e.data)===null||t===void 0?void 0:t.length);s++){const t=e.data[s];const c={radio:true,"radio--checked":t.checked?true:false,"radio--disabled":e.disabled?true:false,[`radio--${e.type}`]:e.type?true:false};n.push(b("div",{class:`form-field \n ${e.leadingLabel?" form-field--align-end":""} ${e.disabled?"radio--disabled":""}`},b("div",{class:c},i===N.RADIO?b("input",{class:"radio__native-control",type:"radio",name:"radio-element",value:t.value,checked:t.checked,disabled:e.disabled,onBlur:e.onBlur,onChange:e.onChange?e.onChange.bind(e.onChange,s):null,onFocus:e.onFocus}):b(h,null,t.checked?b(g,{resource:"check",sizeX:"14px",sizeY:"14px"}):b(g,{sizeX:"14px",sizeY:"14px",onClick:e.onChange?e.onChange.bind(e.onChange,s):null})),i===N.RADIO&&b("div",{class:"radio__background"},b("div",{class:"radio__outer-circle"}),b("div",{class:"radio__inner-circle"}))),b("label",{htmlFor:"radio-element",onClick:e.onChange?e.onChange.bind(e.onChange,s):null},t.label?t.label:"")))}const c={"--kup_radio_columns":s?`repeat(${e.columns}, 1fr)`:""};return b("div",{class:`f-radio radio-wrapper\n ${s?"radio-wrapper-grid":""} ${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.horizontal?"kup-horizontal":""}`,style:c},n)};const H=e=>{if(!e.maxValue){e.maxValue=5}return b("div",{class:`f-rating ${e.disabled?"disabled":""} ${e.danger?"kup-danger":""} ${e.info?"kup-info":""} ${e.secondary?"kup-secondary":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},D(e))};function D(e){const t=[];for(let s=1;s<=e.maxValue;s++){if(s<=e.value){t.push(b("span",{class:"rating",onClick:e.onClick?e.onClick.bind(e.onClick,s):null},"★"))}else{t.push(b("span",{class:"rating",onClick:e.onClick?e.onClick.bind(e.onClick,s):null},"☆"))}}return t}const T=document.documentElement;const M=(i,c)=>{var a;const l=i.cell;const o=i.column;const u=i.row;const d=i.shape?i.shape:l.shape?l.shape:o.shape?o.shape:null;const p=!T.ketchup.objects.isEmptyKupObj(l.obj);let k=false;if(l.hasOwnProperty("isEditable")){k=l.isEditable}else if(o.hasOwnProperty("isEditable")){k=o.isEditable}k=k&&i.editable;if(l.options){l.data=(a=S(l,o))!==null&&a!==void 0?a:l.data}const h=i.previousValue!==l.value?l.value:"";const v=T.ketchup.data.cell.getType(l,d);const m=Object.assign({},l.data);let w=l.cssClass?l.cssClass:(o===null||o===void 0?void 0:o.cssClass)?o===null||o===void 0?void 0:o.cssClass:"";if(i.component.legacyLook){w+=" monospace c-pre"}const j={"f-cell":true,[r.OBJ]:p?true:false,[v+"-cell"]:true,[i.wrapperClass]:i.wrapperClass?true:false,[i.density]:i.density&&v!==n.BAR?true:false,[w]:w?true:false};let O=h;if(!l.data){ee(v,l)}if(k&&e.includes(v)){O=J(v,j,l,o,i)}else if(l.data&&t.includes(v)){if(i.setSizes){q(v,m,l)}if(!i.renderKup){const e="cell-"+v+" placeholder";O=b("span",{class:e})}else{O=Z(v,j,m,l,u,o,i)}}else{if(i.setSizes){U(v,m,l,i)}O=Q(v,m,O,j,l,o,i)}let y=null;if(!k&&(o.icon||l.icon)&&O){const e={color:`rgba(var(${s.TEXT}-rgb), 0.375)`,resource:l.icon?l.icon:o.icon,placeholderResource:l.placeholderIcon?l.placeholderIcon:o.placeholderIcon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"obj-icon"};y=b(g,Object.assign({},e))}let $=null;if(T.ketchup.debug.isDebug()&&p){$=l.obj.t+"; "+l.obj.p+"; "+l.obj.k+";"}else if(l.title!=null&&l.title.trim()!=""){$=l.title}let x=null;if(l.info){const e=Object.assign({},l.info);if(!e.color){e.color=`var(${s.INFO})`}if(!e.icon){e.icon="info"}const t={color:e.color,resource:e.icon,placeholderResource:e.placeholderIcon,sizeX:"1.25em",sizeY:"1.25em",title:e.message?e.message:"",wrapperClass:"cell-info"};x=b(g,Object.assign({},t))}return b("div",{onKeyUp:e=>te(e,i,v,f.KEYUP),class:j,"kup-get-cell-props":()=>i,ref:e=>l.element=e,style:l.style},b("div",{class:"f-cell__content",style:l.styleContent,title:$},i.cellActionIcon&&b(g,{resource:"more_vert",sizeX:"16px",sizeY:"16px",wrapperClass:`f-cell__iconfunction ${v===n.NUMBER?"left":"right"}`,onClick:i.cellActionIcon.onClick,tabIndex:0}),c&&c.length>0?c:[i.indents,x,y,O]))};const S=(e,t)=>{if(!e){return null}const s=e.options;const i=t.title;const c=e.value;const a=T.ketchup.data.cell.getType(e,e.shape);const l=new Map([[n.BUTTON_LIST,R.bind(undefined)],[n.STRING,Y.bind(undefined)],[n.RADIO,K.bind(undefined)],[n.AUTOCOMPLETE,W.bind(undefined)],[n.COMBOBOX,W.bind(undefined)],[n.CHECKBOX,X.bind(undefined)],[n.OBJECT,V.bind(undefined)],[n.CHIP,E.bind(undefined)]]);const o=l.get(a);return o?o(s,i,c,e):null};const E=(e,t,s,n)=>{const i={data:(e===null||e===void 0?void 0:e.length)?e===null||e===void 0?void 0:e.map((e=>({id:e.id,value:e.id}))):[]};n.data=Object.assign(Object.assign({},n.data),i)};const V=(e,t,s,n,i)=>({data:{initialValue:s||"",label:t||"",value:s||""}});const X=(e,t,s,n)=>Object.assign(Object.assign({},n.data),{checked:s==="on"||s==="1",label:t});const R=(e,t,s,n)=>({data:[Object.assign(Object.assign({},n.data),{icon:n.icon,value:s})]});const Y=(e,t,s,n)=>Object.assign(Object.assign({},n.data),{label:t});const K=(e,t,s,n)=>{const c=i(s,e);n.data=Object.assign(Object.assign({},n.data),c)};const W=(e,t,s,n,i)=>{var a;if(!((a=n.data)===null||a===void 0?void 0:a.data)&&e){const n=c(s,t,[]);n.data["kup-list"].data=A(e,s);return n}};const A=(e,t)=>{const s=L.get(e.type);if(s){return s(e,t)}else{return e.map((e=>({value:e.label,id:e.id,selected:t===e.id})))}};const B=(e,t)=>e.children.map((e=>{var s;return{id:e.content.codice,value:e.content.testo,selected:t===e.content.codice,children:((s=e.children)===null||s===void 0?void 0:s.length)?B(e,t):[]}}));const G=(e,t)=>e.children.map((e=>{var s;return{id:e.obj.k,value:e.value,selected:t===e.obj.k,children:((s=e.children)===null||s===void 0?void 0:s.length)?G(e,t):[]}}));const P=(e,t)=>e.rows.map((e=>{var s;const n=e.fields||e.cells;const[i,c]=Object.keys(n);return{id:n[i].value,value:((s=n[c])===null||s===void 0?void 0:s.value)||n[i].value,selected:t===n[i].value}}));const L=new Map([["SmeupTreeNode",B.bind(undefined)],["SmeupDataTree",G.bind(undefined)],["SmeupTable",P.bind(undefined)],["SmeupDataTable",P.bind(undefined)]]);function U(e,t,s,i){var c;switch(e){case n.CHECKBOX:case n.ICON:if(!t.sizeX){t.sizeX="18px"}if(!t.sizeY){t.sizeY="18px"}if(s.style){if(!s.style.height){s.style["minHeight"]=t.sizeY}}else{s.style={minHeight:t.sizeY}}break;case n.IMAGE:const e=((c=i.cell)===null||c===void 0?void 0:c.value)||"";const l=e.indexOf(".")>-1||e.indexOf("/")>-1||e.indexOf("\\")>-1;if(i.component.rootElement.tagName===a.DATA_TABLE&&!l){if(!t.sizeX&&!t.sizeY){t.sizeX="100%";t.sizeY="64px";t.wrapperClass="noWidth"}else{if(!t.sizeX){t.sizeX="100%";t.wrapperClass="noWidth"}if(!t.sizeY){t.sizeY="auto"}}}if(i.component.rootElement.tagName===a.BOX){if(!t.sizeY){t.sizeY="auto"}if(t.fit===undefined){t.fit=true}}else if(!t.sizeX){t.sizeX="auto"}if(!t.sizeY){t.sizeY="64px"}break}}function q(e,t,s){switch(e){case n.BAR:if(!t.sizeY){t.sizeY="26px"}break;case n.BUTTON:let e="";if(t.label){e="36px"}if(s.style){if(!s.style.height){s.style["minHeight"]=e}}else{s.style={minHeight:e}}break;case n.CHART:if(!t.sizeX){t.sizeX="100%"}if(!t.sizeY){t.sizeY="100%"}break;case n.CHIP:if(s.style){if(!s.style.height){s.style["minHeight"]="40px"}}else{s.style={minHeight:"40px"}}break;case n.RADIO:if(s.style){if(!s.style.height){s.style["minHeight"]="40px"}}else{s.style={minHeight:"40px"}}break}}function J(e,t,s,i,c){var a,o;switch(e){case n.AUTOCOMPLETE:return b("kup-autocomplete",Object.assign({key:i.name+c.row.id,initialValue:s.value},s.data,{class:ie(c)?"kup-full-width":"","onkup-autocomplete-change":t=>te(t,c,e,f.UPDATE),"onkup-autocomplete-input":t=>te(t,c,e,f.INPUT),"onkup-autocomplete-iconclick":t=>te(t,c,e,f.ICON_CLICK)}));case n.CHECKBOX:if(ne(c)){t[r.C_CENTERED]=true}if(s.shape===l.INPUT_CHECKBOX){return b("input",{checked:s.value==="on"||s.value==="1"?true:false,class:"input-checkbox",onChange:t=>te(t,c,e,f.UPDATE),type:"checkbox"})}else{return b(v,Object.assign({},s.data,{onChange:t=>te(t,c,e,f.UPDATE)}))}case n.CHIP:return b("kup-chip",Object.assign({},s.data,{type:w.INPUT,enableInput:true,"onKup-chip-change":t=>te(t,c,e,f.UPDATE)}),b("kup-text-field",Object.assign({fullWidth:true,slot:"field"},s.slotData,{error:s.data.error})));case n.COLOR_PICKER:return b("kup-color-picker",Object.assign({key:i.name+c.row.id,initialValue:s.value},s.data,{class:ie(c)?"kup-full-width":"",disabled:false,"onkup-colorpicker-change":t=>te(t,c,e,f.UPDATE)}));case n.COMBOBOX:return b("kup-combobox",Object.assign({key:i.name+c.row.id,initialValue:s.value},s.data,{class:ie(c)?"kup-full-width":"","onkup-combobox-change":t=>te(t,c,e,f.UPDATE),"onkup-combobox-input":t=>te(t,c,e,f.INPUT),"onkup-combobox-iconclick":t=>te(t,c,e,f.ICON_CLICK)}));case n.DATE:return b("kup-date-picker",Object.assign({key:i.name+c.row.id,initialValue:s.value},s.data,{class:ie(c)?"kup-full-width":"","onkup-datepicker-change":t=>te(t,c,e,f.UPDATE),"onkup-datepicker-input":t=>te(t,c,e,f.INPUT)}));case n.MULTI_AUTOCOMPLETE:return b("kup-chip",Object.assign({displayId:true},s.data,{type:w.INPUT,enableInput:true,"onKup-chip-change":t=>te(t,c,e,f.UPDATE)}),b("kup-autocomplete",Object.assign({class:"kup-full-width",slot:"field",displayMode:x.DESCRIPTION_AND_CODE,selectMode:x.DESCRIPTION_AND_CODE,"onkup-autocomplete-input":t=>te(t,c,e,f.INPUT),"onkup-autocomplete-iconclick":t=>te(t,c,e,f.ICON_CLICK),showDropDownIcon:false},s.slotData,{error:s.data.error})));case n.MULTI_COMBOBOX:return b("kup-chip",Object.assign({displayId:true},s.data,{type:w.INPUT,enableInput:true,"onKup-chip-change":t=>te(t,c,e,f.UPDATE)}),b("kup-combobox",Object.assign({class:"kup-full-width",slot:"field",displayMode:x.DESCRIPTION_AND_CODE,selectMode:x.DESCRIPTION_AND_CODE,"onkup-combobox-input":t=>te(t,c,e,f.INPUT),"onkup-combobox-iconclick":t=>te(t,c,e,f.ICON_CLICK)},s.slotData,{error:s.data.error})));case n.RADIO:return b(F,Object.assign({},s.data,{disabled:false,onChange:(t,n)=>{const i=s.data.data;for(let e=0;e<i.length;e++){const s=i[e];if(e===t){s.checked=true}else{s.checked=false}}te(n,c,e,f.UPDATE)}}));case n.RATING:return b("kup-rating",Object.assign({key:i.name+c.row.id},s.data,{disabled:false,"onkup-rating-click":t=>te(t,c,e,f.UPDATE)}));case n.SWITCH:return b(I,Object.assign({},s.data,{disabled:false,onChange:t=>te(t,c,e,f.UPDATE)}));case n.TIME:return b("kup-time-picker",Object.assign({key:i.name+c.row.id,initialValue:s.value},s.data,{class:ie(c)?"kup-full-width":"","onkup-timepicker-change":t=>te(t,c,e,f.UPDATE),"onkup-timepicker-input":t=>te(t,c,e,f.INPUT)}));case n.OBJECT:return b(m,Object.assign({icon:"table"},s.data,{disabled:false,onIconClick:t=>te(t,c,e,f.ICON_CLICK)}));case n.NUMBER:t[r.C_RIGHT_ALIGNED]=true;case n.LINK:case n.STRING:const u=t=>te(t,c,e,f.UPDATE);const d=t=>te(t,c,e,f.INPUT);const p=e===n.NUMBER?"number":null;const k=e===n.NUMBER&&s.value?T.ketchup.math.numberifySafe(s.value).toString():s.value;if(s.shape===l.INPUT_FIELD){return b("input",{class:"input-field",onChange:u,onInput:d,type:p,value:k,maxLength:(o=(a=i.cellData)===null||a===void 0?void 0:a.maxLength)!==null&&o!==void 0?o:-1})}else{return b(m,Object.assign({inputType:p,fullWidth:ie(c)?true:false},s.data,{icon:s.data&&s.data.icon?s.data.icon:s.icon?s.icon:i.icon?i.icon:null,value:k,onChange:u,onInput:d,onIconClick:t=>te(t,c,e,f.ICON_CLICK)}))}}}function Q(e,t,s,i,c,a,l){switch(e){case n.AUTOCOMPLETE:case n.COMBOBOX:case n.DATE:case n.DATETIME:case n.TIME:if(s&&s!=""){const e=d(a,c);return b("div",{class:"f-cell__text"},e)}return s;case n.CHECKBOX:if(ne(l)){i[r.C_CENTERED]=true}return b(g,{resource:t.checked?"check_box":"check_box_outline_blank",sizeX:"18px",sizeY:"18px"});case n.EDITOR:return b("div",{innerHTML:c.value});case n.ICON:if(ne(l)){i[r.C_CENTERED]=true}if(t.badgeData){i[r.C_PADDED]=true}return b(g,Object.assign({},t));case n.IMAGE:if(ne(l)){i[r.C_CENTERED]=true}if(t.badgeData){i[r.C_PADDED]=true}return b(g,Object.assign({},t));case n.LINK:return b("a",{href:s,target:"_blank"},c.value);case n.NUMBER:if(s&&s!=""){const e=T.ketchup.math.numberifySafe(c.value);const t=d(a,c);if(e<0){i[r.TEXT_DANGER]=true}if(ne(l)){i[r.C_RIGHT_ALIGNED]=true}return b("div",{class:"f-cell__text"},t)}return b("div",{class:"f-cell__text"},s);case n.SWITCH:if(ne(l)){i[r.C_CENTERED]=true}t["disabled"]=true;return b(I,Object.assign({},t));default:return b("div",{class:"f-cell__text"},s)}}function Z(e,t,s,i,c,a,l){switch(e){case n.BAR:if(!s.data){return b("kup-image",Object.assign({key:a.name+l.row.id,sizeX:"250px"},s))}else{const e={height:s.sizeY,width:"100%"};return b("div",{style:e},b(g,Object.assign({},s)))}case n.BUTTON:if(ne(l)){t[r.C_CENTERED]=true}return b(O,Object.assign({},s,{onClick:t=>te(t,l,e,f.CLICK)}));case n.BUTTON_LIST:if(ne(l)){t[r.C_CENTERED]=true}s["data-storage"]={cell:i,row:c,column:a};return b("kup-button-list",Object.assign({key:a.name+l.row.id},s));case n.CHART:if(ne(l)){t[r.C_CENTERED]=true}return b("kup-chart",Object.assign({key:a.name+l.row.id},s));case n.MULTI_AUTOCOMPLETE:case n.MULTI_COMBOBOX:case n.CHIP:return b(j,Object.assign({},s));case n.COLOR_PICKER:return b("kup-color-picker",Object.assign({key:a.name+l.row.id},s,{class:ie(l)?"kup-full-width":"",disabled:true}));case n.GAUGE:return b("kup-gauge",Object.assign({key:a.name+l.row.id,value:T.ketchup.math.numberifySafe(i.value),"width-component":"280px"},s));case n.KNOB:case n.PROGRESS_BAR:return s.customStyle?b("kup-progress-bar",Object.assign({key:a.name+l.row.id},s)):b(C,Object.assign({},s));case n.RADIO:if(ne(l)){t[r.C_CENTERED]=true}s["disabled"]=c.readOnly;return b(F,Object.assign({},s));case n.RATING:return b(H,Object.assign({},s,{disabled:true}));case n.OBJECT:return b(m,Object.assign({icon:"table"},s,{disabled:true}))}}function ee(e,t){function s(e){return e.toUpperCase().startsWith("SHAPE;BAR")}function i(e){return e.toUpperCase().startsWith("SHAPE;")}function c(e){return e.toUpperCase().startsWith("BCOLOR;")}function a(e){return e.toUpperCase().startsWith("HEIGHT;")}function l(e){return e.toUpperCase().startsWith("SEP;")||e.toUpperCase().startsWith("DIV;")||e.toUpperCase().startsWith("ARW;")||e.toUpperCase().startsWith("GRID;")}function o(e){if(!e){return null}const t=e.split("\\\\AND\\");const s=[];for(const e of t){const t=r(e);if(t){s.push(...t)}else{return null}}return s}function r(e){const t={};const n=e.split("\\\\");const o=[];for(const e of n){if(e){if(l(e)){return null}if(i(e)){if(!s(e)){return null}else{const s=e.split(";");if(s.length===3){const e=s[2].replace(",",".");if(!isNaN(parseFloat(e))){t.width=`${e}%`}}}}else if(c(e));else if(a(e)){const s=e.substring("HEIGHT;".length).replace(",",".");if(!isNaN(parseFloat(s))){t.height=`${s}%`}}else{o.push(r(e,t))}}return o.length?o:null}function r(e,t){const s=Object.assign({},t);const n=e.split(";");if(n.length>=1){const e=/R(\d+)G(\d+)B(\d+)/;const t=e.exec(n[0]);if(t){const[,e,n,i]=t;if(!isNaN(parseInt(e,10))&&!isNaN(parseInt(n,10))&&!isNaN(parseInt(i,10))){s.color=`rgb(${parseInt(e)},${parseInt(n)},${parseInt(i)})`}}if(n.length>=2){const e=n[1].replace(",",".");if(!isNaN(parseFloat(e))){s.width=`${e}%`}}}return s}}t.data={};const u=()=>{var e;const s=(e=t.value)===null||e===void 0?void 0:e.split(";");if((s===null||s===void 0?void 0:s[s.length-1].trim())===""){s.pop()}if(s&&s.length){t.data.data=[];for(let e of s){t.data.data.push({id:e,value:e})}}};switch(e){case n.CHECKBOX:case n.SWITCH:t.data.checked=t.value==="1"?true:false;break;case n.BAR:if(i(t.value)){t.data.isCanvas=true;t.data.resource=t.value}else{t.data.data=o(t.value)}break;case n.BUTTON:t.data.label=t.value;break;case n.CHART:Object.assign(t.data,{sizeX:"100px",sizeY:"100px",offlineMode:{value:t.value,shape:"pie"}});break;case n.BUTTON_LIST:case n.CHIP:case n.MULTI_AUTOCOMPLETE:case n.MULTI_COMBOBOX:case n.RADIO:u();break;case n.COLOR_PICKER:t.data.initialValue=t.value;break;case n.GAUGE:case n.KNOB:case n.PROGRESS_BAR:case n.RATING:t.data.value=parseInt(t.value);break;case n.ICON:case n.IMAGE:t.data.resource=t.value;break}}function te(e,t,s,i){const c=t.cell;const a=t.column;const l=t.component;const o=t.row;if(i===f.UPDATE){let t=se(e,s);switch(s){case n.AUTOCOMPLETE:case n.COMBOBOX:case n.DATE:case n.TIME:if(c.data){c.data["initialValue"]=t}break;case n.CHECKBOX:case n.SWITCH:t=t==="on"?"0":"1";if(c.data){c.data.checked=t==="0"?false:true}break;case n.RADIO:if(c.data.data){const e=c.data.data;const s=e.find((e=>e.checked));if(s){t=s.value}}break;case n.CHIP:case n.MULTI_AUTOCOMPLETE:case n.MULTI_COMBOBOX:t=e.detail.stringifiedValues;if(c.data){c.data.data=e.detail.comp.data}break}if(c.obj){c.obj.k=t===null||t===void 0?void 0:t.toString()}c.value=t===null||t===void 0?void 0:t.toString();c.displayedValue=null;c.displayedValue=d(a,c)}if(l&&l.rootElement){const t=new CustomEvent(i,{bubbles:true,cancelable:true,composed:true,detail:{comp:l,id:l.rootElement.id,cell:c,column:a,event:e,row:o,type:s}});l.rootElement.dispatchEvent(t);if(i===f.UPDATE){try{l.refresh()}catch(e){T.ketchup.debug.logMessage(l,e,p.ERROR)}}}}function se(e,t){const s=!!(e.target.tagName==="INPUT");let i=s?e.target.value:e.detail.value;if(t===n.CHECKBOX&&s){i=e.target.checked?"off":"on"}if(t===n.NUMBER&&s){i=T.ketchup.math.formattedStringToNumberString(i,"")}return i}function ne(e){var t;return u.includes((t=e.component)===null||t===void 0?void 0:t.rootElement.tagName)}function ie(e){var t;return o.includes((t=e.component)===null||t===void 0?void 0:t.rootElement.tagName)}export{M as F,x as I,$ as K,y as a,C as b,F as c,H as d,_ as e,I as f};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{a8 as e,a9 as t,d as s,a5 as n,aa as i,ab as c,ac as a,F as l,ad as o,ae as r,af as u,ag as d,ah as f,e as p}from"./p-f98dc5f6.js";import{h as b,g as k,F as h}from"./p-d7c15b0e.js";import{F as v}from"./p-5d03c077.js";import{F as m}from"./p-9b0551b5.js";import{F as g}from"./p-2b519589.js";import{F as w,c as j}from"./p-2b14f215.js";import{F as O}from"./p-cc32b7a2.js";var y;(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."})(y||(y={}));var $;(function(e){e["LISTBOX"]="listbox";e["RADIOGROUP"]="radiogroup";e["GROUP"]="group"})($||($={}));var x;(function(e){e["CODE"]="code";e["DESCRIPTION"]="description";e["DESCRIPTION_AND_CODE"]="both"})(x||(x={}));var _;(function(e){e["SMALL"]="small";e["MEDIUM"]="medium"})(_||(_={}));const I=e=>{if(!e.sizing){e.sizing=_.MEDIUM}e.sizing.toLowerCase()===_.SMALL;const t={switch:true,"switch--checked":e.checked,"switch--disabled":e.disabled,[`switch--${e.sizing}`]:e.sizing?true:false};return b("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}),b("div",{class:`form-field ${e.leadingLabel?"form-field--align-end":""}`},b("div",{class:t},b("div",{class:"switch__track"}),b("div",{class:"switch__thumb-underlay"},b("div",{class:"switch__thumb"},b("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})))),b("label",{onClick:e.onChange},e.label)))};const C=e=>{if(!e.centeredLabel&&!e.centeredLabel!==false){e.centeredLabel=true}let t=`f-progress-bar ${e.danger?"kup-danger":""} ${e.animated?"kup-animated":""} ${e.padded?"kup-padded":""} ${e.info?"kup-info":""} ${e.slim?"kup-slim":""} ${e.striped?"kup-striped":""} ${e.secondary?"kup-secondary":""} ${e.slim?"kup-slim":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`;let s="pie";let n=undefined;if(e.isRadial){t+=" pie-wrapper is-radial"}else{t+=" progress-bar"}let i=undefined;const c={width:`${e.value}%`};if(!e.centeredLabel){i=c;if(e.value>2){t+=" text-color-on-primary"}}else if(e.value>49){t+=" text-color-on-primary"}let a=null;if(e.icon){a=z(e)}else{if(!e.hideLabel){if(e.isRadial){if(e.label){a=b("span",{class:"label"},e.label)}else{a=b("span",{class:"label"},e.value,b("span",{class:"smaller"},"%"))}}else{if(e.label){a=e.label}else{a=e.value+"%"}}}}if(e.value>0){s+=" has-value";if(e.value>50){s+=" is-more-than-half"}else{s+=" is-less-than-half"}}if(e.isRadial){return b("div",{class:t},a,b("div",{class:s},b("div",{style:n,class:"left-side half-circle"}),b("div",{class:"right-side half-circle"})),b("div",{class:"shadow"}))}else{return b("div",{class:t},b("div",{class:"progress-bar-percentage",style:c},b("span",{style:i},a)))}};function z(e){if(!e.icon){return undefined}if(e.icon.indexOf(".")>-1||e.icon.indexOf("/")>-1||e.icon.indexOf("\\")>-1){return b("span",{class:"label kup-icon is-image"},b("img",{src:e.icon}))}else{let t=`url('${k(`./assets/svg/${e.icon}.svg`)}') no-repeat center`;let s={mask:t,webkitMask:t};return b("span",{style:s,class:"label kup-icon"})}}var N;(function(e){e["RADIO"]="radio";e["CHEVRON"]="chevron"})(N||(N={}));const F=e=>{var t;const s=!!e.columns;const n=[];const i=e.type||N.RADIO;for(let s=0;s<((t=e.data)===null||t===void 0?void 0:t.length);s++){const t=e.data[s];const c={radio:true,"radio--checked":t.checked?true:false,"radio--disabled":e.disabled?true:false,[`radio--${e.type}`]:e.type?true:false};n.push(b("div",{class:`form-field \n ${e.leadingLabel?" form-field--align-end":""} ${e.disabled?"radio--disabled":""}`},b("div",{class:c},i===N.RADIO?b("input",{class:"radio__native-control",type:"radio",name:"radio-element",value:t.value,checked:t.checked,disabled:e.disabled,onBlur:e.onBlur,onChange:e.onChange?e.onChange.bind(e.onChange,s):null,onFocus:e.onFocus}):b(h,null,t.checked?b(g,{resource:"check",sizeX:"14px",sizeY:"14px"}):b(g,{sizeX:"14px",sizeY:"14px",onClick:e.onChange?e.onChange.bind(e.onChange,s):null})),i===N.RADIO&&b("div",{class:"radio__background"},b("div",{class:"radio__outer-circle"}),b("div",{class:"radio__inner-circle"}))),b("label",{htmlFor:"radio-element",onClick:e.onChange?e.onChange.bind(e.onChange,s):null},t.label?t.label:"")))}const c={"--kup_radio_columns":s?`repeat(${e.columns}, 1fr)`:""};return b("div",{class:`f-radio radio-wrapper\n ${s?"radio-wrapper-grid":""} ${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.horizontal?"kup-horizontal":""}`,style:c},n)};const H=e=>{if(!e.maxValue){e.maxValue=5}return b("div",{class:`f-rating ${e.disabled?"disabled":""} ${e.danger?"kup-danger":""} ${e.info?"kup-info":""} ${e.secondary?"kup-secondary":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},D(e))};function D(e){const t=[];for(let s=1;s<=e.maxValue;s++){if(s<=e.value){t.push(b("span",{class:"rating",onClick:e.onClick?e.onClick.bind(e.onClick,s):null},"★"))}else{t.push(b("span",{class:"rating",onClick:e.onClick?e.onClick.bind(e.onClick,s):null},"☆"))}}return t}const T=document.documentElement;const M=(i,c)=>{var a;const l=i.cell;const o=i.column;const u=i.row;const d=i.shape?i.shape:l.shape?l.shape:o.shape?o.shape:null;const p=!T.ketchup.objects.isEmptyKupObj(l.obj);let k=false;if(l.hasOwnProperty("isEditable")){k=l.isEditable}else if(o.hasOwnProperty("isEditable")){k=o.isEditable}k=k&&i.editable;if(l.options){l.data=(a=S(l,o))!==null&&a!==void 0?a:l.data}const h=i.previousValue!==l.value?l.value:"";const v=T.ketchup.data.cell.getType(l,d);const m=Object.assign({},l.data);let w=l.cssClass?l.cssClass:(o===null||o===void 0?void 0:o.cssClass)?o===null||o===void 0?void 0:o.cssClass:"";if(i.component.legacyLook){w+=" monospace c-pre"}const j={"f-cell":true,[r.OBJ]:p?true:false,[v+"-cell"]:true,[i.wrapperClass]:i.wrapperClass?true:false,[i.density]:i.density&&v!==n.BAR?true:false,[w]:w?true:false};let O=h;if(!l.data){ee(v,l)}if(k&&e.includes(v)){O=J(v,j,l,o,i)}else if(l.data&&t.includes(v)){if(i.setSizes){q(v,m,l)}if(!i.renderKup){const e="cell-"+v+" placeholder";O=b("span",{class:e})}else{O=Z(v,j,m,l,u,o,i)}}else{if(i.setSizes){U(v,m,l,i)}O=Q(v,m,O,j,l,o,i)}let y=null;if(!k&&(o.icon||l.icon)&&O){const e={color:`rgba(var(${s.TEXT}-rgb), 0.375)`,resource:l.icon?l.icon:o.icon,placeholderResource:l.placeholderIcon?l.placeholderIcon:o.placeholderIcon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"obj-icon"};y=b(g,Object.assign({},e))}let $=null;if(T.ketchup.debug.isDebug()&&p){$=l.obj.t+"; "+l.obj.p+"; "+l.obj.k+";"}else if(l.title!=null&&l.title.trim()!=""){$=l.title}let x=null;if(l.info){const e=Object.assign({},l.info);if(!e.color){e.color=`var(${s.INFO})`}if(!e.icon){e.icon="info"}const t={color:e.color,resource:e.icon,placeholderResource:e.placeholderIcon,sizeX:"1.25em",sizeY:"1.25em",title:e.message?e.message:"",wrapperClass:"cell-info"};x=b(g,Object.assign({},t))}return b("div",{onKeyUp:e=>te(e,i,v,f.KEYUP),class:j,"kup-get-cell-props":()=>i,ref:e=>l.element=e,style:l.style},b("div",{class:"f-cell__content",style:l.styleContent,title:$},i.cellActionIcon&&b(g,{resource:"more_vert",sizeX:"16px",sizeY:"16px",wrapperClass:`f-cell__iconfunction ${v===n.NUMBER?"left":"right"}`,onClick:i.cellActionIcon.onClick,tabIndex:0}),c&&c.length>0?c:[i.indents,x,y,O]))};const S=(e,t)=>{if(!e){return null}const s=e.options;const i=t.title;const c=e.value;const a=T.ketchup.data.cell.getType(e,e.shape);const l=new Map([[n.BUTTON_LIST,R.bind(undefined)],[n.STRING,Y.bind(undefined)],[n.RADIO,K.bind(undefined)],[n.AUTOCOMPLETE,W.bind(undefined)],[n.COMBOBOX,W.bind(undefined)],[n.CHECKBOX,X.bind(undefined)],[n.OBJECT,V.bind(undefined)],[n.CHIP,E.bind(undefined)]]);const o=l.get(a);return o?o(s,i,c,e):null};const E=(e,t,s,n)=>{const i={data:(e===null||e===void 0?void 0:e.length)?e===null||e===void 0?void 0:e.map((e=>({id:e.id,value:e.id}))):[]};n.data=Object.assign(Object.assign({},n.data),i)};const V=(e,t,s,n,i)=>({data:{initialValue:s||"",label:t||"",value:s||""}});const X=(e,t,s,n)=>Object.assign(Object.assign({},n.data),{checked:s==="on"||s==="1",label:t});const R=(e,t,s,n)=>({data:[Object.assign(Object.assign({},n.data),{icon:n.icon,value:s})]});const Y=(e,t,s,n)=>Object.assign(Object.assign({},n.data),{label:t});const K=(e,t,s,n)=>{const c=i(s,e);n.data=Object.assign(Object.assign({},n.data),c)};const W=(e,t,s,n,i)=>{var a;if(!((a=n.data)===null||a===void 0?void 0:a.data)&&e){const n=c(s,t,[]);n.data["kup-list"].data=A(e,s);return n}};const A=(e,t)=>{const s=L.get(e.type);if(s){return s(e,t)}else{return e.map((e=>({value:e.label,id:e.id,selected:t===e.id})))}};const B=(e,t)=>e.children.map((e=>{var s;return{id:e.content.codice,value:e.content.testo,selected:t===e.content.codice,children:((s=e.children)===null||s===void 0?void 0:s.length)?B(e,t):[]}}));const G=(e,t)=>e.children.map((e=>{var s;return{id:e.obj.k,value:e.value,selected:t===e.obj.k,children:((s=e.children)===null||s===void 0?void 0:s.length)?G(e,t):[]}}));const P=(e,t)=>e.rows.map((e=>{var s;const n=e.fields||e.cells;const[i,c]=Object.keys(n);return{id:n[i].value,value:((s=n[c])===null||s===void 0?void 0:s.value)||n[i].value,selected:t===n[i].value}}));const L=new Map([["SmeupTreeNode",B.bind(undefined)],["SmeupDataTree",G.bind(undefined)],["SmeupTable",P.bind(undefined)],["SmeupDataTable",P.bind(undefined)]]);function U(e,t,s,i){var c;switch(e){case n.CHECKBOX:case n.ICON:if(!t.sizeX){t.sizeX="18px"}if(!t.sizeY){t.sizeY="18px"}if(s.style){if(!s.style.height){s.style["minHeight"]=t.sizeY}}else{s.style={minHeight:t.sizeY}}break;case n.IMAGE:const e=((c=i.cell)===null||c===void 0?void 0:c.value)||"";const l=e.indexOf(".")>-1||e.indexOf("/")>-1||e.indexOf("\\")>-1;if(i.component.rootElement.tagName===a.DATA_TABLE&&!l){if(!t.sizeX&&!t.sizeY){t.sizeX="100%";t.sizeY="64px";t.wrapperClass="noWidth"}else{if(!t.sizeX){t.sizeX="100%";t.wrapperClass="noWidth"}if(!t.sizeY){t.sizeY="auto"}}}if(i.component.rootElement.tagName===a.BOX){if(!t.sizeY){t.sizeY="auto"}if(t.fit===undefined){t.fit=true}}else if(!t.sizeX){t.sizeX="auto"}if(!t.sizeY){t.sizeY="64px"}break}}function q(e,t,s){switch(e){case n.BAR:if(!t.sizeY){t.sizeY="26px"}break;case n.BUTTON:let e="";if(t.label){e="36px"}if(s.style){if(!s.style.height){s.style["minHeight"]=e}}else{s.style={minHeight:e}}break;case n.CHART:if(!t.sizeX){t.sizeX="100%"}if(!t.sizeY){t.sizeY="100%"}break;case n.CHIP:if(s.style){if(!s.style.height){s.style["minHeight"]="40px"}}else{s.style={minHeight:"40px"}}break;case n.RADIO:if(s.style){if(!s.style.height){s.style["minHeight"]="40px"}}else{s.style={minHeight:"40px"}}break}}function J(e,t,s,i,c){var a,o;switch(e){case n.AUTOCOMPLETE:return b("kup-autocomplete",Object.assign({key:i.name+c.row.id,initialValue:s.value},s.data,{class:ie(c)?"kup-full-width":"","onkup-autocomplete-change":t=>te(t,c,e,f.UPDATE),"onkup-autocomplete-input":t=>te(t,c,e,f.INPUT),"onkup-autocomplete-iconclick":t=>te(t,c,e,f.ICON_CLICK)}));case n.CHECKBOX:if(ne(c)){t[r.C_CENTERED]=true}if(s.shape===l.INPUT_CHECKBOX){return b("input",{checked:s.value==="on"||s.value==="1"?true:false,class:"input-checkbox",onChange:t=>te(t,c,e,f.UPDATE),type:"checkbox"})}else{return b(v,Object.assign({},s.data,{onChange:t=>te(t,c,e,f.UPDATE)}))}case n.CHIP:return b("kup-chip",Object.assign({},s.data,{type:w.INPUT,enableInput:true,"onKup-chip-change":t=>te(t,c,e,f.UPDATE)}),b("kup-text-field",Object.assign({fullWidth:true,slot:"field"},s.slotData,{error:s.data.error})));case n.COLOR_PICKER:return b("kup-color-picker",Object.assign({key:i.name+c.row.id,initialValue:s.value},s.data,{class:ie(c)?"kup-full-width":"",disabled:false,"onkup-colorpicker-change":t=>te(t,c,e,f.UPDATE)}));case n.COMBOBOX:return b("kup-combobox",Object.assign({key:i.name+c.row.id,initialValue:s.value},s.data,{class:ie(c)?"kup-full-width":"","onkup-combobox-change":t=>te(t,c,e,f.UPDATE),"onkup-combobox-input":t=>te(t,c,e,f.INPUT),"onkup-combobox-iconclick":t=>te(t,c,e,f.ICON_CLICK)}));case n.DATE:return b("kup-date-picker",Object.assign({key:i.name+c.row.id,initialValue:s.value},s.data,{class:ie(c)?"kup-full-width":"","onkup-datepicker-change":t=>te(t,c,e,f.UPDATE),"onkup-datepicker-input":t=>te(t,c,e,f.INPUT)}));case n.MULTI_AUTOCOMPLETE:return b("kup-chip",Object.assign({displayId:true},s.data,{type:w.INPUT,enableInput:true,"onKup-chip-change":t=>te(t,c,e,f.UPDATE)}),b("kup-autocomplete",Object.assign({class:"kup-full-width",slot:"field",displayMode:x.DESCRIPTION_AND_CODE,selectMode:x.DESCRIPTION_AND_CODE,"onkup-autocomplete-input":t=>te(t,c,e,f.INPUT),"onkup-autocomplete-iconclick":t=>te(t,c,e,f.ICON_CLICK),showDropDownIcon:false},s.slotData,{error:s.data.error})));case n.MULTI_COMBOBOX:return b("kup-chip",Object.assign({displayId:true},s.data,{type:w.INPUT,enableInput:true,"onKup-chip-change":t=>te(t,c,e,f.UPDATE)}),b("kup-combobox",Object.assign({class:"kup-full-width",slot:"field",displayMode:x.DESCRIPTION_AND_CODE,selectMode:x.DESCRIPTION_AND_CODE,"onkup-combobox-input":t=>te(t,c,e,f.INPUT),"onkup-combobox-iconclick":t=>te(t,c,e,f.ICON_CLICK)},s.slotData,{error:s.data.error})));case n.RADIO:return b(F,Object.assign({},s.data,{disabled:false,onChange:(t,n)=>{const i=s.data.data;for(let e=0;e<i.length;e++){const s=i[e];if(e===t){s.checked=true}else{s.checked=false}}te(n,c,e,f.UPDATE)}}));case n.RATING:return b("kup-rating",Object.assign({key:i.name+c.row.id},s.data,{disabled:false,"onkup-rating-click":t=>te(t,c,e,f.UPDATE)}));case n.SWITCH:return b(I,Object.assign({},s.data,{disabled:false,onChange:t=>te(t,c,e,f.UPDATE)}));case n.TIME:return b("kup-time-picker",Object.assign({key:i.name+c.row.id,initialValue:s.value},s.data,{class:ie(c)?"kup-full-width":"","onkup-timepicker-change":t=>te(t,c,e,f.UPDATE),"onkup-timepicker-input":t=>te(t,c,e,f.INPUT)}));case n.OBJECT:return b(m,Object.assign({icon:"table"},s.data,{disabled:false,onIconClick:t=>te(t,c,e,f.ICON_CLICK)}));case n.NUMBER:t[r.C_RIGHT_ALIGNED]=true;case n.LINK:case n.STRING:const u=t=>te(t,c,e,f.UPDATE);const d=t=>te(t,c,e,f.INPUT);const p=e===n.NUMBER?"number":null;const k=e===n.NUMBER&&s.value?T.ketchup.math.numberifySafe(s.value).toString():s.value;if(s.shape===l.INPUT_FIELD){return b("input",{class:"input-field",onChange:u,onInput:d,type:p,value:k,maxLength:(o=(a=i.cellData)===null||a===void 0?void 0:a.maxLength)!==null&&o!==void 0?o:-1})}else{return b(m,Object.assign({inputType:p,fullWidth:ie(c)?true:false},s.data,{icon:s.data&&s.data.icon?s.data.icon:s.icon?s.icon:i.icon?i.icon:null,value:k,onChange:u,onInput:d,onIconClick:t=>te(t,c,e,f.ICON_CLICK)}))}}}function Q(e,t,s,i,c,a,l){switch(e){case n.AUTOCOMPLETE:case n.COMBOBOX:case n.DATE:case n.DATETIME:case n.TIME:if(s&&s!=""){const e=d(a,c);return b("div",{class:"f-cell__text"},e)}return s;case n.CHECKBOX:if(ne(l)){i[r.C_CENTERED]=true}return b(g,{resource:t.checked?"check_box":"check_box_outline_blank",sizeX:"18px",sizeY:"18px"});case n.EDITOR:return b("div",{innerHTML:c.value});case n.ICON:if(ne(l)){i[r.C_CENTERED]=true}if(t.badgeData){i[r.C_PADDED]=true}return b(g,Object.assign({},t));case n.IMAGE:if(ne(l)){i[r.C_CENTERED]=true}if(t.badgeData){i[r.C_PADDED]=true}return b(g,Object.assign({},t));case n.LINK:return b("a",{href:s,target:"_blank"},c.value);case n.NUMBER:if(s&&s!=""){const e=T.ketchup.math.numberifySafe(c.value);const t=d(a,c);if(e<0){i[r.TEXT_DANGER]=true}if(ne(l)){i[r.C_RIGHT_ALIGNED]=true}return b("div",{class:"f-cell__text"},t)}return b("div",{class:"f-cell__text"},s);case n.SWITCH:if(ne(l)){i[r.C_CENTERED]=true}t["disabled"]=true;return b(I,Object.assign({},t));default:return b("div",{class:"f-cell__text"},s)}}function Z(e,t,s,i,c,a,l){switch(e){case n.BAR:if(!s.data){return b("kup-image",Object.assign({key:a.name+l.row.id,sizeX:"250px"},s))}else{const e={height:s.sizeY,width:"100%"};return b("div",{style:e},b(g,Object.assign({},s)))}case n.BUTTON:if(ne(l)){t[r.C_CENTERED]=true}return b(O,Object.assign({},s,{onClick:t=>te(t,l,e,f.CLICK)}));case n.BUTTON_LIST:if(ne(l)){t[r.C_CENTERED]=true}s["data-storage"]={cell:i,row:c,column:a};return b("kup-button-list",Object.assign({key:a.name+l.row.id},s));case n.CHART:if(ne(l)){t[r.C_CENTERED]=true}return b("kup-chart",Object.assign({key:a.name+l.row.id},s));case n.MULTI_AUTOCOMPLETE:case n.MULTI_COMBOBOX:case n.CHIP:return b(j,Object.assign({},s));case n.COLOR_PICKER:return b("kup-color-picker",Object.assign({key:a.name+l.row.id},s,{class:ie(l)?"kup-full-width":"",disabled:true}));case n.GAUGE:return b("kup-gauge",Object.assign({key:a.name+l.row.id,value:T.ketchup.math.numberifySafe(i.value),"width-component":"280px"},s));case n.KNOB:case n.PROGRESS_BAR:return s.customStyle?b("kup-progress-bar",Object.assign({key:a.name+l.row.id},s)):b(C,Object.assign({},s));case n.RADIO:if(ne(l)){t[r.C_CENTERED]=true}s["disabled"]=c.readOnly;return b(F,Object.assign({},s));case n.RATING:return b(H,Object.assign({},s,{disabled:true}));case n.OBJECT:return b(m,Object.assign({icon:"table"},s,{disabled:true}))}}function ee(e,t){function s(e){return e.toUpperCase().startsWith("SHAPE;BAR")}function i(e){return e.toUpperCase().startsWith("SHAPE;")}function c(e){return e.toUpperCase().startsWith("BCOLOR;")}function a(e){return e.toUpperCase().startsWith("HEIGHT;")}function l(e){return e.toUpperCase().startsWith("SEP;")||e.toUpperCase().startsWith("DIV;")||e.toUpperCase().startsWith("ARW;")||e.toUpperCase().startsWith("GRID;")}function o(e){if(!e){return null}const t=e.split("\\\\AND\\");const s=[];for(const e of t){const t=r(e);if(t){s.push(...t)}else{return null}}return s}function r(e){const t={};const n=e.split("\\\\");const o=[];for(const e of n){if(e){if(l(e)){return null}if(i(e)){if(!s(e)){return null}else{const s=e.split(";");if(s.length===3){const e=s[2].replace(",",".");if(!isNaN(parseFloat(e))){t.width=`${e}%`}}}}else if(c(e));else if(a(e)){const s=e.substring("HEIGHT;".length).replace(",",".");if(!isNaN(parseFloat(s))){t.height=`${s}%`}}else{o.push(r(e,t))}}return o.length?o:null}function r(e,t){const s=Object.assign({},t);const n=e.split(";");if(n.length>=1){const e=/R(\d+)G(\d+)B(\d+)/;const t=e.exec(n[0]);if(t){const[,e,n,i]=t;if(!isNaN(parseInt(e,10))&&!isNaN(parseInt(n,10))&&!isNaN(parseInt(i,10))){s.color=`rgb(${parseInt(e)},${parseInt(n)},${parseInt(i)})`}}if(n.length>=2){const e=n[1].replace(",",".");if(!isNaN(parseFloat(e))){s.width=`${e}%`}}}return s}}t.data={};const u=()=>{var e;const s=(e=t.value)===null||e===void 0?void 0:e.split(";");if((s===null||s===void 0?void 0:s[s.length-1].trim())===""){s.pop()}if(s&&s.length){t.data.data=[];for(let e of s){t.data.data.push({id:e,value:e})}}};switch(e){case n.CHECKBOX:case n.SWITCH:t.data.checked=t.value==="1"?true:false;break;case n.BAR:if(i(t.value)){t.data.isCanvas=true;t.data.resource=t.value}else{t.data.data=o(t.value)}break;case n.BUTTON:t.data.label=t.value;break;case n.CHART:Object.assign(t.data,{sizeX:"100px",sizeY:"100px",offlineMode:{value:t.value,shape:"pie"}});break;case n.BUTTON_LIST:case n.CHIP:case n.MULTI_AUTOCOMPLETE:case n.MULTI_COMBOBOX:case n.RADIO:u();break;case n.COLOR_PICKER:t.data.initialValue=t.value;break;case n.GAUGE:case n.KNOB:case n.PROGRESS_BAR:case n.RATING:t.data.value=parseInt(t.value);break;case n.ICON:case n.IMAGE:t.data.resource=t.value;break}}function te(e,t,s,i){const c=t.cell;const a=t.column;const l=t.component;const o=t.row;if(i===f.UPDATE){let t=se(e,s);switch(s){case n.AUTOCOMPLETE:case n.COMBOBOX:case n.DATE:case n.TIME:if(c.data){c.data["initialValue"]=t}break;case n.CHECKBOX:case n.SWITCH:t=t==="on"?"0":"1";if(c.data){c.data.checked=t==="0"?false:true}break;case n.RADIO:if(c.data.data){const e=c.data.data;const s=e.find((e=>e.checked));if(s){t=s.value}}break;case n.CHIP:case n.MULTI_AUTOCOMPLETE:case n.MULTI_COMBOBOX:t=e.detail.stringifiedValues;if(c.data){c.data.data=e.detail.comp.data}break}if(c.obj){c.obj.k=t===null||t===void 0?void 0:t.toString()}c.value=t===null||t===void 0?void 0:t.toString();c.displayedValue=null;c.displayedValue=d(a,c)}if(l&&l.rootElement){const t=new CustomEvent(i,{bubbles:true,cancelable:true,composed:true,detail:{comp:l,id:l.rootElement.id,cell:c,column:a,event:e,row:o,type:s}});l.rootElement.dispatchEvent(t);if(i===f.UPDATE){try{l.refresh()}catch(e){T.ketchup.debug.logMessage(l,e,p.ERROR)}}}}function se(e,t){const s=!!(e.target.tagName==="INPUT");let i=s?e.target.value:e.detail.value;if(t===n.CHECKBOX&&s){i=e.target.checked?"off":"on"}if(t===n.NUMBER&&s){i=T.ketchup.math.formattedStringToNumberString(i,"")}return i}function ne(e){var t;return u.includes((t=e.component)===null||t===void 0?void 0:t.rootElement.tagName)}function ie(e){var t;return o.includes((t=e.component)===null||t===void 0?void 0:t.rootElement.tagName)}export{M as F,x as I,$ as K,y as a,C as b,F as c,H as d,_ as e,I as f};
|
|
2
|
+
//# sourceMappingURL=p-49485bbf.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as i,f as e,h as n,H as s,d as o}from"./p-d7c15b0e.js";import{F as l}from"./p-cc32b7a2.js";import{F as a}from"./p-7d7b8718.js";import{k as r,a5 as u,F as c,g as h,s as f,h as p,al as d,ab as m,aa as v,am as b,e as k,ak as g}from"./p-86b6489e.js";import{F as y}from"./p-c4054aba.js";import{c as _}from"./p-635bb4b3.js";import"./p-e3062c19.js";import"./p-2b519589.js";import"./p-5d03c077.js";import"./p-fe31a004.js";import"./p-a16707d1.js";import"./p-029c7cbe.js";import"./p-d4a879fc.js";var j;(function(t){t["TAB"]="tab"})(j||(j={}));var x;(function(t){t["customStyle"]="Custom style of the component.";t["data"]="Actual data of the input panel.";t["hiddenSubmitButton"]="Creates a hidden submit button in order to submit the form with enter.";t["submitCb"]="Sets the callback function on submit form";t["optionsHandler"]="Sets the callback function to recieve options"})(x||(x={}));const w=12;const O=22;const $=t=>{if(t==0){return w/2}if(!t){return null}if(t===1){return 1.5*w}return t*w};const z=t=>{if(!t){return null}return t*O};const S=t=>{if(!t){return null}return(t-1)*O};const M=t=>{if(!t){return null}return t*w};const T=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:14px;line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_input_panel_background_color:var(\n --kup-input-panel-background-color,\n var(--kup-layer-0)\n );--kup_input_panel_color:var(\n --kup-input-panel-color,\n var(--kup-text-secondary)\n );--kup_input_panel_font_family:var(\n --kup-input-panel-font-family,\n var(--kup-font-family)\n );--kup_input_panel_font_size:var(\n --kup-input-panel-font-size,\n var(--kup-font-size)\n );--kup_input_panel_label_alignment:var(--kup-input-panel-label-alignment);--kup_input_panel_label_width:var(--kup-input-panel-label-width);--kup_input_panel_padding:var(--kup-input-panel-padding, 1em 0)}:host .input-panel{background:var(--kup_input_panel_background_color);color:var(--kup_input_panel_color);display:flex;flex-grow:1;overflow:auto;padding:var(--kup_input_panel_padding);position:relative;gap:2rem}:host .input-panel--column{flex-direction:column}:host .input-panel__section_label_container{display:flex;flex-direction:column;gap:1rem}:host .input-panel__section{display:grid}:host .input-panel__section .f-cell__content>*{width:100%}:host .input-panel__horizontal-section{display:inline-grid}:host .input-panel .f-cell .f-checkbox .checkbox .checkbox__native-control{height:40px;width:40px}:host .input-panel__label_container{display:flex;flex-direction:column;justify-content:center}:host .input-panel__label_container>.f-cell{flex:1}:host .input-panel__tabs_container{display:flex;flex-direction:column;justify-content:center;gap:2rem}:host .input-panel .f-cell.number-cell .f-cell__content{--kup-textfield-font-family:var(--kup_cell_font_family);font-family:var(--kup_cell_font_family)}:host .input-panel .input-panel-label{display:flex;width:100%;height:100%;align-items:center;justify-content:center}:host .input-panel--absolute{height:40ch;justify-content:flex-end}:host .input-panel--absolute .input-panel-label{justify-content:start}:host .input-panel--absolute .mdc-text-field{height:unset !important}";const W=T;var D=undefined&&undefined.__classPrivateFieldGet||function(t,i,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof i==="function"?t!==i||!n:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(t):n?n.value:i.get(t)};var C=undefined&&undefined.__classPrivateFieldSet||function(t,i,e,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof i==="function"?t!==i||!s:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,e):s?s.value=e:i.set(t,e),e};var E=undefined&&undefined.__rest||function(t,i){var e={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&i.indexOf(n)<0)e[n]=t[n];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++){if(i.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s]))e[n[s]]=t[n[s]]}return e};var F,B,I,P,R,N,V,G,J,A,L,H,K,X,Y,q,Q,U,Z,tt,it,et,nt,st,ot,lt,at,rt,ut,ct,ht,ft,pt,dt,mt,vt,bt,kt,gt,yt,_t,jt,xt,wt,Ot,$t,zt,St,Mt,Tt,Wt,Dt,Ct,Et,Ft,Bt,It,Pt;const Rt=document.documentElement;const Nt=class{constructor(e){t(this,e);this.kupReady=i(this,"kup-input-panel-ready",6);F.add(this);B.set(this,r());I.set(this,new Map([["SmeupTreeNode",D(this,F,"m",Wt).bind(this)],["SmeupDataTree",D(this,F,"m",Dt).bind(this)],["SmeupTable",D(this,F,"m",Ct).bind(this)],["SmeupDataTable",D(this,F,"m",Ct).bind(this)]]));P.set(this,null);R.set(this,new Map([[u.AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[u.MULTI_AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[u.COMBOBOX,["kup-combobox-iconclick","kup-combobox-blur"]],[u.MULTI_COMBOBOX,["kup-combobox-iconclick"]]]));N.set(this,new Map([[c.AUTOCOMPLETE,"kup-autocomplete-blur"],[c.CHIP,"kup-textfield-blur"],[c.COMBOBOX,"kup-combobox-blur"],[c.DATE,"kup-datepicker-blur"],[c.MULTI_AUTOCOMPLETE,"kup-autocomplete-blur"],[c.MULTI_COMBOBOX,"kup-combobox-blur"],[c.TIME,"kup-timepicker-blur"]]));V.set(this,[]);G.set(this,new Map([[u.DATE,"kup-date-picker"],[u.TIME,"kup-time-picker"]]));J.set(this,new Map([[c.BUTTON_LIST,D(this,F,"m",Y).bind(this)],[c.EDITOR,D(this,F,"m",q).bind(this)],[c.LABEL,D(this,F,"m",U).bind(this)],[c.TABLE,D(this,F,"m",Q).bind(this)]]));A.set(this,new Map([[j.TAB,D(this,F,"m",ot).bind(this)]]));L.set(this,[]);this.customStyle="";this.data=null;this.hiddenSubmitButton=false;this.submitCb=null;this.optionsHandler=null;this.customButtonClickHandler=null;this.checkValidObjCallback=null;this.checkValidValueCallback=null;this.inputPanelCells=[];this.tabSelected=null}onDataChanged(){C(this,P,structuredClone(this.data),"f");if(D(this,V,"f").length){D(this,V,"f").map((({event:t,handler:i})=>{this.rootElement.removeEventListener(t,i)}));C(this,V,[],"f")}if(D(this,L,"f").length){D(this,L,"f").map((t=>{D(this,B,"f").keysBinding.unregister(t)}));C(this,L,[],"f")}D(this,F,"m",rt).call(this,this.data)}async getProps(t){return h(this,x,t)}async refresh(){e(this)}async setProps(t){f(this,x,t)}componentWillLoad(){D(this,B,"f").debug.logLoad(this,false);D(this,B,"f").language.register(this);D(this,B,"f").theme.register(this);this.onDataChanged()}componentDidLoad(){this.kupReady.emit({comp:this,id:this.rootElement.id});D(this,B,"f").debug.logLoad(this,true)}componentWillRender(){D(this,B,"f").debug.logRender(this,false)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const i=t.querySelectorAll(".f-text-field");for(let t=0;t<i.length;t++){y(i[t])}}D(this,B,"f").debug.logRender(this,true)}render(){const t=Boolean(!this.inputPanelCells.length);const i=t?[n("p",null,D(this,B,"f").language.translate(p.EMPTY_DATA))]:this.inputPanelCells.map((t=>D(this,F,"m",K).call(this,t)));return n(s,{key:"35cfbce1a8bbf2b75c9623e8c9b8ab39fe4dd7da"},n("style",{key:"6e8a97a51addf209b9be81bc4aaa207e5a07efae"},D(this,B,"f").theme.setKupStyle(this.rootElement)),n("div",{key:"6a927b5e5fb9972382525e8b7b96dd462b7aa3a0",id:_},i))}disconnectedCallback(){D(this,B,"f").language.unregister(this);D(this,B,"f").theme.unregister(this)}get rootElement(){return o(this)}static get watchers(){return{data:["onDataChanged"]}}};B=new WeakMap,I=new WeakMap,P=new WeakMap,R=new WeakMap,N=new WeakMap,V=new WeakMap,G=new WeakMap,J=new WeakMap,A=new WeakMap,L=new WeakMap,F=new WeakSet,H=function t(i){return this.inputPanelCells.reduce(((t,{cells:e})=>{if(!t){return e.find((({column:t})=>t.name===i)).cell}return t}),null)},K=function t(i){var e;const s=i.row.layout;const o=(s===null||s===void 0?void 0:s.horizontal)||false;const a={};let r;if(!((e=s===null||s===void 0?void 0:s.sections)===null||e===void 0?void 0:e.length)){r=i.cells.map((t=>D(this,F,"m",X).call(this,t.cell,i.row,t.column)))}else{if(s.absolute){r=D(this,F,"m",it).call(this,i,s)}else{if(!s.sectionsType){const t=s.sections.some((t=>t.dim));a.display="grid";if(s.horizontal){a.gridTemplateColumns=t?s.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${s.sections.length}, 1fr)`}else{a.gridTemplateRows=t?s.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${s.sections.length}, 1fr)`}}r=D(this,F,"m",tt).call(this,i,s)}}const u={"input-panel":true,"input-panel--column":!o,"input-panel--absolute":s===null||s===void 0?void 0:s.absolute};return n("form",{name:this.rootElement.id,onSubmit:t=>{t.preventDefault();this.submitCb({value:{before:Object.assign({},D(this,P,"f")),after:D(this,F,"m",ht).call(this)}})}},n("div",{class:u,style:a},r),!this.hiddenSubmitButton?n(l,{buttonType:"submit",label:D(this,B,"f").language.translate(p.CONFIRM),wrapperClass:"form__submit"}):null)},X=function t(i,e,s){if(!i){return}const o=D(this,J,"f").get(i.shape);if(o!==undefined){return o(i,s.name)}const l={cell:i,column:s,row:e,component:this,editable:true,renderKup:true,setSizes:true};const r=D(this,F,"m",Z).call(this,i,s.title);if(r){return n("div",{class:{"input-panel__label_container":true}},r,n(a,Object.assign({},l)))}return n(a,Object.assign({},l))},Y=function t(i,e){return n(l,Object.assign({icon:i.icon,id:e},i.data,{wrapperClass:"form__submit"}))},q=function t(i,e){const s="kup-editor-save";const o=t=>{const i=this.inputPanelCells.reduce(((t,{cells:i})=>{if(!t){return i.find((({column:t})=>t.name===e)).cell}return t}),null);i.value=t.detail.htmlValue.replace(/\n/g,"<br>")};this.rootElement.addEventListener(s,o);D(this,V,"f").push({event:s,handler:o});return n("kup-editor",Object.assign({},i.data,{id:e,isReadOnly:!i.isEditable,showToolbar:true}))},Q=function t(i,e){return n("kup-data-table",Object.assign({id:e,editableData:true,showGroups:true,showFilters:true,showFooter:true},i.data))},U=function t(i,e){return n("span",{class:"input-panel-label",id:e},i.value)},Z=function t(i,e){if(!e){return null}const s=Rt.ketchup.data.cell.getType(i,i.shape);if(s===u.RADIO){return n("span",null,e)}return null},tt=function t(i,e){const n=D(this,A,"f").get(e.sectionsType);return n?n(i,e.sections):e.sections.map((t=>D(this,F,"m",et).call(this,i,t)))},it=function t(i,e){return e.sections.map((t=>D(this,F,"m",nt).call(this,i,t)))},et=function t(i,e,s=false,o={}){var l,a;const r={"input-panel__section":!e.horizontal,"input-panel__horizontal-section":e.horizontal};o.gap=+e.gap>0?`${e.gap}rem`:"1rem";let u=[];if((l=e.sections)===null||l===void 0?void 0:l.length){u=e.sections.map((e=>D(this,F,"m",t).call(this,i,e)));const n=e.sections.some((t=>t.dim));if(!e.gridCols&&e.horizontal){o.gridTemplateColumns=n?e.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${e.sections.length}, 1fr)`}if(!e.gridRows&&!e.horizontal){o.gridTemplateRows=n?e.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${e.sections.length}, 1fr)`}}else if((a=e.content)===null||a===void 0?void 0:a.length){u=e.content.map((t=>D(this,F,"m",lt).call(this,i,t)));o.gridTemplateColumns=+e.gridCols>0?`repeat(${e.gridCols}, 1fr)`:"";o.gridTemplateRows=+e.gridRows>0?`repeat(${e.gridRows}, 1fr)`:""}const c=n("div",{class:r,style:o},u);return e.title&&!s?n("div",{class:{"input-panel__section_label_container":true}},n("h3",null,e.title),c):c},nt=function t(i,e){var s,o;let l=[];if((s=e.sections)===null||s===void 0?void 0:s.length){l=e.sections.map((e=>D(this,F,"m",t).call(this,i,e)))}else if((o=e.content)===null||o===void 0?void 0:o.length){l=e.content.map((t=>D(this,F,"m",at).call(this,i,t)))}const a=`${$(e.absoluteWidth)}px`;const r=`${z(e.absoluteHeight)}px`;const u=`${S(e.absoluteRow)}px`;const c=`${M(e.absoluteColumn)}px`;const h={position:"absolute",width:a,"min-width":a,"max-width":a,height:r,"min-height":r,"max-height":r,top:u,left:c,overflow:"auto"};return n("div",{style:h},l)},st=function t(i){var e,n;let s=[];if((e=i.content)===null||e===void 0?void 0:e.length){i.content.forEach((t=>{if(t.id){s.push(t.id)}}))}if((n=i.sections)===null||n===void 0?void 0:n.length){i.sections.forEach((i=>{s=s.concat(D(this,F,"m",t).call(this,i))}))}return s},ot=function t(i,e){if(!this.tabSelected){this.tabSelected=e[0].id||"0"}const s=e.map(((t,e)=>{const n=D(this,F,"m",st).call(this,t);const s=i.cells.some((t=>{var i;const e=t.cell;const s=t.column;return n.includes(s.name)&&!!((i=e.data)===null||i===void 0?void 0:i.error)}));return{active:(t.id||`${e}`)===this.tabSelected,value:t.title,icon:s?"error":t.icon,id:t.id||`${e}`,danger:s}}));const o=e.map(((t,e)=>{const n=t.id||`${e}`;return D(this,F,"m",et).call(this,i,t,true,{display:this.tabSelected!==n?"none":"grid"})}));const l=".tab-bar .tab-scroller .tab .tab__content { justify-content: flex-start; }";if(!D(this,V,"f").map((t=>t.event)).includes("kup-tabbar-click")){const t="kup-tabbar-click";const i=t=>{this.tabSelected=t.detail.node.id};this.rootElement.addEventListener(t,i);D(this,V,"f").push({event:t,handler:i})}return n("div",{class:{"input-panel__tabs_container":true}},n("kup-tab-bar",{data:s,customStyle:l}),o)},lt=function t(i,e){const s=i.cells.find((t=>t.column.name===e.id));const o=+e.colSpan>0?e.colSpan:!(+e.colSpan>0)&&!(+e.colStart>0)?1:null;const l=o?`span ${o}`:`${e.colStart}`;const a=+e.colEnd>0?`${e.colEnd}`:"";const r=+e.rowSpan>0?e.rowSpan:!(+e.rowSpan>0)&&!(+e.rowStart>0)?1:null;const u=r?`span ${r}`:`${e.rowStart}`;const c=+e.rowEnd>0?`${e.rowEnd}`:"";const h={"grid-column-start":l,"grid-column-end":a,"grid-row-start":u,"grid-row-end":c};if(!s||!s.cell){return}return n("div",{style:h},D(this,F,"m",X).call(this,s.cell,i.row,s.column))},at=function t(i,e){const s=i.cells.find((t=>t.column.name===e.id));if(!s||!s.cell){return}let o;if(s.cell.shape==c.DATE){o=e.absoluteLength>8?e.absoluteLength:8}else{o=e.absoluteLength}const l=`${$(o)}px`;const a=`${z(1)}px`;const r=`${S(e.absoluteRow)}px`;const u=`${M(e.absoluteColumn)}px`;const h={position:"absolute",width:l,"min-width":l,"max-width":l,height:a,"min-height":a,"max-height":a,top:r,left:u,overflow:"auto"};s.cell.data=Object.assign(Object.assign({},s.cell.data),{customStyle:(s.cell.data.customStyle||"")+".mdc-text-field {height: unset !important;}"});return n("div",{style:h},D(this,F,"m",X).call(this,s.cell,i.row,s.column))},rt=function t(i){var e,n;const s=(e=i===null||i===void 0?void 0:i.rows[0])===null||e===void 0?void 0:e.layout;const o=((n=i===null||i===void 0?void 0:i.rows)===null||n===void 0?void 0:n.length)?i.rows.reduce(((t,e)=>{const n=i.columns.filter((t=>t.visible)).map((t=>{const i=structuredClone(e.cells[t.name]);const n=i?Object.assign(Object.assign({},i),{data:D(this,F,"m",ut).call(this,i,t,s),slotData:D(this,F,"m",pt).call(this,i,t),isEditable:true}):null;return{column:t,cell:n}}));return[...t,{cells:n,row:e}]}),[]):[];o.map((({cells:t})=>t.map((({cell:t,column:i})=>{const e=Rt.ketchup.data.cell.getType(t,t.shape);const n=D(this,G,"f").get(e);if(!n){return}const s=this.rootElement.shadowRoot.querySelector(`${n}[id=${i.name.replace(/\//g,"\\$1")}]`);s===null||s===void 0?void 0:s.setValue(t.value)}))));this.inputPanelCells=o},ut=function t(i,e,n){const s=Object.assign(Object.assign({},D(this,F,"m",ft).call(this,i,e,n)),{disabled:!i.editable,id:e.name});const o=Rt.ketchup.data.cell.getType(i,i.shape);const l=i.data||{},a=E(l,["data"]);return o!==u.MULTI_AUTOCOMPLETE&&o!==u.MULTI_COMBOBOX?D(this,F,"m",ct).call(this,s,Object.assign({},i.data)):Object.assign(Object.assign({},s),a)},ct=function t(i,e){for(const n in e){if(e[n]instanceof Object&&!Array.isArray(e[n])&&n in i){i[n]=D(this,F,"m",t).call(this,i[n],e[n])}else{i[n]=e[n]}}return i},ht=function t(){return this.inputPanelCells.reduce(((t,i)=>{const e=Object.keys(i.row.cells).reduce(((t,e)=>{var n;const s=(n=i.cells.find((t=>t.column.name===e)))===null||n===void 0?void 0:n.cell;let o=s===null||s===void 0?void 0:s.value;if((s===null||s===void 0?void 0:s.shape)===c.TABLE){o=JSON.stringify(D(this,F,"m",Mt).call(this,s.data.data,e))}return Object.assign(Object.assign({},t),{[e]:Object.assign(Object.assign({},i.row.cells[e]),{value:o,obj:s===null||s===void 0?void 0:s.obj})})}),{});return{columns:[...t.columns,...i.cells.map((t=>t.column))],rows:[...t.rows,{cells:e,layout:i.row.layout}]}}),{columns:[],rows:[]})},ft=function t(i,e,n){if(!i){return null}const s=i.options;let o;if(n===null||n===void 0?void 0:n.absolute){o=null}else{o=e.title}const l=i.value;const a=Rt.ketchup.data.cell.getType(i,i.shape);const r=new Map([[u.AUTOCOMPLETE,D(this,F,"m",bt).bind(this)],[u.BUTTON_LIST,D(this,F,"m",vt).bind(this)],[u.CHART,D(this,F,"m",mt).bind(this)],[u.CHIP,D(this,F,"m",dt).bind(this)],[u.CHECKBOX,D(this,F,"m",kt).bind(this)],[u.COLOR_PICKER,D(this,F,"m",gt).bind(this)],[u.COMBOBOX,D(this,F,"m",bt).bind(this)],[u.EDITOR,D(this,F,"m",yt).bind(this)],[u.MULTI_AUTOCOMPLETE,D(this,F,"m",dt).bind(this)],[u.MULTI_COMBOBOX,D(this,F,"m",dt).bind(this)],[u.NUMBER,D(this,F,"m",zt).bind(this)],[u.DATE,D(this,F,"m",wt).bind(this)],[u.OBJECT,D(this,F,"m",Ot).bind(this)],[u.RADIO,D(this,F,"m",jt).bind(this)],[u.STRING,D(this,F,"m",_t).bind(this)],[u.SWITCH,D(this,F,"m",xt).bind(this)],[u.TABLE,D(this,F,"m",St).bind(this)],[u.TIME,D(this,F,"m",$t).bind(this)]]);const c=r.get(a);return c?c(s,o,l,i,e.name):null},pt=function t(i,e){const n=Rt.ketchup.data.cell.getType(i,i.shape);if(!i.editable){return null}if(n===u.CHIP){return{trailingIcon:true,label:e.title,disabled:!i.editable,id:e.name,fullWidth:false}}if(n===u.MULTI_AUTOCOMPLETE||n===u.MULTI_COMBOBOX){return Object.assign(Object.assign({},D(this,F,"m",bt).call(this,i.options,e.title,null,i,e.name)),{showDropDownIcon:true,class:"",style:{width:"100%"},disabled:!i.editable,id:e.name})}return null},dt=function t(i,e,n,s,o){var l,a;if(((l=s.inputSettings)===null||l===void 0?void 0:l.checkObject)||((a=s.inputSettings)===null||a===void 0?void 0:a.checkValueOnExit)||s.mandatory){D(this,F,"m",Bt).call(this,s,o)}return d(n)},mt=function t(){return{data:{sizeX:"50px",offlineMode:{value:"8;4;5"},id:"i1012_GREF_0",cellId:"i1012_GREF_0",sizeY:"50px"}}},vt=function t(i,e,n,s,o){var l,a,r,u;s.data=s.data||{};s.data.onClick=()=>{s.fun?this.customButtonClickHandler({fun:s.fun,cellId:o,currentState:D(this,F,"m",ht).call(this)}):this.submitCb({value:{before:Object.assign({},D(this,P,"f")),after:D(this,F,"m",ht).call(this)},cell:o})};if(((l=s.data)===null||l===void 0?void 0:l.keyShortcut)&&!((a=s.data)===null||a===void 0?void 0:a.disabled)){D(this,L,"f").push((r=s.data)===null||r===void 0?void 0:r.keyShortcut);D(this,B,"f").keysBinding.register((u=s.data)===null||u===void 0?void 0:u.keyShortcut,s.data.onClick.bind(this))}return Object.assign({label:s.value,fun:s.fun},s.data)},bt=function t(i,e,n,s,o){var l,a;const r=m(n,e,[]);if(s.fun){const t=Rt.ketchup.data.cell.getType(s,s.shape);const i=D(this,R,"f").get(t);if(!i){return}i.map((t=>{const i=t=>{D(this,F,"m",Et).call(this,t.detail,s.fun,r,o,n)};this.rootElement.addEventListener(t,i);D(this,V,"f").push({event:t,handler:i})}))}else if(i){r.data["kup-list"].data=D(this,F,"m",Tt).call(this,i,n)}if(((l=s.inputSettings)===null||l===void 0?void 0:l.checkObject)||((a=s.inputSettings)===null||a===void 0?void 0:a.checkValueOnExit)||s.mandatory){D(this,F,"m",Bt).call(this,s,o)}return r},kt=function t(i,e,n,s,o){var l,a;let r=g(n,e);if(((l=s.inputSettings)===null||l===void 0?void 0:l.checkObject)||((a=s.inputSettings)===null||a===void 0?void 0:a.checkValueOnExit)||s.mandatory){return Object.assign(Object.assign({},r),{onBlur:()=>{D(this,F,"m",Ft).call(this,s,o)}})}return r},gt=function t(i,e,n){return{data:{"kup-text-field":{label:e}}}},yt=function t(i,e,n){return{initialValue:n}},_t=function t(i,e,n,s,o){var l,a;if(((l=s.inputSettings)===null||l===void 0?void 0:l.checkObject)||((a=s.inputSettings)===null||a===void 0?void 0:a.checkValueOnExit)||s.mandatory){return{label:e,onBlur:()=>{D(this,F,"m",Ft).call(this,s,o)}}}return{label:e}},jt=function t(i,e,n,s,o){var l,a;let r=v(n,i);if(((l=s.inputSettings)===null||l===void 0?void 0:l.checkObject)||((a=s.inputSettings)===null||a===void 0?void 0:a.checkValueOnExit)||s.mandatory){return Object.assign(Object.assign({},r),{onBlur:()=>{D(this,F,"m",Ft).call(this,s,o)}})}return r},xt=function t(i,e,n){return b(n,e)},wt=function t(i,e,n,s,o){var l,a;if(((l=s.inputSettings)===null||l===void 0?void 0:l.checkObject)||((a=s.inputSettings)===null||a===void 0?void 0:a.checkValueOnExit)||s.mandatory){D(this,F,"m",Bt).call(this,s,o)}return{data:{"kup-text-field":{label:e}},initialValue:n}},Ot=function t(i,e,n,s,o){var l,a;if(((l=s.inputSettings)===null||l===void 0?void 0:l.checkObject)||((a=s.inputSettings)===null||a===void 0?void 0:a.checkValueOnExit)||s.mandatory){return{initialValue:n||"",label:e||" ",value:n||"",onBlur:()=>{D(this,F,"m",Ft).call(this,s,o)}}}return{initialValue:n||"",label:e||" ",value:n||""}},$t=function t(i,e,n,s,o){var l,a;if(((l=s.inputSettings)===null||l===void 0?void 0:l.checkObject)||((a=s.inputSettings)===null||a===void 0?void 0:a.checkValueOnExit)||s.mandatory){D(this,F,"m",Bt).call(this,s,o)}return{data:{"kup-text-field":{label:e}}}},zt=function t(i,e,n,s,o){var l,a;if(((l=s.inputSettings)===null||l===void 0?void 0:l.checkObject)||((a=s.inputSettings)===null||a===void 0?void 0:a.checkValueOnExit)||s.mandatory){return{label:e,onBlur:()=>{D(this,F,"m",Ft).call(this,s,o)}}}return{label:e}},St=function t(i,e,n,s,o){try{let t=JSON.parse(s.value);if(!t){D(this,B,"f").debug.logMessage(this,`Empty value for ${o} cell.`,k.WARNING);return null}if(t.type!=="SmeupDataTable"){D(this,B,"f").debug.logMessage(this,`Wrong data table type for ${o} cell. Type \`SmeupDataTable\` in value expected`,k.ERROR);return null}return{data:{columns:t.columns.map((i=>Object.assign(Object.assign({},i),{obj:t.rows[0].cells[i.name].obj}))),rows:t.rows.map((i=>Object.assign(Object.assign({},i),{cells:Object.keys(i.cells).reduce(((e,n)=>{const s=t.columns.find((t=>t.name===n));return Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},i.cells[n]),{data:Object.assign(Object.assign({},D(this,F,"m",ft).call(this,i.cells[n],s)),{disabled:i.cells[n].editable===false,id:s.id})})})}),{})})))}}}catch(t){D(this,B,"f").debug.logMessage(this,`Invalid value for ${o} cell. Type \`SmeupDataTable\` expected`,k.ERROR);return null}},Mt=function t(i,e){const n=Object.assign(Object.assign({},i),{rows:i.rows.map((t=>Object.assign(Object.assign({},t),{cells:{}})))});const s=i.columns.filter((t=>t.isEditable)).map((t=>t.name));if(!s.length){return n}try{const t=JSON.parse(D(this,P,"f").rows[0].cells[e].value);n.rows=i.rows.map(((i,e)=>s.reduce(((n,s)=>{const o=t.rows[e].cells[s]&&i.cells[s].value!==t.rows[e].cells[s].value;if(o){return Object.assign(Object.assign({},t.rows[e]),{cells:Object.assign(Object.assign({},n.cells),{[s]:Object.assign(Object.assign({},t.rows[e].cells[s]),{value:i.cells[s].value})})})}return Object.assign(Object.assign({},t.rows[e]),{cells:n.cells})}),Object.assign(Object.assign({},t.rows[e]),{cells:{}}))));return n}catch(t){return n}},Tt=function t(i,e){const n=D(this,I,"f").get(i.type);if(n){return n(i,e)}else{return i.map((t=>({value:t.label,id:t.id,selected:e===t.id})))}},Wt=function t(i,e){return i.children.map((i=>{var n;return{id:i.content.codice,value:i.content.testo,selected:e===i.content.codice,children:((n=i.children)===null||n===void 0?void 0:n.length)?D(this,F,"m",t).call(this,i,e):[]}}))},Dt=function t(i,e){return i.children.map((i=>{var n;return{id:i.obj.k,value:i.value,selected:e===i.obj.k,children:((n=i.children)===null||n===void 0?void 0:n.length)?D(this,F,"m",t).call(this,i,e):[]}}))},Ct=function t(i,e){return i.rows.map((t=>{var i;const n=t.fields||t.cells;const[s,o]=Object.keys(n);return{id:n[s].value,value:((i=n[o])===null||i===void 0?void 0:i.value)||n[s].value,selected:e===n[s].value}}))},Et=function t(i,e,n,s,o){if(i.id!==s||i.open===false){return}this.optionsHandler(e,i.inputValue,D(this,F,"m",ht).call(this),i.id).then((t=>{var e;n.data["kup-list"].data=(e=D(this,F,"m",Tt).call(this,t,o))!==null&&e!==void 0?e:[];i.comp.refresh()}))},Ft=async function t(i,e){var n,s;const o=D(this,F,"m",H).call(this,e);if(i.mandatory){D(this,F,"m",It).call(this,e,o.value?null:D(this,B,"f").language.translate(p.REQUIRED_VALUE));if(!o.value){return}}if(((n=i.inputSettings)===null||n===void 0?void 0:n.checkObject)&&o.value){const{valid:t}=await this.checkValidObjCallback({obj:i.obj,currentState:D(this,F,"m",ht).call(this),fun:i.fun});if(t){D(this,F,"m",It).call(this,e,null)}else{D(this,F,"m",It).call(this,e,D(this,B,"f").language.translate(p.INVALID_VALUE));return}}if(((s=i.inputSettings)===null||s===void 0?void 0:s.checkValueOnExit)&&D(this,F,"m",Pt).call(this)){this.checkValidValueCallback({before:Object.assign({},D(this,P,"f")),after:D(this,F,"m",ht).call(this)})}},Bt=function t(i,e){const n=D(this,N,"f").get(i.shape);if(!n){return}const s=async t=>{var n,s;const o=D(this,F,"m",H).call(this,e);if(t.detail.id!==e){return}if(i.mandatory){D(this,F,"m",It).call(this,e,o.value?null:D(this,B,"f").language.translate(p.REQUIRED_VALUE));if(!t.detail.value){return}}if(((n=i.inputSettings)===null||n===void 0?void 0:n.checkObject)&&t.detail.value){const{valid:t}=await this.checkValidObjCallback({obj:i.obj,currentState:D(this,F,"m",ht).call(this),fun:i.fun});D(this,F,"m",It).call(this,e,t?null:D(this,B,"f").language.translate(p.REQUIRED_VALUE));if(!t){return}}if(((s=i.inputSettings)===null||s===void 0?void 0:s.checkValueOnExit)&&D(this,F,"m",Pt).call(this)){this.checkValidValueCallback({before:Object.assign({},D(this,P,"f")),after:D(this,F,"m",ht).call(this)})}};this.rootElement.addEventListener(n,s);D(this,V,"f").push({event:n,handler:s})},It=function t(i,e){this.inputPanelCells=this.inputPanelCells.map((t=>Object.assign(Object.assign({},t),{cells:t.cells.map((({cell:t,column:n})=>{const s=n.name===i?Object.assign(Object.assign({},t.data),{error:e}):t.data;return{column:n,cell:Object.assign(Object.assign({},t),{data:s})}}))})))},Pt=function t(){return this.inputPanelCells.some((({cells:t,row:i})=>t.some((({cell:t,column:{name:e}})=>t.value!==i.cells[e].value))))};Nt.style=W;export{Nt as kup_input_panel};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as i,f as e,h as n,H as s,d as l}from"./p-d7c15b0e.js";import{F as o}from"./p-cc32b7a2.js";import{F as r}from"./p-49485bbf.js";import{k as a,a5 as u,F as c,g as h,s as f,h as p,al as d,ab as m,aa as v,am as b,e as k,ak as g}from"./p-f98dc5f6.js";import{F as y}from"./p-c4054aba.js";import{c as _}from"./p-635bb4b3.js";import"./p-e3062c19.js";import"./p-2b519589.js";import"./p-5d03c077.js";import"./p-9b0551b5.js";import"./p-2b14f215.js";import"./p-029c7cbe.js";import"./p-d4a879fc.js";var j;(function(t){t["TAB"]="tab"})(j||(j={}));var x;(function(t){t["customStyle"]="Custom style of the component.";t["data"]="Actual data of the input panel.";t["hiddenSubmitButton"]="Creates a hidden submit button in order to submit the form with enter.";t["submitCb"]="Sets the callback function on submit form";t["optionsHandler"]="Sets the callback function to recieve options"})(x||(x={}));const w=12;const O=22;const $=t=>{if(t==0){return w/2}if(!t){return null}if(t===1){return 1.5*w}return t*w};const z=t=>{if(!t){return null}return t*O};const S=t=>{if(!t){return null}return(t-1)*O};const M=t=>{if(!t){return null}return t*w};const T=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:14px;line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_input_panel_background_color:var(\n --kup-input-panel-background-color,\n var(--kup-layer-0)\n );--kup_input_panel_color:var(\n --kup-input-panel-color,\n var(--kup-text-secondary)\n );--kup_input_panel_font_family:var(\n --kup-input-panel-font-family,\n var(--kup-font-family)\n );--kup_input_panel_font_size:var(\n --kup-input-panel-font-size,\n var(--kup-font-size)\n );--kup_input_panel_label_alignment:var(--kup-input-panel-label-alignment);--kup_input_panel_label_width:var(--kup-input-panel-label-width);--kup_input_panel_padding:var(--kup-input-panel-padding, 1em 0)}:host .input-panel{background:var(--kup_input_panel_background_color);color:var(--kup_input_panel_color);display:flex;flex-grow:1;overflow:auto;padding:var(--kup_input_panel_padding);position:relative;gap:2rem}:host .input-panel--column{flex-direction:column}:host .input-panel__section_label_container{display:flex;flex-direction:column;gap:1rem}:host .input-panel__section{display:grid}:host .input-panel__section .f-cell__content>*{width:100%}:host .input-panel__horizontal-section{display:inline-grid}:host .input-panel .f-cell .f-checkbox .checkbox .checkbox__native-control{height:40px;width:40px}:host .input-panel__label_container{display:flex;flex-direction:column;justify-content:center}:host .input-panel__label_container>.f-cell{flex:1}:host .input-panel__tabs_container{display:flex;flex-direction:column;justify-content:center;gap:2rem}:host .input-panel .f-cell.number-cell .f-cell__content{--kup-textfield-font-family:var(--kup_cell_font_family);font-family:var(--kup_cell_font_family)}:host .input-panel .input-panel-label{display:flex;width:100%;height:100%;align-items:center;justify-content:center}:host .input-panel--absolute{height:40ch;justify-content:flex-end}:host .input-panel--absolute .input-panel-label{justify-content:start}:host .input-panel--absolute .mdc-text-field{height:unset !important}";const W=T;var D=undefined&&undefined.__classPrivateFieldGet||function(t,i,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof i==="function"?t!==i||!n:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(t):n?n.value:i.get(t)};var C=undefined&&undefined.__classPrivateFieldSet||function(t,i,e,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof i==="function"?t!==i||!s:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,e):s?s.value=e:i.set(t,e),e};var E=undefined&&undefined.__rest||function(t,i){var e={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&i.indexOf(n)<0)e[n]=t[n];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++){if(i.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s]))e[n[s]]=t[n[s]]}return e};var F,B,I,P,R,N,V,G,J,A,L,H,K,X,Y,q,Q,U,Z,tt,it,et,nt,st,lt,ot,rt,at,ut,ct,ht,ft,pt,dt,mt,vt,bt,kt,gt,yt,_t,jt,xt,wt,Ot,$t,zt,St,Mt,Tt,Wt,Dt,Ct,Et,Ft,Bt,It,Pt;const Rt=document.documentElement;const Nt=class{constructor(e){t(this,e);this.kupReady=i(this,"kup-input-panel-ready",6);F.add(this);B.set(this,a());I.set(this,new Map([["SmeupTreeNode",D(this,F,"m",Wt).bind(this)],["SmeupDataTree",D(this,F,"m",Dt).bind(this)],["SmeupTable",D(this,F,"m",Ct).bind(this)],["SmeupDataTable",D(this,F,"m",Ct).bind(this)]]));P.set(this,null);R.set(this,new Map([[u.AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[u.MULTI_AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[u.COMBOBOX,["kup-combobox-iconclick","kup-combobox-blur"]],[u.MULTI_COMBOBOX,["kup-combobox-iconclick"]]]));N.set(this,new Map([[c.AUTOCOMPLETE,"kup-autocomplete-blur"],[c.CHIP,"kup-textfield-blur"],[c.COMBOBOX,"kup-combobox-blur"],[c.DATE,"kup-datepicker-blur"],[c.MULTI_AUTOCOMPLETE,"kup-autocomplete-blur"],[c.MULTI_COMBOBOX,"kup-combobox-blur"],[c.TIME,"kup-timepicker-blur"]]));V.set(this,[]);G.set(this,new Map([[u.DATE,"kup-date-picker"],[u.TIME,"kup-time-picker"]]));J.set(this,new Map([[c.BUTTON_LIST,D(this,F,"m",Y).bind(this)],[c.EDITOR,D(this,F,"m",q).bind(this)],[c.LABEL,D(this,F,"m",U).bind(this)],[c.TABLE,D(this,F,"m",Q).bind(this)]]));A.set(this,new Map([[j.TAB,D(this,F,"m",lt).bind(this)]]));L.set(this,[]);this.customStyle="";this.data=null;this.hiddenSubmitButton=false;this.submitCb=null;this.optionsHandler=null;this.customButtonClickHandler=null;this.checkValidObjCallback=null;this.checkValidValueCallback=null;this.inputPanelCells=[];this.tabSelected=null}onDataChanged(){C(this,P,structuredClone(this.data),"f");if(D(this,V,"f").length){D(this,V,"f").map((({event:t,handler:i})=>{this.rootElement.removeEventListener(t,i)}));C(this,V,[],"f")}if(D(this,L,"f").length){D(this,L,"f").map((t=>{D(this,B,"f").keysBinding.unregister(t)}));C(this,L,[],"f")}D(this,F,"m",at).call(this,this.data)}async getProps(t){return h(this,x,t)}async refresh(){e(this)}async setProps(t){f(this,x,t)}componentWillLoad(){D(this,B,"f").debug.logLoad(this,false);D(this,B,"f").language.register(this);D(this,B,"f").theme.register(this);this.onDataChanged()}componentDidLoad(){this.kupReady.emit({comp:this,id:this.rootElement.id});D(this,B,"f").debug.logLoad(this,true)}componentWillRender(){D(this,B,"f").debug.logRender(this,false)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const i=t.querySelectorAll(".f-text-field");for(let t=0;t<i.length;t++){y(i[t])}}D(this,B,"f").debug.logRender(this,true)}render(){const t=Boolean(!this.inputPanelCells.length);const i=t?[n("p",null,D(this,B,"f").language.translate(p.EMPTY_DATA))]:this.inputPanelCells.map((t=>D(this,F,"m",K).call(this,t)));return n(s,{key:"424cf4fea72c35eaf738e96a13da3186cbf86d66"},n("style",{key:"1ad0a18733d45a7f28f5518d85623ea0530c1d16"},D(this,B,"f").theme.setKupStyle(this.rootElement)),n("div",{key:"834d8f4056a8b9f1f913b9f968db4256dca2ff70",id:_},i))}disconnectedCallback(){D(this,B,"f").language.unregister(this);D(this,B,"f").theme.unregister(this)}get rootElement(){return l(this)}static get watchers(){return{data:["onDataChanged"]}}};B=new WeakMap,I=new WeakMap,P=new WeakMap,R=new WeakMap,N=new WeakMap,V=new WeakMap,G=new WeakMap,J=new WeakMap,A=new WeakMap,L=new WeakMap,F=new WeakSet,H=function t(i){return this.inputPanelCells.reduce(((t,{cells:e})=>{if(!t){return e.find((({column:t})=>t.name===i)).cell}return t}),null)},K=function t(i){var e;const s=i.row.layout;const l=(s===null||s===void 0?void 0:s.horizontal)||false;const r={};let a;if(!((e=s===null||s===void 0?void 0:s.sections)===null||e===void 0?void 0:e.length)){a=i.cells.map((t=>D(this,F,"m",X).call(this,t.cell,i.row,t.column)))}else{if(s.absolute){a=D(this,F,"m",it).call(this,i,s)}else{if(!s.sectionsType){const t=s.sections.some((t=>t.dim));r.display="grid";if(s.horizontal){r.gridTemplateColumns=t?s.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${s.sections.length}, 1fr)`}else{r.gridTemplateRows=t?s.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${s.sections.length}, 1fr)`}}a=D(this,F,"m",tt).call(this,i,s)}}const u={"input-panel":true,"input-panel--column":!l,"input-panel--absolute":s===null||s===void 0?void 0:s.absolute};return n("form",{name:this.rootElement.id,onSubmit:t=>{t.preventDefault();this.submitCb({value:{before:Object.assign({},D(this,P,"f")),after:D(this,F,"m",ht).call(this)}})}},n("div",{class:u,style:r},a),!this.hiddenSubmitButton?n(o,{buttonType:"submit",label:D(this,B,"f").language.translate(p.CONFIRM),wrapperClass:"form__submit"}):null)},X=function t(i,e,s){if(!i){return}const l=D(this,J,"f").get(i.shape);if(l!==undefined){return l(i,s.name)}const o={cell:i,column:s,row:e,component:this,editable:true,renderKup:true,setSizes:true};const a=D(this,F,"m",Z).call(this,i,s.title);if(a){return n("div",{class:{"input-panel__label_container":true}},a,n(r,Object.assign({},o)))}return n(r,Object.assign({},o))},Y=function t(i,e){return n(o,Object.assign({icon:i.icon,id:e},i.data,{wrapperClass:"form__submit"}))},q=function t(i,e){const s="kup-editor-save";const l=t=>{const i=this.inputPanelCells.reduce(((t,{cells:i})=>{if(!t){return i.find((({column:t})=>t.name===e)).cell}return t}),null);i.value=t.detail.htmlValue.replace(/\n/g,"<br>")};this.rootElement.addEventListener(s,l);D(this,V,"f").push({event:s,handler:l});return n("kup-editor",Object.assign({},i.data,{id:e,isReadOnly:!i.isEditable,showToolbar:true}))},Q=function t(i,e){return n("kup-data-table",Object.assign({id:e,editableData:true,showGroups:true,showFilters:true,showFooter:true},i.data))},U=function t(i,e){return n("span",{class:"input-panel-label",id:e},i.value)},Z=function t(i,e){if(!e){return null}const s=Rt.ketchup.data.cell.getType(i,i.shape);if(s===u.RADIO){return n("span",null,e)}return null},tt=function t(i,e){const n=D(this,A,"f").get(e.sectionsType);return n?n(i,e.sections):e.sections.map((t=>D(this,F,"m",et).call(this,i,t)))},it=function t(i,e){return e.sections.map((t=>D(this,F,"m",nt).call(this,i,t)))},et=function t(i,e,s=false,l={}){var o,r;const a={"input-panel__section":!e.horizontal,"input-panel__horizontal-section":e.horizontal};l.gap=+e.gap>0?`${e.gap}rem`:"1rem";let u=[];if((o=e.sections)===null||o===void 0?void 0:o.length){u=e.sections.map((e=>D(this,F,"m",t).call(this,i,e)));const n=e.sections.some((t=>t.dim));if(!e.gridCols&&e.horizontal){l.gridTemplateColumns=n?e.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${e.sections.length}, 1fr)`}if(!e.gridRows&&!e.horizontal){l.gridTemplateRows=n?e.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${e.sections.length}, 1fr)`}}else if((r=e.content)===null||r===void 0?void 0:r.length){u=e.content.map((t=>D(this,F,"m",ot).call(this,i,t)));l.gridTemplateColumns=+e.gridCols>0?`repeat(${e.gridCols}, 1fr)`:"";l.gridTemplateRows=+e.gridRows>0?`repeat(${e.gridRows}, 1fr)`:""}const c=n("div",{class:a,style:l},u);return e.title&&!s?n("div",{class:{"input-panel__section_label_container":true}},n("h3",null,e.title),c):c},nt=function t(i,e){var s,l;let o=[];if((s=e.sections)===null||s===void 0?void 0:s.length){o=e.sections.map((e=>D(this,F,"m",t).call(this,i,e)))}else if((l=e.content)===null||l===void 0?void 0:l.length){o=e.content.map((t=>D(this,F,"m",rt).call(this,i,t)))}const r=`${$(e.absoluteWidth)}px`;const a=`${z(e.absoluteHeight)}px`;const u=`${S(e.absoluteRow)}px`;const c=`${M(e.absoluteColumn)}px`;const h={position:"absolute",width:r,"min-width":r,"max-width":r,height:a,"min-height":a,"max-height":a,top:u,left:c,overflow:"auto"};return n("div",{style:h},o)},st=function t(i){var e,n;let s=[];if((e=i.content)===null||e===void 0?void 0:e.length){i.content.forEach((t=>{if(t.id){s.push(t.id)}}))}if((n=i.sections)===null||n===void 0?void 0:n.length){i.sections.forEach((i=>{s=s.concat(D(this,F,"m",t).call(this,i))}))}return s},lt=function t(i,e){if(!this.tabSelected){this.tabSelected=e[0].id||"0"}const s=e.map(((t,e)=>{const n=D(this,F,"m",st).call(this,t);const s=i.cells.some((t=>{var i;const e=t.cell;const s=t.column;return n.includes(s.name)&&!!((i=e.data)===null||i===void 0?void 0:i.error)}));return{active:(t.id||`${e}`)===this.tabSelected,value:t.title,icon:s?"error":t.icon,id:t.id||`${e}`,danger:s}}));const l=e.map(((t,e)=>{const n=t.id||`${e}`;return D(this,F,"m",et).call(this,i,t,true,{display:this.tabSelected!==n?"none":"grid"})}));const o=".tab-bar .tab-scroller .tab .tab__content { justify-content: flex-start; }";if(!D(this,V,"f").map((t=>t.event)).includes("kup-tabbar-click")){const t="kup-tabbar-click";const i=t=>{this.tabSelected=t.detail.node.id};this.rootElement.addEventListener(t,i);D(this,V,"f").push({event:t,handler:i})}return n("div",{class:{"input-panel__tabs_container":true}},n("kup-tab-bar",{data:s,customStyle:o}),l)},ot=function t(i,e){const s=i.cells.find((t=>t.column.name===e.id));const l=+e.colSpan>0?e.colSpan:!(+e.colSpan>0)&&!(+e.colStart>0)?1:null;const o=l?`span ${l}`:`${e.colStart}`;const r=+e.colEnd>0?`${e.colEnd}`:"";const a=+e.rowSpan>0?e.rowSpan:!(+e.rowSpan>0)&&!(+e.rowStart>0)?1:null;const u=a?`span ${a}`:`${e.rowStart}`;const c=+e.rowEnd>0?`${e.rowEnd}`:"";const h={"grid-column-start":o,"grid-column-end":r,"grid-row-start":u,"grid-row-end":c};if(!s||!s.cell){return}return n("div",{style:h},D(this,F,"m",X).call(this,s.cell,i.row,s.column))},rt=function t(i,e){const s=i.cells.find((t=>t.column.name===e.id));if(!s||!s.cell){return}let l;if(s.cell.shape==c.DATE){l=e.absoluteLength>8?e.absoluteLength:8}else{l=e.absoluteLength}const o=`${$(l)}px`;const r=`${z(1)}px`;const a=`${S(e.absoluteRow)}px`;const u=`${M(e.absoluteColumn)}px`;const h={position:"absolute",width:o,"min-width":o,"max-width":o,height:r,"min-height":r,"max-height":r,top:a,left:u,overflow:"auto"};s.cell.data=Object.assign(Object.assign({},s.cell.data),{customStyle:(s.cell.data.customStyle||"")+".mdc-text-field {height: unset !important;}"});return n("div",{style:h},D(this,F,"m",X).call(this,s.cell,i.row,s.column))},at=function t(i){var e,n;const s=(e=i===null||i===void 0?void 0:i.rows[0])===null||e===void 0?void 0:e.layout;const l=((n=i===null||i===void 0?void 0:i.rows)===null||n===void 0?void 0:n.length)?i.rows.reduce(((t,e)=>{const n=i.columns.filter((t=>t.visible)).map((t=>{const i=structuredClone(e.cells[t.name]);const n=i?Object.assign(Object.assign({},i),{data:D(this,F,"m",ut).call(this,i,t,s),slotData:D(this,F,"m",pt).call(this,i,t),isEditable:true}):null;return{column:t,cell:n}}));return[...t,{cells:n,row:e}]}),[]):[];l.map((({cells:t})=>t.map((({cell:t,column:i})=>{const e=Rt.ketchup.data.cell.getType(t,t.shape);const n=D(this,G,"f").get(e);if(!n){return}const s=this.rootElement.shadowRoot.querySelector(`${n}[id=${i.name.replace(/\//g,"\\$1")}]`);s===null||s===void 0?void 0:s.setValue(t.value)}))));this.inputPanelCells=l},ut=function t(i,e,n){const s=Object.assign(Object.assign({},D(this,F,"m",ft).call(this,i,e,n)),{disabled:!i.editable,id:e.name});const l=Rt.ketchup.data.cell.getType(i,i.shape);const o=i.data||{},r=E(o,["data"]);return l!==u.MULTI_AUTOCOMPLETE&&l!==u.MULTI_COMBOBOX?D(this,F,"m",ct).call(this,s,Object.assign({},i.data)):Object.assign(Object.assign({},s),r)},ct=function t(i,e){for(const n in e){if(e[n]instanceof Object&&!Array.isArray(e[n])&&n in i){i[n]=D(this,F,"m",t).call(this,i[n],e[n])}else{i[n]=e[n]}}return i},ht=function t(){return this.inputPanelCells.reduce(((t,i)=>{const e=Object.keys(i.row.cells).reduce(((t,e)=>{var n;const s=(n=i.cells.find((t=>t.column.name===e)))===null||n===void 0?void 0:n.cell;let l=s===null||s===void 0?void 0:s.value;if((s===null||s===void 0?void 0:s.shape)===c.TABLE){l=JSON.stringify(D(this,F,"m",Mt).call(this,s.data.data,e))}return Object.assign(Object.assign({},t),{[e]:Object.assign(Object.assign({},i.row.cells[e]),{value:l,obj:s===null||s===void 0?void 0:s.obj})})}),{});return{columns:[...t.columns,...i.cells.map((t=>t.column))],rows:[...t.rows,{cells:e,layout:i.row.layout}]}}),{columns:[],rows:[]})},ft=function t(i,e,n){if(!i){return null}const s=i.options;let l;if(n===null||n===void 0?void 0:n.absolute){l=null}else{l=e.title}const o=i.value;const r=Rt.ketchup.data.cell.getType(i,i.shape);const a=new Map([[u.AUTOCOMPLETE,D(this,F,"m",bt).bind(this)],[u.BUTTON_LIST,D(this,F,"m",vt).bind(this)],[u.CHART,D(this,F,"m",mt).bind(this)],[u.CHIP,D(this,F,"m",dt).bind(this)],[u.CHECKBOX,D(this,F,"m",kt).bind(this)],[u.COLOR_PICKER,D(this,F,"m",gt).bind(this)],[u.COMBOBOX,D(this,F,"m",bt).bind(this)],[u.EDITOR,D(this,F,"m",yt).bind(this)],[u.MULTI_AUTOCOMPLETE,D(this,F,"m",dt).bind(this)],[u.MULTI_COMBOBOX,D(this,F,"m",dt).bind(this)],[u.NUMBER,D(this,F,"m",zt).bind(this)],[u.DATE,D(this,F,"m",wt).bind(this)],[u.OBJECT,D(this,F,"m",Ot).bind(this)],[u.RADIO,D(this,F,"m",jt).bind(this)],[u.STRING,D(this,F,"m",_t).bind(this)],[u.SWITCH,D(this,F,"m",xt).bind(this)],[u.TABLE,D(this,F,"m",St).bind(this)],[u.TIME,D(this,F,"m",$t).bind(this)]]);const c=a.get(r);return c?c(s,l,o,i,e.name):null},pt=function t(i,e){const n=Rt.ketchup.data.cell.getType(i,i.shape);if(!i.editable){return null}if(n===u.CHIP){return{trailingIcon:true,label:e.title,disabled:!i.editable,id:e.name,fullWidth:false}}if(n===u.MULTI_AUTOCOMPLETE||n===u.MULTI_COMBOBOX){return Object.assign(Object.assign({},D(this,F,"m",bt).call(this,i.options,e.title,null,i,e.name)),{showDropDownIcon:true,class:"",style:{width:"100%"},disabled:!i.editable,id:e.name})}return null},dt=function t(i,e,n,s,l){var o,r;if(((o=s.inputSettings)===null||o===void 0?void 0:o.checkObject)||((r=s.inputSettings)===null||r===void 0?void 0:r.checkValueOnExit)||s.mandatory){D(this,F,"m",Bt).call(this,s,l)}return d(n)},mt=function t(){return{data:{sizeX:"50px",offlineMode:{value:"8;4;5"},id:"i1012_GREF_0",cellId:"i1012_GREF_0",sizeY:"50px"}}},vt=function t(i,e,n,s,l){var o,r,a,u;s.data=s.data||{};s.data.onClick=()=>{s.fun?this.customButtonClickHandler({fun:s.fun,cellId:l,currentState:D(this,F,"m",ht).call(this)}):this.submitCb({value:{before:Object.assign({},D(this,P,"f")),after:D(this,F,"m",ht).call(this)},cell:l})};if(((o=s.data)===null||o===void 0?void 0:o.keyShortcut)&&!((r=s.data)===null||r===void 0?void 0:r.disabled)){D(this,L,"f").push((a=s.data)===null||a===void 0?void 0:a.keyShortcut);D(this,B,"f").keysBinding.register((u=s.data)===null||u===void 0?void 0:u.keyShortcut,s.data.onClick.bind(this))}return Object.assign({label:s.value,fun:s.fun},s.data)},bt=function t(i,e,n,s,l){var o,r;const a=m(n,e,[]);if(s.fun){const t=Rt.ketchup.data.cell.getType(s,s.shape);const i=D(this,R,"f").get(t);if(!i){return}i.map((t=>{const i=t=>{D(this,F,"m",Et).call(this,t.detail,s.fun,a,l,n)};this.rootElement.addEventListener(t,i);D(this,V,"f").push({event:t,handler:i})}))}else if(i){a.data["kup-list"].data=D(this,F,"m",Tt).call(this,i,n)}if(((o=s.inputSettings)===null||o===void 0?void 0:o.checkObject)||((r=s.inputSettings)===null||r===void 0?void 0:r.checkValueOnExit)||s.mandatory){D(this,F,"m",Bt).call(this,s,l)}return a},kt=function t(i,e,n,s,l){var o,r;let a=g(n,e);if(((o=s.inputSettings)===null||o===void 0?void 0:o.checkObject)||((r=s.inputSettings)===null||r===void 0?void 0:r.checkValueOnExit)||s.mandatory){return Object.assign(Object.assign({},a),{onBlur:()=>{D(this,F,"m",Ft).call(this,s,l)}})}return a},gt=function t(i,e,n){return{data:{"kup-text-field":{label:e}}}},yt=function t(i,e,n){return{initialValue:n}},_t=function t(i,e,n,s,l){var o,r;if(((o=s.inputSettings)===null||o===void 0?void 0:o.checkObject)||((r=s.inputSettings)===null||r===void 0?void 0:r.checkValueOnExit)||s.mandatory){return{label:e,onBlur:()=>{D(this,F,"m",Ft).call(this,s,l)}}}return{label:e}},jt=function t(i,e,n,s,l){var o,r;let a=v(n,i);if(((o=s.inputSettings)===null||o===void 0?void 0:o.checkObject)||((r=s.inputSettings)===null||r===void 0?void 0:r.checkValueOnExit)||s.mandatory){return Object.assign(Object.assign({},a),{onBlur:()=>{D(this,F,"m",Ft).call(this,s,l)}})}return a},xt=function t(i,e,n){return b(n,e)},wt=function t(i,e,n,s,l){var o,r;if(((o=s.inputSettings)===null||o===void 0?void 0:o.checkObject)||((r=s.inputSettings)===null||r===void 0?void 0:r.checkValueOnExit)||s.mandatory){D(this,F,"m",Bt).call(this,s,l)}return{data:{"kup-text-field":{label:e}},initialValue:n}},Ot=function t(i,e,n,s,l){var o,r;if(((o=s.inputSettings)===null||o===void 0?void 0:o.checkObject)||((r=s.inputSettings)===null||r===void 0?void 0:r.checkValueOnExit)||s.mandatory){return{initialValue:n||"",label:e||" ",value:n||"",onBlur:()=>{D(this,F,"m",Ft).call(this,s,l)}}}return{initialValue:n||"",label:e||" ",value:n||""}},$t=function t(i,e,n,s,l){var o,r;if(((o=s.inputSettings)===null||o===void 0?void 0:o.checkObject)||((r=s.inputSettings)===null||r===void 0?void 0:r.checkValueOnExit)||s.mandatory){D(this,F,"m",Bt).call(this,s,l)}return{data:{"kup-text-field":{label:e}}}},zt=function t(i,e,n,s,l){var o,r;if(((o=s.inputSettings)===null||o===void 0?void 0:o.checkObject)||((r=s.inputSettings)===null||r===void 0?void 0:r.checkValueOnExit)||s.mandatory){return{label:e,onBlur:()=>{D(this,F,"m",Ft).call(this,s,l)}}}return{label:e}},St=function t(i,e,n,s,l){try{let t=JSON.parse(s.value);if(!t){D(this,B,"f").debug.logMessage(this,`Empty value for ${l} cell.`,k.WARNING);return null}if(t.type!=="SmeupDataTable"){D(this,B,"f").debug.logMessage(this,`Wrong data table type for ${l} cell. Type \`SmeupDataTable\` in value expected`,k.ERROR);return null}return{data:{columns:t.columns.map((i=>Object.assign(Object.assign({},i),{obj:t.rows[0].cells[i.name].obj}))),rows:t.rows.map((i=>Object.assign(Object.assign({},i),{cells:Object.keys(i.cells).reduce(((e,n)=>{const s=t.columns.find((t=>t.name===n));return Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},i.cells[n]),{data:Object.assign(Object.assign({},D(this,F,"m",ft).call(this,i.cells[n],s)),{disabled:i.cells[n].editable===false,id:s.id})})})}),{})})))}}}catch(t){D(this,B,"f").debug.logMessage(this,`Invalid value for ${l} cell. Type \`SmeupDataTable\` expected`,k.ERROR);return null}},Mt=function t(i,e){const n=Object.assign(Object.assign({},i),{rows:i.rows.map((t=>Object.assign(Object.assign({},t),{cells:{}})))});const s=i.columns.filter((t=>t.isEditable)).map((t=>t.name));if(!s.length){return n}try{const t=JSON.parse(D(this,P,"f").rows[0].cells[e].value);n.rows=i.rows.map(((i,e)=>s.reduce(((n,s)=>{const l=t.rows[e].cells[s]&&i.cells[s].value!==t.rows[e].cells[s].value;if(l){return Object.assign(Object.assign({},t.rows[e]),{cells:Object.assign(Object.assign({},n.cells),{[s]:Object.assign(Object.assign({},t.rows[e].cells[s]),{value:i.cells[s].value})})})}return Object.assign(Object.assign({},t.rows[e]),{cells:n.cells})}),Object.assign(Object.assign({},t.rows[e]),{cells:{}}))));return n}catch(t){return n}},Tt=function t(i,e){const n=D(this,I,"f").get(i.type);if(n){return n(i,e)}else{return i.map((t=>({value:t.label,id:t.id,selected:e===t.id})))}},Wt=function t(i,e){return i.children.map((i=>{var n;return{id:i.content.codice,value:i.content.testo,selected:e===i.content.codice,children:((n=i.children)===null||n===void 0?void 0:n.length)?D(this,F,"m",t).call(this,i,e):[]}}))},Dt=function t(i,e){return i.children.map((i=>{var n;return{id:i.obj.k,value:i.value,selected:e===i.obj.k,children:((n=i.children)===null||n===void 0?void 0:n.length)?D(this,F,"m",t).call(this,i,e):[]}}))},Ct=function t(i,e){return i.rows.map((t=>{var i;const n=t.fields||t.cells;const[s,l]=Object.keys(n);return{id:n[s].value,value:((i=n[l])===null||i===void 0?void 0:i.value)||n[s].value,selected:e===n[s].value}}))},Et=function t(i,e,n,s,l){if(i.id!==s||i.open===false){return}this.optionsHandler(e,i.inputValue,D(this,F,"m",ht).call(this),i.id).then((t=>{var e;n.data["kup-list"].data=(e=D(this,F,"m",Tt).call(this,t,l))!==null&&e!==void 0?e:[];i.comp.refresh()}))},Ft=async function t(i,e){var n,s;const l=D(this,F,"m",H).call(this,e);if(i.mandatory){D(this,F,"m",It).call(this,e,l.value?null:D(this,B,"f").language.translate(p.REQUIRED_VALUE));if(!l.value){return}}else{D(this,F,"m",It).call(this,e,null)}if(((n=i.inputSettings)===null||n===void 0?void 0:n.checkObject)&&l.value){const{valid:t}=await this.checkValidObjCallback({obj:i.obj,currentState:D(this,F,"m",ht).call(this),fun:i.fun});if(t){D(this,F,"m",It).call(this,e,null)}else{D(this,F,"m",It).call(this,e,D(this,B,"f").language.translate(p.INVALID_VALUE));return}}if(((s=i.inputSettings)===null||s===void 0?void 0:s.checkValueOnExit)&&D(this,F,"m",Pt).call(this)){this.checkValidValueCallback({before:Object.assign({},D(this,P,"f")),after:D(this,F,"m",ht).call(this)})}},Bt=function t(i,e){const n=D(this,N,"f").get(i.shape);if(!n){return}const s=async t=>{var n,s;const l=D(this,F,"m",H).call(this,e);if(t.detail.id!==e){return}if(i.mandatory){D(this,F,"m",It).call(this,e,l.value?null:D(this,B,"f").language.translate(p.REQUIRED_VALUE));if(!t.detail.value){return}}else{D(this,F,"m",It).call(this,e,null)}if(((n=i.inputSettings)===null||n===void 0?void 0:n.checkObject)&&t.detail.value){const{valid:t}=await this.checkValidObjCallback({obj:i.obj,currentState:D(this,F,"m",ht).call(this),fun:i.fun});D(this,F,"m",It).call(this,e,t?null:D(this,B,"f").language.translate(p.INVALID_VALUE));if(!t){return}}if(((s=i.inputSettings)===null||s===void 0?void 0:s.checkValueOnExit)&&D(this,F,"m",Pt).call(this)){this.checkValidValueCallback({before:Object.assign({},D(this,P,"f")),after:D(this,F,"m",ht).call(this)})}};this.rootElement.addEventListener(n,s);D(this,V,"f").push({event:n,handler:s})},It=function t(i,e){this.inputPanelCells=this.inputPanelCells.map((t=>Object.assign(Object.assign({},t),{cells:t.cells.map((({cell:t,column:n})=>{const s=n.name===i?Object.assign(Object.assign({},t.data),{error:e}):t.data;return{column:n,cell:Object.assign(Object.assign({},t),{data:s})}}))})))},Pt=function t(){return this.inputPanelCells.some((({cells:t,row:i})=>t.some((({cell:t,column:{name:e}})=>t.value!==i.cells[e].value))))};Nt.style=W;export{Nt as kup_input_panel};
|
|
2
|
+
//# sourceMappingURL=p-4d6644f0.entry.js.map
|