@alaarab/ogrid-angular 2.5.0 → 2.5.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/esm/index.js CHANGED
@@ -670,7 +670,7 @@ import {createGridDataAccessor,columnLetterToIndex,flattenColumns,getMultiSelect
670
670
  } @else {
671
671
  There are no items available at this time.
672
672
  }
673
- `})],Z);var Le=class{constructor(){this.propsSignal=signal(void 0);this.ogridService=inject(ie);effect(()=>{let e=this.propsSignal();e&&this.ogridService.configure(e);});}set props(e){this.propsSignal.set(e);}get showToolbar(){return this.ogridService.columnChooserPlacement()==="toolbar"||this.ogridService.toolbar()!=null||this.ogridService.fullScreen()}onPageSizeChange(e){this.ogridService.pagination().setPageSize(e);}};l([Input({required:true})],Le.prototype,"props",1);function Rt(p,e){let t=signal(p());return effect(n=>{let i=p(),o=setTimeout(()=>{t.set(i);},e);n(()=>clearTimeout(o));}),t}function wt(p,e){let t=null;return((...n)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{p(...n),t=null;},e);})}function xt(p){return((...e)=>p()(...e))}var nt=class{constructor(){this.stateService=inject(oe);this.columnReorderService=inject(le);this.virtualScrollService=inject(ae);this.lastMouseShift=false;this.columnSizingVersion=signal(0);this.measureDirty=signal(true);this.measuredColumnWidths=signal({});this.wrapperElSignal=signal(null);this.tableContainerElSignal=signal(null);this.state=computed(()=>this.stateService.getState());this.layoutState=computed(()=>this.state().layout);this.rowSelectionState=computed(()=>this.state().rowSelection);this.editingState=computed(()=>this.state().editing);this.interactionState=computed(()=>this.state().interaction);this.contextMenuState=computed(()=>this.state().contextMenu);this.viewModelsState=computed(()=>this.state().viewModels);this.pinningState=computed(()=>this.state().pinning);this.tableContainerEl=computed(()=>this.tableContainerElSignal());this.items=computed(()=>this.getProps()?.items??[]);this.getRowId=computed(()=>this.getProps()?.getRowId??(e=>e.id));this.isLoading=computed(()=>this.getProps()?.isLoading??false);this.loadingMessage=computed(()=>"Loading\u2026");this.layoutModeFit=computed(()=>(this.getProps()?.layoutMode??"fill")==="content");this.rowHeightCssVar=computed(()=>{let e=this.getProps()?.rowHeight;return e?`${e}px`:null});this.ariaLabel=computed(()=>this.getProps()?.["aria-label"]??"Data grid");this.ariaLabelledBy=computed(()=>this.getProps()?.["aria-labelledby"]);this.stickyHeader=computed(()=>this.getProps()?.stickyHeader??true);this.emptyState=computed(()=>this.getProps()?.emptyState);this.currentPage=computed(()=>this.getProps()?.currentPage??1);this.pageSize=computed(()=>this.getProps()?.pageSize??25);this.rowNumberOffset=computed(()=>this.hasRowNumbersCol()?(this.currentPage()-1)*this.pageSize():0);this.propsVisibleColumns=computed(()=>this.getProps()?.visibleColumns);this.propsColumnOrder=computed(()=>this.getProps()?.columnOrder);this.visibleCols=computed(()=>this.layoutState().visibleCols);this.hasCheckboxCol=computed(()=>this.layoutState().hasCheckboxCol);this.hasRowNumbersCol=computed(()=>this.layoutState().hasRowNumbersCol);this.colOffset=computed(()=>this.layoutState().colOffset);this.containerWidth=computed(()=>this.layoutState().containerWidth);this.minTableWidth=computed(()=>this.layoutState().minTableWidth);this.desiredTableWidth=computed(()=>this.layoutState().desiredTableWidth);this.columnSizingOverrides=computed(()=>this.layoutState().columnSizingOverrides);this.selectedRowIds=computed(()=>this.rowSelectionState().selectedRowIds);this.allSelected=computed(()=>this.rowSelectionState().allSelected);this.someSelected=computed(()=>this.rowSelectionState().someSelected);this.editingCell=computed(()=>this.editingState().editingCell);this.pendingEditorValue=computed(()=>this.editingState().pendingEditorValue);this.activeCell=computed(()=>this.interactionState().activeCell);this.selectionRange=computed(()=>this.interactionState().selectionRange);this.hasCellSelection=computed(()=>this.interactionState().hasCellSelection);this.cutRange=computed(()=>this.interactionState().cutRange);this.copyRange=computed(()=>this.interactionState().copyRange);this.canUndo=computed(()=>this.interactionState().canUndo);this.canRedo=computed(()=>this.interactionState().canRedo);this.isDragging=computed(()=>this.interactionState().isDragging);this.menuPosition=computed(()=>this.contextMenuState().menuPosition);this.statusBarConfig=computed(()=>this.viewModelsState().statusBarConfig);this.showEmptyInGrid=computed(()=>this.viewModelsState().showEmptyInGrid);this.headerFilterInput=computed(()=>this.viewModelsState().headerFilterInput);this.cellDescriptorInput=computed(()=>this.viewModelsState().cellDescriptorInput);this.pinnedColumnsMap=computed(()=>this.pinningState().pinnedColumns);this.vsEnabled=computed(()=>this.virtualScrollService.isActive());this.vsVisibleRange=computed(()=>this.virtualScrollService.visibleRange());this.vsTopSpacerHeight=computed(()=>this.vsEnabled()?this.vsVisibleRange().offsetTop:0);this.vsBottomSpacerHeight=computed(()=>this.vsEnabled()?this.vsVisibleRange().offsetBottom:0);this.vsVisibleItems=computed(()=>{let e=this.items();if(!this.vsEnabled())return e;let t=this.vsVisibleRange();return e.slice(t.startIndex,Math.min(t.endIndex+1,e.length))});this.vsStartIndex=computed(()=>this.vsEnabled()?this.vsVisibleRange().startIndex:0);this.vsColumnsEnabled=computed(()=>this.virtualScrollService.columnsEnabled());this.vsColumnRange=computed(()=>this.virtualScrollService.columnRange());this.vsColumnPartition=computed(()=>{if(!this.vsColumnsEnabled())return null;let e=this.visibleCols(),t=this.vsColumnRange(),i=this.getProps()?.pinnedColumns;return partitionColumnsForVirtualization(e,t,i)});this.vsColumnLayouts=computed(()=>{let e=this.columnLayouts(),t=this.vsColumnPartition();if(!t)return e;let n=new Set;for(let i of t.pinnedLeft)n.add(i.columnId);for(let i of t.virtualizedUnpinned)n.add(i.columnId);for(let i of t.pinnedRight)n.add(i.columnId);return e.filter(i=>n.has(i.col.columnId))});this.vsVisibleCols=computed(()=>{let e=this.visibleCols(),t=this.vsColumnPartition();if(!t)return e;let n=new Set;for(let i of t.pinnedLeft)n.add(i.columnId);for(let i of t.virtualizedUnpinned)n.add(i.columnId);for(let i of t.pinnedRight)n.add(i.columnId);return e.filter(i=>n.has(i.columnId))});this.vsLeftSpacerWidth=computed(()=>this.vsColumnPartition()?.leftSpacerWidth??0);this.vsRightSpacerWidth=computed(()=>this.vsColumnPartition()?.rightSpacerWidth??0);this.globalColIndexMap=computed(()=>{let e=this.visibleCols(),t=new Map;for(let n=0;n<e.length;n++)t.set(e[n].columnId,n);return t});this.popoverAnchorEl=computed(()=>this.editingState().popoverAnchorEl);this.pendingEditorValueForPopover=computed(()=>this.editingState().pendingEditorValue);this.allowOverflowX=computed(()=>{if(this.getProps()?.suppressHorizontalScroll)return false;let t=this.containerWidth(),n=this.minTableWidth(),i=this.desiredTableWidth();return t>0&&(n>t||i>t)});this.selectionCellCount=computed(()=>{let e=this.selectionRange();if(e)return (Math.abs(e.endRow-e.startRow)+1)*(Math.abs(e.endCol-e.startCol)+1)});this.headerRows=computed(()=>{let e=this.getProps();return e?buildHeaderRows(e.columns,e.visibleColumns):[]});this.columnLayouts=computed(()=>{let e=this.visibleCols(),n=this.getProps()?.pinnedColumns??{},i=this.measuredColumnWidths(),o=this.columnSizingOverrides();return e.map(r=>{let s=n[r.columnId],u=s==="left"||r.pinned==="left",d=s==="right"||r.pinned==="right",c=this.getColumnWidth(r),m=!!o[r.columnId],f=i[r.columnId],b=r.minWidth??DEFAULT_MIN_COLUMN_WIDTH,R=m?c:Math.max(b,f??0);return {col:r,pinnedLeft:u,pinnedRight:d,minWidth:R,width:c}})});this.pinningOffsets=computed(()=>{let e=this.columnLayouts(),t={},n={},i=0;this.hasCheckboxCol()&&(i+=CHECKBOX_COLUMN_WIDTH),this.hasRowNumbersCol()&&(i+=this.getRowNumberWidth());let o=0,r=e.length;for(let s=0;s<r;s++){let u=e[s];u.pinnedLeft&&(t[u.col.columnId]=i,i+=u.width+CELL_PADDING);let d=r-1-s,c=e[d];c.pinnedRight&&(n[c.col.columnId]=o,o+=c.width+CELL_PADDING);}return {leftOffsets:t,rightOffsets:n}});this.columnMenuHandlersMap=computed(()=>{let e=this.visibleCols(),t=new Map;for(let n of e)t.set(n.columnId,this.buildColumnMenuHandlers(n.columnId));return t});}ngAfterViewInit(){let e=this.getWrapperRef()?.nativeElement??null,t=this.getTableContainerRef()?.nativeElement??null;e&&this.wrapperElSignal.set(e),t&&this.tableContainerElSignal.set(t),this.measureColumnWidths();}ngAfterViewChecked(){this.measureDirty()&&(this.measureDirty.set(false),this.measureColumnWidths());}measureColumnWidths(){let e=this.getWrapperRef()?.nativeElement;if(!e)return;let t=e.querySelectorAll("th[data-column-id]");if(t.length===0)return;let n={};t.forEach(r=>{let s=r.getAttribute("data-column-id");s&&(n[s]=r.offsetWidth);});let i=this.measuredColumnWidths(),o=Object.keys(n).length!==Object.keys(i).length;if(!o){for(let r in n)if(i[r]!==n[r]){o=true;break}}o&&this.measuredColumnWidths.set(n);}getGlobalColIndex(e){return this.globalColIndexMap().get(e.columnId)??0}getRowNumberWidth(){let t=this.columnSizingOverrides()[ROW_NUMBER_COLUMN_ID];return t?t.widthPx:ROW_NUMBER_COLUMN_WIDTH}initBase(){effect(()=>{let e=this.getProps();e&&this.stateService.props.set(e);}),effect(()=>{let e=this.wrapperElSignal();e&&(this.stateService.wrapperEl.set(e),this.columnReorderService.wrapperEl.set(e));}),effect(()=>{let e=this.getProps();if(e){let t=this.visibleCols();this.columnReorderService.columns.set(t),this.columnReorderService.columnOrder.set(e.columnOrder),this.columnReorderService.onColumnOrderChange.set(e.onColumnOrderChange),this.columnReorderService.enabled.set(e.columnReorder===true);}}),effect(()=>{this.visibleCols(),this.columnSizingOverrides(),this.columnSizingVersion(),this.measureDirty.set(true);}),effect(()=>{let e=this.getProps();e&&(this.virtualScrollService.totalRows.set(e.items.length),e.virtualScroll&&this.virtualScrollService.updateConfig({enabled:e.virtualScroll.enabled,rowHeight:e.virtualScroll.rowHeight,overscan:e.virtualScroll.overscan,columns:e.virtualScroll.columns,columnOverscan:e.virtualScroll.columnOverscan}));}),effect(()=>{let e=this.columnLayouts(),n=this.getProps()?.pinnedColumns??{},i=e.filter(o=>!o.pinnedLeft&&!o.pinnedRight&&!n[o.col.columnId]).map(o=>o.width);this.virtualScrollService.columnWidths.set(i);}),effect(()=>{let e=this.wrapperElSignal();e&&(this.virtualScrollService.setContainer(e),this.virtualScrollService.containerHeight.set(e.clientHeight),this.virtualScrollService.containerWidth.set(e.clientWidth));});}getEffectiveMinWidth(e){return this.columnLayouts().find(n=>n.col.columnId===e.columnId)?.minWidth??e.minWidth??DEFAULT_MIN_COLUMN_WIDTH}getCellInteractionProps(e){return {tabIndex:e.isActive?0:-1,dataRowIndex:e.rowIndex,dataColIndex:e.globalColIndex,dataInRange:e.isInRange?"true":null,role:e.canEditAny?"button":null}}asColumnDef(e){return e}visibleColIndex(e){return this.visibleCols().indexOf(e)}getColumnWidth(e){let n=this.columnSizingOverrides()[e.columnId];return n?n.widthPx:e.defaultWidth??e.minWidth??DEFAULT_MIN_COLUMN_WIDTH}getFilterConfig(e){return getHeaderFilterConfig(e,this.headerFilterInput())}buildColumnMenuHandlers(e){return {onPinLeft:()=>this.onPinColumn(e,"left"),onPinRight:()=>this.onPinColumn(e,"right"),onUnpin:()=>this.onUnpinColumn(e),onSortAsc:()=>this.onSortAsc(e),onSortDesc:()=>this.onSortDesc(e),onClearSort:()=>this.onClearSort(e),onAutosizeThis:()=>this.onAutosizeColumn(e),onAutosizeAll:()=>this.onAutosizeAllColumns(),onClose:()=>{}}}getColumnMenuHandlersMemoized(e){return this.columnMenuHandlersMap().get(e)??this.buildColumnMenuHandlers(e)}getCellDescriptor(e,t,n,i){return getCellRenderDescriptor(e,t,n,i,this.cellDescriptorInput())}resolveCellContent(e,t,n){try{return resolveCellDisplayContent(e,t,n)}catch(i){let o=this.getProps()?.onCellError;return o&&o(i instanceof Error?i:new Error(String(i)),void 0),""}}resolveCellStyleFn(e,t,n){return resolveCellStyle(e,t,n)}buildPopoverEditorProps(e,t,n){return buildPopoverEditorProps(e,t,n,this.pendingEditorValue(),{setPendingEditorValue:i=>this.setPendingEditorValue(i),commitCellEdit:(i,o,r,s,u,d)=>this.commitEdit(i,o,r,s,u,d),cancelPopoverEdit:()=>this.cancelPopoverEdit()})}isActiveCell(e,t){let n=this.activeCell();return n?n.rowIndex===e&&n.columnIndex===t+this.colOffset():false}isInSelectionRange(e,t){let n=this.selectionRange();if(!n)return false;let i=Math.min(n.startRow,n.endRow),o=Math.max(n.startRow,n.endRow),r=Math.min(n.startCol,n.endCol),s=Math.max(n.startCol,n.endCol);return e>=i&&e<=o&&t>=r&&t<=s}isSelectionEndCell(e,t){let n=this.selectionRange();return !n||this.isDragging()||this.copyRange()||this.cutRange()?false:e===n.endRow&&t===n.endCol}getCellBackground(e,t){return this.isInSelectionRange(e,t)?"var(--ogrid-range-bg, rgba(33, 115, 70, 0.08))":null}getEditorType(e,t){return e.cellEditor==="text"||e.cellEditor==="select"||e.cellEditor==="checkbox"||e.cellEditor==="date"||e.cellEditor==="richSelect"?e.cellEditor:e.type==="date"?"date":e.type==="boolean"?"checkbox":"text"}getSelectValues(e){let t=e.cellEditorParams;return t&&typeof t=="object"&&"values"in t?t.values.map(String):[]}formatDateForInput(e){if(!e)return "";let t=new Date(String(e));return Number.isNaN(t.getTime())?"":t.toISOString().split("T")[0]}getPinnedLeftOffset(e){return this.pinningOffsets().leftOffsets[e]??null}getPinnedRightOffset(e){return this.pinningOffsets().rightOffsets[e]??null}onWrapperScroll(e){this.virtualScrollService.onScroll(e);}setPopoverAnchorEl(e){this.state().editing.setPopoverAnchorEl(e);}setPendingEditorValue(e){this.state().editing.setPendingEditorValue(e);}cancelPopoverEdit(){this.state().editing.cancelPopoverEdit();}commitPopoverEdit(e,t,n,i,o,r){this.state().editing.commitCellEdit(e,t,n,i,o,r);}onWrapperMouseDown(e){this.lastMouseShift=e.shiftKey;}onGridKeyDown(e){this.state().interaction.handleGridKeyDown(e);}onCellMouseDown(e,t,n){this.state().interaction.handleCellMouseDown(e,t,n);}onCellClick(e,t){this.state().interaction.setActiveCell?.({rowIndex:e,columnIndex:t});}onCellContextMenu(e){this.state().contextMenu.handleCellContextMenu(e);}onCellDblClick(e,t){this.state().editing.setEditingCell({rowId:e,columnId:t});}onFillHandleMouseDown(e){this.state().interaction.handleFillHandleMouseDown?.(e);}onResizeStart(e,t){e.preventDefault(),this.state().interaction.setActiveCell?.(null),this.state().interaction.setSelectionRange?.(null),this.getWrapperRef()?.nativeElement.focus({preventScroll:true});let n=e.clientX,i=t.columnId,o=i===ROW_NUMBER_COLUMN_ID?this.getRowNumberWidth():this.getColumnWidth(t),r=i===ROW_NUMBER_COLUMN_ID?ROW_NUMBER_COLUMN_MIN_WIDTH:t.minWidth??DEFAULT_MIN_COLUMN_WIDTH,s=d=>{let c=d.clientX-n,m=Math.max(r,o+c),f={...this.columnSizingOverrides(),[t.columnId]:{widthPx:m}};this.state().layout.setColumnSizingOverrides(f),this.columnSizingVersion.update(b=>b+1);},u=()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",u);let d=this.getColumnWidth(t);this.state().layout.onColumnResized?.(t.columnId,d);};window.addEventListener("pointermove",s),window.addEventListener("pointerup",u);}onResizeDoubleClick(e,t){e.preventDefault(),e.stopPropagation();let n=t.columnId,o=(e.currentTarget.closest("th")??e.currentTarget.parentElement)?.closest("table")?.parentElement??void 0,r=t.minWidth??DEFAULT_MIN_COLUMN_WIDTH,s=measureColumnContentWidth(n,r,o),u={...this.columnSizingOverrides(),[n]:{widthPx:s}};this.state().layout.setColumnSizingOverrides(u),this.columnSizingVersion.update(d=>d+1),this.state().layout.onColumnResized?.(n,s);}onSelectAllChange(e){let t=e.target.checked;this.state().rowSelection.handleSelectAll(!!t);}onRowClick(e,t){if(this.getProps()?.rowSelection!=="single")return;let i=this.selectedRowIds();this.state().rowSelection.updateSelection(i.has(t)?new Set:new Set([t]));}onRowCheckboxChange(e,t,n){let i=t.target.checked;this.state().rowSelection.handleRowCheckboxChange(e,i,n,this.lastMouseShift);}commitEdit(e,t,n,i,o,r){this.state().editing.commitCellEdit(e,t,n,i,o,r);}cancelEdit(){this.state().editing.setEditingCell(null);}onEditorKeydown(e,t,n,i,o,r){if(e.key==="Enter"){e.preventDefault();let s=e.target.value;this.commitEdit(t,n,i,s,o,r);}else e.key==="Escape"&&(e.preventDefault(),this.cancelEdit());}closeContextMenu(){this.state().contextMenu.closeContextMenu();}handleCopy(){this.state().interaction.handleCopy();}handleCut(){this.state().interaction.handleCut();}handlePaste(){this.state().interaction.handlePaste();}handleSelectAllCells(){this.state().interaction.handleSelectAllCells();}onUndo(){this.state().interaction.onUndo?.();}onRedo(){this.state().interaction.onRedo?.();}onHeaderMouseDown(e,t){this.columnReorderService.handleHeaderMouseDown(e,t);}onPinColumn(e,t){this.state().pinning.pinColumn(e,t);}onUnpinColumn(e){this.state().pinning.unpinColumn(e);}isPinned(e){return this.state().pinning.isPinned(e)}getPinState(e){let t=this.isPinned(e);return {canPinLeft:t!=="left",canPinRight:t!=="right",canUnpin:!!t}}onSortAsc(e){this.getProps()?.onColumnSort?.(e,"asc");}onSortDesc(e){this.getProps()?.onColumnSort?.(e,"desc");}onClearSort(e){let t=this.getProps(),n=e??t?.sortBy;n&&t?.onColumnSort?.(n,null);}getSortState(e){let t=this.getProps();return t?.sortBy===e?t.sortDirection??"asc":null}onAutosizeColumn(e){let t=this.visibleCols().find(i=>i.columnId===e);if(!t)return;let n=measureColumnContentWidth(e,t.minWidth,this.tableContainerEl()??void 0);this.state().layout.setColumnSizingOverrides({...this.columnSizingOverrides(),[e]:{widthPx:n}}),(this.state().layout.onAutosizeColumn??this.state().layout.onColumnResized)?.(e,n);}onAutosizeAllColumns(){let e=this.tableContainerEl()??void 0,t={};for(let n of this.visibleCols()){let i=measureColumnContentWidth(n.columnId,n.minWidth,e);t[n.columnId]={widthPx:i},(this.state().layout.onAutosizeColumn??this.state().layout.onColumnResized)?.(n.columnId,i);}this.state().layout.setColumnSizingOverrides({...this.columnSizingOverrides(),...t});}};var T=class{constructor(){this._filterType=signal("none");this._selectedValues=signal(void 0);this._options=signal(void 0);this._textValue=signal("");this._selectedUser=signal(void 0);this._dateValue=signal(void 0);this.isSorted=false;this.isSortedDescending=false;this.onSort=void 0;this.onFilterChange=void 0;this.isLoadingOptions=false;this.onTextChange=void 0;this.onUserChange=void 0;this.peopleSearch=void 0;this.onDateChange=void 0;this.isFilterOpen=signal(false);this.tempTextValue=signal("");this.searchText=signal("");this.tempSelected=signal(new Set);this.peopleSearchText=signal("");this.peopleSuggestions=signal([]);this.isPeopleLoading=signal(false);this.tempDateFrom=signal("");this.tempDateTo=signal("");this.popoverTop=signal(0);this.popoverLeft=signal(0);this.peopleDebounceTimer=null;this.hasActiveFilter=computed(()=>{let e=this._filterType();return e==="text"?!!this._textValue():e==="multiSelect"?(this._selectedValues()?.length??0)>0:e==="people"?this._selectedUser()!=null:e==="date"?this._dateValue()!=null:false});this.filteredOptions=computed(()=>{let e=this._options()??[],t=this.searchText().toLowerCase().trim();return t?e.filter(n=>n.toLowerCase().includes(t)):e});}set filterType(e){this._filterType.set(e);}get filterType(){return this._filterType()}set selectedValues(e){this._selectedValues.set(e);}get selectedValues(){return this._selectedValues()}set options(e){this._options.set(e);}get options(){return this._options()}set textValue(e){this._textValue.set(e);}get textValue(){return this._textValue()}set selectedUser(e){this._selectedUser.set(e);}get selectedUser(){return this._selectedUser()}set dateValue(e){this._dateValue.set(e);}get dateValue(){return this._dateValue()}asInputValue(e){return e.target.value}toggleFilter(e){if(e.stopPropagation(),this.isFilterOpen()){this.isFilterOpen.set(false);return}this.tempTextValue.set(this.textValue),this.tempSelected.set(new Set(this.selectedValues??[])),this.searchText.set(""),this.peopleSearchText.set(""),this.peopleSuggestions.set([]);let t=this.dateValue;this.tempDateFrom.set(t?.from??""),this.tempDateTo.set(t?.to??"");let n=this.getHeaderEl()?.nativeElement;if(n){let i=n.getBoundingClientRect();this.popoverTop.set(i.bottom+4),this.popoverLeft.set(i.left);}this.isFilterOpen.set(true);}onTextKeydown(e){e.stopPropagation(),e.key==="Enter"&&(e.preventDefault(),this.handleTextApply());}handleTextApply(){this.onTextChange&&this.onTextChange(this.tempTextValue()),this.isFilterOpen.set(false);}handleTextClear(){this.tempTextValue.set(""),this.onTextChange&&this.onTextChange(""),this.isFilterOpen.set(false);}handleCheckboxChange(e,t){let n=t.target.checked;this.tempSelected.update(i=>{let o=new Set(i);return n?o.add(e):o.delete(e),o});}handleSelectAllFiltered(){this.tempSelected.update(e=>{let t=new Set(e);for(let n of this.filteredOptions())t.add(n);return t});}handleClearSelection(){this.tempSelected.set(new Set);}handleApplyMultiSelect(){this.onFilterChange&&this.onFilterChange(Array.from(this.tempSelected())),this.isFilterOpen.set(false);}onPeopleSearchInput(e){let t=e.target.value;this.peopleSearchText.set(t),this.peopleDebounceTimer&&clearTimeout(this.peopleDebounceTimer);let n=t.trim();if(!n){this.peopleSuggestions.set([]),this.isPeopleLoading.set(false);return}this.isPeopleLoading.set(true),this.peopleDebounceTimer=setTimeout(()=>{let i=this.peopleSearch;i&&i(n).then(o=>{this.peopleSuggestions.set(o),this.isPeopleLoading.set(false);}).catch(()=>{this.peopleSuggestions.set([]),this.isPeopleLoading.set(false);});},300);}handleUserSelect(e){this.onUserChange&&this.onUserChange(e),this.isFilterOpen.set(false);}handleClearUser(){this.onUserChange&&this.onUserChange(void 0),this.isFilterOpen.set(false);}handleDateApply(){let e=this.tempDateFrom(),t=this.tempDateTo();this.onDateChange&&(!e&&!t?this.onDateChange(void 0):this.onDateChange({from:e||void 0,to:t||void 0})),this.isFilterOpen.set(false);}handleDateClear(){this.tempDateFrom.set(""),this.tempDateTo.set(""),this.onDateChange&&this.onDateChange(void 0),this.isFilterOpen.set(false);}ngOnDestroy(){this.peopleDebounceTimer&&(clearTimeout(this.peopleDebounceTimer),this.peopleDebounceTimer=null);}onDocumentClick(e,t){let n=e.target;!n.closest(t)&&!n.closest(".ogrid-header-filter__popover")&&this.isFilterOpen.set(false);}};l([Input({required:true})],T.prototype,"columnKey",2),l([Input({required:true})],T.prototype,"columnName",2),l([Input({required:true})],T.prototype,"filterType",1),l([Input()],T.prototype,"selectedValues",1),l([Input()],T.prototype,"options",1),l([Input()],T.prototype,"textValue",1),l([Input()],T.prototype,"selectedUser",1),l([Input()],T.prototype,"dateValue",1),l([Input()],T.prototype,"isSorted",2),l([Input()],T.prototype,"isSortedDescending",2),l([Input()],T.prototype,"onSort",2),l([Input()],T.prototype,"onFilterChange",2),l([Input()],T.prototype,"isLoadingOptions",2),l([Input()],T.prototype,"onTextChange",2),l([Input()],T.prototype,"onUserChange",2),l([Input()],T.prototype,"peopleSearch",2),l([Input()],T.prototype,"onDateChange",2);var ve=class{constructor(){this._columns=signal([]);this._visibleColumns=signal(new Set);this.visibilityChange=new EventEmitter;this.isOpen=signal(false);this.visibleCount=computed(()=>this._visibleColumns().size);this.totalCount=computed(()=>this._columns().length);}set columns(e){this._columns.set(e);}get columns(){return this._columns()}set visibleColumns(e){this._visibleColumns.set(e);}get visibleColumns(){return this._visibleColumns()}toggle(){this.isOpen.update(e=>!e);}onCheckboxChange(e,t){let n=t.target.checked;this.visibilityChange.emit({columnKey:e,visible:n});}onToggle(e,t){this.visibilityChange.emit({columnKey:e,visible:t});}selectAll(){for(let e of this.columns)this.visibleColumns.has(e.columnId)||this.visibilityChange.emit({columnKey:e.columnId,visible:true});}clearAll(){for(let e of this.columns)this.visibleColumns.has(e.columnId)&&this.visibilityChange.emit({columnKey:e.columnId,visible:false});}onClearAll(){for(let e of this.columns)e.required!==true&&this.visibleColumns.has(e.columnId)&&this.visibilityChange.emit({columnKey:e.columnId,visible:false});}onSelectAll(){for(let e of this.columns)this.visibleColumns.has(e.columnId)||this.visibilityChange.emit({columnKey:e.columnId,visible:true});}};l([Input({required:true})],ve.prototype,"columns",1),l([Input({required:true})],ve.prototype,"visibleColumns",1),l([Output()],ve.prototype,"visibilityChange",2);var $=class{constructor(){this._currentPage=signal(1);this._pageSize=signal(25);this._totalCount=signal(0);this._pageSizeOptions=signal(void 0);this._entityLabelPlural=signal("items");this.pageChange=new EventEmitter;this.pageSizeChange=new EventEmitter;this.labelPlural=computed(()=>this._entityLabelPlural()??"items");this.vm=computed(()=>{let e=this._pageSizeOptions();return getPaginationViewModel(this._currentPage(),this._pageSize(),this._totalCount(),e?{pageSizeOptions:e}:void 0)});}set currentPage(e){this._currentPage.set(e);}get currentPage(){return this._currentPage()}set pageSize(e){this._pageSize.set(e);}get pageSize(){return this._pageSize()}set totalCount(e){this._totalCount.set(e);}get totalCount(){return this._totalCount()}set pageSizeOptions(e){this._pageSizeOptions.set(e);}get pageSizeOptions(){return this._pageSizeOptions()}set entityLabelPlural(e){this._entityLabelPlural.set(e);}get entityLabelPlural(){return this._entityLabelPlural()}onPageSizeSelect(e){let t=Number(e.target.value);this.pageSizeChange.emit(t);}onPageSizeChange(e){this.pageSizeChange.emit(Number(e));}};l([Input({required:true})],$.prototype,"currentPage",1),l([Input({required:true})],$.prototype,"pageSize",1),l([Input({required:true})],$.prototype,"totalCount",1),l([Input()],$.prototype,"pageSizeOptions",1),l([Input()],$.prototype,"entityLabelPlural",1),l([Output()],$.prototype,"pageChange",2),l([Output()],$.prototype,"pageSizeChange",2);var L=class{constructor(){this.commit=new EventEmitter;this.cancel=new EventEmitter;this.localValue=signal("");this.highlightedIndex=signal(0);this.selectOptions=signal([]);this.searchText=signal("");this.scrollCleanup=null;this.filteredOptions=computed(()=>{let e=this.selectOptions(),t=this.searchText().trim().toLowerCase();return t?e.filter(n=>this.getDisplayText(n).toLowerCase().includes(t)):e});this._initialized=false;}ngOnInit(){this._initialized=true,this.syncFromInputs();}ngOnChanges(){this._initialized&&this.syncFromInputs();}syncFromInputs(){let e=this.value,t=e!=null?String(e):"";this.editorType==="date"&&t.match(/^\d{4}-\d{2}-\d{2}/)&&(t=t.substring(0,10)),this.localValue.set(t);let n=this.column;if(n?.cellEditorParams?.values){let i=n.cellEditorParams.values;this.selectOptions.set(i);let o=i.findIndex(r=>String(r)===String(e));this.highlightedIndex.set(Math.max(o,0));}}ngAfterViewInit(){setTimeout(()=>{let e=this.richSelectInput?.nativeElement;if(e){e.focus(),e.select(),this.positionFixedDropdown(this.richSelectWrapper,this.richSelectDropdown),this.attachScrollClose(this.richSelectWrapper?.nativeElement);return}let t=this.selectWrapper?.nativeElement;if(t){t.focus(),this.positionFixedDropdown(this.selectWrapper,this.selectDropdown),this.attachScrollClose(t);return}let n=this.inputEl?.nativeElement;if(n)if(n.focus(),n instanceof HTMLInputElement&&n.type==="date")try{n.showPicker();}catch{}else n instanceof HTMLInputElement&&n.type==="text"&&n.select();});}ngOnDestroy(){this.scrollCleanup?.();}attachScrollClose(e){if(!e)return;let t=e.closest(".ogrid-table-wrapper")??e.closest('[style*="overflow"]'),n=()=>this.cancel.emit();t&&t.addEventListener("scroll",n,{passive:true}),window.addEventListener("scroll",n,{passive:true}),this.scrollCleanup=()=>{t&&t.removeEventListener("scroll",n),window.removeEventListener("scroll",n);};}commitValue(e){this.commit.emit(e);}onTextKeyDown(e){e.key==="Enter"?(e.preventDefault(),this.commitValue(this.localValue())):e.key==="Escape"?(e.preventDefault(),this.cancel.emit()):e.key==="Tab"&&(e.preventDefault(),this.commitValue(this.localValue()));}getDisplayText(e){let t=this.column?.cellEditorParams?.formatValue;return t?t(e):e!=null?String(e):""}onCustomSelectKeyDown(e){let t=this.selectOptions();switch(e.key){case "ArrowDown":e.preventDefault(),this.highlightedIndex.set(Math.min(this.highlightedIndex()+1,t.length-1)),this.scrollOptionIntoView(this.selectDropdown);break;case "ArrowUp":e.preventDefault(),this.highlightedIndex.set(Math.max(this.highlightedIndex()-1,0)),this.scrollOptionIntoView(this.selectDropdown);break;case "Enter":e.preventDefault(),e.stopPropagation(),t.length>0&&this.highlightedIndex()<t.length&&this.commitValue(t[this.highlightedIndex()]);break;case "Tab":e.preventDefault(),t.length>0&&this.highlightedIndex()<t.length&&this.commitValue(t[this.highlightedIndex()]);break;case "Escape":e.preventDefault(),e.stopPropagation(),this.cancel.emit();break}}onRichSelectSearch(e){this.searchText.set(e),this.highlightedIndex.set(0);}onRichSelectKeyDown(e){let t=this.filteredOptions();switch(e.key){case "ArrowDown":e.preventDefault(),this.highlightedIndex.set(Math.min(this.highlightedIndex()+1,t.length-1)),this.scrollOptionIntoView(this.richSelectDropdown);break;case "ArrowUp":e.preventDefault(),this.highlightedIndex.set(Math.max(this.highlightedIndex()-1,0)),this.scrollOptionIntoView(this.richSelectDropdown);break;case "Enter":e.preventDefault(),e.stopPropagation(),t.length>0&&this.highlightedIndex()<t.length&&this.commitValue(t[this.highlightedIndex()]);break;case "Escape":e.preventDefault(),e.stopPropagation(),this.cancel.emit();break}}onCheckboxKeyDown(e){e.key==="Escape"&&(e.preventDefault(),this.cancel.emit());}onTextBlur(){this.commitValue(this.localValue());}getInputStyle(){let e="width:100%;box-sizing:border-box;padding:6px 10px;border:none;outline:none;font:inherit;background:transparent;color:inherit;";return this.column.type==="numeric"?e+"text-align:right;":e}positionFixedDropdown(e,t){let n=e?.nativeElement,i=t?.nativeElement;if(!n||!i)return;let o=n.getBoundingClientRect(),r=200,s=window.innerHeight-o.bottom,u=s<r&&o.top>s;i.style.position="fixed",i.style.left=`${o.left}px`,i.style.width=`${o.width}px`,i.style.maxHeight=`${r}px`,i.style.zIndex="9999",i.style.right="auto",i.style.textAlign="left",u?(i.style.top="auto",i.style.bottom=`${window.innerHeight-o.top}px`):i.style.top=`${o.bottom}px`;}scrollOptionIntoView(e){setTimeout(()=>{let t=e?.nativeElement;if(!t)return;t.children[this.highlightedIndex()]?.scrollIntoView({block:"nearest"});});}};l([Input({required:true})],L.prototype,"value",2),l([Input({required:true})],L.prototype,"item",2),l([Input({required:true})],L.prototype,"column",2),l([Input({required:true})],L.prototype,"rowIndex",2),l([Input({required:true})],L.prototype,"editorType",2),l([Output()],L.prototype,"commit",2),l([Output()],L.prototype,"cancel",2),l([ViewChild("inputEl")],L.prototype,"inputEl",2),l([ViewChild("selectWrapper")],L.prototype,"selectWrapper",2),l([ViewChild("selectDropdown")],L.prototype,"selectDropdown",2),l([ViewChild("richSelectWrapper")],L.prototype,"richSelectWrapper",2),l([ViewChild("richSelectInput")],L.prototype,"richSelectInput",2),l([ViewChild("richSelectDropdown")],L.prototype,"richSelectDropdown",2);var q=class{constructor(){this._canPinLeft=signal(true);this._canPinRight=signal(true);this._canUnpin=signal(false);this._currentSort=signal(null);this._isSortable=signal(true);this._isResizable=signal(true);this.handlers={};this.menuItems=computed(()=>getColumnHeaderMenuItems({canPinLeft:this._canPinLeft(),canPinRight:this._canPinRight(),canUnpin:this._canUnpin(),currentSort:this._currentSort(),isSortable:this._isSortable(),isResizable:this._isResizable()}));}set canPinLeft(e){this._canPinLeft.set(e);}set canPinRight(e){this._canPinRight.set(e);}set canUnpin(e){this._canUnpin.set(e);}set currentSort(e){this._currentSort.set(e);}set isSortable(e){this._isSortable.set(e);}set isResizable(e){this._isResizable.set(e);}handleMenuItemClick(e){let t=this.handlers,i={pinLeft:t.onPinLeft,pinRight:t.onPinRight,unpin:t.onUnpin,sortAsc:t.onSortAsc,sortDesc:t.onSortDesc,clearSort:t.onClearSort,autosizeThis:t.onAutosizeThis,autosizeAll:t.onAutosizeAll}[e];i&&(i(),t.onClose?.());}};l([Input({required:true})],q.prototype,"columnId",2),l([Input()],q.prototype,"canPinLeft",1),l([Input()],q.prototype,"canPinRight",1),l([Input()],q.prototype,"canUnpin",1),l([Input()],q.prototype,"currentSort",1),l([Input()],q.prototype,"isSortable",1),l([Input()],q.prototype,"isResizable",1),l([Input()],q.prototype,"handlers",2);var to=`
673
+ `})],Z);var Le=class{constructor(){this.propsSignal=signal(void 0);this.ogridService=inject(ie);effect(()=>{let e=this.propsSignal();e&&this.ogridService.configure(e);});}set props(e){this.propsSignal.set(e);}get showToolbar(){return this.ogridService.columnChooserPlacement()==="toolbar"||this.ogridService.toolbar()!=null||this.ogridService.fullScreen()}onPageSizeChange(e){this.ogridService.pagination().setPageSize(e);}};l([Input({required:true})],Le.prototype,"props",1);function Rt(p,e){let t=signal(p());return effect(n=>{let i=p(),o=setTimeout(()=>{t.set(i);},e);n(()=>clearTimeout(o));}),t}function wt(p,e){let t=null;return((...n)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{p(...n),t=null;},e);})}function xt(p){return((...e)=>p()(...e))}var nt=class{constructor(){this.stateService=inject(oe);this.columnReorderService=inject(le);this.virtualScrollService=inject(ae);this.lastMouseShift=false;this.columnSizingVersion=signal(0);this.measureDirty=signal(true);this.measuredColumnWidths=signal({});this.wrapperElSignal=signal(null);this.tableContainerElSignal=signal(null);this.state=computed(()=>this.stateService.getState());this.layoutState=computed(()=>this.state().layout);this.rowSelectionState=computed(()=>this.state().rowSelection);this.editingState=computed(()=>this.state().editing);this.interactionState=computed(()=>this.state().interaction);this.contextMenuState=computed(()=>this.state().contextMenu);this.viewModelsState=computed(()=>this.state().viewModels);this.pinningState=computed(()=>this.state().pinning);this.tableContainerEl=computed(()=>this.tableContainerElSignal());this.items=computed(()=>this.getProps()?.items??[]);this.getRowId=computed(()=>this.getProps()?.getRowId??(e=>e.id));this.isLoading=computed(()=>this.getProps()?.isLoading??false);this.loadingMessage=computed(()=>"Loading\u2026");this.layoutModeFit=computed(()=>(this.getProps()?.layoutMode??"fill")==="content");this.rowHeightCssVar=computed(()=>{let e=this.getProps()?.rowHeight;return e?`${e}px`:null});this.ariaLabel=computed(()=>this.getProps()?.["aria-label"]??"Data grid");this.ariaLabelledBy=computed(()=>this.getProps()?.["aria-labelledby"]);this.stickyHeader=computed(()=>this.getProps()?.stickyHeader??true);this.emptyState=computed(()=>this.getProps()?.emptyState);this.currentPage=computed(()=>this.getProps()?.currentPage??1);this.pageSize=computed(()=>this.getProps()?.pageSize??25);this.rowNumberOffset=computed(()=>this.hasRowNumbersCol()?(this.currentPage()-1)*this.pageSize():0);this.propsVisibleColumns=computed(()=>this.getProps()?.visibleColumns);this.propsColumnOrder=computed(()=>this.getProps()?.columnOrder);this.visibleCols=computed(()=>this.layoutState().visibleCols);this.hasCheckboxCol=computed(()=>this.layoutState().hasCheckboxCol);this.hasRowNumbersCol=computed(()=>this.layoutState().hasRowNumbersCol);this.colOffset=computed(()=>this.layoutState().colOffset);this.containerWidth=computed(()=>this.layoutState().containerWidth);this.minTableWidth=computed(()=>this.layoutState().minTableWidth);this.desiredTableWidth=computed(()=>this.layoutState().desiredTableWidth);this.columnSizingOverrides=computed(()=>this.layoutState().columnSizingOverrides);this.selectedRowIds=computed(()=>this.rowSelectionState().selectedRowIds);this.allSelected=computed(()=>this.rowSelectionState().allSelected);this.someSelected=computed(()=>this.rowSelectionState().someSelected);this.editingCell=computed(()=>this.editingState().editingCell);this.pendingEditorValue=computed(()=>this.editingState().pendingEditorValue);this.activeCell=computed(()=>this.interactionState().activeCell);this.selectionRange=computed(()=>this.interactionState().selectionRange);this.hasCellSelection=computed(()=>this.interactionState().hasCellSelection);this.cutRange=computed(()=>this.interactionState().cutRange);this.copyRange=computed(()=>this.interactionState().copyRange);this.canUndo=computed(()=>this.interactionState().canUndo);this.canRedo=computed(()=>this.interactionState().canRedo);this.isDragging=computed(()=>this.interactionState().isDragging);this.menuPosition=computed(()=>this.contextMenuState().menuPosition);this.statusBarConfig=computed(()=>this.viewModelsState().statusBarConfig);this.showEmptyInGrid=computed(()=>this.viewModelsState().showEmptyInGrid);this.headerFilterInput=computed(()=>this.viewModelsState().headerFilterInput);this.cellDescriptorInput=computed(()=>this.viewModelsState().cellDescriptorInput);this.pinnedColumnsMap=computed(()=>this.pinningState().pinnedColumns);this.vsEnabled=computed(()=>this.virtualScrollService.isActive());this.vsVisibleRange=computed(()=>this.virtualScrollService.visibleRange());this.vsTopSpacerHeight=computed(()=>this.vsEnabled()?this.vsVisibleRange().offsetTop:0);this.vsBottomSpacerHeight=computed(()=>this.vsEnabled()?this.vsVisibleRange().offsetBottom:0);this.vsVisibleItems=computed(()=>{let e=this.items();if(!this.vsEnabled())return e;let t=this.vsVisibleRange();return e.slice(t.startIndex,Math.min(t.endIndex+1,e.length))});this.vsStartIndex=computed(()=>this.vsEnabled()?this.vsVisibleRange().startIndex:0);this.vsColumnsEnabled=computed(()=>this.virtualScrollService.columnsEnabled());this.vsColumnRange=computed(()=>this.virtualScrollService.columnRange());this.vsColumnPartition=computed(()=>{if(!this.vsColumnsEnabled())return null;let e=this.visibleCols(),t=this.vsColumnRange(),i=this.getProps()?.pinnedColumns;return partitionColumnsForVirtualization(e,t,i)});this.vsColumnLayouts=computed(()=>{let e=this.columnLayouts(),t=this.vsColumnPartition();if(!t)return e;let n=new Set;for(let i of t.pinnedLeft)n.add(i.columnId);for(let i of t.virtualizedUnpinned)n.add(i.columnId);for(let i of t.pinnedRight)n.add(i.columnId);return e.filter(i=>n.has(i.col.columnId))});this.vsVisibleCols=computed(()=>{let e=this.visibleCols(),t=this.vsColumnPartition();if(!t)return e;let n=new Set;for(let i of t.pinnedLeft)n.add(i.columnId);for(let i of t.virtualizedUnpinned)n.add(i.columnId);for(let i of t.pinnedRight)n.add(i.columnId);return e.filter(i=>n.has(i.columnId))});this.vsLeftSpacerWidth=computed(()=>this.vsColumnPartition()?.leftSpacerWidth??0);this.vsRightSpacerWidth=computed(()=>this.vsColumnPartition()?.rightSpacerWidth??0);this.globalColIndexMap=computed(()=>{let e=this.visibleCols(),t=new Map;for(let n=0;n<e.length;n++)t.set(e[n].columnId,n);return t});this.popoverAnchorEl=computed(()=>this.editingState().popoverAnchorEl);this.pendingEditorValueForPopover=computed(()=>this.editingState().pendingEditorValue);this.allowOverflowX=computed(()=>{if(this.getProps()?.suppressHorizontalScroll)return false;let t=this.containerWidth(),n=this.minTableWidth(),i=this.desiredTableWidth();return t>0&&(n>t||i>t)});this.selectionCellCount=computed(()=>{let e=this.selectionRange();if(e)return (Math.abs(e.endRow-e.startRow)+1)*(Math.abs(e.endCol-e.startCol)+1)});this.headerRows=computed(()=>{let e=this.getProps();return e?buildHeaderRows(e.columns,e.visibleColumns):[]});this.columnLayouts=computed(()=>{let e=this.visibleCols(),n=this.getProps()?.pinnedColumns??{},i=this.measuredColumnWidths(),o=this.columnSizingOverrides();return e.map(r=>{let s=n[r.columnId],u=s==="left"||r.pinned==="left",d=s==="right"||r.pinned==="right",c=this.getColumnWidth(r),m=!!o[r.columnId],f=i[r.columnId],b=r.minWidth??DEFAULT_MIN_COLUMN_WIDTH,R=m?c:Math.max(b,f??0);return {col:r,pinnedLeft:u,pinnedRight:d,minWidth:R,width:c}})});this.pinningOffsets=computed(()=>{let e=this.columnLayouts(),t={},n={},i=0;this.hasCheckboxCol()&&(i+=CHECKBOX_COLUMN_WIDTH),this.hasRowNumbersCol()&&(i+=this.getRowNumberWidth());let o=0,r=e.length;for(let s=0;s<r;s++){let u=e[s];u.pinnedLeft&&(t[u.col.columnId]=i,i+=u.width+CELL_PADDING);let d=r-1-s,c=e[d];c.pinnedRight&&(n[c.col.columnId]=o,o+=c.width+CELL_PADDING);}return {leftOffsets:t,rightOffsets:n}});this.columnMenuHandlersMap=computed(()=>{let e=this.visibleCols(),t=new Map;for(let n of e)t.set(n.columnId,this.buildColumnMenuHandlers(n.columnId));return t});}ngAfterViewInit(){let e=this.getWrapperRef()?.nativeElement??null,t=this.getTableContainerRef()?.nativeElement??null;e&&this.wrapperElSignal.set(e),t&&this.tableContainerElSignal.set(t),this.measureColumnWidths();}ngAfterViewChecked(){this.measureDirty()&&(this.measureDirty.set(false),this.measureColumnWidths());}measureColumnWidths(){let e=this.getWrapperRef()?.nativeElement;if(!e)return;let t=e.querySelectorAll("th[data-column-id]");if(t.length===0)return;let n={};t.forEach(r=>{let s=r.getAttribute("data-column-id");s&&(n[s]=r.offsetWidth);});let i=this.measuredColumnWidths(),o=Object.keys(n).length!==Object.keys(i).length;if(!o){for(let r in n)if(i[r]!==n[r]){o=true;break}}o&&this.measuredColumnWidths.set(n);}getGlobalColIndex(e){return this.globalColIndexMap().get(e.columnId)??0}getRowNumberWidth(){let t=this.columnSizingOverrides()[ROW_NUMBER_COLUMN_ID];return t?t.widthPx:ROW_NUMBER_COLUMN_WIDTH}initBase(){effect(()=>{let e=this.getProps();e&&this.stateService.props.set(e);}),effect(()=>{let e=this.wrapperElSignal();e&&(this.stateService.wrapperEl.set(e),this.columnReorderService.wrapperEl.set(e));}),effect(()=>{let e=this.getProps();if(e){let t=this.visibleCols();this.columnReorderService.columns.set(t),this.columnReorderService.columnOrder.set(e.columnOrder),this.columnReorderService.onColumnOrderChange.set(e.onColumnOrderChange),this.columnReorderService.enabled.set(e.columnReorder===true);}}),effect(()=>{this.visibleCols(),this.columnSizingOverrides(),this.columnSizingVersion(),this.measureDirty.set(true);}),effect(()=>{let e=this.getProps();e&&(this.virtualScrollService.totalRows.set(e.items.length),e.virtualScroll&&this.virtualScrollService.updateConfig({enabled:e.virtualScroll.enabled,rowHeight:e.virtualScroll.rowHeight,overscan:e.virtualScroll.overscan,columns:e.virtualScroll.columns,columnOverscan:e.virtualScroll.columnOverscan}));}),effect(()=>{let e=this.columnLayouts(),n=this.getProps()?.pinnedColumns??{},i=e.filter(o=>!o.pinnedLeft&&!o.pinnedRight&&!n[o.col.columnId]).map(o=>o.width);this.virtualScrollService.columnWidths.set(i);}),effect(()=>{let e=this.wrapperElSignal();e&&(this.virtualScrollService.setContainer(e),this.virtualScrollService.containerHeight.set(e.clientHeight),this.virtualScrollService.containerWidth.set(e.clientWidth));});}getEffectiveMinWidth(e){return this.columnLayouts().find(n=>n.col.columnId===e.columnId)?.minWidth??e.minWidth??DEFAULT_MIN_COLUMN_WIDTH}getCellInteractionProps(e){return {tabIndex:e.isActive?0:-1,dataRowIndex:e.rowIndex,dataColIndex:e.globalColIndex,dataInRange:e.isInRange?"true":null,role:e.canEditAny?"button":null}}asColumnDef(e){return e}visibleColIndex(e){return this.visibleCols().indexOf(e)}getColumnWidth(e){let n=this.columnSizingOverrides()[e.columnId];return n?n.widthPx:e.defaultWidth??e.minWidth??DEFAULT_MIN_COLUMN_WIDTH}getFilterConfig(e){return getHeaderFilterConfig(e,this.headerFilterInput())}buildColumnMenuHandlers(e){return {onPinLeft:()=>this.onPinColumn(e,"left"),onPinRight:()=>this.onPinColumn(e,"right"),onUnpin:()=>this.onUnpinColumn(e),onSortAsc:()=>this.onSortAsc(e),onSortDesc:()=>this.onSortDesc(e),onClearSort:()=>this.onClearSort(e),onAutosizeThis:()=>this.onAutosizeColumn(e),onAutosizeAll:()=>this.onAutosizeAllColumns(),onClose:()=>{}}}getColumnMenuHandlersMemoized(e){return this.columnMenuHandlersMap().get(e)??this.buildColumnMenuHandlers(e)}getCellDescriptor(e,t,n,i){return getCellRenderDescriptor(e,t,n,i,this.cellDescriptorInput())}resolveCellContent(e,t,n){try{return resolveCellDisplayContent(e,t,n)}catch(i){let o=this.getProps()?.onCellError;return o&&o(i instanceof Error?i:new Error(String(i)),void 0),""}}resolveCellStyleFn(e,t,n){return resolveCellStyle(e,t,n)}buildPopoverEditorProps(e,t,n){return buildPopoverEditorProps(e,t,n,this.pendingEditorValue(),{setPendingEditorValue:i=>this.setPendingEditorValue(i),commitCellEdit:(i,o,r,s,u,d)=>this.commitEdit(i,o,r,s,u,d),cancelPopoverEdit:()=>this.cancelPopoverEdit()})}isActiveCell(e,t){let n=this.activeCell();return n?n.rowIndex===e&&n.columnIndex===t+this.colOffset():false}isInSelectionRange(e,t){let n=this.selectionRange();if(!n)return false;let i=Math.min(n.startRow,n.endRow),o=Math.max(n.startRow,n.endRow),r=Math.min(n.startCol,n.endCol),s=Math.max(n.startCol,n.endCol);return e>=i&&e<=o&&t>=r&&t<=s}isSelectionEndCell(e,t){let n=this.selectionRange();return !n||this.isDragging()||this.copyRange()||this.cutRange()?false:e===n.endRow&&t===n.endCol}getCellBackground(e,t){return this.isInSelectionRange(e,t)?"var(--ogrid-range-bg, rgba(33, 115, 70, 0.08))":null}getEditorType(e,t){return e.cellEditor==="text"||e.cellEditor==="select"||e.cellEditor==="checkbox"||e.cellEditor==="date"||e.cellEditor==="richSelect"?e.cellEditor:e.type==="date"?"date":e.type==="boolean"?"checkbox":"text"}getSelectValues(e){let t=e.cellEditorParams;return t&&typeof t=="object"&&"values"in t?t.values.map(String):[]}formatDateForInput(e){if(!e)return "";let t=new Date(String(e));return Number.isNaN(t.getTime())?"":t.toISOString().split("T")[0]}getPinnedLeftOffset(e){return this.pinningOffsets().leftOffsets[e]??null}getPinnedRightOffset(e){return this.pinningOffsets().rightOffsets[e]??null}onWrapperScroll(e){this.virtualScrollService.onScroll(e);}setPopoverAnchorEl(e){this.state().editing.setPopoverAnchorEl(e);}setPendingEditorValue(e){this.state().editing.setPendingEditorValue(e);}cancelPopoverEdit(){this.state().editing.cancelPopoverEdit();}commitPopoverEdit(e,t,n,i,o,r){this.state().editing.commitCellEdit(e,t,n,i,o,r);}onWrapperMouseDown(e){this.lastMouseShift=e.shiftKey;}onGridKeyDown(e){this.state().interaction.handleGridKeyDown(e);}onCellMouseDown(e,t,n){this.state().interaction.handleCellMouseDown(e,t,n);}onCellClick(e,t){this.state().interaction.setActiveCell?.({rowIndex:e,columnIndex:t});}onCellContextMenu(e){this.state().contextMenu.handleCellContextMenu(e);}onCellDblClick(e,t){this.state().editing.setEditingCell({rowId:e,columnId:t});}onFillHandleMouseDown(e){this.state().interaction.handleFillHandleMouseDown?.(e);}onResizeStart(e,t){e.preventDefault(),this.state().interaction.setActiveCell?.(null),this.state().interaction.setSelectionRange?.(null),this.getWrapperRef()?.nativeElement.focus({preventScroll:true});let n=e.clientX,i=t.columnId,o=i===ROW_NUMBER_COLUMN_ID?this.getRowNumberWidth():this.getColumnWidth(t),r=i===ROW_NUMBER_COLUMN_ID?ROW_NUMBER_COLUMN_MIN_WIDTH:t.minWidth??DEFAULT_MIN_COLUMN_WIDTH,s=d=>{let c=d.clientX-n,m=Math.max(r,o+c),f={...this.columnSizingOverrides(),[t.columnId]:{widthPx:m}};this.state().layout.setColumnSizingOverrides(f),this.columnSizingVersion.update(b=>b+1);},u=()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",u);let d=this.getColumnWidth(t);this.state().layout.onColumnResized?.(t.columnId,d);};window.addEventListener("pointermove",s),window.addEventListener("pointerup",u);}onResizeDoubleClick(e,t){e.preventDefault(),e.stopPropagation();let n=t.columnId,o=(e.currentTarget.closest("th")??e.currentTarget.parentElement)?.closest("table")?.parentElement??void 0,r=t.minWidth??DEFAULT_MIN_COLUMN_WIDTH,s=measureColumnContentWidth(n,r,o),u={...this.columnSizingOverrides(),[n]:{widthPx:s}};this.state().layout.setColumnSizingOverrides(u),this.columnSizingVersion.update(d=>d+1),this.state().layout.onColumnResized?.(n,s);}onSelectAllChange(e){let t=e.target.checked;this.state().rowSelection.handleSelectAll(!!t);}onRowClick(e,t){if(this.getProps()?.rowSelection!=="single")return;let i=this.selectedRowIds();this.state().rowSelection.updateSelection(i.has(t)?new Set:new Set([t]));}onRowCheckboxChange(e,t,n){let i=t.target.checked;this.state().rowSelection.handleRowCheckboxChange(e,i,n,this.lastMouseShift);}commitEdit(e,t,n,i,o,r){this.state().editing.commitCellEdit(e,t,n,i,o,r);}cancelEdit(){this.state().editing.setEditingCell(null);}onEditorKeydown(e,t,n,i,o,r){if(e.key==="Enter"){e.preventDefault();let s=e.target.value;this.commitEdit(t,n,i,s,o,r);}else e.key==="Escape"&&(e.preventDefault(),this.cancelEdit());}closeContextMenu(){this.state().contextMenu.closeContextMenu();}handleCopy(){this.state().interaction.handleCopy();}handleCut(){this.state().interaction.handleCut();}handlePaste(){this.state().interaction.handlePaste();}handleSelectAllCells(){this.state().interaction.handleSelectAllCells();}onUndo(){this.state().interaction.onUndo?.();}onRedo(){this.state().interaction.onRedo?.();}onHeaderMouseDown(e,t){this.columnReorderService.handleHeaderMouseDown(e,t);}onPinColumn(e,t){this.state().pinning.pinColumn(e,t);}onUnpinColumn(e){this.state().pinning.unpinColumn(e);}isPinned(e){return this.state().pinning.isPinned(e)}getPinState(e){let t=this.isPinned(e);return {canPinLeft:t!=="left",canPinRight:t!=="right",canUnpin:!!t}}onSortAsc(e){this.getProps()?.onColumnSort?.(e,"asc");}onSortDesc(e){this.getProps()?.onColumnSort?.(e,"desc");}onClearSort(e){let t=this.getProps(),n=e??t?.sortBy;n&&t?.onColumnSort?.(n,null);}getSortState(e){let t=this.getProps();return t?.sortBy===e?t.sortDirection??"asc":null}onAutosizeColumn(e){let t=this.visibleCols().find(i=>i.columnId===e);if(!t)return;let n=measureColumnContentWidth(e,t.minWidth,this.tableContainerEl()??void 0);this.state().layout.setColumnSizingOverrides({...this.columnSizingOverrides(),[e]:{widthPx:n}}),(this.state().layout.onAutosizeColumn??this.state().layout.onColumnResized)?.(e,n);}onAutosizeAllColumns(){let e=this.tableContainerEl()??void 0,t={};for(let n of this.visibleCols()){let i=measureColumnContentWidth(n.columnId,n.minWidth,e);t[n.columnId]={widthPx:i},(this.state().layout.onAutosizeColumn??this.state().layout.onColumnResized)?.(n.columnId,i);}this.state().layout.setColumnSizingOverrides({...this.columnSizingOverrides(),...t});}};var T=class{constructor(){this._filterType=signal("none");this._selectedValues=signal(void 0);this._options=signal(void 0);this._textValue=signal("");this._selectedUser=signal(void 0);this._dateValue=signal(void 0);this.isSorted=false;this.isSortedDescending=false;this.onSort=void 0;this.onFilterChange=void 0;this.isLoadingOptions=false;this.onTextChange=void 0;this.onUserChange=void 0;this.peopleSearch=void 0;this.onDateChange=void 0;this.isFilterOpen=signal(false);this.tempTextValue=signal("");this.searchText=signal("");this.tempSelected=signal(new Set);this.peopleSearchText=signal("");this.peopleSuggestions=signal([]);this.isPeopleLoading=signal(false);this.tempDateFrom=signal("");this.tempDateTo=signal("");this.popoverTop=signal(0);this.popoverLeft=signal(0);this.peopleDebounceTimer=null;this.hasActiveFilter=computed(()=>{let e=this._filterType();return e==="text"?!!this._textValue():e==="multiSelect"?(this._selectedValues()?.length??0)>0:e==="people"?this._selectedUser()!=null:e==="date"?this._dateValue()!=null:false});this.filteredOptions=computed(()=>{let e=this._options()??[],t=this.searchText().toLowerCase().trim();return t?e.filter(n=>n.toLowerCase().includes(t)):e});}set filterType(e){this._filterType.set(e);}get filterType(){return this._filterType()}set selectedValues(e){this._selectedValues.set(e);}get selectedValues(){return this._selectedValues()}set options(e){this._options.set(e);}get options(){return this._options()}set textValue(e){this._textValue.set(e);}get textValue(){return this._textValue()}set selectedUser(e){this._selectedUser.set(e);}get selectedUser(){return this._selectedUser()}set dateValue(e){this._dateValue.set(e);}get dateValue(){return this._dateValue()}asInputValue(e){return e.target.value}toggleFilter(e){if(e.stopPropagation(),this.isFilterOpen()){this.isFilterOpen.set(false);return}this.tempTextValue.set(this.textValue),this.tempSelected.set(new Set(this.selectedValues??[])),this.searchText.set(""),this.peopleSearchText.set(""),this.peopleSuggestions.set([]);let t=this.dateValue;this.tempDateFrom.set(t?.from??""),this.tempDateTo.set(t?.to??"");let n=this.getHeaderEl()?.nativeElement;if(n){let i=n.getBoundingClientRect();this.popoverTop.set(i.bottom+4),this.popoverLeft.set(i.left);}this.isFilterOpen.set(true);}onTextKeydown(e){e.stopPropagation(),e.key==="Enter"&&(e.preventDefault(),this.handleTextApply());}handleTextApply(){this.onTextChange&&this.onTextChange(this.tempTextValue()),this.isFilterOpen.set(false);}handleTextClear(){this.tempTextValue.set(""),this.onTextChange&&this.onTextChange(""),this.isFilterOpen.set(false);}handleCheckboxChange(e,t){let n=t.target.checked;this.tempSelected.update(i=>{let o=new Set(i);return n?o.add(e):o.delete(e),o});}handleSelectAllFiltered(){this.tempSelected.update(e=>{let t=new Set(e);for(let n of this.filteredOptions())t.add(n);return t});}handleClearSelection(){this.tempSelected.set(new Set);}handleApplyMultiSelect(){this.onFilterChange&&this.onFilterChange(Array.from(this.tempSelected())),this.isFilterOpen.set(false);}onPeopleSearchInput(e){let t=e.target.value;this.peopleSearchText.set(t),this.peopleDebounceTimer&&clearTimeout(this.peopleDebounceTimer);let n=t.trim();if(!n){this.peopleSuggestions.set([]),this.isPeopleLoading.set(false);return}this.isPeopleLoading.set(true),this.peopleDebounceTimer=setTimeout(()=>{let i=this.peopleSearch;i&&i(n).then(o=>{this.peopleSuggestions.set(o),this.isPeopleLoading.set(false);}).catch(()=>{this.peopleSuggestions.set([]),this.isPeopleLoading.set(false);});},300);}handleUserSelect(e){this.onUserChange&&this.onUserChange(e),this.isFilterOpen.set(false);}handleClearUser(){this.onUserChange&&this.onUserChange(void 0),this.isFilterOpen.set(false);}handleDateApply(){let e=this.tempDateFrom(),t=this.tempDateTo();this.onDateChange&&(!e&&!t?this.onDateChange(void 0):this.onDateChange({from:e||void 0,to:t||void 0})),this.isFilterOpen.set(false);}handleDateClear(){this.tempDateFrom.set(""),this.tempDateTo.set(""),this.onDateChange&&this.onDateChange(void 0),this.isFilterOpen.set(false);}ngOnDestroy(){this.peopleDebounceTimer&&(clearTimeout(this.peopleDebounceTimer),this.peopleDebounceTimer=null);}onDocumentClick(e,t){let n=e.target;!n.closest(t)&&!n.closest(".ogrid-header-filter__popover")&&this.isFilterOpen.set(false);}};l([Input({required:true})],T.prototype,"columnKey",2),l([Input({required:true})],T.prototype,"columnName",2),l([Input({required:true})],T.prototype,"filterType",1),l([Input()],T.prototype,"selectedValues",1),l([Input()],T.prototype,"options",1),l([Input()],T.prototype,"textValue",1),l([Input()],T.prototype,"selectedUser",1),l([Input()],T.prototype,"dateValue",1),l([Input()],T.prototype,"isSorted",2),l([Input()],T.prototype,"isSortedDescending",2),l([Input()],T.prototype,"onSort",2),l([Input()],T.prototype,"onFilterChange",2),l([Input()],T.prototype,"isLoadingOptions",2),l([Input()],T.prototype,"onTextChange",2),l([Input()],T.prototype,"onUserChange",2),l([Input()],T.prototype,"peopleSearch",2),l([Input()],T.prototype,"onDateChange",2);var ve=class{constructor(){this._columns=signal([]);this._visibleColumns=signal(new Set);this.visibilityChange=new EventEmitter;this.isOpen=signal(false);this.visibleCount=computed(()=>this._visibleColumns().size);this.totalCount=computed(()=>this._columns().length);}set columns(e){this._columns.set(e);}get columns(){return this._columns()}set visibleColumns(e){this._visibleColumns.set(e);}get visibleColumns(){return this._visibleColumns()}toggle(){this.isOpen.update(e=>!e);}onCheckboxChange(e,t){let n=t.target.checked;this.visibilityChange.emit({columnKey:e,visible:n});}onToggle(e,t){this.visibilityChange.emit({columnKey:e,visible:t});}selectAll(){for(let e of this.columns)this.visibleColumns.has(e.columnId)||this.visibilityChange.emit({columnKey:e.columnId,visible:true});}clearAll(){for(let e of this.columns)this.visibleColumns.has(e.columnId)&&this.visibilityChange.emit({columnKey:e.columnId,visible:false});}onClearAll(){for(let e of this.columns)e.required!==true&&this.visibleColumns.has(e.columnId)&&this.visibilityChange.emit({columnKey:e.columnId,visible:false});}onSelectAll(){for(let e of this.columns)this.visibleColumns.has(e.columnId)||this.visibilityChange.emit({columnKey:e.columnId,visible:true});}};l([Input({required:true})],ve.prototype,"columns",1),l([Input({required:true})],ve.prototype,"visibleColumns",1),l([Output()],ve.prototype,"visibilityChange",2);var $=class{constructor(){this._currentPage=signal(1);this._pageSize=signal(25);this._totalCount=signal(0);this._pageSizeOptions=signal(void 0);this._entityLabelPlural=signal("items");this.pageChange=new EventEmitter;this.pageSizeChange=new EventEmitter;this.labelPlural=computed(()=>this._entityLabelPlural()??"items");this.vm=computed(()=>{let e=this._pageSizeOptions();return getPaginationViewModel(this._currentPage(),this._pageSize(),this._totalCount(),e?{pageSizeOptions:e}:void 0)});}set currentPage(e){this._currentPage.set(e);}get currentPage(){return this._currentPage()}set pageSize(e){this._pageSize.set(e);}get pageSize(){return this._pageSize()}set totalCount(e){this._totalCount.set(e);}get totalCount(){return this._totalCount()}set pageSizeOptions(e){this._pageSizeOptions.set(e);}get pageSizeOptions(){return this._pageSizeOptions()}set entityLabelPlural(e){this._entityLabelPlural.set(e);}get entityLabelPlural(){return this._entityLabelPlural()}onPageSizeSelect(e){let t=Number(e.target.value);this.pageSizeChange.emit(t);}onPageSizeChange(e){this.pageSizeChange.emit(Number(e));}};l([Input({required:true})],$.prototype,"currentPage",1),l([Input({required:true})],$.prototype,"pageSize",1),l([Input({required:true})],$.prototype,"totalCount",1),l([Input()],$.prototype,"pageSizeOptions",1),l([Input()],$.prototype,"entityLabelPlural",1),l([Output()],$.prototype,"pageChange",2),l([Output()],$.prototype,"pageSizeChange",2);var L=class{constructor(){this.commit=new EventEmitter;this.cancel=new EventEmitter;this.localValue=signal("");this.highlightedIndex=signal(0);this.selectOptions=signal([]);this.searchText=signal("");this.scrollCleanup=null;this.filteredOptions=computed(()=>{let e=this.selectOptions(),t=this.searchText().trim().toLowerCase();return t?e.filter(n=>this.getDisplayText(n).toLowerCase().includes(t)):e});this._initialized=false;}ngOnInit(){this._initialized=true,this.syncFromInputs();}ngOnChanges(){this._initialized&&this.syncFromInputs();}syncFromInputs(){let e=this.value,t=e!=null?String(e):"";this.editorType==="date"&&t.match(/^\d{4}-\d{2}-\d{2}/)&&(t=t.substring(0,10)),this.localValue.set(t);let n=this.column;if(n?.cellEditorParams?.values){let i=n.cellEditorParams.values;this.selectOptions.set(i);let o=i.findIndex(r=>String(r)===String(e));this.highlightedIndex.set(Math.max(o,0));}}ngAfterViewInit(){setTimeout(()=>{let e=this.richSelectInput?.nativeElement;if(e){e.focus(),e.select(),this.positionFixedDropdown(this.richSelectWrapper,this.richSelectDropdown),this.attachScrollClose(this.richSelectWrapper?.nativeElement);return}let t=this.selectWrapper?.nativeElement;if(t){t.focus(),this.positionFixedDropdown(this.selectWrapper,this.selectDropdown),this.attachScrollClose(t);return}let n=this.inputEl?.nativeElement;if(n)if(n.focus(),n instanceof HTMLInputElement&&n.type==="date")try{n.showPicker();}catch{}else n instanceof HTMLInputElement&&n.type==="text"&&n.select();});}ngOnDestroy(){this.scrollCleanup?.();}attachScrollClose(e){if(!e)return;let t=e.closest(".ogrid-table-wrapper")??e.closest('[style*="overflow"]'),n=()=>this.cancel.emit(),i=requestAnimationFrame(()=>{t&&t.addEventListener("scroll",n,{passive:true}),window.addEventListener("scroll",n,{passive:true});});this.scrollCleanup=()=>{cancelAnimationFrame(i),t&&t.removeEventListener("scroll",n),window.removeEventListener("scroll",n);};}commitValue(e){this.commit.emit(e);}onTextKeyDown(e){e.key==="Enter"?(e.preventDefault(),this.commitValue(this.localValue())):e.key==="Escape"?(e.preventDefault(),this.cancel.emit()):e.key==="Tab"&&(e.preventDefault(),this.commitValue(this.localValue()));}getDisplayText(e){let t=this.column?.cellEditorParams?.formatValue;return t?t(e):e!=null?String(e):""}onCustomSelectKeyDown(e){let t=this.selectOptions();switch(e.key){case "ArrowDown":e.preventDefault(),this.highlightedIndex.set(Math.min(this.highlightedIndex()+1,t.length-1)),this.scrollOptionIntoView(this.selectDropdown);break;case "ArrowUp":e.preventDefault(),this.highlightedIndex.set(Math.max(this.highlightedIndex()-1,0)),this.scrollOptionIntoView(this.selectDropdown);break;case "Enter":e.preventDefault(),e.stopPropagation(),t.length>0&&this.highlightedIndex()<t.length&&this.commitValue(t[this.highlightedIndex()]);break;case "Tab":e.preventDefault(),t.length>0&&this.highlightedIndex()<t.length&&this.commitValue(t[this.highlightedIndex()]);break;case "Escape":e.preventDefault(),e.stopPropagation(),this.cancel.emit();break}}onRichSelectSearch(e){this.searchText.set(e),this.highlightedIndex.set(0);}onRichSelectKeyDown(e){let t=this.filteredOptions();switch(e.key){case "ArrowDown":e.preventDefault(),this.highlightedIndex.set(Math.min(this.highlightedIndex()+1,t.length-1)),this.scrollOptionIntoView(this.richSelectDropdown);break;case "ArrowUp":e.preventDefault(),this.highlightedIndex.set(Math.max(this.highlightedIndex()-1,0)),this.scrollOptionIntoView(this.richSelectDropdown);break;case "Enter":e.preventDefault(),e.stopPropagation(),t.length>0&&this.highlightedIndex()<t.length&&this.commitValue(t[this.highlightedIndex()]);break;case "Escape":e.preventDefault(),e.stopPropagation(),this.cancel.emit();break}}onCheckboxKeyDown(e){e.key==="Escape"&&(e.preventDefault(),this.cancel.emit());}onTextBlur(){this.commitValue(this.localValue());}getInputStyle(){let e="width:100%;box-sizing:border-box;padding:6px 10px;border:none;outline:none;font:inherit;background:transparent;color:inherit;";return this.column.type==="numeric"?e+"text-align:right;":e}positionFixedDropdown(e,t){let n=e?.nativeElement,i=t?.nativeElement;if(!n||!i)return;let o=n.getBoundingClientRect(),r=200,s=window.innerHeight-o.bottom,u=s<r&&o.top>s;i.style.position="fixed",i.style.left=`${o.left}px`,i.style.width=`${o.width}px`,i.style.maxHeight=`${r}px`,i.style.zIndex="9999",i.style.right="auto",i.style.textAlign="left",u?(i.style.top="auto",i.style.bottom=`${window.innerHeight-o.top}px`):i.style.top=`${o.bottom}px`;}scrollOptionIntoView(e){setTimeout(()=>{let t=e?.nativeElement;if(!t)return;t.children[this.highlightedIndex()]?.scrollIntoView({block:"nearest"});});}};l([Input({required:true})],L.prototype,"value",2),l([Input({required:true})],L.prototype,"item",2),l([Input({required:true})],L.prototype,"column",2),l([Input({required:true})],L.prototype,"rowIndex",2),l([Input({required:true})],L.prototype,"editorType",2),l([Output()],L.prototype,"commit",2),l([Output()],L.prototype,"cancel",2),l([ViewChild("inputEl")],L.prototype,"inputEl",2),l([ViewChild("selectWrapper")],L.prototype,"selectWrapper",2),l([ViewChild("selectDropdown")],L.prototype,"selectDropdown",2),l([ViewChild("richSelectWrapper")],L.prototype,"richSelectWrapper",2),l([ViewChild("richSelectInput")],L.prototype,"richSelectInput",2),l([ViewChild("richSelectDropdown")],L.prototype,"richSelectDropdown",2);var q=class{constructor(){this._canPinLeft=signal(true);this._canPinRight=signal(true);this._canUnpin=signal(false);this._currentSort=signal(null);this._isSortable=signal(true);this._isResizable=signal(true);this.handlers={};this.menuItems=computed(()=>getColumnHeaderMenuItems({canPinLeft:this._canPinLeft(),canPinRight:this._canPinRight(),canUnpin:this._canUnpin(),currentSort:this._currentSort(),isSortable:this._isSortable(),isResizable:this._isResizable()}));}set canPinLeft(e){this._canPinLeft.set(e);}set canPinRight(e){this._canPinRight.set(e);}set canUnpin(e){this._canUnpin.set(e);}set currentSort(e){this._currentSort.set(e);}set isSortable(e){this._isSortable.set(e);}set isResizable(e){this._isResizable.set(e);}handleMenuItemClick(e){let t=this.handlers,i={pinLeft:t.onPinLeft,pinRight:t.onPinRight,unpin:t.onUnpin,sortAsc:t.onSortAsc,sortDesc:t.onSortDesc,clearSort:t.onClearSort,autosizeThis:t.onAutosizeThis,autosizeAll:t.onAutosizeAll}[e];i&&(i(),t.onClose?.());}};l([Input({required:true})],q.prototype,"columnId",2),l([Input()],q.prototype,"canPinLeft",1),l([Input()],q.prototype,"canPinRight",1),l([Input()],q.prototype,"canUnpin",1),l([Input()],q.prototype,"currentSort",1),l([Input()],q.prototype,"isSortable",1),l([Input()],q.prototype,"isResizable",1),l([Input()],q.prototype,"handlers",2);var to=`
674
674
  @switch (editorType) {
675
675
  @case ('text') {
676
676
  <input
@@ -33,7 +33,9 @@ export declare abstract class BaseInlineCellEditorComponent<T = unknown> {
33
33
  private syncFromInputs;
34
34
  ngAfterViewInit(): void;
35
35
  ngOnDestroy(): void;
36
- /** Attach scroll listeners to close the editor when the grid scrolls. */
36
+ /** Attach scroll listeners to close the editor when the grid scrolls.
37
+ * Delayed via RAF to skip spurious scroll events fired during mount
38
+ * (e.g. focus-triggered scroll, layout-shift scroll from DOM changes). */
37
39
  private attachScrollClose;
38
40
  commitValue(value: unknown): void;
39
41
  onTextKeyDown(e: KeyboardEvent): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alaarab/ogrid-angular",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "description": "OGrid Angular – Angular services, signals, and headless components for OGrid data grids.",
5
5
  "main": "dist/esm/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -35,7 +35,7 @@
35
35
  "node": ">=18"
36
36
  },
37
37
  "dependencies": {
38
- "@alaarab/ogrid-core": "2.5.0"
38
+ "@alaarab/ogrid-core": "2.5.2"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@angular/core": "^21.0.0",