@rxap/material-table-system 13.2.1 → 13.3.1

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.
@@ -980,6 +980,12 @@ class FilterHeaderRowDirective extends FormDirective {
980
980
  super(cdr, formDefinition);
981
981
  this.tableFilter = tableFilter;
982
982
  }
983
+ set useFormDefinition(value) {
984
+ if (value) {
985
+ this._formDefinition = value;
986
+ this.form = value.rxapFormGroup;
987
+ }
988
+ }
983
989
  ngOnInit() {
984
990
  super.ngOnInit();
985
991
  this._subscription = this.form.value$
@@ -992,7 +998,7 @@ class FilterHeaderRowDirective extends FormDirective {
992
998
  }
993
999
  }
994
1000
  FilterHeaderRowDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FilterHeaderRowDirective, deps: [{ token: TableFilterService }, { token: i0.ChangeDetectorRef }, { token: RXAP_TABLE_FILTER_FORM_DEFINITION, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
995
- FilterHeaderRowDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FilterHeaderRowDirective, selector: "table[rxap-filter-header-row]", providers: [
1001
+ FilterHeaderRowDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FilterHeaderRowDirective, selector: "table[rxap-filter-header-row]", inputs: { useFormDefinition: ["rxap-filter-header-row", "useFormDefinition"] }, providers: [
996
1002
  {
997
1003
  provide: ControlContainer,
998
1004
  // ignore coverage
@@ -1017,7 +1023,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
1017
1023
  }, {
1018
1024
  type: Inject,
1019
1025
  args: [RXAP_TABLE_FILTER_FORM_DEFINITION]
1020
- }] }]; } });
1026
+ }] }]; }, propDecorators: { useFormDefinition: [{
1027
+ type: Input,
1028
+ args: ['rxap-filter-header-row']
1029
+ }] } });
1021
1030
 
1022
1031
  class ToFilterColumnNamesPipe {
1023
1032
  transform(columns) {
@@ -1945,9 +1954,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
1945
1954
  }] });
1946
1955
 
1947
1956
  const RXAP_TABLE_ACTION_METHOD_TYPE_METADATA = 'rxap-table-action-method-type-metadata';
1948
- function TableActionMethod(type) {
1957
+ const RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA = 'rxap-table-action-method-check-function-metadata';
1958
+ function TableActionMethod(type, checkFunction) {
1949
1959
  return function (target) {
1950
1960
  setMetadata(RXAP_TABLE_ACTION_METHOD_TYPE_METADATA, type, target);
1961
+ if (checkFunction) {
1962
+ setMetadata(RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA, checkFunction, target);
1963
+ }
1951
1964
  };
1952
1965
  }
1953
1966
 
@@ -1988,6 +2001,16 @@ function IsTableRowActionTypeMethod(type) {
1988
2001
  return (getMetadata(RXAP_TABLE_ACTION_METHOD_TYPE_METADATA, method.constructor) === type);
1989
2002
  };
1990
2003
  }
2004
+ function HasTableRowActionCheckFunction(method) {
2005
+ return hasMetadata(RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA, method.constructor);
2006
+ }
2007
+ function GetTableRowActionCheckFunction(method) {
2008
+ const checkFunction = getMetadata(RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA, method.constructor);
2009
+ if (!checkFunction) {
2010
+ throw new Error(`Extracted check function from '${method.constructor.name}' is empty`);
2011
+ }
2012
+ return checkFunction;
2013
+ }
1991
2014
 
1992
2015
  const RXAP_TABLE_ROW_ACTION_METHOD = new InjectionToken('rxap-table-row-action-method');
1993
2016
 
@@ -2244,14 +2267,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
2244
2267
  args: ['rxapTableRowHeaderAction']
2245
2268
  }] } });
2246
2269
 
