@coolon/angular-ui-powerups 13.5.3 → 13.6.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/esm2020/lib/angular-ui-powerups.module.mjs +8 -4
- package/esm2020/lib/components/components.module.mjs +6 -3
- package/esm2020/lib/components/exports.mjs +2 -1
- package/esm2020/lib/components/tables/abstract-table-model.mjs +10 -5
- package/esm2020/lib/components/tables/abstract-table.component.mjs +14 -60
- package/esm2020/lib/components/tables/paginator/paginator.component.mjs +2 -2
- package/esm2020/lib/components/tables/renderer/table-body/table-body.component.mjs +112 -0
- package/esm2020/lib/components/tables/table/table-model.mjs +21 -2
- package/esm2020/lib/components/tables/table/table.component.mjs +29 -16
- package/esm2020/lib/components/tables/tree-table/tree-table-component.mjs +9 -12
- package/fesm2015/coolon-angular-ui-powerups.mjs +424 -326
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +464 -366
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/angular-ui-powerups.module.d.ts +4 -3
- package/lib/components/components.module.d.ts +23 -22
- package/lib/components/exports.d.ts +1 -0
- package/lib/components/tables/abstract-table-model.d.ts +5 -3
- package/lib/components/tables/abstract-table.component.d.ts +7 -13
- package/lib/components/tables/renderer/table-body/table-body.component.d.ts +35 -0
- package/lib/components/tables/table/table-model.d.ts +7 -2
- package/lib/components/tables/table/table.component.d.ts +7 -5
- package/lib/components/tables/tree-table/tree-table-component.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ObserversModule } from '@angular/cdk/observers';
|
|
1
2
|
import * as i4 from '@angular/common';
|
|
2
3
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
3
4
|
import * as i0 from '@angular/core';
|
|
@@ -40,7 +41,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
|
|
40
41
|
import * as i1$5 from '@fortawesome/angular-fontawesome';
|
|
41
42
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
42
43
|
import * as i1$7 from '@coolon/pectin';
|
|
43
|
-
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, MultipleSelectionModel, AbstractComputedListModel, DelegatingSelectionModel, DirtyTrackingForm,
|
|
44
|
+
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, MultipleSelectionModel, AbstractComputedListModel, DelegatingSelectionModel, DirtyTrackingForm, PagedListModel, PageController, Trace, ComputedListModel, Deferred } from '@coolon/pectin';
|
|
44
45
|
import { __decorate, __param, __metadata } from 'tslib';
|
|
45
46
|
import * as i1$2 from '@angular/platform-browser';
|
|
46
47
|
import * as _ from 'lodash';
|
|
@@ -50,9 +51,10 @@ import { Memoize } from '@typescript-plus/fast-memoize-decorator';
|
|
|
50
51
|
import { Enum } from 'typescript-string-enums';
|
|
51
52
|
import { lang as lang$1, assert as assert$1, Stringy, Klass, Opts } from '@coolon/typescript-utilities';
|
|
52
53
|
import * as i3 from '@angular/material/core';
|
|
53
|
-
import ResizeObserver from 'resize-observer-polyfill';
|
|
54
54
|
import produce from 'immer';
|
|
55
55
|
import escapeStringRegexp from 'escape-string-regexp';
|
|
56
|
+
import { isNil as isNil$1, isEmpty as isEmpty$1 } from 'lodash-es';
|
|
57
|
+
import ResizeObserver from 'resize-observer-polyfill';
|
|
56
58
|
import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
57
59
|
import * as i6$1 from '@angular/cdk/a11y';
|
|
58
60
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
@@ -62,7 +64,6 @@ import * as i1$e from '@angular/material/dialog';
|
|
|
62
64
|
import { MatDialogModule, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
|
|
63
65
|
import * as i1$c from '@angular/router';
|
|
64
66
|
import { UrlSegment, NavigationStart, NavigationEnd, NavigationError, NavigationCancel, RouterModule, ActivatedRouteSnapshot } from '@angular/router';
|
|
65
|
-
import { isEmpty as isEmpty$1 } from 'lodash-es';
|
|
66
67
|
import * as i1$d from '@angular/cdk/overlay';
|
|
67
68
|
import * as i2$5 from '@angular/material/list';
|
|
68
69
|
import { MatListModule } from '@angular/material/list';
|
|
@@ -2343,90 +2344,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
2343
2344
|
args: [SwitchCaseOption]
|
|
2344
2345
|
}] } });
|
|
2345
2346
|
|
|
2346
|
-
class Dimension {
|
|
2347
|
-
constructor(width, height) {
|
|
2348
|
-
this.width = width;
|
|
2349
|
-
this.height = height;
|
|
2350
|
-
}
|
|
2351
|
-
}
|
|
2352
|
-
|
|
2353
|
-
class Point {
|
|
2354
|
-
constructor(x, y) {
|
|
2355
|
-
this.x = x;
|
|
2356
|
-
this.y = y;
|
|
2357
|
-
}
|
|
2358
|
-
static from(data) {
|
|
2359
|
-
return new Point(data.x, data.y);
|
|
2360
|
-
}
|
|
2361
|
-
translate(x, y) {
|
|
2362
|
-
return new Point(this.x + x, this.y + y);
|
|
2363
|
-
}
|
|
2364
|
-
}
|
|
2365
|
-
|
|
2366
|
-
class Bounds extends Dimension {
|
|
2367
|
-
constructor(top, left, width, height) {
|
|
2368
|
-
super(width, height);
|
|
2369
|
-
this.top = top;
|
|
2370
|
-
this.left = left;
|
|
2371
|
-
this.width = width;
|
|
2372
|
-
this.height = height;
|
|
2373
|
-
}
|
|
2374
|
-
relativePositionOf(point) {
|
|
2375
|
-
if (point instanceof MouseEvent) {
|
|
2376
|
-
return new Point(point.clientX - this.left, point.clientY - this.top);
|
|
2377
|
-
}
|
|
2378
|
-
else {
|
|
2379
|
-
return new Point(point.x - this.left, point.y - this.top);
|
|
2380
|
-
}
|
|
2381
|
-
}
|
|
2382
|
-
}
|
|
2383
|
-
(function (Bounds) {
|
|
2384
|
-
function ofElement(element) {
|
|
2385
|
-
const rect = element.getBoundingClientRect();
|
|
2386
|
-
return new Bounds(rect.top, rect.left, rect.width, rect.height);
|
|
2387
|
-
}
|
|
2388
|
-
Bounds.ofElement = ofElement;
|
|
2389
|
-
})(Bounds || (Bounds = {}));
|
|
2390
|
-
|
|
2391
|
-
class ResizeAwareComponent extends DisposableComponent {
|
|
2392
|
-
constructor(elementRef, ngZone) {
|
|
2393
|
-
super();
|
|
2394
|
-
this.elementRef = elementRef;
|
|
2395
|
-
this.ngZone = ngZone;
|
|
2396
|
-
this._boundsModel = new MutableValueModel(new Bounds(0, 0, 0, 0));
|
|
2397
|
-
}
|
|
2398
|
-
ngAfterViewInit() {
|
|
2399
|
-
const element = this.elementRef.nativeElement;
|
|
2400
|
-
const ro = new ResizeObserver((entries, observer) => {
|
|
2401
|
-
this.ngZone.run(() => this._updateBounds());
|
|
2402
|
-
});
|
|
2403
|
-
ro.observe(element);
|
|
2404
|
-
this.onDispose(() => ro.disconnect());
|
|
2405
|
-
setTimeout(() => this._updateBounds());
|
|
2406
|
-
}
|
|
2407
|
-
get boundsModel() {
|
|
2408
|
-
return this._boundsModel.readonly;
|
|
2409
|
-
}
|
|
2410
|
-
get nativeElement() {
|
|
2411
|
-
return this.elementRef.nativeElement;
|
|
2412
|
-
}
|
|
2413
|
-
// TODO: Make this handle body scroll
|
|
2414
|
-
relativePositionOf(point) {
|
|
2415
|
-
return this.bounds.relativePositionOf(point);
|
|
2416
|
-
}
|
|
2417
|
-
get bounds() {
|
|
2418
|
-
return this._boundsModel.value;
|
|
2419
|
-
}
|
|
2420
|
-
_updateBounds() {
|
|
2421
|
-
this._boundsModel.value = Bounds.ofElement(this.nativeElement);
|
|
2422
|
-
}
|
|
2423
|
-
}
|
|
2424
|
-
ResizeAwareComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ResizeAwareComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2425
|
-
ResizeAwareComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: ResizeAwareComponent, usesInheritance: true, ngImport: i0 });
|
|
2426
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ResizeAwareComponent, decorators: [{
|
|
2427
|
-
type: Directive
|
|
2428
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; } });
|
|
2429
|
-
|
|
2430
2347
|
const HEADER_CELL_RENDERER_PORTAL = Symbol('aup-cell-header-renderer-component-ref');
|
|
2431
2348
|
const CELL_RENDERER_PORTAL = Symbol('aup-cell-renderer-component-ref');
|
|
2432
2349
|
const CELL_EDITOR_PORTAL = Symbol('aup-cell-editor-component-ref');
|
|
@@ -2827,9 +2744,9 @@ class CustomTemplateColumnModel extends ColumnModel {
|
|
|
2827
2744
|
* }
|
|
2828
2745
|
* }
|
|
2829
2746
|
*/
|
|
2830
|
-
class AbstractTableComponent extends
|
|
2831
|
-
constructor(
|
|
2832
|
-
super(
|
|
2747
|
+
class AbstractTableComponent extends DisposableComponent {
|
|
2748
|
+
constructor(injector) {
|
|
2749
|
+
super();
|
|
2833
2750
|
this.injector = injector;
|
|
2834
2751
|
/**
|
|
2835
2752
|
* Set to true to enable scrolling. Once enabled the table will have 0 implicit height. You will either
|
|
@@ -2842,33 +2759,14 @@ class AbstractTableComponent extends ResizeAwareComponent {
|
|
|
2842
2759
|
this.rowHeight = new MutableValueModel(48);
|
|
2843
2760
|
this.baseCssClass = 'aup-table-component';
|
|
2844
2761
|
const { chain, when } = Dsl.disposeWith(this);
|
|
2845
|
-
const actualHeaderHeight = chain(this.showHeaderModel).map(show => {
|
|
2846
|
-
return show ? this.headerHeight.value : 0;
|
|
2847
|
-
}, { dependsOn: this.headerHeight });
|
|
2848
|
-
this.visibleRowCount = chain(this.boundsModel).map(bounds => {
|
|
2849
|
-
// TODO: this doesn't take into account any css styling adjustments etc. Will investigate if it's an issue.
|
|
2850
|
-
const rawRowCount = (bounds.height - actualHeaderHeight.value) / this.rowHeight.value;
|
|
2851
|
-
return rawRowCount < 1 ? 0 : Math.floor(rawRowCount);
|
|
2852
|
-
}, {
|
|
2853
|
-
dependsOn: [actualHeaderHeight, this.rowHeight],
|
|
2854
|
-
postponeWhile: chain(this.boundsModel).pluckNumeric('height').isLessThan(1)
|
|
2855
|
-
});
|
|
2856
|
-
}
|
|
2857
|
-
get hideHeader() {
|
|
2858
|
-
return !this.showHeader;
|
|
2859
|
-
}
|
|
2860
|
-
getModel() {
|
|
2861
|
-
return lang$1.abstractMethod(this.constructor);
|
|
2862
2762
|
}
|
|
2863
2763
|
ngOnInit() {
|
|
2864
2764
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
2865
2765
|
this.getModel().initialise(this.injector);
|
|
2866
|
-
this.
|
|
2867
|
-
this.columnIds = chain(this.columns).pluck('columnId');
|
|
2868
|
-
this.columnsById = chain(this.columns).indexBy('columnId');
|
|
2766
|
+
this.columnsById = chain(this.getModel().columns).indexBy('columnId');
|
|
2869
2767
|
}
|
|
2870
|
-
|
|
2871
|
-
return
|
|
2768
|
+
getModel() {
|
|
2769
|
+
return lang$1.abstractMethod(this.constructor);
|
|
2872
2770
|
}
|
|
2873
2771
|
registerColumnTemplate(columnId, templateRef, viewContainer, fillCell, padChild) {
|
|
2874
2772
|
const column = this.columnsById.get(columnId);
|
|
@@ -2876,36 +2774,15 @@ class AbstractTableComponent extends ResizeAwareComponent {
|
|
|
2876
2774
|
column.setTemplate(templateRef, viewContainer, fillCell, padChild);
|
|
2877
2775
|
}
|
|
2878
2776
|
}
|
|
2879
|
-
notifyCellClicked(columnModel, row) {
|
|
2880
|
-
this.getModel()._notifyCellClicked(columnModel, row);
|
|
2881
|
-
}
|
|
2882
|
-
// @Trace()
|
|
2883
|
-
isFirstVisibleColumn(columnId) {
|
|
2884
|
-
return this.getModel().firstVisibleColumn$.query().value?.columnId === columnId;
|
|
2885
|
-
}
|
|
2886
|
-
// @Trace()
|
|
2887
|
-
isLastVisibleColumn(columnId) {
|
|
2888
|
-
return this.getModel().lastVisibleColumn$.query().value?.columnId === columnId;
|
|
2889
|
-
}
|
|
2890
|
-
getColumnClasses(columnId) {
|
|
2891
|
-
const classes = [`aup-col-${this.columnsById.get(columnId).dasherisedColumnId}`];
|
|
2892
|
-
if (this.isFirstVisibleColumn(columnId)) {
|
|
2893
|
-
classes.push('first-visible-column');
|
|
2894
|
-
}
|
|
2895
|
-
if (this.isLastVisibleColumn(columnId)) {
|
|
2896
|
-
classes.push('last-visible-column');
|
|
2897
|
-
}
|
|
2898
|
-
return classes;
|
|
2899
|
-
}
|
|
2900
2777
|
}
|
|
2901
|
-
AbstractTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AbstractTableComponent, deps: [{ token: i0.
|
|
2902
|
-
AbstractTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: AbstractTableComponent, selector: "aup-abstract-table", inputs: {
|
|
2778
|
+
AbstractTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AbstractTableComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
2779
|
+
AbstractTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: AbstractTableComponent, selector: "aup-abstract-table", inputs: { showHeader$: "showHeader$", showHeader: "showHeader", enableScrolling: "enableScrolling" }, host: { properties: { "class": "this.baseCssClass" } }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
2903
2780
|
__decorate([
|
|
2904
2781
|
TrackExternal({ defaultValue: true }),
|
|
2905
2782
|
__metadata("design:type", ValueModel)
|
|
2906
|
-
], AbstractTableComponent.prototype, "
|
|
2783
|
+
], AbstractTableComponent.prototype, "showHeader$", void 0);
|
|
2907
2784
|
__decorate([
|
|
2908
|
-
StoreInValueModel(
|
|
2785
|
+
StoreInValueModel("showHeader$"),
|
|
2909
2786
|
__metadata("design:type", Boolean)
|
|
2910
2787
|
], AbstractTableComponent.prototype, "showHeader", void 0);
|
|
2911
2788
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AbstractTableComponent, decorators: [{
|
|
@@ -2914,21 +2791,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
2914
2791
|
selector: 'aup-abstract-table',
|
|
2915
2792
|
template: ''
|
|
2916
2793
|
}]
|
|
2917
|
-
}], ctorParameters: function () { return [{ type: i0.
|
|
2794
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { showHeader$: [{
|
|
2918
2795
|
type: Input
|
|
2919
2796
|
}], showHeader: [{
|
|
2920
2797
|
type: Input
|
|
2921
2798
|
}], enableScrolling: [{
|
|
2922
2799
|
type: Input
|
|
2923
|
-
}, {
|
|
2924
|
-
type: HostBinding,
|
|
2925
|
-
args: ['class.enable-scrolling']
|
|
2926
2800
|
}], baseCssClass: [{
|
|
2927
2801
|
type: HostBinding,
|
|
2928
2802
|
args: ['class']
|
|
2929
|
-
}], hideHeader: [{
|
|
2930
|
-
type: HostBinding,
|
|
2931
|
-
args: ['class.hide-header']
|
|
2932
2803
|
}] } });
|
|
2933
2804
|
|
|
2934
2805
|
class ColumnTemplateDirective {
|
|
@@ -3377,7 +3248,8 @@ class RowClass {
|
|
|
3377
3248
|
class AbstractTableModel extends GarbageCollector {
|
|
3378
3249
|
constructor() {
|
|
3379
3250
|
super();
|
|
3380
|
-
this.
|
|
3251
|
+
this._rawDataSource = this.registerDisposable(new DelegatingListModel());
|
|
3252
|
+
this._visibleRows$ = this.registerDisposable(new DelegatingListModel());
|
|
3381
3253
|
this._columnList = this.registerDisposable(new ColumnListModel());
|
|
3382
3254
|
this._editorSessions = new MutableListModel();
|
|
3383
3255
|
this.rowClassNamePredicates = [];
|
|
@@ -3402,11 +3274,12 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3402
3274
|
allowNil: true,
|
|
3403
3275
|
dependsOn: this.columns
|
|
3404
3276
|
});
|
|
3405
|
-
this.
|
|
3277
|
+
this._filteredRows$ = chain(this._rawDataSource)
|
|
3406
3278
|
.reduceToList(items => this._textSearchPredicate$.value(items), {
|
|
3407
3279
|
dependsOn: this._textSearchPredicate$
|
|
3408
3280
|
})
|
|
3409
3281
|
.replaceAll(this.rowsBeingEdited$);
|
|
3282
|
+
this._visibleRows$.setDelegate(this._filteredRows$);
|
|
3410
3283
|
this.firstEditableColumn$ = chain(this.columns).select(c => c.hasEditorPortal()).first();
|
|
3411
3284
|
this.firstVisibleColumn$ = chain(this._columnList).first();
|
|
3412
3285
|
this.lastVisibleColumn$ = chain(this._columnList).last();
|
|
@@ -3430,15 +3303,18 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3430
3303
|
});
|
|
3431
3304
|
this.columns.value.forEach(c => c.initialise(customInjector));
|
|
3432
3305
|
}
|
|
3306
|
+
get visibleRows$() {
|
|
3307
|
+
return this._visibleRows$.readonly;
|
|
3308
|
+
}
|
|
3433
3309
|
setDataSource(sourceOfTruth) {
|
|
3434
|
-
this.
|
|
3310
|
+
this._rawDataSource.setDelegate(sourceOfTruth);
|
|
3435
3311
|
}
|
|
3436
3312
|
setTextSearch(searchText$, throttleDelayMilliseconds = 100) {
|
|
3437
3313
|
const { chain } = Dsl.disposeWith(this);
|
|
3438
3314
|
this._searchText$.setDelegate(chain(searchText$).throttle(throttleDelayMilliseconds));
|
|
3439
3315
|
}
|
|
3440
3316
|
identityOf(row) {
|
|
3441
|
-
return this.
|
|
3317
|
+
return this._rawDataSource.identityOf(row);
|
|
3442
3318
|
}
|
|
3443
3319
|
get rowsBeingEdited$() {
|
|
3444
3320
|
return this._rowsBeingEdited$.readonly;
|
|
@@ -3667,98 +3543,425 @@ class TableHeaderCellComponent {
|
|
|
3667
3543
|
this.column.attachHeaderCell(this);
|
|
3668
3544
|
}
|
|
3669
3545
|
// @Trace()
|
|
3670
|
-
initialiseHeader(ref) {
|
|
3671
|
-
this.column.onHeaderAttached(this, ref);
|
|
3546
|
+
initialiseHeader(ref) {
|
|
3547
|
+
this.column.onHeaderAttached(this, ref);
|
|
3548
|
+
}
|
|
3549
|
+
getPortal() {
|
|
3550
|
+
return this[HEADER_CELL_RENDERER_PORTAL];
|
|
3551
|
+
}
|
|
3552
|
+
}
|
|
3553
|
+
TableHeaderCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableHeaderCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3554
|
+
TableHeaderCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: TableHeaderCellComponent, selector: "aup-table-header-cell", inputs: { column: "column" }, host: { properties: { "class": "this.defaultClassNames" } }, ngImport: i0, template: "<ng-container [cdkPortalOutlet]=\"getPortal()\" (attached)=\"initialiseHeader($event)\"></ng-container>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch;justify-content:center;height:100%}\n"], directives: [{ type: i2$4.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }] });
|
|
3555
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableHeaderCellComponent, decorators: [{
|
|
3556
|
+
type: Component,
|
|
3557
|
+
args: [{ selector: 'aup-table-header-cell', template: "<ng-container [cdkPortalOutlet]=\"getPortal()\" (attached)=\"initialiseHeader($event)\"></ng-container>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch;justify-content:center;height:100%}\n"] }]
|
|
3558
|
+
}], ctorParameters: function () { return []; }, propDecorators: { column: [{
|
|
3559
|
+
type: Input
|
|
3560
|
+
}], defaultClassNames: [{
|
|
3561
|
+
type: HostBinding,
|
|
3562
|
+
args: ['class']
|
|
3563
|
+
}] } });
|
|
3564
|
+
|
|
3565
|
+
class MenuItemData {
|
|
3566
|
+
constructor(factory, face) {
|
|
3567
|
+
this.factory = factory;
|
|
3568
|
+
this.face = face;
|
|
3569
|
+
}
|
|
3570
|
+
}
|
|
3571
|
+
/**
|
|
3572
|
+
*
|
|
3573
|
+
*/
|
|
3574
|
+
class TableRowMenuComponent extends DisposableComponent {
|
|
3575
|
+
constructor() {
|
|
3576
|
+
super();
|
|
3577
|
+
this.actions = [];
|
|
3578
|
+
this.moreActions = [];
|
|
3579
|
+
}
|
|
3580
|
+
registerAction(commandFactory, properties) {
|
|
3581
|
+
this.actions.push(new MenuItemData(commandFactory, properties));
|
|
3582
|
+
}
|
|
3583
|
+
registerMoreAction(commandFactory, properties) {
|
|
3584
|
+
this.moreActions.push(new MenuItemData(commandFactory, properties));
|
|
3585
|
+
}
|
|
3586
|
+
createMoreMenuCommand(item, value) {
|
|
3587
|
+
const { when } = Dsl.disposeWith(this);
|
|
3588
|
+
const command = item.factory.create(value);
|
|
3589
|
+
when(command.busy).becomesFalsey(() => {
|
|
3590
|
+
this.closeMoreMenu();
|
|
3591
|
+
});
|
|
3592
|
+
return command;
|
|
3593
|
+
}
|
|
3594
|
+
closeMoreMenu() {
|
|
3595
|
+
this.menu.closeMenu();
|
|
3596
|
+
}
|
|
3597
|
+
}
|
|
3598
|
+
TableRowMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableRowMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3599
|
+
TableRowMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: TableRowMenuComponent, selector: "aup-table-row-menu", inputs: { value: "value" }, viewQueries: [{ propertyName: "menu", first: true, predicate: MatMenuTrigger, descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
3600
|
+
<aup-tool-bar>
|
|
3601
|
+
<aup-command *ngFor="let action of actions" [command]="action.factory.create(value)"
|
|
3602
|
+
[face]="action.face"></aup-command>
|
|
3603
|
+
</aup-tool-bar>
|
|
3604
|
+
<ng-container *ngIf="moreActions.length > 0">
|
|
3605
|
+
<aup-more-menu>
|
|
3606
|
+
<aup-command *ngFor="let action of moreActions" [command]="action.factory.create(value)"
|
|
3607
|
+
[face]="action.face"></aup-command>
|
|
3608
|
+
</aup-more-menu>
|
|
3609
|
+
</ng-container>
|
|
3610
|
+
`, isInline: true, styles: [":host{display:inline-flex;flex-direction:row;align-items:center}\n"], components: [{ type: ToolBarComponent, selector: "aup-tool-bar" }, { type: CommandComponent, selector: "aup-command", inputs: ["command", "faceModel", "face", "busyFaceModel", "busyFace", "alignFace"] }, { type: MoreMenuComponent, selector: "aup-more-menu", inputs: ["tooltip"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3611
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableRowMenuComponent, decorators: [{
|
|
3612
|
+
type: Component,
|
|
3613
|
+
args: [{
|
|
3614
|
+
selector: 'aup-table-row-menu',
|
|
3615
|
+
template: `
|
|
3616
|
+
<aup-tool-bar>
|
|
3617
|
+
<aup-command *ngFor="let action of actions" [command]="action.factory.create(value)"
|
|
3618
|
+
[face]="action.face"></aup-command>
|
|
3619
|
+
</aup-tool-bar>
|
|
3620
|
+
<ng-container *ngIf="moreActions.length > 0">
|
|
3621
|
+
<aup-more-menu>
|
|
3622
|
+
<aup-command *ngFor="let action of moreActions" [command]="action.factory.create(value)"
|
|
3623
|
+
[face]="action.face"></aup-command>
|
|
3624
|
+
</aup-more-menu>
|
|
3625
|
+
</ng-container>
|
|
3626
|
+
`,
|
|
3627
|
+
styles: [`:host {
|
|
3628
|
+
display: inline-flex;
|
|
3629
|
+
flex-direction: row;
|
|
3630
|
+
align-items: center;
|
|
3631
|
+
}`]
|
|
3632
|
+
}]
|
|
3633
|
+
}], ctorParameters: function () { return []; }, propDecorators: { value: [{
|
|
3634
|
+
type: Input
|
|
3635
|
+
}], menu: [{
|
|
3636
|
+
type: ViewChild,
|
|
3637
|
+
args: [MatMenuTrigger]
|
|
3638
|
+
}] } });
|
|
3639
|
+
|
|
3640
|
+
/**
|
|
3641
|
+
* Example:
|
|
3642
|
+
* @example
|
|
3643
|
+
* const model = new TableModel(heroList, table => {
|
|
3644
|
+
* table.pluck("firstName");
|
|
3645
|
+
* table.pluck("lastName");
|
|
3646
|
+
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
3647
|
+
* });
|
|
3648
|
+
*
|
|
3649
|
+
* Editable tables
|
|
3650
|
+
* @example
|
|
3651
|
+
* const saveCommand = UnaryCommand.create((form: Form<Hero>) => {
|
|
3652
|
+
* if (form.validate()) {
|
|
3653
|
+
* // normal form save stuff
|
|
3654
|
+
* return true; // finish editing
|
|
3655
|
+
* }
|
|
3656
|
+
* return false; // continue editiing
|
|
3657
|
+
* }
|
|
3658
|
+
* const colorsNames: ListModel<string> = ...;
|
|
3659
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
3660
|
+
* table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
|
|
3661
|
+
* table.pluck("lastName").cellEditor(StringInputComponent, {
|
|
3662
|
+
* validators: [Validator.present("We need a last name")]
|
|
3663
|
+
* });
|
|
3664
|
+
* table.pluck("age").cellEditor(NumberInputComponent);
|
|
3665
|
+
* table.pluck("favoriteColor").cellEditor(SelectInputComponent, {
|
|
3666
|
+
* initialiseComponent(component: SelectInputComponent) {
|
|
3667
|
+
* selectInput.optionsModel = colorsNames; // <- initialise our component
|
|
3668
|
+
* }
|
|
3669
|
+
* });
|
|
3670
|
+
* table.addEditControls(saveCommand); // <- required to enable editing
|
|
3671
|
+
* });
|
|
3672
|
+
*
|
|
3673
|
+
* Selection models
|
|
3674
|
+
* @example
|
|
3675
|
+
* const model = new TableModel(heroList, table => {
|
|
3676
|
+
* table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
|
|
3677
|
+
* table.pluck("firstName");
|
|
3678
|
+
* table.pluck("lastName");
|
|
3679
|
+
* });
|
|
3680
|
+
*
|
|
3681
|
+
* Custom cell renderers and editors
|
|
3682
|
+
* @example
|
|
3683
|
+
* const model = new TableModel(heroList, table => {
|
|
3684
|
+
* table.pluck("favoriteColor")
|
|
3685
|
+
* .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {
|
|
3686
|
+
* // configure your component with what ever you need.
|
|
3687
|
+
* });
|
|
3688
|
+
* .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }
|
|
3689
|
+
* .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
|
|
3690
|
+
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
3691
|
+
* });
|
|
3692
|
+
*
|
|
3693
|
+
* Template columns
|
|
3694
|
+
* @example
|
|
3695
|
+
* const model = new TableModel(heroList, table => {
|
|
3696
|
+
* table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
|
|
3697
|
+
* table.addTemplateColumn("myTemplate");
|
|
3698
|
+
* });
|
|
3699
|
+
*
|
|
3700
|
+
* <div *aupColumnTemplate="let hero; columnId: 'myTemplate'">{{hero.age}}</div>
|
|
3701
|
+
*
|
|
3702
|
+
* I18n
|
|
3703
|
+
* @example
|
|
3704
|
+
* [table.yml]
|
|
3705
|
+
* table:
|
|
3706
|
+
* columns(ColumnTextProperties[]):
|
|
3707
|
+
* firstName:
|
|
3708
|
+
* headerText: "First Name"
|
|
3709
|
+
* fullName:
|
|
3710
|
+
* headerText: "Full Name"
|
|
3711
|
+
*
|
|
3712
|
+
* const model = new TableModel(heroList, table => {
|
|
3713
|
+
* table.pluck("favoriteColor").cellRenderer(...).cellEditor(...);
|
|
3714
|
+
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
3715
|
+
*
|
|
3716
|
+
* table.columnTextProperties(I18n.table.columns); // <- configures all columns
|
|
3717
|
+
* });
|
|
3718
|
+
*/
|
|
3719
|
+
class TableModel extends AbstractTableModel {
|
|
3720
|
+
constructor(sourceOfTruth, builder) {
|
|
3721
|
+
super();
|
|
3722
|
+
this._pageSize = new MutableValueModel();
|
|
3723
|
+
if (builder) {
|
|
3724
|
+
builder(this);
|
|
3725
|
+
}
|
|
3726
|
+
if (sourceOfTruth) {
|
|
3727
|
+
this.setDataSource(sourceOfTruth);
|
|
3728
|
+
}
|
|
3729
|
+
}
|
|
3730
|
+
get pageController() {
|
|
3731
|
+
return this._pageController;
|
|
3732
|
+
}
|
|
3733
|
+
enablePaging() {
|
|
3734
|
+
if (isNil$1(this.pageController)) {
|
|
3735
|
+
const pagedListModel = this.registerDisposable(PagedListModel.wrap(this._visibleRows$.getDelegate()));
|
|
3736
|
+
this._visibleRows$.setDelegate(pagedListModel);
|
|
3737
|
+
this._pageController = pagedListModel.pageController;
|
|
3738
|
+
this._pageController.setPageSize(this._pageSize);
|
|
3739
|
+
}
|
|
3740
|
+
}
|
|
3741
|
+
addSelectionColumn(selectionModel, showSelectionColumn) {
|
|
3742
|
+
return this._addSelectionColumn(selectionModel, showSelectionColumn);
|
|
3743
|
+
}
|
|
3744
|
+
updatePageSize(count) {
|
|
3745
|
+
this._pageSize.value = count;
|
|
3746
|
+
}
|
|
3747
|
+
}
|
|
3748
|
+
|
|
3749
|
+
class Dimension {
|
|
3750
|
+
constructor(width, height) {
|
|
3751
|
+
this.width = width;
|
|
3752
|
+
this.height = height;
|
|
3753
|
+
}
|
|
3754
|
+
}
|
|
3755
|
+
|
|
3756
|
+
class Point {
|
|
3757
|
+
constructor(x, y) {
|
|
3758
|
+
this.x = x;
|
|
3759
|
+
this.y = y;
|
|
3760
|
+
}
|
|
3761
|
+
static from(data) {
|
|
3762
|
+
return new Point(data.x, data.y);
|
|
3763
|
+
}
|
|
3764
|
+
translate(x, y) {
|
|
3765
|
+
return new Point(this.x + x, this.y + y);
|
|
3766
|
+
}
|
|
3767
|
+
}
|
|
3768
|
+
|
|
3769
|
+
class Bounds extends Dimension {
|
|
3770
|
+
constructor(top, left, width, height) {
|
|
3771
|
+
super(width, height);
|
|
3772
|
+
this.top = top;
|
|
3773
|
+
this.left = left;
|
|
3774
|
+
this.width = width;
|
|
3775
|
+
this.height = height;
|
|
3776
|
+
}
|
|
3777
|
+
relativePositionOf(point) {
|
|
3778
|
+
if (point instanceof MouseEvent) {
|
|
3779
|
+
return new Point(point.clientX - this.left, point.clientY - this.top);
|
|
3780
|
+
}
|
|
3781
|
+
else {
|
|
3782
|
+
return new Point(point.x - this.left, point.y - this.top);
|
|
3783
|
+
}
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
(function (Bounds) {
|
|
3787
|
+
function ofElement(element) {
|
|
3788
|
+
const rect = element.getBoundingClientRect();
|
|
3789
|
+
return new Bounds(rect.top, rect.left, rect.width, rect.height);
|
|
3790
|
+
}
|
|
3791
|
+
Bounds.ofElement = ofElement;
|
|
3792
|
+
})(Bounds || (Bounds = {}));
|
|
3793
|
+
|
|
3794
|
+
class ResizeAwareComponent extends DisposableComponent {
|
|
3795
|
+
constructor(elementRef, ngZone) {
|
|
3796
|
+
super();
|
|
3797
|
+
this.elementRef = elementRef;
|
|
3798
|
+
this.ngZone = ngZone;
|
|
3799
|
+
this._boundsModel = new MutableValueModel(new Bounds(0, 0, 0, 0));
|
|
3800
|
+
}
|
|
3801
|
+
ngAfterViewInit() {
|
|
3802
|
+
const element = this.elementRef.nativeElement;
|
|
3803
|
+
const ro = new ResizeObserver((entries, observer) => {
|
|
3804
|
+
this.ngZone.run(() => this._updateBounds());
|
|
3805
|
+
});
|
|
3806
|
+
ro.observe(element);
|
|
3807
|
+
this.onDispose(() => ro.disconnect());
|
|
3808
|
+
setTimeout(() => this._updateBounds());
|
|
3809
|
+
}
|
|
3810
|
+
get boundsModel() {
|
|
3811
|
+
return this._boundsModel.readonly;
|
|
3812
|
+
}
|
|
3813
|
+
get nativeElement() {
|
|
3814
|
+
return this.elementRef.nativeElement;
|
|
3815
|
+
}
|
|
3816
|
+
// TODO: Make this handle body scroll
|
|
3817
|
+
relativePositionOf(point) {
|
|
3818
|
+
return this.bounds.relativePositionOf(point);
|
|
3819
|
+
}
|
|
3820
|
+
get bounds() {
|
|
3821
|
+
return this._boundsModel.value;
|
|
3822
|
+
}
|
|
3823
|
+
_updateBounds() {
|
|
3824
|
+
this._boundsModel.value = Bounds.ofElement(this.nativeElement);
|
|
3825
|
+
}
|
|
3826
|
+
}
|
|
3827
|
+
ResizeAwareComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ResizeAwareComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3828
|
+
ResizeAwareComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: ResizeAwareComponent, usesInheritance: true, ngImport: i0 });
|
|
3829
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ResizeAwareComponent, decorators: [{
|
|
3830
|
+
type: Directive
|
|
3831
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; } });
|
|
3832
|
+
|
|
3833
|
+
class TableBodyComponent extends ResizeAwareComponent {
|
|
3834
|
+
constructor(elementRef, ngZone) {
|
|
3835
|
+
super(elementRef, ngZone);
|
|
3836
|
+
this.visibleRowCount = new EventEmitter();
|
|
3837
|
+
/**
|
|
3838
|
+
* Set to true to enable scrolling. Once enabled the table will have 0 implicit height. You will either
|
|
3839
|
+
* need to set it explicitly e.g. height: 400px; or by using flex or grid layout to make it fill it's
|
|
3840
|
+
* containment area.
|
|
3841
|
+
*/
|
|
3842
|
+
this.enableScrolling = false;
|
|
3843
|
+
// TODO: support user defined header and row heights via css vars.
|
|
3844
|
+
this.headerHeight = new MutableValueModel(56);
|
|
3845
|
+
this.rowHeight = new MutableValueModel(48);
|
|
3846
|
+
this.baseCssClass = "aup-table-component";
|
|
3847
|
+
const { chain, when } = Dsl.disposeWith(this);
|
|
3848
|
+
const actualHeaderHeight = chain(this.showHeader$).map(show => {
|
|
3849
|
+
return show ? this.headerHeight.value : 0;
|
|
3850
|
+
}, { dependsOn: this.headerHeight });
|
|
3851
|
+
this._visibleRowCount = chain(this.boundsModel).map(bounds => {
|
|
3852
|
+
// TODO: this doesn't take into account any css styling adjustments etc. Will investigate if it's an issue.
|
|
3853
|
+
const rawRowCount = (bounds.height - actualHeaderHeight.value) / this.rowHeight.value;
|
|
3854
|
+
return rawRowCount < 1 ? 0 : Math.floor(rawRowCount);
|
|
3855
|
+
}, {
|
|
3856
|
+
dependsOn: [actualHeaderHeight, this.rowHeight],
|
|
3857
|
+
postponeWhile: chain(this.boundsModel).pluckNumeric("height").isLessThan(1)
|
|
3858
|
+
});
|
|
3859
|
+
when(this._visibleRowCount).changes(visibleRows => {
|
|
3860
|
+
this.visibleRowCount.emit(visibleRows);
|
|
3861
|
+
}, { initialValue: "triggerChangeUnlessNil" });
|
|
3862
|
+
}
|
|
3863
|
+
get hideHeader() {
|
|
3864
|
+
return !this.showHeader;
|
|
3865
|
+
}
|
|
3866
|
+
ngOnInit() {
|
|
3867
|
+
const { chain } = Dsl.disposeWith(this);
|
|
3868
|
+
this.columns = chain(this.tableModel.columns);
|
|
3869
|
+
this.columnIds = chain(this.columns).pluck("columnId");
|
|
3870
|
+
this.columnsById = chain(this.columns).indexBy('columnId');
|
|
3871
|
+
}
|
|
3872
|
+
isEditing(row) {
|
|
3873
|
+
return !!this.tableModel.getEditSessionFor(row);
|
|
3874
|
+
}
|
|
3875
|
+
notifyCellClicked(columnModel, row) {
|
|
3876
|
+
this.tableModel._notifyCellClicked(columnModel, row);
|
|
3877
|
+
}
|
|
3878
|
+
// @Trace()
|
|
3879
|
+
isFirstVisibleColumn(columnId) {
|
|
3880
|
+
return this.tableModel.firstVisibleColumn$.query().value?.columnId === columnId;
|
|
3672
3881
|
}
|
|
3673
|
-
|
|
3674
|
-
|
|
3882
|
+
// @Trace()
|
|
3883
|
+
isLastVisibleColumn(columnId) {
|
|
3884
|
+
return this.tableModel.lastVisibleColumn$.query().value?.columnId === columnId;
|
|
3885
|
+
}
|
|
3886
|
+
getColumnClasses(columnId) {
|
|
3887
|
+
const classes = [`aup-col-${this.columnsById.get(columnId).dasherisedColumnId}`];
|
|
3888
|
+
if (this.isFirstVisibleColumn(columnId)) {
|
|
3889
|
+
classes.push("first-visible-column");
|
|
3890
|
+
}
|
|
3891
|
+
if (this.isLastVisibleColumn(columnId)) {
|
|
3892
|
+
classes.push("last-visible-column");
|
|
3893
|
+
}
|
|
3894
|
+
return classes;
|
|
3675
3895
|
}
|
|
3676
3896
|
}
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3897
|
+
TableBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableBodyComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
3898
|
+
TableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: TableBodyComponent, selector: "aup-table-body", inputs: { tableModel: "tableModel", showHeader$: "showHeader$", showHeader: "showHeader", enableScrolling: "enableScrolling" }, outputs: { visibleRowCount: "visibleRowCount" }, host: { properties: { "class.enable-scrolling": "this.enableScrolling", "class": "this.baseCssClass", "class.hide-header": "this.hideHeader" } }, usesInheritance: true, ngImport: i0, template: "<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"tableModel.visibleRows$.value\" [trackBy]=\"tableModel.trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\" [class.enable-hover]=\"tableModel.isHoverEnabled()\"\n [attr.aup-row-id]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}\n"], components: [{ type: i1$b.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: TableHeaderCellComponent, selector: "aup-table-header-cell", inputs: ["column"] }, { type: TableCellComponent, selector: "aup-table-cell", inputs: ["row", "column", "editSession", "tableModel"] }, { type: i1$b.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i1$b.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$b.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i1$b.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i1$b.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i1$b.MatCellDef, selector: "[matCellDef]" }, { type: i1$b.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i1$b.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i1$b.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
3899
|
+
__decorate([
|
|
3900
|
+
TrackExternal(),
|
|
3901
|
+
__metadata("design:type", AbstractTableModel)
|
|
3902
|
+
], TableBodyComponent.prototype, "tableModel", void 0);
|
|
3903
|
+
__decorate([
|
|
3904
|
+
TrackExternal({ defaultValue: true }),
|
|
3905
|
+
__metadata("design:type", ValueModel)
|
|
3906
|
+
], TableBodyComponent.prototype, "showHeader$", void 0);
|
|
3907
|
+
__decorate([
|
|
3908
|
+
StoreInValueModel("showHeader$"),
|
|
3909
|
+
__metadata("design:type", Boolean)
|
|
3910
|
+
], TableBodyComponent.prototype, "showHeader", void 0);
|
|
3911
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableBodyComponent, decorators: [{
|
|
3680
3912
|
type: Component,
|
|
3681
|
-
args: [{ selector:
|
|
3682
|
-
}], ctorParameters: function () { return []; }, propDecorators: {
|
|
3913
|
+
args: [{ selector: "aup-table-body", template: "<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"tableModel.visibleRows$.value\" [trackBy]=\"tableModel.trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\" [class.enable-hover]=\"tableModel.isHoverEnabled()\"\n [attr.aup-row-id]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}\n"] }]
|
|
3914
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { tableModel: [{
|
|
3683
3915
|
type: Input
|
|
3684
|
-
}],
|
|
3916
|
+
}], showHeader$: [{
|
|
3917
|
+
type: Input
|
|
3918
|
+
}], showHeader: [{
|
|
3919
|
+
type: Input
|
|
3920
|
+
}], visibleRowCount: [{
|
|
3921
|
+
type: Output
|
|
3922
|
+
}], enableScrolling: [{
|
|
3923
|
+
type: Input
|
|
3924
|
+
}, {
|
|
3685
3925
|
type: HostBinding,
|
|
3686
|
-
args: [
|
|
3926
|
+
args: ["class.enable-scrolling"]
|
|
3927
|
+
}], baseCssClass: [{
|
|
3928
|
+
type: HostBinding,
|
|
3929
|
+
args: ["class"]
|
|
3930
|
+
}], hideHeader: [{
|
|
3931
|
+
type: HostBinding,
|
|
3932
|
+
args: ["class.hide-header"]
|
|
3687
3933
|
}] } });
|
|
3688
3934
|
|
|
3689
|
-
class
|
|
3690
|
-
constructor(factory, face) {
|
|
3691
|
-
this.factory = factory;
|
|
3692
|
-
this.face = face;
|
|
3693
|
-
}
|
|
3694
|
-
}
|
|
3695
|
-
/**
|
|
3696
|
-
*
|
|
3697
|
-
*/
|
|
3698
|
-
class TableRowMenuComponent extends DisposableComponent {
|
|
3935
|
+
class PaginatorComponent extends DisposableComponent {
|
|
3699
3936
|
constructor() {
|
|
3700
3937
|
super();
|
|
3701
|
-
this.actions = [];
|
|
3702
|
-
this.moreActions = [];
|
|
3703
3938
|
}
|
|
3704
|
-
|
|
3705
|
-
this.actions.push(new MenuItemData(commandFactory, properties));
|
|
3939
|
+
ngOnInit() {
|
|
3706
3940
|
}
|
|
3707
|
-
|
|
3708
|
-
this.
|
|
3941
|
+
get totalPages() {
|
|
3942
|
+
return this.pageController.totalPages.value;
|
|
3709
3943
|
}
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
const command = item.factory.create(value);
|
|
3713
|
-
when(command.busy).becomesFalsey(() => {
|
|
3714
|
-
this.closeMoreMenu();
|
|
3715
|
-
});
|
|
3716
|
-
return command;
|
|
3944
|
+
get pageNumber() {
|
|
3945
|
+
return this.pageController.pageNumber.value;
|
|
3717
3946
|
}
|
|
3718
|
-
|
|
3719
|
-
this.
|
|
3947
|
+
get previousCommand() {
|
|
3948
|
+
return this.pageController.previousCommand;
|
|
3949
|
+
}
|
|
3950
|
+
get nextCommand() {
|
|
3951
|
+
return this.pageController.nextCommand;
|
|
3720
3952
|
}
|
|
3721
3953
|
}
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
<aup-more-menu>
|
|
3730
|
-
<aup-command *ngFor="let action of moreActions" [command]="action.factory.create(value)"
|
|
3731
|
-
[face]="action.face"></aup-command>
|
|
3732
|
-
</aup-more-menu>
|
|
3733
|
-
</ng-container>
|
|
3734
|
-
`, isInline: true, styles: [":host{display:inline-flex;flex-direction:row;align-items:center}\n"], components: [{ type: ToolBarComponent, selector: "aup-tool-bar" }, { type: CommandComponent, selector: "aup-command", inputs: ["command", "faceModel", "face", "busyFaceModel", "busyFace", "alignFace"] }, { type: MoreMenuComponent, selector: "aup-more-menu", inputs: ["tooltip"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3735
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableRowMenuComponent, decorators: [{
|
|
3954
|
+
PaginatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3955
|
+
PaginatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: PaginatorComponent, selector: "aup-paginator", inputs: { pageController: "pageController" }, usesInheritance: true, ngImport: i0, template: "<p>Page {{pageNumber}} of {{totalPages}}</p>\n<button mat-icon-button [pectinCommand]=\"previousCommand\"><aup-icon icon=\"mat:keyboard_arrow_left\"></aup-icon></button>\n<button mat-icon-button [pectinCommand]=\"nextCommand\"><aup-icon icon=\"mat:keyboard_arrow_right\"></aup-icon></button>\n\n", styles: [":host{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;font-size:12px;padding:0 8px;color:#0009}:host p{color:inherit;margin:0 8px 0 0}:host button.md-button.md-icon-button{padding:0;margin:0;width:30px;height:30px}\n"], components: [{ type: i1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: IconComponent, selector: "aup-icon", inputs: ["icon"] }], directives: [{ type: CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter"] }] });
|
|
3956
|
+
__decorate([
|
|
3957
|
+
TrackExternal(),
|
|
3958
|
+
__metadata("design:type", PageController)
|
|
3959
|
+
], PaginatorComponent.prototype, "pageController", void 0);
|
|
3960
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PaginatorComponent, decorators: [{
|
|
3736
3961
|
type: Component,
|
|
3737
|
-
args: [{
|
|
3738
|
-
|
|
3739
|
-
template: `
|
|
3740
|
-
<aup-tool-bar>
|
|
3741
|
-
<aup-command *ngFor="let action of actions" [command]="action.factory.create(value)"
|
|
3742
|
-
[face]="action.face"></aup-command>
|
|
3743
|
-
</aup-tool-bar>
|
|
3744
|
-
<ng-container *ngIf="moreActions.length > 0">
|
|
3745
|
-
<aup-more-menu>
|
|
3746
|
-
<aup-command *ngFor="let action of moreActions" [command]="action.factory.create(value)"
|
|
3747
|
-
[face]="action.face"></aup-command>
|
|
3748
|
-
</aup-more-menu>
|
|
3749
|
-
</ng-container>
|
|
3750
|
-
`,
|
|
3751
|
-
styles: [`:host {
|
|
3752
|
-
display: inline-flex;
|
|
3753
|
-
flex-direction: row;
|
|
3754
|
-
align-items: center;
|
|
3755
|
-
}`]
|
|
3756
|
-
}]
|
|
3757
|
-
}], ctorParameters: function () { return []; }, propDecorators: { value: [{
|
|
3962
|
+
args: [{ selector: 'aup-paginator', template: "<p>Page {{pageNumber}} of {{totalPages}}</p>\n<button mat-icon-button [pectinCommand]=\"previousCommand\"><aup-icon icon=\"mat:keyboard_arrow_left\"></aup-icon></button>\n<button mat-icon-button [pectinCommand]=\"nextCommand\"><aup-icon icon=\"mat:keyboard_arrow_right\"></aup-icon></button>\n\n", styles: [":host{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;font-size:12px;padding:0 8px;color:#0009}:host p{color:inherit;margin:0 8px 0 0}:host button.md-button.md-icon-button{padding:0;margin:0;width:30px;height:30px}\n"] }]
|
|
3963
|
+
}], ctorParameters: function () { return []; }, propDecorators: { pageController: [{
|
|
3758
3964
|
type: Input
|
|
3759
|
-
}], menu: [{
|
|
3760
|
-
type: ViewChild,
|
|
3761
|
-
args: [MatMenuTrigger]
|
|
3762
3965
|
}] } });
|
|
3763
3966
|
|
|
3764
3967
|
/**
|
|
@@ -3822,29 +4025,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
3822
4025
|
* }
|
|
3823
4026
|
*/
|
|
3824
4027
|
class TableComponent extends AbstractTableComponent {
|
|
3825
|
-
constructor(
|
|
3826
|
-
super(
|
|
4028
|
+
constructor() {
|
|
4029
|
+
super(...arguments);
|
|
4030
|
+
this._footerContentAdded = false;
|
|
3827
4031
|
}
|
|
3828
4032
|
getModel() {
|
|
3829
4033
|
return this.tableModel;
|
|
3830
4034
|
}
|
|
4035
|
+
footerContentChanged($event) {
|
|
4036
|
+
console.log($event);
|
|
4037
|
+
this._footerContentAdded = true;
|
|
4038
|
+
}
|
|
4039
|
+
updatePageSize(count) {
|
|
4040
|
+
this.tableModel.updatePageSize(count);
|
|
4041
|
+
}
|
|
3831
4042
|
}
|
|
3832
|
-
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableComponent, deps:
|
|
4043
|
+
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3833
4044
|
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: TableComponent, selector: "aup-table", inputs: { tableModel: "tableModel" }, providers: [
|
|
3834
4045
|
{ provide: AbstractTableComponent, useExisting: TableComponent }
|
|
3835
|
-
], usesInheritance: true, ngImport: i0, template: "<
|
|
4046
|
+
], usesInheritance: true, ngImport: i0, template: "<aup-table-body [tableModel]=\"tableModel\"\n [showHeader$]=\"showHeader$\"\n [enableScrolling]=\"enableScrolling\"\n (visibleRowCount)=\"updatePageSize($event)\"\n></aup-table-body>\n<section class=\"table-footer\">\n <div class=\"footer-content\"><ng-content select=\"[footer]\"></ng-content></div>\n <aup-paginator *ngIf=\"tableModel.pageController\" [pageController]=\"tableModel.pageController\"></aup-paginator>\n</section>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}aup-table-body{flex:1}.table-footer{display:flex;flex-direction:row;align-items:center}.table-footer .footer-content{flex:1}\n"], components: [{ type: TableBodyComponent, selector: "aup-table-body", inputs: ["tableModel", "showHeader$", "showHeader", "enableScrolling"], outputs: ["visibleRowCount"] }, { type: PaginatorComponent, selector: "aup-paginator", inputs: ["pageController"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3836
4047
|
__decorate([
|
|
3837
4048
|
TrackExternal(),
|
|
3838
|
-
__metadata("design:type",
|
|
4049
|
+
__metadata("design:type", TableModel)
|
|
3839
4050
|
], TableComponent.prototype, "tableModel", void 0);
|
|
4051
|
+
__decorate([
|
|
4052
|
+
Trace(),
|
|
4053
|
+
__metadata("design:type", Function),
|
|
4054
|
+
__metadata("design:paramtypes", [Number]),
|
|
4055
|
+
__metadata("design:returntype", void 0)
|
|
4056
|
+
], TableComponent.prototype, "updatePageSize", null);
|
|
3840
4057
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableComponent, decorators: [{
|
|
3841
4058
|
type: Component,
|
|
3842
4059
|
args: [{ selector: 'aup-table', providers: [
|
|
3843
4060
|
{ provide: AbstractTableComponent, useExisting: TableComponent }
|
|
3844
|
-
], template: "<
|
|
3845
|
-
}],
|
|
4061
|
+
], template: "<aup-table-body [tableModel]=\"tableModel\"\n [showHeader$]=\"showHeader$\"\n [enableScrolling]=\"enableScrolling\"\n (visibleRowCount)=\"updatePageSize($event)\"\n></aup-table-body>\n<section class=\"table-footer\">\n <div class=\"footer-content\"><ng-content select=\"[footer]\"></ng-content></div>\n <aup-paginator *ngIf=\"tableModel.pageController\" [pageController]=\"tableModel.pageController\"></aup-paginator>\n</section>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}aup-table-body{flex:1}.table-footer{display:flex;flex-direction:row;align-items:center}.table-footer .footer-content{flex:1}\n"] }]
|
|
4062
|
+
}], propDecorators: { tableModel: [{
|
|
3846
4063
|
type: Input
|
|
3847
|
-
}] } });
|
|
4064
|
+
}], updatePageSize: [] } });
|
|
3848
4065
|
|
|
3849
4066
|
const SVG_HEIGHT = 60;
|
|
3850
4067
|
class TreeInheritanceIconComponent {
|
|
@@ -4421,17 +4638,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
4421
4638
|
* }
|
|
4422
4639
|
*/
|
|
4423
4640
|
class TreeTableComponent extends AbstractTableComponent {
|
|
4424
|
-
constructor(
|
|
4425
|
-
super(
|
|
4641
|
+
constructor(injector) {
|
|
4642
|
+
super(injector);
|
|
4426
4643
|
}
|
|
4427
4644
|
getModel() {
|
|
4428
4645
|
return this.treeTableModel;
|
|
4429
4646
|
}
|
|
4430
4647
|
}
|
|
4431
|
-
TreeTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TreeTableComponent, deps: [{ token: i0.
|
|
4648
|
+
TreeTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TreeTableComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
4432
4649
|
TreeTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: TreeTableComponent, selector: "aup-tree-table", inputs: { treeTableModel: "treeTableModel" }, providers: [
|
|
4433
4650
|
{ provide: AbstractTableComponent, useExisting: TreeTableComponent }
|
|
4434
|
-
], usesInheritance: true, ngImport: i0, template: "<
|
|
4651
|
+
], usesInheritance: true, ngImport: i0, template: "<aup-table-body [tableModel]=\"treeTableModel\"\n [showHeader$]=\"showHeader$\"\n [enableScrolling]=\"enableScrolling\"\n></aup-table-body>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host::ng-deep td.mat-cell{border-top-width:0!important;border-bottom-width:0!important}:host::ng-deep td.mat-column-tree-label,:host::ng-deep td.mat-column-tree-label{width:1px}:host::ng-deep aup-table-cell-renderer[column-id=tree-label]{padding-left:8px!important}:host::ng-deep aup-tree-label-cell-renderer{flex:1}\n"], components: [{ type: TableBodyComponent, selector: "aup-table-body", inputs: ["tableModel", "showHeader$", "showHeader", "enableScrolling"], outputs: ["visibleRowCount"] }] });
|
|
4435
4652
|
__decorate([
|
|
4436
4653
|
TrackExternal(),
|
|
4437
4654
|
__metadata("design:type", TreeTableModel)
|
|
@@ -4440,8 +4657,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
4440
4657
|
type: Component,
|
|
4441
4658
|
args: [{ selector: 'aup-tree-table', providers: [
|
|
4442
4659
|
{ provide: AbstractTableComponent, useExisting: TreeTableComponent }
|
|
4443
|
-
], template: "<
|
|
4444
|
-
}], ctorParameters: function () { return [{ type: i0.
|
|
4660
|
+
], template: "<aup-table-body [tableModel]=\"treeTableModel\"\n [showHeader$]=\"showHeader$\"\n [enableScrolling]=\"enableScrolling\"\n></aup-table-body>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host::ng-deep td.mat-cell{border-top-width:0!important;border-bottom-width:0!important}:host::ng-deep td.mat-column-tree-label,:host::ng-deep td.mat-column-tree-label{width:1px}:host::ng-deep aup-table-cell-renderer[column-id=tree-label]{padding-left:8px!important}:host::ng-deep aup-tree-label-cell-renderer{flex:1}\n"] }]
|
|
4661
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { treeTableModel: [{
|
|
4445
4662
|
type: Input
|
|
4446
4663
|
}] } });
|
|
4447
4664
|
|
|
@@ -4516,38 +4733,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
4516
4733
|
args: ['keyup.arrowUp', ['$event']]
|
|
4517
4734
|
}] } });
|
|
4518
4735
|
|
|
4519
|
-
class PaginatorComponent extends DisposableComponent {
|
|
4520
|
-
constructor() {
|
|
4521
|
-
super();
|
|
4522
|
-
}
|
|
4523
|
-
ngOnInit() {
|
|
4524
|
-
}
|
|
4525
|
-
get totalPages() {
|
|
4526
|
-
return this.pageController.totalPages.value;
|
|
4527
|
-
}
|
|
4528
|
-
get pageNumber() {
|
|
4529
|
-
return this.pageController.pageNumber.value;
|
|
4530
|
-
}
|
|
4531
|
-
get previousCommand() {
|
|
4532
|
-
return this.pageController.previousCommand;
|
|
4533
|
-
}
|
|
4534
|
-
get nextCommand() {
|
|
4535
|
-
return this.pageController.nextCommand;
|
|
4536
|
-
}
|
|
4537
|
-
}
|
|
4538
|
-
PaginatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4539
|
-
PaginatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: PaginatorComponent, selector: "aup-paginator", inputs: { pageController: "pageController" }, usesInheritance: true, ngImport: i0, template: "<p>Page {{pageNumber}} of {{totalPages}}</p>\n<button mat-icon-button [pectinCommand]=\"previousCommand\"><aup-icon icon=\"mat:keyboard_arrow_left\"></aup-icon></button>\n<button mat-icon-button [pectinCommand]=\"nextCommand\"><aup-icon icon=\"mat:keyboard_arrow_right\"></aup-icon></button>\n\n", styles: [":host{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;font-size:12px;padding:0 8px;color:#0009}:host p{color:inherit;margin-right:8px}:host button.md-button.md-icon-button{padding:0;margin:0;width:30px;height:30px}\n"], components: [{ type: i1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: IconComponent, selector: "aup-icon", inputs: ["icon"] }], directives: [{ type: CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter"] }] });
|
|
4540
|
-
__decorate([
|
|
4541
|
-
TrackExternal(),
|
|
4542
|
-
__metadata("design:type", PageController)
|
|
4543
|
-
], PaginatorComponent.prototype, "pageController", void 0);
|
|
4544
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PaginatorComponent, decorators: [{
|
|
4545
|
-
type: Component,
|
|
4546
|
-
args: [{ selector: 'aup-paginator', template: "<p>Page {{pageNumber}} of {{totalPages}}</p>\n<button mat-icon-button [pectinCommand]=\"previousCommand\"><aup-icon icon=\"mat:keyboard_arrow_left\"></aup-icon></button>\n<button mat-icon-button [pectinCommand]=\"nextCommand\"><aup-icon icon=\"mat:keyboard_arrow_right\"></aup-icon></button>\n\n", styles: [":host{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;font-size:12px;padding:0 8px;color:#0009}:host p{color:inherit;margin-right:8px}:host button.md-button.md-icon-button{padding:0;margin:0;width:30px;height:30px}\n"] }]
|
|
4547
|
-
}], ctorParameters: function () { return []; }, propDecorators: { pageController: [{
|
|
4548
|
-
type: Input
|
|
4549
|
-
}] } });
|
|
4550
|
-
|
|
4551
4736
|
class LabelledValueComponent extends DisposableComponent {
|
|
4552
4737
|
constructor() {
|
|
4553
4738
|
super();
|
|
@@ -4693,7 +4878,8 @@ ComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
4693
4878
|
CardStackComponent,
|
|
4694
4879
|
LabelledValueComponent,
|
|
4695
4880
|
LoadingContainerComponent,
|
|
4696
|
-
MarkdownComponent
|
|
4881
|
+
MarkdownComponent,
|
|
4882
|
+
TableBodyComponent], imports: [CommonModule,
|
|
4697
4883
|
BrowserAnimationsModule,
|
|
4698
4884
|
FormsModule,
|
|
4699
4885
|
MatInputModule,
|
|
@@ -4856,7 +5042,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
4856
5042
|
CardStackComponent,
|
|
4857
5043
|
LabelledValueComponent,
|
|
4858
5044
|
LoadingContainerComponent,
|
|
4859
|
-
MarkdownComponent
|
|
5045
|
+
MarkdownComponent,
|
|
5046
|
+
TableBodyComponent
|
|
4860
5047
|
],
|
|
4861
5048
|
exports: [
|
|
4862
5049
|
NumberInputComponent,
|
|
@@ -8133,98 +8320,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
8133
8320
|
}]
|
|
8134
8321
|
}] });
|
|
8135
8322
|
|
|
8136
|
-
/**
|
|
8137
|
-
* Example:
|
|
8138
|
-
* @example
|
|
8139
|
-
* const model = new TableModel(heroList, table => {
|
|
8140
|
-
* table.pluck("firstName");
|
|
8141
|
-
* table.pluck("lastName");
|
|
8142
|
-
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
8143
|
-
* });
|
|
8144
|
-
*
|
|
8145
|
-
* Editable tables
|
|
8146
|
-
* @example
|
|
8147
|
-
* const saveCommand = UnaryCommand.create((form: Form<Hero>) => {
|
|
8148
|
-
* if (form.validate()) {
|
|
8149
|
-
* // normal form save stuff
|
|
8150
|
-
* return true; // finish editing
|
|
8151
|
-
* }
|
|
8152
|
-
* return false; // continue editiing
|
|
8153
|
-
* }
|
|
8154
|
-
* const colorsNames: ListModel<string> = ...;
|
|
8155
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
8156
|
-
* table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
|
|
8157
|
-
* table.pluck("lastName").cellEditor(StringInputComponent, {
|
|
8158
|
-
* validators: [Validator.present("We need a last name")]
|
|
8159
|
-
* });
|
|
8160
|
-
* table.pluck("age").cellEditor(NumberInputComponent);
|
|
8161
|
-
* table.pluck("favoriteColor").cellEditor(SelectInputComponent, {
|
|
8162
|
-
* initialiseComponent(component: SelectInputComponent) {
|
|
8163
|
-
* selectInput.optionsModel = colorsNames; // <- initialise our component
|
|
8164
|
-
* }
|
|
8165
|
-
* });
|
|
8166
|
-
* table.addEditControls(saveCommand); // <- required to enable editing
|
|
8167
|
-
* });
|
|
8168
|
-
*
|
|
8169
|
-
* Selection models
|
|
8170
|
-
* @example
|
|
8171
|
-
* const model = new TableModel(heroList, table => {
|
|
8172
|
-
* table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
|
|
8173
|
-
* table.pluck("firstName");
|
|
8174
|
-
* table.pluck("lastName");
|
|
8175
|
-
* });
|
|
8176
|
-
*
|
|
8177
|
-
* Custom cell renderers and editors
|
|
8178
|
-
* @example
|
|
8179
|
-
* const model = new TableModel(heroList, table => {
|
|
8180
|
-
* table.pluck("favoriteColor")
|
|
8181
|
-
* .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {
|
|
8182
|
-
* // configure your component with what ever you need.
|
|
8183
|
-
* });
|
|
8184
|
-
* .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }
|
|
8185
|
-
* .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
|
|
8186
|
-
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
8187
|
-
* });
|
|
8188
|
-
*
|
|
8189
|
-
* Template columns
|
|
8190
|
-
* @example
|
|
8191
|
-
* const model = new TableModel(heroList, table => {
|
|
8192
|
-
* table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
|
|
8193
|
-
* table.addTemplateColumn("myTemplate");
|
|
8194
|
-
* });
|
|
8195
|
-
*
|
|
8196
|
-
* <div *aupColumnTemplate="let hero; columnId: 'myTemplate'">{{hero.age}}</div>
|
|
8197
|
-
*
|
|
8198
|
-
* I18n
|
|
8199
|
-
* @example
|
|
8200
|
-
* [table.yml]
|
|
8201
|
-
* table:
|
|
8202
|
-
* columns(ColumnTextProperties[]):
|
|
8203
|
-
* firstName:
|
|
8204
|
-
* headerText: "First Name"
|
|
8205
|
-
* fullName:
|
|
8206
|
-
* headerText: "Full Name"
|
|
8207
|
-
*
|
|
8208
|
-
* const model = new TableModel(heroList, table => {
|
|
8209
|
-
* table.pluck("favoriteColor").cellRenderer(...).cellEditor(...);
|
|
8210
|
-
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
8211
|
-
*
|
|
8212
|
-
* table.columnTextProperties(I18n.table.columns); // <- configures all columns
|
|
8213
|
-
* });
|
|
8214
|
-
*/
|
|
8215
|
-
class TableModel extends AbstractTableModel {
|
|
8216
|
-
constructor(sourceOfTruth, builder) {
|
|
8217
|
-
super();
|
|
8218
|
-
if (builder) {
|
|
8219
|
-
builder(this);
|
|
8220
|
-
}
|
|
8221
|
-
this.setDataSource(sourceOfTruth);
|
|
8222
|
-
}
|
|
8223
|
-
addSelectionColumn(selectionModel, showSelectionColumn) {
|
|
8224
|
-
return this._addSelectionColumn(selectionModel, showSelectionColumn);
|
|
8225
|
-
}
|
|
8226
|
-
}
|
|
8227
|
-
|
|
8228
8323
|
/**
|
|
8229
8324
|
* @file Automatically generated by barrelsby.
|
|
8230
8325
|
*/
|
|
@@ -9634,7 +9729,8 @@ AngularUiPowerupsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
|
|
|
9634
9729
|
DirectivesModule,
|
|
9635
9730
|
ComponentsModule,
|
|
9636
9731
|
PlaceModule,
|
|
9637
|
-
InteractionModule
|
|
9732
|
+
InteractionModule,
|
|
9733
|
+
ObserversModule], exports: [InteractionModule,
|
|
9638
9734
|
PlaceModule,
|
|
9639
9735
|
DirectivesModule,
|
|
9640
9736
|
ComponentsModule,
|
|
@@ -9651,7 +9747,8 @@ AngularUiPowerupsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
|
|
|
9651
9747
|
DirectivesModule,
|
|
9652
9748
|
ComponentsModule,
|
|
9653
9749
|
PlaceModule,
|
|
9654
|
-
InteractionModule
|
|
9750
|
+
InteractionModule,
|
|
9751
|
+
ObserversModule
|
|
9655
9752
|
], InteractionModule,
|
|
9656
9753
|
PlaceModule,
|
|
9657
9754
|
DirectivesModule,
|
|
@@ -9671,7 +9768,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
9671
9768
|
DirectivesModule,
|
|
9672
9769
|
ComponentsModule,
|
|
9673
9770
|
PlaceModule,
|
|
9674
|
-
InteractionModule
|
|
9771
|
+
InteractionModule,
|
|
9772
|
+
ObserversModule
|
|
9675
9773
|
],
|
|
9676
9774
|
exports: [
|
|
9677
9775
|
InteractionModule,
|
|
@@ -10161,5 +10259,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
10161
10259
|
* Generated bundle index. Do not edit.
|
|
10162
10260
|
*/
|
|
10163
10261
|
|
|
10164
|
-
export { ACTIVITY_DATA, ALERT_CONFIG, AUP_PLACE_CONFIG, AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT, AbstractActivityTriggerComponent, AbstractCardContainerComponent, AbstractConfirmDialogComponent, AbstractDialogComponent, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractTableComponent, AbstractTableModel, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityBodyComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, ActivityTitleComponent, AddCardActivityComponent, AddItemInteractionContextComponent, Alert, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CardStackComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnListModel, ColumnModel, ColumnTemplateDirective, ColumnTextSearchFormatter, CommandComponent, CommandContainer, CommandDirective, CommandFace, CommandFaceComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmThenExecuteDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DecoratedTreeNode, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EnableCellTextSearch, EventCleanUpSession, FlattenedTreeListModel, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, HEADER_CELL_RENDERER_PORTAL, HighlightPipe, HighlightTextModelDirective, HorizontalAlignment, IconComponent, InPlaceInteractionContextComponent, InlineActivityTriggerComponent, InlineEditorModel, InlineStringEditorComponent, InputActivity, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, Keys, LEFT_RIGHT_PLACE_ANIMATION, LabelledValueComponent, ListPlaceNavComponent, ListPropertyColumnModel, LoadingContainerComponent, MarkdownComponent, MarkdownService, ModalActivityTriggerComponent, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NotAuthorisedNoticeComponent, NumberInputComponent, POPUP_CONTAINER, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, PaginatorComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceAccessGuard, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupActivityTriggerComponent, PopupAwareComponent, PopupInteractionContextComponent, PopupMenuComponent, PopupMenuRendererComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectInputActivity, SelectInputComponent, SelectionCellComponent, SelectionColumnModel, SelectionHeaderCellComponent, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellComponent, TableComponent, TableHeaderCellComponent, TableModel, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, TreeExpansionModel, TreeInheritanceIconComponent, TreeLabelCellRendererComponent, TreeLabelColumnModel, TreeTableComponent, TreeTableModel, UrlService, UrlSnapshot, VerticalFocusContainerComponent, VisibilityService, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, markdownPillExtension, slideDownOnEnterAnimation, slideRightOnEnterAnimation, treeNodeDecorator };
|
|
10262
|
+
export { ACTIVITY_DATA, ALERT_CONFIG, AUP_PLACE_CONFIG, AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT, AbstractActivityTriggerComponent, AbstractCardContainerComponent, AbstractConfirmDialogComponent, AbstractDialogComponent, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractTableComponent, AbstractTableModel, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityBodyComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, ActivityTitleComponent, AddCardActivityComponent, AddItemInteractionContextComponent, Alert, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CardStackComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnListModel, ColumnModel, ColumnTemplateDirective, ColumnTextSearchFormatter, CommandComponent, CommandContainer, CommandDirective, CommandFace, CommandFaceComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmThenExecuteDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DecoratedTreeNode, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EnableCellTextSearch, EventCleanUpSession, FlattenedTreeListModel, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, HEADER_CELL_RENDERER_PORTAL, HighlightPipe, HighlightTextModelDirective, HorizontalAlignment, IconComponent, InPlaceInteractionContextComponent, InlineActivityTriggerComponent, InlineEditorModel, InlineStringEditorComponent, InputActivity, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, Keys, LEFT_RIGHT_PLACE_ANIMATION, LabelledValueComponent, ListPlaceNavComponent, ListPropertyColumnModel, LoadingContainerComponent, MarkdownComponent, MarkdownService, ModalActivityTriggerComponent, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NotAuthorisedNoticeComponent, NumberInputComponent, POPUP_CONTAINER, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, PaginatorComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceAccessGuard, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupActivityTriggerComponent, PopupAwareComponent, PopupInteractionContextComponent, PopupMenuComponent, PopupMenuRendererComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectInputActivity, SelectInputComponent, SelectionCellComponent, SelectionColumnModel, SelectionHeaderCellComponent, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableBodyComponent, TableCellComponent, TableComponent, TableHeaderCellComponent, TableModel, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, TreeExpansionModel, TreeInheritanceIconComponent, TreeLabelCellRendererComponent, TreeLabelColumnModel, TreeTableComponent, TreeTableModel, UrlService, UrlSnapshot, VerticalFocusContainerComponent, VisibilityService, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, markdownPillExtension, slideDownOnEnterAnimation, slideRightOnEnterAnimation, treeNodeDecorator };
|
|
10165
10263
|
//# sourceMappingURL=coolon-angular-ui-powerups.mjs.map
|