@rxap/material-table-system 13.2.1 → 13.3.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.
- package/esm2020/index.mjs +3 -1
- package/esm2020/lib/table-row-actions/decorators.mjs +6 -2
- package/esm2020/lib/table-row-actions/row-action-check.pipe.mjs +43 -0
- package/esm2020/lib/table-row-actions/table-row-action.directive.mjs +1 -1
- package/esm2020/lib/table-row-actions/table-row-action.method.mjs +12 -2
- package/esm2020/lib/table-row-actions/table-row-actions.module.mjs +8 -3
- package/esm2020/lib/table-row-actions/table-row-header-action.directive.mjs +1 -1
- package/esm2020/lib/table-row-actions/types.mjs +2 -0
- package/fesm2015/rxap-material-table-system.mjs +62 -4
- package/fesm2015/rxap-material-table-system.mjs.map +1 -1
- package/fesm2020/rxap-material-table-system.mjs +60 -4
- package/fesm2020/rxap-material-table-system.mjs.map +1 -1
- package/index.d.ts +2 -0
- package/lib/table-row-actions/decorators.d.ts +3 -1
- package/lib/table-row-actions/row-action-check.pipe.d.ts +10 -0
- package/lib/table-row-actions/table-row-action.directive.d.ts +1 -1
- package/lib/table-row-actions/table-row-action.method.d.ts +3 -7
- package/lib/table-row-actions/table-row-actions.module.d.ts +8 -7
- package/lib/table-row-actions/table-row-header-action.directive.d.ts +1 -1
- package/lib/table-row-actions/types.d.ts +8 -0
- package/package.json +8 -9
|
@@ -1945,9 +1945,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
1945
1945
|
}] });
|
|
1946
1946
|
|
|
1947
1947
|
const RXAP_TABLE_ACTION_METHOD_TYPE_METADATA = 'rxap-table-action-method-type-metadata';
|
|
1948
|
-
|
|
1948
|
+
const RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA = 'rxap-table-action-method-check-function-metadata';
|
|
1949
|
+
function TableActionMethod(type, checkFunction) {
|
|
1949
1950
|
return function (target) {
|
|
1950
1951
|
setMetadata(RXAP_TABLE_ACTION_METHOD_TYPE_METADATA, type, target);
|
|
1952
|
+
if (checkFunction) {
|
|
1953
|
+
setMetadata(RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA, checkFunction, target);
|
|
1954
|
+
}
|
|
1951
1955
|
};
|
|
1952
1956
|
}
|
|
1953
1957
|
|
|
@@ -1988,6 +1992,16 @@ function IsTableRowActionTypeMethod(type) {
|
|
|
1988
1992
|
return (getMetadata(RXAP_TABLE_ACTION_METHOD_TYPE_METADATA, method.constructor) === type);
|
|
1989
1993
|
};
|
|
1990
1994
|
}
|
|
1995
|
+
function HasTableRowActionCheckFunction(method) {
|
|
1996
|
+
return hasMetadata(RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA, method.constructor);
|
|
1997
|
+
}
|
|
1998
|
+
function GetTableRowActionCheckFunction(method) {
|
|
1999
|
+
const checkFunction = getMetadata(RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA, method.constructor);
|
|
2000
|
+
if (!checkFunction) {
|
|
2001
|
+
throw new Error(`Extracted check function from '${method.constructor.name}' is empty`);
|
|
2002
|
+
}
|
|
2003
|
+
return checkFunction;
|
|
2004
|
+
}
|
|
1991
2005
|
|
|
1992
2006
|
const RXAP_TABLE_ROW_ACTION_METHOD = new InjectionToken('rxap-table-row-action-method');
|
|
1993
2007
|
|
|
@@ -2244,14 +2258,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
2244
2258
|
args: ['rxapTableRowHeaderAction']
|
|
2245
2259
|
}] } });
|
|
2246
2260
|
|
|
2261
|
+
class RowActionCheckPipe {
|
|
2262
|
+
constructor(tableRowActionMethodList) {
|
|
2263
|
+
this.actionMethodList = coerceArray(tableRowActionMethodList);
|
|
2264
|
+
}
|
|
2265
|
+
transform(value, type) {
|
|
2266
|
+
if (!type) {
|
|
2267
|
+
throw new Error(`The provided type is empty '${type}'`);
|
|
2268
|
+
}
|
|
2269
|
+
const actionMethodList = this.actionMethodList.filter(IsTableRowActionTypeMethod(type));
|
|
2270
|
+
if (actionMethodList.length > 1) {
|
|
2271
|
+
throw new Error(`Multiple (${actionMethodList.length}) action method with the same type '${type}' found`);
|
|
2272
|
+
}
|
|
2273
|
+
if (actionMethodList.length === 0) {
|
|
2274
|
+
throw new Error(`Could not find a action method with the type '${type}'`);
|
|
2275
|
+
}
|
|
2276
|
+
const actionMethod = actionMethodList[0];
|
|
2277
|
+
if (HasTableRowActionCheckFunction(actionMethod)) {
|
|
2278
|
+
const checkFunction = GetTableRowActionCheckFunction(actionMethod);
|
|
2279
|
+
const input = coerceArray(value);
|
|
2280
|
+
return input.length !== 0 && input.every(checkFunction);
|
|
2281
|
+
}
|
|
2282
|
+
return true;
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
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 });
|
|
2286
|
+
RowActionCheckPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RowActionCheckPipe, name: "rxapRowActionCheck" });
|
|
2287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: RowActionCheckPipe, decorators: [{
|
|
2288
|
+
type: Pipe,
|
|
2289
|
+
args: [{
|
|
2290
|
+
name: 'rxapRowActionCheck',
|
|
2291
|
+
}]
|
|
2292
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
2293
|
+
type: Optional
|
|
2294
|
+
}, {
|
|
2295
|
+
type: Inject,
|
|
2296
|
+
args: [RXAP_TABLE_ROW_ACTION_METHOD]
|
|
2297
|
+
}] }]; } });
|
|
2298
|
+
|
|
2247
2299
|
class TableRowActionsModule {
|
|
2248
2300
|
}
|
|
2249
2301
|
TableRowActionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableRowActionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2250
2302
|
TableRowActionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableRowActionsModule, declarations: [TableRowActionDirective,
|
|
2251
2303
|
TableRowActionExecutingDirective,
|
|
2252
|
-
TableRowHeaderActionDirective
|
|
2304
|
+
TableRowHeaderActionDirective,
|
|
2305
|
+
RowActionCheckPipe], exports: [TableRowActionDirective,
|
|
2253
2306
|
TableRowHeaderActionDirective,
|
|
2254
2307
|
TableRowActionExecutingDirective,
|
|
2308
|
+
RowActionCheckPipe,
|
|
2255
2309
|
MatTooltipModule,
|
|
2256
2310
|
MatButtonModule,
|
|
2257
2311
|
ConfirmComponentModule,
|
|
@@ -2270,12 +2324,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
2270
2324
|
declarations: [
|
|
2271
2325
|
TableRowActionDirective,
|
|
2272
2326
|
TableRowActionExecutingDirective,
|
|
2273
|
-
TableRowHeaderActionDirective
|
|
2327
|
+
TableRowHeaderActionDirective,
|
|
2328
|
+
RowActionCheckPipe
|
|
2274
2329
|
],
|
|
2275
2330
|
exports: [
|
|
2276
2331
|
TableRowActionDirective,
|
|
2277
2332
|
TableRowHeaderActionDirective,
|
|
2278
2333
|
TableRowActionExecutingDirective,
|
|
2334
|
+
RowActionCheckPipe,
|
|
2279
2335
|
MatTooltipModule,
|
|
2280
2336
|
MatButtonModule,
|
|
2281
2337
|
ConfirmComponentModule,
|
|
@@ -2293,5 +2349,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
2293
2349
|
* Generated bundle index. Do not edit.
|
|
2294
2350
|
*/
|
|
2295
2351
|
|
|
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 };
|
|
2352
|
+
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
2353
|
//# sourceMappingURL=rxap-material-table-system.mjs.map
|