@alaarab/ogrid-angular-primeng 2.0.9 → 2.0.12
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/column-chooser/column-chooser.component.js +9 -29
- package/dist/esm/column-header-filter/column-header-filter.component.js +47 -165
- package/dist/esm/column-header-menu/column-header-menu.component.js +88 -51
- package/dist/esm/datagrid-table/datagrid-table.component.js +614 -152
- package/dist/esm/datagrid-table/inline-cell-editor.component.js +32 -14
- package/dist/esm/datagrid-table/popover-cell-editor.component.js +39 -20
- package/dist/esm/index.js +2 -0
- package/dist/esm/ogrid/ogrid.component.js +25 -11
- package/dist/esm/pagination-controls/pagination-controls.component.js +13 -27
- package/dist/types/column-chooser/column-chooser.component.d.ts +3 -19
- package/dist/types/column-header-filter/column-header-filter.component.d.ts +5 -62
- package/dist/types/column-header-menu/column-header-menu.component.d.ts +11 -12
- package/dist/types/datagrid-table/datagrid-table.component.d.ts +72 -50
- package/dist/types/datagrid-table/inline-cell-editor.component.d.ts +9 -9
- package/dist/types/datagrid-table/popover-cell-editor.component.d.ts +9 -9
- package/dist/types/index.d.ts +0 -2
- package/dist/types/ogrid/ogrid.component.d.ts +7 -6
- package/dist/types/pagination-controls/pagination-controls.component.d.ts +2 -11
- package/package.json +14 -4
|
@@ -4,24 +4,18 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { Component,
|
|
7
|
+
import { Component, signal, effect, ViewChild, Input, Output, EventEmitter } from '@angular/core';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
9
|
let InlineCellEditorComponent = class InlineCellEditorComponent {
|
|
10
10
|
constructor() {
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
13
|
-
this.column = input.required();
|
|
14
|
-
this.rowIndex = input.required();
|
|
15
|
-
this.editorType = input.required();
|
|
16
|
-
this.commit = output();
|
|
17
|
-
this.cancel = output();
|
|
18
|
-
this.inputEl = viewChild('inputEl');
|
|
11
|
+
this.commit = new EventEmitter();
|
|
12
|
+
this.cancel = new EventEmitter();
|
|
19
13
|
this.localValue = signal('');
|
|
20
14
|
this.selectOptions = signal([]);
|
|
21
15
|
effect(() => {
|
|
22
|
-
const v = this.value
|
|
16
|
+
const v = this.value;
|
|
23
17
|
this.localValue.set(v != null ? String(v) : '');
|
|
24
|
-
const col = this.column
|
|
18
|
+
const col = this.column;
|
|
25
19
|
if (col.cellEditorParams?.values) {
|
|
26
20
|
this.selectOptions.set(col.cellEditorParams.values);
|
|
27
21
|
}
|
|
@@ -29,7 +23,7 @@ let InlineCellEditorComponent = class InlineCellEditorComponent {
|
|
|
29
23
|
}
|
|
30
24
|
ngAfterViewInit() {
|
|
31
25
|
setTimeout(() => {
|
|
32
|
-
const el = this.inputEl
|
|
26
|
+
const el = this.inputEl?.nativeElement;
|
|
33
27
|
if (el) {
|
|
34
28
|
el.focus();
|
|
35
29
|
if (el instanceof HTMLInputElement && el.type === 'text') {
|
|
@@ -72,20 +66,44 @@ let InlineCellEditorComponent = class InlineCellEditorComponent {
|
|
|
72
66
|
}
|
|
73
67
|
getInputStyle() {
|
|
74
68
|
const baseStyle = 'width:100%;box-sizing:border-box;padding:6px 10px;border:2px solid var(--ogrid-selection, #217346);border-radius:2px;outline:none;font:inherit;background:var(--ogrid-bg, #fff);color:var(--ogrid-fg, #242424);';
|
|
75
|
-
const col = this.column
|
|
69
|
+
const col = this.column;
|
|
76
70
|
if (col.type === 'numeric') {
|
|
77
71
|
return baseStyle + 'text-align:right;';
|
|
78
72
|
}
|
|
79
73
|
return baseStyle;
|
|
80
74
|
}
|
|
81
75
|
};
|
|
76
|
+
__decorate([
|
|
77
|
+
Input({ required: true })
|
|
78
|
+
], InlineCellEditorComponent.prototype, "value", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
Input({ required: true })
|
|
81
|
+
], InlineCellEditorComponent.prototype, "item", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
Input({ required: true })
|
|
84
|
+
], InlineCellEditorComponent.prototype, "column", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
Input({ required: true })
|
|
87
|
+
], InlineCellEditorComponent.prototype, "rowIndex", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
Input({ required: true })
|
|
90
|
+
], InlineCellEditorComponent.prototype, "editorType", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
Output()
|
|
93
|
+
], InlineCellEditorComponent.prototype, "commit", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
Output()
|
|
96
|
+
], InlineCellEditorComponent.prototype, "cancel", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
ViewChild('inputEl')
|
|
99
|
+
], InlineCellEditorComponent.prototype, "inputEl", void 0);
|
|
82
100
|
InlineCellEditorComponent = __decorate([
|
|
83
101
|
Component({
|
|
84
102
|
selector: 'ogrid-primeng-inline-cell-editor',
|
|
85
103
|
standalone: true,
|
|
86
104
|
imports: [CommonModule],
|
|
87
105
|
template: `
|
|
88
|
-
@switch (editorType
|
|
106
|
+
@switch (editorType) {
|
|
89
107
|
@case ('text') {
|
|
90
108
|
<input
|
|
91
109
|
#inputEl
|
|
@@ -4,37 +4,28 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { Component,
|
|
7
|
+
import { Component, ChangeDetectionStrategy, signal, effect, ViewChild, Injector, createComponent, EnvironmentInjector, inject, Input } from '@angular/core';
|
|
8
8
|
/**
|
|
9
9
|
* PopoverCellEditor component for Angular PrimeNG.
|
|
10
10
|
* Renders custom popover editor when anchor element is set.
|
|
11
11
|
*/
|
|
12
12
|
let PopoverCellEditorComponent = class PopoverCellEditorComponent {
|
|
13
13
|
constructor() {
|
|
14
|
-
this.item = input.required();
|
|
15
|
-
this.column = input.required();
|
|
16
|
-
this.rowIndex = input.required();
|
|
17
|
-
this.globalColIndex = input.required();
|
|
18
|
-
this.displayValue = input.required();
|
|
19
|
-
this.editorProps = input.required();
|
|
20
|
-
this.onCancel = input.required();
|
|
21
|
-
this.anchorRef = viewChild('anchorEl');
|
|
22
|
-
this.editorContainerRef = viewChild('editorContainer');
|
|
23
14
|
this.injector = inject(Injector);
|
|
24
15
|
this.envInjector = inject(EnvironmentInjector);
|
|
25
16
|
this.showEditor = signal(false);
|
|
26
17
|
// Show editor after anchor is rendered
|
|
27
18
|
effect(() => {
|
|
28
|
-
const anchor = this.anchorRef
|
|
19
|
+
const anchor = this.anchorRef;
|
|
29
20
|
if (anchor) {
|
|
30
21
|
setTimeout(() => this.showEditor.set(true), 0);
|
|
31
22
|
}
|
|
32
23
|
});
|
|
33
24
|
// Render custom editor component when container is available
|
|
34
25
|
effect(() => {
|
|
35
|
-
const container = this.editorContainerRef
|
|
36
|
-
const props = this.editorProps
|
|
37
|
-
const col = this.column
|
|
26
|
+
const container = this.editorContainerRef;
|
|
27
|
+
const props = this.editorProps;
|
|
28
|
+
const col = this.column;
|
|
38
29
|
if (!container || !this.showEditor() || typeof col.cellEditor !== 'function')
|
|
39
30
|
return;
|
|
40
31
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -54,9 +45,36 @@ let PopoverCellEditorComponent = class PopoverCellEditorComponent {
|
|
|
54
45
|
});
|
|
55
46
|
}
|
|
56
47
|
handleOverlayClick() {
|
|
57
|
-
this.onCancel()
|
|
48
|
+
this.onCancel();
|
|
58
49
|
}
|
|
59
50
|
};
|
|
51
|
+
__decorate([
|
|
52
|
+
Input({ required: true })
|
|
53
|
+
], PopoverCellEditorComponent.prototype, "item", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
Input({ required: true })
|
|
56
|
+
], PopoverCellEditorComponent.prototype, "column", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
Input({ required: true })
|
|
59
|
+
], PopoverCellEditorComponent.prototype, "rowIndex", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
Input({ required: true })
|
|
62
|
+
], PopoverCellEditorComponent.prototype, "globalColIndex", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
Input({ required: true })
|
|
65
|
+
], PopoverCellEditorComponent.prototype, "displayValue", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
Input({ required: true })
|
|
68
|
+
], PopoverCellEditorComponent.prototype, "editorProps", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
Input({ required: true })
|
|
71
|
+
], PopoverCellEditorComponent.prototype, "onCancel", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
ViewChild('anchorEl')
|
|
74
|
+
], PopoverCellEditorComponent.prototype, "anchorRef", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
ViewChild('editorContainer')
|
|
77
|
+
], PopoverCellEditorComponent.prototype, "editorContainerRef", void 0);
|
|
60
78
|
PopoverCellEditorComponent = __decorate([
|
|
61
79
|
Component({
|
|
62
80
|
selector: 'ogrid-primeng-popover-cell-editor',
|
|
@@ -65,10 +83,10 @@ PopoverCellEditorComponent = __decorate([
|
|
|
65
83
|
template: `
|
|
66
84
|
<div #anchorEl
|
|
67
85
|
class="ogrid-popover-anchor"
|
|
68
|
-
[attr.data-row-index]="rowIndex
|
|
69
|
-
[attr.data-col-index]="globalColIndex
|
|
86
|
+
[attr.data-row-index]="rowIndex"
|
|
87
|
+
[attr.data-col-index]="globalColIndex"
|
|
70
88
|
>
|
|
71
|
-
{{ displayValue
|
|
89
|
+
{{ displayValue }}
|
|
72
90
|
</div>
|
|
73
91
|
@if (showEditor()) {
|
|
74
92
|
<div class="ogrid-popover-editor-overlay" (click)="handleOverlayClick()">
|
|
@@ -89,9 +107,10 @@ PopoverCellEditorComponent = __decorate([
|
|
|
89
107
|
display: flex; align-items: center; justify-content: center;
|
|
90
108
|
}
|
|
91
109
|
.ogrid-popover-editor-content {
|
|
92
|
-
background: #
|
|
93
|
-
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
110
|
+
background: var(--ogrid-bg, #ffffff); border-radius: 4px; padding: 16px;
|
|
111
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
94
112
|
max-width: 90vw; max-height: 90vh; overflow: auto;
|
|
113
|
+
color: var(--ogrid-fg, rgba(0, 0, 0, 0.87));
|
|
95
114
|
}
|
|
96
115
|
`],
|
|
97
116
|
})
|
package/dist/esm/index.js
CHANGED
|
@@ -6,6 +6,8 @@ export { DataGridTableComponent } from './datagrid-table/datagrid-table.componen
|
|
|
6
6
|
export { InlineCellEditorComponent } from './datagrid-table/inline-cell-editor.component';
|
|
7
7
|
export { PopoverCellEditorComponent } from './datagrid-table/popover-cell-editor.component';
|
|
8
8
|
export { ColumnHeaderFilterComponent } from './column-header-filter/column-header-filter.component';
|
|
9
|
+
// IColumnHeaderFilterProps is now exported from @alaarab/ogrid-angular (base class)
|
|
9
10
|
export { ColumnChooserComponent } from './column-chooser/column-chooser.component';
|
|
11
|
+
// IColumnChooserProps is now exported from @alaarab/ogrid-angular (base class)
|
|
10
12
|
export { PaginationControlsComponent } from './pagination-controls/pagination-controls.component';
|
|
11
13
|
export { ColumnHeaderMenuComponent } from './column-header-menu/column-header-menu.component';
|
|
@@ -4,37 +4,49 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { Component,
|
|
7
|
+
import { Component, inject, ChangeDetectionStrategy, Input, signal, effect } from '@angular/core';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
9
|
import { OGridService, OGridLayoutComponent, } from '@alaarab/ogrid-angular';
|
|
10
10
|
import { DataGridTableComponent } from '../datagrid-table/datagrid-table.component';
|
|
11
11
|
import { ColumnChooserComponent } from '../column-chooser/column-chooser.component';
|
|
12
12
|
import { PaginationControlsComponent } from '../pagination-controls/pagination-controls.component';
|
|
13
13
|
let OGridComponent = class OGridComponent {
|
|
14
|
+
set props(value) {
|
|
15
|
+
this.propsSignal.set(value);
|
|
16
|
+
}
|
|
14
17
|
constructor() {
|
|
15
18
|
this.service = inject(OGridService);
|
|
16
|
-
this.
|
|
19
|
+
this.propsSignal = signal(undefined);
|
|
17
20
|
// Stable callback references (avoid re-creating every template eval)
|
|
18
|
-
this.onColumnSortFn = (columnKey) => this.service.handleSort(columnKey);
|
|
21
|
+
this.onColumnSortFn = (columnKey, direction) => this.service.handleSort(columnKey, direction);
|
|
19
22
|
this.onColumnResizedFn = (columnId, width) => this.service.handleColumnResized(columnId, width);
|
|
20
23
|
this.onColumnPinnedFn = (columnId, pinned) => this.service.handleColumnPinned(columnId, pinned);
|
|
21
24
|
this.onSelectionChangeFn = (event) => this.service.handleSelectionChange(event);
|
|
22
25
|
this.onFilterChangeFn = (key, value) => this.service.handleFilterChange(key, value);
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
effect(() => {
|
|
27
|
+
const p = this.propsSignal();
|
|
28
|
+
if (p)
|
|
29
|
+
this.service.configure(p);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
get showToolbar() {
|
|
33
|
+
return this.service.columnChooserPlacement() === 'toolbar' || this.service.toolbar() != null;
|
|
34
|
+
}
|
|
35
|
+
get emptyStateObj() {
|
|
36
|
+
return {
|
|
25
37
|
hasActiveFilters: this.service.hasActiveFilters(),
|
|
26
38
|
onClearAll: () => this.service.setFilters({}),
|
|
27
39
|
message: this.service.emptyState()?.message,
|
|
28
40
|
render: this.service.emptyState()?.render,
|
|
29
|
-
}
|
|
30
|
-
effect(() => {
|
|
31
|
-
this.service.configure(this.props());
|
|
32
|
-
});
|
|
41
|
+
};
|
|
33
42
|
}
|
|
34
43
|
onPageSizeChange(size) {
|
|
35
44
|
this.service.setPageSize(size);
|
|
36
45
|
}
|
|
37
46
|
};
|
|
47
|
+
__decorate([
|
|
48
|
+
Input({ required: true })
|
|
49
|
+
], OGridComponent.prototype, "props", null);
|
|
38
50
|
OGridComponent = __decorate([
|
|
39
51
|
Component({
|
|
40
52
|
selector: 'ogrid-primeng',
|
|
@@ -48,10 +60,11 @@ OGridComponent = __decorate([
|
|
|
48
60
|
],
|
|
49
61
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
50
62
|
providers: [OGridService],
|
|
63
|
+
styles: [`:host { display: block; height: 100%; }`],
|
|
51
64
|
template: `
|
|
52
65
|
<ogrid-layout
|
|
53
66
|
[className]="service.className()"
|
|
54
|
-
[hasToolbar]="showToolbar
|
|
67
|
+
[hasToolbar]="showToolbar"
|
|
55
68
|
[hasToolbarBelow]="false"
|
|
56
69
|
[hasPagination]="true"
|
|
57
70
|
[sideBar]="service.sideBarProps()"
|
|
@@ -102,9 +115,10 @@ OGridComponent = __decorate([
|
|
|
102
115
|
[getUserByEmail]="service.dataSource()?.getUserByEmail?.bind(service.dataSource())"
|
|
103
116
|
[layoutMode]="service.layoutMode()"
|
|
104
117
|
[suppressHorizontalScroll]="service.suppressHorizontalScroll()"
|
|
118
|
+
[columnReorder]="service.columnReorder()"
|
|
105
119
|
[aria-label]="service.ariaLabel()"
|
|
106
120
|
[aria-labelledby]="service.ariaLabelledBy()"
|
|
107
|
-
[emptyState]="emptyStateObj
|
|
121
|
+
[emptyState]="emptyStateObj"
|
|
108
122
|
></ogrid-primeng-datagrid-table>
|
|
109
123
|
|
|
110
124
|
<div pagination>
|
|
@@ -4,24 +4,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { Component
|
|
7
|
+
import { Component } from '@angular/core';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
|
-
import {
|
|
10
|
-
let PaginationControlsComponent = class PaginationControlsComponent {
|
|
11
|
-
constructor() {
|
|
12
|
-
this.currentPage = input.required();
|
|
13
|
-
this.pageSize = input.required();
|
|
14
|
-
this.totalCount = input.required();
|
|
15
|
-
this.pageSizeOptions = input(undefined);
|
|
16
|
-
this.entityLabelPlural = input('items');
|
|
17
|
-
this.pageChange = output();
|
|
18
|
-
this.pageSizeChange = output();
|
|
19
|
-
this.labelPlural = computed(() => this.entityLabelPlural() ?? 'items');
|
|
20
|
-
this.vm = computed(() => getPaginationViewModel(this.currentPage(), this.pageSize(), this.totalCount(), this.pageSizeOptions() ? { pageSizeOptions: this.pageSizeOptions() } : undefined));
|
|
21
|
-
}
|
|
22
|
-
onPageSizeChange(value) {
|
|
23
|
-
this.pageSizeChange.emit(Number(value));
|
|
24
|
-
}
|
|
9
|
+
import { BasePaginationControlsComponent } from '@alaarab/ogrid-angular';
|
|
10
|
+
let PaginationControlsComponent = class PaginationControlsComponent extends BasePaginationControlsComponent {
|
|
25
11
|
};
|
|
26
12
|
PaginationControlsComponent = __decorate([
|
|
27
13
|
Component({
|
|
@@ -32,14 +18,14 @@ PaginationControlsComponent = __decorate([
|
|
|
32
18
|
@if (vm()) {
|
|
33
19
|
<div style="display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:13px;color:var(--ogrid-fg, #242424)">
|
|
34
20
|
<div>
|
|
35
|
-
Showing {{ vm()!.startItem }} to {{ vm()!.endItem }} of {{ totalCount
|
|
21
|
+
Showing {{ vm()!.startItem }} to {{ vm()!.endItem }} of {{ totalCount.toLocaleString() }} {{ labelPlural() }}
|
|
36
22
|
</div>
|
|
37
23
|
|
|
38
24
|
<div style="display:flex;align-items:center;gap:4px" role="navigation" aria-label="Pagination">
|
|
39
25
|
<button
|
|
40
26
|
type="button"
|
|
41
27
|
class="p-button p-button-text p-button-sm"
|
|
42
|
-
[disabled]="currentPage
|
|
28
|
+
[disabled]="currentPage === 1"
|
|
43
29
|
(click)="pageChange.emit(1)"
|
|
44
30
|
aria-label="First page"
|
|
45
31
|
style="min-width:32px;padding:4px 8px"
|
|
@@ -47,8 +33,8 @@ PaginationControlsComponent = __decorate([
|
|
|
47
33
|
<button
|
|
48
34
|
type="button"
|
|
49
35
|
class="p-button p-button-text p-button-sm"
|
|
50
|
-
[disabled]="currentPage
|
|
51
|
-
(click)="pageChange.emit(currentPage
|
|
36
|
+
[disabled]="currentPage === 1"
|
|
37
|
+
(click)="pageChange.emit(currentPage - 1)"
|
|
52
38
|
aria-label="Previous page"
|
|
53
39
|
style="min-width:32px;padding:4px 8px"
|
|
54
40
|
>‹</button>
|
|
@@ -68,10 +54,10 @@ PaginationControlsComponent = __decorate([
|
|
|
68
54
|
<button
|
|
69
55
|
type="button"
|
|
70
56
|
class="p-button p-button-sm"
|
|
71
|
-
[class.p-button-outlined]="currentPage
|
|
57
|
+
[class.p-button-outlined]="currentPage !== pageNum"
|
|
72
58
|
(click)="pageChange.emit(pageNum)"
|
|
73
59
|
[attr.aria-label]="'Page ' + pageNum"
|
|
74
|
-
[attr.aria-current]="currentPage
|
|
60
|
+
[attr.aria-current]="currentPage === pageNum ? 'page' : null"
|
|
75
61
|
style="min-width:32px;padding:4px 8px"
|
|
76
62
|
>{{ pageNum }}</button>
|
|
77
63
|
}
|
|
@@ -90,15 +76,15 @@ PaginationControlsComponent = __decorate([
|
|
|
90
76
|
<button
|
|
91
77
|
type="button"
|
|
92
78
|
class="p-button p-button-text p-button-sm"
|
|
93
|
-
[disabled]="currentPage
|
|
94
|
-
(click)="pageChange.emit(currentPage
|
|
79
|
+
[disabled]="currentPage >= vm()!.totalPages"
|
|
80
|
+
(click)="pageChange.emit(currentPage + 1)"
|
|
95
81
|
aria-label="Next page"
|
|
96
82
|
style="min-width:32px;padding:4px 8px"
|
|
97
83
|
>›</button>
|
|
98
84
|
<button
|
|
99
85
|
type="button"
|
|
100
86
|
class="p-button p-button-text p-button-sm"
|
|
101
|
-
[disabled]="currentPage
|
|
87
|
+
[disabled]="currentPage >= vm()!.totalPages"
|
|
102
88
|
(click)="pageChange.emit(vm()!.totalPages)"
|
|
103
89
|
aria-label="Last page"
|
|
104
90
|
style="min-width:32px;padding:4px 8px"
|
|
@@ -108,7 +94,7 @@ PaginationControlsComponent = __decorate([
|
|
|
108
94
|
<div style="display:flex;align-items:center;gap:6px">
|
|
109
95
|
<span style="font-size:12px">Rows</span>
|
|
110
96
|
<select
|
|
111
|
-
[value]="'' + pageSize
|
|
97
|
+
[value]="'' + pageSize"
|
|
112
98
|
(change)="onPageSizeChange($any($event.target).value)"
|
|
113
99
|
aria-label="Rows per page"
|
|
114
100
|
style="padding:4px 6px;border:1px solid var(--ogrid-border, #e0e0e0);border-radius:4px;background:var(--ogrid-bg, #fff);color:var(--ogrid-fg, #242424)"
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
visibleColumns: Set<string>;
|
|
5
|
-
onVisibilityChange: (columnKey: string, visible: boolean) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare class ColumnChooserComponent {
|
|
8
|
-
readonly columns: import("@angular/core").InputSignal<IColumnDefinition[]>;
|
|
9
|
-
readonly visibleColumns: import("@angular/core").InputSignal<Set<string>>;
|
|
10
|
-
readonly visibilityChange: import("@angular/core").OutputEmitterRef<{
|
|
11
|
-
columnKey: string;
|
|
12
|
-
visible: boolean;
|
|
13
|
-
}>;
|
|
14
|
-
readonly open: import("@angular/core").WritableSignal<boolean>;
|
|
15
|
-
protected readonly visibleCount: import("@angular/core").Signal<number>;
|
|
16
|
-
protected readonly totalCount: import("@angular/core").Signal<number>;
|
|
17
|
-
onToggle(columnKey: string, checked: boolean): void;
|
|
18
|
-
onSelectAll(): void;
|
|
19
|
-
onClearAll(): void;
|
|
1
|
+
import { BaseColumnChooserComponent } from '@alaarab/ogrid-angular';
|
|
2
|
+
export declare class ColumnChooserComponent extends BaseColumnChooserComponent {
|
|
3
|
+
get open(): import("@angular/core").WritableSignal<boolean>;
|
|
20
4
|
}
|
|
@@ -1,70 +1,13 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
|
-
import
|
|
3
|
-
export
|
|
4
|
-
columnKey: string;
|
|
5
|
-
columnName: string;
|
|
6
|
-
filterType: ColumnFilterType;
|
|
7
|
-
isSorted?: boolean;
|
|
8
|
-
isSortedDescending?: boolean;
|
|
9
|
-
onSort?: () => void;
|
|
10
|
-
selectedValues?: string[];
|
|
11
|
-
onFilterChange?: (values: string[]) => void;
|
|
12
|
-
options?: string[];
|
|
13
|
-
isLoadingOptions?: boolean;
|
|
14
|
-
textValue?: string;
|
|
15
|
-
onTextChange?: (value: string) => void;
|
|
16
|
-
selectedUser?: UserLike;
|
|
17
|
-
onUserChange?: (user: UserLike | undefined) => void;
|
|
18
|
-
peopleSearch?: (query: string) => Promise<UserLike[]>;
|
|
19
|
-
dateValue?: IDateFilterValue;
|
|
20
|
-
onDateChange?: (value: IDateFilterValue | undefined) => void;
|
|
21
|
-
}
|
|
22
|
-
export declare class ColumnHeaderFilterComponent {
|
|
2
|
+
import { BaseColumnHeaderFilterComponent } from '@alaarab/ogrid-angular';
|
|
3
|
+
export declare class ColumnHeaderFilterComponent extends BaseColumnHeaderFilterComponent {
|
|
23
4
|
private destroyRef;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
readonly isSorted: import("@angular/core").InputSignal<boolean>;
|
|
28
|
-
readonly isSortedDescending: import("@angular/core").InputSignal<boolean>;
|
|
29
|
-
readonly onSort: import("@angular/core").InputSignal<(() => void) | undefined>;
|
|
30
|
-
readonly selectedValues: import("@angular/core").InputSignal<string[] | undefined>;
|
|
31
|
-
readonly onFilterChange: import("@angular/core").InputSignal<((values: string[]) => void) | undefined>;
|
|
32
|
-
readonly options: import("@angular/core").InputSignal<string[]>;
|
|
33
|
-
readonly isLoadingOptions: import("@angular/core").InputSignal<boolean>;
|
|
34
|
-
readonly textValue: import("@angular/core").InputSignal<string>;
|
|
35
|
-
readonly onTextChange: import("@angular/core").InputSignal<((value: string) => void) | undefined>;
|
|
36
|
-
readonly selectedUser: import("@angular/core").InputSignal<UserLike | undefined>;
|
|
37
|
-
readonly onUserChange: import("@angular/core").InputSignal<((user: UserLike | undefined) => void) | undefined>;
|
|
38
|
-
readonly peopleSearch: import("@angular/core").InputSignal<((query: string) => Promise<UserLike[]>) | undefined>;
|
|
39
|
-
readonly dateValue: import("@angular/core").InputSignal<IDateFilterValue | undefined>;
|
|
40
|
-
readonly onDateChange: import("@angular/core").InputSignal<((value: IDateFilterValue | undefined) => void) | undefined>;
|
|
41
|
-
readonly isFilterOpen: import("@angular/core").WritableSignal<boolean>;
|
|
42
|
-
readonly tempTextValue: import("@angular/core").WritableSignal<string>;
|
|
43
|
-
readonly searchText: import("@angular/core").WritableSignal<string>;
|
|
44
|
-
readonly tempSelected: import("@angular/core").WritableSignal<Set<string>>;
|
|
45
|
-
readonly peopleSearchText: import("@angular/core").WritableSignal<string>;
|
|
46
|
-
readonly peopleSuggestions: import("@angular/core").WritableSignal<UserLike[]>;
|
|
47
|
-
readonly isPeopleLoading: import("@angular/core").WritableSignal<boolean>;
|
|
48
|
-
readonly tempDateFrom: import("@angular/core").WritableSignal<string>;
|
|
49
|
-
readonly tempDateTo: import("@angular/core").WritableSignal<string>;
|
|
50
|
-
readonly filterTrigger: import("@angular/core").Signal<ElementRef<HTMLButtonElement> | undefined>;
|
|
51
|
-
readonly filterPanel: import("@angular/core").Signal<ElementRef<HTMLDivElement> | undefined>;
|
|
52
|
-
private peopleDebounceTimer;
|
|
5
|
+
filterTrigger?: ElementRef<HTMLButtonElement>;
|
|
6
|
+
filterPanel?: ElementRef<HTMLDivElement>;
|
|
7
|
+
protected getHeaderEl(): ElementRef<HTMLElement> | undefined;
|
|
53
8
|
private clickOutsideHandler;
|
|
54
|
-
readonly hasActiveFilter: import("@angular/core").Signal<boolean>;
|
|
55
|
-
readonly filteredOptions: import("@angular/core").Signal<string[]>;
|
|
56
9
|
constructor();
|
|
57
10
|
handleSortClick(): void;
|
|
58
11
|
toggleFilter(): void;
|
|
59
|
-
handleTextApply(): void;
|
|
60
|
-
handleTextClear(): void;
|
|
61
|
-
handleCheckboxChange(opt: string, checked: boolean): void;
|
|
62
12
|
handleSelectAllOptions(): void;
|
|
63
|
-
handleClearSelection(): void;
|
|
64
|
-
handleApplyMultiSelect(): void;
|
|
65
|
-
onPeopleSearchInput(value: string): void;
|
|
66
|
-
handleUserSelect(user: UserLike): void;
|
|
67
|
-
handleClearUser(): void;
|
|
68
|
-
handleDateApply(): void;
|
|
69
|
-
handleDateClear(): void;
|
|
70
13
|
}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import type { Menu } from 'primeng/menu';
|
|
2
2
|
import type { MenuItem } from 'primeng/api';
|
|
3
|
+
import { type ColumnHeaderMenuHandlers } from '@alaarab/ogrid-core';
|
|
3
4
|
/**
|
|
4
|
-
* Column header dropdown menu for pin/unpin actions.
|
|
5
|
+
* Column header dropdown menu for pin/unpin, sort, and autosize actions.
|
|
5
6
|
* Uses PrimeNG Menu component.
|
|
6
7
|
*/
|
|
7
8
|
export declare class ColumnHeaderMenuComponent {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
columnId: string;
|
|
10
|
+
canPinLeft: boolean;
|
|
11
|
+
canPinRight: boolean;
|
|
12
|
+
canUnpin: boolean;
|
|
13
|
+
currentSort: 'asc' | 'desc' | null;
|
|
14
|
+
isSortable: boolean;
|
|
15
|
+
isResizable: boolean;
|
|
16
|
+
handlers: Partial<ColumnHeaderMenuHandlers>;
|
|
17
|
+
menuRef?: Menu;
|
|
16
18
|
readonly menuModel: import("@angular/core").Signal<MenuItem[]>;
|
|
17
|
-
handlePinLeft(): void;
|
|
18
|
-
handlePinRight(): void;
|
|
19
|
-
handleUnpin(): void;
|
|
20
19
|
}
|