2270
+ class RowActionCheckPipe {
2271
+ constructor(tableRowActionMethodList) {
2272
+ this.actionMethodList = coerceArray(tableRowActionMethodList);
2273
+ }
2274
+ transform(value, type) {
2275
+ if (!type) {
2276
+ throw new Error(`The provided type is empty '${type}'`);
2277
+ }
2278
+ const actionMethodList = this.actionMethodList.filter(IsTableRowActionTypeMethod(type));
2279
+ if (actionMethodList.length > 1) {
2280
+ throw new Error(`Multiple (${actionMethodList.length}) action method with the same type '${type}' found`);
2281
+ }
2282
+ if (actionMethodList.length === 0) {
2283
+ throw new Error(`Could not find a action method with the type '${type}'`);
2284
+ }
2285
+ const actionMethod = actionMethodList[0];
2286
+ if (HasTableRowActionCheckFunction(actionMethod)) {
2287
+ const checkFunction = GetTableRowActionCheckFunction(actionMethod);
2288
+ const input = coerceArray(value);
2289
+ return input.length !== 0 && input.every(checkFunction);
2290
+ }
2291
+ return true;
2292
+ }
2293
+ }
2294
+ RowActionCheckPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RowActionCheckPipe, deps: [{ token: RXAP_TABLE_ROW_ACTION_METHOD, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
2295
+ RowActionCheckPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RowActionCheckPipe, name: "rxapRowActionCheck" });
2296
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RowActionCheckPipe, decorators: [{
2297
+ type: Pipe,
2298
+ args: [{
2299
+ name: 'rxapRowActionCheck',
2300
+ }]
2301
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2302
+ type: Optional
2303
+ }, {
2304
+ type: Inject,
2305
+ args: [RXAP_TABLE_ROW_ACTION_METHOD]
2306
+ }] }]; } });
2307
+
2247
2308
  class TableRowActionsModule {
2248
2309
  }
2249
2310
  TableRowActionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableRowActionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2250
