@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
|
@@ -47,12 +47,12 @@ export * from "./switch-case/switch-case.component";
|
|
|
47
47
|
export * from "./tables/abstract-table-model";
|
|
48
48
|
export * from "./tables/abstract-table.component";
|
|
49
49
|
export * from "./tables/column-list-model";
|
|
50
|
+
export * from "./tables/edit-session";
|
|
50
51
|
export * from "./tables/table/cell-editors";
|
|
51
52
|
export * from "./tables/table/cell-portal-ref";
|
|
52
53
|
export * from "./tables/table/cell-renderer";
|
|
53
54
|
export * from "./tables/table/column-model";
|
|
54
55
|
export * from "./tables/table/column-text-properties";
|
|
55
|
-
export * from "./tables/table/edit-session";
|
|
56
56
|
export * from "./tables/table/mutable-cell-renderer";
|
|
57
57
|
export * from "./tables/table/table-def";
|
|
58
58
|
export * from "./tables/table/table-model";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComponentType } from '@angular/cdk/overlay';
|
|
2
|
-
import { BooleanValueModelChain, DirtyTrackingForm, Disposable, GarbageCollector, ListModel, ListModelChain, SelectionModel, Types,
|
|
2
|
+
import { BooleanValueModelChain, Command, DirtyTrackingForm, Disposable, GarbageCollector, ListModel, ListModelChain, SelectionModel, Types, ValueModel, ValueModelChain } from '@coolon/pectin';
|
|
3
|
+
import { EditSession } from './edit-session';
|
|
3
4
|
import { CellRenderer } from './table/cell-renderer';
|
|
4
5
|
import { CellRendererOptions, ColumnModel, CustomTemplateColumnModel, CustomValueColumnModel, EditorControlColumnModel, ListPropertyColumnModel, OnComponentInit, PropertyColumnModel, SelectionColumnModel } from './table/column-model';
|
|
5
6
|
import { ColumnTextProperties } from './table/column-text-properties';
|
|
6
|
-
import { EditSession } from './table/edit-session';
|
|
7
7
|
export declare class AbstractTableModel<Row> extends GarbageCollector {
|
|
8
8
|
private readonly _dataSource;
|
|
9
9
|
readonly dataSource: ListModelChain<Row>;
|
|
@@ -12,7 +12,7 @@ export declare class AbstractTableModel<Row> extends GarbageCollector {
|
|
|
12
12
|
private readonly _rowsBeingEdited;
|
|
13
13
|
private readonly rowClassNamePredicates;
|
|
14
14
|
private _columnTextPropertiesLookup;
|
|
15
|
-
private
|
|
15
|
+
private saveCommandFactory;
|
|
16
16
|
private _editorSessionByRowId;
|
|
17
17
|
readonly editing: BooleanValueModelChain;
|
|
18
18
|
readonly firstEditableColumn: ValueModelChain<ColumnModel<Row>>;
|
|
@@ -38,7 +38,7 @@ export declare class AbstractTableModel<Row> extends GarbageCollector {
|
|
|
38
38
|
columnId: string;
|
|
39
39
|
}): ListPropertyColumnModel<Row, P>;
|
|
40
40
|
protected _addSelectionColumn(selectionModel?: SelectionModel<Row>, visible?: ValueModel<boolean> | boolean): SelectionColumnModel<Row>;
|
|
41
|
-
addEditControls(
|
|
41
|
+
addEditControls(saveCommandFactory: Command.Factory<DirtyTrackingForm<Row>, boolean | Promise<boolean>>, formFactory?: (row: Row) => DirtyTrackingForm<Row>): EditorControlColumnModel<Row>;
|
|
42
42
|
addCustomColumn<V>(columnId: string, dataAccessor: (row: Row) => V): CustomValueColumnModel<Row, V>;
|
|
43
43
|
addComponentColumn<C extends CellRenderer<Partial<Row>>>(columnId: string, component: ComponentType<C>, onInit?: OnComponentInit<C>): CustomValueColumnModel<Row, Row>;
|
|
44
44
|
addComponentColumn<C extends CellRenderer<Partial<Row>>>(columnId: string, component: ComponentType<C>, options?: CellRendererOptions<Row, C>): CustomValueColumnModel<Row, Row>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DirtyTrackingForm, GarbageCollector
|
|
1
|
+
import { Command, DirtyTrackingForm, GarbageCollector } from '@coolon/pectin';
|
|
2
2
|
export declare class EditSession<Row> extends GarbageCollector {
|
|
3
3
|
readonly rowId: any;
|
|
4
4
|
readonly form: DirtyTrackingForm<Row>;
|
|
5
|
-
readonly saveCommand:
|
|
5
|
+
readonly saveCommand: Command<boolean | Promise<boolean>>;
|
|
6
6
|
private _liveRowValue;
|
|
7
7
|
readonly liveRowValue: import("@coolon/pectin").ValueModel<Row>;
|
|
8
|
-
constructor(rowId: any, row: Row, form: DirtyTrackingForm<Row>, saveCommand:
|
|
8
|
+
constructor(rowId: any, row: Row, form: DirtyTrackingForm<Row>, saveCommand: Command<boolean | Promise<boolean>>);
|
|
9
9
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentType } from '@angular/cdk/overlay';
|
|
2
2
|
import { TemplateRef, ViewContainerRef } from '@angular/core';
|
|
3
3
|
import { ColumnModel, RowData } from './column-model';
|
|
4
|
-
import { EditSession } from '
|
|
4
|
+
import { EditSession } from '../edit-session';
|
|
5
5
|
import { TableCellRendererComponent } from './table-cell-renderer/table-cell-renderer.component';
|
|
6
6
|
import { TableHeaderCellRendererComponent } from './table-header-cell-renderer/table-header-cell-renderer.component';
|
|
7
7
|
export declare const HEADER_CELL_RENDERER_PORTAL: unique symbol;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ComponentType } from '@angular/cdk/overlay';
|
|
2
2
|
import { TemplateRef, ViewContainerRef } from '@angular/core';
|
|
3
|
-
import { Command, DelegatingSelectionModel, DirtyTrackingForm, GarbageCollector, SelectionModel, Types,
|
|
3
|
+
import { Command, DelegatingSelectionModel, DirtyTrackingForm, GarbageCollector, SelectionModel, Types, Validator, ValueModel } from '@coolon/pectin';
|
|
4
4
|
import { CellEditorComponent, CellListEditorComponent } from './cell-editors';
|
|
5
5
|
import { CellEditorPortalRef, CellHeaderPortalRef, CellRendererPortalRef } from './cell-portal-ref';
|
|
6
6
|
import { CellRenderer } from './cell-renderer';
|
|
7
7
|
import { ColumnTextProperties } from './column-text-properties';
|
|
8
|
-
import { EditSession } from '
|
|
8
|
+
import { EditSession } from '../edit-session';
|
|
9
9
|
import { MutableCellRenderer } from './mutable-cell-renderer';
|
|
10
10
|
import { TableCellRendererComponent } from './table-cell-renderer/table-cell-renderer.component';
|
|
11
11
|
import { TableHeaderCellRendererComponent } from './table-header-cell-renderer/table-header-cell-renderer.component';
|
|
@@ -116,7 +116,7 @@ export declare class CustomValueColumnModel<Row, V> extends ColumnModel<Row> {
|
|
|
116
116
|
selectRowOnClick(selectOnRowClick: boolean): this;
|
|
117
117
|
}
|
|
118
118
|
export declare class EditorControlColumnModel<Row> extends ColumnModel<Row> {
|
|
119
|
-
constructor(columnId: string,
|
|
119
|
+
constructor(columnId: string, saveCommandFactory: Command.Factory<DirtyTrackingForm<Row>, boolean | Promise<boolean>>, defaults: ColumnModel.TextPropertiesProvider);
|
|
120
120
|
cellRenderer(componentType: ComponentType<{
|
|
121
121
|
row: Row;
|
|
122
122
|
editSession: EditSession<Row>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { Command, DirtyTrackingForm } from '@coolon/pectin';
|
|
3
3
|
import { DisposableComponent } from '../../../disposable-component';
|
|
4
|
-
import { EditSession } from '
|
|
4
|
+
import { EditSession } from '../../edit-session';
|
|
5
5
|
export declare class EditRowControls<Row> extends DisposableComponent implements OnInit {
|
|
6
6
|
row: Row;
|
|
7
7
|
editRowCommand: Command<void>;
|
|
8
|
-
|
|
8
|
+
private _session;
|
|
9
|
+
set editSession(session: EditSession<Row>);
|
|
10
|
+
get editSession(): EditSession<Row>;
|
|
9
11
|
readonly saveCommand: Command<void>;
|
|
10
12
|
readonly cancelCommand: Command<void>;
|
|
11
13
|
constructor();
|
|
@@ -4,7 +4,7 @@ import { DisposableComponent } from '../../../disposable-component';
|
|
|
4
4
|
import { AbstractTableModel } from '../../abstract-table-model';
|
|
5
5
|
import { CellEditorComponent, CellListEditorComponent } from '../cell-editors';
|
|
6
6
|
import { ColumnModel, RowData } from '../column-model';
|
|
7
|
-
import { EditSession } from '
|
|
7
|
+
import { EditSession } from '../../edit-session';
|
|
8
8
|
import { CELL_RENDERER_PORTAL, CELL_EDITOR_PORTAL } from '../cell-portal-ref';
|
|
9
9
|
export declare class TableCellRendererComponent<Row> extends DisposableComponent implements OnInit, OnChanges {
|
|
10
10
|
row: Row;
|
|
@@ -45,18 +45,19 @@ import { AbstractTableComponent } from '../abstract-table.component';
|
|
|
45
45
|
* --row-selected-background-color: rebeccapurple; // defaults to transparent
|
|
46
46
|
* --first-column-padding-left: 18px // defaults to --column-gap
|
|
47
47
|
* --last-column-padding-right: 18px // defaults to --column-gap
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
48
|
+
* ::ng-deep {
|
|
49
|
+
* aup-table-header-cell-renderer,
|
|
50
|
+
* aup-table-cell-renderer {
|
|
51
|
+
* &.aup-col-my-dasherised-column-id {
|
|
52
|
+
* // do stuff
|
|
53
|
+
* }
|
|
54
|
+
* &.first-visible-column {
|
|
55
|
+
* // do stuff
|
|
56
|
+
* }
|
|
57
|
+
* &.last-visible-column {
|
|
58
|
+
* // do stuff
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
60
61
|
* }
|
|
61
62
|
* }
|
|
62
63
|
*/
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edit-session.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/table/edit-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,gBAAgB,EAAE,iBAAiB,EAAgB,MAAM,gBAAgB,CAAC;AAE5G,OAAO,OAAsB,MAAM,OAAO,CAAC;AAE3C,MAAM,OAAO,WAAiB,SAAQ,gBAAgB;IAIpD,YAAqB,KAAU,EAAE,GAAQ,EAAW,IAA4B,EAAW,WAA0D;QACnJ,KAAK,EAAE,CAAC;QADW,UAAK,GAAL,KAAK,CAAK;QAAqB,SAAI,GAAJ,IAAI,CAAwB;QAAW,gBAAW,GAAX,WAAW,CAA+C;QAH7I,kBAAa,GAAG,IAAI,iBAAiB,EAAO,CAAC;QAC5C,iBAAY,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;QAIlD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,aAAa,CAAC,KAAK,GAAG,GAAG,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;YACpB,8CAA8C;YAC9C,mBAAmB;YACnB,IAAI;YACJ,IAAI,CAAC,aAAa,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;gBACnE,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAyB,CAAC,CAAC;YACzD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import { DirtyTrackingForm, Form, GarbageCollector, MutableValueModel, UnaryCommand } from '@coolon/pectin';\nimport { PickMutable } from '@coolon/typescript-utilities';\nimport produce, { immerable } from 'immer';\n\nexport class EditSession<Row> extends GarbageCollector {\n private _liveRowValue = new MutableValueModel<Row>();\n readonly liveRowValue = this._liveRowValue.readonly;\n\n constructor(readonly rowId: any, row: Row, readonly form: DirtyTrackingForm<Row>, readonly saveCommand: UnaryCommand<DirtyTrackingForm<Row>, boolean>) {\n super();\n this.form.load(row);\n this._liveRowValue.value = row;\n this.form.onEdit(() => {\n // if (!this._liveRowValue.value[immerable]) {\n // console.warn()\n // }\n this._liveRowValue.value = produce(this._liveRowValue.value, draft => {\n this.form.writeDirtyStateTo(draft as PickMutable<Row>);\n });\n });\n }\n}\n"]}
|
|
File without changes
|