@coolon/angular-ui-powerups 1.21.0 → 2.0.0-alpha.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/CHANGELOG.md +16 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +22 -15
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-list-input.component.js +3 -3
- package/esm2015/lib/components/forms/abstract-list-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-value-input.component.js +12 -6
- package/esm2015/lib/components/forms/abstract-value-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-value-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/multiple-select-input/multiple-select-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/number-input/number-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/password-input/password-input.component.js +1 -1
- package/esm2015/lib/components/forms/password-input/password-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/password-input/password-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/select-input/select-input.component.js +3 -3
- package/esm2015/lib/components/forms/select-input/select-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/string-input/string-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/string-input/string-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/text-input/text-input.component.js.map +1 -1
- package/esm2015/lib/components/table/cell-editors.js.map +1 -1
- 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/edit-row-controls/edit-row-controls.component.js.map +1 -1
- package/esm2015/lib/components/table/edit-session.js.map +1 -1
- package/esm2015/lib/components/table/edit-session.metadata.json +1 -1
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
- package/esm2015/lib/components/table/table-model.js +4 -4
- 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/components/table/table.component.js +3 -2
- package/esm2015/lib/components/table/table.component.js.map +1 -1
- package/esm2015/lib/components/table/table.component.metadata.json +1 -1
- package/esm2015/lib/components/table/table.component.scss.ngstyle.js.map +1 -0
- package/esm2015/lib/interaction/components/input-activities/abstract-input-activity.js +2 -2
- package/esm2015/lib/interaction/components/input-activities/abstract-input-activity.js.map +1 -1
- package/esm2015/lib/interaction/components/input-activities/input-activity-data.js.map +1 -1
- package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm5/lib/components/forms/abstract-list-input.component.js +3 -3
- package/esm5/lib/components/forms/abstract-list-input.component.js.map +1 -1
- package/esm5/lib/components/forms/abstract-value-input.component.js +12 -6
- package/esm5/lib/components/forms/abstract-value-input.component.js.map +1 -1
- package/esm5/lib/components/forms/checkbox-input/checkbox-input.component.js.map +1 -1
- package/esm5/lib/components/forms/multiple-select-input/multiple-select-input.component.js.map +1 -1
- package/esm5/lib/components/forms/number-input/number-input.component.js.map +1 -1
- package/esm5/lib/components/forms/password-input/password-input.component.js +1 -1
- package/esm5/lib/components/forms/password-input/password-input.component.js.map +1 -1
- package/esm5/lib/components/forms/select-input/select-input.component.js +3 -3
- package/esm5/lib/components/forms/select-input/select-input.component.js.map +1 -1
- package/esm5/lib/components/forms/string-input/string-input.component.js.map +1 -1
- package/esm5/lib/components/forms/text-input/text-input.component.js.map +1 -1
- package/esm5/lib/components/table/cell-editors.js.map +1 -1
- package/esm5/lib/components/table/column-model.js.map +1 -1
- package/esm5/lib/components/table/edit-row-controls/edit-row-controls.component.js.map +1 -1
- package/esm5/lib/components/table/edit-session.js.map +1 -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 +4 -4
- package/esm5/lib/components/table/table-model.js.map +1 -1
- package/esm5/lib/components/table/table.component.js +3 -2
- package/esm5/lib/components/table/table.component.js.map +1 -1
- package/esm5/lib/components/table/table.component.scss.ngstyle.js.map +1 -0
- package/esm5/lib/interaction/components/input-activities/abstract-input-activity.js +2 -2
- package/esm5/lib/interaction/components/input-activities/abstract-input-activity.js.map +1 -1
- package/esm5/lib/interaction/components/input-activities/input-activity-data.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +24 -17
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +24 -17
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/forms/abstract-list-input.component.d.ts +3 -3
- package/lib/components/forms/abstract-value-input.component.d.ts +4 -3
- package/lib/components/forms/checkbox-input/checkbox-input.component.d.ts +2 -2
- package/lib/components/forms/multiple-select-input/multiple-select-input.component.d.ts +2 -2
- package/lib/components/forms/number-input/number-input.component.d.ts +2 -2
- package/lib/components/forms/password-input/password-input.component.d.ts +2 -2
- package/lib/components/forms/select-input/select-input.component.d.ts +2 -2
- package/lib/components/forms/string-input/string-input.component.d.ts +2 -2
- package/lib/components/forms/text-input/text-input.component.d.ts +2 -2
- package/lib/components/table/cell-editors.d.ts +3 -3
- package/lib/components/table/column-model.d.ts +2 -2
- package/lib/components/table/edit-row-controls/edit-row-controls.component.d.ts +2 -2
- package/lib/components/table/edit-session.d.ts +4 -4
- package/lib/components/table/table-model.d.ts +5 -5
- package/lib/interaction/components/input-activities/abstract-input-activity.d.ts +2 -2
- package/lib/interaction/components/input-activities/input-activity-data.d.ts +2 -2
- package/package.json +1 -1
- package/esm2015/lib/components/table/table.component.scss.shim.ngstyle.js.map +0 -1
- package/esm5/lib/components/table/table.component.scss.shim.ngstyle.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __extends, __decorate, __metadata, __param, __assign, __awaiter, __generator, __spread } from 'tslib';
|
|
2
2
|
import { DOCUMENT, CommonModule, Location } from '@angular/common';
|
|
3
|
-
import { ElementRef, Inject, Input, HostListener, Directive, NgZone, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule, ContentChild, TemplateRef, Component, Self, HostBinding, EventEmitter, Output, ChangeDetectorRef, ContentChildren, QueryList, ViewContainerRef, InjectionToken, Injector, ComponentFactoryResolver, ViewChild, ViewChildren, Optional, SkipSelf } from '@angular/core';
|
|
3
|
+
import { ElementRef, Inject, Input, HostListener, Directive, NgZone, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule, ContentChild, TemplateRef, Component, Self, HostBinding, EventEmitter, Output, ChangeDetectorRef, ContentChildren, QueryList, ViewEncapsulation, ViewContainerRef, InjectionToken, Injector, ComponentFactoryResolver, ViewChild, ViewChildren, Optional, 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';
|
|
@@ -13,7 +13,7 @@ import { MatButtonModule } from '@angular/material/button';
|
|
|
13
13
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
14
14
|
import { MatIconModule } from '@angular/material/icon';
|
|
15
15
|
import { MatTableModule } from '@angular/material/table';
|
|
16
|
-
import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, TrackExternal, Command, FocusManager,
|
|
16
|
+
import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, TrackExternal, Command, FocusManager, Form, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MutableValueModel, MultipleSelectionModel, MutableListModel, DirtyTrackingForm, DelegatingCommand, Deferred, Trace, Guard, DebugContext, Binding, Functions } from '@coolon/pectin';
|
|
17
17
|
import { assert as assert$1, Opts, lang as lang$1, Klass } from '@coolon/typescript-utilities';
|
|
18
18
|
import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
19
19
|
import ___default, { isEqual, isNil } from 'lodash';
|
|
@@ -688,14 +688,14 @@ var AbstractListInputComponent = /** @class */ (function (_super) {
|
|
|
688
688
|
* A backing model for all our @Input() valueModel properties which should be defined as follows.
|
|
689
689
|
*
|
|
690
690
|
* @Input() @TrackExternal({useExisting: "inputModel"})
|
|
691
|
-
* valueModel:
|
|
691
|
+
* valueModel: Form.ListModelBase<string> | IMutableListModel<string>;
|
|
692
692
|
*
|
|
693
693
|
* This approach allows the input to accept plain or form models but all backed by a form
|
|
694
694
|
* friendly delegate. We have to use an existing delegate for union types as pectin just
|
|
695
695
|
* gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
|
|
696
696
|
*/
|
|
697
697
|
// We have to register it as a disposable so it ditches any listeners when we're disposed.
|
|
698
|
-
_this.inputModel = _this.registerDisposable(new
|
|
698
|
+
_this.inputModel = _this.registerDisposable(new Form.DelegatingListModel());
|
|
699
699
|
return _this;
|
|
700
700
|
}
|
|
701
701
|
AbstractListInputComponent = __decorate([
|
|
@@ -707,23 +707,29 @@ var AbstractListInputComponent = /** @class */ (function (_super) {
|
|
|
707
707
|
var AbstractValueInputComponent = /** @class */ (function (_super) {
|
|
708
708
|
__extends(AbstractValueInputComponent, _super);
|
|
709
709
|
function AbstractValueInputComponent() {
|
|
710
|
-
var _this = _super
|
|
710
|
+
var _this = _super.call(this) || this;
|
|
711
711
|
/**
|
|
712
712
|
* A backing model for all our @Input() valueModel properties which should be defined as follows.
|
|
713
713
|
*
|
|
714
714
|
* @Input() @TrackExternal({useExisting: "inputModel"})
|
|
715
|
-
* valueModel:
|
|
715
|
+
* valueModel: DirtyTrackingForm.ValueModel<string> | IMutableValueModel<string>;
|
|
716
716
|
*
|
|
717
717
|
* This approach allows the input to accept plain or form models but all backed by a form
|
|
718
718
|
* friendly delegate. We have to use an existing delegate for union types as pectin just
|
|
719
719
|
* gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
|
|
720
720
|
*/
|
|
721
721
|
// We have to register it as a disposable so it ditches any listeners when we're disposed.
|
|
722
|
-
_this.inputModel = _this.registerDisposable(new
|
|
722
|
+
_this.inputModel = _this.registerDisposable(new Form.DelegatingValueModel());
|
|
723
|
+
_this.inputModel.onTransactionStart(function (tx) {
|
|
724
|
+
tx.onRootTransactionFinalised(function () {
|
|
725
|
+
console.log({ changed: tx.hasChanged() });
|
|
726
|
+
});
|
|
727
|
+
});
|
|
723
728
|
return _this;
|
|
724
729
|
}
|
|
725
730
|
AbstractValueInputComponent = __decorate([
|
|
726
|
-
Component({ template: '' })
|
|
731
|
+
Component({ template: '' }),
|
|
732
|
+
__metadata("design:paramtypes", [])
|
|
727
733
|
], AbstractValueInputComponent);
|
|
728
734
|
return AbstractValueInputComponent;
|
|
729
735
|
}(AbstractInputComponent));
|
|
@@ -802,7 +808,7 @@ var PasswordInputComponent = /** @class */ (function (_super) {
|
|
|
802
808
|
PasswordInputComponent.prototype.ngOnInit = function () {
|
|
803
809
|
};
|
|
804
810
|
__decorate([
|
|
805
|
-
Input(), TrackExternal({ delegateTo:
|
|
811
|
+
Input(), TrackExternal({ delegateTo: 'inputModel' }),
|
|
806
812
|
__metadata("design:type", Object)
|
|
807
813
|
], PasswordInputComponent.prototype, "valueModel", void 0);
|
|
808
814
|
PasswordInputComponent = __decorate([
|
|
@@ -826,7 +832,7 @@ var SelectInputComponent = /** @class */ (function (_super) {
|
|
|
826
832
|
SelectInputComponent.prototype.ngOnInit = function () {
|
|
827
833
|
};
|
|
828
834
|
__decorate([
|
|
829
|
-
Input(), TrackExternal({ delegateTo:
|
|
835
|
+
Input(), TrackExternal({ delegateTo: 'inputModel' }),
|
|
830
836
|
__metadata("design:type", Object)
|
|
831
837
|
], SelectInputComponent.prototype, "valueModel", void 0);
|
|
832
838
|
__decorate([
|
|
@@ -846,11 +852,11 @@ var SelectInputComponent = /** @class */ (function (_super) {
|
|
|
846
852
|
__metadata("design:type", Boolean)
|
|
847
853
|
], SelectInputComponent.prototype, "allowNil", void 0);
|
|
848
854
|
__decorate([
|
|
849
|
-
ContentChild(
|
|
855
|
+
ContentChild('optionTemplate'),
|
|
850
856
|
__metadata("design:type", TemplateRef)
|
|
851
857
|
], SelectInputComponent.prototype, "optionTemplateRef", void 0);
|
|
852
858
|
__decorate([
|
|
853
|
-
ContentChild(
|
|
859
|
+
ContentChild('nilOptionTemplate'),
|
|
854
860
|
__metadata("design:type", TemplateRef)
|
|
855
861
|
], SelectInputComponent.prototype, "nilOptionTemplateRef", void 0);
|
|
856
862
|
__decorate([
|
|
@@ -1706,7 +1712,7 @@ var RowClass = /** @class */ (function () {
|
|
|
1706
1712
|
* }
|
|
1707
1713
|
* const colorsNames: ListModel<string> = ...;
|
|
1708
1714
|
* const model = TableModel.fromList(heroList, table => {
|
|
1709
|
-
* table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel:
|
|
1715
|
+
* table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
|
|
1710
1716
|
* table.pluck("lastName").cellEditor(StringInputComponent, {
|
|
1711
1717
|
* validators: [Validator.present("We need a last name")]
|
|
1712
1718
|
* });
|
|
@@ -1735,7 +1741,7 @@ var RowClass = /** @class */ (function () {
|
|
|
1735
1741
|
* // configure your component with what ever you need.
|
|
1736
1742
|
* });
|
|
1737
1743
|
* .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }
|
|
1738
|
-
* .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel:
|
|
1744
|
+
* .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
|
|
1739
1745
|
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
1740
1746
|
* });
|
|
1741
1747
|
*
|
|
@@ -1764,7 +1770,7 @@ var TableModel = /** @class */ (function () {
|
|
|
1764
1770
|
this._columns = new MutableListModel();
|
|
1765
1771
|
this._editorSessions = new MutableListModel();
|
|
1766
1772
|
this.rowClassNamePredicates = [];
|
|
1767
|
-
this._createForm = function (row) { return new
|
|
1773
|
+
this._createForm = function (row) { return new DirtyTrackingForm(); };
|
|
1768
1774
|
this.identityOf = sourceOfTruth.identityOf;
|
|
1769
1775
|
var _a = Dsl.disposeWith(this._garbage), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
1770
1776
|
this._columnsById = chain(this._columns).indexBy('columnId');
|
|
@@ -1973,7 +1979,8 @@ var TableComponent = /** @class */ (function (_super) {
|
|
|
1973
1979
|
TableComponent = __decorate([
|
|
1974
1980
|
Component({
|
|
1975
1981
|
selector: 'aup-table',
|
|
1976
|
-
template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.getTrackByFunction()\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"onCellClicked(column, row)\" [class.enable-cursor]=\"tableModel.isRowSelectionEnabledFor(column)\">\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\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;\"\n [ngClass]=\"tableModel.getRowClasses(row)\"\n ></tr>\n\n</table>\n",
|
|
1982
|
+
template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.getTrackByFunction()\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"onCellClicked(column, row)\" [class.enable-cursor]=\"tableModel.isRowSelectionEnabledFor(column)\">\n <aup-table-cell-renderer [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.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\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;\"\n [ngClass]=\"tableModel.getRowClasses(row)\"\n ></tr>\n\n</table>\n",
|
|
1983
|
+
encapsulation: ViewEncapsulation.None,
|
|
1977
1984
|
styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{flex:1}"]
|
|
1978
1985
|
}),
|
|
1979
1986
|
__metadata("design:paramtypes", [])
|
|
@@ -3571,7 +3578,7 @@ var AbstractInputActivity = /** @class */ (function (_super) {
|
|
|
3571
3578
|
var _this = _super.call(this) || this;
|
|
3572
3579
|
_this.data = data;
|
|
3573
3580
|
_this.class = 'aup-input-activity';
|
|
3574
|
-
var form = new
|
|
3581
|
+
var form = new DirtyTrackingForm();
|
|
3575
3582
|
_this.valueModel = form.valueModel(_this.data.initialValue);
|
|
3576
3583
|
_this.valueModel.validateUsing(data.validators || []);
|
|
3577
3584
|
_this.confirmCommand = Command.create(function () {
|