@skyux/ag-grid 14.11.0 → 14.13.0

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.
@@ -1,15 +1,15 @@
1
1
  import * as i0 from '@angular/core';
2
- import { AfterContentInit, AfterViewInit, ElementRef, OnDestroy, TemplateRef, Type, Signal, WritableSignal } from '@angular/core';
2
+ import { AfterContentInit, AfterViewInit, ElementRef, OnDestroy, TemplateRef, Signal, Type, WritableSignal } from '@angular/core';
3
3
  import * as i1$1 from 'ag-grid-angular';
4
4
  import { AgGridAngular, ICellEditorAngularComp, ICellRendererAngularComp, IDateAngularComp, IHeaderGroupAngularComp, IHeaderAngularComp } from 'ag-grid-angular';
5
5
  import * as i2 from '@angular/common';
6
6
  import * as ag_grid_community from 'ag-grid-community';
7
- import { GridOptions, ICellEditorParams, ColumnGroup, IHeaderGroupParams, Column, IHeaderParams, GridApi, ICellRendererParams, IRowNode, IDateParams } from 'ag-grid-community';
7
+ import { GridOptions, ColDef, ICellEditorParams, ICellRendererParams, ColumnGroup, IHeaderGroupParams, Column, IHeaderParams, GridApi, IRowNode, IDateParams } from 'ag-grid-community';
8
8
  import * as i1 from '@skyux/i18n';
9
9
  import { SkyAutocompleteSelectionChange, SkyLookupAddClickEventArgs, SkyAutocompleteSearchFunction, SkyAutocompleteSearchAsyncArgs, SkyAutocompleteSearchFunctionFilter, SkyLookupSelectModeType, SkyLookupShowMoreConfig } from '@skyux/lookup';
10
+ import { SkyNumericOptions } from '@skyux/core';
10
11
  import { Observable, Subject, Subscription, BehaviorSubject } from 'rxjs';
11
12
  import { UntypedFormGroup, UntypedFormControl, FormControl } from '@angular/forms';
12
- import { SkyNumericOptions } from '@skyux/core';
13
13
  import { SkyPopoverMessage } from '@skyux/popovers';
14
14
 
