@sme.up/ketchup 11.0.0-SNAPSHOT-20241107091530 → 11.0.0-SNAPSHOT-20241107155833
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-32c25f65.js → f-cell-6c56dc27.js} +4 -4
- package/dist/cjs/{f-cell-32c25f65.js.map → f-cell-6c56dc27.js.map} +1 -1
- package/dist/cjs/{f-chip-3118b9ba.js → f-chip-ba07ec67.js} +2 -2
- package/dist/cjs/{f-chip-3118b9ba.js.map → f-chip-ba07ec67.js.map} +1 -1
- package/dist/cjs/{f-paginator-utils-3099b4b3.js → f-paginator-utils-34835b29.js} +2 -2
- package/dist/cjs/{f-paginator-utils-3099b4b3.js.map → f-paginator-utils-34835b29.js.map} +1 -1
- package/dist/cjs/{f-text-field-1ced2cfa.js → f-text-field-e1540ae4.js} +2 -2
- package/dist/cjs/{f-text-field-1ced2cfa.js.map → f-text-field-e1540ae4.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-457ee6aa.js → kup-data-table-helper-ca99429e.js} +2 -2
- package/dist/cjs/{kup-data-table-helper-457ee6aa.js.map → kup-data-table-helper-ca99429e.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 +4 -4
- 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-65839aad.js → kup-manager-458527e9.js} +2 -2
- package/dist/cjs/kup-manager-458527e9.js.map +1 -0
- 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/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/components/kup-manager.js +1 -1
- package/dist/components/kup-manager.js.map +1 -1
- package/dist/esm/{f-cell-678a99c3.js → f-cell-dc6e3d13.js} +4 -4
- package/dist/esm/{f-cell-678a99c3.js.map → f-cell-dc6e3d13.js.map} +1 -1
- package/dist/esm/{f-chip-b0b7b121.js → f-chip-ba5e40f4.js} +2 -2
- package/dist/esm/{f-chip-b0b7b121.js.map → f-chip-ba5e40f4.js.map} +1 -1
- package/dist/esm/{f-paginator-utils-56f66406.js → f-paginator-utils-6283a294.js} +2 -2
- package/dist/esm/{f-paginator-utils-56f66406.js.map → f-paginator-utils-6283a294.js.map} +1 -1
- package/dist/esm/{f-text-field-73c20614.js → f-text-field-7ceb0591.js} +2 -2
- package/dist/esm/{f-text-field-73c20614.js.map → f-text-field-7ceb0591.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-1333a2f8.js → kup-data-table-helper-353a9675.js} +2 -2
- package/dist/esm/{kup-data-table-helper-1333a2f8.js.map → kup-data-table-helper-353a9675.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 +4 -4
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +1 -1
- package/dist/esm/{kup-manager-c6f89439.js → kup-manager-f28f3f94.js} +2 -2
- package/dist/esm/{kup-manager-c6f89439.js.map → kup-manager-f28f3f94.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-04c25532.entry.js +2 -0
- package/dist/ketchup/{p-197aa6ed.entry.js.map → p-04c25532.entry.js.map} +1 -1
- package/dist/ketchup/{p-f8fe5435.entry.js → p-057f17e6.entry.js} +2 -2
- package/dist/ketchup/{p-634b3510.entry.js → p-0b1e37b8.entry.js} +2 -2
- package/dist/ketchup/{p-d336255f.js → p-1362560b.js} +2 -2
- package/dist/ketchup/{p-9b0551b5.js → p-170d2abd.js} +2 -2
- package/dist/ketchup/{p-a496ba6a.entry.js → p-2a6bb010.entry.js} +2 -2
- package/dist/ketchup/{p-65780ddc.entry.js → p-2d68ffb5.entry.js} +2 -2
- package/dist/ketchup/{p-7f762e33.entry.js → p-3338a656.entry.js} +2 -2
- package/dist/ketchup/{p-42ea84f3.entry.js → p-37d71bc6.entry.js} +2 -2
- package/dist/ketchup/{p-dd816cfe.entry.js → p-3a2a4de6.entry.js} +2 -2
- package/dist/ketchup/{p-a3b1896e.entry.js → p-43b236fe.entry.js} +2 -2
- package/dist/ketchup/{p-f073ce49.entry.js → p-4a39ec70.entry.js} +2 -2
- package/dist/ketchup/{p-256ca361.entry.js → p-5655beb9.entry.js} +2 -2
- package/dist/ketchup/{p-6e4b8f6d.entry.js → p-5da3d8ef.entry.js} +2 -2
- package/dist/ketchup/{p-e545ca7b.entry.js → p-64ae9a7d.entry.js} +2 -2
- package/dist/ketchup/{p-ebdf1442.entry.js → p-75e96ca0.entry.js} +2 -2
- package/dist/ketchup/p-81285484.js +29 -0
- package/dist/{cjs/kup-manager-65839aad.js.map → ketchup/p-81285484.js.map} +1 -1
- package/dist/ketchup/{p-2b14f215.js → p-854b53fb.js} +2 -2
- package/dist/ketchup/{p-0efc24e7.entry.js → p-8e04c2fd.entry.js} +2 -2
- package/dist/ketchup/{p-b05c0af5.entry.js → p-92fcbf1a.entry.js} +2 -2
- package/dist/ketchup/{p-07e7fade.entry.js → p-947559c9.entry.js} +2 -2
- package/dist/ketchup/{p-3e9957c1.entry.js → p-98e9e968.entry.js} +2 -2
- package/dist/ketchup/{p-69ada7f9.entry.js → p-99813847.entry.js} +2 -2
- package/dist/ketchup/{p-d1fc3c35.entry.js → p-aab21af5.entry.js} +2 -2
- package/dist/ketchup/{p-5184497b.entry.js → p-b9f36550.entry.js} +2 -2
- package/dist/ketchup/p-ba1eb179.js +2 -0
- package/dist/ketchup/{p-00286291.entry.js → p-baaf5cdc.entry.js} +2 -2
- package/dist/ketchup/{p-4d6644f0.entry.js → p-bdcd92b2.entry.js} +2 -2
- package/dist/ketchup/{p-ddc78c64.entry.js → p-c4d94b5d.entry.js} +2 -2
- package/dist/ketchup/{p-b947f411.entry.js → p-d1a9c9a1.entry.js} +2 -2
- package/dist/ketchup/{p-31d98241.entry.js → p-d3e76f80.entry.js} +2 -2
- package/dist/ketchup/{p-784120c9.entry.js → p-ddee8c53.entry.js} +2 -2
- package/dist/ketchup/{p-dfaaabb5.entry.js → p-de9c014f.entry.js} +2 -2
- package/dist/ketchup/{p-e34f8755.entry.js → p-fbd5c6f3.entry.js} +2 -2
- package/dist/ketchup/{p-49485bbf.js → p-fcfc07e1.js} +2 -2
- package/package.json +1 -1
- package/dist/ketchup/p-197aa6ed.entry.js +0 -2
- package/dist/ketchup/p-e9985f62.js +0 -2
- package/dist/ketchup/p-f98dc5f6.js +0 -29
- package/dist/ketchup/p-f98dc5f6.js.map +0 -1
- /package/dist/ketchup/{p-f8fe5435.entry.js.map → p-057f17e6.entry.js.map} +0 -0
- /package/dist/ketchup/{p-634b3510.entry.js.map → p-0b1e37b8.entry.js.map} +0 -0
- /package/dist/ketchup/{p-d336255f.js.map → p-1362560b.js.map} +0 -0
- /package/dist/ketchup/{p-9b0551b5.js.map → p-170d2abd.js.map} +0 -0
- /package/dist/ketchup/{p-a496ba6a.entry.js.map → p-2a6bb010.entry.js.map} +0 -0
- /package/dist/ketchup/{p-65780ddc.entry.js.map → p-2d68ffb5.entry.js.map} +0 -0
- /package/dist/ketchup/{p-7f762e33.entry.js.map → p-3338a656.entry.js.map} +0 -0
- /package/dist/ketchup/{p-42ea84f3.entry.js.map → p-37d71bc6.entry.js.map} +0 -0
- /package/dist/ketchup/{p-dd816cfe.entry.js.map → p-3a2a4de6.entry.js.map} +0 -0
- /package/dist/ketchup/{p-a3b1896e.entry.js.map → p-43b236fe.entry.js.map} +0 -0
- /package/dist/ketchup/{p-f073ce49.entry.js.map → p-4a39ec70.entry.js.map} +0 -0
- /package/dist/ketchup/{p-256ca361.entry.js.map → p-5655beb9.entry.js.map} +0 -0
- /package/dist/ketchup/{p-6e4b8f6d.entry.js.map → p-5da3d8ef.entry.js.map} +0 -0
- /package/dist/ketchup/{p-e545ca7b.entry.js.map → p-64ae9a7d.entry.js.map} +0 -0
- /package/dist/ketchup/{p-ebdf1442.entry.js.map → p-75e96ca0.entry.js.map} +0 -0
- /package/dist/ketchup/{p-2b14f215.js.map → p-854b53fb.js.map} +0 -0
- /package/dist/ketchup/{p-0efc24e7.entry.js.map → p-8e04c2fd.entry.js.map} +0 -0
- /package/dist/ketchup/{p-b05c0af5.entry.js.map → p-92fcbf1a.entry.js.map} +0 -0
- /package/dist/ketchup/{p-07e7fade.entry.js.map → p-947559c9.entry.js.map} +0 -0
- /package/dist/ketchup/{p-3e9957c1.entry.js.map → p-98e9e968.entry.js.map} +0 -0
- /package/dist/ketchup/{p-69ada7f9.entry.js.map → p-99813847.entry.js.map} +0 -0
- /package/dist/ketchup/{p-d1fc3c35.entry.js.map → p-aab21af5.entry.js.map} +0 -0
- /package/dist/ketchup/{p-5184497b.entry.js.map → p-b9f36550.entry.js.map} +0 -0
- /package/dist/ketchup/{p-e9985f62.js.map → p-ba1eb179.js.map} +0 -0
- /package/dist/ketchup/{p-00286291.entry.js.map → p-baaf5cdc.entry.js.map} +0 -0
- /package/dist/ketchup/{p-4d6644f0.entry.js.map → p-bdcd92b2.entry.js.map} +0 -0
- /package/dist/ketchup/{p-ddc78c64.entry.js.map → p-c4d94b5d.entry.js.map} +0 -0
- /package/dist/ketchup/{p-b947f411.entry.js.map → p-d1a9c9a1.entry.js.map} +0 -0
- /package/dist/ketchup/{p-31d98241.entry.js.map → p-d3e76f80.entry.js.map} +0 -0
- /package/dist/ketchup/{p-784120c9.entry.js.map → p-ddee8c53.entry.js.map} +0 -0
- /package/dist/ketchup/{p-dfaaabb5.entry.js.map → p-de9c014f.entry.js.map} +0 -0
- /package/dist/ketchup/{p-e34f8755.entry.js.map → p-fbd5c6f3.entry.js.map} +0 -0
- /package/dist/ketchup/{p-49485bbf.js.map → p-fcfc07e1.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
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-
|
|
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-fcfc07e1.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-81285484.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-170d2abd.js";import"./p-854b53fb.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-bdcd92b2.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,f as e,h as i,H as a,d as s}from"./p-d7c15b0e.js";import{k as o,g as n,s as l,h as c,e as p,as as h,O as f,at as r,V as u,d}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,f as e,h as i,H as a,d as s}from"./p-d7c15b0e.js";import{k as o,g as n,s as l,h as c,e as p,as as h,O as f,at as r,V as u,d}from"./p-81285484.js";import{a as g}from"./p-e3062c19.js";import{F as m}from"./p-2b519589.js";import{c as k}from"./p-635bb4b3.js";import"./p-029c7cbe.js";var b;(function(t){t["customStyle"]="Custom style of the component.";t["data"]="Sets the data that will be used to display different components."})(b||(b={}));var x;(function(t){t["BOX"]="Box";t["BUTTON_LIST"]="Button List";t["CHART"]="Chart";t["CHIP"]="Chip";t["ECHART"]="Echart";t["DATATABLE"]="Datatable";t["JSON"]="JSON";t["TREE"]="Tree"})(x||(x={}));const y=".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{background-color:var(--kup-background-color);color:var(--kup-text-color);display:block;height:300px;min-width:700px;width:700px}#kup-component,.magic-box-wrapper{height:100%;width:100%}.magic-box-wrapper{border:3px dashed var(--kup-border-subtle);box-sizing:border-box;display:flex;flex-direction:column}.actions{align-items:center;background-color:var(--kup-title-background-color);display:inline-flex;height:52px;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1}.actions kup-button{margin:0.5em}.actions #comp-switcher{margin:auto 0}.actions #close-dialog{position:absolute;margin:0;top:0;right:0;background-color:var(--kup-title-background-color)}.content{box-sizing:border-box;height:100%;margin-top:52px;overflow:auto;transition:background-color 125ms ease}.empty{flex-direction:column;display:flex;text-align:center;justify-content:center;height:100%;width:100%;opacity:0.5;transition:opacity 0.25s ease-out}.empty .f-image{margin:0}.json{font-family:var(--kup-font-family-monospace);margin:0}[kup-drag-over]{background-color:rgba(var(--kup-success-color-rgb), 0.25)}";const v=y;const w=class{constructor(e){t(this,e);this.dragHandler=null;this.kupManager=o();this.textArea=null;this.wrapperRef=null;this.display=x.DATATABLE;this.customStyle="";this.data=null}async getProps(t){return n(this,b,t)}async refresh(){e(this)}async setProps(t){l(this,b,t)}comboboxProps(){const t=[];for(const e in x){if(Object.prototype.hasOwnProperty.call(x,e)){t.push({id:x[e],selected:false,value:x[e]})}}return{data:{"kup-list":{data:t,id:"kup-debug-theme-changer-list"},"kup-text-field":{emitSubmitEventOnEnter:false,inputType:"text",label:this.kupManager.language.translate(c.VIEW_AS)}},id:"comp-switcher",initialValue:this.display,isSelect:true,["onKup-combobox-itemclick"]:t=>{this.display=t.detail.value}}}setContent(){const t=!!(this.data&&this.data.columns&&this.data.columns.length>0);const e=[];const a={};if(this.display===x.JSON){a.initialValue=this.data?JSON.stringify(this.data,null,2):"";a.textArea=true;e.push(i("kup-text-field",Object.assign({class:"kup-full-width kup-full-height"},a,{ref:t=>this.textArea=t,"onkup-textfield-input":t=>{try{this.data=JSON.parse(t.detail.value)}catch(t){this.data={columns:[{name:"ERROR",title:"Error"}],rows:[{cells:{ERROR:{value:"Invalid JSON:"+t}}}]}}}})))}else if(!t){e.push(i("div",{class:"empty"},i(m,{sizeY:"100px",resource:"move_to_inbox"}),i("div",{class:"empty-text"},this.kupManager.language.translate(c.DROP_YOUR_DATA))))}else{switch(this.display){case x.BOX:a.data=this.data;e.push(i("kup-box",Object.assign({},a)));break;case x.BUTTON_LIST:a.data=this.data;e.push(i("kup-button-list",Object.assign({},a)));break;case x.CHIP:a.data=this.data;e.push(i("kup-chip",Object.assign({},a)));break;case x.CHART:case x.ECHART:a.data=this.data;a["series"]=[];a["axis"]=null;for(let t=0;t<this.data.columns.length;t++){const e=this.data.columns[t];if(e.obj&&this.kupManager.objects.isNumber(e.obj)||a["axis"]!==null){if(this.display===x.CHART){a["series"].push({code:e.name,decode:e.title})}else{a["series"].push(e.name)}}else{a["axis"]=e.name}}if(a["series"].length===0){this.kupManager.debug.logMessage(this,"Not enough numerical columns to display a chart!",p.WARNING)}if(!a["axis"]){this.kupManager.debug.logMessage(this,"No axis for the chart!",p.WARNING)}if(this.display===x.CHART){e.push(i("kup-chart",Object.assign({},a)))}else{e.push(i("kup-echart",Object.assign({},a)))}break;case x.DATATABLE:a.data=this.data;a["autoFillMissingCells"]=true;e.push(i("kup-data-table",Object.assign({},a)));break;case x.TREE:a.data=this.data;e.push(i("kup-tree",Object.assign({class:"kup-full-width"},a)));break;default:this.kupManager.debug.logMessage(this,"Display mode not supported ("+this.display+")!",p.ERROR);return}}return e}updateData(t){{const e=Object.assign({},this.data);const i=t.detail.sourceElement&&t.detail.sourceElement.column?t.detail.sourceElement.column:null;const a=t.detail.sourceElement&&t.detail.sourceElement.row?t.detail.sourceElement.row:null;if(i&&i.name){if(!e.columns){e.columns=[i]}else{const t=this.data.columns.find((t=>t.name===i.name));if(!t){e.columns.push(i)}}}else{this.kupManager.debug.logMessage(this,"Invalid column received.",p.WARNING)}if(a){if(!e.rows){e.rows=[a]}else{e.rows.push(a)}}this.data=e;if(this.data&&this.textArea){try{this.textArea.setValue(JSON.stringify(this.data,null,2))}catch(t){this.textArea.setValue("Invalid JSON:"+t)}}}}componentWillLoad(){this.kupManager.debug.logLoad(this,false);this.kupManager.language.register(this);this.kupManager.theme.register(this)}componentDidLoad(){this.rootElement.addEventListener(h,(t=>this.updateData(t)));this.dragHandler=this.rootElement.shadowRoot.querySelector("#drag-handle");this.kupManager.interact.dialogify(this.rootElement,this.dragHandler);this.kupManager.interact.dropzone(this.wrapperRef,{accept:`[${f}],[${r}]`},{dispatcher:this.rootElement,type:u.MAGICBOX});this.kupManager.debug.logLoad(this,true)}componentWillRender(){this.kupManager.debug.logRender(this,false)}componentDidRender(){this.kupManager.debug.logRender(this,true)}render(){return i(a,{key:"8f04a5029dad9d7d8f3673124a6fb954880719d5"},i("style",{key:"af43ffc44c345efb6982aecac7ffeb7469a1e1ab"},this.kupManager.theme.setKupStyle(this.rootElement)),i("div",{key:"4da32884b8cfaee501fe98de3ad61dbfd40644f1",id:k},i("div",{key:"3ae6ee9f2ee07d1ace113fe223bf45fe907eb1d2",class:"magic-box-wrapper"},i("div",{key:"7331459e7beeecbad1f94907c5dfc37e6fd77221",class:"actions",id:"drag-handle"},i("kup-combobox",Object.assign({key:"cf49975df5a5aa923c031c64ecee9a81ae4ad0bc"},this.comboboxProps())),i("kup-button",{key:"9268ce09ec663aa4e00a82ba0fadef493422d12f",styling:g.FLAT,icon:"delete",label:"Reset","onkup-button-click":()=>{this.data=null}}),i("kup-button",{key:"3724463433b93aa9ae13ae19d67be8fc39c702f6",id:"close-dialog",customStyle:`:host{${d.PRIMARY}: var(${d.TITLE});}`,icon:"clear","onkup-button-click":()=>{this.kupManager.hideMagicBox()}})),i("div",{key:"448858d039c7cd0ea8e756d9ad66af2b3baf5c52",class:"content",ref:t=>this.wrapperRef=t},this.setContent()))))}disconnectedCallback(){this.kupManager.interact.unregister([this.rootElement,this.wrapperRef]);this.kupManager.language.unregister(this);this.kupManager.theme.unregister(this)}get rootElement(){return s(this)}};w.style=v;export{w as kup_magic_box};
|
|
2
|
+
//# sourceMappingURL=p-c4d94b5d.entry.js.map
|