@rxap/material-table-system 14.2.0 → 14.4.0-dev.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/select-row/select-row.service.mjs +2 -2
- package/esm2020/lib/select-row/selection-model.mjs +218 -0
- 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 +280 -6
- package/fesm2015/rxap-material-table-system.mjs.map +1 -1
- package/fesm2020/rxap-material-table-system.mjs +278 -6
- package/fesm2020/rxap-material-table-system.mjs.map +1 -1
- package/index.d.ts +2 -0
- package/lib/select-row/select-row.service.d.ts +1 -1
- package/lib/select-row/selection-model.d.ts +118 -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 +15 -16
package/index.d.ts
CHANGED
|
@@ -60,3 +60,5 @@ export * from './lib/table-row-actions/table-row-action-status';
|
|
|
60
60
|
export * from './lib/table-row-actions/table-row-actions.module';
|
|
61
61
|
export * from './lib/table-row-actions/table-row-header-action.directive';
|
|
62
62
|
export * from './lib/table-row-actions/tokens';
|
|
63
|
+
export * from './lib/table-row-actions/types';
|
|
64
|
+
export * from './lib/table-row-actions/row-action-check.pipe';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SelectionModel } from '@angular/cdk/collections';
|
|
2
1
|
import type { Observable } from 'rxjs';
|
|
3
2
|
import { SelectRowOptions } from './select-row.options';
|
|
3
|
+
import { SelectionModel } from './selection-model';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class SelectRowService<Data extends Record<string, any>> {
|
|
6
6
|
selectedRows$: Observable<Data[]>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
import { Subject } from 'rxjs';
|
|
9
|
+
/**
|
|
10
|
+
* Class to be used to power selecting one or more options from a list.
|
|
11
|
+
*/
|
|
12
|
+
export declare class SelectionModel<T> {
|
|
13
|
+
private _multiple;
|
|
14
|
+
private _emitChanges;
|
|
15
|
+
compareWith?: ((o1: T, o2: T) => boolean) | undefined;
|
|
16
|
+
/** Currently-selected values. */
|
|
17
|
+
private _selection;
|
|
18
|
+
/** Keeps track of the deselected options that haven't been emitted by the change event. */
|
|
19
|
+
private _deselectedToEmit;
|
|
20
|
+
/** Keeps track of the selected options that haven't been emitted by the change event. */
|
|
21
|
+
private _selectedToEmit;
|
|
22
|
+
/** Cache for the array value of the selected items. */
|
|
23
|
+
private _selected;
|
|
24
|
+
/** Selected values. */
|
|
25
|
+
get selected(): T[];
|
|
26
|
+
/** Event emitted when the value has changed. */
|
|
27
|
+
readonly changed: Subject<SelectionChange<T>>;
|
|
28
|
+
constructor(_multiple?: boolean, initiallySelectedValues?: T[], _emitChanges?: boolean, compareWith?: ((o1: T, o2: T) => boolean) | undefined);
|
|
29
|
+
/**
|
|
30
|
+
* Selects a value or an array of values.
|
|
31
|
+
* @param values The values to select
|
|
32
|
+
* @return Whether the selection changed as a result of this call
|
|
33
|
+
* @breaking-change 16.0.0 make return type boolean
|
|
34
|
+
*/
|
|
35
|
+
select(...values: T[]): boolean | void;
|
|
36
|
+
/**
|
|
37
|
+
* Deselects a value or an array of values.
|
|
38
|
+
* @param values The values to deselect
|
|
39
|
+
* @return Whether the selection changed as a result of this call
|
|
40
|
+
* @breaking-change 16.0.0 make return type boolean
|
|
41
|
+
*/
|
|
42
|
+
deselect(...values: T[]): boolean | void;
|
|
43
|
+
/**
|
|
44
|
+
* Sets the selected values
|
|
45
|
+
* @param values The new selected values
|
|
46
|
+
* @return Whether the selection changed as a result of this call
|
|
47
|
+
* @breaking-change 16.0.0 make return type boolean
|
|
48
|
+
*/
|
|
49
|
+
setSelection(...values: T[]): boolean | void;
|
|
50
|
+
/**
|
|
51
|
+
* Toggles a value between selected and deselected.
|
|
52
|
+
* @param value The value to toggle
|
|
53
|
+
* @return Whether the selection changed as a result of this call
|
|
54
|
+
* @breaking-change 16.0.0 make return type boolean
|
|
55
|
+
*/
|
|
56
|
+
toggle(value: T): boolean | void;
|
|
57
|
+
/**
|
|
58
|
+
* Clears all of the selected values.
|
|
59
|
+
* @param flushEvent Whether to flush the changes in an event.
|
|
60
|
+
* If false, the changes to the selection will be flushed along with the next event.
|
|
61
|
+
* @return Whether the selection changed as a result of this call
|
|
62
|
+
* @breaking-change 16.0.0 make return type boolean
|
|
63
|
+
*/
|
|
64
|
+
clear(flushEvent?: boolean): boolean | void;
|
|
65
|
+
/**
|
|
66
|
+
* Determines whether a value is selected.
|
|
67
|
+
*/
|
|
68
|
+
isSelected(value: T): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Determines whether the model does not have a value.
|
|
71
|
+
*/
|
|
72
|
+
isEmpty(): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Determines whether the model has a value.
|
|
75
|
+
*/
|
|
76
|
+
hasValue(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Sorts the selected values based on a predicate function.
|
|
79
|
+
*/
|
|
80
|
+
sort(predicate?: (a: T, b: T) => number): void;
|
|
81
|
+
/**
|
|
82
|
+
* Gets whether multiple values can be selected.
|
|
83
|
+
*/
|
|
84
|
+
isMultipleSelection(): boolean;
|
|
85
|
+
/** Emits a change event and clears the records of selected and deselected values. */
|
|
86
|
+
private _emitChangeEvent;
|
|
87
|
+
/** Selects a value. */
|
|
88
|
+
private _markSelected;
|
|
89
|
+
/** Deselects a value. */
|
|
90
|
+
private _unmarkSelected;
|
|
91
|
+
/** Clears out the selected values. */
|
|
92
|
+
private _unmarkAll;
|
|
93
|
+
/**
|
|
94
|
+
* Verifies the value assignment and throws an error if the specified value array is
|
|
95
|
+
* including multiple values while the selection model is not supporting multiple values.
|
|
96
|
+
*/
|
|
97
|
+
private _verifyValueAssignment;
|
|
98
|
+
/** Whether there are queued up change to be emitted. */
|
|
99
|
+
private _hasQueuedChanges;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Event emitted when the value of a MatSelectionModel has changed.
|
|
103
|
+
* @docs-private
|
|
104
|
+
*/
|
|
105
|
+
export interface SelectionChange<T> {
|
|
106
|
+
/** Model that dispatched the event. */
|
|
107
|
+
source: SelectionModel<T>;
|
|
108
|
+
/** Options that were added to the model. */
|
|
109
|
+
added: T[];
|
|
110
|
+
/** Options that were removed from the model. */
|
|
111
|
+
removed: T[];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Returns an error that reports that multiple values are passed into a selection model
|
|
115
|
+
* with a single value.
|
|
116
|
+
* @docs-private
|
|
117
|
+
*/
|
|
118
|
+
export declare function getMultipleValuesInSingleSelectionError(): Error;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { RowActionCheckFunction } from './types';
|
|
1
2
|
export declare const RXAP_TABLE_ACTION_METHOD_TYPE_METADATA = "rxap-table-action-method-type-metadata";
|
|
2
|
-
export declare
|
|
3
|
+
export declare const RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA = "rxap-table-action-method-check-function-metadata";
|
|
4
|
+
export declare function TableActionMethod<Data = unknown>(type: string, checkFunction?: RowActionCheckFunction<Data>): (target: any) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { TableRowActionTypeMethod } from './types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class RowActionCheckPipe<RowType> implements PipeTransform {
|
|
5
|
+
private readonly actionMethodList;
|
|
6
|
+
constructor(tableRowActionMethodList: Array<TableRowActionTypeMethod<RowType>> | TableRowActionTypeMethod<RowType> | null);
|
|
7
|
+
transform(value: RowType | RowType[], type: string): boolean;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RowActionCheckPipe<any>, [{ optional: true; }]>;
|
|
9
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<RowActionCheckPipe<any>, "rxapRowActionCheck", false>;
|
|
10
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ChangeDetectorRef, ViewContainerRef } from '@angular/core';
|
|
2
2
|
import { MatButton } from '@angular/material/button';
|
|
3
3
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
4
|
-
import { TableRowActionMethod } from './table-row-action.method';
|
|
5
4
|
import { TableDataSourceDirective } from '../table-data-source.directive';
|
|
5
|
+
import { TableRowActionMethod } from './types';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class TableRowActionDirective<Data extends Record<string, any>> {
|
|
8
8
|
protected readonly cdr: ChangeDetectorRef;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare type TableRowActionTypeSwitchMethod<Data extends Record<string, any>> = Method<any, {
|
|
3
|
-
element: Data;
|
|
4
|
-
type: string;
|
|
5
|
-
}>;
|
|
6
|
-
export declare type TableRowActionTypeMethod<Data extends Record<string, any>> = Method<any, Data>;
|
|
7
|
-
export declare type TableRowActionMethod<Data extends Record<string, any>> = TableRowActionTypeSwitchMethod<Data> | TableRowActionTypeMethod<Data>;
|
|
1
|
+
import { TableRowActionMethod, TableRowActionTypeMethod, TableRowActionTypeSwitchMethod, RowActionCheckFunction } from './types';
|
|
8
2
|
export declare function IsTableRowActionTypeSwitchMethod<Data extends Record<string, any>>(method: TableRowActionMethod<Data>): method is TableRowActionTypeSwitchMethod<Data>;
|
|
9
3
|
export declare function IsTableRowActionTypeMethod<Data extends Record<string, any>>(type: string): (method: TableRowActionMethod<Data>) => method is TableRowActionTypeMethod<Data>;
|
|
4
|
+
export declare function HasTableRowActionCheckFunction(method: TableRowActionMethod<any>): boolean;
|
|
5
|
+
export declare function GetTableRowActionCheckFunction<Data>(method: TableRowActionMethod<Data>): RowActionCheckFunction<Data>;
|
|
@@ -2,14 +2,15 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
import * as i1 from "./table-row-action.directive";
|
|
3
3
|
import * as i2 from "./table-row-action-executing.directive";
|
|
4
4
|
import * as i3 from "./table-row-header-action.directive";
|
|
5
|
-
import * as i4 from "
|
|
6
|
-
import * as i5 from "@angular/material/
|
|
7
|
-
import * as i6 from "@
|
|
8
|
-
import * as i7 from "@
|
|
9
|
-
import * as i8 from "@angular/material/
|
|
10
|
-
import * as i9 from "@angular/
|
|
5
|
+
import * as i4 from "./row-action-check.pipe";
|
|
6
|
+
import * as i5 from "@angular/material/tooltip";
|
|
7
|
+
import * as i6 from "@angular/material/button";
|
|
8
|
+
import * as i7 from "@rxap/components";
|
|
9
|
+
import * as i8 from "@angular/material/icon";
|
|
10
|
+
import * as i9 from "@angular/material/progress-bar";
|
|
11
|
+
import * as i10 from "@angular/common";
|
|
11
12
|
export declare class TableRowActionsModule {
|
|
12
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableRowActionsModule, never>;
|
|
13
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<TableRowActionsModule, [typeof i1.TableRowActionDirective, typeof i2.TableRowActionExecutingDirective, typeof i3.TableRowHeaderActionDirective], never, [typeof i1.TableRowActionDirective, typeof i3.TableRowHeaderActionDirective, typeof i2.TableRowActionExecutingDirective, typeof i4.
|
|
14
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TableRowActionsModule, [typeof i1.TableRowActionDirective, typeof i2.TableRowActionExecutingDirective, typeof i3.TableRowHeaderActionDirective, typeof i4.RowActionCheckPipe], never, [typeof i1.TableRowActionDirective, typeof i3.TableRowHeaderActionDirective, typeof i2.TableRowActionExecutingDirective, typeof i4.RowActionCheckPipe, typeof i5.MatTooltipModule, typeof i6.MatButtonModule, typeof i7.ConfirmComponentModule, typeof i8.MatIconModule, typeof i9.MatProgressBarModule, typeof i10.CommonModule]>;
|
|
14
15
|
static ɵinj: i0.ɵɵInjectorDeclaration<TableRowActionsModule>;
|
|
15
16
|
}
|
|
@@ -2,9 +2,9 @@ import { ChangeDetectorRef, OnDestroy, OnInit, ViewContainerRef } from '@angular
|
|
|
2
2
|
import { MatButton } from '@angular/material/button';
|
|
3
3
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
4
4
|
import { TableRowActionDirective } from './table-row-action.directive';
|
|
5
|
-
import { TableRowActionMethod } from './table-row-action.method';
|
|
6
5
|
import { TableDataSourceDirective } from '../table-data-source.directive';
|
|
7
6
|
import { SelectRowService } from '../select-row/select-row.service';
|
|
7
|
+
import { TableRowActionMethod } from './types';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
export declare class TableRowHeaderActionDirective<Data extends Record<string, any>> extends TableRowActionDirective<Data> implements OnInit, OnDestroy {
|
|
10
10
|
private readonly selectRowService;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Method } from '@rxap/utilities/rxjs';
|
|
2
|
+
export declare type RowActionCheckFunction<Data extends Record<string, any>> = (element: Data, index: number, array: Data[]) => boolean;
|
|
3
|
+
export declare type TableRowActionTypeSwitchMethod<Data extends Record<string, any>> = Method<any, {
|
|
4
|
+
element: Data;
|
|
5
|
+
type: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare type TableRowActionTypeMethod<Data extends Record<string, any>> = Method<any, Data>;
|
|
8
|
+
export declare type TableRowActionMethod<Data extends Record<string, any>> = TableRowActionTypeSwitchMethod<Data> | TableRowActionTypeMethod<Data>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxap/material-table-system",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.4.0-dev.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular-devkit/schematics": "^14.2.3",
|
|
6
6
|
"@angular/animations": "^14.2.2",
|
|
@@ -14,20 +14,20 @@
|
|
|
14
14
|
"@angular/platform-browser": "^14.2.2",
|
|
15
15
|
"@angular/platform-browser-dynamic": "^14.2.2",
|
|
16
16
|
"@angular/router": "^14.2.2",
|
|
17
|
-
"@rxap/components": "^14.0.
|
|
18
|
-
"@rxap/config": "^14.1.
|
|
19
|
-
"@rxap/data-source": "^14.1.
|
|
20
|
-
"@rxap/definition": "^14.0.
|
|
21
|
-
"@rxap/directives": "^14.0.
|
|
22
|
-
"@rxap/forms": "^14.0.
|
|
23
|
-
"@rxap/material-directives": "^14.0.
|
|
24
|
-
"@rxap/mixin": "^14.0.
|
|
25
|
-
"@rxap/open-api": "^14.
|
|
26
|
-
"@rxap/remote-method": "^14.0.
|
|
27
|
-
"@rxap/services": "^14.0.
|
|
28
|
-
"@rxap/utilities": "^14.0.
|
|
29
|
-
"@rxap/window-system": "^14.0.
|
|
30
|
-
"@schematics/angular": "^
|
|
17
|
+
"@rxap/components": "^14.0.2",
|
|
18
|
+
"@rxap/config": "^14.1.3",
|
|
19
|
+
"@rxap/data-source": "^14.1.3",
|
|
20
|
+
"@rxap/definition": "^14.0.3",
|
|
21
|
+
"@rxap/directives": "^14.0.3",
|
|
22
|
+
"@rxap/forms": "^14.0.2",
|
|
23
|
+
"@rxap/material-directives": "^14.0.2",
|
|
24
|
+
"@rxap/mixin": "^14.0.2",
|
|
25
|
+
"@rxap/open-api": "^14.1.3",
|
|
26
|
+
"@rxap/remote-method": "^14.0.2",
|
|
27
|
+
"@rxap/services": "^14.0.5",
|
|
28
|
+
"@rxap/utilities": "^14.0.3",
|
|
29
|
+
"@rxap/window-system": "^14.0.2",
|
|
30
|
+
"@schematics/angular": "^14.2.10",
|
|
31
31
|
"joi": "^17.6.3",
|
|
32
32
|
"reflect-metadata": "^0.1.13",
|
|
33
33
|
"rxjs": "^6.6.0"
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
"directory": "../../../dist/libs/material/table-system",
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "e75f92d806744f93d00f5abf69fb80cfec0ccace",
|
|
60
59
|
"license": "MIT",
|
|
61
60
|
"keywords": [
|
|
62
61
|
"rxap",
|