@alaarab/ogrid-angular-primeng 2.1.3 → 2.1.4
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 +1693 -15
- package/dist/types/index.d.ts +4 -1
- package/package.json +4 -4
- package/dist/esm/column-chooser/column-chooser.component.js +0 -73
- package/dist/esm/column-header-filter/column-header-filter.component.js +0 -251
- package/dist/esm/column-header-menu/column-header-menu.component.js +0 -134
- package/dist/esm/datagrid-table/datagrid-table.component.js +0 -1015
- package/dist/esm/datagrid-table/inline-cell-editor.component.js +0 -20
- package/dist/esm/datagrid-table/popover-cell-editor.component.js +0 -27
- package/dist/esm/ogrid/ogrid.component.js +0 -139
- package/dist/esm/pagination-controls/pagination-controls.component.js +0 -111
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
8
|
-
import { BaseInlineCellEditorComponent, INLINE_CELL_EDITOR_TEMPLATE, INLINE_CELL_EDITOR_STYLES } from '@alaarab/ogrid-angular';
|
|
9
|
-
let InlineCellEditorComponent = class InlineCellEditorComponent extends BaseInlineCellEditorComponent {
|
|
10
|
-
};
|
|
11
|
-
InlineCellEditorComponent = __decorate([
|
|
12
|
-
Component({
|
|
13
|
-
selector: 'ogrid-primeng-inline-cell-editor',
|
|
14
|
-
standalone: true,
|
|
15
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16
|
-
template: INLINE_CELL_EDITOR_TEMPLATE,
|
|
17
|
-
styles: [INLINE_CELL_EDITOR_STYLES],
|
|
18
|
-
})
|
|
19
|
-
], InlineCellEditorComponent);
|
|
20
|
-
export { InlineCellEditorComponent };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
8
|
-
import { BasePopoverCellEditorComponent, POPOVER_CELL_EDITOR_TEMPLATE, POPOVER_CELL_EDITOR_OVERLAY_STYLES } from '@alaarab/ogrid-angular';
|
|
9
|
-
let PopoverCellEditorComponent = class PopoverCellEditorComponent extends BasePopoverCellEditorComponent {
|
|
10
|
-
};
|
|
11
|
-
PopoverCellEditorComponent = __decorate([
|
|
12
|
-
Component({
|
|
13
|
-
selector: 'ogrid-primeng-popover-cell-editor',
|
|
14
|
-
standalone: true,
|
|
15
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16
|
-
template: POPOVER_CELL_EDITOR_TEMPLATE,
|
|
17
|
-
styles: [`
|
|
18
|
-
${POPOVER_CELL_EDITOR_OVERLAY_STYLES}
|
|
19
|
-
.ogrid-popover-anchor {
|
|
20
|
-
padding: 6px 10px; min-height: 20px; cursor: default; overflow: hidden;
|
|
21
|
-
text-overflow: ellipsis; white-space: nowrap;
|
|
22
|
-
outline: 2px solid var(--ogrid-selection, #217346); outline-offset: -2px;
|
|
23
|
-
}
|
|
24
|
-
`],
|
|
25
|
-
})
|
|
26
|
-
], PopoverCellEditorComponent);
|
|
27
|
-
export { PopoverCellEditorComponent };
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { Component, inject, ChangeDetectionStrategy, Input, signal, effect, computed } from '@angular/core';
|
|
8
|
-
import { OGridService, OGridLayoutComponent, } from '@alaarab/ogrid-angular';
|
|
9
|
-
import { DataGridTableComponent } from '../datagrid-table/datagrid-table.component';
|
|
10
|
-
import { ColumnChooserComponent } from '../column-chooser/column-chooser.component';
|
|
11
|
-
import { PaginationControlsComponent } from '../pagination-controls/pagination-controls.component';
|
|
12
|
-
let OGridComponent = class OGridComponent {
|
|
13
|
-
set props(value) {
|
|
14
|
-
this.propsSignal.set(value);
|
|
15
|
-
}
|
|
16
|
-
constructor() {
|
|
17
|
-
this.service = inject(OGridService);
|
|
18
|
-
this.propsSignal = signal(undefined);
|
|
19
|
-
// Stable callback references (avoid re-creating every template eval)
|
|
20
|
-
this.onColumnSortFn = (columnKey, direction) => this.service.handleSort(columnKey, direction);
|
|
21
|
-
this.onColumnResizedFn = (columnId, width) => this.service.handleColumnResized(columnId, width);
|
|
22
|
-
this.onColumnPinnedFn = (columnId, pinned) => this.service.handleColumnPinned(columnId, pinned);
|
|
23
|
-
this.onSelectionChangeFn = (event) => this.service.handleSelectionChange(event);
|
|
24
|
-
this.onFilterChangeFn = (key, value) => this.service.handleFilterChange(key, value);
|
|
25
|
-
this.clearAllFiltersFn = () => this.service.setFilters({});
|
|
26
|
-
this.emptyStateComputed = computed(() => ({
|
|
27
|
-
hasActiveFilters: this.service.hasActiveFilters(),
|
|
28
|
-
onClearAll: this.clearAllFiltersFn,
|
|
29
|
-
message: this.service.emptyState()?.message,
|
|
30
|
-
render: this.service.emptyState()?.render,
|
|
31
|
-
}));
|
|
32
|
-
effect(() => {
|
|
33
|
-
const p = this.propsSignal();
|
|
34
|
-
if (p)
|
|
35
|
-
this.service.configure(p);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
get showToolbar() {
|
|
39
|
-
return this.service.columnChooserPlacement() === 'toolbar' || this.service.toolbar() != null || this.service.fullScreen();
|
|
40
|
-
}
|
|
41
|
-
get emptyStateObj() {
|
|
42
|
-
return this.emptyStateComputed();
|
|
43
|
-
}
|
|
44
|
-
onPageSizeChange(size) {
|
|
45
|
-
this.service.setPageSize(size);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
__decorate([
|
|
49
|
-
Input({ required: true })
|
|
50
|
-
], OGridComponent.prototype, "props", null);
|
|
51
|
-
OGridComponent = __decorate([
|
|
52
|
-
Component({
|
|
53
|
-
selector: 'ogrid-primeng',
|
|
54
|
-
standalone: true,
|
|
55
|
-
imports: [
|
|
56
|
-
OGridLayoutComponent,
|
|
57
|
-
DataGridTableComponent,
|
|
58
|
-
ColumnChooserComponent,
|
|
59
|
-
PaginationControlsComponent,
|
|
60
|
-
],
|
|
61
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
62
|
-
providers: [OGridService],
|
|
63
|
-
styles: [`:host { display: block; height: 100%; }`],
|
|
64
|
-
template: `
|
|
65
|
-
<ogrid-layout
|
|
66
|
-
[className]="service.className()"
|
|
67
|
-
[hasToolbar]="showToolbar"
|
|
68
|
-
[hasToolbarBelow]="false"
|
|
69
|
-
[hasPagination]="true"
|
|
70
|
-
[sideBar]="service.sideBarProps()"
|
|
71
|
-
[fullScreen]="service.fullScreen()"
|
|
72
|
-
>
|
|
73
|
-
<ng-content select="[toolbar]" toolbar></ng-content>
|
|
74
|
-
|
|
75
|
-
<div toolbarEnd>
|
|
76
|
-
@if (service.columnChooserPlacement() === 'toolbar') {
|
|
77
|
-
<ogrid-primeng-column-chooser
|
|
78
|
-
[columns]="service.columnChooser().columns"
|
|
79
|
-
[visibleColumns]="service.columnChooser().visibleColumns"
|
|
80
|
-
(visibilityChange)="service.handleVisibilityChange($event.columnKey, $event.visible)"
|
|
81
|
-
></ogrid-primeng-column-chooser>
|
|
82
|
-
}
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<ogrid-primeng-datagrid-table
|
|
86
|
-
[items]="service.displayItems()"
|
|
87
|
-
[columns]="service.columnsProp()"
|
|
88
|
-
[getRowId]="service.getRowId()"
|
|
89
|
-
[sortBy]="service.sort().field"
|
|
90
|
-
[sortDirection]="service.sort().direction"
|
|
91
|
-
[onColumnSort]="onColumnSortFn"
|
|
92
|
-
[visibleColumns]="service.visibleColumns()"
|
|
93
|
-
[columnOrder]="service.columnOrder()"
|
|
94
|
-
[onColumnOrderChange]="service.onColumnOrderChange()"
|
|
95
|
-
[onColumnResized]="onColumnResizedFn"
|
|
96
|
-
[onColumnPinned]="onColumnPinnedFn"
|
|
97
|
-
[editable]="service.editable()"
|
|
98
|
-
[cellSelection]="service.cellSelection()"
|
|
99
|
-
[onCellValueChanged]="service.onCellValueChanged()"
|
|
100
|
-
[onUndo]="service.onUndo()"
|
|
101
|
-
[onRedo]="service.onRedo()"
|
|
102
|
-
[canUndo]="service.canUndo()"
|
|
103
|
-
[canRedo]="service.canRedo()"
|
|
104
|
-
[rowSelection]="service.rowSelection()"
|
|
105
|
-
[selectedRows]="service.effectiveSelectedRows()"
|
|
106
|
-
[onSelectionChange]="onSelectionChangeFn"
|
|
107
|
-
[statusBar]="service.statusBarConfig()"
|
|
108
|
-
[isLoading]="service.isLoadingResolved()"
|
|
109
|
-
[filters]="service.filters()"
|
|
110
|
-
[onFilterChange]="onFilterChangeFn"
|
|
111
|
-
[filterOptions]="service.clientFilterOptions()"
|
|
112
|
-
[loadingFilterOptions]="service.loadingFilterOptions()"
|
|
113
|
-
[peopleSearch]="service.dataSource()?.searchPeople?.bind(service.dataSource())"
|
|
114
|
-
[getUserByEmail]="service.dataSource()?.getUserByEmail?.bind(service.dataSource())"
|
|
115
|
-
[layoutMode]="service.layoutMode()"
|
|
116
|
-
[suppressHorizontalScroll]="service.suppressHorizontalScroll()"
|
|
117
|
-
[stickyHeaderInput]="service.stickyHeader()"
|
|
118
|
-
[columnReorder]="service.columnReorder()"
|
|
119
|
-
[aria-label]="service.ariaLabel()"
|
|
120
|
-
[aria-labelledby]="service.ariaLabelledBy()"
|
|
121
|
-
[emptyState]="emptyStateObj"
|
|
122
|
-
></ogrid-primeng-datagrid-table>
|
|
123
|
-
|
|
124
|
-
<div pagination>
|
|
125
|
-
<ogrid-primeng-pagination-controls
|
|
126
|
-
[currentPage]="service.pagination().page"
|
|
127
|
-
[pageSize]="service.pagination().pageSize"
|
|
128
|
-
[totalCount]="service.pagination().displayTotalCount"
|
|
129
|
-
[pageSizeOptions]="service.pageSizeOptions()"
|
|
130
|
-
[entityLabelPlural]="service.entityLabelPlural()"
|
|
131
|
-
(pageChange)="service.setPage($event)"
|
|
132
|
-
(pageSizeChange)="onPageSizeChange($event)"
|
|
133
|
-
></ogrid-primeng-pagination-controls>
|
|
134
|
-
</div>
|
|
135
|
-
</ogrid-layout>
|
|
136
|
-
`,
|
|
137
|
-
})
|
|
138
|
-
], OGridComponent);
|
|
139
|
-
export { OGridComponent };
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
8
|
-
import { BasePaginationControlsComponent } from '@alaarab/ogrid-angular';
|
|
9
|
-
let PaginationControlsComponent = class PaginationControlsComponent extends BasePaginationControlsComponent {
|
|
10
|
-
};
|
|
11
|
-
PaginationControlsComponent = __decorate([
|
|
12
|
-
Component({
|
|
13
|
-
selector: 'ogrid-primeng-pagination-controls',
|
|
14
|
-
standalone: true,
|
|
15
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16
|
-
template: `
|
|
17
|
-
@if (vm()) {
|
|
18
|
-
<div style="display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:13px;color:var(--ogrid-fg, #242424)">
|
|
19
|
-
<div>
|
|
20
|
-
Showing {{ vm()!.startItem }} to {{ vm()!.endItem }} of {{ totalCount.toLocaleString() }} {{ labelPlural() }}
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
<div style="display:flex;align-items:center;gap:4px" role="navigation" aria-label="Pagination">
|
|
24
|
-
<button
|
|
25
|
-
type="button"
|
|
26
|
-
class="p-button p-button-text p-button-sm"
|
|
27
|
-
[disabled]="currentPage === 1"
|
|
28
|
-
(click)="pageChange.emit(1)"
|
|
29
|
-
aria-label="First page"
|
|
30
|
-
style="min-width:32px;padding:4px 8px"
|
|
31
|
-
>«</button>
|
|
32
|
-
<button
|
|
33
|
-
type="button"
|
|
34
|
-
class="p-button p-button-text p-button-sm"
|
|
35
|
-
[disabled]="currentPage === 1"
|
|
36
|
-
(click)="pageChange.emit(currentPage - 1)"
|
|
37
|
-
aria-label="Previous page"
|
|
38
|
-
style="min-width:32px;padding:4px 8px"
|
|
39
|
-
>‹</button>
|
|
40
|
-
|
|
41
|
-
@if (vm()!.showStartEllipsis) {
|
|
42
|
-
<button
|
|
43
|
-
type="button"
|
|
44
|
-
class="p-button p-button-text p-button-sm"
|
|
45
|
-
(click)="pageChange.emit(1)"
|
|
46
|
-
aria-label="Page 1"
|
|
47
|
-
style="min-width:32px;padding:4px 8px"
|
|
48
|
-
>1</button>
|
|
49
|
-
<span aria-hidden style="padding:0 4px">…</span>
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@for (pageNum of vm()!.pageNumbers; track pageNum) {
|
|
53
|
-
<button
|
|
54
|
-
type="button"
|
|
55
|
-
class="p-button p-button-sm"
|
|
56
|
-
[class.p-button-outlined]="currentPage !== pageNum"
|
|
57
|
-
(click)="pageChange.emit(pageNum)"
|
|
58
|
-
[attr.aria-label]="'Page ' + pageNum"
|
|
59
|
-
[attr.aria-current]="currentPage === pageNum ? 'page' : null"
|
|
60
|
-
style="min-width:32px;padding:4px 8px"
|
|
61
|
-
>{{ pageNum }}</button>
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@if (vm()!.showEndEllipsis) {
|
|
65
|
-
<span aria-hidden style="padding:0 4px">…</span>
|
|
66
|
-
<button
|
|
67
|
-
type="button"
|
|
68
|
-
class="p-button p-button-text p-button-sm"
|
|
69
|
-
(click)="pageChange.emit(vm()!.totalPages)"
|
|
70
|
-
[attr.aria-label]="'Page ' + vm()!.totalPages"
|
|
71
|
-
style="min-width:32px;padding:4px 8px"
|
|
72
|
-
>{{ vm()!.totalPages }}</button>
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
<button
|
|
76
|
-
type="button"
|
|
77
|
-
class="p-button p-button-text p-button-sm"
|
|
78
|
-
[disabled]="currentPage >= vm()!.totalPages"
|
|
79
|
-
(click)="pageChange.emit(currentPage + 1)"
|
|
80
|
-
aria-label="Next page"
|
|
81
|
-
style="min-width:32px;padding:4px 8px"
|
|
82
|
-
>›</button>
|
|
83
|
-
<button
|
|
84
|
-
type="button"
|
|
85
|
-
class="p-button p-button-text p-button-sm"
|
|
86
|
-
[disabled]="currentPage >= vm()!.totalPages"
|
|
87
|
-
(click)="pageChange.emit(vm()!.totalPages)"
|
|
88
|
-
aria-label="Last page"
|
|
89
|
-
style="min-width:32px;padding:4px 8px"
|
|
90
|
-
>»</button>
|
|
91
|
-
</div>
|
|
92
|
-
|
|
93
|
-
<div style="display:flex;align-items:center;gap:6px">
|
|
94
|
-
<span style="font-size:12px">Rows</span>
|
|
95
|
-
<select
|
|
96
|
-
[value]="'' + pageSize"
|
|
97
|
-
(change)="onPageSizeChange($any($event.target).value)"
|
|
98
|
-
aria-label="Rows per page"
|
|
99
|
-
style="padding:4px 6px;border:1px solid var(--ogrid-border, rgba(0, 0, 0, 0.12));border-radius:4px;background:var(--ogrid-bg, #fff);color:var(--ogrid-fg, #242424)"
|
|
100
|
-
>
|
|
101
|
-
@for (opt of vm()!.pageSizeOptions; track opt) {
|
|
102
|
-
<option [value]="opt">{{ opt }}</option>
|
|
103
|
-
}
|
|
104
|
-
</select>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
}
|
|
108
|
-
`,
|
|
109
|
-
})
|
|
110
|
-
], PaginationControlsComponent);
|
|
111
|
-
export { PaginationControlsComponent };
|