@coolon/angular-ui-powerups 12.4.0-alpha.69 → 12.4.0-alpha.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/coolon-angular-ui-powerups.umd.js +60 -36
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/components/exports.js +1 -1
- package/esm2015/lib/components/exports.js.map +1 -1
- package/esm2015/lib/components/exports.metadata.json +1 -1
- package/esm2015/lib/components/tables/abstract-table-model.js +21 -17
- package/esm2015/lib/components/tables/abstract-table-model.js.map +1 -1
- package/esm2015/lib/components/tables/edit-session.js.map +1 -0
- package/esm2015/lib/components/tables/{table/edit-session.metadata.json → edit-session.metadata.json} +1 -1
- package/esm2015/lib/components/tables/table/cell-portal-ref.js.map +1 -1
- package/esm2015/lib/components/tables/table/column-model.js +1 -1
- package/esm2015/lib/components/tables/table/column-model.js.map +1 -1
- package/esm2015/lib/components/tables/table/column-model.metadata.json +1 -1
- package/esm2015/lib/components/tables/table/edit-row-controls/edit-row-controls.component.js +18 -11
- package/esm2015/lib/components/tables/table/edit-row-controls/edit-row-controls.component.js.map +1 -1
- package/esm2015/lib/components/tables/table/edit-row-controls/edit-row-controls.component.metadata.json +1 -1
- package/esm2015/lib/components/tables/table/table-cell-renderer/table-cell-renderer.component.js +1 -1
- package/esm2015/lib/components/tables/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
- package/esm2015/lib/components/tables/table/table.component.js +13 -12
- package/esm2015/lib/components/tables/table/table.component.js.map +1 -1
- package/esm2015/lib/components/tables/table/table.component.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +50 -38
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/exports.d.ts +1 -1
- package/lib/components/tables/abstract-table-model.d.ts +4 -4
- package/lib/components/tables/{table/edit-session.d.ts → edit-session.d.ts} +3 -3
- package/lib/components/tables/table/cell-portal-ref.d.ts +1 -1
- package/lib/components/tables/table/column-model.d.ts +3 -3
- package/lib/components/tables/table/edit-row-controls/edit-row-controls.component.d.ts +4 -2
- package/lib/components/tables/table/table-cell-renderer/table-cell-renderer.component.d.ts +1 -1
- package/lib/components/tables/table/table.component.d.ts +13 -12
- package/package.json +1 -1
- package/esm2015/lib/components/tables/table/edit-session.js.map +0 -1
- /package/esm2015/lib/components/tables/{table/edit-session.js → edit-session.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"EditRowControls":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../disposable-component","name":"DisposableComponent","line":11,"character":42},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"aup-row-editor-controls","template":"<button *ngIf=\"!editSession\" mat-icon-button [pectinCommand]=\"editRowCommand\" class=\"edit-button\"><aup-icon icon=\"mat:edit\"></aup-icon></button>\n<button *ngIf=\"editSession\" mat-icon-button [pectinCommand]=\"saveCommand\"><aup-icon icon=\"mat:done\"></aup-icon></button>\n<button *ngIf=\"editSession\" mat-icon-button [pectinCommand]=\"cancelCommand\"><aup-icon icon=\"mat:clear\"></aup-icon></button>\n","styles":[":host{display:block;width:80px}.edit-button{visibility:hidden}:host-context(tr:hover) .edit-button{visibility:visible}\n"]}]}],"members":{"row":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"editRowCommand":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":17,"character":3}}]}],"editSession":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"EditRowControls":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../disposable-component","name":"DisposableComponent","line":11,"character":42},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"aup-row-editor-controls","template":"<button *ngIf=\"!editSession\" mat-icon-button [pectinCommand]=\"editRowCommand\" class=\"edit-button\"><aup-icon icon=\"mat:edit\"></aup-icon></button>\n<button *ngIf=\"editSession\" mat-icon-button [pectinCommand]=\"saveCommand\"><aup-icon icon=\"mat:done\"></aup-icon></button>\n<button *ngIf=\"editSession\" mat-icon-button [pectinCommand]=\"cancelCommand\"><aup-icon icon=\"mat:clear\"></aup-icon></button>\n","styles":[":host{display:block;width:80px}.edit-button{visibility:hidden}:host-context(tr:hover) .edit-button{visibility:visible}\n"]}]}],"members":{"row":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"editRowCommand":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":17,"character":3}}]}],"editSession":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":22,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}]}}}}]
|
package/esm2015/lib/components/tables/table/table-cell-renderer/table-cell-renderer.component.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Command, Dsl } from '@coolon/pectin';
|
|
|
3
3
|
import { DisposableComponent } from '../../../disposable-component';
|
|
4
4
|
import { AbstractTableModel } from '../../abstract-table-model';
|
|
5
5
|
import { ColumnModel } from '../column-model';
|
|
6
|
-
import { EditSession } from '
|
|
6
|
+
import { EditSession } from '../../edit-session';
|
|
7
7
|
import { CELL_RENDERER_PORTAL, CELL_EDITOR_PORTAL } from '../cell-portal-ref';
|
|
8
8
|
export class TableCellRendererComponent extends DisposableComponent {
|
|
9
9
|
constructor() {
|
package/esm2015/lib/components/tables/table/table-cell-renderer/table-cell-renderer.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-cell-renderer.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/table/table-cell-renderer/table-cell-renderer.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAoC,MAAM,eAAe,CAAC;AAChG,OAAO,EAA0B,OAAO,EAAE,GAAG,EAA0B,MAAM,gBAAgB,CAAC;AAE9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAW,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"table-cell-renderer.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/table/table-cell-renderer/table-cell-renderer.component.ts"],"names":[],"mappings":"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","sourcesContent":["import { Portal } from '@angular/cdk/portal';\nimport { Component, HostBinding, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';\nimport { BooleanValueModelChain, Command, Dsl, HasFocusContext, Trace } from '@coolon/pectin';\nimport { Stringy } from '@coolon/typescript-utilities';\nimport { DisposableComponent } from '../../../disposable-component';\nimport { AbstractTableModel } from '../../abstract-table-model';\nimport { CellEditorComponent, CellListEditorComponent } from '../cell-editors';\nimport { ColumnModel, RowData } from '../column-model';\nimport { EditSession } from '../../edit-session';\nimport { TableModel } from '../table-model';\nimport { CELL_RENDERER_PORTAL, CELL_EDITOR_PORTAL } from '../cell-portal-ref';\n\n@Component({\n selector: 'aup-table-cell-renderer',\n templateUrl: './table-cell-renderer.component.html',\n styleUrls: ['./table-cell-renderer.component.scss']\n})\nexport class TableCellRendererComponent<Row> extends DisposableComponent implements OnInit, OnChanges {\n\n @Input()\n row: Row;\n\n @Input()\n column: ColumnModel<Row>;\n\n @Input()\n editSession: EditSession<Row>;\n\n @Input()\n tableModel: AbstractTableModel<Row>;\n\n private editRowCommand: Command<void>;\n\n [CELL_RENDERER_PORTAL]: Portal<any>;\n [CELL_EDITOR_PORTAL]: Portal<any>;\n\n @HostBinding('class')\n defaultClassNames = 'aup-cell-renderer';\n\n @HostBinding('class.fillCell')\n fillCell = false;\n\n @HostBinding('class.padChild')\n padChild = false;\n\n private firstEditableColumn: BooleanValueModelChain;\n\n constructor() {\n super();\n this.editRowCommand = Command.create(() => {\n this.tableModel.startEditSession(this.row);\n });\n }\n\n ngOnInit(): void {\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.firstEditableColumn = chain(this.tableModel.firstEditableColumn).equals(this.column); // this would break if the column changed.\n this.column.attachCell(this);\n }\n\n hasActiveEditor(): boolean {\n return !!this.editSession && !!this.column.hasEditorPortal();\n }\n\n initialiseRenderer(instance: any) {\n this.column.onRendererAttached(this, instance);\n }\n\n initialiseEditor(instance: CellEditorComponent<Row> | CellListEditorComponent<Row>) {\n this.column.onEditorAttached(this, instance);\n if (this.firstEditableColumn.value) {\n // @see https://github.com/angular/components/issues/12070\n setTimeout(() => this.tryAndFocusEditor(instance));\n }\n }\n\n private tryAndFocusEditor(editor: CellEditorComponent<Row> | CellListEditorComponent<Row>) {\n if (editor.requestFocus) {\n editor.requestFocus();\n } else {\n const model = (editor['valueModel'] || editor['listModel']) as HasFocusContext;\n model?.focusContext?.requestFocus();\n }\n }\n\n // @Trace()\n ngOnChanges(changes: SimpleChanges): void {\n this.column.updatePortalContent(this);\n }\n\n getRendererPortal() {\n return this[CELL_RENDERER_PORTAL];\n }\n\n getEditorPortal() {\n return this[CELL_EDITOR_PORTAL];\n }\n\n getRowData(): RowData<Row> {\n return {\n row: this.row,\n editSession: this.editSession,\n editRowCommand: this.editRowCommand\n };\n }\n}\n"]}
|
|
@@ -47,18 +47,19 @@ import { AbstractTableComponent } from '../abstract-table.component';
|
|
|
47
47
|
* --row-selected-background-color: rebeccapurple; // defaults to transparent
|
|
48
48
|
* --first-column-padding-left: 18px // defaults to --column-gap
|
|
49
49
|
* --last-column-padding-right: 18px // defaults to --column-gap
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
50
|
+
* ::ng-deep {
|
|
51
|
+
* aup-table-header-cell-renderer,
|
|
52
|
+
* aup-table-cell-renderer {
|
|
53
|
+
* &.aup-col-my-dasherised-column-id {
|
|
54
|
+
* // do stuff
|
|
55
|
+
* }
|
|
56
|
+
* &.first-visible-column {
|
|
57
|
+
* // do stuff
|
|
58
|
+
* }
|
|
59
|
+
* &.last-visible-column {
|
|
60
|
+
* // do stuff
|
|
61
|
+
* }
|
|
62
|
+
* }
|
|
62
63
|
* }
|
|
63
64
|
* }
|
|
64
65
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/table/table.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE
|
|
1
|
+
{"version":3,"file":"table.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/table/table.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AASH,MAAM,OAAO,cAAoB,SAAQ,sBAA2B;IAMlE,YAAY,UAAsB,EAAE,MAAc;QAChD,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;;;YApBF,SAAS,SAAC;gBACT,QAAQ,EAAE,WAAW;gBACrB,k4DAAsC;gBAEtC,SAAS,EAAE;oBACT,EAAC,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,cAAc,EAAC;iBAC/D;;aACF;;;YAxEmB,UAAU;YAAS,MAAM;;;yBA2E1C,KAAK;;AAEN;IADC,aAAa,EAAE;8BACJ,kBAAkB;kDAAM","sourcesContent":["import { Component, ElementRef, Input, NgZone } from '@angular/core';\nimport { TrackExternal } from '@coolon/pectin';\nimport { AbstractTableModel } from '../abstract-table-model';\nimport { AbstractTableComponent } from '../abstract-table.component';\n\n/**\n * Create your model:\n * @example\n * this.heroTableModel = TableModel.fromList(heroList, table => {\n * table.pluck(\"firstName\");\n * table.pluck(\"lastName\");\n * table.addCustomColumn(\"fullName\", hero => `${hero.firstName} ${hero.lastName}`);\n * });\n *\n * Create your table\n * @example\n * <aup-table [tableModel]=\"heroTableModel\"></aup-table>\n *\n * Column templates\n * @example\n * this.heroTableModel = TableModel.fromList(heroList, table => {\n * table.pluck(\"firstName\");\n * table.pluck(\"lastName\");\n * table.addTemplateColumn(\"specialColumn\");\n * });\n * <aup-table [tableModel]=\"heroTableModel\">\n * <div *aupColumnTemplate=\"let hero; columnId: 'specialColumn'; fillCell: true; padChild:false\">\n * {{hero.name}}\n * </div>\n * </aup-table>\n *\n * Styling\n * @example\n * // global settings\n * :root {\n * --aup-table-column-gap: 10px; // defaults to 24px\n * --aup-table-row-hover-background-color, rgba(0, 0, 0, 0.05)\n * --aup-table-row-selected-background-color: rebeccapurple; // defaults to transparent\n * --aup-table-first-column-padding-left: 18px // defaults to --column-gap\n * --aup-table-last-column-padding-right: 18px // defaults to --column-gap\n * }\n *\n * // per table settings.\n * aup-table {\n * --column-gap: 10px; // defaults to 24px\n * --row-hover-background-color, rgba(0, 0, 0, 0.05)\n * --row-selected-background-color: rebeccapurple; // defaults to transparent\n * --first-column-padding-left: 18px // defaults to --column-gap\n * --last-column-padding-right: 18px // defaults to --column-gap\n * ::ng-deep {\n * aup-table-header-cell-renderer,\n * aup-table-cell-renderer {\n * &.aup-col-my-dasherised-column-id {\n * // do stuff\n * }\n * &.first-visible-column {\n * // do stuff\n * }\n * &.last-visible-column {\n * // do stuff\n * }\n * }\n * }\n * }\n */\n@Component({\n selector: 'aup-table',\n templateUrl: '../table.component.html',\n styleUrls: ['../table.component.scss'],\n providers: [\n {provide: AbstractTableComponent, useExisting: TableComponent}\n ]\n})\nexport class TableComponent<Row> extends AbstractTableComponent<Row> {\n\n @Input()\n @TrackExternal()\n tableModel: AbstractTableModel<Row>;\n\n constructor(elementRef: ElementRef, ngZone: NgZone) {\n super(elementRef, ngZone);\n }\n\n getModel(): AbstractTableModel<Row> {\n return this.tableModel;\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"TableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-table.component","name":"AbstractTableComponent","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"TableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-table.component","name":"AbstractTableComponent","line":73,"character":41},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":65,"character":1},"arguments":[{"selector":"aup-table","providers":[{"provide":{"__symbolic":"reference","module":"../abstract-table.component","name":"AbstractTableComponent","line":70,"character":14},"useExisting":{"__symbolic":"reference","name":"TableComponent"}}],"template":"<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\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; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.aup-row-id]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n","styles":[":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}\n"]}]}],"members":{"tableModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":75,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":76,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":79,"character":26},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":79,"character":46}]}],"getModel":[{"__symbolic":"method"}]}}}}]
|
|
@@ -2367,17 +2367,24 @@ class EditSession extends GarbageCollector {
|
|
|
2367
2367
|
class EditRowControls extends DisposableComponent {
|
|
2368
2368
|
constructor() {
|
|
2369
2369
|
super();
|
|
2370
|
-
this.saveCommand = Command.create(() => {
|
|
2371
|
-
this.editSession.saveCommand.execute(
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
});
|
|
2377
|
-
});
|
|
2370
|
+
this.saveCommand = Command.create(() => __awaiter(this, void 0, void 0, function* () {
|
|
2371
|
+
const finished = yield this.editSession.saveCommand.execute();
|
|
2372
|
+
if (finished) {
|
|
2373
|
+
this.editSession.dispose();
|
|
2374
|
+
}
|
|
2375
|
+
}));
|
|
2378
2376
|
this.cancelCommand = Command.create(() => {
|
|
2379
2377
|
this.editSession.dispose();
|
|
2380
|
-
});
|
|
2378
|
+
}).disableWhile(this.saveCommand.busy);
|
|
2379
|
+
}
|
|
2380
|
+
set editSession(session) {
|
|
2381
|
+
if (session) {
|
|
2382
|
+
session.form.disableWhile(this.saveCommand.busy);
|
|
2383
|
+
}
|
|
2384
|
+
this._session = session;
|
|
2385
|
+
}
|
|
2386
|
+
get editSession() {
|
|
2387
|
+
return this._session;
|
|
2381
2388
|
}
|
|
2382
2389
|
ngOnInit() {
|
|
2383
2390
|
}
|
|
@@ -2753,7 +2760,7 @@ class CustomValueColumnModel extends ColumnModel {
|
|
|
2753
2760
|
}
|
|
2754
2761
|
}
|
|
2755
2762
|
class EditorControlColumnModel extends ColumnModel {
|
|
2756
|
-
constructor(columnId,
|
|
2763
|
+
constructor(columnId, saveCommandFactory, defaults) {
|
|
2757
2764
|
super(columnId, defaults);
|
|
2758
2765
|
this.cellRenderer(EditRowControls);
|
|
2759
2766
|
}
|
|
@@ -3112,10 +3119,13 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3112
3119
|
}
|
|
3113
3120
|
return selectionColumnModel;
|
|
3114
3121
|
}
|
|
3115
|
-
addEditControls(
|
|
3116
|
-
this.
|
|
3122
|
+
addEditControls(saveCommandFactory, formFactory) {
|
|
3123
|
+
this.saveCommandFactory = saveCommandFactory;
|
|
3124
|
+
if (_.isFunction(formFactory)) {
|
|
3125
|
+
this._createForm = formFactory;
|
|
3126
|
+
}
|
|
3117
3127
|
const columnId = 'editControls';
|
|
3118
|
-
return this.addColumn(new EditorControlColumnModel(columnId,
|
|
3128
|
+
return this.addColumn(new EditorControlColumnModel(columnId, saveCommandFactory, () => this.getColumnTextProperties(columnId)));
|
|
3119
3129
|
}
|
|
3120
3130
|
addCustomColumn(columnId, dataAccessor) {
|
|
3121
3131
|
return this.addColumn(new CustomValueColumnModel(columnId, () => this.getColumnTextProperties(columnId), dataAccessor));
|
|
@@ -3159,19 +3169,20 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3159
3169
|
if (this._rowsBeingEdited.query().indexOf(row) > -1) {
|
|
3160
3170
|
return lang.illegalState(`Row with id=${rowId} already being edited`);
|
|
3161
3171
|
}
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
this.
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
}
|
|
3172
|
+
// todo: pass the factories to the edit session so we can make the whole lot pluggable?
|
|
3173
|
+
const form = this._createForm(row);
|
|
3174
|
+
const saveCommand = this.saveCommandFactory.create(form);
|
|
3175
|
+
const editSession = new EditSession(rowId, row, form, saveCommand);
|
|
3176
|
+
const { when } = Dsl.disposeWith(editSession);
|
|
3177
|
+
when(editSession.liveRowValue).changes((editedValue) => {
|
|
3178
|
+
this._rowsBeingEdited.replaceOrPush(editedValue);
|
|
3179
|
+
}, { initialValue: 'triggerChangeUnlessNil' });
|
|
3180
|
+
this._editorSessions.push(editSession);
|
|
3181
|
+
editSession.onDispose(() => {
|
|
3182
|
+
this._rowsBeingEdited.remove(editSession.liveRowValue.value);
|
|
3183
|
+
this._editorSessions.remove(editSession);
|
|
3184
|
+
});
|
|
3185
|
+
return editSession;
|
|
3175
3186
|
}
|
|
3176
3187
|
getEditSessionFor(row) {
|
|
3177
3188
|
return this._editorSessionByRowId.get(this.identityOf(row));
|
|
@@ -3426,18 +3437,19 @@ TableRowMenuComponent.propDecorators = {
|
|
|
3426
3437
|
* --row-selected-background-color: rebeccapurple; // defaults to transparent
|
|
3427
3438
|
* --first-column-padding-left: 18px // defaults to --column-gap
|
|
3428
3439
|
* --last-column-padding-right: 18px // defaults to --column-gap
|
|
3429
|
-
*
|
|
3430
|
-
*
|
|
3431
|
-
*
|
|
3432
|
-
*
|
|
3433
|
-
*
|
|
3434
|
-
*
|
|
3435
|
-
*
|
|
3436
|
-
*
|
|
3437
|
-
*
|
|
3438
|
-
*
|
|
3439
|
-
*
|
|
3440
|
-
*
|
|
3440
|
+
* ::ng-deep {
|
|
3441
|
+
* aup-table-header-cell-renderer,
|
|
3442
|
+
* aup-table-cell-renderer {
|
|
3443
|
+
* &.aup-col-my-dasherised-column-id {
|
|
3444
|
+
* // do stuff
|
|
3445
|
+
* }
|
|
3446
|
+
* &.first-visible-column {
|
|
3447
|
+
* // do stuff
|
|
3448
|
+
* }
|
|
3449
|
+
* &.last-visible-column {
|
|
3450
|
+
* // do stuff
|
|
3451
|
+
* }
|
|
3452
|
+
* }
|
|
3441
3453
|
* }
|
|
3442
3454
|
* }
|
|
3443
3455
|
*/
|