@sme.up/ketchup 8.0.0 → 8.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{f-button-49b2c37c.js → f-button-9524bbf7.js} +2 -2
- package/dist/cjs/{f-cell-9a6bc55c.js → f-cell-bcb75ade.js} +22 -13
- package/dist/cjs/{f-checkbox-593f72c3.js → f-checkbox-1148e791.js} +1 -1
- package/dist/cjs/{f-chip-dee84122.js → f-chip-2249b386.js} +3 -3
- package/dist/cjs/{f-image-27f965ff.js → f-image-47d74999.js} +2 -2
- package/dist/cjs/{f-paginator-utils-4a30189d.js → f-paginator-utils-b0a9ae5f.js} +64 -63
- package/dist/cjs/{f-text-field-04a663b4.js → f-text-field-579c0fc0.js} +83 -9
- package/dist/cjs/{index-74433248.js → index-1f177abc.js} +0 -3
- package/dist/cjs/ketchup.cjs.js +2 -2
- package/dist/cjs/kup-accordion.cjs.entry.js +3 -3
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +798 -815
- package/dist/cjs/kup-box.cjs.entry.js +10 -10
- package/dist/cjs/kup-calendar.cjs.entry.js +5 -5
- package/dist/cjs/kup-cell.cjs.entry.js +7 -7
- package/dist/cjs/kup-dash-list.cjs.entry.js +3 -4
- package/dist/cjs/kup-dash_2.cjs.entry.js +2 -2
- package/dist/cjs/kup-dashboard.cjs.entry.js +6 -6
- package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
- package/dist/cjs/kup-echart.cjs.entry.js +2 -2
- package/dist/cjs/kup-family-tree.cjs.entry.js +4 -4
- package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
- package/dist/cjs/kup-image-list.cjs.entry.js +8 -8
- package/dist/cjs/kup-lazy.cjs.entry.js +2 -2
- package/dist/cjs/kup-magic-box.cjs.entry.js +3 -3
- package/dist/cjs/{kup-manager-2ff5d258.js → kup-manager-85b2a756.js} +758 -538
- package/dist/cjs/kup-nav-bar.cjs.entry.js +2 -2
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
- package/dist/cjs/kup-photo-frame.cjs.entry.js +2 -2
- package/dist/cjs/kup-planner.cjs.entry.js +3 -3
- package/dist/cjs/kup-probe.cjs.entry.js +2 -2
- package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
- package/dist/cjs/kup-snackbar.cjs.entry.js +12 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/kup-card/built-in/kup-card-calendar.js +5 -61
- package/dist/collection/components/kup-card/built-in/kup-card-clock.js +1 -1
- package/dist/collection/components/kup-dash-list/kup-dash-list.js +1 -3
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +7 -8
- package/dist/collection/components/kup-data-table/kup-data-table.js +5 -4
- package/dist/collection/components/kup-gauge/kup-gauge.js +4 -4
- package/dist/collection/components/kup-snackbar/kup-snackbar.js +27 -0
- package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +3 -0
- package/dist/collection/components/kup-text-field/kup-text-field.js +107 -9
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +7 -7
- package/dist/collection/components/kup-tree/kup-tree.js +2 -2
- package/dist/collection/f-components/f-cell/f-cell.js +16 -8
- package/dist/collection/f-components/f-paginator/f-paginator-utils.js +3 -3
- package/dist/collection/f-components/f-text-field/f-text-field.js +80 -6
- package/dist/collection/managers/kup-data/kup-data.js +3 -1
- package/dist/collection/managers/kup-dates/kup-dates-declarations.js +21 -10
- package/dist/collection/managers/kup-dates/kup-dates.js +312 -1
- package/dist/collection/managers/kup-math/kup-math.js +258 -6
- package/dist/collection/utils/cell-utils.js +5 -6
- package/dist/collection/utils/filters/filters.js +11 -13
- package/dist/collection/utils/utils.js +18 -444
- package/dist/components/kup-autocomplete2.js +1301 -1002
- package/dist/components/kup-box2.js +1 -1
- package/dist/components/kup-calendar.js +1 -1
- package/dist/components/kup-cell.js +1 -1
- package/dist/components/kup-dash-list.js +2 -3
- package/dist/components/kup-dashboard.js +1 -1
- package/dist/components/kup-data-table.js +1 -1
- package/dist/components/kup-date-picker.js +1 -1
- package/dist/components/kup-dialog.js +1 -1
- package/dist/components/kup-dropdown-button.js +1 -1
- package/dist/components/kup-echart2.js +1 -1
- package/dist/components/kup-family-tree.js +1 -1
- package/dist/components/kup-form.js +1 -1
- package/dist/components/kup-gauge.js +1 -1
- package/dist/components/kup-grid2.js +1 -1
- package/dist/components/kup-iframe.js +1 -1
- package/dist/components/kup-image-list.js +1 -1
- package/dist/components/kup-image.js +1 -1
- package/dist/components/kup-list.js +1 -1
- package/dist/components/kup-magic-box.js +1 -1
- package/dist/components/kup-numeric-picker.js +1 -1
- package/dist/components/kup-planner.js +1 -1
- package/dist/components/kup-progress-bar.js +1 -1
- package/dist/components/kup-radio.js +1 -1
- package/dist/components/kup-rating.js +1 -1
- package/dist/components/kup-snackbar.js +8 -0
- package/dist/components/kup-spinner.js +1 -1
- package/dist/components/kup-switch.js +1 -1
- package/dist/components/kup-tab-bar.js +1 -1
- package/dist/components/kup-text-field.js +1 -1
- package/dist/components/kup-time-picker.js +1 -1
- package/dist/components/kup-tree.js +1 -1
- package/dist/esm/{f-button-744cf1f6.js → f-button-024f0cfe.js} +2 -2
- package/dist/esm/{f-cell-b319c869.js → f-cell-90240a8c.js} +22 -13
- package/dist/esm/{f-checkbox-ec85b437.js → f-checkbox-9b3f5f5b.js} +1 -1
- package/dist/esm/{f-chip-7e3e4180.js → f-chip-2238ad43.js} +3 -3
- package/dist/esm/{f-image-098c26ce.js → f-image-f2e9bf79.js} +2 -2
- package/dist/esm/{f-paginator-utils-674cb2ae.js → f-paginator-utils-8cb3c023.js} +64 -63
- package/dist/esm/{f-text-field-c38ef113.js → f-text-field-d231982c.js} +83 -9
- package/dist/esm/{index-b326ffc9.js → index-8bd38435.js} +1 -3
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +3 -3
- package/dist/esm/kup-autocomplete_27.entry.js +792 -809
- package/dist/esm/kup-box.entry.js +10 -10
- package/dist/esm/kup-calendar.entry.js +5 -5
- package/dist/esm/kup-cell.entry.js +7 -7
- package/dist/esm/kup-dash-list.entry.js +3 -4
- package/dist/esm/kup-dash_2.entry.js +2 -2
- package/dist/esm/kup-dashboard.entry.js +6 -6
- package/dist/esm/kup-drawer.entry.js +2 -2
- package/dist/esm/kup-echart.entry.js +2 -2
- package/dist/esm/kup-family-tree.entry.js +4 -4
- package/dist/esm/kup-iframe.entry.js +2 -2
- package/dist/esm/kup-image-list.entry.js +8 -8
- package/dist/esm/kup-lazy.entry.js +2 -2
- package/dist/esm/kup-magic-box.entry.js +3 -3
- package/dist/esm/{kup-manager-b41eb2a8.js → kup-manager-d1da769e.js} +758 -529
- package/dist/esm/kup-nav-bar.entry.js +2 -2
- package/dist/esm/kup-numeric-picker.entry.js +3 -3
- package/dist/esm/kup-photo-frame.entry.js +2 -2
- package/dist/esm/kup-planner.entry.js +3 -3
- package/dist/esm/kup-probe.entry.js +2 -2
- package/dist/esm/kup-qlik.entry.js +2 -2
- package/dist/esm/kup-snackbar.entry.js +12 -4
- package/dist/esm/loader.js +3 -3
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-5ce2b4fc.entry.js → p-063d4c27.entry.js} +1 -1
- package/dist/ketchup/{p-4325d965.entry.js → p-0bcda0e2.entry.js} +1 -1
- package/dist/ketchup/{p-af82131e.entry.js → p-0d7d59c7.entry.js} +1 -1
- package/dist/ketchup/{p-bd42562d.entry.js → p-163b18b9.entry.js} +1 -1
- package/dist/ketchup/{p-b244f5ca.entry.js → p-1ad628fb.entry.js} +1 -1
- package/dist/ketchup/{p-a9b7533b.entry.js → p-33aff1ca.entry.js} +1 -1
- package/dist/ketchup/p-3432ebaf.entry.js +9 -0
- package/dist/ketchup/{p-b032f47d.entry.js → p-35b29b22.entry.js} +1 -1
- package/dist/ketchup/{p-940a5feb.js → p-36dac88e.js} +3 -3
- package/dist/ketchup/{p-395e1960.entry.js → p-37067ee6.entry.js} +1 -1
- package/dist/ketchup/p-39a55c47.js +1 -0
- package/dist/ketchup/p-3cf64473.js +1 -0
- package/dist/ketchup/{p-5d398e42.js → p-410c102a.js} +1 -1
- package/dist/ketchup/p-43b67de4.entry.js +1 -0
- package/dist/ketchup/{p-a7e19620.entry.js → p-489d55ff.entry.js} +1 -1
- package/dist/ketchup/{p-77e3d537.js → p-5f3680f2.js} +1 -1
- package/dist/ketchup/p-651d89c8.entry.js +1 -0
- package/dist/ketchup/{p-da891093.entry.js → p-73c8d651.entry.js} +1 -1
- package/dist/ketchup/{p-bb17c1ba.entry.js → p-83435e6c.entry.js} +1 -1
- package/dist/ketchup/{p-3b41aca7.entry.js → p-89743989.entry.js} +1 -1
- package/dist/ketchup/{p-ef614656.js → p-8b46e7ce.js} +1 -1
- package/dist/ketchup/{p-d4ece435.js → p-9dcfbb1e.js} +2 -2
- package/dist/ketchup/{p-c26975bf.js → p-9f9b6656.js} +1 -1
- package/dist/ketchup/{p-c968e93d.entry.js → p-a84f1d24.entry.js} +1 -1
- package/dist/ketchup/{p-e02b5141.entry.js → p-b2fd2dbf.entry.js} +1 -1
- package/dist/ketchup/{p-d739710a.entry.js → p-c42b80c1.entry.js} +1 -1
- package/dist/ketchup/p-d1b050d0.entry.js +27 -0
- package/dist/ketchup/p-d6ea709e.entry.js +1 -0
- package/dist/ketchup/{p-0b91f5f8.entry.js → p-e1f1e661.entry.js} +1 -1
- package/dist/ketchup/p-eda7f130.js +1 -0
- package/dist/ketchup/{p-4ae2ca6f.entry.js → p-f876125d.entry.js} +1 -1
- package/dist/types/components/kup-snackbar/kup-snackbar.d.ts +5 -0
- package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +3 -0
- package/dist/types/components/kup-text-field/kup-text-field.d.ts +20 -2
- package/dist/types/components.d.ts +34 -0
- package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +3 -0
- package/dist/types/managers/kup-dates/kup-dates-declarations.d.ts +19 -9
- package/dist/types/managers/kup-dates/kup-dates.d.ts +94 -1
- package/dist/types/managers/kup-math/kup-math-declarations.d.ts +6 -0
- package/dist/types/managers/kup-math/kup-math.d.ts +88 -3
- package/dist/types/utils/utils.d.ts +13 -103
- package/package.json +1 -1
- package/dist/ketchup/p-0b0b61cb.entry.js +0 -1
- package/dist/ketchup/p-3efe7f43.entry.js +0 -27
- package/dist/ketchup/p-9700eb32.js +0 -1
- package/dist/ketchup/p-a877a87b.entry.js +0 -9
- package/dist/ketchup/p-c8b7790a.entry.js +0 -1
- package/dist/ketchup/p-d98fdb9b.js +0 -1
- package/dist/ketchup/p-df316daf.entry.js +0 -1
- package/dist/ketchup/p-e714f4dc.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as o,f as i,e,h as s,H as r,g as n}from"./p-d4ece435.js";import{k as a,z as l,g as h,s as c,u as p,l as b,K as d,c as u,R as x,W as g,X as f,Y as k,I as m,a3 as w}from"./p-940a5feb.js";import{f as v,p as y,s as _,d as j,r as C,h as R,b as A}from"./p-9700eb32.js";import{F as z}from"./p-5d398e42.js";import{a as P}from"./p-ef614656.js";import{c as I}from"./p-97e8ea42.js";import{F as O}from"./p-d98fdb9b.js";import{F as S}from"./p-27a56c87.js";import"./p-77e3d537.js";import"./p-6c77a36c.js";import"./p-c26975bf.js";import"./p-e714f4dc.js";import"./p-7f59211b.js";import"./p-10d84b1b.js";var B;!function(t){t.cardData="Data of the card linked to the box when the latter's layout must be a premade template.",t.columns="Number of columns.",t.customStyle="Custom style of the component.",t.data="Actual data of the box.",t.dragEnabled="Enable dragging.",t.dropEnabled="Enable dropping.",t.dropOnSection="Drop can be done in section.",t.enableRowActions="If enabled, a button to load / display the row actions will be displayed on the right of every box.",t.globalFilter="When set to true it activates the global filter.",t.globalFilterValue="The value of the global filter.",t.kanban="Displays the boxlist as a Kanban.",t.layout="How the field will be displayed. If not present, a default one will be created.",t.multiSelection="Enable multi selection.",t.pageSelected="Current page number.",t.pageSize="Number of boxes per page.",t.pagination="Enables pagination.",t.rowsPerPage="Number of current rows per page.",t.scrollOnHover="Activates the scroll on hover function.",t.selectBox="Automatically selects the box at the specified index.",t.selectedRowsState="Multiple selection.",t.showSelection="If enabled, highlights the selected box/boxes.",t.sortBy="If sorting is enabled, specifies which column to sort.",t.sortEnabled="Enable sorting.",t.stateId="",t.store="",t.swipeDisabled="Disable swipe."}(B||(B={}));class D{constructor(){this.globalFilterValue="",this.sortBy="",this.selectedRowsState="",this.pageSelected=1,this.rowsPerPage=0,this.load=!1}toDebugString(){return"box state"}}const M=class{constructor(i){t(this,i),this.kupBoxClick=o(this,"kup-box-click",6),this.kupBoxSelected=o(this,"kup-box-selected",6),this.kupAutoBoxSelect=o(this,"kup-box-autoselect",6),this.kupRowActionMenuClick=o(this,"kup-box-rowactionmenuclick",6),this.kupRowActionClick=o(this,"kup-box-rowactionclick",6),this.kupDidLoad=o(this,"kup-box-didload",6),this.kupDidUnload=o(this,"kup-box-didunload",6),this.kupBoxContextMenu=o(this,"kup-box-contextmenu",6),this.state=new D,this.kupManager=a(),this.visibleColumns=[],this.rows=[],this.filteredRows=[],this.sectionRef=null,this.rowsRefs=[],this.hold=!1,this.interactableDrag=[],this.interactableDrop=[],this.interactableTouch=[],this.collapsedSection={},this.selectedRows=[],this.rowActionMenuOpened=void 0,this.currentPage=1,this.currentRowsPerPage=10,this.cardData=null,this.columns=1,this.customStyle="",this.data=null,this.dragEnabled=!1,this.dropEnabled=!1,this.dropOnSection=!1,this.editableData=!1,this.enableRowActions=!1,this.globalFilter=!1,this.globalFilterValue="",this.kanban=null,this.layout=void 0,this.multiSelection=!1,this.pageSelected=1,this.pageSize=10,this.pagination=!1,this.rowsPerPage=void 0,this.scrollOnHover=!1,this.selectBox=void 0,this.selectedRowsState=void 0,this.showSelection=!0,this.sortBy=void 0,this.sortEnabled=!1,this.stateId="",this.store=void 0,this.swipeDisabled=!1}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);null!=t&&(this.kupManager.debug.logMessage(this,"Initialize with state for stateId "+this.stateId+": "+t),this.sortBy=this.state.sortBy,this.globalFilterValue=this.state.globalFilterValue,this.selectedRowsState=this.state.selectedRowsState,this.pageSelected=this.state.pageSelected,this.rowsPerPage=this.state.rowsPerPage)}}persistState(){if(this.store&&this.stateId){let t=!1;this.kupManager.objects.deepEqual(this.state.sortBy,this.sortBy)||(this.state.sortBy=this.sortBy,t=!0),this.kupManager.objects.deepEqual(this.state.globalFilterValue,this.globalFilterValue)||(this.state.globalFilterValue=this.globalFilterValue,t=!0),this.kupManager.objects.deepEqual(this.state.pageSelected,this.currentPage)||(this.state.pageSelected=this.currentPage,t=!0),this.kupManager.objects.deepEqual(this.state.rowsPerPage,this.currentRowsPerPage)||(this.state.rowsPerPage=this.currentRowsPerPage,t=!0);const o=this.selectedRows.reduce(((t,o,i)=>t+(i>0?";":"")+o.id),"");if(this.kupManager.objects.deepEqual(this.state.selectedRowsState,o)||(this.state.selectedRowsState=o,t=!0),!this.state.load)return void(this.state.load=!0);t&&(this.kupManager.debug.logMessage(this,"Persisting state for stateId "+this.stateId+": "+this.state),this.store.persistState(this.stateId,this.state))}}rowsPerPageHandler(t){this.currentRowsPerPage=t}recalculateRows(){this.initRows()}onDataChanged(){l(this.getRows()),this.initVisibleColumns(),this.initRows(),this.checkLayout()}onLayoutChanged(){this.checkLayout()}onSelectBoxChanged(){this.handleAutomaticBoxSelection()}async getProps(t){return h(this,B,t)}async loadRowActions(t,o){t.actions=o,this.rowActionMenuOpened=t}async refresh(){i(this)}async setProps(t){c(this,B,t)}getColumns(){return this.data&&this.data.columns?this.data.columns:[{title:"",name:"",size:void 0}]}initVisibleColumns(){this.visibleColumns=this.getColumns().filter((t=>!t.hasOwnProperty("visible")||t.visible))}getRows(){return this.data&&this.data.rows?this.data.rows:[]}initRows(){this.filteredRows=this.getRows(),this.globalFilter&&this.globalFilterValue&&(this.filteredRows=v(this.filteredRows,null,this.globalFilterValue,this.visibleColumns)),this.rows=this.sortRows(this.filteredRows),this.pagination&&(this.rows=y(this.rows,this.currentPage,this.currentRowsPerPage,!1))}sortRows(t){let o=t;return this.sortBy&&(o=_(o,[{column:this.sortBy,sortMode:w.A}])),o}checkScrollOnHover(){this.kupManager.scrollOnHover.isRegistered(this.boxContainer)?this.scrollOnHover||this.kupManager.scrollOnHover.unregister(this.boxContainer):this.scrollOnHover&&this.kupManager.scrollOnHover.register(this.boxContainer)}checkLayout(){if(this.layout)return void(this.boxLayout=this.layout);const t={horizontal:!1,sections:[]},o=this.visibleColumns;let i=o.length,e=[],s=0;for(;i-- >0;)e.push({column:o[s++].name});t.content=e,this.boxLayout={sections:[t]}}onSortChange(t){let o=p(this.visibleColumns,t.detail.value);this.sortBy=o.name}onGlobalFilterChange({detail:t}){let o="";t&&t.value&&(o=t.value),this.globalFilterValue=o}isSectionExpanded(t,o){return!(!t.id||!o.id)&&this.collapsedSection[o.id]&&this.collapsedSection[o.id][t.id]}handleAutomaticBoxSelection(){if(this.selectBox&&this.selectBox>0&&this.selectBox<=this.data.rows.length){this.selectedRows=[];for(let t of this.data.rows)if(t.id===(this.selectBox-1).toString()){this.selectedRows.push(t);break}this.kupAutoBoxSelect.emit({comp:this,id:this.rootElement.id,row:this.selectedRows[0]})}}getEventDetails(t,o){let i=null,e=null,s=null,r=null;if(t&&(i=t.closest(".box-object")||t.querySelector(".box-object")||t.closest(".f-cell")),i)if(i.classList.contains("f-cell")){const t=i["kup-get-cell-props"]();e=t.cell,r=t.column,s=t.row}else e=i["data-cell"],s=i["data-row"],r=p(this.visibleColumns,i.dataset.column);return{boxObject:i||null,column:r||null,cell:e||null,originalEvent:o,row:s||null}}contextMenuHandler(t){return this.getEventDetails(t.target,t)}checkIfElementIsActionMenuIcon(t){return!(!t.tagName||!t.parentElement)&&"svg"===t.tagName&&t.parentElement.classList.contains("row-actions-toggler")}onBoxClick({target:t},o){if(!(t instanceof e))return;let i=t,s=i.classList;for(;!s.contains("box-object")&&!s.contains("box-section")&&!s.contains("box")&&(i=i.parentElement,null!==i);)s=i.classList;let r=null;s.contains("box-object")&&(r=i.dataset.column),this.kupBoxClick.emit({comp:this,id:this.rootElement.id,row:o,column:r}),this.multiSelection?this.onSelectionCheckChange(o):this.selectedRows=[o]}onSelectionCheckChange(t){var o=-1;for(let i=0;i<this.selectedRows.length;i++)if(this.selectedRows[i].id===t.id){o=i;break}o>=0?(this.selectedRows.splice(o,1),this.selectedRows=[...this.selectedRows]):this.selectedRows=[...this.selectedRows,t],this.kupBoxSelected.emit({comp:this,id:this.rootElement.id,rows:this.selectedRows})}toggleSectionExpand(t,o){if(o.id)if(t.id){if(this.collapsedSection[o.id]){const i=this.collapsedSection[o.id];i[t.id]=!i[t.id]||!i[t.id]}else this.collapsedSection[o.id]={},this.collapsedSection[o.id][t.id]=!0;this.collapsedSection=Object.assign({},this.collapsedSection)}else console.error("cannot expand / collapse a section of a row without ad id");else console.error("cannot expand / collapse a section withoun an ID")}onRowAction(t){t&&(t!==this.rowActionMenuOpened?t.actions?this.rowActionMenuOpened=t:this.kupRowActionMenuClick.emit({comp:this,id:this.rootElement.id,row:t}):this.rowActionMenuOpened=null)}onRowActionClick(t,o,i){this.kupRowActionClick.emit({comp:this,id:this.rootElement.id,row:t,action:o,index:i})}clickFunction(t){try{const o=t.composedPath();for(let t of o)if(this.checkIfElementIsActionMenuIcon(t))return}catch(o){if(this.checkIfElementIsActionMenuIcon(t.target))return}this.rowActionMenuOpened=null}handlePageChange(t){const o=j(t,this.filteredRows.length,this.currentRowsPerPage);o&&(this.currentPage=o)}handleRowsPerPageChange(t){const o=C(t,this.filteredRows.length);o&&(this.currentRowsPerPage=o,this.adjustPaginator())}adjustPaginator(){const t=Math.ceil(this.rows.length/this.currentRowsPerPage);this.currentPage>t&&(this.currentPage=1)}renderSectionAsCard(t){let o=!1;const i={button:[],cell:[],columns:[],image:[],progressbar:[],text:[]};for(let o=0;o<this.data.columns.length;o++){const e=this.data.columns[o];!1!==e.visible&&(i.cell.push(t.cells[e.name]),i.columns.push(e))}for(const o in t.cells)if(t.cells.hasOwnProperty(o)){const e=t.cells[o];if(void 0!==e.cardID&&e.obj)switch(e.obj.p){case"BTN":do{i.button.push({})}while(i.button.length<e.cardID);i.button[e.cardID]={label:e.value};break;case"IMG":do{i.image.push({})}while(i.image.length<e.cardID);i.image[e.cardID]={resource:e.value};break;case"PGB":do{i.progressbar.push({})}while(i.progressbar.length<e.cardID);i.progressbar[e.cardID]={value:e.value};break;default:do{i.text.push("")}while(i.text.length<e.cardID);i.text[e.cardID]=e.value}}for(const e in t.cells)if(t.cells.hasOwnProperty(e)){const s=t.cells[e];if(void 0===s.cardID&&s.obj)switch(o=!1,s.obj.p){case"BTN":for(let t=0;t<i.button.length;t++)if(!Object.keys(i.button[t]).length){i.button[t]={label:s.value},o=!0;break}o||i.button.push({label:s.value});break;case"IMG":for(let t=0;t<i.image.length;t++)if(!Object.keys(i.image[t]).length){i.image[t]={resource:s.value},o=!0;break}o||i.image.push({resource:s.value});break;case"PGB":for(let t=0;t<i.progressbar.length;t++)if(!Object.keys(i.progressbar[t]).length){i.progressbar[t]={value:s.value},o=!0;break}o||i.progressbar.push({value:s.value});break;default:for(let t=0;t<i.text.length;t++)if(""===i.text[t]){i.text[t]=s.value,o=!0;break}o||i.text.push(s.value)}}return s("kup-card",Object.assign({data:i},this.cardData))}renderRow(t){const o=[...this.visibleColumns];let i=null,e=t.layout;e||(e=this.boxLayout);let r=!1;if(e){e.horizontal&&(r=!0);const s=e.sections;let n=s.length,a=0;n>0&&(i=[]);const l={horizontal:r};for(;n-- >0;)i.push(null!=this.cardData&&"object"==typeof this.cardData?this.renderSectionAsCard(t):this.renderSection(s[a++],l,t,o))}var n=!1;for(let o of this.selectedRows)o.id===t.id&&(n=!0);let a=null;this.multiSelection&&(a=s("div",{class:"box-selection"},s("kup-checkbox",{checked:n})));let l=null;if(this.enableRowActions&&!this.swipeDisabled){const o={"row-action-menu":!0,open:t===this.rowActionMenuOpened};let i=null;if(t.actions){const o=t.actions.map(((o,i)=>s("li",{tabindex:"0",onClick:()=>this.onRowActionClick(t,o,i)},s("div",{class:`icon ${o.icon}`}),s("div",{class:"text"},o.text))));i=s("ul",null,o)}l=s("div",{class:"row-actions-wrapper"},s("div",{class:"row-actions-toggler"},s("svg",{version:"1.1",width:"24",height:"24",viewBox:"0 0 24 24",onClick:()=>this.onRowAction(t)},s("path",{d:"M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z"})),s("div",{class:o},i)))}let h=null;return t.badgeData&&t.badgeData.length>0&&(h=t.badgeData.map((t=>s("kup-badge",{text:t.text,class:t.className?`centered ${t.className}`:"centered",imageData:t.imageData})))),s("div",{class:"box-wrapper",style:t.style||{}},s("div",{class:{box:!0,draggable:this.dragEnabled,selected:this.showSelection&&n,column:!r},onClick:o=>this.onBoxClick(o,t),ref:t=>this.rowsRefs.push(t)},a,i,h),l)}renderSection(t,o,i,e){let r=null;if(t.sections&&t.sections.length>0){const o=t.sections;let s=o.length,n=0;for(s>0&&(r=[]);s-- >0;)r.push(this.renderSection(o[n++],t,i,e))}else if(t.content){const o=t.content;let s=o.length,n=0;for(s>0&&(r=[]);s-- >0;)r.push(this.renderBoxObject({boxObject:o[n++],row:i,visibleColumns:e},!0))}else e.length>0&&(r=this.renderBoxObject({boxObject:{column:e[0].name},row:i,visibleColumns:e}));const n=this.isSectionExpanded(i,t),a=!!t.columns,l={"box-section":!0,open:n,column:!a&&!t.horizontal,grid:a,titled:!!t.title,"last-child":!t.sections||0===t.sections.length},h=t.style||{};t.dim&&o&&(h.flex=`0 0 ${t.dim}`,o.horizontal?h.maxWidth=t.dim:h.maxHeight=t.dim),a&&(h["grid-template-columns"]=`repeat(${t.columns}, 1fr)`);let c=null;if(t.collapsible){l["collapse-section"]=!0;const o={content:!0};let e="";e=t.title?t.title:this.kupManager.language.translate(n?b.COLLAPSE:b.EXPAND),c=s("div",{class:l,style:h},s("div",{class:o},r),s("div",{class:"header",role:"button",onClick:o=>{o.stopPropagation(),this.toggleSectionExpand(i,t)}},s("div",{class:"header-content"},s("span",null,e),s(z,{resource:`${d.DROPDOWN}`,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:n?"toggled":""}))))}else{const o=t.title?s("h3",null,t.title):null;c=s("div",{class:l,style:h},o,r)}return c}renderBoxObject({boxObject:t,row:o,visibleColumns:i},e){const r={"box-object":!0};let n=null,a=-1;for(let o=0;o<i.length;o++)if(i[o].name===t.column){a=o;break}a>=0?(n=i[a],i.splice(a,1)):e&&(n=this.data.columns.find((o=>o.name===t.column)));const l=o.cells[t.column];let h;return l&&!this.kupManager.objects.isEmptyKupObj(l.obj)&&(r["is-obj"]=!0,this.kupManager.debug.isDebug()&&(h=l.obj.t+"; "+l.obj.p+"; "+l.obj.k+";")),s("div",{"data-cell":l,"data-row":o,"data-column":t.column,class:r,style:{},title:h},l&&n?s(O,Object.assign({},{cell:l,column:n,component:this,editable:this.editableData,renderKup:!0,row:o,setSizes:!0,shape:t.shape})):s("span",null,t.value))}kanbanMode(){if(!this.kanban.columns||0===this.kanban.columns.length)return this.kupManager.debug.logMessage(this,"No columns to group by detected.",u.ERROR),{jsx:s("div",{id:"empty-data-message",class:"box-wrapper"},s("div",{ref:t=>this.rowsRefs.push(t)}),this.kupManager.language.translate(b.EMPTY_DATA)),style:{"grid-template-columns":"repeat(1, 1fr)"}};const t=[];if(this.kanban.labels)for(let o=0;o<this.kanban.labels.length;o++)t.push({labels:this.kanban.labels[o],nodes:[]});for(let o=0;o<this.rows.length;o++){let i=[];for(let t=0;t<this.kanban.columns.length;t++)try{i.push(this.rows[o].cells[this.kanban.columns[t]].value)}catch(t){this.kupManager.debug.logMessage(this,t,u.WARNING)}const e={found:!1,index:null};for(let o=0;o<t.length;o++){let s=t[o].labels,r=!0;for(let t=0;t<s.length;t++)if(i[t]!==s[t]){r=!1;break}if(r){e.found=!0,e.index=o;break}}e.found?t[e.index].nodes.push(this.renderRow(this.rows[o])):t.push({labels:i,nodes:[this.renderRow(this.rows[o])]})}const o=[];for(let i=0;i<t.length;i++){const e=t[i].labels,r={data:[]};for(let t=0;t<e.length;t++)r.data.push({value:e[t],id:e[t]});o.push(s("div",{class:"kanban-section"},s(P,Object.assign({},r)),t[i].nodes))}return{jsx:o,style:{"grid-template-columns":this.kanban.isStacked?"repeat(1fr)":this.kanban.size?`repeat(${Object.keys(t).length}, ${this.kanban.size})`:`repeat(${Object.keys(t).length}, 1fr)`}}}didLoadInteractables(){this.interactableTouch.push(this.boxContainer),this.kupManager.interact.on(this.boxContainer,x.TAP,(t=>{this.hold?this.hold=!1:2===t.button&&this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)})})),this.kupManager.interact.on(this.boxContainer,x.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||(this.hold=!0,this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)}))}))}didRenderInteractables(){if(this.dragEnabled)for(let t=0;t<this.rowsRefs.length;t++){const o=this.rowsRefs[t],i=()=>{const t=this.rootElement.shadowRoot.querySelector(".box-object:hover");return{cell:t["data-cell"],column:p(this.visibleColumns,t.dataset.column),id:this.rootElement.id,multiple:this.multiSelection,row:t["data-row"],selectedRows:this.selectedRows}};o&&!this.interactableDrag.includes(o)&&(this.interactableDrag.push(o),this.kupManager.interact.draggable(o,{allowFrom:".box-object",cursorChecker:()=>null},{callback:i},g.BADGE))}if(this.dropEnabled){const t=()=>{const t=this.getEventDetails(this.rootElement.shadowRoot.querySelector(".box:hover"));return{cell:t.cell,column:t.column,id:this.rootElement.id,row:t.row}};this.interactableDrop.includes(this.sectionRef)||(this.interactableDrop.push(this.sectionRef),this.kupManager.interact.dropzone(this.sectionRef,{accept:`[${f}]`},{dispatcher:this.rootElement,type:k.BOX}));for(let o=0;o<this.rowsRefs.length;o++){const i=this.rowsRefs[o];i&&!this.interactableDrop.includes(i)&&(this.interactableDrop.push(i),this.kupManager.interact.dropzone(i,{accept:`[${f}]`},{callback:t,dispatcher:this.rootElement,type:k.BOX}))}}}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.rowsPerPage?this.currentRowsPerPage=this.rowsPerPage:this.pageSize&&(this.currentRowsPerPage=this.pageSize),this.data&&this.data.rows&&this.currentRowsPerPage>this.data.rows.length&&(this.currentRowsPerPage=this.data.rows.length),this.kupManager.language.register(this),this.kupManager.theme.register(this),this.onDataChanged(),this.adjustPaginator()}componentDidLoad(){if(this.handleAutomaticBoxSelection(),document.addEventListener("click",this.clickFunction.bind(this)),this.currentPage=this.pageSelected,this.multiSelection&&this.selectedRowsState){this.selectedRows=[];let t=this.selectedRowsState.split(";");this.selectedRows=this.data.rows.filter((o=>t.indexOf(o.id)>=0))}this.didLoadInteractables(),this.kupDidLoad.emit({comp:this,id:this.rootElement.id}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const o=t.querySelectorAll(".f-text-field");for(let t=0;t<o.length;t++)S(o[t])}this.checkScrollOnHover(),this.persistState(),this.didRenderInteractables(),this.kupManager.debug.logRender(this,!0)}render(){const t=!("object"!=typeof this.kanban||null===this.kanban);let o=null;if(this.sortEnabled){const t=[{value:"",id:""},...this.visibleColumns.map((t=>({value:t.title,id:t.name,selected:t.name===this.sortBy})))];let i={label:this.kupManager.language.translate(b.SORT_BY),trailingIcon:!0};o=s("div",{id:"sort-panel"},s("kup-combobox",{data:{"kup-text-field":i,"kup-list":{data:t,selectable:!0}},initialValue:this.sortBy,"onkup-combobox-itemclick":t=>this.onSortChange(t)}))}let i=null;this.globalFilter&&(i=s("div",{id:"global-filter"},s("kup-text-field",{fullWidth:!0,label:this.kupManager.language.translate(m.SEARCH),icon:d.SEARCH,initialValue:this.globalFilterValue,"onkup-textfield-input":t=>{window.clearTimeout(this.globalFilterTimeout),this.globalFilterTimeout=window.setTimeout((()=>this.onGlobalFilterChange(t)),600)}})));let e=null;this.pagination&&(e=s(A,{id:top?"top-paginator":"bottom-paginator",currentPage:this.currentPage,max:this.filteredRows.length,mode:R.SIMPLE,perPage:this.currentRowsPerPage?this.currentRowsPerPage:this.pageSize,onPageChange:t=>this.handlePageChange(t.detail.value),onRowsChange:t=>this.handleRowsPerPageChange(t.detail.value)}));let n=null,a={};if(0===this.rows.length)n=s("div",{id:"empty-data-message",class:"box-wrapper"},s("div",{class:"box",ref:t=>this.rowsRefs.push(t)},this.kupManager.language.translate(b.EMPTY_DATA))),a={"grid-template-columns":"repeat(1, 1fr)"};else if(t){const t=this.kanbanMode();n=t.jsx,a=t.style}else{a={"grid-template-columns":`repeat(${this.columns}, 1fr)`};const t=this.rows;let o=t.length,i=0;for(n=[];o-- >0;)n.push(this.renderRow(t[i++]))}return s(r,null,s("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),s("div",{id:I},s("div",{class:"box-component",ref:t=>this.sectionRef=t},o,i,e,s("div",{class:t?"is-kanban":"",id:"box-container",style:a,onContextMenu:t=>{t.preventDefault()},ref:t=>this.boxContainer=t},n))))}disconnectedCallback(){this.kupManager.interact.unregister(this.interactableDrag.concat(this.interactableDrop)),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this),this.scrollOnHover&&this.kupManager.scrollOnHover.unregister(this.boxContainer),document.removeEventListener("click",this.clickFunction.bind(this)),this.kupDidUnload.emit({comp:this,id:this.rootElement.id})}get rootElement(){return n(this)}static get watchers(){return{pageSize:["rowsPerPageHandler","recalculateRows"],globalFilterValue:["recalculateRows"],sortBy:["recalculateRows"],pagination:["recalculateRows"],currentPage:["recalculateRows"],currentRowsPerPage:["recalculateRows"],data:["onDataChanged"],layout:["onLayoutChanged"],selectBox:["onSelectBoxChanged"]}}};M.style=":host{--kup_box_background_color:var(\n --kup-box-background-color,\n var(--kup-background-color)\n );--kup_box_color:var(--kup-box-color, var(--kup-text-color));--kup_box_font_family:var(--kup-box-font-family, var(--kup-font-family));--kup_box_font_size:var(--kup-box-font-size, var(--kup-font-size));--kup_box_grid_gap:var(--kup-box-grid-gap, 1em);--kup_box_hover_box_shadow:var(\n --kup-box-hover-box-shadow,\n 0px 0px 7.5px 0px rgba(128, 128, 128, 0.5)\n );--kup_box_primary_color_rgb:var(\n --kup-box-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_box_transition:var(--kup-box-transition, 0.25s);display:block;font-family:var(--kup_box_font_family);font-size:var(--kup_box_font_size)}.box-component{background:var(--kup_box_background_color);transition:border var(--kup_box_transition) ease}.box-component[kup-drag-over]{position:relative;border:3px dashed var(--kup-border-color)}#box-container{display:grid;grid-gap:var(--kup_box_grid_gap);color:var(--kup_box_color);overflow:auto}#box-container.is-kanban .kanban-section{overflow:auto}#box-container.is-kanban .box-wrapper{padding-top:1em}#box-container.is-kanban .box-wrapper .box{overflow:auto}#box-container *{box-sizing:border-box}#box-container .box-wrapper{display:flex;align-items:center}#box-container .box-wrapper .box{flex-grow:1;cursor:pointer;position:relative;display:flex;transition:background-color var(--kup_box_transition) ease, box-shadow var(--kup_box_transition) ease, border var(--kup_box_transition) ease}#box-container .box-wrapper .box.draggable{touch-action:none;user-select:none}#box-container .box-wrapper .box.column{flex-direction:column}#box-container .box-wrapper .box:hover{box-shadow:var(--kup_box_hover_box_shadow)}#box-container .box-wrapper .box.selected{background-color:rgba(var(--kup_box_primary_color_rgb), 0.175)}#box-container .box-wrapper .box.selected .box-section.titled>h3{background-color:transparent}#box-container .box-wrapper .box[kup-draggable]{opacity:0.5}#box-container .box-wrapper .box[kup-drag-over]{border:3px dashed var(--kup-border-color);position:relative;z-index:2}#box-container .box-wrapper .box .box-section{display:flex;flex-direction:row;flex:1 1 1%;flex-wrap:wrap}#box-container .box-wrapper .box .box-section.column{flex-direction:column;justify-content:center;flex-wrap:unset}#box-container .box-wrapper .box .box-section.column>.box-section{flex:0 0 auto}#box-container .box-wrapper .box .box-section.grid{display:grid}#box-container .box-wrapper .box .box-section .box-object{min-height:16px}#box-container .box-wrapper .box .box-section .box-object img{height:auto}#box-container .box-wrapper .box .box-section.collapse-section .header{border-top:1px solid var(--kup-border-color);color:rgba(var(--kup-text-color-rgb), 0.75);display:flex;justify-content:space-around;width:100%}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content{margin:0.5em;display:flex;align-items:center}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image{transition:transform 0.15s}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image.toggled{transform:rotate(-180deg)}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .kup-icon.kup-dropdown-icon{margin:0;-webkit-mask:var(--kup-dropdown-icon);mask:var(--kup-dropdown-icon)}#box-container .box-wrapper .box .box-section.collapse-section .content{display:none;width:100%}#box-container .box-wrapper .box .box-section.collapse-section.open .content{display:block}#box-container .box-wrapper .box .box-section.titled{border:1px solid var(--kup-border-color);padding-top:5px;position:relative;margin:10px}#box-container .box-wrapper .box .box-section.titled>h3{background:var(--kup-background-color);font-size:calc(var(--kup-font-size) * 1.15);position:absolute;margin:0px;padding:0 8px;top:-11px;left:5px;transition:background-color 0.25s ease}#box-container .box-wrapper .box .box-selection{position:absolute;top:0.5em;right:0.5em;z-index:1}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler{position:relative;width:24px;height:24px;margin-left:3px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler svg{cursor:pointer;opacity:0;fill:var(--kup-text-color);transition:opacity 500ms ease-out}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu{background:var(--kup-background-color);border:1px solid var(--kup-border-color);box-shadow:0px 0px 7.5px 0px rgba(128, 128, 128, 0.5);position:absolute;top:0;right:24px;display:none;z-index:10}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul{list-style-type:none;margin:0;padding:0}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li{cursor:pointer;white-space:nowrap;padding:0 12px;display:flex;align-items:center;line-height:30px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li:not(:last-child){border-bottom:1px solid var(--kup-border-color)}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu.open{display:block}#box-container .box-wrapper:hover .row-actions-wrapper .row-actions-toggler svg{opacity:1}#sort-panel,#global-filter{margin-bottom:1em}:host(.kup-center-aligned) #kup-component .box-section{text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell img{margin:auto}:host(.kup-right-aligned) #kup-component .box-section{text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell img{margin-left:auto;margin-right:0}:host(.kup-top-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-start}:host(.kup-bottom-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-end}:host(:not(.kup-borderless)) .box{border:1px solid var(--kup-border-color)}:host(.kup-flat-on-hover) #box-container .box-wrapper .box:hover{box-shadow:none}:host(.kup-shaped) .box{border-radius:10px}:host(.kup-round) .box{border-radius:25px}:host(.kup-dashed-sections) .box-section{border:2px dashed var(--kup-text-color)}:host(:not(.kup-paddingless)) #box-container .box{padding:3px}:host(:not(.kup-paddingless)) #box-container .box .box-section .box-object{padding:1px 4px}:host(:not(.kup-paddingless)) #box-container .box .box-section.last-child{margin:3px 4px}:host(.kup-danger){--kup-box-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-box-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-box-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-box-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-box-primary-color-rgb:var(--kup-warning-color-rgb)}";export{M as kup_box}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{af as e,ag as t,b as c,a7 as s,ah as a,ai as i,aj as n,ak as o,al as l,am as u,an as r}from"./p-940a5feb.js";import{h as p}from"./p-d4ece435.js";import{F as k}from"./p-c26975bf.js";import{F as d}from"./p-e714f4dc.js";import{F as b}from"./p-5d398e42.js";import{F as h,a as f}from"./p-ef614656.js";var m,w,j;!function(e){e.customStyle="Custom style of the component.",e.data="The data of the list.",e.displayMode="Selects how the items must display their label and how they can be filtered for.",e.filter="Keeps string for filtering elements when filter mode is active",e.hideText="Hides rows' text, ideally to display a list of icons only.",e.isMenu="Defines whether the list is a menu or not.",e.keyboardNavigation="When true, enables items' navigation through arrow keys.",e.menuVisible="Sets the status of the menu, when false it's hidden otherwise it's visible.",e.roleType="Defines the type of selection. Values accepted: listbox, radiogroup or group.",e.selectable="Defines whether items are selectable or not.",e.showIcons="Displays the icons associated to each row when set to true.",e.twoLine="The list elements descriptions will be arranged in two lines."}(m||(m={})),function(e){e.LISTBOX="listbox",e.RADIOGROUP="radiogroup",e.GROUP="group"}(w||(w={})),function(e){e.CODE="code",e.DESCRIPTION="description",e.DESCRIPTION_AND_CODE="both"}(j||(j={}));const y=e=>p("div",Object.assign({class:`f-switch ${e.danger?"kup-danger":""} ${e.info?"kup-info":""} ${e.secondary?"kup-secondary":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),p("div",{class:"form-field "+(e.leadingLabel?"form-field--align-end":"")},p("div",{class:`switch ${e.checked?"switch--checked":""} ${e.disabled?"switch--disabled":""}`},p("div",{class:"switch__track"}),p("div",{class:"switch__thumb-underlay"},p("div",{class:"switch__thumb"},p("input",{type:"checkbox",class:"switch__native-control",role:"switch",checked:e.checked,disabled:e.disabled,value:e.checked?"on":"off",onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus})))),p("label",{onClick:e.onChange},e.label))),g=document.documentElement,v=(i,l)=>{const m=i.cell,w=i.column,v=i.row,C=i.shape?i.shape:m.shape?m.shape:w.shape?w.shape:null,I=!g.ketchup.objects.isEmptyKupObj(m.obj),$=!(!m.isEditable&&!w.isEditable||!i.editable),z=i.previousValue!==m.value?m.value:"",D=g.ketchup.data.cell.getType(m,C),F=Object.assign({},m.data);let K=m.cssClass?m.cssClass:w.cssClass?w.cssClass:"";const V={"f-cell":!0,[o.OBJ]:!!I,[D+"-cell"]:!0,[i.wrapperClass]:!!i.wrapperClass,[i.density]:!(!i.density||D===s.BAR),[K]:!!K};let H=z;$&&e.includes(D)?H=function(e,t,c,a,i){switch(e){case s.AUTOCOMPLETE:return p("kup-autocomplete",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"","onkup-autocomplete-change":t=>O(t,i,e,r.UPDATE),"onkup-autocomplete-input":t=>O(t,i,e,r.INPUT),"onkup-autocomplete-iconclick":t=>O(t,i,e,r.ICON_CLICK)}));case s.CHECKBOX:return x(i)&&(t[o.C_CENTERED]=!0),p(k,Object.assign({},c.data,{onChange:t=>O(t,i,e,r.UPDATE)}));case s.CHIP:return p("kup-chip",Object.assign({},c.data,{type:h.INPUT,enableInput:!0,"onKup-chip-change":t=>O(t,i,e,r.UPDATE)}),p("kup-text-field",Object.assign({fullWidth:!0,slot:"field"},c.slotData)));case s.COLOR_PICKER:return p("kup-color-picker",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"",disabled:!1,"onkup-colorpicker-change":t=>O(t,i,e,r.UPDATE)}));case s.COMBOBOX:return p("kup-combobox",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"","onkup-combobox-change":t=>O(t,i,e,r.UPDATE),"onkup-combobox-input":t=>O(t,i,e,r.INPUT),"onkup-combobox-iconclick":t=>O(t,i,e,r.ICON_CLICK)}));case s.DATE:return p("kup-date-picker",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"","onkup-datepicker-change":t=>O(t,i,e,r.UPDATE),"onkup-datepicker-input":t=>O(t,i,e,r.INPUT)}));case s.MULTI_AUTOCOMPLETE:return p("kup-chip",Object.assign({displayId:!0},c.data,{type:h.INPUT,enableInput:!0,"onKup-chip-change":t=>O(t,i,e,r.UPDATE)}),p("kup-autocomplete",Object.assign({class:"kup-full-width",slot:"field",displayMode:j.DESCRIPTION_AND_CODE,selectMode:j.DESCRIPTION_AND_CODE,"onkup-autocomplete-input":t=>O(t,i,e,r.INPUT),"onkup-autocomplete-iconclick":t=>O(t,i,e,r.ICON_CLICK),showDropDownIcon:!1},c.slotData)));case s.MULTI_COMBOBOX:return p("kup-chip",Object.assign({displayId:!0},c.data,{type:h.INPUT,enableInput:!0,"onKup-chip-change":t=>O(t,i,e,r.UPDATE)}),p("kup-combobox",Object.assign({class:"kup-full-width",slot:"field",displayMode:j.DESCRIPTION_AND_CODE,selectMode:j.DESCRIPTION_AND_CODE,"onkup-combobox-input":t=>O(t,i,e,r.INPUT),"onkup-combobox-iconclick":t=>O(t,i,e,r.ICON_CLICK)},c.slotData)));case s.RATING:return p("kup-rating",Object.assign({key:a.name+i.row.id},c.data,{disabled:!1,"onkup-rating-click":t=>O(t,i,e,r.UPDATE)}));case s.SWITCH:return p(y,Object.assign({},c.data,{disabled:!1,onChange:t=>O(t,i,e,r.UPDATE)}));case s.TIME:return p("kup-time-picker",Object.assign({key:a.name+i.row.id,initialValue:c.value},c.data,{class:_(i)?"kup-full-width":"","onkup-timepicker-change":t=>O(t,i,e,r.UPDATE),"onkup-timepicker-input":t=>O(t,i,e,r.INPUT)}));case s.NUMBER:t[o.C_RIGHT_ALIGNED]=!0;case s.LINK:case s.STRING:return p(d,Object.assign({inputType:e===s.NUMBER?"number":null,fullWidth:!!_(i)},c.data,{icon:c.icon?c.icon:a.icon?a.icon:null,value:e===s.NUMBER?n(c.value).toString():c.value,onChange:t=>O(t,i,e,r.UPDATE),onInput:t=>O(t,i,e,r.INPUT),onIconClick:t=>O(t,i,e,r.ICON_CLICK)}))}}(D,V,m,w,i):m.data&&t.includes(D)?(i.setSizes&&function(e,t,c){switch(e){case s.BAR:t.sizeY||(t.sizeY="26px");break;case s.BUTTON:let e="";t.label&&(e="36px"),c.style?c.style.height||(c.style.minHeight=e):c.style={minHeight:e};break;case s.CHART:t.sizeX||(t.sizeX="100%"),t.sizeY||(t.sizeY="100%");break;case s.CHIP:case s.RADIO:c.style?c.style.height||(c.style.minHeight="40px"):c.style={minHeight:"40px"}}}(D,F,m),H=i.renderKup?function(e,t,c,a,i,l,u){switch(e){case s.BAR:return c.data?p("div",{style:{height:c.sizeY,width:"100%"}},p(b,Object.assign({},c))):p("kup-image",Object.assign({key:l.name+u.row.id},c));case s.BUTTON:return x(u)&&(t[o.C_CENTERED]=!0),p("kup-button",Object.assign({key:l.name+u.row.id},c,{"onkup-button-click":t=>O(t,u,e,r.CLICK)}));case s.BUTTON_LIST:return x(u)&&(t[o.C_CENTERED]=!0),c["data-storage"]={cell:a,row:i,column:l},p("kup-button-list",Object.assign({key:l.name+u.row.id},c));case s.CHART:return x(u)&&(t[o.C_CENTERED]=!0),p("kup-chart",Object.assign({key:l.name+u.row.id},c));case s.CHIP:return p(f,Object.assign({},c));case s.COLOR_PICKER:return p("kup-color-picker",Object.assign({key:l.name+u.row.id},c,{class:_(u)?"kup-full-width":"",disabled:!0}));case s.GAUGE:return p("kup-gauge",Object.assign({key:l.name+u.row.id,value:n(a.value),"width-component":"280px"},c));case s.KNOB:case s.PROGRESS_BAR:return p("kup-progress-bar",Object.assign({key:l.name+u.row.id},c));case s.RADIO:return x(u)&&(t[o.C_CENTERED]=!0),c.disabled=i.readOnly,p("kup-radio",Object.assign({key:l.name+u.row.id},c));case s.RATING:return p("kup-rating",Object.assign({key:l.name+u.row.id},c,{disabled:!0}))}}(D,V,F,m,v,w,i):p("span",{class:"cell-"+D+" placeholder"})):(i.setSizes&&function(e,t,c,i){switch(e){case s.CHECKBOX:case s.ICON:t.sizeX||(t.sizeX="18px"),t.sizeY||(t.sizeY="18px"),c.style?c.style.height||(c.style.minHeight=t.sizeY):c.style={minHeight:t.sizeY};break;case s.IMAGE:i.component.rootElement.tagName===a.BOX?(t.sizeY||(t.sizeY="auto"),void 0===t.fit&&(t.fit=!0)):t.sizeX||(t.sizeX="auto"),t.sizeY||(t.sizeY="64px")}}(D,F,m,i),H=function(e,t,c,a,i,l,r){switch(e){case s.AUTOCOMPLETE:case s.COMBOBOX:case s.DATE:case s.DATETIME:case s.TIME:if(c&&""!=c){const e=u(l,i);return p("div",{class:"f-cell__text"},e)}return c;case s.CHECKBOX:return x(r)&&(a[o.C_CENTERED]=!0),p(b,{resource:t.checked?"check_box":"check_box_outline_blank",sizeX:"18px",sizeY:"18px"});case s.EDITOR:return p("div",{innerHTML:i.value});case s.ICON:case s.IMAGE:return x(r)&&(a[o.C_CENTERED]=!0),t.badgeData&&(a[o.C_PADDED]=!0),p(b,Object.assign({},t));case s.LINK:return p("a",{href:c,target:"_blank"},i.value);case s.NUMBER:if(c&&""!=c){const e=n(i.value),t=u(l,i);return e<0&&(a[o.TEXT_DANGER]=!0),x(r)&&(a[o.C_RIGHT_ALIGNED]=!0),p("div",{class:"f-cell__text"},t)}return p("div",{class:"f-cell__text"},c);case s.SWITCH:return x(r)&&(a[o.C_CENTERED]=!0),t.disabled=!0,p(y,Object.assign({},t));default:return p("div",{class:"f-cell__text"},c)}}(D,F,H,V,m,w,i));let M=null;!$&&(w.icon||m.icon)&&H&&(M=p(b,Object.assign({},{color:`rgba(var(${c.TEXT}-rgb), 0.375)`,resource:m.icon?m.icon:w.icon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"obj-icon"})));let T=null;g.ketchup.debug.isDebug()&&I?T=m.obj.t+"; "+m.obj.p+"; "+m.obj.k+";":null!=m.title&&""!=m.title.trim()&&(T=m.title);let W=null;if(m.info){const e=Object.assign({},m.info);e.color||(e.color=`var(${c.INFO})`),e.icon||(e.icon="info"),W=p(b,Object.assign({},{color:e.color,resource:e.icon,sizeX:"1.25em",sizeY:"1.25em",title:e.message?e.message:"",wrapperClass:"cell-info"}))}return p("div",{onKeyUp:e=>O(e,i,D,r.KEYUP),class:V,"kup-get-cell-props":()=>i,style:m.style},p("div",{class:"f-cell__content",style:m.styleContent,title:T},l&&l.length>0?l:[i.indents,W,M,H]))};function O(e,t,c,a){const i=t.cell,n=t.column,o=t.component,l=t.row;let p="INPUT"===e.target.tagName?e.target.value:e.detail.value;if(a===r.UPDATE){switch(c){case s.AUTOCOMPLETE:case s.COMBOBOX:case s.DATE:case s.TIME:i.data&&(i.data.initialValue=p);break;case s.CHECKBOX:case s.SWITCH:p="on"===p?"0":"1",i.data&&(i.data.checked="0"!==p);break;case s.CHIP:case s.MULTI_AUTOCOMPLETE:case s.MULTI_COMBOBOX:p=e.detail.stringifiedValues,i.data&&(i.data.data=e.detail.comp.data)}i.obj&&(i.obj.k=p.toString()),i.value=p.toString(),i.displayedValue=null,i.displayedValue=u(n,i)}if(o&&o.rootElement){const t=new CustomEvent(a,{bubbles:!0,cancelable:!0,composed:!0,detail:{comp:o,id:o.rootElement.id,cell:i,column:n,event:e,row:l,type:c}});if(o.rootElement.dispatchEvent(t),a===r.UPDATE)try{o.refresh()}catch(e){}}}function x(e){var t;return l.includes(null===(t=e.component)||void 0===t?void 0:t.rootElement.tagName)}function _(e){var t;return i.includes(null===(t=e.component)||void 0===t?void 0:t.rootElement.tagName)}export{v as F,j as I,w as K,m as a,y as b}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as s,f as i,h as o,H as a,g as n}from"./p-d4ece435.js";import{k as e,g as r,s as c}from"./p-940a5feb.js";import{c as l}from"./p-97e8ea42.js";import{F as p}from"./p-77e3d537.js";import"./p-6c77a36c.js";import"./p-5d398e42.js";const h="snackbar";var u;!function(t){t.actionButton="Set of FButton props to set the action button.",t.closeButton="When true, the hide button will be displayed.",t.customStyle="Custom style of the component.",t.text="Sets the textual content of the snackbar.",t.timeout="Defaults at null, when set the snackbar will automatically disappear after the specified amount of milliseconds."}(u||(u={}));const b=class{constructor(i){t(this,i),this.kupActionClick=s(this,"kup-snackbar-actionclick",6),this.kupManager=e(),this.visible=!1,this.actionButton=null,this.closeButton=!0,this.customStyle="",this.text="",this.timeout=null}onKupActionClick(){this.hide(),this.kupActionClick.emit({comp:this,id:this.rootElement.id})}async getProps(t){return r(this,u,t)}async hide(){this.visible=!1}async refresh(){i(this)}async setProps(t){c(this,u,t)}async show(){this.visible=!0}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.timeout&&this.visible&&setTimeout((()=>{this.hide()}),this.timeout),this.kupManager.debug.logRender(this,!0)}render(){return o(a,{"kup-visible":this.visible},o("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),o("div",{id:l},o("div",{class:h},o("div",{class:`${h}__text`},this.text),this.actionButton||this.closeButton?o("div",{class:`${h}__buttons`},this.actionButton?o("div",{class:`${h}__action`},o(p,Object.assign({},this.actionButton,{onClick:()=>this.onKupActionClick()}))):null,this.closeButton?o("div",{class:`${h}__close`},o(p,{icon:"close",onClick:()=>this.hide()})):null):null)))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return n(this)}};b.style=":host{animation:snackbar-show 125ms;bottom:0;box-sizing:border-box;display:block;left:0;outline:none;pointer-events:none;position:fixed;transition:opacity 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms, transform 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms, -webkit-transform 0.15s cubic-bezier(0, 0, 0.2, 1) 0ms;width:100%;z-index:calc(var(--kup-navbar-zindex) + 1)}:host(:not([kup-visible])){display:none}#kup-component{box-sizing:border-box;display:flex;justify-content:center;height:100%;padding:8px;width:100%}.snackbar{align-items:center;background:var(--kup-navbar-background-color);border-radius:5px;box-shadow:var(--kup-box-shadow);color:var(--kup-navbar-color);display:flex;justify-content:space-between;max-width:672px;min-height:48px;min-width:344px}.snackbar__text{padding:14px 16px;pointer-events:all;word-break:break-word}.snackbar__buttons{--kup-button-primary-color:var(--kup-navbar-color);--kup-button-primary-color-rgb:var(--kup-navbar-color-rgb);--kup-button-primary-color-h:var(--kup-navbar-color-h);--kup-button-primary-color-s:var(--kup-navbar-color-s);--kup-button-primary-color-l:var(--kup-navbar-color-l);align-items:center;display:flex;justify-content:flex-end;margin-right:8px;pointer-events:all;width:max-content}.snackbar__close{--kup-button-font-size:11px;margin-left:8px;pointer-events:all}@keyframes snackbar-show{from{transform:scale(0.5);opacity:0}to{transform:scale(1);opacity:1}}:host(.kup-top){bottom:unset;top:var(--kup-navbar-height, 0)}";export{b as kup_snackbar}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,a as t}from"./p-d4ece435.js";import{K as l}from"./p-940a5feb.js";const i=(t,l)=>e("div",Object.assign({class:`f-text-field ${t.danger?"kup-danger":""} ${t.fullHeight?"kup-full-height":""} ${t.fullWidth?"kup-full-width":""} ${t.info?"kup-info":""} ${t.secondary?"kup-secondary":""} ${t.shaped?"kup-shaped":""} ${t.success?"kup-success":""} ${t.warning?"kup-warning":""} ${t.wrapperClass?t.wrapperClass:""}`},t.dataSet,{id:t.id,title:t.title}),t.leadingLabel||t.trailingLabel?e("div",{class:"mdc-form-field "+(t.leadingLabel?"mdc-form-field--align-end":"")},[d(t),c(t),e("label",null,t.label)]):[d(t),c(t)],l);function d(i){const d=i.textArea||i.outlined;let c,n;if(!i.label||i.leadingLabel||i.trailingLabel||(c=e("label",{class:"mdc-floating-label",htmlFor:"kup-input"},i.label)),i.icon){let d,c="";if(Object.values(l).indexOf(i.icon)>-1)c=i.icon.replace("--","");else{let e=`url('${t(`./assets/svg/${i.icon}.svg`)}') no-repeat center`;d={mask:e,webkitMask:e}}n=e("span",{style:d,onClick:i.onIconClick,class:`mdc-text-field__icon kup-icon action ${c}`})}return e("div",{class:{"is-clearable":i.isClearable,"mdc-text-field":!0,"mdc-text-field--disabled":i.disabled,"mdc-text-field--filled":!i.fullWidth&&!d,"mdc-text-field--no-label":!i.label,"mdc-text-field--fullwidth":i.fullWidth,"mdc-text-field--outlined":d,"mdc-text-field--textarea":i.textArea,"mdc-text-field--with-leading-icon":i.icon&&!i.trailingIcon,"mdc-text-field--with-trailing-icon":i.icon&&i.trailingIcon}},i.textArea&&i.maxLength?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",i.maxLength):void 0,i.trailingIcon?void 0:n,i.textArea?e("span",{class:"mdc-text-field__resizer"},e("textarea",{class:"mdc-text-field__input",disabled:i.disabled,readOnly:i.readOnly,maxlength:i.maxLength,value:i.value,onBlur:i.onBlur,onClick:i.onClick,onChange:i.onChange,onFocus:i.onFocus,onInput:i.onInput,onKeyDown:i.onKeyDown})):e("input",{inputmode:i.inputMode?i.inputMode:void 0,type:i.inputType?i.inputType:"text",step:i.step,min:i.min,max:i.max,name:i.name,class:"mdc-text-field__input",disabled:i.disabled,readOnly:i.readOnly,placeholder:i.fullWidth&&!i.outlined?i.label:void 0,maxlength:i.maxLength,value:i.value,onBlur:i.onBlur,onChange:e=>{null!==i.decimals&&"number"===i.inputType&&(e.target.value=parseFloat(e.target.value).toFixed(i.decimals)),i.onChange&&i.onChange(e)},onClick:i.onClick,onFocus:i.onFocus,onInput:i.onInput,onKeyDown:i.onKeyDown}),i.isClearable?e("span",{class:`mdc-text-field__icon kup-icon ${l.CLEAR.replace("--","")}`,onClick:i.onClearIconClick}):void 0,i.trailingIcon?n:void 0,i.fullWidth||d?void 0:c,d?e("div",{class:"mdc-notched-outline"},e("div",{class:"mdc-notched-outline__leading"}),e("div",{class:"mdc-notched-outline__notch"},c),e("div",{class:"mdc-notched-outline__trailing"})):e("span",{class:"mdc-line-ripple"}))}function c(t){if(!1!==t.helperEnabled){if(t.helper)return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:{"mdc-text-field-helper-text":!0,"mdc-text-field-helper-text--persistent":!t.helperWhenFocused}},t.helper),t.maxLength&&!t.textArea?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",t.maxLength.toString()):void 0);if(t.maxLength&&!t.textArea)return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",t.maxLength))}}export{i as F}
|