@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.
@@ -84,6 +84,8 @@ const RESOURCES = {
84
84
  sky_ag_grid_column_group_header_collapse_aria_label: {
85
85
  message: 'Collapse column group {0}',
86
86
  },
87
+ sky_ag_grid_locale_no_rows_to_show: { message: 'No data available' },
88
+ sky_ag_grid_locale_no_matching_rows: { message: 'No matching rows' },
87
89
  },
88
90
  'FR-CA': {
89
91
  sky_ag_grid_row_selector_aria_label: {
@@ -311,6 +313,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
311
313
  /**
312
314
  * 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.
313
315
  * 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.
316
+ * Use `defineSkyAgGridColDef()` to validate a column definition's `cellEditorParams` and `cellRendererParams` against its cell type.
314
317
  */
315
318
  var SkyCellType;
316
319
  (function (SkyCellType) {
@@ -357,7 +360,7 @@ var SkyCellType;
357
360
  *
358
361
  * **Read-only mode**
359
362
  *
360
- * 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.
363
+ * 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.
361
364
  */
362
365
  SkyCellType["Lookup"] = "skyCellLookup";
363
366
  /**
@@ -3612,8 +3615,22 @@ function getValidatorCellRendererSelector(component, fallback) {
3612
3615
  };
3613
3616
  }
3614
3617
  let rowNodeId = -1;
3618
+ const skyAgGridLocaleTextDefaults = {
3619
+ noRowsToShow: 'No data available',
3620
+ noMatchingRows: 'No matching rows',
3621
+ };
3622
+ const skyAgGridLocaleTextResourceKeys = {
3623
+ noRowsToShow: 'sky_ag_grid_locale_no_rows_to_show',
3624
+ noMatchingRows: 'sky_ag_grid_locale_no_matching_rows',
3625
+ };
3615
3626
  /**
3616
3627
  * `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.
3628
+ *
3629
+ * Locale text is resolved once, when the grid options are created. [AG Grid does not re-read
3630
+ * locale text after a grid is created](https://www.ag-grid.com/angular-data-grid/localisation/),
3631
+ * so an application that changes locale at runtime must destroy and recreate the grid. Setting
3632
+ * `gridOptions.getLocaleText` replaces SKY UX locale text entirely — use `gridOptions.localeText`
3633
+ * to override individual strings instead.
3617
3634
  */
3618
3635
  class SkyAgGridService {
3619
3636
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -3629,8 +3646,13 @@ class SkyAgGridService {
3629
3646
  #numberValidatorMsg = toSignal(this.#resources?.getString('sky_ag_grid_cell_renderer_number_validator_message') ?? of('Please enter a valid number'), { initialValue: 'Please enter a valid number' });
3630
3647
  #rowSelectorHeading = toSignal(this.#resources?.getString('sky_ag_grid_row_selector_column_heading') ??
3631
3648
  of('Row selection'), { initialValue: 'Row selection' });
3649
+ #localeText = toSignal(this.#resources?.getStrings(skyAgGridLocaleTextResourceKeys) ??
3650
+ of(skyAgGridLocaleTextDefaults), { initialValue: skyAgGridLocaleTextDefaults });
3632
3651
  /**
3633
3652
  * 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.
3653
+ *
3654
+ * Locale text is resolved once, at call time. If the application's locale changes at
3655
+ * runtime, destroy and recreate the grid to pick up the new locale text.
3634
3656
  * @param args
3635
3657
  * @returns
3636
3658
  */
@@ -3641,6 +3663,9 @@ class SkyAgGridService {
3641
3663
  }
3642
3664
  /**
3643
3665
  * 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.
3666
+ *
3667
+ * Locale text is resolved once, at call time. If the application's locale changes at
3668
+ * runtime, destroy and recreate the grid to pick up the new locale text.
3644
3669
  * @param args
3645
3670
  * @returns
3646
3671
  */
@@ -3691,6 +3716,10 @@ class SkyAgGridService {
3691
3716
  ...defaultGridOptions.context,
3692
3717
  ...providedGridOptions.context,
3693
3718
  },
3719
+ localeText: {
3720
+ ...defaultGridOptions.localeText,
3721
+ ...providedGridOptions.localeText,
3722
+ },
3694
3723
  columnTypes: {
3695
3724
  ...providedGridOptions.columnTypes,
3696
3725
  // apply default second to prevent consumers from overwriting our default column types
@@ -3958,6 +3987,7 @@ class SkyAgGridService {
3958
3987
  iconKey,
3959
3988
  this.#getIconTemplate(iconKey),
3960
3989
  ])),
3990
+ localeText: this.#localeText(),
3961
3991
  loadingOverlayComponent: SkyAgGridLoadingComponent,
3962
3992
  onCellFocused: (event) => this.#onCellFocused(event),
3963
3993
  rowModelType: 'clientSide',
@@ -4067,11 +4097,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
4067
4097
  }]
4068
4098
  }] });
4069
4099
 
4100
+ /**
4101
+ * Builds a column definition whose `cellEditorParams` and `cellRendererParams`
4102
+ * are validated against the SKY UX cell types in the `type` property. The cell
4103
+ * type is inferred, so no type arguments are needed:
4104
+ * ```
4105
+ * defineSkyAgGridColDef({
4106
+ * field: 'endDate',
4107
+ * type: [SkyCellType.Date, SkyCellType.Validator],
4108
+ * cellRendererParams: { skyComponentProperties: { validator: ... } },
4109
+ * })
4110
+ * ```
4111
+ */
4112
+ // `C` preserves the exact shape of the passed literal (like `satisfies`), `F`
4113
+ // keeps `field` narrowed to its literal type for row-typed grid options, and
4114
+ // the `Record` intersection rejects misspelled or unknown properties.
4115
+ function defineSkyAgGridColDef(colDef) {
4116
+ return colDef;
4117
+ }
4118
+
4070
4119
  // Export any types that should be included in the root.
4071
4120
 
4072
4121
  /**
4073
4122
  * Generated bundle index. Do not edit.
4074
4123
  */
4075
4124
 
4076
- 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 };
4125
+ 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 };
4077
4126
  //# sourceMappingURL=skyux-ag-grid.mjs.map