@coolon/angular-ui-powerups 1.11.3 → 1.12.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/CHANGELOG.md +14 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +830 -821
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +2 -2
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.d.ts +15 -16
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +15 -16
- package/esm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/esm2015/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/index.js +1 -0
- package/esm2015/lib/components/index.js.map +1 -1
- package/esm2015/lib/components/index.metadata.json +1 -1
- package/esm2015/lib/components/table/column-model.js +13 -2
- package/esm2015/lib/components/table/column-model.js.map +1 -1
- package/esm2015/lib/components/table/column-model.metadata.json +1 -1
- package/esm2015/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.js +3 -4
- package/esm2015/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.js.map +1 -1
- package/esm2015/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.metadata.json +1 -1
- package/esm2015/lib/components/table/edit-row-controls/edit-row-controls.component.js +2 -2
- package/esm2015/lib/components/table/edit-row-controls/edit-row-controls.component.js.map +1 -1
- package/esm2015/lib/components/table/edit-row-controls/edit-row-controls.component.metadata.json +1 -1
- package/esm2015/lib/components/table/edit-session.js +20 -0
- package/esm2015/lib/components/table/edit-session.js.map +1 -0
- package/esm2015/lib/components/table/edit-session.metadata.json +1 -0
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +2 -1
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.metadata.json +1 -1
- package/esm2015/lib/components/table/table-model.js +4 -24
- package/esm2015/lib/components/table/table-model.js.map +1 -1
- package/esm2015/lib/components/table/table-model.metadata.json +1 -1
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.js +1 -1
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.js.map +1 -1
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.metadata.json +1 -1
- package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.js +2 -2
- package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.js.map +1 -1
- package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.metadata.json +1 -1
- package/esm5/coolon-angular-ui-powerups.js +15 -16
- package/esm5/coolon-angular-ui-powerups.js.map +1 -1
- package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm5/lib/components/index.js +1 -0
- package/esm5/lib/components/index.js.map +1 -1
- package/esm5/lib/components/table/column-model.js +13 -2
- package/esm5/lib/components/table/column-model.js.map +1 -1
- package/esm5/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.js +3 -4
- package/esm5/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.js.map +1 -1
- package/esm5/lib/components/table/edit-row-controls/edit-row-controls.component.js +2 -2
- package/esm5/lib/components/table/edit-row-controls/edit-row-controls.component.js.map +1 -1
- package/esm5/lib/components/table/edit-session.js +25 -0
- package/esm5/lib/components/table/edit-session.js.map +1 -0
- package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +2 -1
- package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
- package/esm5/lib/components/table/table-model.js +5 -28
- package/esm5/lib/components/table/table-model.js.map +1 -1
- package/esm5/lib/interaction/components/activity-actions/activity-actions.component.js +1 -1
- package/esm5/lib/interaction/components/activity-actions/activity-actions.component.js.map +1 -1
- package/esm5/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.js +2 -2
- package/esm5/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +552 -544
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +804 -796
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/table/column-model.d.ts +16 -12
- package/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.d.ts +1 -2
- package/lib/components/table/edit-row-controls/edit-row-controls.component.d.ts +2 -2
- package/lib/components/table/edit-session.d.ts +9 -0
- package/lib/components/table/table-cell-renderer/table-cell-renderer.component.d.ts +2 -1
- package/lib/components/table/table-model.d.ts +4 -13
- package/lib/interaction/components/activity-actions/activity-actions.component.d.ts +1 -1
- package/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.d.ts +3 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata, __param, __awaiter } from 'tslib';
|
|
2
2
|
import { DOCUMENT, CommonModule, Location } from '@angular/common';
|
|
3
|
-
import { ElementRef, Inject, Input, HostListener, Directive, NgZone, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule, HostBinding, Component,
|
|
3
|
+
import { ElementRef, Inject, Input, HostListener, Directive, NgZone, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule, HostBinding, Component, InjectionToken, Injector, ComponentFactoryResolver, ViewContainerRef, ViewChild, ViewChildren, QueryList, Optional, EventEmitter, Output, ContentChild, TemplateRef, Self, ChangeDetectorRef, ContentChildren, SkipSelf } from '@angular/core';
|
|
4
4
|
import { FormsModule } from '@angular/forms';
|
|
5
5
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
6
6
|
import { MatInputModule } from '@angular/material/input';
|
|
@@ -12,12 +12,11 @@ import { MatButtonModule } from '@angular/material/button';
|
|
|
12
12
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
13
13
|
import { MatIconModule } from '@angular/material/icon';
|
|
14
14
|
import { MatTableModule } from '@angular/material/table';
|
|
15
|
-
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger,
|
|
15
|
+
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, Command, Deferred, Trace, MutableListModel, FocusManager, Form, DelegatingFormValueModel, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MutableValueModel, MultipleSelectionModel, Guard, DebugContext, Binding, Functions } from '@coolon/pectin';
|
|
16
16
|
import { FlexModule, GridModule } from '@angular/flex-layout';
|
|
17
|
-
import { MatDialog, MatDialogConfig, MAT_DIALOG_DEFAULT_OPTIONS
|
|
17
|
+
import { MatDialogModule, MatDialog, MatDialogConfig, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
|
|
18
18
|
import { RouterModule, UrlSegment, Router, UrlSerializer, NavigationStart, NavigationEnd, NavigationError, NavigationCancel, RouterOutlet } from '@angular/router';
|
|
19
19
|
import ___default, { isEqual, isNil } from 'lodash';
|
|
20
|
-
import ResizeObserver from 'resize-observer-polyfill';
|
|
21
20
|
import { assert as assert$1, lang as lang$1, Opts, Klass } from '@coolon/typescript-utilities';
|
|
22
21
|
import { Overlay } from '@angular/cdk/overlay';
|
|
23
22
|
import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
@@ -28,6 +27,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
|
|
28
27
|
import { Memoize as Memoize$1 } from '@typescript-plus/fast-memoize-decorator';
|
|
29
28
|
import 'reflect-metadata';
|
|
30
29
|
import { style, query, group, animate, trigger, transition } from '@angular/animations';
|
|
30
|
+
import ResizeObserver from 'resize-observer-polyfill';
|
|
31
31
|
import { Observable } from 'rxjs';
|
|
32
32
|
|
|
33
33
|
let CommandDirective = class CommandDirective extends GarbageCollector {
|
|
@@ -328,225 +328,50 @@ DirectivesModule = __decorate([
|
|
|
328
328
|
})
|
|
329
329
|
], DirectivesModule);
|
|
330
330
|
|
|
331
|
-
let
|
|
332
|
-
constructor(
|
|
333
|
-
super();
|
|
334
|
-
this.
|
|
335
|
-
this.focusManager = focusManager;
|
|
336
|
-
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
337
|
-
if (this.focusManager) {
|
|
338
|
-
this._focusContext = this.focusManager.registerFocusable(this);
|
|
339
|
-
this.registerDisposable(this._focusContext);
|
|
340
|
-
this.registerDisposable(focusBindingFactory.createBinding(el.nativeElement, this.focusContext));
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
get focusable() {
|
|
344
|
-
return !!this.focusContext ? 0 : undefined;
|
|
331
|
+
let ActivityActionsComponent = class ActivityActionsComponent extends DisposableComponent {
|
|
332
|
+
constructor() {
|
|
333
|
+
super(...arguments);
|
|
334
|
+
this.align = 'start';
|
|
345
335
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
(_a = this.focusContext) === null || _a === void 0 ? void 0 : _a.notifyFocusIn();
|
|
336
|
+
get alignEnd() {
|
|
337
|
+
return this.align === 'end';
|
|
349
338
|
}
|
|
350
|
-
|
|
351
|
-
var _a;
|
|
352
|
-
(_a = this.focusContext) === null || _a === void 0 ? void 0 : _a.notifyFocusOut();
|
|
339
|
+
ngOnInit() {
|
|
353
340
|
}
|
|
354
|
-
|
|
355
|
-
return this.
|
|
341
|
+
hasConfirmText() {
|
|
342
|
+
return !___default.isEmpty(this.confirmText);
|
|
356
343
|
}
|
|
357
344
|
};
|
|
358
|
-
FocusableComponent.ctorParameters = () => [
|
|
359
|
-
{ type: ElementRef },
|
|
360
|
-
{ type: FocusManager },
|
|
361
|
-
{ type: FocusBindingFactory }
|
|
362
|
-
];
|
|
363
|
-
__decorate([
|
|
364
|
-
HostBinding('attr.tabindex'),
|
|
365
|
-
__metadata("design:type", Object),
|
|
366
|
-
__metadata("design:paramtypes", [])
|
|
367
|
-
], FocusableComponent.prototype, "focusable", null);
|
|
368
345
|
__decorate([
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
__metadata("design:
|
|
372
|
-
|
|
373
|
-
], FocusableComponent.prototype, "onFocus", null);
|
|
346
|
+
Input(),
|
|
347
|
+
TrackExternal(),
|
|
348
|
+
__metadata("design:type", Command)
|
|
349
|
+
], ActivityActionsComponent.prototype, "confirmCommand", void 0);
|
|
374
350
|
__decorate([
|
|
375
|
-
|
|
376
|
-
__metadata("design:type",
|
|
377
|
-
|
|
378
|
-
__metadata("design:returntype", void 0)
|
|
379
|
-
], FocusableComponent.prototype, "onBlur", null);
|
|
380
|
-
FocusableComponent = __decorate([
|
|
381
|
-
Component({ template: '' }),
|
|
382
|
-
__metadata("design:paramtypes", [ElementRef, FocusManager, FocusBindingFactory])
|
|
383
|
-
], FocusableComponent);
|
|
384
|
-
|
|
385
|
-
class Dimension {
|
|
386
|
-
constructor(width, height) {
|
|
387
|
-
this.width = width;
|
|
388
|
-
this.height = height;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
class Point {
|
|
393
|
-
constructor(x, y) {
|
|
394
|
-
this.x = x;
|
|
395
|
-
this.y = y;
|
|
396
|
-
}
|
|
397
|
-
static from(data) {
|
|
398
|
-
return new Point(data.x, data.y);
|
|
399
|
-
}
|
|
400
|
-
translate(x, y) {
|
|
401
|
-
return new Point(this.x + x, this.y + y);
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
class Bounds extends Dimension {
|
|
406
|
-
constructor(top, left, width, height) {
|
|
407
|
-
super(width, height);
|
|
408
|
-
this.top = top;
|
|
409
|
-
this.left = left;
|
|
410
|
-
this.width = width;
|
|
411
|
-
this.height = height;
|
|
412
|
-
}
|
|
413
|
-
relativePositionOf(point) {
|
|
414
|
-
if (point instanceof MouseEvent) {
|
|
415
|
-
return new Point(point.clientX - this.left, point.clientY - this.top);
|
|
416
|
-
}
|
|
417
|
-
else {
|
|
418
|
-
return new Point(point.x - this.left, point.y - this.top);
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
(function (Bounds) {
|
|
423
|
-
function ofElement(element) {
|
|
424
|
-
const rect = element.getBoundingClientRect();
|
|
425
|
-
return new Bounds(rect.top, rect.left, rect.width, rect.height);
|
|
426
|
-
}
|
|
427
|
-
Bounds.ofElement = ofElement;
|
|
428
|
-
})(Bounds || (Bounds = {}));
|
|
429
|
-
|
|
430
|
-
let ResizeAwareComponent = class ResizeAwareComponent extends DisposableComponent {
|
|
431
|
-
constructor(elementRef, ngZone) {
|
|
432
|
-
super();
|
|
433
|
-
this.elementRef = elementRef;
|
|
434
|
-
this.ngZone = ngZone;
|
|
435
|
-
this._boundsModel = new MutableValueModel(new Bounds(0, 0, 0, 0));
|
|
436
|
-
}
|
|
437
|
-
ngAfterViewInit() {
|
|
438
|
-
this.updateBounds();
|
|
439
|
-
const element = this.elementRef.nativeElement;
|
|
440
|
-
const ro = new ResizeObserver((entries, observer) => {
|
|
441
|
-
this.ngZone.run(() => this.updateBounds());
|
|
442
|
-
});
|
|
443
|
-
ro.observe(element);
|
|
444
|
-
this.onDispose(() => ro.disconnect());
|
|
445
|
-
}
|
|
446
|
-
get boundsModel() {
|
|
447
|
-
return this._boundsModel.readonly;
|
|
448
|
-
}
|
|
449
|
-
get nativeElement() {
|
|
450
|
-
return this.elementRef.nativeElement;
|
|
451
|
-
}
|
|
452
|
-
// TODO: Make this handle body scroll
|
|
453
|
-
relativePositionOf(point) {
|
|
454
|
-
return this.bounds.relativePositionOf(point);
|
|
455
|
-
}
|
|
456
|
-
get bounds() {
|
|
457
|
-
return this._boundsModel.value;
|
|
458
|
-
}
|
|
459
|
-
updateBounds() {
|
|
460
|
-
this._boundsModel.value = Bounds.ofElement(this.nativeElement);
|
|
461
|
-
}
|
|
462
|
-
};
|
|
463
|
-
ResizeAwareComponent.ctorParameters = () => [
|
|
464
|
-
{ type: ElementRef },
|
|
465
|
-
{ type: NgZone }
|
|
466
|
-
];
|
|
467
|
-
ResizeAwareComponent = __decorate([
|
|
468
|
-
Directive(),
|
|
469
|
-
__metadata("design:paramtypes", [ElementRef, NgZone])
|
|
470
|
-
], ResizeAwareComponent);
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* @example
|
|
474
|
-
* // CSS Vars
|
|
475
|
-
* aup-card-container {
|
|
476
|
-
* --card-gap: var(--card-gap, 16px);
|
|
477
|
-
* --card-width: var(--card-width, 300px);
|
|
478
|
-
* --card-height: var(--card-height, auto);
|
|
479
|
-
* --card-min-height: var(--card-min-height, auto);
|
|
480
|
-
* --card-background: var(--card-background, #fcfcfb);
|
|
481
|
-
* }
|
|
482
|
-
*
|
|
483
|
-
* // Content Templates:
|
|
484
|
-
* #addCardTemplate
|
|
485
|
-
* <ng-template #addCardTemplate>
|
|
486
|
-
* This is a new card template, it will the the size of the other cards.
|
|
487
|
-
* </nav-template>
|
|
488
|
-
*
|
|
489
|
-
*/
|
|
490
|
-
let CardContainerComponent = class CardContainerComponent extends DisposableComponent {
|
|
491
|
-
constructor() {
|
|
492
|
-
super();
|
|
493
|
-
}
|
|
494
|
-
ngOnInit() {
|
|
495
|
-
}
|
|
496
|
-
};
|
|
351
|
+
Input(),
|
|
352
|
+
__metadata("design:type", String)
|
|
353
|
+
], ActivityActionsComponent.prototype, "confirmText", void 0);
|
|
497
354
|
__decorate([
|
|
498
355
|
Input(),
|
|
499
356
|
TrackExternal(),
|
|
500
357
|
__metadata("design:type", Command)
|
|
501
|
-
],
|
|
358
|
+
], ActivityActionsComponent.prototype, "cancelCommand", void 0);
|
|
502
359
|
__decorate([
|
|
503
|
-
|
|
504
|
-
__metadata("design:type",
|
|
505
|
-
],
|
|
506
|
-
CardContainerComponent = __decorate([
|
|
507
|
-
Component({
|
|
508
|
-
selector: 'aup-card-container',
|
|
509
|
-
template: "<div class=\"card-container\">\n <ng-content></ng-content>\n\n <div class=\"add-card-container\" *ngIf=\"addCardCommand.enabled.value\" [pectinCommand]=\"addCardCommand\">\n <mat-icon>add</mat-icon>\n </div>\n\n <div class=\"add-card-template\" *ngIf=\"addCardTemplate\">\n <ng-container [ngTemplateOutlet]=\"addCardTemplate\"></ng-container>\n </div>\n\n</div>\n",
|
|
510
|
-
styles: [":root{--aup-default-padding:var(--default-padding, 18px);--aup-default-background:white}.router-outlet-container>*{position:absolute;top:0;left:0;bottom:0;right:0}[no-tab-header]>mat-tab-header{display:none}[full-height-tabs] .mat-tab-body-wrapper,mat-tab-group.full-height-tabs .mat-tab-body-wrapper{flex:1}[full-height-tabs] .mat-tab-body-wrapper .mat-tab-body-content,[full-height-tabs] .mat-tab-body-wrapper mat-tab-body,mat-tab-group.full-height-tabs .mat-tab-body-wrapper .mat-tab-body-content,mat-tab-group.full-height-tabs .mat-tab-body-wrapper mat-tab-body{display:flex;flex-direction:column;justify-content:stretch}.dialog-interaction-context{max-width:95vw!important;max-height:95vh!important}.dialog-interaction-context mat-dialog-container{max-width:95vw!important;max-height:95vh!important;padding:0}.aup-popup-interaction-panel{background:var(--aup-default-background,#fff);box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);transition:box-shadow 280ms cubic-bezier(.4,0,.2,1)}.aup-input-activity{padding:calc(var(--aup-default-padding)/2)}.aup-input-component{display:block}.aup-input-component input,.aup-input-component mat-form-field{width:100%}.aup-input-component input mat-hint.faux-error,.aup-input-component mat-form-field mat-hint.faux-error{color:#f44336}aup-table-cell-renderer>.aup-input-component .mat-form-field-flex{padding-top:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-infix{width:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-label-wrapper{display:none}aup-table{--default-column-gap:var(--column-gap, 24px)}aup-table aup-table-cell-renderer:not(.first-column),aup-table aup-table-header-cell-renderer:not(.first-column){padding-left:var(--default-column-gap)}:host{--resolved-card-gap:var(--card-gap, 16px);--resolved-card-width:var(--card-width, 300px);--resolved-card-height:var(--card-height, auto);--resolved-card-min-height:var(--card-min-height, auto);--resolved-card-background:var(--card-background, #fcfcfb);flex:1;display:block;background:var(--resolved-card-background)}.card-container{display:-ms-grid;display:grid;grid-template-columns:repeat(auto-fill,var(--resolved-card-width));grid-template-rows:repeat(auto-fit,minmax(0,var(--resolved-card-height)));grid-gap:var(--resolved-card-gap);box-sizing:border-box;padding:var(--resolved-card-gap);min-height:calc(var(--resolved-card-height) + 2 * var(--resolved-card-gap));min-width:calc(var(--resolved-card-width) + 2 * var(--resolved-card-gap));width:calc((var(--resolved-card-width) + var(--resolved-card-gap)) * 2 + var(--grid-gap));max-width:100%}.add-card-container{width:var(--resolved-card-width);height:var(--resolved-card-height);min-height:var(--resolved-card-min-height);display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;border:2px dashed rgba(0,0,0,.1);border-radius:6px;font-weight:300;cursor:pointer;color:rgba(0,0,0,.54);background-color:rgba(255,255,255,.8);transition:280ms cubic-bezier(.4,0,.2,1)}.add-card-container mat-icon{font-size:200%}.add-card-container:hover{transition:280ms cubic-bezier(.4,0,.2,1);border-color:transparent;background-color:#fff;color:rgba(0,0,0,.54)}.add-card-container:hover:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.add-card-template-container{width:var(--resolved-card-width);height:var(--resolved-card-height);display:flex;flex-direction:column;align-items:stretch;justify-content:stretch}"]
|
|
511
|
-
}),
|
|
512
|
-
__metadata("design:paramtypes", [])
|
|
513
|
-
], CardContainerComponent);
|
|
514
|
-
|
|
515
|
-
let FocusContainerComponent = class FocusContainerComponent extends DisposableComponent {
|
|
516
|
-
constructor(focusManager) {
|
|
517
|
-
super();
|
|
518
|
-
this.focusManager = focusManager;
|
|
519
|
-
this.restoreFocusCommand = Command.create(() => {
|
|
520
|
-
this.restoreFocus();
|
|
521
|
-
});
|
|
522
|
-
this.tabIndex = -1;
|
|
523
|
-
}
|
|
524
|
-
ngOnInit() {
|
|
525
|
-
}
|
|
526
|
-
// @Trace()
|
|
527
|
-
restoreFocus() {
|
|
528
|
-
this.focusManager.restoreFocus();
|
|
529
|
-
}
|
|
530
|
-
};
|
|
531
|
-
FocusContainerComponent.ctorParameters = () => [
|
|
532
|
-
{ type: FocusManager, decorators: [{ type: Self }] }
|
|
533
|
-
];
|
|
360
|
+
Input(),
|
|
361
|
+
__metadata("design:type", String)
|
|
362
|
+
], ActivityActionsComponent.prototype, "align", void 0);
|
|
534
363
|
__decorate([
|
|
535
|
-
HostBinding('
|
|
536
|
-
__metadata("design:type",
|
|
537
|
-
|
|
538
|
-
|
|
364
|
+
HostBinding('class.align-end'),
|
|
365
|
+
__metadata("design:type", Boolean),
|
|
366
|
+
__metadata("design:paramtypes", [])
|
|
367
|
+
], ActivityActionsComponent.prototype, "alignEnd", null);
|
|
368
|
+
ActivityActionsComponent = __decorate([
|
|
539
369
|
Component({
|
|
540
|
-
selector: 'aup-
|
|
541
|
-
template: "<ng-content></ng-content>\n",
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
styles: [":host{display:block}"]
|
|
546
|
-
}),
|
|
547
|
-
__param(0, Self()),
|
|
548
|
-
__metadata("design:paramtypes", [FocusManager])
|
|
549
|
-
], FocusContainerComponent);
|
|
370
|
+
selector: 'aup-activity-actions',
|
|
371
|
+
template: "<button class=\"cancel\" mat-icon-button [pectinCommand]=\"cancelCommand\">\n <mat-icon>clear</mat-icon>\n</button>\n<button class=\"confirm\" *ngIf=\"!hasConfirmText()\" mat-icon-button [pectinCommand]=\"confirmCommand\">\n <mat-icon>done</mat-icon>\n</button>\n<button class=\"confirm\" *ngIf=\"hasConfirmText()\" mat-button [pectinCommand]=\"confirmCommand\">{{confirmText}}</button>\n<div class=\"content\">\n <ng-content></ng-content>\n</div>\n",
|
|
372
|
+
styles: [":host{display:-ms-grid;display:grid;grid-template-areas:\"cancel confirm content\";-ms-grid-columns:auto auto 1fr;grid-template-columns:auto auto 1fr;-ms-grid-rows:auto;grid-template-rows:auto;align-items:center;justify-content:end}:host.align-end{grid-template-areas:\"content cancel confirm\";-ms-grid-columns:1fr auto auto;grid-template-columns:1fr auto auto}.cancel{-ms-grid-row:1;-ms-grid-column:1;grid-area:cancel}:host.align-end>.cancel{-ms-grid-row:1;-ms-grid-column:2}.confirm{-ms-grid-row:1;-ms-grid-column:2;grid-area:confirm}:host.align-end>.confirm{-ms-grid-row:1;-ms-grid-column:3}.content{-ms-grid-row:1;-ms-grid-column:3;grid-area:content;text-align:left}:host.align-end>.content{-ms-grid-row:1;-ms-grid-column:1}"]
|
|
373
|
+
})
|
|
374
|
+
], ActivityActionsComponent);
|
|
550
375
|
|
|
551
376
|
const ACTIVITY_DATA = new InjectionToken('InteractionActivityData');
|
|
552
377
|
class Activity extends DisposableComponent {
|
|
@@ -1464,25 +1289,210 @@ InteractionContextTriggerFor = __decorate([
|
|
|
1464
1289
|
__metadata("design:paramtypes", [])
|
|
1465
1290
|
], InteractionContextTriggerFor);
|
|
1466
1291
|
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1292
|
+
let InteractionModule = class InteractionModule {
|
|
1293
|
+
};
|
|
1294
|
+
InteractionModule = __decorate([
|
|
1295
|
+
NgModule({
|
|
1296
|
+
imports: [
|
|
1297
|
+
CommonModule,
|
|
1298
|
+
MatButtonModule,
|
|
1299
|
+
MatDialogModule,
|
|
1300
|
+
MatTabsModule,
|
|
1301
|
+
PortalModule,
|
|
1302
|
+
RouterModule,
|
|
1303
|
+
MatIconModule,
|
|
1304
|
+
DirectivesModule,
|
|
1305
|
+
FlexModule,
|
|
1306
|
+
GridModule
|
|
1307
|
+
],
|
|
1308
|
+
declarations: [
|
|
1309
|
+
ActivityContainerComponent,
|
|
1310
|
+
ConfirmationDialogComponent,
|
|
1311
|
+
ConfirmThenDialogComponent,
|
|
1312
|
+
AlertDialogComponent,
|
|
1313
|
+
ActivityOutletComponent,
|
|
1314
|
+
InPlaceInteractionContextComponent,
|
|
1315
|
+
AddItemInteractionContextComponent,
|
|
1316
|
+
ActivityActionsComponent,
|
|
1317
|
+
PopupInteractionContextComponent,
|
|
1318
|
+
InteractionContextTriggerFor
|
|
1319
|
+
],
|
|
1320
|
+
exports: [
|
|
1321
|
+
ActivityContainerComponent,
|
|
1322
|
+
ActivityOutletComponent,
|
|
1323
|
+
InPlaceInteractionContextComponent,
|
|
1324
|
+
AddItemInteractionContextComponent,
|
|
1325
|
+
ActivityActionsComponent,
|
|
1326
|
+
PopupInteractionContextComponent,
|
|
1327
|
+
InteractionContextTriggerFor
|
|
1328
|
+
],
|
|
1329
|
+
entryComponents: [
|
|
1330
|
+
ActivityContainerComponent,
|
|
1331
|
+
ConfirmationDialogComponent,
|
|
1332
|
+
ConfirmThenDialogComponent,
|
|
1333
|
+
AlertDialogComponent
|
|
1334
|
+
],
|
|
1335
|
+
providers: [
|
|
1336
|
+
InteractionService
|
|
1337
|
+
// {
|
|
1338
|
+
// provide: MAT_TABS_CONFIG, useValue: { animationDuration: "2s" }
|
|
1339
|
+
// }
|
|
1340
|
+
]
|
|
1341
|
+
})
|
|
1342
|
+
], InteractionModule);
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* @example
|
|
1346
|
+
* // CSS Vars
|
|
1347
|
+
* aup-card-container {
|
|
1348
|
+
* --card-gap: var(--card-gap, 16px);
|
|
1349
|
+
* --card-width: var(--card-width, 300px);
|
|
1350
|
+
* --card-height: var(--card-height, auto);
|
|
1351
|
+
* --card-min-height: var(--card-min-height, auto);
|
|
1352
|
+
* --card-background: var(--card-background, #fcfcfb);
|
|
1353
|
+
* }
|
|
1354
|
+
*
|
|
1355
|
+
* // Content Templates:
|
|
1356
|
+
* #addCardTemplate
|
|
1357
|
+
* <ng-template #addCardTemplate>
|
|
1358
|
+
* This is a new card template, it will the the size of the other cards.
|
|
1359
|
+
* </nav-template>
|
|
1360
|
+
*
|
|
1361
|
+
*/
|
|
1362
|
+
let CardContainerComponent = class CardContainerComponent extends DisposableComponent {
|
|
1363
|
+
constructor() {
|
|
1364
|
+
super();
|
|
1365
|
+
}
|
|
1366
|
+
ngOnInit() {
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
__decorate([
|
|
1370
|
+
Input(),
|
|
1371
|
+
TrackExternal(),
|
|
1372
|
+
__metadata("design:type", Command)
|
|
1373
|
+
], CardContainerComponent.prototype, "addCardCommand", void 0);
|
|
1374
|
+
__decorate([
|
|
1375
|
+
ContentChild("addCardTemplate"),
|
|
1376
|
+
__metadata("design:type", TemplateRef)
|
|
1377
|
+
], CardContainerComponent.prototype, "addCardTemplate", void 0);
|
|
1378
|
+
CardContainerComponent = __decorate([
|
|
1379
|
+
Component({
|
|
1380
|
+
selector: 'aup-card-container',
|
|
1381
|
+
template: "<div class=\"card-container\">\n <ng-content></ng-content>\n\n <div class=\"add-card-container\" *ngIf=\"addCardCommand.enabled.value\" [pectinCommand]=\"addCardCommand\">\n <mat-icon>add</mat-icon>\n </div>\n\n <div class=\"add-card-template\" *ngIf=\"addCardTemplate\">\n <ng-container [ngTemplateOutlet]=\"addCardTemplate\"></ng-container>\n </div>\n\n</div>\n",
|
|
1382
|
+
styles: [":root{--aup-default-padding:var(--default-padding, 18px);--aup-default-background:white}.router-outlet-container>*{position:absolute;top:0;left:0;bottom:0;right:0}[no-tab-header]>mat-tab-header{display:none}[full-height-tabs] .mat-tab-body-wrapper,mat-tab-group.full-height-tabs .mat-tab-body-wrapper{flex:1}[full-height-tabs] .mat-tab-body-wrapper .mat-tab-body-content,[full-height-tabs] .mat-tab-body-wrapper mat-tab-body,mat-tab-group.full-height-tabs .mat-tab-body-wrapper .mat-tab-body-content,mat-tab-group.full-height-tabs .mat-tab-body-wrapper mat-tab-body{display:flex;flex-direction:column;justify-content:stretch}.dialog-interaction-context{max-width:95vw!important;max-height:95vh!important}.dialog-interaction-context mat-dialog-container{max-width:95vw!important;max-height:95vh!important;padding:0}.aup-popup-interaction-panel{background:var(--aup-default-background,#fff);box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);transition:box-shadow 280ms cubic-bezier(.4,0,.2,1)}.aup-input-activity{padding:calc(var(--aup-default-padding)/2)}.aup-input-component{display:block}.aup-input-component input,.aup-input-component mat-form-field{width:100%}.aup-input-component input mat-hint.faux-error,.aup-input-component mat-form-field mat-hint.faux-error{color:#f44336}aup-table-cell-renderer>.aup-input-component .mat-form-field-flex{padding-top:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-infix{width:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-label-wrapper{display:none}aup-table{--default-column-gap:var(--column-gap, 24px)}aup-table aup-table-cell-renderer:not(.first-column),aup-table aup-table-header-cell-renderer:not(.first-column){padding-left:var(--default-column-gap)}:host{--resolved-card-gap:var(--card-gap, 16px);--resolved-card-width:var(--card-width, 300px);--resolved-card-height:var(--card-height, auto);--resolved-card-min-height:var(--card-min-height, auto);--resolved-card-background:var(--card-background, #fcfcfb);flex:1;display:block;background:var(--resolved-card-background)}.card-container{display:-ms-grid;display:grid;grid-template-columns:repeat(auto-fill,var(--resolved-card-width));grid-template-rows:repeat(auto-fit,minmax(0,var(--resolved-card-height)));grid-gap:var(--resolved-card-gap);box-sizing:border-box;padding:var(--resolved-card-gap);min-height:calc(var(--resolved-card-height) + 2 * var(--resolved-card-gap));min-width:calc(var(--resolved-card-width) + 2 * var(--resolved-card-gap));width:calc((var(--resolved-card-width) + var(--resolved-card-gap)) * 2 + var(--grid-gap));max-width:100%}.add-card-container{width:var(--resolved-card-width);height:var(--resolved-card-height);min-height:var(--resolved-card-min-height);display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;border:2px dashed rgba(0,0,0,.1);border-radius:6px;font-weight:300;cursor:pointer;color:rgba(0,0,0,.54);background-color:rgba(255,255,255,.8);transition:280ms cubic-bezier(.4,0,.2,1)}.add-card-container mat-icon{font-size:200%}.add-card-container:hover{transition:280ms cubic-bezier(.4,0,.2,1);border-color:transparent;background-color:#fff;color:rgba(0,0,0,.54)}.add-card-container:hover:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.add-card-template-container{width:var(--resolved-card-width);height:var(--resolved-card-height);display:flex;flex-direction:column;align-items:stretch;justify-content:stretch}"]
|
|
1383
|
+
}),
|
|
1384
|
+
__metadata("design:paramtypes", [])
|
|
1385
|
+
], CardContainerComponent);
|
|
1386
|
+
|
|
1387
|
+
let FocusContainerComponent = class FocusContainerComponent extends DisposableComponent {
|
|
1388
|
+
constructor(focusManager) {
|
|
1389
|
+
super();
|
|
1390
|
+
this.focusManager = focusManager;
|
|
1391
|
+
this.restoreFocusCommand = Command.create(() => {
|
|
1392
|
+
this.restoreFocus();
|
|
1393
|
+
});
|
|
1394
|
+
this.tabIndex = -1;
|
|
1395
|
+
}
|
|
1396
|
+
ngOnInit() {
|
|
1397
|
+
}
|
|
1398
|
+
// @Trace()
|
|
1399
|
+
restoreFocus() {
|
|
1400
|
+
this.focusManager.restoreFocus();
|
|
1401
|
+
}
|
|
1402
|
+
};
|
|
1403
|
+
FocusContainerComponent.ctorParameters = () => [
|
|
1404
|
+
{ type: FocusManager, decorators: [{ type: Self }] }
|
|
1405
|
+
];
|
|
1406
|
+
__decorate([
|
|
1407
|
+
HostBinding('attr.tabindex'),
|
|
1408
|
+
__metadata("design:type", Object)
|
|
1409
|
+
], FocusContainerComponent.prototype, "tabIndex", void 0);
|
|
1410
|
+
FocusContainerComponent = __decorate([
|
|
1411
|
+
Component({
|
|
1412
|
+
selector: 'aup-focus-container',
|
|
1413
|
+
template: "<ng-content></ng-content>\n",
|
|
1414
|
+
providers: [
|
|
1415
|
+
{ provide: FocusManager }
|
|
1416
|
+
],
|
|
1417
|
+
styles: [":host{display:block}"]
|
|
1418
|
+
}),
|
|
1419
|
+
__param(0, Self()),
|
|
1420
|
+
__metadata("design:paramtypes", [FocusManager])
|
|
1421
|
+
], FocusContainerComponent);
|
|
1422
|
+
|
|
1423
|
+
let FocusableComponent = class FocusableComponent extends DisposableComponent {
|
|
1424
|
+
constructor(el, focusManager, focusBindingFactory) {
|
|
1425
|
+
super();
|
|
1426
|
+
this.el = el;
|
|
1427
|
+
this.focusManager = focusManager;
|
|
1428
|
+
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
1429
|
+
if (this.focusManager) {
|
|
1430
|
+
this._focusContext = this.focusManager.registerFocusable(this);
|
|
1431
|
+
this.registerDisposable(this._focusContext);
|
|
1432
|
+
this.registerDisposable(focusBindingFactory.createBinding(el.nativeElement, this.focusContext));
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
get focusable() {
|
|
1436
|
+
return !!this.focusContext ? 0 : undefined;
|
|
1437
|
+
}
|
|
1438
|
+
onFocus() {
|
|
1439
|
+
var _a;
|
|
1440
|
+
(_a = this.focusContext) === null || _a === void 0 ? void 0 : _a.notifyFocusIn();
|
|
1441
|
+
}
|
|
1442
|
+
onBlur() {
|
|
1443
|
+
var _a;
|
|
1444
|
+
(_a = this.focusContext) === null || _a === void 0 ? void 0 : _a.notifyFocusOut();
|
|
1445
|
+
}
|
|
1446
|
+
get focusContext() {
|
|
1447
|
+
return this._focusContext;
|
|
1448
|
+
}
|
|
1449
|
+
};
|
|
1450
|
+
FocusableComponent.ctorParameters = () => [
|
|
1451
|
+
{ type: ElementRef },
|
|
1452
|
+
{ type: FocusManager },
|
|
1453
|
+
{ type: FocusBindingFactory }
|
|
1454
|
+
];
|
|
1455
|
+
__decorate([
|
|
1456
|
+
HostBinding('attr.tabindex'),
|
|
1457
|
+
__metadata("design:type", Object),
|
|
1458
|
+
__metadata("design:paramtypes", [])
|
|
1459
|
+
], FocusableComponent.prototype, "focusable", null);
|
|
1460
|
+
__decorate([
|
|
1461
|
+
HostListener('focus'),
|
|
1462
|
+
__metadata("design:type", Function),
|
|
1463
|
+
__metadata("design:paramtypes", []),
|
|
1464
|
+
__metadata("design:returntype", void 0)
|
|
1465
|
+
], FocusableComponent.prototype, "onFocus", null);
|
|
1466
|
+
__decorate([
|
|
1467
|
+
HostListener('blur'),
|
|
1468
|
+
__metadata("design:type", Function),
|
|
1469
|
+
__metadata("design:paramtypes", []),
|
|
1470
|
+
__metadata("design:returntype", void 0)
|
|
1471
|
+
], FocusableComponent.prototype, "onBlur", null);
|
|
1472
|
+
FocusableComponent = __decorate([
|
|
1473
|
+
Component({ template: '' }),
|
|
1474
|
+
__metadata("design:paramtypes", [ElementRef, FocusManager, FocusBindingFactory])
|
|
1475
|
+
], FocusableComponent);
|
|
1476
|
+
|
|
1477
|
+
class DialogInteractionContext extends AbstractInteractionContext {
|
|
1478
|
+
constructor(identifier, api, dialogService, config) {
|
|
1479
|
+
super();
|
|
1480
|
+
this.identifier = identifier;
|
|
1481
|
+
this.api = api;
|
|
1482
|
+
this.dialogService = dialogService;
|
|
1483
|
+
this.config = config;
|
|
1484
|
+
this.garbage = new GarbageCollector();
|
|
1485
|
+
assert$1.notNil(dialogService);
|
|
1486
|
+
}
|
|
1487
|
+
cancelActiveActivity() {
|
|
1488
|
+
return this.activityContainer.cancelActiveActivity();
|
|
1489
|
+
}
|
|
1490
|
+
dispose() {
|
|
1491
|
+
if (this.isActive()) {
|
|
1492
|
+
lang.illegalState('Dispose called while active.');
|
|
1493
|
+
}
|
|
1494
|
+
this.garbage.dispose();
|
|
1495
|
+
}
|
|
1486
1496
|
registerDisposable(disposable) {
|
|
1487
1497
|
return this.garbage.registerDisposable(disposable);
|
|
1488
1498
|
}
|
|
@@ -2132,208 +2142,34 @@ let DefaultHeaderCellRendererComponent = class DefaultHeaderCellRendererComponen
|
|
|
2132
2142
|
};
|
|
2133
2143
|
__decorate([
|
|
2134
2144
|
Input(),
|
|
2135
|
-
__metadata("design:type",
|
|
2136
|
-
], DefaultHeaderCellRendererComponent.prototype, "
|
|
2145
|
+
__metadata("design:type", String)
|
|
2146
|
+
], DefaultHeaderCellRendererComponent.prototype, "headerText", void 0);
|
|
2137
2147
|
DefaultHeaderCellRendererComponent = __decorate([
|
|
2138
2148
|
Component({
|
|
2139
2149
|
selector: 'aup-default-header-renderer',
|
|
2140
|
-
template: "{{
|
|
2150
|
+
template: "{{headerText}}\n",
|
|
2141
2151
|
styles: [""]
|
|
2142
2152
|
}),
|
|
2143
2153
|
__metadata("design:paramtypes", [])
|
|
2144
2154
|
], DefaultHeaderCellRendererComponent);
|
|
2145
2155
|
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
* Example:
|
|
2151
|
-
* @example
|
|
2152
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
2153
|
-
* table.pluck("firstName");
|
|
2154
|
-
* table.pluck("lastName");
|
|
2155
|
-
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
2156
|
-
* });
|
|
2157
|
-
*
|
|
2158
|
-
* Editable tables
|
|
2159
|
-
* @example
|
|
2160
|
-
* const saveCommand = UnaryCommand.create((form: Form<Hero>) => {
|
|
2161
|
-
* if (form.validate()) {
|
|
2162
|
-
* // normal form save stuff
|
|
2163
|
-
* return true; // finish editing
|
|
2164
|
-
* }
|
|
2165
|
-
* return false; // continue editiing
|
|
2166
|
-
* }
|
|
2167
|
-
* const colorsNames: ListModel<string> = ...;
|
|
2168
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
2169
|
-
* table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: FormValueModel<string> | ValueModel<string>; }
|
|
2170
|
-
* table.pluck("lastName").cellEditor(StringInputComponent, {
|
|
2171
|
-
* validators: [Validator.present("We need a last name")]
|
|
2172
|
-
* });
|
|
2173
|
-
* table.pluck("age").cellEditor(NumberInputComponent);
|
|
2174
|
-
* table.pluck("favoriteColor").cellEditor(SelectInputComponent, {
|
|
2175
|
-
* initialiseComponent(component: SelectInputComponent) {
|
|
2176
|
-
* selectInput.optionsModel = colorsNames; // <- initialise our component
|
|
2177
|
-
* }
|
|
2178
|
-
* });
|
|
2179
|
-
* table.addEditControls(saveCommand); // <- required to enable editing
|
|
2180
|
-
* });
|
|
2181
|
-
*
|
|
2182
|
-
* Selection models
|
|
2183
|
-
* @example
|
|
2184
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
2185
|
-
* table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
|
|
2186
|
-
* table.pluck("firstName");
|
|
2187
|
-
* table.pluck("lastName");
|
|
2188
|
-
* });
|
|
2189
|
-
*
|
|
2190
|
-
* Custom cell renderers and editors
|
|
2191
|
-
* @example
|
|
2192
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
2193
|
-
* table.pluck("favoriteColor")
|
|
2194
|
-
* .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {
|
|
2195
|
-
* // configure your component with what ever you need.
|
|
2196
|
-
* });
|
|
2197
|
-
* .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }
|
|
2198
|
-
* .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: FormValueModel<string> | ValueModel<string>; }
|
|
2199
|
-
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
2200
|
-
* });
|
|
2201
|
-
*
|
|
2202
|
-
* I18n
|
|
2203
|
-
* @example
|
|
2204
|
-
* [table.yml]
|
|
2205
|
-
* table:
|
|
2206
|
-
* columns(ColumnTextProperties[]):
|
|
2207
|
-
* firstName:
|
|
2208
|
-
* headerText: "First Name"
|
|
2209
|
-
* fullName:
|
|
2210
|
-
* headerText: "Full Name"
|
|
2211
|
-
*
|
|
2212
|
-
* const model = TableModel.fromList(heroList, table => {
|
|
2213
|
-
* table.pluck("favoriteColor").cellRenderer(...).cellEditor(...);
|
|
2214
|
-
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
2215
|
-
*
|
|
2216
|
-
* table.columnTextProperties(I18n.table.columns); // <- configures all columns
|
|
2217
|
-
* });
|
|
2218
|
-
*/
|
|
2219
|
-
let TableModel = TableModel_1 = class TableModel {
|
|
2220
|
-
constructor(sourceOfTruth) {
|
|
2221
|
-
this.sourceOfTruth = sourceOfTruth;
|
|
2222
|
-
this._garbage = new GarbageCollector();
|
|
2223
|
-
this._columns = new MutableListModel();
|
|
2224
|
-
this._editorSessions = new MutableListModel();
|
|
2225
|
-
this.identityOf = sourceOfTruth.identityOf;
|
|
2226
|
-
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this._garbage);
|
|
2227
|
-
this._columnsById = chain(this._columns).indexBy('columnId');
|
|
2228
|
-
this._rowsBeingEdited = new MutableListModel([], {
|
|
2229
|
-
identifiedWith: this.identityOf
|
|
2230
|
-
});
|
|
2231
|
-
this._editorSessionByRowId = chain(this._editorSessions).indexBy('rowId');
|
|
2232
|
-
this.editing = chain(this._editorSessions).count().isGreaterThan(0);
|
|
2233
|
-
this.dataSource = chain(this.sourceOfTruth).replaceAll(this.rowsBeingEdited);
|
|
2234
|
-
}
|
|
2235
|
-
static fromList(sourceOfTruth, builder) {
|
|
2236
|
-
const model = new TableModel_1(sourceOfTruth);
|
|
2237
|
-
builder(model);
|
|
2238
|
-
return model;
|
|
2239
|
-
}
|
|
2240
|
-
get rowsBeingEdited() {
|
|
2241
|
-
return this._rowsBeingEdited.readonly;
|
|
2242
|
-
}
|
|
2243
|
-
getTrackByFunction() {
|
|
2244
|
-
return (index, item) => {
|
|
2245
|
-
return this.identityOf ? this.identityOf(item) : index;
|
|
2246
|
-
};
|
|
2247
|
-
}
|
|
2248
|
-
get columns() {
|
|
2249
|
-
return this._columns.readonly;
|
|
2250
|
-
}
|
|
2251
|
-
pluck(property) {
|
|
2252
|
-
return this.addColumn(new PropertyColumnModel(property, this));
|
|
2253
|
-
}
|
|
2254
|
-
addSelectionColumn(selectionModel) {
|
|
2255
|
-
return this.addColumn(new SelectionColumnModel('selection', this, selectionModel));
|
|
2256
|
-
}
|
|
2257
|
-
addEditControls(saveCommand) {
|
|
2156
|
+
class EditSession extends GarbageCollector {
|
|
2157
|
+
constructor(rowId, row, saveCommand) {
|
|
2158
|
+
super();
|
|
2159
|
+
this.rowId = rowId;
|
|
2258
2160
|
this.saveCommand = saveCommand;
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
}
|
|
2268
|
-
else {
|
|
2269
|
-
this._columns.push(column);
|
|
2270
|
-
}
|
|
2271
|
-
return column;
|
|
2272
|
-
}
|
|
2273
|
-
columnTextProperties(columnTextProperties) {
|
|
2274
|
-
this._columnTextPropertiesLookup = columnTextProperties;
|
|
2275
|
-
}
|
|
2276
|
-
getColumnTextProperties(column) {
|
|
2277
|
-
const factory = this._columnTextPropertiesLookup[column.columnId];
|
|
2278
|
-
return factory ? factory() : undefined;
|
|
2279
|
-
}
|
|
2280
|
-
startEditSession(row) {
|
|
2281
|
-
const rowId = this.identityOf(row);
|
|
2282
|
-
if (this._rowsBeingEdited.query().indexOf(row) > -1) {
|
|
2283
|
-
return lang.illegalState(`Row with id=${rowId} already being edited`);
|
|
2284
|
-
}
|
|
2285
|
-
else {
|
|
2286
|
-
const editSession = new TableModel_1.EditSession(rowId, row, this.saveCommand);
|
|
2287
|
-
const { when } = Dsl.disposeWith(editSession);
|
|
2288
|
-
when.valueOf(editSession.rowValueModel).changes((editedValue) => {
|
|
2289
|
-
this._rowsBeingEdited.replaceOrPush(editedValue);
|
|
2290
|
-
}, { initialValue: 'triggerChangeUnlessNil' });
|
|
2291
|
-
this._editorSessions.push(editSession);
|
|
2292
|
-
editSession.onDispose(() => {
|
|
2293
|
-
this._rowsBeingEdited.remove(editSession.rowValueModel.value);
|
|
2294
|
-
this._editorSessions.remove(editSession);
|
|
2295
|
-
});
|
|
2296
|
-
return editSession;
|
|
2297
|
-
}
|
|
2298
|
-
}
|
|
2299
|
-
getEditSessionFor(row) {
|
|
2300
|
-
return this._editorSessionByRowId.get(this.identityOf(row));
|
|
2301
|
-
}
|
|
2302
|
-
cancelAllEditorSessions() {
|
|
2303
|
-
this._editorSessions.runInTransaction((draft) => {
|
|
2304
|
-
this._rowsBeingEdited.runInTransaction(() => {
|
|
2305
|
-
draft.value.forEach(session => session.dispose());
|
|
2161
|
+
this._editorValue = new MutableValueModel();
|
|
2162
|
+
this.rowValueModel = this._editorValue.readonly;
|
|
2163
|
+
this.form = new Form();
|
|
2164
|
+
this.form.load(row);
|
|
2165
|
+
this._editorValue.value = row;
|
|
2166
|
+
this.form.onEdit(() => {
|
|
2167
|
+
this._editorValue.value = produce(this._editorValue.value, draft => {
|
|
2168
|
+
this.form.writeDirtyStateTo(draft);
|
|
2306
2169
|
});
|
|
2307
2170
|
});
|
|
2308
2171
|
}
|
|
2309
|
-
}
|
|
2310
|
-
TableModel.ctorParameters = () => [
|
|
2311
|
-
{ type: ListModel }
|
|
2312
|
-
];
|
|
2313
|
-
TableModel = TableModel_1 = __decorate([
|
|
2314
|
-
TrackExternal.Strategy(new TrackExternal.OneTimeBinding()),
|
|
2315
|
-
__metadata("design:paramtypes", [ListModel])
|
|
2316
|
-
], TableModel);
|
|
2317
|
-
(function (TableModel) {
|
|
2318
|
-
class EditSession extends GarbageCollector {
|
|
2319
|
-
constructor(rowId, row, saveCommand) {
|
|
2320
|
-
super();
|
|
2321
|
-
this.rowId = rowId;
|
|
2322
|
-
this.saveCommand = saveCommand;
|
|
2323
|
-
this._editorValue = new MutableValueModel();
|
|
2324
|
-
this.rowValueModel = this._editorValue.readonly;
|
|
2325
|
-
this.form = new Form();
|
|
2326
|
-
this.form.load(row);
|
|
2327
|
-
this._editorValue.value = row;
|
|
2328
|
-
this.form.onEdit(() => {
|
|
2329
|
-
this._editorValue.value = produce(this._editorValue.value, draft => {
|
|
2330
|
-
this.form.writeDirtyStateTo(draft);
|
|
2331
|
-
});
|
|
2332
|
-
});
|
|
2333
|
-
}
|
|
2334
|
-
}
|
|
2335
|
-
TableModel.EditSession = EditSession;
|
|
2336
|
-
})(TableModel || (TableModel = {}));
|
|
2172
|
+
}
|
|
2337
2173
|
|
|
2338
2174
|
let EditRowControls = class EditRowControls extends DisposableComponent {
|
|
2339
2175
|
constructor() {
|
|
@@ -2368,7 +2204,7 @@ __decorate([
|
|
|
2368
2204
|
], EditRowControls.prototype, "editRowCommand", void 0);
|
|
2369
2205
|
__decorate([
|
|
2370
2206
|
Input(),
|
|
2371
|
-
__metadata("design:type",
|
|
2207
|
+
__metadata("design:type", EditSession)
|
|
2372
2208
|
], EditRowControls.prototype, "editSession", void 0);
|
|
2373
2209
|
EditRowControls = __decorate([
|
|
2374
2210
|
Component({
|
|
@@ -2446,7 +2282,7 @@ class ColumnModel {
|
|
|
2446
2282
|
this.columnId = columnId;
|
|
2447
2283
|
this.defaults = defaults;
|
|
2448
2284
|
this.cellHeaderRenderer(DefaultHeaderCellRendererComponent, (component, column) => {
|
|
2449
|
-
component.
|
|
2285
|
+
component.headerText = column.getHeaderText();
|
|
2450
2286
|
});
|
|
2451
2287
|
}
|
|
2452
2288
|
getHeaderText() {
|
|
@@ -2474,6 +2310,7 @@ class ColumnModel {
|
|
|
2474
2310
|
portal: new ComponentPortal(cellRenderer),
|
|
2475
2311
|
initialiseComponent: initialiser
|
|
2476
2312
|
};
|
|
2313
|
+
return this;
|
|
2477
2314
|
}
|
|
2478
2315
|
setCellEditor(cellEditor) {
|
|
2479
2316
|
this._cellEditorConfig = cellEditor;
|
|
@@ -2517,12 +2354,14 @@ class PropertyColumnModel extends ColumnModel {
|
|
|
2517
2354
|
constructor(property, defaults) {
|
|
2518
2355
|
super(property.toString(), defaults);
|
|
2519
2356
|
this.property = property;
|
|
2357
|
+
this._format = (value) => value;
|
|
2520
2358
|
this.cellRenderer(DefaultCellRendererComponent);
|
|
2521
2359
|
}
|
|
2522
2360
|
cellRenderer(componentType) {
|
|
2523
2361
|
this.setCellRenderer(componentType, (component, row) => {
|
|
2524
|
-
component.value = row[this.property];
|
|
2362
|
+
component.value = this._format(row[this.property]);
|
|
2525
2363
|
});
|
|
2364
|
+
return this;
|
|
2526
2365
|
}
|
|
2527
2366
|
cellEditor(editor, options) {
|
|
2528
2367
|
this.setCellEditor({
|
|
@@ -2540,6 +2379,11 @@ class PropertyColumnModel extends ColumnModel {
|
|
|
2540
2379
|
});
|
|
2541
2380
|
return this;
|
|
2542
2381
|
}
|
|
2382
|
+
format(formatter) {
|
|
2383
|
+
assert$1.isFunction(formatter);
|
|
2384
|
+
this._format = formatter;
|
|
2385
|
+
return this;
|
|
2386
|
+
}
|
|
2543
2387
|
}
|
|
2544
2388
|
class CustomValueColumnModel extends ColumnModel {
|
|
2545
2389
|
constructor(columnId, defaults, getValue) {
|
|
@@ -2551,6 +2395,7 @@ class CustomValueColumnModel extends ColumnModel {
|
|
|
2551
2395
|
this.setCellRenderer(componentType, (component, row) => {
|
|
2552
2396
|
component.value = this.getValue(row);
|
|
2553
2397
|
});
|
|
2398
|
+
return this;
|
|
2554
2399
|
}
|
|
2555
2400
|
}
|
|
2556
2401
|
class EditorControlColumnModel extends ColumnModel {
|
|
@@ -2564,33 +2409,206 @@ class EditorControlColumnModel extends ColumnModel {
|
|
|
2564
2409
|
component.editSession = editSession;
|
|
2565
2410
|
component.editRowCommand = editRowCommand;
|
|
2566
2411
|
});
|
|
2412
|
+
return this;
|
|
2413
|
+
}
|
|
2414
|
+
getDefaultHeaderText() {
|
|
2415
|
+
return '';
|
|
2416
|
+
}
|
|
2417
|
+
}
|
|
2418
|
+
class CustomTemplateColumnModel extends ColumnModel {
|
|
2419
|
+
constructor(columnId, defaults, component) {
|
|
2420
|
+
super(columnId, defaults);
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
class SelectionColumnModel extends ColumnModel {
|
|
2424
|
+
constructor(columnId, defaults, selectionModel) {
|
|
2425
|
+
super(columnId, defaults);
|
|
2426
|
+
if (selectionModel instanceof MultipleSelectionModel) {
|
|
2427
|
+
this.cellHeaderRenderer(SelectHeaderCellRendererComponent, (component) => {
|
|
2428
|
+
component.selectionModel = selectionModel;
|
|
2429
|
+
});
|
|
2430
|
+
}
|
|
2431
|
+
this.setCellRenderer(SelectCellRendererComponent, (component, row, editRowCommand, editSession) => {
|
|
2432
|
+
component.row = row;
|
|
2433
|
+
component.selectionModel = selectionModel;
|
|
2434
|
+
});
|
|
2435
|
+
}
|
|
2436
|
+
getDefaultHeaderText() {
|
|
2437
|
+
return '';
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
var TableModel_1;
|
|
2442
|
+
// export type StringPropertiesOf<T> = { [K in keyof T]: T[K] extends string ? K : never }[keyof T];
|
|
2443
|
+
// export type NumberPropertiesOf<T> = { [K in keyof T]: T[K] extends number ? K : never }[keyof T];
|
|
2444
|
+
/**
|
|
2445
|
+
* Example:
|
|
2446
|
+
* @example
|
|
2447
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
2448
|
+
* table.pluck("firstName");
|
|
2449
|
+
* table.pluck("lastName");
|
|
2450
|
+
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
2451
|
+
* });
|
|
2452
|
+
*
|
|
2453
|
+
* Editable tables
|
|
2454
|
+
* @example
|
|
2455
|
+
* const saveCommand = UnaryCommand.create((form: Form<Hero>) => {
|
|
2456
|
+
* if (form.validate()) {
|
|
2457
|
+
* // normal form save stuff
|
|
2458
|
+
* return true; // finish editing
|
|
2459
|
+
* }
|
|
2460
|
+
* return false; // continue editiing
|
|
2461
|
+
* }
|
|
2462
|
+
* const colorsNames: ListModel<string> = ...;
|
|
2463
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
2464
|
+
* table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: FormValueModel<string> | ValueModel<string>; }
|
|
2465
|
+
* table.pluck("lastName").cellEditor(StringInputComponent, {
|
|
2466
|
+
* validators: [Validator.present("We need a last name")]
|
|
2467
|
+
* });
|
|
2468
|
+
* table.pluck("age").cellEditor(NumberInputComponent);
|
|
2469
|
+
* table.pluck("favoriteColor").cellEditor(SelectInputComponent, {
|
|
2470
|
+
* initialiseComponent(component: SelectInputComponent) {
|
|
2471
|
+
* selectInput.optionsModel = colorsNames; // <- initialise our component
|
|
2472
|
+
* }
|
|
2473
|
+
* });
|
|
2474
|
+
* table.addEditControls(saveCommand); // <- required to enable editing
|
|
2475
|
+
* });
|
|
2476
|
+
*
|
|
2477
|
+
* Selection models
|
|
2478
|
+
* @example
|
|
2479
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
2480
|
+
* table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
|
|
2481
|
+
* table.pluck("firstName");
|
|
2482
|
+
* table.pluck("lastName");
|
|
2483
|
+
* });
|
|
2484
|
+
*
|
|
2485
|
+
* Custom cell renderers and editors
|
|
2486
|
+
* @example
|
|
2487
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
2488
|
+
* table.pluck("favoriteColor")
|
|
2489
|
+
* .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {
|
|
2490
|
+
* // configure your component with what ever you need.
|
|
2491
|
+
* });
|
|
2492
|
+
* .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }
|
|
2493
|
+
* .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: FormValueModel<string> | ValueModel<string>; }
|
|
2494
|
+
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
2495
|
+
* });
|
|
2496
|
+
*
|
|
2497
|
+
* I18n
|
|
2498
|
+
* @example
|
|
2499
|
+
* [table.yml]
|
|
2500
|
+
* table:
|
|
2501
|
+
* columns(ColumnTextProperties[]):
|
|
2502
|
+
* firstName:
|
|
2503
|
+
* headerText: "First Name"
|
|
2504
|
+
* fullName:
|
|
2505
|
+
* headerText: "Full Name"
|
|
2506
|
+
*
|
|
2507
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
2508
|
+
* table.pluck("favoriteColor").cellRenderer(...).cellEditor(...);
|
|
2509
|
+
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
2510
|
+
*
|
|
2511
|
+
* table.columnTextProperties(I18n.table.columns); // <- configures all columns
|
|
2512
|
+
* });
|
|
2513
|
+
*/
|
|
2514
|
+
let TableModel = TableModel_1 = class TableModel {
|
|
2515
|
+
constructor(sourceOfTruth) {
|
|
2516
|
+
this.sourceOfTruth = sourceOfTruth;
|
|
2517
|
+
this._garbage = new GarbageCollector();
|
|
2518
|
+
this._columns = new MutableListModel();
|
|
2519
|
+
this._editorSessions = new MutableListModel();
|
|
2520
|
+
this.identityOf = sourceOfTruth.identityOf;
|
|
2521
|
+
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this._garbage);
|
|
2522
|
+
this._columnsById = chain(this._columns).indexBy('columnId');
|
|
2523
|
+
this._rowsBeingEdited = new MutableListModel([], {
|
|
2524
|
+
identifiedWith: this.identityOf
|
|
2525
|
+
});
|
|
2526
|
+
this._editorSessionByRowId = chain(this._editorSessions).indexBy('rowId');
|
|
2527
|
+
this.editing = chain(this._editorSessions).count().isGreaterThan(0);
|
|
2528
|
+
this.dataSource = chain(this.sourceOfTruth).replaceAll(this.rowsBeingEdited);
|
|
2529
|
+
}
|
|
2530
|
+
static fromList(sourceOfTruth, builder) {
|
|
2531
|
+
const model = new TableModel_1(sourceOfTruth);
|
|
2532
|
+
builder(model);
|
|
2533
|
+
return model;
|
|
2534
|
+
}
|
|
2535
|
+
get rowsBeingEdited() {
|
|
2536
|
+
return this._rowsBeingEdited.readonly;
|
|
2537
|
+
}
|
|
2538
|
+
getTrackByFunction() {
|
|
2539
|
+
return (index, item) => {
|
|
2540
|
+
return this.identityOf ? this.identityOf(item) : index;
|
|
2541
|
+
};
|
|
2542
|
+
}
|
|
2543
|
+
get columns() {
|
|
2544
|
+
return this._columns.readonly;
|
|
2545
|
+
}
|
|
2546
|
+
pluck(property) {
|
|
2547
|
+
return this.addColumn(new PropertyColumnModel(property, this));
|
|
2548
|
+
}
|
|
2549
|
+
addSelectionColumn(selectionModel) {
|
|
2550
|
+
return this.addColumn(new SelectionColumnModel('selection', this, selectionModel));
|
|
2551
|
+
}
|
|
2552
|
+
addEditControls(saveCommand) {
|
|
2553
|
+
this.saveCommand = saveCommand;
|
|
2554
|
+
return this.addColumn(new EditorControlColumnModel('editControls', saveCommand, this));
|
|
2555
|
+
}
|
|
2556
|
+
addCustomColumn(columnId, dataAccessor) {
|
|
2557
|
+
return this.addColumn(new CustomValueColumnModel(columnId, this, dataAccessor));
|
|
2558
|
+
}
|
|
2559
|
+
addColumn(column) {
|
|
2560
|
+
if (this._columnsById.get(column.columnId)) {
|
|
2561
|
+
lang.illegalState(`Column with id=${column.columnId} already exists`);
|
|
2562
|
+
}
|
|
2563
|
+
else {
|
|
2564
|
+
this._columns.push(column);
|
|
2565
|
+
}
|
|
2566
|
+
return column;
|
|
2567
2567
|
}
|
|
2568
|
-
|
|
2569
|
-
|
|
2568
|
+
columnTextProperties(columnTextProperties) {
|
|
2569
|
+
this._columnTextPropertiesLookup = columnTextProperties;
|
|
2570
2570
|
}
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
super(columnId, defaults);
|
|
2571
|
+
getColumnTextProperties(column) {
|
|
2572
|
+
const factory = this._columnTextPropertiesLookup ? this._columnTextPropertiesLookup[column.columnId] : undefined;
|
|
2573
|
+
return factory ? factory() : undefined;
|
|
2575
2574
|
}
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2575
|
+
startEditSession(row) {
|
|
2576
|
+
const rowId = this.identityOf(row);
|
|
2577
|
+
if (this._rowsBeingEdited.query().indexOf(row) > -1) {
|
|
2578
|
+
return lang.illegalState(`Row with id=${rowId} already being edited`);
|
|
2579
|
+
}
|
|
2580
|
+
else {
|
|
2581
|
+
const editSession = new EditSession(rowId, row, this.saveCommand);
|
|
2582
|
+
const { when } = Dsl.disposeWith(editSession);
|
|
2583
|
+
when.valueOf(editSession.rowValueModel).changes((editedValue) => {
|
|
2584
|
+
this._rowsBeingEdited.replaceOrPush(editedValue);
|
|
2585
|
+
}, { initialValue: 'triggerChangeUnlessNil' });
|
|
2586
|
+
this._editorSessions.push(editSession);
|
|
2587
|
+
editSession.onDispose(() => {
|
|
2588
|
+
this._rowsBeingEdited.remove(editSession.rowValueModel.value);
|
|
2589
|
+
this._editorSessions.remove(editSession);
|
|
2583
2590
|
});
|
|
2591
|
+
return editSession;
|
|
2584
2592
|
}
|
|
2585
|
-
this.setCellRenderer(SelectCellRendererComponent, (component, row, editRowCommand, editSession) => {
|
|
2586
|
-
component.row = row;
|
|
2587
|
-
component.selectionModel = selectionModel;
|
|
2588
|
-
});
|
|
2589
2593
|
}
|
|
2590
|
-
|
|
2591
|
-
return
|
|
2594
|
+
getEditSessionFor(row) {
|
|
2595
|
+
return this._editorSessionByRowId.get(this.identityOf(row));
|
|
2592
2596
|
}
|
|
2593
|
-
|
|
2597
|
+
cancelAllEditorSessions() {
|
|
2598
|
+
this._editorSessions.runInTransaction((draft) => {
|
|
2599
|
+
this._rowsBeingEdited.runInTransaction(() => {
|
|
2600
|
+
draft.value.forEach(session => session.dispose());
|
|
2601
|
+
});
|
|
2602
|
+
});
|
|
2603
|
+
}
|
|
2604
|
+
};
|
|
2605
|
+
TableModel.ctorParameters = () => [
|
|
2606
|
+
{ type: ListModel }
|
|
2607
|
+
];
|
|
2608
|
+
TableModel = TableModel_1 = __decorate([
|
|
2609
|
+
TrackExternal.Strategy(new TrackExternal.OneTimeBinding()),
|
|
2610
|
+
__metadata("design:paramtypes", [ListModel])
|
|
2611
|
+
], TableModel);
|
|
2594
2612
|
|
|
2595
2613
|
/**
|
|
2596
2614
|
* Create your model:
|
|
@@ -2705,7 +2723,7 @@ __decorate([
|
|
|
2705
2723
|
], TableCellRendererComponent.prototype, "column", void 0);
|
|
2706
2724
|
__decorate([
|
|
2707
2725
|
Input(),
|
|
2708
|
-
__metadata("design:type",
|
|
2726
|
+
__metadata("design:type", EditSession)
|
|
2709
2727
|
], TableCellRendererComponent.prototype, "editSession", void 0);
|
|
2710
2728
|
__decorate([
|
|
2711
2729
|
Input(),
|
|
@@ -2834,107 +2852,6 @@ VerticalFocusContainerComponent = __decorate([
|
|
|
2834
2852
|
__metadata("design:paramtypes", [FocusManager])
|
|
2835
2853
|
], VerticalFocusContainerComponent);
|
|
2836
2854
|
|
|
2837
|
-
/**
|
|
2838
|
-
* @file Automatically generated by barrelsby.
|
|
2839
|
-
*/
|
|
2840
|
-
|
|
2841
|
-
let ActivityActionsComponent = class ActivityActionsComponent extends DisposableComponent {
|
|
2842
|
-
constructor() {
|
|
2843
|
-
super(...arguments);
|
|
2844
|
-
this.align = 'start';
|
|
2845
|
-
}
|
|
2846
|
-
get alignEnd() {
|
|
2847
|
-
return this.align === 'end';
|
|
2848
|
-
}
|
|
2849
|
-
ngOnInit() {
|
|
2850
|
-
}
|
|
2851
|
-
hasConfirmText() {
|
|
2852
|
-
return !___default.isEmpty(this.confirmText);
|
|
2853
|
-
}
|
|
2854
|
-
};
|
|
2855
|
-
__decorate([
|
|
2856
|
-
Input(),
|
|
2857
|
-
TrackExternal(),
|
|
2858
|
-
__metadata("design:type", Command)
|
|
2859
|
-
], ActivityActionsComponent.prototype, "confirmCommand", void 0);
|
|
2860
|
-
__decorate([
|
|
2861
|
-
Input(),
|
|
2862
|
-
__metadata("design:type", String)
|
|
2863
|
-
], ActivityActionsComponent.prototype, "confirmText", void 0);
|
|
2864
|
-
__decorate([
|
|
2865
|
-
Input(),
|
|
2866
|
-
TrackExternal(),
|
|
2867
|
-
__metadata("design:type", Command)
|
|
2868
|
-
], ActivityActionsComponent.prototype, "cancelCommand", void 0);
|
|
2869
|
-
__decorate([
|
|
2870
|
-
Input(),
|
|
2871
|
-
__metadata("design:type", String)
|
|
2872
|
-
], ActivityActionsComponent.prototype, "align", void 0);
|
|
2873
|
-
__decorate([
|
|
2874
|
-
HostBinding('class.align-end'),
|
|
2875
|
-
__metadata("design:type", Boolean),
|
|
2876
|
-
__metadata("design:paramtypes", [])
|
|
2877
|
-
], ActivityActionsComponent.prototype, "alignEnd", null);
|
|
2878
|
-
ActivityActionsComponent = __decorate([
|
|
2879
|
-
Component({
|
|
2880
|
-
selector: 'aup-activity-actions',
|
|
2881
|
-
template: "<button class=\"cancel\" mat-icon-button [pectinCommand]=\"cancelCommand\">\n <mat-icon>clear</mat-icon>\n</button>\n<button class=\"confirm\" *ngIf=\"!hasConfirmText()\" mat-icon-button [pectinCommand]=\"confirmCommand\">\n <mat-icon>done</mat-icon>\n</button>\n<button class=\"confirm\" *ngIf=\"hasConfirmText()\" mat-button [pectinCommand]=\"confirmCommand\">{{confirmText}}</button>\n<div class=\"content\">\n <ng-content></ng-content>\n</div>\n",
|
|
2882
|
-
styles: [":host{display:-ms-grid;display:grid;grid-template-areas:\"cancel confirm content\";-ms-grid-columns:auto auto 1fr;grid-template-columns:auto auto 1fr;-ms-grid-rows:auto;grid-template-rows:auto;align-items:center;justify-content:end}:host.align-end{grid-template-areas:\"content cancel confirm\";-ms-grid-columns:1fr auto auto;grid-template-columns:1fr auto auto}.cancel{-ms-grid-row:1;-ms-grid-column:1;grid-area:cancel}:host.align-end>.cancel{-ms-grid-row:1;-ms-grid-column:2}.confirm{-ms-grid-row:1;-ms-grid-column:2;grid-area:confirm}:host.align-end>.confirm{-ms-grid-row:1;-ms-grid-column:3}.content{-ms-grid-row:1;-ms-grid-column:3;grid-area:content;text-align:left}:host.align-end>.content{-ms-grid-row:1;-ms-grid-column:1}"]
|
|
2883
|
-
})
|
|
2884
|
-
], ActivityActionsComponent);
|
|
2885
|
-
|
|
2886
|
-
let InteractionModule = class InteractionModule {
|
|
2887
|
-
};
|
|
2888
|
-
InteractionModule = __decorate([
|
|
2889
|
-
NgModule({
|
|
2890
|
-
imports: [
|
|
2891
|
-
CommonModule,
|
|
2892
|
-
MatButtonModule,
|
|
2893
|
-
MatDialogModule,
|
|
2894
|
-
MatTabsModule,
|
|
2895
|
-
PortalModule,
|
|
2896
|
-
RouterModule,
|
|
2897
|
-
MatIconModule,
|
|
2898
|
-
DirectivesModule,
|
|
2899
|
-
FlexModule,
|
|
2900
|
-
GridModule
|
|
2901
|
-
],
|
|
2902
|
-
declarations: [
|
|
2903
|
-
ActivityContainerComponent,
|
|
2904
|
-
ConfirmationDialogComponent,
|
|
2905
|
-
ConfirmThenDialogComponent,
|
|
2906
|
-
AlertDialogComponent,
|
|
2907
|
-
ActivityOutletComponent,
|
|
2908
|
-
InPlaceInteractionContextComponent,
|
|
2909
|
-
AddItemInteractionContextComponent,
|
|
2910
|
-
ActivityActionsComponent,
|
|
2911
|
-
PopupInteractionContextComponent,
|
|
2912
|
-
InteractionContextTriggerFor
|
|
2913
|
-
],
|
|
2914
|
-
exports: [
|
|
2915
|
-
ActivityContainerComponent,
|
|
2916
|
-
ActivityOutletComponent,
|
|
2917
|
-
InPlaceInteractionContextComponent,
|
|
2918
|
-
AddItemInteractionContextComponent,
|
|
2919
|
-
ActivityActionsComponent,
|
|
2920
|
-
PopupInteractionContextComponent,
|
|
2921
|
-
InteractionContextTriggerFor
|
|
2922
|
-
],
|
|
2923
|
-
entryComponents: [
|
|
2924
|
-
ActivityContainerComponent,
|
|
2925
|
-
ConfirmationDialogComponent,
|
|
2926
|
-
ConfirmThenDialogComponent,
|
|
2927
|
-
AlertDialogComponent
|
|
2928
|
-
],
|
|
2929
|
-
providers: [
|
|
2930
|
-
InteractionService
|
|
2931
|
-
// {
|
|
2932
|
-
// provide: MAT_TABS_CONFIG, useValue: { animationDuration: "2s" }
|
|
2933
|
-
// }
|
|
2934
|
-
]
|
|
2935
|
-
})
|
|
2936
|
-
], InteractionModule);
|
|
2937
|
-
|
|
2938
2855
|
let ComponentsModule = class ComponentsModule {
|
|
2939
2856
|
};
|
|
2940
2857
|
ComponentsModule = __decorate([
|
|
@@ -5155,6 +5072,97 @@ const slideRightOnEnterAnimation = trigger('slideRightOnEnter', [
|
|
|
5155
5072
|
transition(':leave', [animate('{{duration}}', slideLeftOnEnterDef)], { params: { duration: '100ms' } })
|
|
5156
5073
|
]);
|
|
5157
5074
|
|
|
5075
|
+
/**
|
|
5076
|
+
* @file Automatically generated by barrelsby.
|
|
5077
|
+
*/
|
|
5078
|
+
|
|
5079
|
+
class Dimension {
|
|
5080
|
+
constructor(width, height) {
|
|
5081
|
+
this.width = width;
|
|
5082
|
+
this.height = height;
|
|
5083
|
+
}
|
|
5084
|
+
}
|
|
5085
|
+
|
|
5086
|
+
class Point {
|
|
5087
|
+
constructor(x, y) {
|
|
5088
|
+
this.x = x;
|
|
5089
|
+
this.y = y;
|
|
5090
|
+
}
|
|
5091
|
+
static from(data) {
|
|
5092
|
+
return new Point(data.x, data.y);
|
|
5093
|
+
}
|
|
5094
|
+
translate(x, y) {
|
|
5095
|
+
return new Point(this.x + x, this.y + y);
|
|
5096
|
+
}
|
|
5097
|
+
}
|
|
5098
|
+
|
|
5099
|
+
class Bounds extends Dimension {
|
|
5100
|
+
constructor(top, left, width, height) {
|
|
5101
|
+
super(width, height);
|
|
5102
|
+
this.top = top;
|
|
5103
|
+
this.left = left;
|
|
5104
|
+
this.width = width;
|
|
5105
|
+
this.height = height;
|
|
5106
|
+
}
|
|
5107
|
+
relativePositionOf(point) {
|
|
5108
|
+
if (point instanceof MouseEvent) {
|
|
5109
|
+
return new Point(point.clientX - this.left, point.clientY - this.top);
|
|
5110
|
+
}
|
|
5111
|
+
else {
|
|
5112
|
+
return new Point(point.x - this.left, point.y - this.top);
|
|
5113
|
+
}
|
|
5114
|
+
}
|
|
5115
|
+
}
|
|
5116
|
+
(function (Bounds) {
|
|
5117
|
+
function ofElement(element) {
|
|
5118
|
+
const rect = element.getBoundingClientRect();
|
|
5119
|
+
return new Bounds(rect.top, rect.left, rect.width, rect.height);
|
|
5120
|
+
}
|
|
5121
|
+
Bounds.ofElement = ofElement;
|
|
5122
|
+
})(Bounds || (Bounds = {}));
|
|
5123
|
+
|
|
5124
|
+
let ResizeAwareComponent = class ResizeAwareComponent extends DisposableComponent {
|
|
5125
|
+
constructor(elementRef, ngZone) {
|
|
5126
|
+
super();
|
|
5127
|
+
this.elementRef = elementRef;
|
|
5128
|
+
this.ngZone = ngZone;
|
|
5129
|
+
this._boundsModel = new MutableValueModel(new Bounds(0, 0, 0, 0));
|
|
5130
|
+
}
|
|
5131
|
+
ngAfterViewInit() {
|
|
5132
|
+
this.updateBounds();
|
|
5133
|
+
const element = this.elementRef.nativeElement;
|
|
5134
|
+
const ro = new ResizeObserver((entries, observer) => {
|
|
5135
|
+
this.ngZone.run(() => this.updateBounds());
|
|
5136
|
+
});
|
|
5137
|
+
ro.observe(element);
|
|
5138
|
+
this.onDispose(() => ro.disconnect());
|
|
5139
|
+
}
|
|
5140
|
+
get boundsModel() {
|
|
5141
|
+
return this._boundsModel.readonly;
|
|
5142
|
+
}
|
|
5143
|
+
get nativeElement() {
|
|
5144
|
+
return this.elementRef.nativeElement;
|
|
5145
|
+
}
|
|
5146
|
+
// TODO: Make this handle body scroll
|
|
5147
|
+
relativePositionOf(point) {
|
|
5148
|
+
return this.bounds.relativePositionOf(point);
|
|
5149
|
+
}
|
|
5150
|
+
get bounds() {
|
|
5151
|
+
return this._boundsModel.value;
|
|
5152
|
+
}
|
|
5153
|
+
updateBounds() {
|
|
5154
|
+
this._boundsModel.value = Bounds.ofElement(this.nativeElement);
|
|
5155
|
+
}
|
|
5156
|
+
};
|
|
5157
|
+
ResizeAwareComponent.ctorParameters = () => [
|
|
5158
|
+
{ type: ElementRef },
|
|
5159
|
+
{ type: NgZone }
|
|
5160
|
+
];
|
|
5161
|
+
ResizeAwareComponent = __decorate([
|
|
5162
|
+
Directive(),
|
|
5163
|
+
__metadata("design:paramtypes", [ElementRef, NgZone])
|
|
5164
|
+
], ResizeAwareComponent);
|
|
5165
|
+
|
|
5158
5166
|
/**
|
|
5159
5167
|
* @file Automatically generated by barrelsby.
|
|
5160
5168
|
*/
|
|
@@ -5483,5 +5491,5 @@ function VisitParameterList(options) {
|
|
|
5483
5491
|
* Generated bundle index. Do not edit.
|
|
5484
5492
|
*/
|
|
5485
5493
|
|
|
5486
|
-
export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractInputActivity, AbstractInputComponent, AbstractInteractionContext, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, Activity, ActivityActionsComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CardContainerComponent, CheckboxInputComponent, ColumnModel, ColumnTemplateDirective, CommandDirective, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditorControlColumnModel, EmptyStateComponent, EventCleanUpSession, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, InPlaceInteractionContextComponent, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ModalInteractionContextFactory, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NumberInputComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupInteractionContextComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SelectCellRendererComponent, SelectHeaderCellRendererComponent, SelectInputComponent, SelectionColumnModel, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellRendererComponent, TableComponent, TableHeaderCellRendererComponent, TableModel, TextInputComponent, UrlService, UrlSnapshot, VerticalFocusContainerComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationEventsFinish, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, DirectivesModule as ɵa, CommandDirective as ɵb, CardContainerComponent as ɵba, TableComponent as ɵbb, EditRowControls as ɵbc, ColumnTemplateDirective as ɵbd, DefaultCellRendererComponent as ɵbe, TableCellRendererComponent as ɵbf, SelectCellRendererComponent as ɵbg, SelectHeaderCellRendererComponent as ɵbh, DefaultHeaderCellRendererComponent as ɵbi, TableHeaderCellRendererComponent as ɵbj, InteractionModule as ɵbk, ActivityContainerComponent as ɵbl, AbstractInteractionContext as ɵbm, ActivityOutletComponent as ɵbn, ConfirmationDialogComponent as ɵbo, ACTIVITY_DATA as ɵbp, Activity as ɵbq, ConfirmThenDialogComponent as ɵbs, AlertDialogComponent as ɵbt, InPlaceInteractionContextComponent as ɵbv, InteractionService as ɵbw, ModalInteractionContextFactory as ɵbx, AddItemInteractionContextComponent as ɵby, ActivityActionsComponent as ɵbz, FocusBindingDirective as ɵc,
|
|
5494
|
+
export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractInputActivity, AbstractInputComponent, AbstractInteractionContext, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, Activity, ActivityActionsComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CardContainerComponent, CheckboxInputComponent, ColumnModel, ColumnTemplateDirective, CommandDirective, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EventCleanUpSession, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, InPlaceInteractionContextComponent, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ModalInteractionContextFactory, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NumberInputComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupInteractionContextComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SelectCellRendererComponent, SelectHeaderCellRendererComponent, SelectInputComponent, SelectionColumnModel, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellRendererComponent, TableComponent, TableHeaderCellRendererComponent, TableModel, TextInputComponent, UrlService, UrlSnapshot, VerticalFocusContainerComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationEventsFinish, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, DirectivesModule as ɵa, CommandDirective as ɵb, CardContainerComponent as ɵba, TableComponent as ɵbb, EditRowControls as ɵbc, ColumnTemplateDirective as ɵbd, DefaultCellRendererComponent as ɵbe, TableCellRendererComponent as ɵbf, SelectCellRendererComponent as ɵbg, SelectHeaderCellRendererComponent as ɵbh, DefaultHeaderCellRendererComponent as ɵbi, TableHeaderCellRendererComponent as ɵbj, InteractionModule as ɵbk, ActivityContainerComponent as ɵbl, AbstractInteractionContext as ɵbm, ActivityOutletComponent as ɵbn, ConfirmationDialogComponent as ɵbo, ACTIVITY_DATA as ɵbp, Activity as ɵbq, ConfirmThenDialogComponent as ɵbs, AlertDialogComponent as ɵbt, InPlaceInteractionContextComponent as ɵbv, InteractionService as ɵbw, ModalInteractionContextFactory as ɵbx, AddItemInteractionContextComponent as ɵby, ActivityActionsComponent as ɵbz, FocusBindingDirective as ɵc, PopupInteractionContextComponent as ɵca, InteractionContextTriggerFor as ɵcb, PlaceModule as ɵcc, EmptyStateComponent as ɵcd, BusyOverlayComponent as ɵce, PlaceOutletComponent as ɵcf, leftRightPlaceAnimation as ɵcg, LEFT_RIGHT_PLACE_ANIMATION as ɵch, AUP_PLACE_CONFIG as ɵci, PlaceRouter as ɵck, UrlService as ɵcl, PlaceHistory as ɵcm, TabbedPlaceNavigationComponent as ɵcn, AbstractPlaceNavigationComponent as ɵco, ListPlaceNavComponent as ɵcp, SidePlaceNavigationComponent as ɵcq, DisposableComponent as ɵd, FocusBindingFactory as ɵe, ComponentsModule as ɵf, AbstractInputComponent as ɵg, AbstractInputActivity as ɵh, Activity as ɵi, ACTIVITY_DATA as ɵj, NumberInputComponent as ɵk, StringInputComponent as ɵl, StringInputActivity as ɵm, TextInputComponent as ɵn, PasswordInputComponent as ɵo, SelectInputComponent as ɵp, CheckboxInputComponent as ɵq, ScrollContainerComponent as ɵr, NoopComponent as ɵs, SwitchCaseOption as ɵt, SwitchCaseWhenDirective as ɵu, SwitchCaseDefaultDirective as ɵv, SwitchCaseComponent as ɵw, FocusContainerComponent as ɵx, VerticalFocusContainerComponent as ɵy, FocusableComponent as ɵz };
|
|
5487
5495
|
//# sourceMappingURL=coolon-angular-ui-powerups.js.map
|