@rxap/material-table-system 12.4.0-next.0 → 12.4.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.
- package/bundles/rxap-material-table-system.umd.js +15 -8
- package/bundles/rxap-material-table-system.umd.js.map +1 -1
- package/esm2015/lib/table-create-button/table-create-button.directive.js +8 -3
- package/esm2015/lib/table-create-button/table-create-button.directive.js.map +1 -1
- package/fesm2015/rxap-material-table-system.js +8 -3
- package/fesm2015/rxap-material-table-system.js.map +1 -1
- package/lib/table-create-button/table-create-button.directive.d.ts +4 -2
- package/package.json +17 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __awaiter, __decorate, __metadata } from "tslib";
|
|
2
2
|
import { Directive, ElementRef, HostListener, Inject, Input, NgModule, Renderer2 } from '@angular/core';
|
|
3
3
|
import { Required } from '@rxap/utilities';
|
|
4
|
-
import { isObservable } from 'rxjs';
|
|
4
|
+
import { isObservable, Subject } from 'rxjs';
|
|
5
5
|
import { TableDataSourceDirective } from '../table-data-source.directive';
|
|
6
6
|
import { TABLE_CREATE_REMOTE_METHOD } from './tokens';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
@@ -14,9 +14,14 @@ export class TableCreateButtonDirective {
|
|
|
14
14
|
ngOnInit() {
|
|
15
15
|
this.renderer.setStyle(this.elementRef.nativeElement, 'margin-bottom', '6px');
|
|
16
16
|
}
|
|
17
|
+
ngOnDestroy() {
|
|
18
|
+
if (this._createObservable instanceof Subject) {
|
|
19
|
+
this._createObservable.complete();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
17
22
|
onClick() {
|
|
18
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
const result = yield this.remoteMethod.call();
|
|
24
|
+
const result = this._createObservable = yield this.remoteMethod.call();
|
|
20
25
|
if (isObservable(result)) {
|
|
21
26
|
yield result.toPromise();
|
|
22
27
|
}
|
|
@@ -33,7 +38,7 @@ __decorate([
|
|
|
33
38
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: TableCreateButtonDirective, decorators: [{
|
|
34
39
|
type: Directive,
|
|
35
40
|
args: [{
|
|
36
|
-
selector: 'button[rxapTableCreate]'
|
|
41
|
+
selector: 'button[rxapTableCreate]'
|
|
37
42
|
}]
|
|
38
43
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
39
44
|
type: Inject,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-create-button.directive.js","sourceRoot":"","sources":["../../../../../../../libs/material/table-system/src/lib/table-create-button/table-create-button.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,MAAM,EACN,KAAK,EACL,QAAQ,EAER,SAAS,
|
|
1
|
+
{"version":3,"file":"table-create-button.directive.js","sourceRoot":"","sources":["../../../../../../../libs/material/table-system/src/lib/table-create-button/table-create-button.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,MAAM,EACN,KAAK,EACL,QAAQ,EAER,SAAS,EAEV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,YAAY,EAEZ,OAAO,EACR,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;;AAMtD,MAAM,OAAO,0BAA0B;IAQrC,YAEmB,YAAkD,EAElD,UAAsB,EAEtB,QAAmB;QAJnB,iBAAY,GAAZ,YAAY,CAAsC;QAElD,eAAU,GAAV,UAAU,CAAY;QAEtB,aAAQ,GAAR,QAAQ,CAAW;IACnC,CAAC;IAEG,QAAQ;QACb,IAAI,CAAC,QAAQ,CAAC,QAAQ,CACpB,IAAI,CAAC,UAAU,CAAC,aAAa,EAC7B,eAAe,EACf,KAAK,CACN,CAAC;IACJ,CAAC;IAEM,WAAW;QAChB,IAAI,IAAI,CAAC,iBAAiB,YAAY,OAAO,EAAE;YAC7C,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;SACnC;IACH,CAAC;IAGY,OAAO;;YAClB,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;YACvE,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE;gBACxB,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC;aAC1B;YACD,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QAC5B,CAAC;KAAA;;uHAtCU,0BAA0B,kBAS3B,0BAA0B,aAE1B,UAAU,aAEV,SAAS;2GAbR,0BAA0B;AAIrC;IADC,QAAQ;8BACW,wBAAwB;8DAAO;2FAJxC,0BAA0B;kBAHtC,SAAS;mBAAC;oBACT,QAAQ,EAAE,yBAAyB;iBACpC;;0BAUI,MAAM;2BAAC,0BAA0B;;0BAEjC,MAAM;2BAAC,UAAU;;0BAEjB,MAAM;2BAAC,SAAS;4CATZ,UAAU;sBAFhB,KAAK;uBAAC,iBAAiB;gBA8BX,OAAO;sBADnB,YAAY;uBAAC,OAAO;;AAcvB,MAAM,OAAO,gCAAgC;;6HAAhC,gCAAgC;8HAAhC,gCAAgC,iBA7ChC,0BAA0B,aAA1B,0BAA0B;8HA6C1B,gCAAgC;2FAAhC,gCAAgC;kBAJ5C,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,0BAA0B,CAAC;oBAC1C,OAAO,EAAE,CAAC,0BAA0B,CAAC;iBACtC","sourcesContent":["import {\n Directive,\n ElementRef,\n HostListener,\n Inject,\n Input,\n NgModule,\n OnInit,\n Renderer2,\n OnDestroy\n} from '@angular/core';\nimport { Required } from '@rxap/utilities';\nimport {\n isObservable,\n Observable,\n Subject\n} from 'rxjs';\nimport { TableDataSourceDirective } from '../table-data-source.directive';\nimport { TABLE_CREATE_REMOTE_METHOD } from './tokens';\nimport { Method } from '@rxap/utilities/rxjs';\n\n@Directive({\n selector: 'button[rxapTableCreate]'\n})\nexport class TableCreateButtonDirective<Data extends Record<string, any>>\n implements OnInit, OnDestroy {\n @Input('rxapTableCreate')\n @Required\n public dataSource!: TableDataSourceDirective<Data>;\n\n private _createObservable?: Observable<any>;\n\n constructor(\n @Inject(TABLE_CREATE_REMOTE_METHOD)\n private readonly remoteMethod: Method<any, Data | Observable<Data>>,\n @Inject(ElementRef)\n private readonly elementRef: ElementRef,\n @Inject(Renderer2)\n private readonly renderer: Renderer2\n ) {}\n\n public ngOnInit() {\n this.renderer.setStyle(\n this.elementRef.nativeElement,\n 'margin-bottom',\n '6px'\n );\n }\n\n public ngOnDestroy() {\n if (this._createObservable instanceof Subject) {\n this._createObservable.complete();\n }\n }\n\n @HostListener('click')\n public async onClick() {\n const result = this._createObservable = await this.remoteMethod.call();\n if (isObservable(result)) {\n await result.toPromise();\n }\n this.dataSource.refresh();\n }\n}\n\n@NgModule({\n declarations: [TableCreateButtonDirective],\n exports: [TableCreateButtonDirective],\n})\nexport class TableCreateButtonDirectiveModule {}\n"]}
|
|
@@ -5,7 +5,7 @@ import * as i1 from '@angular/cdk/portal';
|
|
|
5
5
|
import { TemplatePortal, PortalModule } from '@angular/cdk/portal';
|
|
6
6
|
import { Required, equals, coerceBoolean, coerceArray } from '@rxap/utilities';
|
|
7
7
|
import { trigger, state, style, transition, animate, sequence } from '@angular/animations';
|
|
8
|
-
import { BehaviorSubject, EMPTY, ReplaySubject, Subscription, isObservable, of } from 'rxjs';
|
|
8
|
+
import { BehaviorSubject, EMPTY, ReplaySubject, Subscription, Subject, isObservable, of } from 'rxjs';
|
|
9
9
|
import { map, filter, tap, distinctUntilChanged, debounceTime, delay, startWith } from 'rxjs/operators';
|
|
10
10
|
import * as i2 from '@angular/common';
|
|
11
11
|
import { CommonModule } from '@angular/common';
|
|
@@ -998,9 +998,14 @@ class TableCreateButtonDirective {
|
|
|
998
998
|
ngOnInit() {
|
|
999
999
|
this.renderer.setStyle(this.elementRef.nativeElement, 'margin-bottom', '6px');
|
|
1000
1000
|
}
|
|
1001
|
+
ngOnDestroy() {
|
|
1002
|
+
if (this._createObservable instanceof Subject) {
|
|
1003
|
+
this._createObservable.complete();
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1001
1006
|
onClick() {
|
|
1002
1007
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1003
|
-
const result = yield this.remoteMethod.call();
|
|
1008
|
+
const result = this._createObservable = yield this.remoteMethod.call();
|
|
1004
1009
|
if (isObservable(result)) {
|
|
1005
1010
|
yield result.toPromise();
|
|
1006
1011
|
}
|
|
@@ -1017,7 +1022,7 @@ __decorate([
|
|
|
1017
1022
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: TableCreateButtonDirective, decorators: [{
|
|
1018
1023
|
type: Directive,
|
|
1019
1024
|
args: [{
|
|
1020
|
-
selector: 'button[rxapTableCreate]'
|
|
1025
|
+
selector: 'button[rxapTableCreate]'
|
|
1021
1026
|
}]
|
|
1022
1027
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1023
1028
|
type: Inject,
|