ngssm-ag-grid 19.2.0 → 19.2.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/fesm2022/ngssm-ag-grid.mjs +266 -72
- package/fesm2022/ngssm-ag-grid.mjs.map +1 -1
- package/lib/components/action-confirmation-popup/action-confirmation-popup-parameter.d.ts +36 -0
- package/lib/components/action-confirmation-popup/action-confirmation-popup.component.d.ts +97 -0
- package/lib/components/action-confirmation-popup/index.d.ts +2 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/ngssm-actions-cell-renderer/action-config.d.ts +82 -4
- package/lib/components/ngssm-actions-cell-renderer/ngssm-actions-cell-renderer.component.d.ts +89 -10
- package/package.json +1 -1
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { __decorate } from 'tslib';
|
|
2
2
|
import update from 'immutability-helper';
|
|
3
|
-
import * as i1 from 'ngssm-store';
|
|
4
|
-
import { NgSsmFeatureState,
|
|
3
|
+
import * as i1$1 from 'ngssm-store';
|
|
4
|
+
import { NgSsmFeatureState, Logger, NgSsmComponent, provideReducers, provideEffect } from 'ngssm-store';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { ChangeDetectionStrategy, Component, InjectionToken, HostBinding, Inject, Optional, Directive,
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import * as i1$1 from 'ag-grid-angular';
|
|
6
|
+
import { inject, EnvironmentInjector, signal, runInInjectionContext, isSignal, ChangeDetectionStrategy, Component, InjectionToken, HostBinding, Inject, Optional, Directive, Input, Injectable, makeEnvironmentProviders } from '@angular/core';
|
|
7
|
+
import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay';
|
|
8
|
+
import { MatIcon } from '@angular/material/icon';
|
|
9
|
+
import { MatTooltip } from '@angular/material/tooltip';
|
|
10
|
+
import { MatIconButton, MatButton } from '@angular/material/button';
|
|
11
|
+
import { isObservable, Subject, BehaviorSubject, take, combineLatest, map, takeUntil } from 'rxjs';
|
|
12
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
13
|
+
import { NgssmComponentDisplayDirective } from 'ngssm-toolkit';
|
|
14
|
+
import * as i1 from 'ag-grid-angular';
|
|
15
|
+
import { MatCard, MatCardHeader, MatCardTitle, MatCardActions } from '@angular/material/card';
|
|
17
16
|
|
|
18
17
|
var AgGridActionType;
|
|
19
18
|
(function (AgGridActionType) {
|
|
@@ -72,14 +71,88 @@ var ChangeOrigin;
|
|
|
72
71
|
ChangeOrigin["other"] = "other";
|
|
73
72
|
})(ChangeOrigin || (ChangeOrigin = {}));
|
|
74
73
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
/**
|
|
75
|
+
* The `NgssmActionsCellRendererComponent` is a custom cell renderer for `ag-grid` that dynamically renders
|
|
76
|
+
* action buttons within a grid cell. It provides flexibility in configuring button behavior, visibility, and state.
|
|
77
|
+
*
|
|
78
|
+
* ### Features:
|
|
79
|
+
* - Dynamically generates action buttons based on the provided configuration.
|
|
80
|
+
* - Supports reactive state management using Angular signals.
|
|
81
|
+
* - Integrates with observables, functions, or signals for `isDisabled` and `isHidden` properties.
|
|
82
|
+
* - Provides customizable tooltips and button styles.
|
|
83
|
+
* - Executes custom actions when buttons are clicked.
|
|
84
|
+
*
|
|
85
|
+
* ### Usage:
|
|
86
|
+
* To use this component, provide it as a cell renderer in your `ag-grid` column definition:
|
|
87
|
+
*
|
|
88
|
+
* ```typescript
|
|
89
|
+
* columnDefs: [
|
|
90
|
+
* {
|
|
91
|
+
* headerName: 'Actions',
|
|
92
|
+
* field: 'actions',
|
|
93
|
+
* cellRenderer: NgssmActionsCellRendererComponent,
|
|
94
|
+
* cellRendererParams: {
|
|
95
|
+
* actions: [
|
|
96
|
+
* {
|
|
97
|
+
* cssClass: 'delete-button',
|
|
98
|
+
* color: 'warn',
|
|
99
|
+
* tooltip: 'Delete Item',
|
|
100
|
+
* isDisabled: (params) => params.data.isLocked,
|
|
101
|
+
* isHidden: (params) => !params.data.canDelete,
|
|
102
|
+
* click: (params) => console.log('Delete action clicked', params)
|
|
103
|
+
* }
|
|
104
|
+
* ]
|
|
105
|
+
* }
|
|
106
|
+
* }
|
|
107
|
+
* ];
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* ### Inputs:
|
|
111
|
+
* - `NgssmActionsCellRendererParams`: Configuration object passed to the component via `cellRendererParams`.
|
|
112
|
+
* - `actions`: Array of `ActionConfig` objects defining the buttons to render.
|
|
113
|
+
*
|
|
114
|
+
* ### Outputs:
|
|
115
|
+
* None.
|
|
116
|
+
*
|
|
117
|
+
* ### Dependencies:
|
|
118
|
+
* - Angular Material components: `MatIconButton`, `MatIcon`, `MatTooltip`.
|
|
119
|
+
* - `ag-grid-angular` for integration with `ag-grid`.
|
|
120
|
+
*
|
|
121
|
+
* ### Example ActionConfig:
|
|
122
|
+
* ```typescript
|
|
123
|
+
* interface ActionConfig {
|
|
124
|
+
* cssClass: string; // CSS class for the button.
|
|
125
|
+
* color?: string; // Button color (e.g., 'primary', 'warn').
|
|
126
|
+
* tooltip?: string; // Tooltip text for the button.
|
|
127
|
+
* isDisabled?: boolean | Signal<boolean> | Observable<boolean> | ((params: ICellRendererParams) => boolean);
|
|
128
|
+
* isHidden?: boolean | Signal<boolean> | Observable<boolean> | ((params: ICellRendererParams) => boolean);
|
|
129
|
+
* click?: (params: ICellRendererParams) => void; // Action to execute on button click.
|
|
130
|
+
* }
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* ### Methods:
|
|
134
|
+
* - `agInit(params: ICellRendererParams)`: Initializes the component with the provided cell renderer parameters.
|
|
135
|
+
* - `refresh(params: ICellRendererParams)`: Refreshes the component state when the grid updates.
|
|
136
|
+
* - `executeAction(action: ActionButton)`: Executes the action associated with a button.
|
|
137
|
+
*
|
|
138
|
+
* ### Internal Logic:
|
|
139
|
+
* - The `setupActions` method initializes the action buttons based on the provided configuration.
|
|
140
|
+
* - The `setUpActionSignal` method handles the initialization of `isDisabled` and `isHidden` states for each button.
|
|
141
|
+
* - The component uses Angular signals (`WritableSignal` and `Signal`) to manage the state of `isDisabled` and `isHidden`.
|
|
142
|
+
* - Observables are converted to signals using `toSignal` for seamless integration with Angular's reactivity system.
|
|
143
|
+
*
|
|
144
|
+
* ### Change Detection:
|
|
145
|
+
* - The component uses `ChangeDetectionStrategy.OnPush` for improved performance by minimizing unnecessary change detection cycles.
|
|
146
|
+
*
|
|
147
|
+
* ### Notes:
|
|
148
|
+
* - Ensure that the `actions` array in `NgssmActionsCellRendererParams` is properly configured to avoid runtime errors.
|
|
149
|
+
* - The component is designed to work with Angular Material and requires the relevant modules to be imported in your application.
|
|
150
|
+
* - The `isDisabled` and `isHidden` properties can accept multiple input types (boolean, function, signal, or observable), providing flexibility in defining button behavior.
|
|
151
|
+
*/
|
|
152
|
+
class NgssmActionsCellRendererComponent {
|
|
153
|
+
constructor() {
|
|
154
|
+
this.environmentInjector = inject(EnvironmentInjector);
|
|
155
|
+
this.actionButtons = signal([]);
|
|
83
156
|
}
|
|
84
157
|
agInit(params) {
|
|
85
158
|
this.cellParams = params;
|
|
@@ -87,12 +160,12 @@ class NgssmActionsCellRendererComponent extends NgSsmComponent {
|
|
|
87
160
|
}
|
|
88
161
|
refresh(params) {
|
|
89
162
|
this.cellParams = params;
|
|
90
|
-
this.
|
|
163
|
+
this.actionButtons().forEach((a) => {
|
|
91
164
|
if (a.actionConfig.isDisabled instanceof Function) {
|
|
92
|
-
a.
|
|
165
|
+
a.isDisabled.set(a.actionConfig.isDisabled(params));
|
|
93
166
|
}
|
|
94
167
|
if (a.actionConfig.isHidden instanceof Function) {
|
|
95
|
-
a.
|
|
168
|
+
a.isHidden.set(a.actionConfig.isHidden(params));
|
|
96
169
|
}
|
|
97
170
|
});
|
|
98
171
|
return true;
|
|
@@ -100,42 +173,53 @@ class NgssmActionsCellRendererComponent extends NgSsmComponent {
|
|
|
100
173
|
executeAction(action) {
|
|
101
174
|
const params = this.cellParams;
|
|
102
175
|
if (params) {
|
|
103
|
-
|
|
176
|
+
action.actionConfig.click?.(params);
|
|
104
177
|
}
|
|
105
178
|
}
|
|
106
179
|
setupActions(rendererParams) {
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
actionButton
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
a.isHidden.pipe(takeUntil(this.unsubscribeAll$)).subscribe((v) => actionButton.hidden$.next(v));
|
|
127
|
-
}
|
|
128
|
-
return actionButton;
|
|
180
|
+
runInInjectionContext(this.environmentInjector, () => {
|
|
181
|
+
const actionButtons = (rendererParams?.actions ?? []).map((a) => {
|
|
182
|
+
const actionButton = {
|
|
183
|
+
cssClass: a.cssClass,
|
|
184
|
+
color: a.color ?? 'primary',
|
|
185
|
+
isDisabled: signal(false),
|
|
186
|
+
isHidden: signal(false),
|
|
187
|
+
actionConfig: a,
|
|
188
|
+
tooltip: a.tooltip ?? '',
|
|
189
|
+
popupRendered: signal(false)
|
|
190
|
+
};
|
|
191
|
+
if (a.popupComponent) {
|
|
192
|
+
actionButton.popupAction = ((component) => this.setupPopupComponent(component, actionButton));
|
|
193
|
+
}
|
|
194
|
+
this.setUpActionSignal(actionButton, a, rendererParams, 'isDisabled');
|
|
195
|
+
this.setUpActionSignal(actionButton, a, rendererParams, 'isHidden');
|
|
196
|
+
return actionButton;
|
|
197
|
+
});
|
|
198
|
+
this.actionButtons.set(actionButtons);
|
|
129
199
|
});
|
|
130
|
-
this._actionButtons$.next(actionButtons);
|
|
131
200
|
}
|
|
132
|
-
|
|
133
|
-
|
|
201
|
+
setUpActionSignal(actionButton, config, rendererParams, signalName) {
|
|
202
|
+
const input = config[signalName];
|
|
203
|
+
if (isSignal(input)) {
|
|
204
|
+
actionButton[signalName] = input;
|
|
205
|
+
}
|
|
206
|
+
else if (input instanceof Function) {
|
|
207
|
+
actionButton[signalName].set(input(rendererParams));
|
|
208
|
+
}
|
|
209
|
+
else if (isObservable(input)) {
|
|
210
|
+
actionButton[signalName] = toSignal(input, { initialValue: false });
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
setupPopupComponent(component, action) {
|
|
214
|
+
component?.init?.(action.popupRendered, this.cellParams, action.actionConfig.popupParameter);
|
|
215
|
+
}
|
|
216
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgssmActionsCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
217
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.4", type: NgssmActionsCellRendererComponent, isStandalone: true, selector: "ngssm-actions-cell-renderer", ngImport: i0, template: "<div class=\"ngssm-actions-cell\">\n @for (actionButton of actionButtons(); track actionButton; let idx = $index) {\n @if (!actionButton.isHidden()) {\n @if (actionButton.actionConfig.popupComponent) {\n <button\n mat-icon-button\n class=\"ngssm-actions-cell-button\"\n [color]=\"actionButton.color\"\n id=\"action_{{ idx }}\"\n [disabled]=\"actionButton.isDisabled()\"\n [matTooltip]=\"actionButton.tooltip\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n (click)=\"actionButton.popupRendered.set(true)\">\n <mat-icon [class]=\"actionButton.cssClass\"></mat-icon>\n </button>\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"actionButton.popupRendered()\">\n <div [ngssmComponentDisplay]=\"actionButton.actionConfig.popupComponent\" [ngssmComponentAction]=\"actionButton.popupAction\"></div>\n </ng-template>\n } @else {\n <button\n mat-icon-button\n class=\"ngssm-actions-cell-button\"\n [color]=\"actionButton.color\"\n id=\"action_{{ idx }}\"\n [disabled]=\"actionButton.isDisabled()\"\n (click)=\"executeAction(actionButton)\"\n [matTooltip]=\"actionButton.tooltip\">\n <mat-icon [class]=\"actionButton.cssClass\"></mat-icon>\n </button>\n }\n }\n }\n</div>\n", dependencies: [{ kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: NgssmComponentDisplayDirective, selector: "[ngssmComponentDisplay]", inputs: ["ngssmComponentDisplay", "ngssmComponentAction"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
134
218
|
}
|
|
135
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgssmActionsCellRendererComponent, decorators: [{
|
|
136
220
|
type: Component,
|
|
137
|
-
args: [{ selector: 'ngssm-actions-cell-renderer', imports: [
|
|
138
|
-
}]
|
|
221
|
+
args: [{ selector: 'ngssm-actions-cell-renderer', imports: [MatIconButton, MatIcon, MatTooltip, CdkOverlayOrigin, CdkConnectedOverlay, NgssmComponentDisplayDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ngssm-actions-cell\">\n @for (actionButton of actionButtons(); track actionButton; let idx = $index) {\n @if (!actionButton.isHidden()) {\n @if (actionButton.actionConfig.popupComponent) {\n <button\n mat-icon-button\n class=\"ngssm-actions-cell-button\"\n [color]=\"actionButton.color\"\n id=\"action_{{ idx }}\"\n [disabled]=\"actionButton.isDisabled()\"\n [matTooltip]=\"actionButton.tooltip\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n (click)=\"actionButton.popupRendered.set(true)\">\n <mat-icon [class]=\"actionButton.cssClass\"></mat-icon>\n </button>\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"actionButton.popupRendered()\">\n <div [ngssmComponentDisplay]=\"actionButton.actionConfig.popupComponent\" [ngssmComponentAction]=\"actionButton.popupAction\"></div>\n </ng-template>\n } @else {\n <button\n mat-icon-button\n class=\"ngssm-actions-cell-button\"\n [color]=\"actionButton.color\"\n id=\"action_{{ idx }}\"\n [disabled]=\"actionButton.isDisabled()\"\n (click)=\"executeAction(actionButton)\"\n [matTooltip]=\"actionButton.tooltip\">\n <mat-icon [class]=\"actionButton.cssClass\"></mat-icon>\n </button>\n }\n }\n }\n</div>\n" }]
|
|
222
|
+
}] });
|
|
139
223
|
|
|
140
224
|
const getNgssmActionsCellColDef = (params) => ({
|
|
141
225
|
cellRenderer: NgssmActionsCellRendererComponent,
|
|
@@ -163,10 +247,10 @@ class NgssmAgGridThemeDirective {
|
|
|
163
247
|
this.agGridAngular.defaultColDef = options?.defaultColDef;
|
|
164
248
|
}
|
|
165
249
|
}
|
|
166
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
167
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
250
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgssmAgGridThemeDirective, deps: [{ token: NGSSM_AG_GRID_OPTIONS, optional: true }, { token: i1.AgGridAngular }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
251
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.4", type: NgssmAgGridThemeDirective, isStandalone: true, selector: "[ngssmAgGridTheme]", host: { properties: { "class": "this.className" } }, ngImport: i0 }); }
|
|
168
252
|
}
|
|
169
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
253
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgssmAgGridThemeDirective, decorators: [{
|
|
170
254
|
type: Directive,
|
|
171
255
|
args: [{
|
|
172
256
|
selector: '[ngssmAgGridTheme]',
|
|
@@ -177,7 +261,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImpor
|
|
|
177
261
|
args: [NGSSM_AG_GRID_OPTIONS]
|
|
178
262
|
}, {
|
|
179
263
|
type: Optional
|
|
180
|
-
}] }, { type: i1
|
|
264
|
+
}] }, { type: i1.AgGridAngular }], propDecorators: { className: [{
|
|
181
265
|
type: HostBinding,
|
|
182
266
|
args: ['class']
|
|
183
267
|
}] } });
|
|
@@ -316,16 +400,16 @@ class NgssmAgGridDirective {
|
|
|
316
400
|
}
|
|
317
401
|
return menuItems;
|
|
318
402
|
}
|
|
319
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
320
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
403
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgssmAgGridDirective, deps: [{ token: i1$1.Store }, { token: i1.AgGridAngular }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
404
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.4", type: NgssmAgGridDirective, isStandalone: true, selector: "[ngssmAgGrid]", inputs: { config: ["ngssmAgGrid", "config"] }, ngImport: i0 }); }
|
|
321
405
|
}
|
|
322
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
406
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgssmAgGridDirective, decorators: [{
|
|
323
407
|
type: Directive,
|
|
324
408
|
args: [{
|
|
325
409
|
selector: '[ngssmAgGrid]',
|
|
326
410
|
standalone: true
|
|
327
411
|
}]
|
|
328
|
-
}], ctorParameters: () => [{ type: i1.Store }, { type: i1
|
|
412
|
+
}], ctorParameters: () => [{ type: i1$1.Store }, { type: i1.AgGridAngular }], propDecorators: { config: [{
|
|
329
413
|
type: Input,
|
|
330
414
|
args: ['ngssmAgGrid']
|
|
331
415
|
}] } });
|
|
@@ -354,6 +438,116 @@ class NgssmBaseCellEditor extends NgSsmComponent {
|
|
|
354
438
|
}
|
|
355
439
|
}
|
|
356
440
|
|
|
441
|
+
/**
|
|
442
|
+
* The `ActionConfirmationPopupComponent` is a reusable confirmation popup component designed to work with `ag-grid`.
|
|
443
|
+
* It provides a customizable confirmation dialog for user actions, allowing developers to define messages, button labels,
|
|
444
|
+
* and actions dynamically.
|
|
445
|
+
*
|
|
446
|
+
* ### Features:
|
|
447
|
+
* - Displays a confirmation popup with customizable message, button labels, and color.
|
|
448
|
+
* - Integrates with the `ActionPopupComponent` interface for seamless use with `NgssmActionsCellRendererComponent`.
|
|
449
|
+
* - Uses Angular signals for efficient state management.
|
|
450
|
+
* - Supports dynamic initialization with parameters provided by `ag-grid`.
|
|
451
|
+
* - Provides methods to handle user actions (confirm or cancel) and close the popup.
|
|
452
|
+
*
|
|
453
|
+
* ### Usage:
|
|
454
|
+
* This component is typically used as a popup in conjunction with the `NgssmActionsCellRendererComponent`.
|
|
455
|
+
* To configure it, pass an `ActionConfirmationPopupParameter` object when initializing the popup.
|
|
456
|
+
*
|
|
457
|
+
* Example:
|
|
458
|
+
* ```typescript
|
|
459
|
+
* const popupParameter: ActionConfirmationPopupParameter = {
|
|
460
|
+
* messageBuilder: (params) => `Are you sure you want to delete ${params.data.name}?`,
|
|
461
|
+
* color: 'warn',
|
|
462
|
+
* cancelButtonLabel: 'No',
|
|
463
|
+
* confirmButtonLabel: 'Yes',
|
|
464
|
+
* confirmAction: (params) => console.log('Confirmed action for:', params.data)
|
|
465
|
+
* };
|
|
466
|
+
* ```
|
|
467
|
+
*
|
|
468
|
+
* ### Inputs:
|
|
469
|
+
* - `popupRendered`: A writable signal indicating whether the popup is currently rendered.
|
|
470
|
+
* - `params`: The cell renderer parameters provided by `ag-grid`.
|
|
471
|
+
* - `popupParameter`: An object of type `ActionConfirmationPopupParameter` that defines the popup's behavior and content.
|
|
472
|
+
*
|
|
473
|
+
* ### Outputs:
|
|
474
|
+
* None.
|
|
475
|
+
*
|
|
476
|
+
* ### Dependencies:
|
|
477
|
+
* - Angular Material components: `MatCard`, `MatButton`.
|
|
478
|
+
* - `ag-grid-community` for integration with `ag-grid`.
|
|
479
|
+
*
|
|
480
|
+
* ### Methods:
|
|
481
|
+
* - `init(popupRendered, params, popupParameter)`: Initializes the popup with the provided parameters.
|
|
482
|
+
* - `popupRendered`: A writable signal to track the popup's visibility.
|
|
483
|
+
* - `params`: The cell renderer parameters from `ag-grid`.
|
|
484
|
+
* - `popupParameter`: The configuration object for the popup.
|
|
485
|
+
*
|
|
486
|
+
* - `closePopup()`: Closes the popup by setting the `isOpen` signal to `false`.
|
|
487
|
+
*
|
|
488
|
+
* - `executeAction()`: Executes the confirmation action defined in the `popupParameter` and closes the popup.
|
|
489
|
+
*
|
|
490
|
+
* ### Signals:
|
|
491
|
+
* - `message`: The message displayed in the popup.
|
|
492
|
+
* - `cancelButtonLabel`: The label for the cancel button.
|
|
493
|
+
* - `confirmButtonLabel`: The label for the confirm button.
|
|
494
|
+
* - `color`: The color theme for the confirm button (e.g., 'primary', 'warn').
|
|
495
|
+
* - `isOpen`: Tracks whether the popup is currently open.
|
|
496
|
+
*
|
|
497
|
+
* ### Example Initialization:
|
|
498
|
+
* ```typescript
|
|
499
|
+
* const popup = new ActionConfirmationPopupComponent();
|
|
500
|
+
* popup.init(
|
|
501
|
+
* popupRenderedSignal,
|
|
502
|
+
* cellRendererParams,
|
|
503
|
+
* {
|
|
504
|
+
* messageBuilder: (params) => `Are you sure you want to delete ${params.data.name}?`,
|
|
505
|
+
* color: 'warn',
|
|
506
|
+
* cancelButtonLabel: 'No',
|
|
507
|
+
* confirmButtonLabel: 'Yes',
|
|
508
|
+
* confirmAction: (params) => console.log('Confirmed action for:', params.data)
|
|
509
|
+
* }
|
|
510
|
+
* );
|
|
511
|
+
* ```
|
|
512
|
+
*
|
|
513
|
+
* ### Notes:
|
|
514
|
+
* - Ensure that the `popupParameter` object is properly configured to avoid runtime errors.
|
|
515
|
+
* - The `messageBuilder` function in `popupParameter` allows dynamic message generation based on the `params` object.
|
|
516
|
+
* - The component uses `ChangeDetectionStrategy.OnPush` for performance optimization.
|
|
517
|
+
* - The `isOpen` signal can be used to programmatically control the popup's visibility.
|
|
518
|
+
*/
|
|
519
|
+
class ActionConfirmationPopupComponent {
|
|
520
|
+
constructor() {
|
|
521
|
+
this.message = signal('No message');
|
|
522
|
+
this.cancelButtonLabel = signal('No');
|
|
523
|
+
this.confirmButtonLabel = signal('Yes');
|
|
524
|
+
this.color = signal('primary');
|
|
525
|
+
this.isOpen = signal(false);
|
|
526
|
+
}
|
|
527
|
+
init(popupRendered, params, popupParameter) {
|
|
528
|
+
this.params = params;
|
|
529
|
+
this.popupParameter = popupParameter;
|
|
530
|
+
this.message.set(popupParameter?.messageBuilder?.(params) ?? 'No message');
|
|
531
|
+
this.color.set(popupParameter?.color ?? 'primary');
|
|
532
|
+
this.cancelButtonLabel.set(popupParameter?.cancelButtonLabel ?? 'Cancel');
|
|
533
|
+
this.confirmButtonLabel.set(popupParameter?.confirmButtonLabel ?? 'Confirm');
|
|
534
|
+
this.isOpen = popupRendered;
|
|
535
|
+
}
|
|
536
|
+
closePopup() {
|
|
537
|
+
this.isOpen.set(false);
|
|
538
|
+
}
|
|
539
|
+
executeAction() {
|
|
540
|
+
this.popupParameter?.confirmAction?.(this.params);
|
|
541
|
+
this.closePopup();
|
|
542
|
+
}
|
|
543
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: ActionConfirmationPopupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
544
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.4", type: ActionConfirmationPopupComponent, isStandalone: true, selector: "ngssm-action-confirmation-popup", ngImport: i0, template: "<mat-card class=\"fxFlex flex-column-stretch\">\n <mat-card-header>\n <mat-card-title>{{ message() }}</mat-card-title>\n </mat-card-header>\n <mat-card-actions class=\"flex-row-center\">\n <span class=\"fxFlex\"></span>\n <button mat-button (click)=\"closePopup()\">{{ cancelButtonLabel() }}</button>\n <button mat-raised-button [color]=\"color()\" (click)=\"executeAction()\">{{ confirmButtonLabel() }}</button>\n </mat-card-actions>\n</mat-card>\n", dependencies: [{ kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "directive", type: MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
545
|
+
}
|
|
546
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: ActionConfirmationPopupComponent, decorators: [{
|
|
547
|
+
type: Component,
|
|
548
|
+
args: [{ selector: 'ngssm-action-confirmation-popup', imports: [MatCard, MatCardHeader, MatCardTitle, MatCardActions, MatButton], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-card class=\"fxFlex flex-column-stretch\">\n <mat-card-header>\n <mat-card-title>{{ message() }}</mat-card-title>\n </mat-card-header>\n <mat-card-actions class=\"flex-row-center\">\n <span class=\"fxFlex\"></span>\n <button mat-button (click)=\"closePopup()\">{{ cancelButtonLabel() }}</button>\n <button mat-raised-button [color]=\"color()\" (click)=\"executeAction()\">{{ confirmButtonLabel() }}</button>\n </mat-card-actions>\n</mat-card>\n" }]
|
|
549
|
+
}] });
|
|
550
|
+
|
|
357
551
|
const getColDefWithNoPadding = () => ({
|
|
358
552
|
cellClass: ['cell-with-no-padding']
|
|
359
553
|
});
|
|
@@ -402,12 +596,12 @@ class LocalStorageEffect {
|
|
|
402
596
|
getColumnsStateLocalStorageKey(gridId) {
|
|
403
597
|
return `ngssm-ag-grid_${gridId}`;
|
|
404
598
|
}
|
|
405
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
406
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
599
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: LocalStorageEffect, deps: [{ token: i1$1.Logger }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
600
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: LocalStorageEffect }); }
|
|
407
601
|
}
|
|
408
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
602
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: LocalStorageEffect, decorators: [{
|
|
409
603
|
type: Injectable
|
|
410
|
-
}], ctorParameters: () => [{ type: i1.Logger }] });
|
|
604
|
+
}], ctorParameters: () => [{ type: i1$1.Logger }] });
|
|
411
605
|
|
|
412
606
|
class GridStatesReducer {
|
|
413
607
|
constructor() {
|
|
@@ -431,10 +625,10 @@ class GridStatesReducer {
|
|
|
431
625
|
}
|
|
432
626
|
return state;
|
|
433
627
|
}
|
|
434
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
435
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
628
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GridStatesReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
629
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GridStatesReducer }); }
|
|
436
630
|
}
|
|
437
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GridStatesReducer, decorators: [{
|
|
438
632
|
type: Injectable
|
|
439
633
|
}] });
|
|
440
634
|
|
|
@@ -460,10 +654,10 @@ class SelectedRowsReducer {
|
|
|
460
654
|
}
|
|
461
655
|
return state;
|
|
462
656
|
}
|
|
463
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
464
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
657
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: SelectedRowsReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
658
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: SelectedRowsReducer }); }
|
|
465
659
|
}
|
|
466
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
660
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: SelectedRowsReducer, decorators: [{
|
|
467
661
|
type: Injectable
|
|
468
662
|
}] });
|
|
469
663
|
|
|
@@ -479,5 +673,5 @@ const provideNgssmAgGrid = () => {
|
|
|
479
673
|
* Generated bundle index. Do not edit.
|
|
480
674
|
*/
|
|
481
675
|
|
|
482
|
-
export { AgGridAction, AgGridActionType, AgGridStateSpecification, ChangeOrigin, NGSSM_AG_GRID_OPTIONS, NgssmActionsCellRendererComponent, NgssmAgGridDirective, NgssmAgGridOptions, NgssmAgGridThemeDirective, NgssmBaseCellEditor, RegisterAgGridStateAction, RegisterSelectedRowsAction, getColDefForEditableColumn, getColDefWithNoPadding, getNgssmActionsCellColDef, provideNgssmAgGrid, selectAgGridState, updateAgGridState };
|
|
676
|
+
export { ActionConfirmationPopupComponent, AgGridAction, AgGridActionType, AgGridStateSpecification, ChangeOrigin, NGSSM_AG_GRID_OPTIONS, NgssmActionsCellRendererComponent, NgssmAgGridDirective, NgssmAgGridOptions, NgssmAgGridThemeDirective, NgssmBaseCellEditor, RegisterAgGridStateAction, RegisterSelectedRowsAction, getColDefForEditableColumn, getColDefWithNoPadding, getNgssmActionsCellColDef, provideNgssmAgGrid, selectAgGridState, updateAgGridState };
|
|
483
677
|
//# sourceMappingURL=ngssm-ag-grid.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngssm-ag-grid.mjs","sources":["../../../projects/ngssm-ag-grid/src/lib/actions/ag-grid-action-type.ts","../../../projects/ngssm-ag-grid/src/lib/actions/register-ag-grid-state.action.ts","../../../projects/ngssm-ag-grid/src/lib/actions/register-selected-rows.action.ts","../../../projects/ngssm-ag-grid/src/lib/actions/ag-grid.action.ts","../../../projects/ngssm-ag-grid/src/lib/state/ag-grid.state.ts","../../../projects/ngssm-ag-grid/src/lib/state/change-origin.ts","../../../projects/ngssm-ag-grid/src/lib/components/ngssm-actions-cell-renderer/ngssm-actions-cell-renderer.component.ts","../../../projects/ngssm-ag-grid/src/lib/components/ngssm-actions-cell-renderer/ngssm-actions-cell-renderer.component.html","../../../projects/ngssm-ag-grid/src/lib/components/ngssm-actions-cell-renderer/ngssm-actions-cell-renderer-params.ts","../../../projects/ngssm-ag-grid/src/lib/ngssm-ag-grid-options.ts","../../../projects/ngssm-ag-grid/src/lib/components/ngssm-ag-grid-theme.directive.ts","../../../projects/ngssm-ag-grid/src/lib/components/ngssm-ag-grid.directive.ts","../../../projects/ngssm-ag-grid/src/lib/components/ngssm-base-cell-editor.ts","../../../projects/ngssm-ag-grid/src/lib/helpers.ts","../../../projects/ngssm-ag-grid/src/lib/effects/local-storage.effect.ts","../../../projects/ngssm-ag-grid/src/lib/reducers/grid-states.reducer.ts","../../../projects/ngssm-ag-grid/src/lib/reducers/selected-rows.reducer.ts","../../../projects/ngssm-ag-grid/src/lib/provide-ngssm-ag-grid.ts","../../../projects/ngssm-ag-grid/src/public-api.ts","../../../projects/ngssm-ag-grid/src/ngssm-ag-grid.ts"],"sourcesContent":["export enum AgGridActionType {\n registerAgGridState = '[AgGridActionType] registerAgGridState',\n registerSelectedRows = '[AgGridActionType] registerSelectedRows',\n saveColumnsStateOnDisk = '[AgGridActionType] saveColumnsStateOnDisk',\n resetColumnsStateFromDisk = '[AgGridActionType] resetColumnsStateFromDisk'\n}\n","import { ColumnState } from 'ag-grid-community';\n\nimport { Action } from 'ngssm-store';\n\nimport { ChangeOrigin } from '../state';\nimport { AgGridActionType } from './ag-grid-action-type';\n\nexport class RegisterAgGridStateAction implements Action {\n public readonly type: string = AgGridActionType.registerAgGridState;\n\n constructor(\n public readonly gridId: string,\n public readonly origin: ChangeOrigin,\n public readonly columnStates: ColumnState[]\n ) {}\n}\n","import { Action } from 'ngssm-store';\nimport { ChangeOrigin } from '../state';\nimport { AgGridActionType } from './ag-grid-action-type';\n\nexport class RegisterSelectedRowsAction implements Action {\n public readonly type: string = AgGridActionType.registerSelectedRows;\n\n constructor(\n public readonly gridId: string,\n public readonly origin: ChangeOrigin,\n public readonly ids: string[]\n ) {}\n}\n","import { Action } from 'ngssm-store';\n\nexport class AgGridAction implements Action {\n constructor(\n public readonly type: string,\n public readonly gridId: string\n ) {}\n}\n","import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\nimport { GridState } from './grid-state';\nimport { SelectedRows } from './selected-rows';\n\nexport const selectAgGridState = (state: State): AgGridState => state[AgGridStateSpecification.featureStateKey] as AgGridState;\n\nexport const updateAgGridState = (state: State, command: Spec<AgGridState, never>): State =>\n update(state, {\n [AgGridStateSpecification.featureStateKey]: command\n });\n\nexport interface AgGridState {\n gridStates: Record<string, GridState>;\n selectedRows: Record<string, SelectedRows>;\n}\n\n@NgSsmFeatureState({\n featureStateKey: AgGridStateSpecification.featureStateKey,\n initialState: AgGridStateSpecification.initialState\n})\nexport class AgGridStateSpecification {\n public static readonly featureStateKey = 'ag-grid-state';\n public static readonly initialState: AgGridState = {\n gridStates: {},\n selectedRows: {}\n };\n}\n","export enum ChangeOrigin {\n agGrid = 'agGrid',\n other = 'other'\n}\n","import { Component, ChangeDetectionStrategy, NgZone } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { BehaviorSubject, isObservable, Observable, takeUntil } from 'rxjs';\n\nimport { ICellRendererAngularComp } from 'ag-grid-angular';\nimport { ICellRendererParams } from 'ag-grid-community';\n\nimport { NgSsmComponent, Store } from 'ngssm-store';\n\nimport { NgssmActionsCellRendererParams } from './ngssm-actions-cell-renderer-params';\nimport { ActionConfig } from './action-config';\n\ninterface ActionButton {\n cssClass: string;\n color: string;\n disabled$: BehaviorSubject<boolean>;\n hidden$: BehaviorSubject<boolean>;\n\n actionConfig: ActionConfig;\n\n tooltip: string;\n}\n\n@Component({\n selector: 'ngssm-actions-cell-renderer',\n imports: [CommonModule, MatButtonModule, MatIconModule, MatTooltipModule],\n templateUrl: './ngssm-actions-cell-renderer.component.html',\n styleUrls: ['./ngssm-actions-cell-renderer.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NgssmActionsCellRendererComponent extends NgSsmComponent implements ICellRendererAngularComp {\n private readonly _actionButtons$ = new BehaviorSubject<ActionButton[]>([]);\n\n private cellParams: ICellRendererParams | undefined;\n\n constructor(\n store: Store,\n private ngZone: NgZone\n ) {\n super(store);\n }\n\n public get actionButtons$(): Observable<ActionButton[]> {\n return this._actionButtons$.asObservable();\n }\n\n public agInit(params: ICellRendererParams): void {\n this.cellParams = params;\n this.setupActions(params as unknown as NgssmActionsCellRendererParams);\n }\n\n public refresh(params: ICellRendererParams): boolean {\n this.cellParams = params;\n this._actionButtons$.getValue().forEach((a) => {\n if (a.actionConfig.isDisabled instanceof Function) {\n a.disabled$.next(a.actionConfig.isDisabled(params));\n }\n\n if (a.actionConfig.isHidden instanceof Function) {\n a.hidden$.next(a.actionConfig.isHidden(params));\n }\n });\n return true;\n }\n\n public executeAction(action: ActionButton): void {\n const params = this.cellParams;\n if (params) {\n this.ngZone.run(() => action.actionConfig.click?.(params));\n }\n }\n\n private setupActions(rendererParams: NgssmActionsCellRendererParams): void {\n const actionButtons: ActionButton[] = (rendererParams?.actions ?? []).map((a) => {\n const actionButton: ActionButton = {\n cssClass: a.cssClass,\n color: a.color ?? 'primary',\n disabled$: new BehaviorSubject<boolean>(false),\n hidden$: new BehaviorSubject<boolean>(false),\n actionConfig: a,\n tooltip: a.tooltip ?? ''\n };\n\n if (a.isDisabled instanceof Function) {\n actionButton.disabled$.next(a.isDisabled(rendererParams as unknown as ICellRendererParams));\n } else if (isObservable(a.isDisabled)) {\n a.isDisabled.pipe(takeUntil(this.unsubscribeAll$)).subscribe((v) => actionButton.disabled$.next(v));\n }\n\n if (a.isHidden instanceof Function) {\n actionButton.hidden$.next(a.isHidden(rendererParams as unknown as ICellRendererParams));\n } else if (isObservable(a.isHidden)) {\n a.isHidden.pipe(takeUntil(this.unsubscribeAll$)).subscribe((v) => actionButton.hidden$.next(v));\n }\n\n return actionButton;\n });\n\n this._actionButtons$.next(actionButtons);\n }\n}\n","<div class=\"ngssm-actions-cell\">\n <div *ngFor=\"let actionButton of actionButtons$ | async; let index=index\">\n <button mat-icon-button class=\"ngssm-actions-cell-button\" [color]=\"actionButton.color\" id=\"action_{{index}}\"\n [disabled]=\"actionButton.disabled$ | async\" (click)=\"executeAction(actionButton)\"\n [matTooltip]=\"actionButton.tooltip\" *ngIf=\"(actionButton.hidden$ | async) === false\">\n <mat-icon [class]=\"actionButton.cssClass\"></mat-icon>\n </button>\n </div>\n\n</div>","import { ColDef } from 'ag-grid-community';\n\nimport { ActionConfig } from './action-config';\nimport { NgssmActionsCellRendererComponent } from './ngssm-actions-cell-renderer.component';\n\n// Parameters of the actions cell renderer\n// For now, an action is rendered as a mat-icon-button with the class passed in ActionConfig\nexport interface NgssmActionsCellRendererParams<TData = unknown, TValue = unknown> {\n actions: ActionConfig<TData, TValue>[];\n}\n\nexport const getNgssmActionsCellColDef = <TData = unknown, TValue = unknown>(\n params: NgssmActionsCellRendererParams<TData, TValue>\n): Partial<ColDef> => ({\n cellRenderer: NgssmActionsCellRendererComponent,\n cellRendererParams: params\n});\n","import { InjectionToken } from '@angular/core';\nimport { ColDef, StatusPanelDef } from 'ag-grid-community';\n\nexport class NgssmAgGridOptions {\n theme = 'ag-theme-material';\n statusBar:\n | {\n statusPanels: StatusPanelDef[];\n }\n | undefined = undefined;\n defaultColDef: ColDef | undefined = undefined;\n}\n\nexport const NGSSM_AG_GRID_OPTIONS = new InjectionToken<NgssmAgGridOptions>('NGSSM_AG_GRID_OPTIONS');\n","import { Directive, HostBinding, Inject, Optional } from '@angular/core';\n\nimport { AgGridAngular } from 'ag-grid-angular';\n\nimport { NgssmAgGridOptions, NGSSM_AG_GRID_OPTIONS } from '../ngssm-ag-grid-options';\n\n@Directive({\n selector: '[ngssmAgGridTheme]',\n standalone: true\n})\nexport class NgssmAgGridThemeDirective {\n @HostBinding('class') className = '';\n\n constructor(\n @Inject(NGSSM_AG_GRID_OPTIONS) @Optional() options: NgssmAgGridOptions,\n private agGridAngular: AgGridAngular\n ) {\n this.className = (options ?? new NgssmAgGridOptions()).theme;\n if (this.agGridAngular.statusBar === undefined) {\n this.agGridAngular.statusBar = options?.statusBar;\n }\n\n if (this.agGridAngular.defaultColDef === undefined) {\n this.agGridAngular.defaultColDef = options?.defaultColDef;\n }\n }\n}\n","import { Directive, inject, Input, OnDestroy } from '@angular/core';\nimport { BehaviorSubject, combineLatest, map, Subject, take, takeUntil } from 'rxjs';\n\nimport { AgGridAngular } from 'ag-grid-angular';\nimport { DefaultMenuItem, GetContextMenuItemsParams, MenuItemDef } from 'ag-grid-community';\n\nimport { Logger, Store } from 'ngssm-store';\n\nimport { AgGridAction, AgGridActionType, RegisterAgGridStateAction, RegisterSelectedRowsAction } from '../actions';\nimport { ChangeOrigin, selectAgGridState } from '../state';\nimport { NgssmAgGridConfig } from './ngssm-ag-grid-config';\n\n@Directive({\n selector: '[ngssmAgGrid]',\n standalone: true\n})\nexport class NgssmAgGridDirective implements OnDestroy {\n private readonly logger = inject(Logger);\n private readonly unsubsribeAll$ = new Subject<void>();\n private readonly _config$ = new BehaviorSubject<NgssmAgGridConfig>({\n gridId: ''\n });\n\n constructor(\n private store: Store,\n private agGridAngular: AgGridAngular\n ) {\n this.agGridAngular.gridReady.pipe(take(1)).subscribe(() => {\n combineLatest([\n this.store.state$.pipe(\n take(1),\n map((s) => selectAgGridState(s))\n ),\n this._config$\n ])\n .pipe(take(1))\n .subscribe((values) => {\n if (values[0].gridStates[values[1].gridId]) {\n this.agGridAngular.api.applyColumnState({\n state: values[0].gridStates[values[1].gridId].columnsState,\n applyOrder: true\n });\n }\n\n if (values[0].selectedRows[values[1].gridId]) {\n if (values[1].keepSelection === true) {\n const ids = values[0].selectedRows[values[1].gridId]?.ids ?? [];\n this.agGridAngular.api.forEachNode((node) => {\n if (node.id) {\n node.setSelected(ids.includes(node.id));\n }\n });\n }\n }\n\n this.initSateChangeListener();\n });\n });\n\n combineLatest([this.store.state$.pipe(map((s) => selectAgGridState(s).gridStates)), this._config$])\n .pipe(takeUntil(this.unsubsribeAll$))\n .subscribe((values) => {\n if (values[0][values[1].gridId]?.origin === ChangeOrigin.other) {\n this.agGridAngular.api.applyColumnState({\n state: values[0][values[1].gridId].columnsState,\n applyOrder: true\n });\n }\n });\n\n combineLatest([this.store.state$.pipe(map((s) => selectAgGridState(s).selectedRows)), this._config$])\n .pipe(takeUntil(this.unsubsribeAll$))\n .subscribe((values) => {\n if (values[0][values[1].gridId]?.origin === ChangeOrigin.other && values[1].keepSelection === true) {\n const ids = values[0][values[1].gridId]?.ids ?? [];\n this.agGridAngular.api.forEachNode((node) => {\n if (node.id) {\n node.setSelected(ids.includes(node.id));\n }\n });\n }\n });\n\n this.agGridAngular.getContextMenuItems = (params) => this.getContextMenuItems(params);\n }\n\n @Input('ngssmAgGrid') public set config(value: string | NgssmAgGridConfig) {\n if (typeof value === 'string') {\n this._config$.next({\n gridId: value as string\n });\n } else {\n this._config$.next(value as NgssmAgGridConfig);\n }\n }\n\n public ngOnDestroy(): void {\n this.unsubsribeAll$.next();\n this.unsubsribeAll$.complete();\n }\n\n private initSateChangeListener(): void {\n this.agGridAngular.sortChanged.pipe(takeUntil(this.unsubsribeAll$)).subscribe(() => this.saveGridState());\n this.agGridAngular.filterChanged.pipe(takeUntil(this.unsubsribeAll$)).subscribe(() => this.saveGridState());\n this.agGridAngular.columnPinned.pipe(takeUntil(this.unsubsribeAll$)).subscribe(() => this.saveGridState());\n this.agGridAngular.columnResized.pipe(takeUntil(this.unsubsribeAll$)).subscribe(() => this.saveGridState());\n this.agGridAngular.displayedColumnsChanged.pipe(takeUntil(this.unsubsribeAll$)).subscribe(() => this.saveGridState());\n this.agGridAngular.rowSelected.pipe(takeUntil(this.unsubsribeAll$)).subscribe(() => this.processSelectionChanged());\n }\n\n private saveGridState(): void {\n const state = this.agGridAngular.api.getColumnState();\n this._config$\n .pipe(take(1))\n .subscribe((gridId) => this.store.dispatchAction(new RegisterAgGridStateAction(gridId.gridId, ChangeOrigin.agGrid, state)));\n }\n\n private processSelectionChanged(): void {\n const selectedRows = this.agGridAngular.api\n .getSelectedNodes()\n .map((n) => n.id ?? '')\n .filter((n) => n !== '');\n this._config$.pipe(take(1)).subscribe((config) => {\n if (config.keepSelection === true) {\n this.store.dispatchAction(new RegisterSelectedRowsAction(config.gridId, ChangeOrigin.agGrid, selectedRows));\n }\n });\n }\n\n private getContextMenuItems(params: GetContextMenuItemsParams): (DefaultMenuItem | MenuItemDef)[] {\n this.logger.information('[NgssmAgGridDirective] Generating the context menu...');\n const menuItems: (DefaultMenuItem | MenuItemDef)[] = [];\n const getContextMenuItems = this._config$.getValue().getContextMenuItems;\n if (getContextMenuItems) {\n menuItems.push(...(getContextMenuItems(params) as (DefaultMenuItem | MenuItemDef)[]));\n } else {\n menuItems.push(...(params.defaultItems ?? []));\n }\n\n if (this._config$.getValue().canSaveOnDiskColumnsState === true) {\n menuItems.push(\n ...[\n 'separator' as DefaultMenuItem,\n {\n name: 'Save columns state',\n action: () =>\n this._config$\n .pipe(take(1))\n .subscribe((config) => this.store.dispatchAction(new AgGridAction(AgGridActionType.saveColumnsStateOnDisk, config.gridId))),\n icon: '<i class=\"fa-regular fa-floppy-disk\"></i>'\n },\n {\n name: 'Restore columns state',\n action: () =>\n this._config$\n .pipe(take(1))\n .subscribe((config) =>\n this.store.dispatchAction(new AgGridAction(AgGridActionType.resetColumnsStateFromDisk, config.gridId))\n ),\n icon: '<i class=\"fa-solid fa-rotate-right\"></i>'\n },\n {\n name: 'Reset columns state to default',\n action: () => this.agGridAngular.api.resetColumnState(),\n icon: '<i class=\"fa-solid fa-clock-rotate-left\"></i>'\n }\n ]\n );\n }\n return menuItems;\n }\n}\n","import { ICellEditorAngularComp } from 'ag-grid-angular';\nimport { ICellEditorParams } from 'ag-grid-community';\n\nimport { NgSsmComponent, Store } from 'ngssm-store';\n\nexport abstract class NgssmBaseCellEditor extends NgSsmComponent implements ICellEditorAngularComp {\n protected params?: ICellEditorParams;\n\n constructor(store: Store) {\n super(store);\n }\n\n public agInit(params: ICellEditorParams): void {\n this.params = params;\n }\n\n public getValue() {\n return '';\n }\n\n public isPopup(): boolean {\n return true;\n }\n\n public getPopupPosition(): 'over' | 'under' | undefined {\n return 'over';\n }\n\n public isCancelAfterEnd(): boolean {\n return true;\n }\n\n public cancel(): void {\n this.params?.stopEditing();\n }\n}\n","import { ColDef } from 'ag-grid-community';\n\nexport const getColDefWithNoPadding = (): Partial<ColDef> => ({\n cellClass: ['cell-with-no-padding']\n});\n\nexport const getColDefForEditableColumn = (): Partial<ColDef> => ({\n editable: true,\n headerClass: 'ngssm-ag-editable-cell',\n valueSetter: () => false\n});\n","import { Injectable } from '@angular/core';\n\nimport { Effect, State, Action, Logger, ActionDispatcher } from 'ngssm-store';\n\nimport { AgGridAction, AgGridActionType, RegisterAgGridStateAction } from '../actions';\nimport { ChangeOrigin, selectAgGridState } from '../state';\n\n@Injectable()\nexport class LocalStorageEffect implements Effect {\n public readonly processedActions: string[] = [AgGridActionType.saveColumnsStateOnDisk, AgGridActionType.resetColumnsStateFromDisk];\n\n constructor(private logger: Logger) {}\n\n public processAction(actiondispatcher: ActionDispatcher, state: State, action: Action): void {\n const agGridAction = action as AgGridAction;\n\n switch (action.type) {\n case AgGridActionType.saveColumnsStateOnDisk: {\n const columnsState = selectAgGridState(state).gridStates[agGridAction.gridId];\n if (columnsState) {\n localStorage.setItem(this.getColumnsStateLocalStorageKey(agGridAction.gridId), JSON.stringify(columnsState.columnsState));\n }\n\n break;\n }\n\n case AgGridActionType.resetColumnsStateFromDisk: {\n const stored = localStorage.getItem(this.getColumnsStateLocalStorageKey(agGridAction.gridId));\n console.log(stored);\n if (stored) {\n try {\n const columnsState = JSON.parse(stored);\n if (Array.isArray(columnsState)) {\n actiondispatcher.dispatchAction(new RegisterAgGridStateAction(agGridAction.gridId, ChangeOrigin.other, columnsState));\n } else {\n this.logger.error(`Wrong columns state config for grid '${agGridAction.gridId}'`, stored);\n }\n } catch (error) {\n this.logger.error(`Unable to load config for grid '${agGridAction.gridId}'`, error);\n }\n }\n\n break;\n }\n }\n }\n\n private getColumnsStateLocalStorageKey(gridId: string): string {\n return `ngssm-ag-grid_${gridId}`;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { AgGridActionType, RegisterAgGridStateAction } from '../actions';\nimport { updateAgGridState } from '../state';\n\n@Injectable()\nexport class GridStatesReducer implements Reducer {\n public readonly processedActions: string[] = [AgGridActionType.registerAgGridState];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case AgGridActionType.registerAgGridState: {\n const registerAgGridStateAction = action as RegisterAgGridStateAction;\n return updateAgGridState(state, {\n gridStates: {\n [registerAgGridStateAction.gridId]: {\n $set: {\n origin: registerAgGridStateAction.origin,\n columnsState: registerAgGridStateAction.columnStates\n }\n }\n }\n });\n }\n }\n\n return state;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { AgGridActionType, RegisterSelectedRowsAction } from '../actions';\nimport { updateAgGridState } from '../state';\n\n@Injectable()\nexport class SelectedRowsReducer implements Reducer {\n public readonly processedActions: string[] = [AgGridActionType.registerSelectedRows];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case AgGridActionType.registerSelectedRows: {\n const registerSelectedRowsAction = action as RegisterSelectedRowsAction;\n return updateAgGridState(state, {\n selectedRows: {\n [registerSelectedRowsAction.gridId]: {\n $set: {\n origin: registerSelectedRowsAction.origin,\n ids: registerSelectedRowsAction.ids\n }\n }\n }\n });\n }\n }\n\n return state;\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nimport { provideEffect, provideReducers } from 'ngssm-store';\n\nimport { LocalStorageEffect } from './effects/local-storage.effect';\nimport { GridStatesReducer } from './reducers/grid-states.reducer';\nimport { SelectedRowsReducer } from './reducers/selected-rows.reducer';\n\nexport const provideNgssmAgGrid = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideReducers(GridStatesReducer, SelectedRowsReducer), provideEffect(LocalStorageEffect)]);\n};\n","/*\n * Public API Surface of ngssm-ag-grid\n */\n\nexport * from './lib/actions';\nexport * from './lib/state';\nexport * from './lib/components';\nexport * from './lib/ngssm-ag-grid-options';\nexport * from './lib/helpers';\nexport * from './lib/provide-ngssm-ag-grid';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,gBAAgB,EAAA;AAC1B,IAAA,gBAAA,CAAA,qBAAA,CAAA,GAAA,wCAA8D;AAC9D,IAAA,gBAAA,CAAA,sBAAA,CAAA,GAAA,yCAAgE;AAChE,IAAA,gBAAA,CAAA,wBAAA,CAAA,GAAA,2CAAoE;AACpE,IAAA,gBAAA,CAAA,2BAAA,CAAA,GAAA,8CAA0E;AAC5E,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,GAK3B,EAAA,CAAA,CAAA;;MCEY,yBAAyB,CAAA;AAGpC,IAAA,WAAA,CACkB,MAAc,EACd,MAAoB,EACpB,YAA2B,EAAA;QAF3B,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,IAAY,CAAA,YAAA,GAAZ,YAAY;AALd,QAAA,IAAA,CAAA,IAAI,GAAW,gBAAgB,CAAC,mBAAmB;;AAOpE;;MCXY,0BAA0B,CAAA;AAGrC,IAAA,WAAA,CACkB,MAAc,EACd,MAAoB,EACpB,GAAa,EAAA;QAFb,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,IAAG,CAAA,GAAA,GAAH,GAAG;AALL,QAAA,IAAA,CAAA,IAAI,GAAW,gBAAgB,CAAC,oBAAoB;;AAOrE;;MCVY,YAAY,CAAA;IACvB,WACkB,CAAA,IAAY,EACZ,MAAc,EAAA;QADd,IAAI,CAAA,IAAA,GAAJ,IAAI;QACJ,IAAM,CAAA,MAAA,GAAN,MAAM;;AAEzB;;ACDM,MAAM,iBAAiB,GAAG,CAAC,KAAY,KAAkB,KAAK,CAAC,wBAAwB,CAAC,eAAe;AAEvG,MAAM,iB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BQ,WAAW,CAAC,KAAY,EAAE,MAAc,EAAA;AAC7C,QAAA,QAAQ,MAAM,CAAC,IAAI;AACjB,YAAA,KAAK,gBAAgB,CAAC,oBAAoB,EAAE;gBAC1C,MAAM,0BAA0B,GAAG,MAAoC;gBACvE,OAAO,iBAAiB,CAAC,KAAK,EAAE;AAC9B,oBAAA,YAAY,EAAE;AACZ,wBAAA,CAAC,0BAA0B,CAAC,MAAM,GAAG;AACnC,4BAAA,IAAI,EAAE;gCACJ,MAAM,EAAE,0BAA0B,CAAC,MAAM;gCACzC,GAAG,EAAE,0BAA0B,CAAC;AACjC;AACF;AACF;AACF,iBAAA,CAAC;;;AAIN,QAAA,OAAO,KAAK;;8GApBH,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAnB,mBAAmB,EAAA,CAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B;;;ACCM,MAAM,kBAAkB,GAAG,MAA2B;AAC3D,IAAA,OAAO,wBAAwB,CAAC,CAAC,eAAe,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAC/H;;ACVA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngssm-ag-grid.mjs","sources":["../../../projects/ngssm-ag-grid/src/lib/actions/ag-grid-action-type.ts","../../../projects/ngssm-ag-grid/src/lib/actions/register-ag-grid-state.action.ts","../../../projects/ngssm-ag-grid/src/lib/actions/register-selected-rows.action.ts","../../../projects/ngssm-ag-grid/src/lib/actions/ag-grid.action.ts","../../../projects/ngssm-ag-grid/src/lib/state/ag-grid.state.ts","../../../projects/ngssm-ag-grid/src/lib/state/change-origin.ts","../../../projects/ngssm-ag-grid/src/lib/components/ngssm-actions-cell-renderer/ngssm-actions-cell-renderer.component.ts","../../../projects/ngssm-ag-grid/src/lib/components/ngssm-actions-cell-renderer/ngssm-actions-cell-renderer.component.html","../../../projects/ngssm-ag-grid/src/lib/components/ngssm-actions-cell-renderer/ngssm-actions-cell-renderer-params.ts","../../../projects/ngssm-ag-grid/src/lib/ngssm-ag-grid-options.ts","../../../projects/ngssm-ag-grid/src/lib/components/ngssm-ag-grid-theme.directive.ts","../../../projects/ngssm-ag-grid/src/lib/components/ngssm-ag-grid.directive.ts","../../../projects/ngssm-ag-grid/src/lib/components/ngssm-base-cell-editor.ts","../../../projects/ngssm-ag-grid/src/lib/components/action-confirmation-popup/action-confirmation-popup.component.ts","../../../projects/ngssm-ag-grid/src/lib/components/action-confirmation-popup/action-confirmation-popup.component.html","../../../projects/ngssm-ag-grid/src/lib/helpers.ts","../../../projects/ngssm-ag-grid/src/lib/effects/local-storage.effect.ts","../../../projects/ngssm-ag-grid/src/lib/reducers/grid-states.reducer.ts","../../../projects/ngssm-ag-grid/src/lib/reducers/selected-rows.reducer.ts","../../../projects/ngssm-ag-grid/src/lib/provide-ngssm-ag-grid.ts","../../../projects/ngssm-ag-grid/src/public-api.ts","../../../projects/ngssm-ag-grid/src/ngssm-ag-grid.ts"],"sourcesContent":["export enum AgGridActionType {\n registerAgGridState = '[AgGridActionType] registerAgGridState',\n registerSelectedRows = '[AgGridActionType] registerSelectedRows',\n saveColumnsStateOnDisk = '[AgGridActionType] saveColumnsStateOnDisk',\n resetColumnsStateFromDisk = '[AgGridActionType] resetColumnsStateFromDisk'\n}\n","import { ColumnState } from 'ag-grid-community';\n\nimport { Action } from 'ngssm-store';\n\nimport { ChangeOrigin } from '../state';\nimport { AgGridActionType } from './ag-grid-action-type';\n\nexport class RegisterAgGridStateAction implements Action {\n public readonly type: string = AgGridActionType.registerAgGridState;\n\n constructor(\n public readonly gridId: string,\n public readonly origin: ChangeOrigin,\n public readonly columnStates: ColumnState[]\n ) {}\n}\n","import { Action } from 'ngssm-store';\nimport { ChangeOrigin } from '../state';\nimport { AgGridActionType } from './ag-grid-action-type';\n\nexport class RegisterSelectedRowsAction implements Action {\n public readonly type: string = AgGridActionType.registerSelectedRows;\n\n constructor(\n public readonly gridId: string,\n public readonly origin: ChangeOrigin,\n public readonly ids: string[]\n ) {}\n}\n","import { Action } from 'ngssm-store';\n\nexport class AgGridAction implements Action {\n constructor(\n public readonly type: string,\n public readonly gridId: string\n ) {}\n}\n","import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\nimport { GridState } from './grid-state';\nimport { SelectedRows } from './selected-rows';\n\nexport const selectAgGridState = (state: State): AgGridState => state[AgGridStateSpecification.featureStateKey] as AgGridState;\n\nexport const updateAgGridState = (state: State, command: Spec<AgGridState, never>): State =>\n update(state, {\n [AgGridStateSpecification.featureStateKey]: command\n });\n\nexport interface AgGridState {\n gridStates: Record<string, GridState>;\n selectedRows: Record<string, SelectedRows>;\n}\n\n@NgSsmFeatureState({\n featureStateKey: AgGridStateSpecification.featureStateKey,\n initialState: AgGridStateSpecification.initialState\n})\nexport class AgGridStateSpecification {\n public static readonly featureStateKey = 'ag-grid-state';\n public static readonly initialState: AgGridState = {\n gridStates: {},\n selectedRows: {}\n };\n}\n","export enum ChangeOrigin {\n agGrid = 'agGrid',\n other = 'other'\n}\n","/**\n * The `NgssmActionsCellRendererComponent` is a custom cell renderer for `ag-grid` that dynamically renders\n * action buttons within a grid cell. It provides flexibility in configuring button behavior, visibility, and state.\n *\n * ### Features:\n * - Dynamically generates action buttons based on the provided configuration.\n * - Supports reactive state management using Angular signals.\n * - Integrates with observables, functions, or signals for `isDisabled` and `isHidden` properties.\n * - Provides customizable tooltips and button styles.\n * - Executes custom actions when buttons are clicked.\n *\n * ### Usage:\n * To use this component, provide it as a cell renderer in your `ag-grid` column definition:\n *\n * ```typescript\n * columnDefs: [\n * {\n * headerName: 'Actions',\n * field: 'actions',\n * cellRenderer: NgssmActionsCellRendererComponent,\n * cellRendererParams: {\n * actions: [\n * {\n * cssClass: 'delete-button',\n * color: 'warn',\n * tooltip: 'Delete Item',\n * isDisabled: (params) => params.data.isLocked,\n * isHidden: (params) => !params.data.canDelete,\n * click: (params) => console.log('Delete action clicked', params)\n * }\n * ]\n * }\n * }\n * ];\n * ```\n *\n * ### Inputs:\n * - `NgssmActionsCellRendererParams`: Configuration object passed to the component via `cellRendererParams`.\n * - `actions`: Array of `ActionConfig` objects defining the buttons to render.\n *\n * ### Outputs:\n * None.\n *\n * ### Dependencies:\n * - Angular Material components: `MatIconButton`, `MatIcon`, `MatTooltip`.\n * - `ag-grid-angular` for integration with `ag-grid`.\n *\n * ### Example ActionConfig:\n * ```typescript\n * interface ActionConfig {\n * cssClass: string; // CSS class for the button.\n * color?: string; // Button color (e.g., 'primary', 'warn').\n * tooltip?: string; // Tooltip text for the button.\n * isDisabled?: boolean | Signal<boolean> | Observable<boolean> | ((params: ICellRendererParams) => boolean);\n * isHidden?: boolean | Signal<boolean> | Observable<boolean> | ((params: ICellRendererParams) => boolean);\n * click?: (params: ICellRendererParams) => void; // Action to execute on button click.\n * }\n * ```\n *\n * ### Methods:\n * - `agInit(params: ICellRendererParams)`: Initializes the component with the provided cell renderer parameters.\n * - `refresh(params: ICellRendererParams)`: Refreshes the component state when the grid updates.\n * - `executeAction(action: ActionButton)`: Executes the action associated with a button.\n *\n * ### Internal Logic:\n * - The `setupActions` method initializes the action buttons based on the provided configuration.\n * - The `setUpActionSignal` method handles the initialization of `isDisabled` and `isHidden` states for each button.\n * - The component uses Angular signals (`WritableSignal` and `Signal`) to manage the state of `isDisabled` and `isHidden`.\n * - Observables are converted to signals using `toSignal` for seamless integration with Angular's reactivity system.\n *\n * ### Change Detection:\n * - The component uses `ChangeDetectionStrategy.OnPush` for improved performance by minimizing unnecessary change detection cycles.\n *\n * ### Notes:\n * - Ensure that the `actions` array in `NgssmActionsCellRendererParams` is properly configured to avoid runtime errors.\n * - The component is designed to work with Angular Material and requires the relevant modules to be imported in your application.\n * - The `isDisabled` and `isHidden` properties can accept multiple input types (boolean, function, signal, or observable), providing flexibility in defining button behavior.\n */\n\nimport {\n Component,\n ChangeDetectionStrategy,\n signal,\n WritableSignal,\n Signal,\n inject,\n EnvironmentInjector,\n runInInjectionContext,\n isSignal\n} from '@angular/core';\nimport { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';\nimport { MatIcon } from '@angular/material/icon';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { MatIconButton } from '@angular/material/button';\nimport { isObservable } from 'rxjs';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nimport { ICellRendererAngularComp } from 'ag-grid-angular';\nimport { ICellRendererParams } from 'ag-grid-community';\n\nimport { NgssmComponentAction, NgssmComponentDisplayDirective } from 'ngssm-toolkit';\n\nimport { NgssmActionsCellRendererParams } from './ngssm-actions-cell-renderer-params';\nimport { ActionConfig, ActionPopupComponent } from './action-config';\n\ninterface ActionButton {\n cssClass: string;\n color: string;\n\n isDisabled: WritableSignal<boolean> | Signal<boolean>;\n isHidden: WritableSignal<boolean> | Signal<boolean>;\n\n actionConfig: ActionConfig;\n\n tooltip: string;\n\n popupRendered: WritableSignal<boolean>;\n popupAction?: NgssmComponentAction;\n}\n\n@Component({\n selector: 'ngssm-actions-cell-renderer',\n imports: [MatIconButton, MatIcon, MatTooltip, CdkOverlayOrigin, CdkConnectedOverlay, NgssmComponentDisplayDirective],\n templateUrl: './ngssm-actions-cell-renderer.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NgssmActionsCellRendererComponent implements ICellRendererAngularComp {\n private environmentInjector = inject(EnvironmentInjector);\n private cellParams: ICellRendererParams | undefined;\n\n public readonly actionButtons = signal<ActionButton[]>([]);\n\n public agInit(params: ICellRendererParams): void {\n this.cellParams = params;\n this.setupActions(params as unknown as NgssmActionsCellRendererParams);\n }\n\n public refresh(params: ICellRendererParams): boolean {\n this.cellParams = params;\n this.actionButtons().forEach((a) => {\n if (a.actionConfig.isDisabled instanceof Function) {\n (a.isDisabled as WritableSignal<boolean>).set(a.actionConfig.isDisabled(params));\n }\n\n if (a.actionConfig.isHidden instanceof Function) {\n (a.isHidden as WritableSignal<boolean>).set(a.actionConfig.isHidden(params));\n }\n });\n return true;\n }\n\n public executeAction(action: ActionButton): void {\n const params = this.cellParams;\n if (params) {\n action.actionConfig.click?.(params);\n }\n }\n\n private setupActions(rendererParams: NgssmActionsCellRendererParams): void {\n runInInjectionContext(this.environmentInjector, () => {\n const actionButtons: ActionButton[] = (rendererParams?.actions ?? []).map((a) => {\n const actionButton: ActionButton = {\n cssClass: a.cssClass,\n color: a.color ?? 'primary',\n isDisabled: signal(false),\n isHidden: signal(false),\n actionConfig: a,\n tooltip: a.tooltip ?? '',\n popupRendered: signal(false)\n };\n\n if (a.popupComponent) {\n actionButton.popupAction = ((component: ActionPopupComponent) =>\n this.setupPopupComponent(component, actionButton)) as NgssmComponentAction;\n }\n\n this.setUpActionSignal(actionButton, a, rendererParams, 'isDisabled');\n this.setUpActionSignal(actionButton, a, rendererParams, 'isHidden');\n\n return actionButton;\n });\n\n this.actionButtons.set(actionButtons);\n });\n }\n\n private setUpActionSignal(\n actionButton: ActionButton,\n config: ActionConfig,\n rendererParams: NgssmActionsCellRendererParams,\n signalName: 'isDisabled' | 'isHidden'\n ): void {\n const input = config[signalName];\n\n if (isSignal(input)) {\n actionButton[signalName] = input as Signal<boolean>;\n } else if (input instanceof Function) {\n (actionButton[signalName] as WritableSignal<boolean>).set(input(rendererParams as unknown as ICellRendererParams));\n } else if (isObservable(input)) {\n actionButton[signalName] = toSignal(input, { initialValue: false });\n }\n }\n\n private setupPopupComponent(component: ActionPopupComponent, action: ActionButton): void {\n component?.init?.(action.popupRendered, this.cellParams as unknown as ICellRendererParams, action.actionConfig.popupParameter);\n }\n}\n","<div class=\"ngssm-actions-cell\">\n @for (actionButton of actionButtons(); track actionButton; let idx = $index) {\n @if (!actionButton.isHidden()) {\n @if (actionButton.actionConfig.popupComponent) {\n <button\n mat-icon-button\n class=\"ngssm-actions-cell-button\"\n [color]=\"actionButton.color\"\n id=\"action_{{ idx }}\"\n [disabled]=\"actionButton.isDisabled()\"\n [matTooltip]=\"actionButton.tooltip\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n (click)=\"actionButton.popupRendered.set(true)\">\n <mat-icon [class]=\"actionButton.cssClass\"></mat-icon>\n </button>\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"actionButton.popupRendered()\">\n <div [ngssmComponentDisplay]=\"actionButton.actionConfig.popupComponent\" [ngssmComponentAction]=\"actionButton.popupAction\"></div>\n </ng-template>\n } @else {\n <button\n mat-icon-button\n class=\"ngssm-actions-cell-button\"\n [color]=\"actionButton.color\"\n id=\"action_{{ idx }}\"\n [disabled]=\"actionButton.isDisabled()\"\n (click)=\"executeAction(actionButton)\"\n [matTooltip]=\"actionButton.tooltip\">\n <mat-icon [class]=\"actionButton.cssClass\"></mat-icon>\n </button>\n }\n }\n }\n</div>\n","import { ColDef } from 'ag-grid-community';\n\nimport { ActionConfig } from './action-config';\nimport { NgssmActionsCellRendererComponent } from './ngssm-actions-cell-renderer.component';\n\n// Parameters of the actions cell renderer\n// For now, an action is rendered as a mat-icon-button with the class passed in ActionConfig\nexport interface NgssmActionsCellRendererParams<TData = unknown, TValue = unknown> {\n actions: ActionConfig<TData, TValue>[];\n}\n\nexport const getNgssmActionsCellColDef = <TData = unknown, TValue = unknown>(\n params: NgssmActionsCellRendererParams<TData, TValue>\n): Partial<ColDef> => ({\n cellRenderer: NgssmActionsCellRendererComponent,\n cellRendererParams: params\n});\n","import { InjectionToken } from '@angular/core';\nimport { ColDef, StatusPanelDef } from 'ag-grid-community';\n\nexport class NgssmAgGridOptions {\n theme = 'ag-theme-material';\n statusBar:\n | {\n statusPanels: StatusPanelDef[];\n }\n | undefined = undefined;\n defaultColDef: ColDef | undefined = undefined;\n}\n\nexport const NGSSM_AG_GRID_OPTIONS = new InjectionToken<NgssmAgGridOptions>('NGSSM_AG_GRID_OPTIONS');\n","import { Directive, HostBinding, Inject, Optional } from '@angular/core';\n\nimport { AgGridAngular } from 'ag-grid-angular';\n\nimport { NgssmAgGridOptions, NGSSM_AG_GRID_OPTIONS } from '../ngssm-ag-grid-options';\n\n@Directive({\n selector: '[ngssmAgGridTheme]',\n standalone: true\n})\nexport class NgssmAgGridThemeDirective {\n @HostBinding('class') className = '';\n\n constructor(\n @Inject(NGSSM_AG_GRID_OPTIONS) @Optional() options: NgssmAgGridOptions,\n private agGridAngular: AgGridAngular\n ) {\n this.className = (options ?? new NgssmAgGridOptions()).theme;\n if (this.agGridAngular.statusBar === undefined) {\n this.agGridAngular.statusBar = options?.statusBar;\n }\n\n if (this.agGridAngular.defaultColDef === undefined) {\n this.agGridAngular.defaultColDef = options?.defaultColDef;\n }\n }\n}\n","import { Directive, inject, Input, OnDestroy } from '@angular/core';\nimport { BehaviorSubject, combineLatest, map, Subject, take, takeUntil } from 'rxjs';\n\nimport { AgGridAngular } from 'ag-grid-angular';\nimport { DefaultMenuItem, GetContextMenuItemsParams, MenuItemDef } from 'ag-grid-community';\n\nimport { Logger, Store } from 'ngssm-store';\n\nimport { AgGridAction, AgGridActionType, RegisterAgGridStateAction, RegisterSelectedRowsAction } from '../actions';\nimport { ChangeOrigin, selectAgGridState } from '../state';\nimport { NgssmAgGridConfig } from './ngssm-ag-grid-config';\n\n@Directive({\n selector: '[ngssmAgGrid]',\n standalone: true\n})\nexport class NgssmAgGridDirective implements OnDestroy {\n private readonly logger = inject(Logger);\n private readonly unsubsribeAll$ = new Subject<void>();\n private readonly _config$ = new BehaviorSubject<NgssmAgGridConfig>({\n gridId: ''\n });\n\n constructor(\n private store: Store,\n private agGridAngular: AgGridAngular\n ) {\n this.agGridAngular.gridReady.pipe(take(1)).subscribe(() => {\n combineLatest([\n this.store.state$.pipe(\n take(1),\n map((s) => selectAgGridState(s))\n ),\n this._config$\n ])\n .pipe(take(1))\n .subscribe((values) => {\n if (values[0].gridStates[values[1].gridId]) {\n this.agGridAngular.api.applyColumnState({\n state: values[0].gridStates[values[1].gridId].columnsState,\n applyOrder: true\n });\n }\n\n if (values[0].selectedRows[values[1].gridId]) {\n if (values[1].keepSelection === true) {\n const ids = values[0].selectedRows[values[1].gridId]?.ids ?? [];\n this.agGridAngular.api.forEachNode((node) => {\n if (node.id) {\n node.setSelected(ids.includes(node.id));\n }\n });\n }\n }\n\n this.initSateChangeListener();\n });\n });\n\n combineLatest([this.store.state$.pipe(map((s) => selectAgGridState(s).gridStates)), this._config$])\n .pipe(takeUntil(this.unsubsribeAll$))\n .subscribe((values) => {\n if (values[0][values[1].gridId]?.origin === ChangeOrigin.other) {\n this.agGridAngular.api.applyColumnState({\n state: values[0][values[1].gridId].columnsState,\n applyOrder: true\n });\n }\n });\n\n combineLatest([this.store.state$.pipe(map((s) => selectAgGridState(s).selectedRows)), this._config$])\n .pipe(takeUntil(this.unsubsribeAll$))\n .subscribe((values) => {\n if (values[0][values[1].gridId]?.origin === ChangeOrigin.other && values[1].keepSelection === true) {\n const ids = values[0][values[1].gridId]?.ids ?? [];\n this.agGridAngular.api.forEachNode((node) => {\n if (node.id) {\n node.setSelected(ids.includes(node.id));\n }\n });\n }\n });\n\n this.agGridAngular.getContextMenuItems = (params) => this.getContextMenuItems(params);\n }\n\n @Input('ngssmAgGrid') public set config(value: string | NgssmAgGridConfig) {\n if (typeof value === 'string') {\n this._config$.next({\n gridId: value as string\n });\n } else {\n this._config$.next(value as NgssmAgGridConfig);\n }\n }\n\n public ngOnDestroy(): void {\n this.unsubsribeAll$.next();\n this.unsubsribeAll$.complete();\n }\n\n private initSateChangeListener(): void {\n this.agGridAngular.sortChanged.pipe(takeUntil(this.unsubsribeAll$)).subscribe(() => this.saveGridState());\n this.agGridAngular.filterChanged.pipe(takeUntil(this.unsubsribeAll$)).subscribe(() => this.saveGridState());\n this.agGridAngular.columnPinned.pipe(takeUntil(this.unsubsribeAll$)).subscribe(() => this.saveGridState());\n this.agGridAngular.columnResized.pipe(takeUntil(this.unsubsribeAll$)).subscribe(() => this.saveGridState());\n this.agGridAngular.displayedColumnsChanged.pipe(takeUntil(this.unsubsribeAll$)).subscribe(() => this.saveGridState());\n this.agGridAngular.rowSelected.pipe(takeUntil(this.unsubsribeAll$)).subscribe(() => this.processSelectionChanged());\n }\n\n private saveGridState(): void {\n const state = this.agGridAngular.api.getColumnState();\n this._config$\n .pipe(take(1))\n .subscribe((gridId) => this.store.dispatchAction(new RegisterAgGridStateAction(gridId.gridId, ChangeOrigin.agGrid, state)));\n }\n\n private processSelectionChanged(): void {\n const selectedRows = this.agGridAngular.api\n .getSelectedNodes()\n .map((n) => n.id ?? '')\n .filter((n) => n !== '');\n this._config$.pipe(take(1)).subscribe((config) => {\n if (config.keepSelection === true) {\n this.store.dispatchAction(new RegisterSelectedRowsAction(config.gridId, ChangeOrigin.agGrid, selectedRows));\n }\n });\n }\n\n private getContextMenuItems(params: GetContextMenuItemsParams): (DefaultMenuItem | MenuItemDef)[] {\n this.logger.information('[NgssmAgGridDirective] Generating the context menu...');\n const menuItems: (DefaultMenuItem | MenuItemDef)[] = [];\n const getContextMenuItems = this._config$.getValue().getContextMenuItems;\n if (getContextMenuItems) {\n menuItems.push(...(getContextMenuItems(params) as (DefaultMenuItem | MenuItemDef)[]));\n } else {\n menuItems.push(...(params.defaultItems ?? []));\n }\n\n if (this._config$.getValue().canSaveOnDiskColumnsState === true) {\n menuItems.push(\n ...[\n 'separator' as DefaultMenuItem,\n {\n name: 'Save columns state',\n action: () =>\n this._config$\n .pipe(take(1))\n .subscribe((config) => this.store.dispatchAction(new AgGridAction(AgGridActionType.saveColumnsStateOnDisk, config.gridId))),\n icon: '<i class=\"fa-regular fa-floppy-disk\"></i>'\n },\n {\n name: 'Restore columns state',\n action: () =>\n this._config$\n .pipe(take(1))\n .subscribe((config) =>\n this.store.dispatchAction(new AgGridAction(AgGridActionType.resetColumnsStateFromDisk, config.gridId))\n ),\n icon: '<i class=\"fa-solid fa-rotate-right\"></i>'\n },\n {\n name: 'Reset columns state to default',\n action: () => this.agGridAngular.api.resetColumnState(),\n icon: '<i class=\"fa-solid fa-clock-rotate-left\"></i>'\n }\n ]\n );\n }\n return menuItems;\n }\n}\n","import { ICellEditorAngularComp } from 'ag-grid-angular';\nimport { ICellEditorParams } from 'ag-grid-community';\n\nimport { NgSsmComponent, Store } from 'ngssm-store';\n\nexport abstract class NgssmBaseCellEditor extends NgSsmComponent implements ICellEditorAngularComp {\n protected params?: ICellEditorParams;\n\n constructor(store: Store) {\n super(store);\n }\n\n public agInit(params: ICellEditorParams): void {\n this.params = params;\n }\n\n public getValue() {\n return '';\n }\n\n public isPopup(): boolean {\n return true;\n }\n\n public getPopupPosition(): 'over' | 'under' | undefined {\n return 'over';\n }\n\n public isCancelAfterEnd(): boolean {\n return true;\n }\n\n public cancel(): void {\n this.params?.stopEditing();\n }\n}\n","import { ChangeDetectionStrategy, Component, signal, WritableSignal } from '@angular/core';\nimport { MatButton } from '@angular/material/button';\nimport { MatCard, MatCardActions, MatCardTitle, MatCardHeader } from '@angular/material/card';\nimport { ICellRendererParams } from 'ag-grid-community';\n\nimport { ActionConfirmationPopupParameter } from './action-confirmation-popup-parameter';\nimport { ActionPopupComponent } from '../ngssm-actions-cell-renderer';\n\n/**\n * The `ActionConfirmationPopupComponent` is a reusable confirmation popup component designed to work with `ag-grid`.\n * It provides a customizable confirmation dialog for user actions, allowing developers to define messages, button labels,\n * and actions dynamically.\n *\n * ### Features:\n * - Displays a confirmation popup with customizable message, button labels, and color.\n * - Integrates with the `ActionPopupComponent` interface for seamless use with `NgssmActionsCellRendererComponent`.\n * - Uses Angular signals for efficient state management.\n * - Supports dynamic initialization with parameters provided by `ag-grid`.\n * - Provides methods to handle user actions (confirm or cancel) and close the popup.\n *\n * ### Usage:\n * This component is typically used as a popup in conjunction with the `NgssmActionsCellRendererComponent`.\n * To configure it, pass an `ActionConfirmationPopupParameter` object when initializing the popup.\n *\n * Example:\n * ```typescript\n * const popupParameter: ActionConfirmationPopupParameter = {\n * messageBuilder: (params) => `Are you sure you want to delete ${params.data.name}?`,\n * color: 'warn',\n * cancelButtonLabel: 'No',\n * confirmButtonLabel: 'Yes',\n * confirmAction: (params) => console.log('Confirmed action for:', params.data)\n * };\n * ```\n *\n * ### Inputs:\n * - `popupRendered`: A writable signal indicating whether the popup is currently rendered.\n * - `params`: The cell renderer parameters provided by `ag-grid`.\n * - `popupParameter`: An object of type `ActionConfirmationPopupParameter` that defines the popup's behavior and content.\n *\n * ### Outputs:\n * None.\n *\n * ### Dependencies:\n * - Angular Material components: `MatCard`, `MatButton`.\n * - `ag-grid-community` for integration with `ag-grid`.\n *\n * ### Methods:\n * - `init(popupRendered, params, popupParameter)`: Initializes the popup with the provided parameters.\n * - `popupRendered`: A writable signal to track the popup's visibility.\n * - `params`: The cell renderer parameters from `ag-grid`.\n * - `popupParameter`: The configuration object for the popup.\n *\n * - `closePopup()`: Closes the popup by setting the `isOpen` signal to `false`.\n *\n * - `executeAction()`: Executes the confirmation action defined in the `popupParameter` and closes the popup.\n *\n * ### Signals:\n * - `message`: The message displayed in the popup.\n * - `cancelButtonLabel`: The label for the cancel button.\n * - `confirmButtonLabel`: The label for the confirm button.\n * - `color`: The color theme for the confirm button (e.g., 'primary', 'warn').\n * - `isOpen`: Tracks whether the popup is currently open.\n *\n * ### Example Initialization:\n * ```typescript\n * const popup = new ActionConfirmationPopupComponent();\n * popup.init(\n * popupRenderedSignal,\n * cellRendererParams,\n * {\n * messageBuilder: (params) => `Are you sure you want to delete ${params.data.name}?`,\n * color: 'warn',\n * cancelButtonLabel: 'No',\n * confirmButtonLabel: 'Yes',\n * confirmAction: (params) => console.log('Confirmed action for:', params.data)\n * }\n * );\n * ```\n *\n * ### Notes:\n * - Ensure that the `popupParameter` object is properly configured to avoid runtime errors.\n * - The `messageBuilder` function in `popupParameter` allows dynamic message generation based on the `params` object.\n * - The component uses `ChangeDetectionStrategy.OnPush` for performance optimization.\n * - The `isOpen` signal can be used to programmatically control the popup's visibility.\n */\n@Component({\n selector: 'ngssm-action-confirmation-popup',\n imports: [MatCard, MatCardHeader, MatCardTitle, MatCardActions, MatButton],\n templateUrl: './action-confirmation-popup.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ActionConfirmationPopupComponent implements ActionPopupComponent<unknown, unknown, ActionConfirmationPopupParameter> {\n private params?: ICellRendererParams;\n private popupParameter?: ActionConfirmationPopupParameter;\n public readonly message = signal<string>('No message');\n public readonly cancelButtonLabel = signal<string>('No');\n public readonly confirmButtonLabel = signal<string>('Yes');\n public readonly color = signal<string>('primary');\n\n public isOpen = signal<boolean>(false);\n\n public init(\n popupRendered: WritableSignal<boolean>,\n params?: ICellRendererParams<unknown, unknown>,\n popupParameter?: ActionConfirmationPopupParameter\n ): void {\n this.params = params;\n this.popupParameter = popupParameter;\n\n this.message.set(popupParameter?.messageBuilder?.(params) ?? 'No message');\n this.color.set(popupParameter?.color ?? 'primary');\n this.cancelButtonLabel.set(popupParameter?.cancelButtonLabel ?? 'Cancel');\n this.confirmButtonLabel.set(popupParameter?.confirmButtonLabel ?? 'Confirm');\n\n this.isOpen = popupRendered;\n }\n\n public closePopup(): void {\n this.isOpen.set(false);\n }\n\n public executeAction(): void {\n this.popupParameter?.confirmAction?.(this.params);\n this.closePopup();\n }\n}\n","<mat-card class=\"fxFlex flex-column-stretch\">\n <mat-card-header>\n <mat-card-title>{{ message() }}</mat-card-title>\n </mat-card-header>\n <mat-card-actions class=\"flex-row-center\">\n <span class=\"fxFlex\"></span>\n <button mat-button (click)=\"closePopup()\">{{ cancelButtonLabel() }}</button>\n <button mat-raised-button [color]=\"color()\" (click)=\"executeAction()\">{{ confirmButtonLabel() }}</button>\n </mat-card-actions>\n</mat-card>\n","import { ColDef } from 'ag-grid-community';\n\nexport const getColDefWithNoPadding = (): Partial<ColDef> => ({\n cellClass: ['cell-with-no-padding']\n});\n\nexport const getColDefForEditableColumn = (): Partial<ColDef> => ({\n editable: true,\n headerClass: 'ngssm-ag-editable-cell',\n valueSetter: () => false\n});\n","import { Injectable } from '@angular/core';\n\nimport { Effect, State, Action, Logger, ActionDispatcher } from 'ngssm-store';\n\nimport { AgGridAction, AgGridActionType, RegisterAgGridStateAction } from '../actions';\nimport { ChangeOrigin, selectAgGridState } from '../state';\n\n@Injectable()\nexport class LocalStorageEffect implements Effect {\n public readonly processedActions: string[] = [AgGridActionType.saveColumnsStateOnDisk, AgGridActionType.resetColumnsStateFromDisk];\n\n constructor(private logger: Logger) {}\n\n public processAction(actiondispatcher: ActionDispatcher, state: State, action: Action): void {\n const agGridAction = action as AgGridAction;\n\n switch (action.type) {\n case AgGridActionType.saveColumnsStateOnDisk: {\n const columnsState = selectAgGridState(state).gridStates[agGridAction.gridId];\n if (columnsState) {\n localStorage.setItem(this.getColumnsStateLocalStorageKey(agGridAction.gridId), JSON.stringify(columnsState.columnsState));\n }\n\n break;\n }\n\n case AgGridActionType.resetColumnsStateFromDisk: {\n const stored = localStorage.getItem(this.getColumnsStateLocalStorageKey(agGridAction.gridId));\n console.log(stored);\n if (stored) {\n try {\n const columnsState = JSON.parse(stored);\n if (Array.isArray(columnsState)) {\n actiondispatcher.dispatchAction(new RegisterAgGridStateAction(agGridAction.gridId, ChangeOrigin.other, columnsState));\n } else {\n this.logger.error(`Wrong columns state config for grid '${agGridAction.gridId}'`, stored);\n }\n } catch (error) {\n this.logger.error(`Unable to load config for grid '${agGridAction.gridId}'`, error);\n }\n }\n\n break;\n }\n }\n }\n\n private getColumnsStateLocalStorageKey(gridId: string): string {\n return `ngssm-ag-grid_${gridId}`;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { AgGridActionType, RegisterAgGridStateAction } from '../actions';\nimport { updateAgGridState } from '../state';\n\n@Injectable()\nexport class GridStatesReducer implements Reducer {\n public readonly processedActions: string[] = [AgGridActionType.registerAgGridState];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case AgGridActionType.registerAgGridState: {\n const registerAgGridStateAction = action as RegisterAgGridStateAction;\n return updateAgGridState(state, {\n gridStates: {\n [registerAgGridStateAction.gridId]: {\n $set: {\n origin: registerAgGridStateAction.origin,\n columnsState: registerAgGridStateAction.columnStates\n }\n }\n }\n });\n }\n }\n\n return state;\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { AgGridActionType, RegisterSelectedRowsAction } from '../actions';\nimport { updateAgGridState } from '../state';\n\n@Injectable()\nexport class SelectedRowsReducer implements Reducer {\n public readonly processedActions: string[] = [AgGridActionType.registerSelectedRows];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case AgGridActionType.registerSelectedRows: {\n const registerSelectedRowsAction = action as RegisterSelectedRowsAction;\n return updateAgGridState(state, {\n selectedRows: {\n [registerSelectedRowsAction.gridId]: {\n $set: {\n origin: registerSelectedRowsAction.origin,\n ids: registerSelectedRowsAction.ids\n }\n }\n }\n });\n }\n }\n\n return state;\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nimport { provideEffect, provideReducers } from 'ngssm-store';\n\nimport { LocalStorageEffect } from './effects/local-storage.effect';\nimport { GridStatesReducer } from './reducers/grid-states.reducer';\nimport { SelectedRowsReducer } from './reducers/selected-rows.reducer';\n\nexport const provideNgssmAgGrid = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideReducers(GridStatesReducer, SelectedRowsReducer), provideEffect(LocalStorageEffect)]);\n};\n","/*\n * Public API Surface of ngssm-ag-grid\n */\n\nexport * from './lib/actions';\nexport * from './lib/state';\nexport * from './lib/components';\nexport * from './lib/ngssm-ag-grid-options';\nexport * from './lib/helpers';\nexport * from './lib/provide-ngssm-ag-grid';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,gBA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AAa,CAAC,gBAAgB,CAAC,oBAAoB,CAAC;AAqBrF;IAnBQ,WAAW,CAAC,KAAY,EAAE,MAAc,EAAA;AAC7C,QAAA,QAAQ,MAAM,CAAC,IAAI;AACjB,YAAA,KAAK,gBAAgB,CAAC,oBAAoB,EAAE;gBAC1C,MAAM,0BAA0B,GAAG,MAAoC;gBACvE,OAAO,iBAAiB,CAAC,KAAK,EAAE;AAC9B,oBAAA,YAAY,EAAE;AACZ,wBAAA,CAAC,0BAA0B,CAAC,MAAM,GAAG;AACnC,4BAAA,IAAI,EAAE;gCACJ,MAAM,EAAE,0BAA0B,CAAC,MAAM;gCACzC,GAAG,EAAE,0BAA0B,CAAC;AACjC;AACF;AACF;AACF,iBAAA,CAAC;;;AAIN,QAAA,OAAO,KAAK;;8GApBH,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAnB,mBAAmB,EAAA,CAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B;;;ACCM,MAAM,kBAAkB,GAAG,MAA2B;AAC3D,IAAA,OAAO,wBAAwB,CAAC,CAAC,eAAe,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAC/H;;ACVA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ICellRendererParams } from "ag-grid-community";
|
|
2
|
+
/**
|
|
3
|
+
* Represents the parameters required for configuring an action confirmation popup.
|
|
4
|
+
* This interface is designed to be used with ag-Grid and provides options for
|
|
5
|
+
* customizing the popup's message, button labels, color, and confirmation action.
|
|
6
|
+
*
|
|
7
|
+
* @template TData - The type of the data associated with the cell.
|
|
8
|
+
* @template TValue - The type of the value associated with the cell.
|
|
9
|
+
*/
|
|
10
|
+
export interface ActionConfirmationPopupParameter<TData = unknown, TValue = unknown> {
|
|
11
|
+
/**
|
|
12
|
+
* A function that builds the confirmation message to be displayed in the popup.
|
|
13
|
+
*
|
|
14
|
+
* @param params - Optional parameters provided by ag-Grid, including cell data and value.
|
|
15
|
+
* @returns The message to display in the confirmation popup.
|
|
16
|
+
*/
|
|
17
|
+
messageBuilder: (params?: ICellRendererParams<TData, TValue>) => string;
|
|
18
|
+
/**
|
|
19
|
+
* The label for the cancel button in the confirmation popup.
|
|
20
|
+
*/
|
|
21
|
+
cancelButtonLabel: string;
|
|
22
|
+
/**
|
|
23
|
+
* The label for the confirm button in the confirmation popup.
|
|
24
|
+
*/
|
|
25
|
+
confirmButtonLabel: string;
|
|
26
|
+
/**
|
|
27
|
+
* Optional color to customize the appearance of the confirm button.
|
|
28
|
+
*/
|
|
29
|
+
color?: string;
|
|
30
|
+
/**
|
|
31
|
+
* An optional function to execute when the confirm button is clicked.
|
|
32
|
+
*
|
|
33
|
+
* @param params - Optional parameters provided by ag-Grid, including cell data and value.
|
|
34
|
+
*/
|
|
35
|
+
confirmAction?: (params?: ICellRendererParams<TData, TValue>) => void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { WritableSignal } from '@angular/core';
|
|
2
|
+
import { ICellRendererParams } from 'ag-grid-community';
|
|
3
|
+
import { ActionConfirmationPopupParameter } from './action-confirmation-popup-parameter';
|
|
4
|
+
import { ActionPopupComponent } from '../ngssm-actions-cell-renderer';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* The `ActionConfirmationPopupComponent` is a reusable confirmation popup component designed to work with `ag-grid`.
|
|
8
|
+
* It provides a customizable confirmation dialog for user actions, allowing developers to define messages, button labels,
|
|
9
|
+
* and actions dynamically.
|
|
10
|
+
*
|
|
11
|
+
* ### Features:
|
|
12
|
+
* - Displays a confirmation popup with customizable message, button labels, and color.
|
|
13
|
+
* - Integrates with the `ActionPopupComponent` interface for seamless use with `NgssmActionsCellRendererComponent`.
|
|
14
|
+
* - Uses Angular signals for efficient state management.
|
|
15
|
+
* - Supports dynamic initialization with parameters provided by `ag-grid`.
|
|
16
|
+
* - Provides methods to handle user actions (confirm or cancel) and close the popup.
|
|
17
|
+
*
|
|
18
|
+
* ### Usage:
|
|
19
|
+
* This component is typically used as a popup in conjunction with the `NgssmActionsCellRendererComponent`.
|
|
20
|
+
* To configure it, pass an `ActionConfirmationPopupParameter` object when initializing the popup.
|
|
21
|
+
*
|
|
22
|
+
* Example:
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const popupParameter: ActionConfirmationPopupParameter = {
|
|
25
|
+
* messageBuilder: (params) => `Are you sure you want to delete ${params.data.name}?`,
|
|
26
|
+
* color: 'warn',
|
|
27
|
+
* cancelButtonLabel: 'No',
|
|
28
|
+
* confirmButtonLabel: 'Yes',
|
|
29
|
+
* confirmAction: (params) => console.log('Confirmed action for:', params.data)
|
|
30
|
+
* };
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* ### Inputs:
|
|
34
|
+
* - `popupRendered`: A writable signal indicating whether the popup is currently rendered.
|
|
35
|
+
* - `params`: The cell renderer parameters provided by `ag-grid`.
|
|
36
|
+
* - `popupParameter`: An object of type `ActionConfirmationPopupParameter` that defines the popup's behavior and content.
|
|
37
|
+
*
|
|
38
|
+
* ### Outputs:
|
|
39
|
+
* None.
|
|
40
|
+
*
|
|
41
|
+
* ### Dependencies:
|
|
42
|
+
* - Angular Material components: `MatCard`, `MatButton`.
|
|
43
|
+
* - `ag-grid-community` for integration with `ag-grid`.
|
|
44
|
+
*
|
|
45
|
+
* ### Methods:
|
|
46
|
+
* - `init(popupRendered, params, popupParameter)`: Initializes the popup with the provided parameters.
|
|
47
|
+
* - `popupRendered`: A writable signal to track the popup's visibility.
|
|
48
|
+
* - `params`: The cell renderer parameters from `ag-grid`.
|
|
49
|
+
* - `popupParameter`: The configuration object for the popup.
|
|
50
|
+
*
|
|
51
|
+
* - `closePopup()`: Closes the popup by setting the `isOpen` signal to `false`.
|
|
52
|
+
*
|
|
53
|
+
* - `executeAction()`: Executes the confirmation action defined in the `popupParameter` and closes the popup.
|
|
54
|
+
*
|
|
55
|
+
* ### Signals:
|
|
56
|
+
* - `message`: The message displayed in the popup.
|
|
57
|
+
* - `cancelButtonLabel`: The label for the cancel button.
|
|
58
|
+
* - `confirmButtonLabel`: The label for the confirm button.
|
|
59
|
+
* - `color`: The color theme for the confirm button (e.g., 'primary', 'warn').
|
|
60
|
+
* - `isOpen`: Tracks whether the popup is currently open.
|
|
61
|
+
*
|
|
62
|
+
* ### Example Initialization:
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const popup = new ActionConfirmationPopupComponent();
|
|
65
|
+
* popup.init(
|
|
66
|
+
* popupRenderedSignal,
|
|
67
|
+
* cellRendererParams,
|
|
68
|
+
* {
|
|
69
|
+
* messageBuilder: (params) => `Are you sure you want to delete ${params.data.name}?`,
|
|
70
|
+
* color: 'warn',
|
|
71
|
+
* cancelButtonLabel: 'No',
|
|
72
|
+
* confirmButtonLabel: 'Yes',
|
|
73
|
+
* confirmAction: (params) => console.log('Confirmed action for:', params.data)
|
|
74
|
+
* }
|
|
75
|
+
* );
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* ### Notes:
|
|
79
|
+
* - Ensure that the `popupParameter` object is properly configured to avoid runtime errors.
|
|
80
|
+
* - The `messageBuilder` function in `popupParameter` allows dynamic message generation based on the `params` object.
|
|
81
|
+
* - The component uses `ChangeDetectionStrategy.OnPush` for performance optimization.
|
|
82
|
+
* - The `isOpen` signal can be used to programmatically control the popup's visibility.
|
|
83
|
+
*/
|
|
84
|
+
export declare class ActionConfirmationPopupComponent implements ActionPopupComponent<unknown, unknown, ActionConfirmationPopupParameter> {
|
|
85
|
+
private params?;
|
|
86
|
+
private popupParameter?;
|
|
87
|
+
readonly message: WritableSignal<string>;
|
|
88
|
+
readonly cancelButtonLabel: WritableSignal<string>;
|
|
89
|
+
readonly confirmButtonLabel: WritableSignal<string>;
|
|
90
|
+
readonly color: WritableSignal<string>;
|
|
91
|
+
isOpen: WritableSignal<boolean>;
|
|
92
|
+
init(popupRendered: WritableSignal<boolean>, params?: ICellRendererParams<unknown, unknown>, popupParameter?: ActionConfirmationPopupParameter): void;
|
|
93
|
+
closePopup(): void;
|
|
94
|
+
executeAction(): void;
|
|
95
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ActionConfirmationPopupComponent, never>;
|
|
96
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ActionConfirmationPopupComponent, "ngssm-action-confirmation-popup", never, {}, {}, never, never, true, never>;
|
|
97
|
+
}
|
|
@@ -1,12 +1,90 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Signal, Type, WritableSignal } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
+
import { ICellRendererParams } from 'ag-grid-community';
|
|
4
|
+
/**
|
|
5
|
+
* A function type that determines whether an action is disabled.
|
|
6
|
+
*
|
|
7
|
+
* @template TData - The type of the data associated with the row.
|
|
8
|
+
* @template TValue - The type of the value associated with the cell.
|
|
9
|
+
* @param params - The cell renderer parameters provided by `ag-grid`.
|
|
10
|
+
* @returns A boolean indicating whether the action is disabled.
|
|
11
|
+
*/
|
|
3
12
|
export type ActionDisabledFunc<TData = unknown, TValue = unknown> = (params: ICellRendererParams<TData, TValue>) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* A function type that determines whether an action is hidden.
|
|
15
|
+
*
|
|
16
|
+
* @template TData - The type of the data associated with the row.
|
|
17
|
+
* @template TValue - The type of the value associated with the cell.
|
|
18
|
+
* @param params - The cell renderer parameters provided by `ag-grid`.
|
|
19
|
+
* @returns A boolean indicating whether the action is hidden.
|
|
20
|
+
*/
|
|
4
21
|
export type ActionHiddenFunc<TData = unknown, TValue = unknown> = (params: ICellRendererParams<TData, TValue>) => boolean;
|
|
5
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Interface for defining a popup component associated with an action.
|
|
24
|
+
*
|
|
25
|
+
* @template TData - The type of the data associated with the row.
|
|
26
|
+
* @template TValue - The type of the value associated with the cell.
|
|
27
|
+
* @template TPopupParameter - The type of the parameter passed to the popup component.
|
|
28
|
+
*/
|
|
29
|
+
export interface ActionPopupComponent<TData = unknown, TValue = unknown, TPopupParameter = unknown> {
|
|
30
|
+
/**
|
|
31
|
+
* An optional initialization function for the popup component.
|
|
32
|
+
*
|
|
33
|
+
* @param popupRendered - A writable signal indicating whether the popup is rendered.
|
|
34
|
+
* @param params - The cell renderer parameters provided by `ag-grid`.
|
|
35
|
+
* @param popupParameter - Additional parameters for the popup component.
|
|
36
|
+
*/
|
|
37
|
+
init?: (popupRendered: WritableSignal<boolean>, params?: ICellRendererParams<TData, TValue>, popupParameter?: TPopupParameter) => void;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Configuration interface for defining actions in a cell renderer.
|
|
41
|
+
*
|
|
42
|
+
* @template TData - The type of the data associated with the row.
|
|
43
|
+
* @template TValue - The type of the value associated with the cell.
|
|
44
|
+
* @template TPopupComponent - The type of the popup component associated with the action.
|
|
45
|
+
* @template TPopupParameter - The type of the parameter passed to the popup component.
|
|
46
|
+
*/
|
|
47
|
+
export interface ActionConfig<TData = unknown, TValue = unknown, TPopupComponent = unknown, TPopupParameter = unknown> {
|
|
48
|
+
/**
|
|
49
|
+
* The CSS class used for the icon to render.
|
|
50
|
+
*/
|
|
6
51
|
cssClass: string;
|
|
52
|
+
/**
|
|
53
|
+
* The color theme for the action element. Possible values are 'primary', 'accent', or 'warn'.
|
|
54
|
+
* Defaults to 'primary' if not specified.
|
|
55
|
+
*/
|
|
7
56
|
color?: string;
|
|
8
|
-
|
|
9
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Determines whether the action is disabled. This can be a function, an observable, or a signal
|
|
59
|
+
* that evaluates to a boolean value.
|
|
60
|
+
*
|
|
61
|
+
* - If a function is provided, it receives the cell renderer parameters and returns a boolean.
|
|
62
|
+
* - If an observable or signal is provided, it emits a boolean value.
|
|
63
|
+
*/
|
|
64
|
+
isDisabled?: ActionDisabledFunc<TData, TValue> | Observable<boolean> | Signal<boolean>;
|
|
65
|
+
/**
|
|
66
|
+
* Determines whether the action is hidden. This can be a function, an observable, or a signal
|
|
67
|
+
* that evaluates to a boolean value.
|
|
68
|
+
*
|
|
69
|
+
* - If a function is provided, it receives the cell renderer parameters and returns a boolean.
|
|
70
|
+
* - If an observable or signal is provided, it emits a boolean value.
|
|
71
|
+
*/
|
|
72
|
+
isHidden?: ActionHiddenFunc<TData, TValue> | Observable<boolean> | Signal<boolean>;
|
|
73
|
+
/**
|
|
74
|
+
* The callback function to execute when the action is clicked.
|
|
75
|
+
* Receives the cell renderer parameters as an argument.
|
|
76
|
+
*/
|
|
10
77
|
click?: (params: ICellRendererParams<TData, TValue>) => void;
|
|
78
|
+
/**
|
|
79
|
+
* The tooltip text to display when hovering over the action element.
|
|
80
|
+
*/
|
|
11
81
|
tooltip?: string;
|
|
82
|
+
/**
|
|
83
|
+
* The Angular component to render as a popup when the action is triggered.
|
|
84
|
+
*/
|
|
85
|
+
popupComponent?: Type<TPopupComponent>;
|
|
86
|
+
/**
|
|
87
|
+
* Additional parameters to pass to the popup component.
|
|
88
|
+
*/
|
|
89
|
+
popupParameter?: TPopupParameter;
|
|
12
90
|
}
|
package/lib/components/ngssm-actions-cell-renderer/ngssm-actions-cell-renderer.component.d.ts
CHANGED
|
@@ -1,28 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The `NgssmActionsCellRendererComponent` is a custom cell renderer for `ag-grid` that dynamically renders
|
|
3
|
+
* action buttons within a grid cell. It provides flexibility in configuring button behavior, visibility, and state.
|
|
4
|
+
*
|
|
5
|
+
* ### Features:
|
|
6
|
+
* - Dynamically generates action buttons based on the provided configuration.
|
|
7
|
+
* - Supports reactive state management using Angular signals.
|
|
8
|
+
* - Integrates with observables, functions, or signals for `isDisabled` and `isHidden` properties.
|
|
9
|
+
* - Provides customizable tooltips and button styles.
|
|
10
|
+
* - Executes custom actions when buttons are clicked.
|
|
11
|
+
*
|
|
12
|
+
* ### Usage:
|
|
13
|
+
* To use this component, provide it as a cell renderer in your `ag-grid` column definition:
|
|
14
|
+
*
|
|
15
|
+
* ```typescript
|
|
16
|
+
* columnDefs: [
|
|
17
|
+
* {
|
|
18
|
+
* headerName: 'Actions',
|
|
19
|
+
* field: 'actions',
|
|
20
|
+
* cellRenderer: NgssmActionsCellRendererComponent,
|
|
21
|
+
* cellRendererParams: {
|
|
22
|
+
* actions: [
|
|
23
|
+
* {
|
|
24
|
+
* cssClass: 'delete-button',
|
|
25
|
+
* color: 'warn',
|
|
26
|
+
* tooltip: 'Delete Item',
|
|
27
|
+
* isDisabled: (params) => params.data.isLocked,
|
|
28
|
+
* isHidden: (params) => !params.data.canDelete,
|
|
29
|
+
* click: (params) => console.log('Delete action clicked', params)
|
|
30
|
+
* }
|
|
31
|
+
* ]
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
* ];
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* ### Inputs:
|
|
38
|
+
* - `NgssmActionsCellRendererParams`: Configuration object passed to the component via `cellRendererParams`.
|
|
39
|
+
* - `actions`: Array of `ActionConfig` objects defining the buttons to render.
|
|
40
|
+
*
|
|
41
|
+
* ### Outputs:
|
|
42
|
+
* None.
|
|
43
|
+
*
|
|
44
|
+
* ### Dependencies:
|
|
45
|
+
* - Angular Material components: `MatIconButton`, `MatIcon`, `MatTooltip`.
|
|
46
|
+
* - `ag-grid-angular` for integration with `ag-grid`.
|
|
47
|
+
*
|
|
48
|
+
* ### Example ActionConfig:
|
|
49
|
+
* ```typescript
|
|
50
|
+
* interface ActionConfig {
|
|
51
|
+
* cssClass: string; // CSS class for the button.
|
|
52
|
+
* color?: string; // Button color (e.g., 'primary', 'warn').
|
|
53
|
+
* tooltip?: string; // Tooltip text for the button.
|
|
54
|
+
* isDisabled?: boolean | Signal<boolean> | Observable<boolean> | ((params: ICellRendererParams) => boolean);
|
|
55
|
+
* isHidden?: boolean | Signal<boolean> | Observable<boolean> | ((params: ICellRendererParams) => boolean);
|
|
56
|
+
* click?: (params: ICellRendererParams) => void; // Action to execute on button click.
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* ### Methods:
|
|
61
|
+
* - `agInit(params: ICellRendererParams)`: Initializes the component with the provided cell renderer parameters.
|
|
62
|
+
* - `refresh(params: ICellRendererParams)`: Refreshes the component state when the grid updates.
|
|
63
|
+
* - `executeAction(action: ActionButton)`: Executes the action associated with a button.
|
|
64
|
+
*
|
|
65
|
+
* ### Internal Logic:
|
|
66
|
+
* - The `setupActions` method initializes the action buttons based on the provided configuration.
|
|
67
|
+
* - The `setUpActionSignal` method handles the initialization of `isDisabled` and `isHidden` states for each button.
|
|
68
|
+
* - The component uses Angular signals (`WritableSignal` and `Signal`) to manage the state of `isDisabled` and `isHidden`.
|
|
69
|
+
* - Observables are converted to signals using `toSignal` for seamless integration with Angular's reactivity system.
|
|
70
|
+
*
|
|
71
|
+
* ### Change Detection:
|
|
72
|
+
* - The component uses `ChangeDetectionStrategy.OnPush` for improved performance by minimizing unnecessary change detection cycles.
|
|
73
|
+
*
|
|
74
|
+
* ### Notes:
|
|
75
|
+
* - Ensure that the `actions` array in `NgssmActionsCellRendererParams` is properly configured to avoid runtime errors.
|
|
76
|
+
* - The component is designed to work with Angular Material and requires the relevant modules to be imported in your application.
|
|
77
|
+
* - The `isDisabled` and `isHidden` properties can accept multiple input types (boolean, function, signal, or observable), providing flexibility in defining button behavior.
|
|
78
|
+
*/
|
|
79
|
+
import { WritableSignal, Signal } from '@angular/core';
|
|
3
80
|
import { ICellRendererAngularComp } from 'ag-grid-angular';
|
|
4
81
|
import { ICellRendererParams } from 'ag-grid-community';
|
|
5
|
-
import {
|
|
82
|
+
import { NgssmComponentAction } from 'ngssm-toolkit';
|
|
6
83
|
import { ActionConfig } from './action-config';
|
|
7
84
|
import * as i0 from "@angular/core";
|
|
8
85
|
interface ActionButton {
|
|
9
86
|
cssClass: string;
|
|
10
87
|
color: string;
|
|
11
|
-
|
|
12
|
-
|
|
88
|
+
isDisabled: WritableSignal<boolean> | Signal<boolean>;
|
|
89
|
+
isHidden: WritableSignal<boolean> | Signal<boolean>;
|
|
13
90
|
actionConfig: ActionConfig;
|
|
14
91
|
tooltip: string;
|
|
92
|
+
popupRendered: WritableSignal<boolean>;
|
|
93
|
+
popupAction?: NgssmComponentAction;
|
|
15
94
|
}
|
|
16
|
-
export declare class NgssmActionsCellRendererComponent
|
|
17
|
-
private
|
|
18
|
-
private readonly _actionButtons$;
|
|
95
|
+
export declare class NgssmActionsCellRendererComponent implements ICellRendererAngularComp {
|
|
96
|
+
private environmentInjector;
|
|
19
97
|
private cellParams;
|
|
20
|
-
|
|
21
|
-
get actionButtons$(): Observable<ActionButton[]>;
|
|
98
|
+
readonly actionButtons: WritableSignal<ActionButton[]>;
|
|
22
99
|
agInit(params: ICellRendererParams): void;
|
|
23
100
|
refresh(params: ICellRendererParams): boolean;
|
|
24
101
|
executeAction(action: ActionButton): void;
|
|
25
102
|
private setupActions;
|
|
103
|
+
private setUpActionSignal;
|
|
104
|
+
private setupPopupComponent;
|
|
26
105
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgssmActionsCellRendererComponent, never>;
|
|
27
106
|
static ɵcmp: i0.ɵɵComponentDeclaration<NgssmActionsCellRendererComponent, "ngssm-actions-cell-renderer", never, {}, {}, never, never, true, never>;
|
|
28
107
|
}
|