2311
  TableRowActionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableRowActionsModule, declarations: [TableRowActionDirective,
2251
2312
  TableRowActionExecutingDirective,
2252
- TableRowHeaderActionDirective], exports: [TableRowActionDirective,
2313
+ TableRowHeaderActionDirective,
2314
+ RowActionCheckPipe], exports: [TableRowActionDirective,
2253
2315
  TableRowHeaderActionDirective,
2254
2316
  TableRowActionExecutingDirective,
2317
+ RowActionCheckPipe,
2255
2318
  MatTooltipModule,
2256
2319
  MatButtonModule,
2257
2320
  ConfirmComponentModule,
@@ -2270,12 +2333,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
2270
2333
  declarations: [
2271
2334
  TableRowActionDirective,
2272
2335
  TableRowActionExecutingDirective,
2273
- TableRowHeaderActionDirective
2336
+ TableRowHeaderActionDirective,
2337
+ RowActionCheckPipe
2274
2338
  ],
2275
2339
  exports: [
2276
2340
  TableRowActionDirective,
2277
2341
  TableRowHeaderActionDirective,
2278
2342
  TableRowActionExecutingDirective,
2343
+ RowActionCheckPipe,
2279
2344
  MatTooltipModule,
2280
2345
  MatButtonModule,
2281
2346
  ConfirmComponentModule,
@@ -2293,5 +2358,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
2293
2358
  * Generated bundle index. Do not edit.
2294
2359
  */
2295
2360
 
2296
- export { BooleanCellComponent, BooleanCellComponentModule, CheckboxCellComponent, CheckboxCellComponentModule, CheckboxHeaderCellComponent, CheckboxHeaderCellComponentModule, CopyToClipboardCellComponent, CopyToClipboardCellComponentModule, DateCellComponent, DateCellComponentModule, ExpandControlsCellComponent, ExpandControlsCellComponentModule, ExpandRowContainerComponent, ExpandRowContainerComponentModule, ExpandRowContentDirective, ExpandRowDirective, ExpandRowModule, ExpandRowService, FilterHeaderRowDirective, IconCellComponent, IconCellComponentModule, ImageCellComponent, ImageCellComponentModule, IsTableRowActionTypeMethod, IsTableRowActionTypeSwitchMethod, LinkCellComponent, LinkCellComponentModule, OptionsCellComponent, OptionsCellComponentModule, PersistentPaginatorDirective, PersistentPaginatorDirectiveModule, ROW_ARCHIVE_METHOD, ROW_DELETE_METHOD, ROW_EDIT_LOADER_METHOD, ROW_EDIT_METHOD, ROW_LINK_METHOD, ROW_RESTORE_METHOD, ROW_VIEW_METHOD, RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS, RXAP_TABLE_ACTION_METHOD_TYPE_METADATA, RXAP_TABLE_FILTER, RXAP_TABLE_FILTER_FORM_DEFINITION, RXAP_TABLE_ROW_ACTION_METHOD, RowAnimation, RowControlsCellComponent, RowControlsCellComponentModule, RowControlsHeaderCellComponent, RowControlsHeaderCellComponentModule, SelectRowModule, SelectRowService, SelectedRowsDirective, TABLE_CREATE_REMOTE_METHOD, TABLE_DATA_SOURCE, TABLE_REMOTE_METHOD, TABLE_REMOTE_METHOD_ADAPTER_FACTORY, TableActionMethod, TableColumnMenuComponent, TableColumnMenuComponentModule, TableColumnOptionComponent, TableCreateButtonDirective, TableCreateButtonDirectiveModule, TableDataSourceDirective, TableDataSourceModule, TableFilterModule, TableFilterService, TableRowActionDirective, TableRowActionExecutingDirective, TableRowActionStatus, TableRowActionsModule, TableRowControlsModule, TableRowHeaderActionDirective, TableSelectControlsComponent, TableSelectControlsComponentModule, TableShowArchivedSlideComponent, TableShowArchivedSlideComponentModule, ToFilterColumnNamesPipe };
2361
+ export { BooleanCellComponent, BooleanCellComponentModule, CheckboxCellComponent, CheckboxCellComponentModule, CheckboxHeaderCellComponent, CheckboxHeaderCellComponentModule, CopyToClipboardCellComponent, CopyToClipboardCellComponentModule, DateCellComponent, DateCellComponentModule, ExpandControlsCellComponent, ExpandControlsCellComponentModule, ExpandRowContainerComponent, ExpandRowContainerComponentModule, ExpandRowContentDirective, ExpandRowDirective, ExpandRowModule, ExpandRowService, FilterHeaderRowDirective, GetTableRowActionCheckFunction, HasTableRowActionCheckFunction, IconCellComponent, IconCellComponentModule, ImageCellComponent, ImageCellComponentModule, IsTableRowActionTypeMethod, IsTableRowActionTypeSwitchMethod, LinkCellComponent, LinkCellComponentModule, OptionsCellComponent, OptionsCellComponentModule, PersistentPaginatorDirective, PersistentPaginatorDirectiveModule, ROW_ARCHIVE_METHOD, ROW_DELETE_METHOD, ROW_EDIT_LOADER_METHOD, ROW_EDIT_METHOD, ROW_LINK_METHOD, ROW_RESTORE_METHOD, ROW_VIEW_METHOD, RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS, RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA, RXAP_TABLE_ACTION_METHOD_TYPE_METADATA, RXAP_TABLE_FILTER, RXAP_TABLE_FILTER_FORM_DEFINITION, RXAP_TABLE_ROW_ACTION_METHOD, RowActionCheckPipe, RowAnimation, RowControlsCellComponent, RowControlsCellComponentModule, RowControlsHeaderCellComponent, RowControlsHeaderCellComponentModule, SelectRowModule, SelectRowService, SelectedRowsDirective, TABLE_CREATE_REMOTE_METHOD, TABLE_DATA_SOURCE, TABLE_REMOTE_METHOD, TABLE_REMOTE_METHOD_ADAPTER_FACTORY, TableActionMethod, TableColumnMenuComponent, TableColumnMenuComponentModule, TableColumnOptionComponent, TableCreateButtonDirective, TableCreateButtonDirectiveModule, TableDataSourceDirective, TableDataSourceModule, TableFilterModule, TableFilterService, TableRowActionDirective, TableRowActionExecutingDirective, TableRowActionStatus, TableRowActionsModule, TableRowControlsModule, TableRowHeaderActionDirective, TableSelectControlsComponent, TableSelectControlsComponentModule, TableShowArchivedSlideComponent, TableShowArchivedSlideComponentModule, ToFilterColumnNamesPipe };
2297
2362
  //# sourceMappingURL=rxap-material-table-system.mjs.map