@alaarab/ogrid-angular-material 2.4.2 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js
CHANGED
|
@@ -1,36 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { AUTOSIZE_EXTRA_PX, AUTOSIZE_MAX_PX, BaseColumnChooserComponent, BaseColumnHeaderFilterComponent, BaseDataGridTableComponent, BaseInlineCellEditorComponent, BaseOGridComponent, BasePaginationControlsComponent, BasePopoverCellEditorComponent, CELL_PADDING, CHECKBOX_COLUMN_WIDTH, COLUMN_HEADER_MENU_ITEMS, ColumnReorderService, DEFAULT_DEBOUNCE_MS, DEFAULT_MIN_COLUMN_WIDTH, DataGridEditingHelper, DataGridInteractionHelper, DataGridLayoutHelper, DataGridStateService, EmptyStateComponent, GRID_BORDER_RADIUS, GRID_CONTEXT_MENU_ITEMS, GridContextMenuComponent, INLINE_CELL_EDITOR_STYLES, INLINE_CELL_EDITOR_TEMPLATE, MAX_PAGE_BUTTONS, MarchingAntsOverlayComponent, OGRID_THEME_VARS_CSS, OGridLayoutComponent, OGridService, PAGE_SIZE_OPTIONS, PEOPLE_SEARCH_DEBOUNCE_MS, POPOVER_CELL_EDITOR_OVERLAY_STYLES, POPOVER_CELL_EDITOR_TEMPLATE, ROW_NUMBER_COLUMN_WIDTH, SIDEBAR_TRANSITION_MS, SideBarComponent, StatusBarComponent, UndoRedoStack, VirtualScrollService, Z_INDEX, applyCellDeletion, applyCutClear, applyFillValues, applyPastedValues, applyRangeRowSelection, areGridRowPropsEqual, booleanParser, buildCsvHeader, buildCsvRows, buildHeaderRows, buildInlineEditorProps, buildPopoverEditorProps, calculateDropTarget, clampSelectionToBounds, computeAggregations, computeArrowNavigation, computeAutoScrollSpeed, computeNextSortState, computeRowSelectionState, computeTabNavigation, computeTotalHeight, computeVisibleRange, createDebouncedCallback, createDebouncedSignal, createLatestCallback, currencyParser, dateParser, debounce, deriveFilterOptionsFromData, emailParser, escapeCsvValue, exportToCsv, findCtrlArrowTarget, flattenColumns, formatCellValueForTsv, formatSelectionAsTsv, formatShortcut, getCellRenderDescriptor, getCellValue, getColumnHeaderMenuItems, getContextMenuHandlers, getDataGridStatusBarConfig, getFilterField, getHeaderFilterConfig, getMultiSelectFilterFields, getPaginationViewModel, getPinStateForColumn, getScrollTopForRow, getStatusBarParts, injectGlobalStyles, isFilterConfig, isInSelectionRange, isRowInRange, measureColumnContentWidth, measureRange, mergeFilter, normalizeSelectionRange, numberParser, parseTsvClipboard, parseValue, processClientSideData, rangesEqual, reorderColumnArray, resolveCellDisplayContent, resolveCellStyle, toUserLike, triggerCsvDownload, validateColumns, validateRowIds } from '@alaarab/ogrid-angular';
|
|
3
|
-
import { ViewChild, Component, ChangeDetectionStrategy, Input, ViewEncapsulation, signal, computed, effect } from '@angular/core';
|
|
4
|
-
import { MatMenuTrigger, MatMenuModule } from '@angular/material/menu';
|
|
5
|
-
import { MatDividerModule } from '@angular/material/divider';
|
|
6
|
-
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
10
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
11
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
12
|
-
if (decorator = decorators[i])
|
|
13
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
14
|
-
if (kind && result) __defProp(target, key, result);
|
|
15
|
-
return result;
|
|
16
|
-
};
|
|
17
|
-
var ColumnHeaderFilterComponent = class extends BaseColumnHeaderFilterComponent {
|
|
18
|
-
getHeaderEl() {
|
|
19
|
-
return this.headerEl;
|
|
20
|
-
}
|
|
21
|
-
onDocumentClickWrapper(event) {
|
|
22
|
-
this.onDocumentClick(event, "ogrid-column-header-filter");
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
__decorateClass([
|
|
26
|
-
ViewChild("headerEl")
|
|
27
|
-
], ColumnHeaderFilterComponent.prototype, "headerEl", 2);
|
|
28
|
-
ColumnHeaderFilterComponent = __decorateClass([
|
|
29
|
-
Component({
|
|
30
|
-
selector: "ogrid-column-header-filter",
|
|
31
|
-
standalone: true,
|
|
32
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
33
|
-
template: `
|
|
1
|
+
import {INLINE_CELL_EDITOR_STYLES,INLINE_CELL_EDITOR_TEMPLATE,POPOVER_CELL_EDITOR_OVERLAY_STYLES,POPOVER_CELL_EDITOR_TEMPLATE,OGRID_THEME_VARS_CSS,CHECKBOX_COLUMN_WIDTH,DataGridStateService,ColumnReorderService,VirtualScrollService,StatusBarComponent,GridContextMenuComponent,MarchingAntsOverlayComponent,EmptyStateComponent,FormulaRefOverlayComponent,OGridService,OGridLayoutComponent,BaseColumnHeaderFilterComponent,BaseColumnHeaderMenuComponent,BaseInlineCellEditorComponent,BasePopoverCellEditorComponent,BaseDataGridTableComponent,formatCellReference,indexToColumnLetter,ROW_NUMBER_COLUMN_ID,BaseColumnChooserComponent,BasePaginationControlsComponent,BaseOGridComponent}from'@alaarab/ogrid-angular';export{AUTOSIZE_EXTRA_PX,AUTOSIZE_MAX_PX,BaseColumnChooserComponent,BaseColumnHeaderFilterComponent,BaseDataGridTableComponent,BaseInlineCellEditorComponent,BaseOGridComponent,BasePaginationControlsComponent,BasePopoverCellEditorComponent,CELL_PADDING,CHECKBOX_COLUMN_WIDTH,COLUMN_HEADER_MENU_ITEMS,ColumnReorderService,DEFAULT_DEBOUNCE_MS,DEFAULT_MIN_COLUMN_WIDTH,DataGridEditingHelper,DataGridInteractionHelper,DataGridLayoutHelper,DataGridStateService,EmptyStateComponent,GRID_BORDER_RADIUS,GRID_CONTEXT_MENU_ITEMS,GridContextMenuComponent,INLINE_CELL_EDITOR_STYLES,INLINE_CELL_EDITOR_TEMPLATE,MAX_PAGE_BUTTONS,MarchingAntsOverlayComponent,OGRID_THEME_VARS_CSS,OGridLayoutComponent,OGridService,PAGE_SIZE_OPTIONS,PEOPLE_SEARCH_DEBOUNCE_MS,POPOVER_CELL_EDITOR_OVERLAY_STYLES,POPOVER_CELL_EDITOR_TEMPLATE,ROW_NUMBER_COLUMN_WIDTH,SIDEBAR_TRANSITION_MS,SideBarComponent,StatusBarComponent,UndoRedoStack,VirtualScrollService,Z_INDEX,applyCellDeletion,applyCutClear,applyFillValues,applyPastedValues,applyRangeRowSelection,areGridRowPropsEqual,booleanParser,buildCsvHeader,buildCsvRows,buildHeaderRows,buildInlineEditorProps,buildPopoverEditorProps,calculateDropTarget,clampSelectionToBounds,computeAggregations,computeArrowNavigation,computeAutoScrollSpeed,computeNextSortState,computeRowSelectionState,computeTabNavigation,computeTotalHeight,computeVisibleRange,createDebouncedCallback,createDebouncedSignal,createLatestCallback,currencyParser,dateParser,debounce,deriveFilterOptionsFromData,emailParser,escapeCsvValue,exportToCsv,findCtrlArrowTarget,flattenColumns,formatCellValueForTsv,formatSelectionAsTsv,formatShortcut,getCellRenderDescriptor,getCellValue,getColumnHeaderMenuItems,getContextMenuHandlers,getDataGridStatusBarConfig,getFilterField,getHeaderFilterConfig,getMultiSelectFilterFields,getPaginationViewModel,getPinStateForColumn,getScrollTopForRow,getStatusBarParts,injectGlobalStyles,isFilterConfig,isInSelectionRange,isRowInRange,measureColumnContentWidth,measureRange,mergeFilter,normalizeSelectionRange,numberParser,parseTsvClipboard,parseValue,processClientSideData,rangesEqual,reorderColumnArray,resolveCellDisplayContent,resolveCellStyle,toUserLike,triggerCsvDownload,validateColumns,validateRowIds}from'@alaarab/ogrid-angular';import {ViewChild,Component,ChangeDetectionStrategy,Input,ViewEncapsulation,signal,computed,effect}from'@angular/core';import {MatMenuTrigger,MatMenuModule}from'@angular/material/menu';import {MatDividerModule}from'@angular/material/divider';var x=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var e=(t,a,r,d)=>{for(var o=d>1?void 0:d?_(a,r):a,u=t.length-1,f;u>=0;u--)(f=t[u])&&(o=(d?f(a,r,o):f(o))||o);return d&&o&&x(a,r,o),o};var n=class extends BaseColumnHeaderFilterComponent{getHeaderEl(){return this.headerEl}onDocumentClickWrapper(a){this.onDocumentClick(a,"ogrid-column-header-filter");}};e([ViewChild("headerEl")],n.prototype,"headerEl",2),n=e([Component({selector:"ogrid-column-header-filter",standalone:true,changeDetection:ChangeDetectionStrategy.OnPush,template:`
|
|
34
2
|
<div class="ogrid-header-filter" #headerEl>
|
|
35
3
|
<div class="ogrid-header-filter__label">
|
|
36
4
|
<span class="ogrid-header-filter__name" [title]="columnName" data-header-label>
|
|
@@ -206,8 +174,7 @@ ColumnHeaderFilterComponent = __decorateClass([
|
|
|
206
174
|
}
|
|
207
175
|
</div>
|
|
208
176
|
}
|
|
209
|
-
`,
|
|
210
|
-
styles: [`
|
|
177
|
+
`,styles:[`
|
|
211
178
|
:host { display: flex; align-items: center; flex: 1; min-width: 0; position: relative; }
|
|
212
179
|
.ogrid-header-filter { display: flex; align-items: center; width: 100%; min-width: 0; }
|
|
213
180
|
.ogrid-header-filter__label { flex: 1; min-width: 0; overflow: hidden; }
|
|
@@ -323,24 +290,7 @@ ColumnHeaderFilterComponent = __decorateClass([
|
|
|
323
290
|
color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
|
|
324
291
|
}
|
|
325
292
|
.ogrid-header-filter__people-option:hover { background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.04)); }
|
|
326
|
-
`],
|
|
327
|
-
host: {
|
|
328
|
-
"(document:click)": "onDocumentClickWrapper($event)"
|
|
329
|
-
}
|
|
330
|
-
})
|
|
331
|
-
], ColumnHeaderFilterComponent);
|
|
332
|
-
var ColumnHeaderMenuComponent = class extends BaseColumnHeaderMenuComponent {
|
|
333
|
-
};
|
|
334
|
-
__decorateClass([
|
|
335
|
-
ViewChild(MatMenuTrigger)
|
|
336
|
-
], ColumnHeaderMenuComponent.prototype, "menuTrigger", 2);
|
|
337
|
-
ColumnHeaderMenuComponent = __decorateClass([
|
|
338
|
-
Component({
|
|
339
|
-
selector: "column-header-menu",
|
|
340
|
-
standalone: true,
|
|
341
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
342
|
-
imports: [MatMenuModule, MatDividerModule],
|
|
343
|
-
template: `
|
|
293
|
+
`],host:{"(document:click)":"onDocumentClickWrapper($event)"}})],n);var l=class extends BaseColumnHeaderMenuComponent{};e([ViewChild(MatMenuTrigger)],l.prototype,"menuTrigger",2),l=e([Component({selector:"column-header-menu",standalone:true,changeDetection:ChangeDetectionStrategy.OnPush,imports:[MatMenuModule,MatDividerModule],template:`
|
|
344
294
|
<button
|
|
345
295
|
[matMenuTriggerFor]="menu"
|
|
346
296
|
class="column-header-menu-trigger"
|
|
@@ -363,8 +313,7 @@ ColumnHeaderMenuComponent = __decorateClass([
|
|
|
363
313
|
}
|
|
364
314
|
}
|
|
365
315
|
</mat-menu>
|
|
366
|
-
`,
|
|
367
|
-
styles: [`
|
|
316
|
+
`,styles:[`
|
|
368
317
|
:host { flex-shrink: 0; }
|
|
369
318
|
.column-header-menu-trigger {
|
|
370
319
|
width: 24px;
|
|
@@ -386,29 +335,7 @@ ColumnHeaderMenuComponent = __decorateClass([
|
|
|
386
335
|
background: var(--ogrid-hover-bg, rgba(0, 0, 0, 0.08));
|
|
387
336
|
color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
|
|
388
337
|
}
|
|
389
|
-
`]
|
|
390
|
-
})
|
|
391
|
-
], ColumnHeaderMenuComponent);
|
|
392
|
-
var InlineCellEditorComponent = class extends BaseInlineCellEditorComponent {
|
|
393
|
-
};
|
|
394
|
-
InlineCellEditorComponent = __decorateClass([
|
|
395
|
-
Component({
|
|
396
|
-
selector: "ogrid-mat-inline-cell-editor",
|
|
397
|
-
standalone: true,
|
|
398
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
399
|
-
template: INLINE_CELL_EDITOR_TEMPLATE,
|
|
400
|
-
styles: [INLINE_CELL_EDITOR_STYLES]
|
|
401
|
-
})
|
|
402
|
-
], InlineCellEditorComponent);
|
|
403
|
-
var PopoverCellEditorComponent = class extends BasePopoverCellEditorComponent {
|
|
404
|
-
};
|
|
405
|
-
PopoverCellEditorComponent = __decorateClass([
|
|
406
|
-
Component({
|
|
407
|
-
selector: "ogrid-mat-popover-cell-editor",
|
|
408
|
-
standalone: true,
|
|
409
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
410
|
-
template: POPOVER_CELL_EDITOR_TEMPLATE,
|
|
411
|
-
styles: [`
|
|
338
|
+
`]})],l);var s=class extends BaseInlineCellEditorComponent{};s=e([Component({selector:"ogrid-mat-inline-cell-editor",standalone:true,changeDetection:ChangeDetectionStrategy.OnPush,template:INLINE_CELL_EDITOR_TEMPLATE,styles:[INLINE_CELL_EDITOR_STYLES]})],s);var g=class extends BasePopoverCellEditorComponent{};g=e([Component({selector:"ogrid-mat-popover-cell-editor",standalone:true,changeDetection:ChangeDetectionStrategy.OnPush,template:POPOVER_CELL_EDITOR_TEMPLATE,styles:[`
|
|
412
339
|
${POPOVER_CELL_EDITOR_OVERLAY_STYLES}
|
|
413
340
|
.ogrid-popover-anchor {
|
|
414
341
|
width: 100%; height: 100%; display: flex; align-items: center; min-width: 0;
|
|
@@ -417,70 +344,7 @@ PopoverCellEditorComponent = __decorateClass([
|
|
|
417
344
|
outline: 2px solid var(--ogrid-selection, #217346); outline-offset: -1px;
|
|
418
345
|
z-index: 2; position: relative;
|
|
419
346
|
}
|
|
420
|
-
`]
|
|
421
|
-
})
|
|
422
|
-
], PopoverCellEditorComponent);
|
|
423
|
-
|
|
424
|
-
// src/datagrid-table/datagrid-table.component.ts
|
|
425
|
-
var DataGridTableComponent = class extends BaseDataGridTableComponent {
|
|
426
|
-
constructor() {
|
|
427
|
-
super();
|
|
428
|
-
this.propsSignal = signal(void 0);
|
|
429
|
-
this.showColumnLetters = computed(() => !!this.getProps()?.showColumnLetters);
|
|
430
|
-
this.formulaReferences = computed(() => this.getProps()?.formulaReferences);
|
|
431
|
-
this.initBase();
|
|
432
|
-
effect(() => {
|
|
433
|
-
const props = this.getProps();
|
|
434
|
-
const onActiveCellChange = props?.onActiveCellChange;
|
|
435
|
-
if (!onActiveCellChange) return;
|
|
436
|
-
const ac = this.activeCell();
|
|
437
|
-
if (ac) {
|
|
438
|
-
const colIndex = ac.columnIndex - this.colOffset();
|
|
439
|
-
const rowNumber = ac.rowIndex + 1;
|
|
440
|
-
onActiveCellChange(formatCellReference(colIndex, rowNumber));
|
|
441
|
-
} else {
|
|
442
|
-
onActiveCellChange(null);
|
|
443
|
-
}
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
set propsInput(value) {
|
|
447
|
-
this.propsSignal.set(value);
|
|
448
|
-
}
|
|
449
|
-
getProps() {
|
|
450
|
-
return this.propsSignal();
|
|
451
|
-
}
|
|
452
|
-
getWrapperRef() {
|
|
453
|
-
return this.wrapperRef;
|
|
454
|
-
}
|
|
455
|
-
getTableContainerRef() {
|
|
456
|
-
return this.tableContainerRef;
|
|
457
|
-
}
|
|
458
|
-
getColumnLetter(colIdx) {
|
|
459
|
-
return indexToColumnLetter(colIdx);
|
|
460
|
-
}
|
|
461
|
-
onResizeRowNumber(event) {
|
|
462
|
-
event.stopPropagation();
|
|
463
|
-
this.onResizeStart(event, { columnId: ROW_NUMBER_COLUMN_ID, name: "#" });
|
|
464
|
-
}
|
|
465
|
-
};
|
|
466
|
-
__decorateClass([
|
|
467
|
-
Input({ required: true, alias: "props" })
|
|
468
|
-
], DataGridTableComponent.prototype, "propsInput", 1);
|
|
469
|
-
__decorateClass([
|
|
470
|
-
ViewChild("wrapperEl")
|
|
471
|
-
], DataGridTableComponent.prototype, "wrapperRef", 2);
|
|
472
|
-
__decorateClass([
|
|
473
|
-
ViewChild("tableContainerElRef")
|
|
474
|
-
], DataGridTableComponent.prototype, "tableContainerRef", 2);
|
|
475
|
-
DataGridTableComponent = __decorateClass([
|
|
476
|
-
Component({
|
|
477
|
-
selector: "ogrid-datagrid-table",
|
|
478
|
-
standalone: true,
|
|
479
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
480
|
-
encapsulation: ViewEncapsulation.None,
|
|
481
|
-
imports: [ColumnHeaderFilterComponent, ColumnHeaderMenuComponent, StatusBarComponent, GridContextMenuComponent, MarchingAntsOverlayComponent, EmptyStateComponent, FormulaRefOverlayComponent, InlineCellEditorComponent, PopoverCellEditorComponent],
|
|
482
|
-
providers: [DataGridStateService, ColumnReorderService, VirtualScrollService],
|
|
483
|
-
template: `
|
|
347
|
+
`]})],g);var i=class extends BaseDataGridTableComponent{constructor(){super();this.propsSignal=signal(void 0);this.showColumnLetters=computed(()=>!!this.getProps()?.showColumnLetters);this.formulaReferences=computed(()=>this.getProps()?.formulaReferences);this.initBase(),effect(()=>{let d=this.getProps()?.onActiveCellChange;if(!d)return;let o=this.activeCell();if(o){let u=o.columnIndex-this.colOffset(),f=o.rowIndex+1;d(formatCellReference(u,f));}else d(null);});}set propsInput(r){this.propsSignal.set(r);}getProps(){return this.propsSignal()}getWrapperRef(){return this.wrapperRef}getTableContainerRef(){return this.tableContainerRef}getColumnLetter(r){return indexToColumnLetter(r)}onResizeRowNumber(r){r.stopPropagation(),this.onResizeStart(r,{columnId:ROW_NUMBER_COLUMN_ID,name:"#"});}};e([Input({required:true,alias:"props"})],i.prototype,"propsInput",1),e([ViewChild("wrapperEl")],i.prototype,"wrapperRef",2),e([ViewChild("tableContainerElRef")],i.prototype,"tableContainerRef",2),i=e([Component({selector:"ogrid-datagrid-table",standalone:true,changeDetection:ChangeDetectionStrategy.OnPush,encapsulation:ViewEncapsulation.None,imports:[n,l,StatusBarComponent,GridContextMenuComponent,MarchingAntsOverlayComponent,EmptyStateComponent,FormulaRefOverlayComponent,s,g],providers:[DataGridStateService,ColumnReorderService,VirtualScrollService],template:`
|
|
484
348
|
<div class="ogrid-datagrid-root">
|
|
485
349
|
<div
|
|
486
350
|
#wrapperEl
|
|
@@ -492,7 +356,7 @@ DataGridTableComponent = __decorateClass([
|
|
|
492
356
|
role="region"
|
|
493
357
|
[attr.aria-label]="ariaLabel()"
|
|
494
358
|
[attr.aria-labelledby]="ariaLabelledBy()"
|
|
495
|
-
(
|
|
359
|
+
(pointerdown)="onWrapperMouseDown($event)"
|
|
496
360
|
(keydown)="onGridKeyDown($event)"
|
|
497
361
|
(scroll)="onWrapperScroll($event)"
|
|
498
362
|
(contextmenu)="$event.preventDefault()"
|
|
@@ -546,7 +410,7 @@ DataGridTableComponent = __decorateClass([
|
|
|
546
410
|
[style.max-width.px]="getRowNumberWidth()"
|
|
547
411
|
>
|
|
548
412
|
<div class="ogrid-row-number-header-content">#</div>
|
|
549
|
-
<div class="ogrid-datagrid-resize-handle" (
|
|
413
|
+
<div class="ogrid-datagrid-resize-handle" (pointerdown)="onResizeRowNumber($event)" (dblclick)="$event.stopPropagation()"></div>
|
|
550
414
|
</th>
|
|
551
415
|
}
|
|
552
416
|
@if (rowIdx === 0 && rowIdx < headerRows().length - 1 && hasRowNumbersCol()) {
|
|
@@ -579,7 +443,7 @@ DataGridTableComponent = __decorateClass([
|
|
|
579
443
|
[style.cursor]="columnReorderService.isDragging() ? 'grabbing' : 'grab'"
|
|
580
444
|
[style.left.px]="pinnedLeft ? getPinnedLeftOffset(col.columnId) : null"
|
|
581
445
|
[style.right.px]="pinnedRight ? getPinnedRightOffset(col.columnId) : null"
|
|
582
|
-
(
|
|
446
|
+
(pointerdown)="onHeaderMouseDown(col.columnId, $event)"
|
|
583
447
|
>
|
|
584
448
|
<div style="display:flex;align-items:center;gap:4px;">
|
|
585
449
|
<ogrid-column-header-filter
|
|
@@ -613,7 +477,7 @@ DataGridTableComponent = __decorateClass([
|
|
|
613
477
|
[handlers]="getColumnMenuHandlersMemoized(col.columnId)"
|
|
614
478
|
/>
|
|
615
479
|
</div>
|
|
616
|
-
<div class="ogrid-datagrid-resize-handle" (
|
|
480
|
+
<div class="ogrid-datagrid-resize-handle" (pointerdown)="onResizeStart($event, col)" (dblclick)="onResizeDoubleClick($event, col)"></div>
|
|
617
481
|
</th>
|
|
618
482
|
}
|
|
619
483
|
}
|
|
@@ -719,7 +583,7 @@ DataGridTableComponent = __decorateClass([
|
|
|
719
583
|
[attr.data-col-index]="descriptor.globalColIndex"
|
|
720
584
|
[attr.data-in-range]="descriptor.isInRange ? 'true' : null"
|
|
721
585
|
[attr.tabindex]="descriptor.isActive ? 0 : -1"
|
|
722
|
-
(
|
|
586
|
+
(pointerdown)="onCellMouseDown($event, rowIndex, descriptor.globalColIndex)"
|
|
723
587
|
(click)="onCellClick(rowIndex, descriptor.globalColIndex)"
|
|
724
588
|
(contextmenu)="onCellContextMenu($event)"
|
|
725
589
|
(dblclick)="descriptor.canEditAny ? onCellDblClick(descriptor.rowId, colLayout.col.columnId) : null"
|
|
@@ -734,7 +598,7 @@ DataGridTableComponent = __decorateClass([
|
|
|
734
598
|
@if (descriptor.canEditAny && descriptor.isSelectionEndCell) {
|
|
735
599
|
<div
|
|
736
600
|
class="ogrid-datagrid-fill-handle"
|
|
737
|
-
(
|
|
601
|
+
(pointerdown)="onFillHandleMouseDown($event)"
|
|
738
602
|
aria-label="Fill handle"
|
|
739
603
|
></div>
|
|
740
604
|
}
|
|
@@ -840,8 +704,7 @@ DataGridTableComponent = __decorateClass([
|
|
|
840
704
|
</div>
|
|
841
705
|
}
|
|
842
706
|
</div>
|
|
843
|
-
`,
|
|
844
|
-
styles: [OGRID_THEME_VARS_CSS, `
|
|
707
|
+
`,styles:[OGRID_THEME_VARS_CSS,`
|
|
845
708
|
:host { display: block; }
|
|
846
709
|
.ogrid-datagrid-root { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
|
|
847
710
|
.ogrid-datagrid-wrapper {
|
|
@@ -959,11 +822,17 @@ DataGridTableComponent = __decorateClass([
|
|
|
959
822
|
position: absolute; right: -3px; bottom: -3px; width: 7px; height: 7px;
|
|
960
823
|
background: var(--ogrid-selection-color, #217346);
|
|
961
824
|
border: 1px solid var(--ogrid-bg, #ffffff); border-radius: 1px;
|
|
962
|
-
cursor: crosshair; pointer-events: auto; z-index: 3;
|
|
825
|
+
cursor: crosshair; pointer-events: auto; touch-action: none; z-index: 3;
|
|
826
|
+
}
|
|
827
|
+
@media (pointer: coarse) {
|
|
828
|
+
.ogrid-datagrid-fill-handle { width: 14px; height: 14px; right: -7px; bottom: -7px; border-radius: 2px; }
|
|
963
829
|
}
|
|
964
830
|
.ogrid-datagrid-resize-handle {
|
|
965
831
|
position: absolute; top: 0; right: -3px; bottom: 0; width: 8px;
|
|
966
|
-
cursor: col-resize; user-select: none;
|
|
832
|
+
cursor: col-resize; user-select: none; touch-action: none;
|
|
833
|
+
}
|
|
834
|
+
@media (pointer: coarse) {
|
|
835
|
+
.ogrid-datagrid-resize-handle { width: 16px; right: -8px; }
|
|
967
836
|
}
|
|
968
837
|
.ogrid-datagrid-resize-handle::after {
|
|
969
838
|
content: ''; position: absolute; top: 4px; right: 3px; bottom: 4px; width: 2px;
|
|
@@ -1032,23 +901,7 @@ DataGridTableComponent = __decorateClass([
|
|
|
1032
901
|
.mat-mdc-menu-item.mat-mdc-menu-item .mat-mdc-menu-item-text {
|
|
1033
902
|
color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
|
|
1034
903
|
}
|
|
1035
|
-
`]
|
|
1036
|
-
})
|
|
1037
|
-
], DataGridTableComponent);
|
|
1038
|
-
var ColumnChooserComponent = class extends BaseColumnChooserComponent {
|
|
1039
|
-
onDocumentClick(event) {
|
|
1040
|
-
const el = event.target;
|
|
1041
|
-
if (!el.closest("ogrid-column-chooser")) {
|
|
1042
|
-
this.isOpen.set(false);
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
};
|
|
1046
|
-
ColumnChooserComponent = __decorateClass([
|
|
1047
|
-
Component({
|
|
1048
|
-
selector: "ogrid-column-chooser",
|
|
1049
|
-
standalone: true,
|
|
1050
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1051
|
-
template: `
|
|
904
|
+
`]})],i);var c=class extends BaseColumnChooserComponent{onDocumentClick(a){a.target.closest("ogrid-column-chooser")||this.isOpen.set(false);}};c=e([Component({selector:"ogrid-column-chooser",standalone:true,changeDetection:ChangeDetectionStrategy.OnPush,template:`
|
|
1052
905
|
<div class="ogrid-column-chooser">
|
|
1053
906
|
<button
|
|
1054
907
|
class="ogrid-column-chooser__trigger"
|
|
@@ -1086,8 +939,7 @@ ColumnChooserComponent = __decorateClass([
|
|
|
1086
939
|
</div>
|
|
1087
940
|
}
|
|
1088
941
|
</div>
|
|
1089
|
-
`,
|
|
1090
|
-
styles: [`
|
|
942
|
+
`,styles:[`
|
|
1091
943
|
:host { display: inline-flex; position: relative; }
|
|
1092
944
|
.ogrid-column-chooser { position: relative; }
|
|
1093
945
|
.ogrid-column-chooser__trigger {
|
|
@@ -1137,20 +989,7 @@ ColumnChooserComponent = __decorateClass([
|
|
|
1137
989
|
.ogrid-column-chooser__btn--primary:hover {
|
|
1138
990
|
opacity: 0.9;
|
|
1139
991
|
}
|
|
1140
|
-
`],
|
|
1141
|
-
host: {
|
|
1142
|
-
"(document:click)": "onDocumentClick($event)"
|
|
1143
|
-
}
|
|
1144
|
-
})
|
|
1145
|
-
], ColumnChooserComponent);
|
|
1146
|
-
var PaginationControlsComponent = class extends BasePaginationControlsComponent {
|
|
1147
|
-
};
|
|
1148
|
-
PaginationControlsComponent = __decorateClass([
|
|
1149
|
-
Component({
|
|
1150
|
-
selector: "ogrid-pagination-controls",
|
|
1151
|
-
standalone: true,
|
|
1152
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1153
|
-
template: `
|
|
992
|
+
`],host:{"(document:click)":"onDocumentClick($event)"}})],c);var p=class extends BasePaginationControlsComponent{};p=e([Component({selector:"ogrid-pagination-controls",standalone:true,changeDetection:ChangeDetectionStrategy.OnPush,template:`
|
|
1154
993
|
@if (vm(); as vm) {
|
|
1155
994
|
<nav class="ogrid-pagination" role="navigation" aria-label="Pagination">
|
|
1156
995
|
<span class="ogrid-pagination__info">
|
|
@@ -1224,8 +1063,7 @@ PaginationControlsComponent = __decorateClass([
|
|
|
1224
1063
|
</span>
|
|
1225
1064
|
</nav>
|
|
1226
1065
|
}
|
|
1227
|
-
`,
|
|
1228
|
-
styles: [`
|
|
1066
|
+
`,styles:[`
|
|
1229
1067
|
:host { display: block; }
|
|
1230
1068
|
.ogrid-pagination {
|
|
1231
1069
|
display: flex; align-items: center; justify-content: space-between;
|
|
@@ -1254,27 +1092,13 @@ PaginationControlsComponent = __decorateClass([
|
|
|
1254
1092
|
font-size: 14px; margin-left: 8px;
|
|
1255
1093
|
background: var(--ogrid-bg, #ffffff); color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
|
|
1256
1094
|
}
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
};
|
|
1264
|
-
OGridComponent = __decorateClass([
|
|
1265
|
-
Component({
|
|
1266
|
-
selector: "ogrid",
|
|
1267
|
-
standalone: true,
|
|
1268
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1269
|
-
imports: [
|
|
1270
|
-
OGridLayoutComponent,
|
|
1271
|
-
DataGridTableComponent,
|
|
1272
|
-
ColumnChooserComponent,
|
|
1273
|
-
PaginationControlsComponent
|
|
1274
|
-
],
|
|
1275
|
-
providers: [OGridService],
|
|
1276
|
-
styles: [`:host { display: block; height: 100%; }`],
|
|
1277
|
-
template: `
|
|
1095
|
+
@media (max-width: 576px) {
|
|
1096
|
+
.ogrid-pagination { flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 8px; font-size: 12px; }
|
|
1097
|
+
.ogrid-pagination__pages { order: -1; justify-content: center; }
|
|
1098
|
+
.ogrid-pagination__info { text-align: center; font-size: 11px; }
|
|
1099
|
+
.ogrid-pagination__size { font-size: 11px; justify-content: center; }
|
|
1100
|
+
}
|
|
1101
|
+
`]})],p);var h=class extends BaseOGridComponent{};h=e([Component({selector:"ogrid",standalone:true,changeDetection:ChangeDetectionStrategy.OnPush,imports:[OGridLayoutComponent,i,c,p],providers:[OGridService],styles:[":host { display: block; height: 100%; }"],template:`
|
|
1278
1102
|
<ogrid-layout
|
|
1279
1103
|
[className]="ogridService.className()"
|
|
1280
1104
|
[sideBar]="ogridService.sideBarProps()"
|
|
@@ -1314,8 +1138,4 @@ OGridComponent = __decorateClass([
|
|
|
1314
1138
|
/>
|
|
1315
1139
|
</ng-container>
|
|
1316
1140
|
</ogrid-layout>
|
|
1317
|
-
`
|
|
1318
|
-
})
|
|
1319
|
-
], OGridComponent);
|
|
1320
|
-
|
|
1321
|
-
export { ColumnChooserComponent, ColumnHeaderFilterComponent, ColumnHeaderMenuComponent, DataGridTableComponent, InlineCellEditorComponent, OGridComponent, PaginationControlsComponent, PopoverCellEditorComponent };
|
|
1141
|
+
`})],h);export{c as ColumnChooserComponent,n as ColumnHeaderFilterComponent,l as ColumnHeaderMenuComponent,i as DataGridTableComponent,s as InlineCellEditorComponent,h as OGridComponent,p as PaginationControlsComponent,g as PopoverCellEditorComponent};
|
|
@@ -17,5 +17,5 @@ export declare class DataGridTableComponent<T> extends BaseDataGridTableComponen
|
|
|
17
17
|
protected getWrapperRef(): ElementRef<HTMLElement> | undefined;
|
|
18
18
|
protected getTableContainerRef(): ElementRef<HTMLElement> | undefined;
|
|
19
19
|
getColumnLetter(colIdx: number): string;
|
|
20
|
-
onResizeRowNumber(event:
|
|
20
|
+
onResizeRowNumber(event: PointerEvent): void;
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alaarab/ogrid-angular-material",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "OGrid Angular Material – MatTable-based data grid with sorting, filtering, pagination, column chooser, and CSV export.",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"node": ">=18"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@alaarab/ogrid-angular": "2.
|
|
40
|
+
"@alaarab/ogrid-angular": "2.5.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@angular/cdk": "^21.0.0",
|