15
15
  declare class SkyAgGridWrapperComponent implements AfterContentInit, AfterViewInit {
@@ -151,17 +151,29 @@ interface SkyGetGridOptionsArgs<T = any> {
151
151
 
152
152
  /**
153
153
  * `SkyAgGridService` provides methods to get AG Grid `gridOptions` to ensure grids match SKY UX functionality. The `gridOptions` can be overridden, and include registered SKY UX column types.
154
+ *
155
+ * Locale text is resolved once, when the grid options are created. [AG Grid does not re-read
156
+ * locale text after a grid is created](https://www.ag-grid.com/angular-data-grid/localisation/),
157
+ * so an application that changes locale at runtime must destroy and recreate the grid. Setting
158
+ * `gridOptions.getLocaleText` replaces SKY UX locale text entirely — use `gridOptions.localeText`
159
+ * to override individual strings instead.
154
160
  */
155
161
  declare class SkyAgGridService {
156
162
  #private;
157
163
  /**
158
164
  * Returns [AG Grid `gridOptions`](https://www.ag-grid.com/angular-data-grid/grid-options/) with default SKY UX options, styling, and cell renderers registered for read-only grids.
165
+ *
166
+ * Locale text is resolved once, at call time. If the application's locale changes at
167
+ * runtime, destroy and recreate the grid to pick up the new locale text.
159
168
  * @param args
160
169
  * @returns
161
170
  */
162
171
  getGridOptions<T = any>(args: SkyGetGridOptionsArgs<T>): GridOptions<T>;
163
172
  /**
164
173
  * Returns [AG Grid `gridOptions`](https://www.ag-grid.com/angular-data-grid/grid-options/) with default SKY UX options, styling, and cell editors registered for editable grids.
174
+ *
175
+ * Locale text is resolved once, at call time. If the application's locale changes at
176
+ * runtime, destroy and recreate the grid to pick up the new locale text.
165
177
  * @param args
166
178
  * @returns
167
179
  */
@@ -234,29 +246,124 @@ interface SkyAutocompleteProperties extends SkyAgGridAutocompleteProperties {
234
246
  }
235
247
 
236
248
  /**
237
- * @internal
249
+ * These column types can be used by setting the AG Grid [column definition `type`](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing) to one of the following values.
250
+ * Any [SKY UX component](https://developer.blackbaud.com/skyux/components) can be made into a [cell editor](https://www.ag-grid.com/angular-data-grid/cell-editors/) or [cell renderer](https://www.ag-grid.com/angular-data-grid/component-cell-renderer/) component. If you would like to use a component that does not have a column definition yet, please consider [contributing it](https://github.com/blackbaud/skyux/blob/main/CONTRIBUTING.md) to the SKY UX data entry grid module.
251
+ * Use `defineSkyAgGridColDef()` to validate a column definition's `cellEditorParams` and `cellRendererParams` against its cell type.
238
252
  */
239
- declare enum SkyCellClass {
240
- Autocomplete = "sky-ag-grid-cell-autocomplete",
241
- Currency = "sky-ag-grid-cell-currency",
242
- Date = "sky-ag-grid-cell-date",
243
- Editable = "sky-ag-grid-cell-editable",
244
- Invalid = "sky-ag-grid-cell-invalid",
245
- Lookup = "sky-ag-grid-cell-lookup",
246
- Number = "sky-ag-grid-cell-number",
247
- RightAligned = "sky-ag-grid-cell-right-aligned",
248
- RowSelector = "sky-ag-grid-cell-row-selector",
249
- Template = "sky-ag-grid-cell-template",
250
- Text = "sky-ag-grid-cell-text",
251
- Uneditable = "sky-ag-grid-cell-uneditable",
252
- Validator = "sky-ag-grid-cell-validator"
253
+ declare enum SkyCellType {
254
+ /**
255
+ * **Edit mode**
256
+ *
257
+ * Cells in the column will be edited as [SKY UX autocomplete components](https://developer.blackbaud.com/skyux/components/autocomplete). You can set any of the autocomplete component's properties by passing `SkyCellEditorAutocompleteParams` in the [column definition's `cellEditorParams` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing). These params can be updated as other cell edits are made or [provided dynamically](https://www.ag-grid.com/angular-data-grid/cell-editing/) based on other cell values. See the demo for an example. Text can be entered and a value selected from the provided list.
258
+ *
259
+ * **Read-only mode**
260
+ *
261
+ * Cells the column will display the currently selected value's name property by default. If the autocomplete needs to show a different property or needs to be formatted in any way, you can [define a `valueFormatter`](https://www.ag-grid.com/angular-data-grid/value-formatters/) on the column definition.
262
+ */
263
+ Autocomplete = "skyCellAutocomplete",
264
+ /**
265
+ * **Edit mode**
266
+ *
267
+ * Cells in the column will be edited as a currency amount.
268
+ *
269
+ * **Read-only mode**
270
+ *
271
+ * Formats the display as currency using [SKY UX numeric components](https://developer.blackbaud.com/skyux/components/numeric).
272
+ */
273
+ Currency = "skyCellCurrency",
274
+ /**
275
+ * **Edit and read-only modes**
276
+ *
277
+ * Combines SkyCellType.Currency and SkyCellType.Validator, where the value is displayed as a currency and passed to a validator function.
278
+ */
279
+ CurrencyValidator = "skyCellCurrencyValidator",
280
+ /**
281
+ * **Edit mode**
282
+ *
283
+ * Cells in the column will be edited as [SKY UX datepicker components](https://developer.blackbaud.com/skyux/components/datepicker). You can set any of the datepicker component's properties by passing `SkyCellEditorDatepickerParams` in the [column definition's `cellEditorParams` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing). These params can be updated as other cell edits are made or [provided dynamically](https://www.ag-grid.com/angular-data-grid/cell-editing/) based on other cell values. See the demo for an example. Date values can be entered.
284
+ *
285
+ * **Read-only mode**
286
+ *
287
+ * Cells in the column will display the currently selected date formatted as `MM-DD-YYYY`, or the date format of the locale passed to `getGridOptions()`. If you would like to overwrite this format, you can [define a `valueFormatter`](https://www.ag-grid.com/angular-data-grid/value-formatters/) on the column definition. See the demo for an example.
288
+ */
289
+ Date = "skyCellDate",
290
+ /**
291
+ * **Edit mode**
292
+ *
293
+ * Cells in the column will be edited as [SKY UX lookup components](https://developer.blackbaud.com/skyux-v5/components/lookup). You can set any of the lookup component's properties by passing `SkyCellEditorLookupParams` in the [column definition's `cellEditorParams` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing). These params can be updated as other cell edits are made or [provided dynamically](https://www.ag-grid.com/angular-data-grid/cell-editing/) based on other cell values. See the demo for an example. Text can be entered and a value selected from the provided list.
294
+ *
295
+ * **Read-only mode**
296
+ *
297
+ * Cells in the column will display, by default, either: the name(s) of the selected value(s) if there are less than 6, or a summary count of the values if there are more than 5. If the lookup needs to show a different property or needs to be formatted in any way, you can [define a `valueFormatter`](https://www.ag-grid.com/angular-data-grid/value-formatters/) on the column definition.
298
+ */
299
+ Lookup = "skyCellLookup",
300
+ /**
301
+ * **Edit mode**
302
+ *
303
+ * Cells in the column will be edited as HTML number `inputs`. Only numbers can be entered.
304
+ *
305
+ * **Read-only mode**
306
+ *
307
+ * Cells in the column will render as the number value.
308
+ */
309
+ Number = "skyCellNumber",
310
+ /**
311
+ * **Edit and read-only modes**
312
+ *
313
+ * Combines SkyCellType.Number and SkyCellType.Validator, where the value is displayed as a number and passed to a validator function.
314
+ */
315
+ NumberValidator = "skyCellNumberValidator",
316
+ /**
317
+ * **Edit and read-only modes**
318
+ *
319
+ * The header and cells in the column will render right aligned.
320
+ */
321
+ RightAligned = "skyCellRightAligned",
322
+ /**
323
+ * **Edit and read-only modes**
324
+ *
325
+ * Cells in the column will render as [SKY UX checkbox components](https://developer.blackbaud.com/skyux/components/checkbox). It allows the user to select multiple rows, and adds a highlight to selected rows. The [Ag Grid `rowNode`](https://www.ag-grid.com/angular-data-grid/row-object/) will be updated to reflect the selected state.
326
+ */
327
+ RowSelector = "skyCellRowSelector",
328
+ /**
329
+ * **Read-only mode**
330
+ *
331
+ * Cells in the column will render in a `TemplateRef` passed in the column definition's `cellRendererParams.template` property, with `value` and `row` context. See the demo for an example.
332
+ */
333
+ Template = "skyCellTemplate",
334
+ /**
335
+ * **Edit mode**
336
+ *
337
+ * Cells in the column will be edited as HTML text `inputs`. Any characters can be entered.
338
+ *
339
+ * **Read-only mode**
340
+ *
341
+ * Cells in the column will render as their string value.
342
+ */
343
+ Text = "skyCellText",
344
+ /**
345
+ * **Edit and read-only modes**
346
+ *
347
+ * Cells in the column will be passed to a validator function that flags erroneous entries. You can set the validator function and message by passing a `SkyAgGridValidatorProperties` object as `skyComponentProperties` to [column definition's `cellRendererParams` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing), like `skyComponentProperties.validator` and `skyComponentProperties.validatorMessage`. SkyCellType.Validator can be combined with other cell types, such as SkyCellType.Autocomplete or SkyCellType.Date, by using the array syntax for the [column definition's `type` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing).
348
+ */
349
+ Validator = "skyCellValidator"
253
350
  }
254
351
 
255
- interface SkyCellEditorAutocompleteParams extends ICellEditorParams {
352
+ interface SkyAgGridCurrencyProperties {
256
353
  /**
257
- * The parameters provided to the autocomplete component.
354
+ * The currency symbol to display in the cell.
355
+ * @default "$"
258
356
  */
259
- skyComponentProperties?: SkyAutocompleteProperties | SkyAgGridAutocompleteProperties;
357
+ currencySymbol?: string;
358
+ /**
359
+ * The number of decimal places to display on the currency.
360
+ * @default 2
361
+ */
362
+ decimalPlaces?: number | string;
363
+ /**
364
+ * Adds the specified brackets around negative values when unfocused.
365
+ */
366
+ negativeBracketsTypeOnBlur?: '(,)' | '[,]' | '<,>' | '{,}' | '〈,〉' | '「,」' | '⸤,⸥' | '⟦,⟧' | '‹,›' | '«,»' | null;
260
367
  }
261
368
 
262
369
  interface SkyAgGridDatepickerProperties {
@@ -295,25 +402,6 @@ interface SkyAgGridDatepickerProperties {
295
402
  interface SkyDatepickerProperties extends SkyAgGridDatepickerProperties {
296
403
  }
297
404
 
298
- interface SkyCellEditorDatepickerParams extends ICellEditorParams {
299
- /**
300
- * The parameters provided to the datepicker component.
301
- */
302
- skyComponentProperties?: SkyDatepickerProperties | SkyAgGridDatepickerProperties;
303
- }
304
-
305
- /** The initial action that a cell editor should take when initialized. */
306
- declare enum SkyAgGridCellEditorInitialAction {
307
- /** The cell should be cleared. */
308
- Delete = 0,
309
- /** The cell value should be highlighted. */
310
- Highlighted = 1,
311
- /** The cell value should be replaced with the initializing value. */
312
- Replace = 2,
313
- /** The cell should not be modified and the cursor is placed at the end of the value. */
314
- Untouched = 3
315
- }
316
-
317
405
  interface SkyAgGridLookupProperties {
318
406
  /**
319
407
  * Fires when users select the button to add options to the list. When the button opens a modal, include
@@ -422,145 +510,292 @@ interface SkyAgGridLookupProperties {
422
510
  wrapperClass?: string;
423
511
  }
424
512
 
425
- interface SkyCellEditorLookupParams extends ICellEditorParams {
513
+ interface SkyAgGridNumberProperties {
426
514
  /**
427
- * The parameters provided to the lookup component.
515
+ * The maximum number that users can enter in the cell.
428
516
  */
429
- skyComponentProperties?: SkyAgGridLookupProperties;
430
- }
431
-
432
- declare class SkyAgGridCellEditorUtils {
517
+ max?: number;
433
518
  /**
434
- * Gets the initial action that a cell editor should take when initialized.
435
- * @param params The editor's initializing parameters.
519
+ * The minimum number that users can enter in the cell.
436
520
  */
437
- static getEditorInitialAction(params: ICellEditorParams | undefined): SkyAgGridCellEditorInitialAction;
521
+ min?: number;
522
+ }
523
+
524
+ interface SkyAgGridTextProperties {
438
525
  /**
439
- * Returns the difference between the minuend and subtrahend. If the minuend is not defined, returns 0.
440
- * @param minuend The number from which another number is subtracted.
441
- * @param subtrahend The number that is subtracted from the minuend.
526
+ * The maximum length of the text that users can enter into the cell.
442
527
  */
443
- static subtractOrZero(minuend: number | null | undefined, subtrahend: number): number;
528
+ maxlength?: number;
444
529
  }
445
530
 
446
531
  /**
447
- * These column types can be used by setting the AG Grid [column definition `type`](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing) to one of the following values.
448
- * Any [SKY UX component](https://developer.blackbaud.com/skyux/components) can be made into a [cell editor](https://www.ag-grid.com/angular-data-grid/cell-editors/) or [cell renderer](https://www.ag-grid.com/angular-data-grid/component-cell-renderer/) component. If you would like to use a component that does not have a column definition yet, please consider [contributing it](https://github.com/blackbaud/skyux/blob/main/CONTRIBUTING.md) to the SKY UX data entry grid module.
532
+ * The parameters that each SKY UX cell type accepts in the
533
+ * [column definition's `cellEditorParams` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing-cellEditorParams).
534
+ * Cell types that map to `never` do not accept editor parameters.
535
+ * Use `defineSkyAgGridColDef()` to validate `cellEditorParams` against the column's
536
+ * cell type.
449
537
  */
450
- declare enum SkyCellType {
451
- /**
452
- * **Edit mode**
453
- *
454
- * Cells in the column will be edited as [SKY UX autocomplete components](https://developer.blackbaud.com/skyux/components/autocomplete). You can set any of the autocomplete component's properties by passing `SkyCellEditorAutocompleteParams` in the [column definition's `cellEditorParams` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing). These params can be updated as other cell edits are made or [provided dynamically](https://www.ag-grid.com/angular-data-grid/cell-editing/) based on other cell values. See the demo for an example. Text can be entered and a value selected from the provided list.
455
- *
456
- * **Read-only mode**
457
- *
458
- * Cells the column will display the currently selected value's name property by default. If the autocomplete needs to show a different property or needs to be formatted in any way, you can [define a `valueFormatter`](https://www.ag-grid.com/angular-data-grid/value-formatters/) on the column definition.
459
- */
460
- Autocomplete = "skyCellAutocomplete",
461
- /**
462
- * **Edit mode**
463
- *
464
- * Cells in the column will be edited as a currency amount.
465
- *
466
- * **Read-only mode**
467
- *
468
- * Formats the display as currency using [SKY UX numeric components](https://developer.blackbaud.com/skyux/components/numeric).
469
- */
470
- Currency = "skyCellCurrency",
471
- /**
472
- * **Edit and read-only modes**
473
- *
474
- * Combines SkyCellType.Currency and SkyCellType.Validator, where the value is displayed as a currency and passed to a validator function.
475
- */
476
- CurrencyValidator = "skyCellCurrencyValidator",
477
- /**
478
- * **Edit mode**
479
- *
480
- * Cells in the column will be edited as [SKY UX datepicker components](https://developer.blackbaud.com/skyux/components/datepicker). You can set any of the datepicker component's properties by passing `SkyCellEditorDatepickerParams` in the [column definition's `cellEditorParams` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing). These params can be updated as other cell edits are made or [provided dynamically](https://www.ag-grid.com/angular-data-grid/cell-editing/) based on other cell values. See the demo for an example. Date values can be entered.
481
- *
482
- * **Read-only mode**
483
- *
484
- * Cells in the column will display the currently selected date formatted as `MM-DD-YYYY`, or the date format of the locale passed to `getGridOptions()`. If you would like to overwrite this format, you can [define a `valueFormatter`](https://www.ag-grid.com/angular-data-grid/value-formatters/) on the column definition. See the demo for an example.
485
- */
486
- Date = "skyCellDate",
538
+ interface SkyCellEditorParamsByType {
539
+ [SkyCellType.Autocomplete]: {
540
+ /**
541
+ * The parameters provided to the autocomplete component.
542
+ */
543
+ skyComponentProperties?: SkyAutocompleteProperties | SkyAgGridAutocompleteProperties;
544
+ };
545
+ [SkyCellType.Currency]: {
546
+ /**
547
+ * The parameters provided to the currency cell editor.
548
+ */
549
+ skyComponentProperties?: SkyAgGridCurrencyProperties;
550
+ };
551
+ [SkyCellType.CurrencyValidator]: {
552
+ /**
553
+ * The parameters provided to the currency cell editor.
554
+ */
555
+ skyComponentProperties?: SkyAgGridCurrencyProperties;
556
+ };
557
+ [SkyCellType.Date]: {
558
+ /**
559
+ * The parameters provided to the datepicker component.
560
+ */
561
+ skyComponentProperties?: SkyDatepickerProperties | SkyAgGridDatepickerProperties;
562
+ };
563
+ [SkyCellType.Lookup]: {
564
+ /**
565
+ * The parameters provided to the lookup component.
566
+ */
567
+ skyComponentProperties?: SkyAgGridLookupProperties;
568
+ };
569
+ [SkyCellType.Number]: {
570
+ /**
571
+ * The parameters provided to the number cell editor.
572
+ */
573
+ skyComponentProperties?: SkyAgGridNumberProperties;
574
+ };
575
+ [SkyCellType.NumberValidator]: {
576
+ /**
577
+ * The parameters provided to the number cell editor.
578
+ */
579
+ skyComponentProperties?: SkyAgGridNumberProperties;
580
+ };
581
+ [SkyCellType.RightAligned]: never;
582
+ [SkyCellType.RowSelector]: never;
583
+ [SkyCellType.Template]: never;
584
+ [SkyCellType.Text]: {
585
+ /**
586
+ * The parameters provided to the text cell editor.
587
+ */
588
+ skyComponentProperties?: SkyAgGridTextProperties;
589
+ };
590
+ [SkyCellType.Validator]: never;
591
+ }
592
+
593
+ interface SkyAgGridValidatorProperties<TValue = unknown, TData = unknown> {
487
594
  /**
488
- * **Edit mode**
489
- *
490
- * Cells in the column will be edited as [SKY UX lookup components](https://developer.blackbaud.com/skyux-v5/components/lookup). You can set any of the lookup component's properties by passing `SkyCellEditorLookupParams` in the [column definition's `cellEditorParams` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing). These params can be updated as other cell edits are made or [provided dynamically](https://www.ag-grid.com/angular-data-grid/cell-editing/) based on other cell values. See the demo for an example. Text can be entered and a value selected from the provided list.
491
- *
492
- * **Read-only mode**
493
- *
494
- * Cells the column will display, by default, either: the name(s) of the selected value(s) if there are less than 6, or a summary count of the values if there are more than 5. If the lookup needs to show a different property or needs to be formatted in any way, you can [define a `valueFormatter`](https://www.ag-grid.com/angular-data-grid/value-formatters/) on the column definition.
595
+ * An optional function that returns an observable that emits a string. Can be used with resources to localize the
596
+ * value displayed in the cell.
495
597
  */
496
- Lookup = "skyCellLookup",
598
+ valueResourceObservable?: (value: TValue, data?: TData, rowIndex?: number | null) => Observable<string>;
497
599
  /**
498
- * **Edit mode**
499
- *
500
- * Cells in the column will be edited as HTML number `inputs`. Only numbers can be entered.
501
- *
502
- * **Read-only mode**
503
- *
504
- * Cells in the column will render as the number value.
600
+ * A function that returns true if the value is valid, or false if it is not. Invalid values
601
+ * will be highlighted and display a validation message.
505
602
  */
506
- Number = "skyCellNumber",
603
+ validator?: (value: TValue, data?: TData, rowIndex?: number | null) => boolean;
507
604
  /**
508
- * **Edit and read-only modes**
509
- *
510
- * Combines SkyCellType.Number and SkyCellType.Validator, where the value is displayed as a number and passed to a validator function.
605
+ * A string signal function, a string, or a function that returns a string. The message to display when the value is
606
+ * invalid.
511
607
  */
512
- NumberValidator = "skyCellNumberValidator",
608
+ validatorMessage?: Signal<string> | string | ((value: TValue, data?: TData, rowIndex?: number | null) => string);
609
+ }
610
+
611
+ /**
612
+ * The parameters that each SKY UX cell type accepts in the
613
+ * [column definition's `cellRendererParams` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-styling-cellRendererParams).
614
+ * Cell types that map to `never` do not accept renderer parameters.
615
+ * Use `defineSkyAgGridColDef()` to validate `cellRendererParams` against the column's
616
+ * cell type.
617
+ */
618
+ interface SkyCellRendererParamsByType<TData = unknown, TValue = unknown> {
619
+ [SkyCellType.Autocomplete]: never;
620
+ [SkyCellType.Currency]: {
621
+ /**
622
+ * Options to pass to the `SkyNumericPipe` for formatting the cell value,
623
+ * and validator properties to flag erroneous entries. `format` is always
624
+ * set to `'currency'`. If not specified, `minDigits` defaults to `2` and
625
+ * `truncate` defaults to `false`.
626
+ */
627
+ skyComponentProperties?: SkyNumericOptions & SkyAgGridValidatorProperties<TValue, TData>;
628
+ };
629
+ [SkyCellType.CurrencyValidator]: {
630
+ /**
631
+ * Options to pass to the `SkyNumericPipe` for formatting the cell value,
632
+ * and validator properties to flag erroneous entries. `format` is always
633
+ * set to `'currency'`. If not specified, `minDigits` defaults to `2` and
634
+ * `truncate` defaults to `false`.
635
+ */
636
+ skyComponentProperties?: SkyNumericOptions & SkyAgGridValidatorProperties<TValue, TData>;
637
+ };
638
+ [SkyCellType.Date]: never;
639
+ [SkyCellType.Lookup]: {
640
+ /**
641
+ * The parameters provided to the lookup component.
642
+ */
643
+ skyComponentProperties?: SkyAgGridLookupProperties;
644
+ };
645
+ [SkyCellType.Number]: {
646
+ /**
647
+ * The validator properties used to validate the cell value and display a
648
+ * validation message.
649
+ */
650
+ skyComponentProperties?: SkyAgGridValidatorProperties<TValue, TData>;
651
+ };
652
+ [SkyCellType.NumberValidator]: {
653
+ /**
654
+ * The validator properties used to validate the cell value and display a
655
+ * validation message.
656
+ */
657
+ skyComponentProperties?: SkyAgGridValidatorProperties<TValue, TData>;
658
+ };
659
+ [SkyCellType.RightAligned]: never;
660
+ [SkyCellType.RowSelector]: {
661
+ /**
662
+ * The `aria-label` for the row selector checkbox, or a function that
663
+ * returns it from the row's data. If not specified, the label defaults to
664
+ * a localized string that includes the row number.
665
+ */
666
+ label?: string | ((data: TData) => string | Observable<string>);
667
+ };
668
+ [SkyCellType.Template]: {
669
+ /**
670
+ * The template to render in the cell. The template's context is a
671
+ * `SkyCellRendererTemplateContext` with `value` and `row` properties.
672
+ */
673
+ template: TemplateRef<unknown> | Signal<TemplateRef<unknown> | undefined>;
674
+ };
675
+ [SkyCellType.Text]: {
676
+ /**
677
+ * The validator properties used to validate the cell value and display a
678
+ * validation message.
679
+ */
680
+ skyComponentProperties?: SkyAgGridValidatorProperties<TValue, TData>;
681
+ };
682
+ [SkyCellType.Validator]: {
683
+ /**
684
+ * The validator properties used to validate the cell value and display a
685
+ * validation message.
686
+ */
687
+ skyComponentProperties?: SkyAgGridValidatorProperties<TValue, TData>;
688
+ };
689
+ }
690
+
691
+ type UnionToIntersection<U> = [U] extends [never] ? never : (U extends unknown ? (u: U) => void : never) extends (i: infer I) => void ? I : never;
692
+ /**
693
+ * A column definition that validates `cellEditorParams` and
694
+ * `cellRendererParams` against the SKY UX cell types in the column's `type`
695
+ * property. Combine cell types by passing a union of `SkyCellType` values,
696
+ * like `SkyAgGridColDef<SkyCellType.Number | SkyCellType.Validator>`.
697
+ */
698
+ type SkyAgGridColDef<T extends SkyCellType, TData = any, TValue = any> = Omit<ColDef<TData, TValue>, 'type' | 'cellEditorParams' | 'cellRendererParams'> & {
699
+ type: T | T[];
700
+ cellEditorParams?: UnionToIntersection<SkyCellEditorParamsByType[T]> | ((params: ICellEditorParams<TData, TValue>) => UnionToIntersection<SkyCellEditorParamsByType[T]>);
701
+ cellRendererParams?: UnionToIntersection<SkyCellRendererParamsByType<TData, TValue>[T]> | ((params: ICellRendererParams<TData, TValue>) => UnionToIntersection<SkyCellRendererParamsByType<TData, TValue>[T]>);
702
+ };
703
+ /**
704
+ * Builds a column definition whose `cellEditorParams` and `cellRendererParams`
705
+ * are validated against the SKY UX cell types in the `type` property. The cell
706
+ * type is inferred, so no type arguments are needed:
707
+ * ```
708
+ * defineSkyAgGridColDef({
709
+ * field: 'endDate',
710
+ * type: [SkyCellType.Date, SkyCellType.Validator],
711
+ * cellRendererParams: { skyComponentProperties: { validator: ... } },
712
+ * })
713
+ * ```
714
+ */
715
+ declare function defineSkyAgGridColDef<T extends SkyCellType, F extends string = never, C extends SkyAgGridColDef<T> = SkyAgGridColDef<T>>(colDef: C & SkyAgGridColDef<T> & {
716
+ field?: F;
717
+ } & Record<Exclude<keyof C, keyof SkyAgGridColDef<T>>, never>): C & {
718
+ field?: F;
719
+ };
720
+
721
+ /**
722
+ * @internal
723
+ */
724
+ declare enum SkyCellClass {
725
+ Autocomplete = "sky-ag-grid-cell-autocomplete",
726
+ Currency = "sky-ag-grid-cell-currency",
727
+ Date = "sky-ag-grid-cell-date",
728
+ Editable = "sky-ag-grid-cell-editable",
729
+ Invalid = "sky-ag-grid-cell-invalid",
730
+ Lookup = "sky-ag-grid-cell-lookup",
731
+ Number = "sky-ag-grid-cell-number",
732
+ RightAligned = "sky-ag-grid-cell-right-aligned",
733
+ RowSelector = "sky-ag-grid-cell-row-selector",
734
+ Template = "sky-ag-grid-cell-template",
735
+ Text = "sky-ag-grid-cell-text",
736
+ Uneditable = "sky-ag-grid-cell-uneditable",
737
+ Validator = "sky-ag-grid-cell-validator"
738
+ }
739
+
740
+ interface SkyCellEditorAutocompleteParams extends ICellEditorParams {
513
741
  /**
514
- * **Edit and read-only modes**
515
- *
516
- * The header and cells in the column will render right aligned.
742
+ * The parameters provided to the autocomplete component.
517
743
  */
518
- RightAligned = "skyCellRightAligned",
744
+ skyComponentProperties?: SkyAutocompleteProperties | SkyAgGridAutocompleteProperties;
745
+ }
746
+
747
+ interface SkyCellEditorDatepickerParams extends ICellEditorParams {
519
748
  /**
520
- * **Edit and read-only modes**
521
- *
522
- * Cells in the column will render as [SKY UX checkbox components](https://developer.blackbaud.com/skyux/components/checkbox). It allows the user to select multiple rows, and adds a highlight to selected rows. The [Ag Grid `rowNode`](https://www.ag-grid.com/angular-data-grid/row-object/) will be updated to reflect the selected state.
749
+ * The parameters provided to the datepicker component.
523
750
  */
524
- RowSelector = "skyCellRowSelector",
751
+ skyComponentProperties?: SkyDatepickerProperties | SkyAgGridDatepickerProperties;
752
+ }
753
+
754
+ /** The initial action that a cell editor should take when initialized. */
755
+ declare enum SkyAgGridCellEditorInitialAction {
756
+ /** The cell should be cleared. */
757
+ Delete = 0,
758
+ /** The cell value should be highlighted. */
759
+ Highlighted = 1,
760
+ /** The cell value should be replaced with the initializing value. */
761
+ Replace = 2,
762
+ /** The cell should not be modified and the cursor is placed at the end of the value. */
763
+ Untouched = 3
764
+ }
765
+
766
+ interface SkyCellEditorLookupParams extends ICellEditorParams {
525
767
  /**
526
- * **Read-only mode**
527
- *
528
- * Cells in the column will render in a `TemplateRef` passed in the column definition's `cellRendererParams.template` property, with `value` and `row` context. See the demo for an example.
768
+ * The parameters provided to the lookup component.
529
769
  */
530
- Template = "skyCellTemplate",
770
+ skyComponentProperties?: SkyAgGridLookupProperties;
771
+ }
772
+
773
+ declare class SkyAgGridCellEditorUtils {
531
774
  /**
532
- * **Edit mode**
533
- *
534
- * Cells in the column will be edited as HTML text `inputs`. Any characters can be entered.
535
- *
536
- * **Read-only mode**
537
- *
538
- * Cells in the column will render as their string value.
775
+ * Gets the initial action that a cell editor should take when initialized.
776
+ * @param params The editor's initializing parameters.
539
777
  */
540
- Text = "skyCellText",
778
+ static getEditorInitialAction(params: ICellEditorParams | undefined): SkyAgGridCellEditorInitialAction;
541
779
  /**
542
- * **Edit and read-only modes**
543
- *
544
- * Cells in the column will be passed to a validator function that flags erroneous entries. You can set the validator function and message by passing a `SkyAgGridValidatorProperties` object as `skyComponentProperties` to [column definition's `cellRendererParams` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing), like `skyComponentProperties.validator` and `skyComponentProperties.validatorMessage`. SkyCellType.Validator can be combined with other cell types, such as SkyCellType.Autocomplete or SkyCellType.Date, by using the array syntax for the [column definition's `type` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing).
780
+ * Returns the difference between the minuend and subtrahend. If the minuend is not defined, returns 0.
781
+ * @param minuend The number from which another number is subtracted.
782
+ * @param subtrahend The number that is subtracted from the minuend.
545
783
  */
546
- Validator = "skyCellValidator"
784
+ static subtractOrZero(minuend: number | null | undefined, subtrahend: number): number;
547
785
  }
548
786
 
549
- interface SkyAgGridCurrencyProperties {
787
+ /**
788
+ * The context provided to the template of a template cell renderer.
789
+ */
790
+ interface SkyCellRendererTemplateContext {
550
791
  /**
551
- * The currency symbol to display in the cell.
552
- * @default "$"
792
+ * The cell's value.
553
793
  */
554
- currencySymbol?: string;
794
+ value: unknown;
555
795
  /**
556
- * The number of decimal places to display on the currency.
557
- * @default 2
796
+ * The row's data.
558
797
  */
559
- decimalPlaces?: number | string;
560
- /**
561
- * Adds the specified brackets around negative values when unfocused.
562
- */
563
- negativeBracketsTypeOnBlur?: '(,)' | '[,]' | '<,>' | '{,}' | '〈,〉' | '「,」' | '⸤,⸥' | '⟦,⟧' | '‹,›' | '«,»' | null;
798
+ row: object | undefined;
564
799
  }
565
800
 
566
801
  /**
@@ -655,42 +890,6 @@ interface SkyAgGridHeaderParams extends IHeaderParams {
655
890
  inlineHelpComponent?: Type<unknown>;
656
891
  }
657
892
 
658
- interface SkyAgGridNumberProperties {
659
- /**
660
- * The maximum number that users can enter in the cell.
661
- */
662
- max?: number;
663
- /**
664
- * The minimum number that users can enter in the cell.
665
- */
666
- min?: number;
667
- }
668
-
669
- interface SkyAgGridTextProperties {
670
- /**
671
- * The maximum length of the text that users can enter into the cell.
672
- */
673
- maxlength?: number;
674
- }
675
-
676
- interface SkyAgGridValidatorProperties {
677
- /**
678
- * An optional function that returns an observable that emits a string. Can be used with resources to localize the
679
- * value displayed in the cell.
680
- */
681
- valueResourceObservable?: (value: unknown, data?: unknown, rowIndex?: number | null) => Observable<string>;
682
- /**
683
- * A function that returns true if the value is valid, or false if it is not. Invalid values
684
- * will be highlighted and display a validation message.
685
- */
686
- validator?: (value: unknown, data?: unknown, rowIndex?: number | null) => boolean;
687
- /**
688
- * A string signal function, a string, or a function that returns a string. The message to display when the value is
689
- * invalid.
690
- */
691
- validatorMessage?: Signal<string> | string | ((value: unknown, data?: unknown, rowIndex?: number | null) => string);
692
- }
693
-
694
893
  /**
695
894
  * Used to provide dependencies to the `SkyAgGridRowDeleteComponent` overlay.
696
895
  * @internal
@@ -1068,7 +1267,7 @@ declare class SkyAgGridCellValidatorTooltipComponent {
1068
1267
  #private;
1069
1268
  readonly params: i0.InputSignal<SkyCellRendererValidatorParams | undefined>;
1070
1269
  protected readonly popoverMessageStream: Subject<SkyPopoverMessage>;
1071
- protected readonly validatorProperties: i0.Signal<SkyAgGridValidatorProperties | undefined>;
1270
+ protected readonly validatorProperties: i0.Signal<SkyAgGridValidatorProperties<unknown, unknown> | undefined>;
1072
1271
  protected readonly validatorMessage: i0.Signal<string>;
1073
1272
  protected readonly showValidatorMessage: i0.Signal<boolean>;
1074
1273
  constructor();
@@ -1140,5 +1339,5 @@ declare class SkyAgGridHeaderComponent implements IHeaderAngularComp, OnDestroy,
1140
1339
  static ɵcmp: i0.ɵɵComponentDeclaration<SkyAgGridHeaderComponent, "sky-ag-grid-header", never, {}, {}, never, never, true, never>;
1141
1340
  }
1142
1341
 
1143
- export { SkyAgGridCellEditorInitialAction, SkyAgGridCellEditorUtils, SkyAgGridHeaderGroupInfo, SkyAgGridHeaderInfo, SkyAgGridModule, SkyAgGridService, SkyCellClass, SkyCellType, SkyHeaderClass, SkyAgGridCellEditorAutocompleteComponent as λ1, SkyAgGridCellRendererValidatorTooltipComponent as λ10, SkyAgGridCellValidatorTooltipComponent as λ11, SkyAgGridWrapperComponent as λ12, SkyAgGridRowDeleteDirective as λ13, SkyAgGridDataManagerAdapterDirective as λ14, SkyAgGridCellEditorLookupComponent as λ15, SkyAgGridCellRendererLookupComponent as λ16, SkyAgGridHeaderComponent as λ17, SkyAgGridHeaderGroupComponent as λ18, SkyAgGridColumnFilterDatepickerComponent as λ19, SkyAgGridCellEditorTextComponent as λ2, SkyAgGridCellEditorCurrencyComponent as λ3, SkyAgGridCellEditorNumberComponent as λ4, SkyAgGridCellEditorDatepickerComponent as λ5, SkyAgGridRowDeleteComponent as λ6, SkyAgGridCellRendererRowSelectorComponent as λ7, SkyAgGridCellRendererCurrencyValidatorComponent as λ8, SkyAgGridCellRendererCurrencyComponent as λ9 };
1144
- export type { SkyAgGridAutocompleteProperties, SkyAgGridCurrencyProperties, SkyAgGridDatepickerProperties, SkyAgGridHeaderGroupParams, SkyAgGridHeaderParams, SkyAgGridLookupProperties, SkyAgGridNumberProperties, SkyAgGridRowDeleteCancelArgs, SkyAgGridRowDeleteConfirmArgs, SkyAgGridTextProperties, SkyAgGridValidatorProperties, SkyAutocompleteProperties, SkyCellEditorAutocompleteParams, SkyCellEditorDatepickerParams, SkyCellEditorLookupParams, SkyDatepickerProperties, SkyGetGridOptionsArgs };
1342
+ export { SkyAgGridCellEditorInitialAction, SkyAgGridCellEditorUtils, SkyAgGridHeaderGroupInfo, SkyAgGridHeaderInfo, SkyAgGridModule, SkyAgGridService, SkyCellClass, SkyCellType, SkyHeaderClass, defineSkyAgGridColDef, SkyAgGridCellEditorAutocompleteComponent as λ1, SkyAgGridCellRendererValidatorTooltipComponent as λ10, SkyAgGridCellValidatorTooltipComponent as λ11, SkyAgGridWrapperComponent as λ12, SkyAgGridRowDeleteDirective as λ13, SkyAgGridDataManagerAdapterDirective as λ14, SkyAgGridCellEditorLookupComponent as λ15, SkyAgGridCellRendererLookupComponent as λ16, SkyAgGridHeaderComponent as λ17, SkyAgGridHeaderGroupComponent as λ18, SkyAgGridColumnFilterDatepickerComponent as λ19, SkyAgGridCellEditorTextComponent as λ2, SkyAgGridCellEditorCurrencyComponent as λ3, SkyAgGridCellEditorNumberComponent as λ4, SkyAgGridCellEditorDatepickerComponent as λ5, SkyAgGridRowDeleteComponent as λ6, SkyAgGridCellRendererRowSelectorComponent as λ7, SkyAgGridCellRendererCurrencyValidatorComponent as λ8, SkyAgGridCellRendererCurrencyComponent as λ9 };
1343
+ export type { SkyAgGridAutocompleteProperties, SkyAgGridColDef, SkyAgGridCurrencyProperties, SkyAgGridDatepickerProperties, SkyAgGridHeaderGroupParams, SkyAgGridHeaderParams, SkyAgGridLookupProperties, SkyAgGridNumberProperties, SkyAgGridRowDeleteCancelArgs, SkyAgGridRowDeleteConfirmArgs, SkyAgGridTextProperties, SkyAgGridValidatorProperties, SkyAutocompleteProperties, SkyCellEditorAutocompleteParams, SkyCellEditorDatepickerParams, SkyCellEditorLookupParams, SkyCellEditorParamsByType, SkyCellRendererParamsByType, SkyCellRendererTemplateContext, SkyDatepickerProperties, SkyGetGridOptionsArgs };