@coolon/angular-ui-powerups 12.0.1 → 12.0.3
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 +54 -37
- 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 -0
- 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 +12 -35
- package/esm2015/lib/components/tables/abstract-table-model.js.map +1 -1
- package/esm2015/lib/components/tables/abstract-table-model.metadata.json +1 -1
- package/esm2015/lib/components/tables/column-list-model.js +38 -0
- package/esm2015/lib/components/tables/column-list-model.js.map +1 -0
- package/esm2015/lib/components/tables/column-list-model.metadata.json +1 -0
- package/fesm2015/coolon-angular-ui-powerups.js +45 -33
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/exports.d.ts +1 -0
- package/lib/components/tables/abstract-table-model.d.ts +2 -4
- package/lib/components/tables/column-list-model.d.ts +12 -0
- package/package.json +2 -2
|
@@ -42,6 +42,7 @@ export * from "./section-header/section-header.component";
|
|
|
42
42
|
export * from "./switch-case/switch-case.component";
|
|
43
43
|
export * from "./tables/abstract-table-model";
|
|
44
44
|
export * from "./tables/abstract-table.component";
|
|
45
|
+
export * from "./tables/column-list-model";
|
|
45
46
|
export * from "./tables/table/cell-editors";
|
|
46
47
|
export * from "./tables/table/cell-portal-ref";
|
|
47
48
|
export * from "./tables/table/cell-renderer";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/components/exports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uB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cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0DAA0D,CAAC;AACzE,cAAc,sEAAsE,CAAC;AACrF,cAAc,oFAAoF,CAAC;AACnG,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8CAA8C,CAAC;AAC7D,cAAc,oEAAoE,CAAC;AACnF,cAAc,kFAAkF,CAAC;AACjG,cAAc,kEAAkE,CAAC;AACjF,cAAc,gFAAgF,CAAC;AAC/F,cAAc,wDAAwD,CAAC;AACvE,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2EAA2E,CAAC;AAC1F,cAAc,iFAAiF,CAAC;AAChG,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+DAA+D,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./alignment\";\nexport * from \"./components.module\";\nexport * from \"./disposable-component\";\nexport * from \"./focusable.component\";\nexport * from \"./resize-aware.component\";\nexport * from \"./track-by\";\nexport * from \"./busy-overlay/busy-overlay.component\";\nexport * from \"./card-container/card-container.component\";\nexport * from \"./commands/command-face\";\nexport * from \"./commands/flex.component\";\nexport * from \"./commands/separator.component\";\nexport * from \"./commands/command/command.component\";\nexport * from \"./commands/command-face/command-face.component\";\nexport * from \"./commands/group/command-container\";\nexport * from \"./commands/group/popup-aware.component\";\nexport * from \"./commands/group/popup-container\";\nexport * from \"./commands/group/popup-menu/abstract-popup-menu.component\";\nexport * from \"./commands/group/popup-menu/more-menu.component\";\nexport * from \"./commands/group/popup-menu/popup-menu.component\";\nexport * from \"./commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component\";\nexport * from \"./commands/group/tool-bar/tool-bar.component\";\nexport * from \"./empty-state/empty-state.component\";\nexport * from \"./focus-container/focus-container.component\";\nexport * from \"./forms/abstract-input.component\";\nexport * from \"./forms/abstract-list-input.component\";\nexport * from \"./forms/abstract-value-input.component\";\nexport * from \"./forms/autocomplete-input/autocomplete-input.component\";\nexport * from \"./forms/checkbox-input/checkbox-input.component\";\nexport * from \"./forms/multiple-select-input/multiple-select-input.component\";\nexport * from \"./forms/number-input/number-input.component\";\nexport * from \"./forms/password-input/password-input.component\";\nexport * from \"./forms/select-input/select-input.component\";\nexport * from \"./forms/string-input/string-input.component\";\nexport * from \"./forms/text-input/text-input.component\";\nexport * from \"./icon/icon.component\";\nexport * from \"./noop/noop.component\";\nexport * from \"./scroll-container/scroll-container.component\";\nexport * from \"./section-header/section-header.component\";\nexport * from \"./switch-case/switch-case.component\";\nexport * from \"./tables/abstract-table-model\";\nexport * from \"./tables/abstract-table.component\";\nexport * from \"./tables/table/cell-editors\";\nexport * from \"./tables/table/cell-portal-ref\";\nexport * from \"./tables/table/cell-renderer\";\nexport * from \"./tables/table/column-model\";\nexport * from \"./tables/table/column-text-properties\";\nexport * from \"./tables/table/edit-session\";\nexport * from \"./tables/table/mutable-cell-renderer\";\nexport * from \"./tables/table/table-def\";\nexport * from \"./tables/table/table-model\";\nexport * from \"./tables/table/table.component\";\nexport * from \"./tables/table/column-template/column-template.directive\";\nexport * from \"./tables/table/default-cell-renderer/default-cell-renderer.component\";\nexport * from \"./tables/table/default-header-cell-renderer/default-header-cell-renderer.component\";\nexport * from \"./tables/table/edit-row-controls/edit-row-controls.component\";\nexport * from \"./tables/table/paginator/paginator.component\";\nexport * from \"./tables/table/select-cell-renderer/select-cell-renderer.component\";\nexport * from \"./tables/table/select-header-cell-renderer/select-header-cell-renderer.component\";\nexport * from \"./tables/table/table-cell-renderer/table-cell-renderer.component\";\nexport * from \"./tables/table/table-header-cell-renderer/table-header-cell-renderer.component\";\nexport * from \"./tables/table/table-row-menu/table-row-menu.component\";\nexport * from \"./tables/tree-table/decorated-tree-node\";\nexport * from \"./tables/tree-table/tree-expansion-model\";\nexport * from \"./tables/tree-table/tree-label-column-model\";\nexport * from \"./tables/tree-table/tree-node\";\nexport * from \"./tables/tree-table/tree-table-component\";\nexport * from \"./tables/tree-table/tree-table-model\";\nexport * from \"./tables/tree-table/tree-to-list-model\";\nexport * from \"./tables/tree-table/visitable.class\";\nexport * from \"./tables/tree-table/tree-inheritance-icon/tree-inheritance-icon.component\";\nexport * from \"./tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component\";\nexport * from \"./types/bounds.class\";\nexport * from \"./types/dimension.class\";\nexport * from \"./types/point.class\";\nexport * from \"./vertical-focus-container/vertical-focus-container.component\";\n"]}
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/components/exports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,2DAA2D,CAAC;AAC1E,cAAc,iDAAiD,CAAC;AAChE,cAAc,kDAAkD,CAAC;AACjE,cAAc,+EAA+E,CAAC;AAC9F,cAAc,8CAA8C,CAAC;AAC7D,cAAc,qCAAqC,CAAC;AACpD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,kCAA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AAc,qCAAqC,CAAC;AACpD,cAAc,2EAA2E,CAAC;AAC1F,cAAc,iFAAiF,CAAC;AAChG,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+DAA+D,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./alignment\";\nexport * from \"./components.module\";\nexport * from \"./disposable-component\";\nexport * from \"./focusable.component\";\nexport * from \"./resize-aware.component\";\nexport * from \"./track-by\";\nexport * from \"./busy-overlay/busy-overlay.component\";\nexport * from \"./card-container/card-container.component\";\nexport * from \"./commands/command-face\";\nexport * from \"./commands/flex.component\";\nexport * from \"./commands/separator.component\";\nexport * from \"./commands/command/command.component\";\nexport * from \"./commands/command-face/command-face.component\";\nexport * from \"./commands/group/command-container\";\nexport * from \"./commands/group/popup-aware.component\";\nexport * from \"./commands/group/popup-container\";\nexport * from \"./commands/group/popup-menu/abstract-popup-menu.component\";\nexport * from \"./commands/group/popup-menu/more-menu.component\";\nexport * from \"./commands/group/popup-menu/popup-menu.component\";\nexport * from \"./commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component\";\nexport * from \"./commands/group/tool-bar/tool-bar.component\";\nexport * from \"./empty-state/empty-state.component\";\nexport * from \"./focus-container/focus-container.component\";\nexport * from \"./forms/abstract-input.component\";\nexport * from \"./forms/abstract-list-input.component\";\nexport * from \"./forms/abstract-value-input.component\";\nexport * from \"./forms/autocomplete-input/autocomplete-input.component\";\nexport * from \"./forms/checkbox-input/checkbox-input.component\";\nexport * from \"./forms/multiple-select-input/multiple-select-input.component\";\nexport * from \"./forms/number-input/number-input.component\";\nexport * from \"./forms/password-input/password-input.component\";\nexport * from \"./forms/select-input/select-input.component\";\nexport * from \"./forms/string-input/string-input.component\";\nexport * from \"./forms/text-input/text-input.component\";\nexport * from \"./icon/icon.component\";\nexport * from \"./noop/noop.component\";\nexport * from \"./scroll-container/scroll-container.component\";\nexport * from \"./section-header/section-header.component\";\nexport * from \"./switch-case/switch-case.component\";\nexport * from \"./tables/abstract-table-model\";\nexport * from \"./tables/abstract-table.component\";\nexport * from \"./tables/column-list-model\";\nexport * from \"./tables/table/cell-editors\";\nexport * from \"./tables/table/cell-portal-ref\";\nexport * from \"./tables/table/cell-renderer\";\nexport * from \"./tables/table/column-model\";\nexport * from \"./tables/table/column-text-properties\";\nexport * from \"./tables/table/edit-session\";\nexport * from \"./tables/table/mutable-cell-renderer\";\nexport * from \"./tables/table/table-def\";\nexport * from \"./tables/table/table-model\";\nexport * from \"./tables/table/table.component\";\nexport * from \"./tables/table/column-template/column-template.directive\";\nexport * from \"./tables/table/default-cell-renderer/default-cell-renderer.component\";\nexport * from \"./tables/table/default-header-cell-renderer/default-header-cell-renderer.component\";\nexport * from \"./tables/table/edit-row-controls/edit-row-controls.component\";\nexport * from \"./tables/table/paginator/paginator.component\";\nexport * from \"./tables/table/select-cell-renderer/select-cell-renderer.component\";\nexport * from \"./tables/table/select-header-cell-renderer/select-header-cell-renderer.component\";\nexport * from \"./tables/table/table-cell-renderer/table-cell-renderer.component\";\nexport * from \"./tables/table/table-header-cell-renderer/table-header-cell-renderer.component\";\nexport * from \"./tables/table/table-row-menu/table-row-menu.component\";\nexport * from \"./tables/tree-table/decorated-tree-node\";\nexport * from \"./tables/tree-table/tree-expansion-model\";\nexport * from \"./tables/tree-table/tree-label-column-model\";\nexport * from \"./tables/tree-table/tree-node\";\nexport * from \"./tables/tree-table/tree-table-component\";\nexport * from \"./tables/tree-table/tree-table-model\";\nexport * from \"./tables/tree-table/tree-to-list-model\";\nexport * from \"./tables/tree-table/visitable.class\";\nexport * from \"./tables/tree-table/tree-inheritance-icon/tree-inheritance-icon.component\";\nexport * from \"./tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component\";\nexport * from \"./types/bounds.class\";\nexport * from \"./types/dimension.class\";\nexport * from \"./types/point.class\";\nexport * from \"./vertical-focus-container/vertical-focus-container.component\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./alignment"},{"from":"./components.module"},{"from":"./disposable-component"},{"from":"./focusable.component"},{"from":"./resize-aware.component"},{"from":"./track-by"},{"from":"./busy-overlay/busy-overlay.component"},{"from":"./card-container/card-container.component"},{"from":"./commands/command-face"},{"from":"./commands/flex.component"},{"from":"./commands/separator.component"},{"from":"./commands/command/command.component"},{"from":"./commands/command-face/command-face.component"},{"from":"./commands/group/command-container"},{"from":"./commands/group/popup-aware.component"},{"from":"./commands/group/popup-container"},{"from":"./commands/group/popup-menu/abstract-popup-menu.component"},{"from":"./commands/group/popup-menu/more-menu.component"},{"from":"./commands/group/popup-menu/popup-menu.component"},{"from":"./commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component"},{"from":"./commands/group/tool-bar/tool-bar.component"},{"from":"./empty-state/empty-state.component"},{"from":"./focus-container/focus-container.component"},{"from":"./forms/abstract-input.component"},{"from":"./forms/abstract-list-input.component"},{"from":"./forms/abstract-value-input.component"},{"from":"./forms/autocomplete-input/autocomplete-input.component"},{"from":"./forms/checkbox-input/checkbox-input.component"},{"from":"./forms/multiple-select-input/multiple-select-input.component"},{"from":"./forms/number-input/number-input.component"},{"from":"./forms/password-input/password-input.component"},{"from":"./forms/select-input/select-input.component"},{"from":"./forms/string-input/string-input.component"},{"from":"./forms/text-input/text-input.component"},{"from":"./icon/icon.component"},{"from":"./noop/noop.component"},{"from":"./scroll-container/scroll-container.component"},{"from":"./section-header/section-header.component"},{"from":"./switch-case/switch-case.component"},{"from":"./tables/abstract-table-model"},{"from":"./tables/abstract-table.component"},{"from":"./tables/table/cell-editors"},{"from":"./tables/table/cell-portal-ref"},{"from":"./tables/table/cell-renderer"},{"from":"./tables/table/column-model"},{"from":"./tables/table/column-text-properties"},{"from":"./tables/table/edit-session"},{"from":"./tables/table/mutable-cell-renderer"},{"from":"./tables/table/table-def"},{"from":"./tables/table/table-model"},{"from":"./tables/table/table.component"},{"from":"./tables/table/column-template/column-template.directive"},{"from":"./tables/table/default-cell-renderer/default-cell-renderer.component"},{"from":"./tables/table/default-header-cell-renderer/default-header-cell-renderer.component"},{"from":"./tables/table/edit-row-controls/edit-row-controls.component"},{"from":"./tables/table/paginator/paginator.component"},{"from":"./tables/table/select-cell-renderer/select-cell-renderer.component"},{"from":"./tables/table/select-header-cell-renderer/select-header-cell-renderer.component"},{"from":"./tables/table/table-cell-renderer/table-cell-renderer.component"},{"from":"./tables/table/table-header-cell-renderer/table-header-cell-renderer.component"},{"from":"./tables/table/table-row-menu/table-row-menu.component"},{"from":"./tables/tree-table/decorated-tree-node"},{"from":"./tables/tree-table/tree-expansion-model"},{"from":"./tables/tree-table/tree-label-column-model"},{"from":"./tables/tree-table/tree-node"},{"from":"./tables/tree-table/tree-table-component"},{"from":"./tables/tree-table/tree-table-model"},{"from":"./tables/tree-table/tree-to-list-model"},{"from":"./tables/tree-table/visitable.class"},{"from":"./tables/tree-table/tree-inheritance-icon/tree-inheritance-icon.component"},{"from":"./tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component"},{"from":"./types/bounds.class"},{"from":"./types/dimension.class"},{"from":"./types/point.class"},{"from":"./vertical-focus-container/vertical-focus-container.component"}]}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./alignment"},{"from":"./components.module"},{"from":"./disposable-component"},{"from":"./focusable.component"},{"from":"./resize-aware.component"},{"from":"./track-by"},{"from":"./busy-overlay/busy-overlay.component"},{"from":"./card-container/card-container.component"},{"from":"./commands/command-face"},{"from":"./commands/flex.component"},{"from":"./commands/separator.component"},{"from":"./commands/command/command.component"},{"from":"./commands/command-face/command-face.component"},{"from":"./commands/group/command-container"},{"from":"./commands/group/popup-aware.component"},{"from":"./commands/group/popup-container"},{"from":"./commands/group/popup-menu/abstract-popup-menu.component"},{"from":"./commands/group/popup-menu/more-menu.component"},{"from":"./commands/group/popup-menu/popup-menu.component"},{"from":"./commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component"},{"from":"./commands/group/tool-bar/tool-bar.component"},{"from":"./empty-state/empty-state.component"},{"from":"./focus-container/focus-container.component"},{"from":"./forms/abstract-input.component"},{"from":"./forms/abstract-list-input.component"},{"from":"./forms/abstract-value-input.component"},{"from":"./forms/autocomplete-input/autocomplete-input.component"},{"from":"./forms/checkbox-input/checkbox-input.component"},{"from":"./forms/multiple-select-input/multiple-select-input.component"},{"from":"./forms/number-input/number-input.component"},{"from":"./forms/password-input/password-input.component"},{"from":"./forms/select-input/select-input.component"},{"from":"./forms/string-input/string-input.component"},{"from":"./forms/text-input/text-input.component"},{"from":"./icon/icon.component"},{"from":"./noop/noop.component"},{"from":"./scroll-container/scroll-container.component"},{"from":"./section-header/section-header.component"},{"from":"./switch-case/switch-case.component"},{"from":"./tables/abstract-table-model"},{"from":"./tables/abstract-table.component"},{"from":"./tables/column-list-model"},{"from":"./tables/table/cell-editors"},{"from":"./tables/table/cell-portal-ref"},{"from":"./tables/table/cell-renderer"},{"from":"./tables/table/column-model"},{"from":"./tables/table/column-text-properties"},{"from":"./tables/table/edit-session"},{"from":"./tables/table/mutable-cell-renderer"},{"from":"./tables/table/table-def"},{"from":"./tables/table/table-model"},{"from":"./tables/table/table.component"},{"from":"./tables/table/column-template/column-template.directive"},{"from":"./tables/table/default-cell-renderer/default-cell-renderer.component"},{"from":"./tables/table/default-header-cell-renderer/default-header-cell-renderer.component"},{"from":"./tables/table/edit-row-controls/edit-row-controls.component"},{"from":"./tables/table/paginator/paginator.component"},{"from":"./tables/table/select-cell-renderer/select-cell-renderer.component"},{"from":"./tables/table/select-header-cell-renderer/select-header-cell-renderer.component"},{"from":"./tables/table/table-cell-renderer/table-cell-renderer.component"},{"from":"./tables/table/table-header-cell-renderer/table-header-cell-renderer.component"},{"from":"./tables/table/table-row-menu/table-row-menu.component"},{"from":"./tables/tree-table/decorated-tree-node"},{"from":"./tables/tree-table/tree-expansion-model"},{"from":"./tables/tree-table/tree-label-column-model"},{"from":"./tables/tree-table/tree-node"},{"from":"./tables/tree-table/tree-table-component"},{"from":"./tables/tree-table/tree-table-model"},{"from":"./tables/tree-table/tree-to-list-model"},{"from":"./tables/tree-table/visitable.class"},{"from":"./tables/tree-table/tree-inheritance-icon/tree-inheritance-icon.component"},{"from":"./tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component"},{"from":"./types/bounds.class"},{"from":"./types/dimension.class"},{"from":"./types/point.class"},{"from":"./vertical-focus-container/vertical-focus-container.component"}]}]
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { assert, DirtyTrackingForm, Dsl, EventListenerList, GarbageCollector, lang, MutableListModel, TrackExternal, ValueModel } from '@coolon/pectin';
|
|
2
|
+
import * as _ from 'lodash';
|
|
3
|
+
import { ColumnListModel } from './column-list-model';
|
|
2
4
|
import { CustomTemplateColumnModel, CustomValueColumnModel, EditorControlColumnModel, ListPropertyColumnModel, PropertyColumnModel, SelectionColumnModel } from './table/column-model';
|
|
3
5
|
import { EditSession } from './table/edit-session';
|
|
4
|
-
import * as _ from 'lodash';
|
|
5
6
|
// export type StringPropertiesOf<T> = { [K in keyof T]: T[K] extends string ? K : never }[keyof T];
|
|
6
7
|
// export type NumberPropertiesOf<T> = { [K in keyof T]: T[K] extends number ? K : never }[keyof T];
|
|
7
8
|
class RowClass {
|
|
@@ -10,27 +11,11 @@ class RowClass {
|
|
|
10
11
|
this.matches = matches;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
|
-
class VisibleColumnListModel extends AbstractComputedListModel {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
this.columns = [];
|
|
17
|
-
}
|
|
18
|
-
addColumn(column) {
|
|
19
|
-
this.runInTransaction(() => {
|
|
20
|
-
this.columns.push(column);
|
|
21
|
-
this.trackSource(column.visible);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
doComputeValue() {
|
|
25
|
-
return this.columns.filter(c => c.visible.value);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
14
|
export class AbstractTableModel extends GarbageCollector {
|
|
29
15
|
constructor(sourceOfTruth) {
|
|
30
16
|
super();
|
|
31
17
|
this.sourceOfTruth = sourceOfTruth;
|
|
32
|
-
this.
|
|
33
|
-
this._visibleColumnTracker = new VisibleColumnListModel();
|
|
18
|
+
this._columnList = this.registerDisposable(new ColumnListModel());
|
|
34
19
|
this._editorSessions = new MutableListModel();
|
|
35
20
|
this.rowClassNamePredicates = [];
|
|
36
21
|
this.rowClickListeners = new EventListenerList();
|
|
@@ -40,7 +25,6 @@ export class AbstractTableModel extends GarbageCollector {
|
|
|
40
25
|
};
|
|
41
26
|
this.identityOf = sourceOfTruth.identityOf;
|
|
42
27
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
43
|
-
this._columnsById = chain(this._columns).indexBy('columnId');
|
|
44
28
|
this._rowsBeingEdited = new MutableListModel([], {
|
|
45
29
|
identifiedWith: this.identityOf
|
|
46
30
|
});
|
|
@@ -48,18 +32,18 @@ export class AbstractTableModel extends GarbageCollector {
|
|
|
48
32
|
this.editing = chain(this._editorSessions).count().isGreaterThan(0);
|
|
49
33
|
this.dataSource = chain(this.sourceOfTruth).replaceAll(this.rowsBeingEdited);
|
|
50
34
|
this.firstEditableColumn = chain(this.columns).select(c => c.hasEditorPortal()).first();
|
|
51
|
-
this.firstVisibleColumn = chain(this.
|
|
52
|
-
this.lastVisibleColumn = chain(this.
|
|
53
|
-
this.rowSelectionDisabledOnAllColumns = chain(this.
|
|
35
|
+
this.firstVisibleColumn = chain(this._columnList).first();
|
|
36
|
+
this.lastVisibleColumn = chain(this._columnList).last();
|
|
37
|
+
this.rowSelectionDisabledOnAllColumns = chain(this._columnList).select(column => column.isRowSelectionEnabled()).count().equals(0);
|
|
54
38
|
}
|
|
55
39
|
get rowsBeingEdited() {
|
|
56
40
|
return this._rowsBeingEdited.readonly;
|
|
57
41
|
}
|
|
58
42
|
get columns() {
|
|
59
|
-
return this.
|
|
43
|
+
return this._columnList.allColumns;
|
|
60
44
|
}
|
|
61
45
|
get visibleColumns() {
|
|
62
|
-
return this.
|
|
46
|
+
return this._columnList.readonly;
|
|
63
47
|
}
|
|
64
48
|
pluck(property, options) {
|
|
65
49
|
const columnId = (options === null || options === void 0 ? void 0 : options.columnId) || property.toString();
|
|
@@ -74,7 +58,7 @@ export class AbstractTableModel extends GarbageCollector {
|
|
|
74
58
|
const columnId = 'selection-column';
|
|
75
59
|
this.selectionColumnModel = new SelectionColumnModel(columnId, () => this.getColumnTextProperties(columnId), selectionModel);
|
|
76
60
|
this.addRowClass('aup-row-selected', row => this.selectionColumnModel.isSelected(row));
|
|
77
|
-
const selectionColumnModel = this.addColumn(this.selectionColumnModel);
|
|
61
|
+
const selectionColumnModel = this.addColumn(this.selectionColumnModel, 0);
|
|
78
62
|
if (!_.isNil(visible)) {
|
|
79
63
|
selectionColumnModel.visibleWhile(visible instanceof ValueModel ? visible : ValueModel.constant(visible));
|
|
80
64
|
}
|
|
@@ -110,15 +94,8 @@ export class AbstractTableModel extends GarbageCollector {
|
|
|
110
94
|
this._createForm = factory;
|
|
111
95
|
return this;
|
|
112
96
|
}
|
|
113
|
-
addColumn(column) {
|
|
114
|
-
|
|
115
|
-
lang.illegalState(`Column with id=${column.columnId} already exists`);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
this._columns.push(column);
|
|
119
|
-
this._visibleColumnTracker.addColumn(column);
|
|
120
|
-
}
|
|
121
|
-
return column;
|
|
97
|
+
addColumn(column, index) {
|
|
98
|
+
return this._columnList.addColumn(column, index);
|
|
122
99
|
}
|
|
123
100
|
// removeColumn(column: ColumnModel<Row>) {
|
|
124
101
|
//
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-table-model.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/abstract-table-model.ts"],"names":[],"mappings":"AACA,OA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,CAAC,qBAAqB,EAAE,IAAI,IAAI,CAAC,iBAAiB,CAAC,aAAa,GAAG,CAAC,CAAC;IAClF,CAAC;IAED,eAAe,CAAC,MAAwB;QACtC,OAAO,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,iBAAiB,CAAC,aAAa,GAAG,CAAC,CAAC;IAC3F,CAAC;IAED,SAAS,CAAC,GAAQ;;QAChB,MAAA,IAAI,CAAC,oBAAoB,0CAAE,SAAS,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,YAAY,CAAC,QAA4B;QACvC,OAAO,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED,kBAAkB,CAAC,WAA6B,EAAE,GAAQ;QACxD,IAAI,IAAI,CAAC,wBAAwB,CAAC,WAAW,CAAC,EAAE;YAC9C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;SACrB;QACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3C,CAAC;CACF;AAGD,aAAa,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { ComponentType } from '@angular/cdk/overlay';\nimport {\n AbstractComputedListModel,\n assert,\n BooleanValueModelChain,\n CanIdentify,\n DirtyTrackingForm,\n Disposable,\n Dsl,\n EventListenerList,\n GarbageCollector,\n lang,\n ListModel,\n ListModelChain,\n MapModelChain, MultipleSelectionModel,\n MutableListModel,\n SelectionModel, Trace,\n TrackExternal,\n Types,\n UnaryCommand,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport { CellRenderer } from './table/cell-renderer';\nimport {\n CellRendererOptions,\n ColumnModel,\n CustomTemplateColumnModel,\n CustomValueColumnModel,\n EditorControlColumnModel,\n ListPropertyColumnModel,\n OnComponentInit,\n PropertyColumnModel,\n SelectionColumnModel\n} from './table/column-model';\nimport { ColumnTextProperties } from './table/column-text-properties';\nimport { EditSession } from './table/edit-session';\nimport * as _ from 'lodash';\n\n// export type StringPropertiesOf<T> = { [K in keyof T]: T[K] extends string ? K : never }[keyof T];\n// export type NumberPropertiesOf<T> = { [K in keyof T]: T[K] extends number ? K : never }[keyof T];\n\nclass RowClass<Row> {\n constructor(readonly className: string,\n readonly matches: (row: Row) => boolean) {\n }\n}\n\n\nclass VisibleColumnListModel<Row> extends AbstractComputedListModel<ColumnModel<Row>, boolean> {\n private columns: ColumnModel<Row>[] = [];\n\n addColumn(column: ColumnModel<Row>) {\n this.runInTransaction(() => {\n this.columns.push(column);\n this.trackSource(column.visible);\n })\n }\n\n doComputeValue(): ColumnModel<Row>[] {\n return this.columns.filter(c => c.visible.value);\n }\n}\n\nexport class AbstractTableModel<Row> extends GarbageCollector {\n\n private readonly _columns = new MutableListModel<ColumnModel<Row>>();\n private readonly _visibleColumnTracker = new VisibleColumnListModel<Row>();\n private _columnsById: MapModelChain<string, ColumnModel<Row>>;\n private _editorSessions = new MutableListModel<EditSession<Row>>();\n private readonly _rowsBeingEdited: MutableListModel<Row>;\n private readonly rowClassNamePredicates: RowClass<Row>[] = [];\n\n private _columnTextPropertiesLookup: { [columnName: string]: ColumnTextProperties };\n\n readonly identityOf: CanIdentify<Row>['identityOf'];\n private saveCommand: UnaryCommand<DirtyTrackingForm<Row>, boolean>;\n private _editorSessionByRowId: MapModelChain<any, EditSession<Row>>;\n\n readonly editing: BooleanValueModelChain;\n readonly dataSource: ListModelChain<Row>;\n readonly firstEditableColumn: ValueModelChain<ColumnModel<Row>>;\n private selectionColumnModel: SelectionColumnModel<Row>;\n private rowSelectionDisabledOnAllColumns: BooleanValueModelChain;\n private readonly rowClickListeners = new EventListenerList<(row: Row) => void>();\n readonly firstVisibleColumn: ValueModel<ColumnModel<Row>>;\n readonly lastVisibleColumn: ValueModel<ColumnModel<Row>>;\n\n private _createForm: (row: Row) => DirtyTrackingForm<Row> = (row) => new DirtyTrackingForm<Row>();\n\n protected constructor(private sourceOfTruth: ListModel<Row>) {\n super();\n this.identityOf = sourceOfTruth.identityOf;\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this._columnsById = chain(this._columns).indexBy('columnId');\n this._rowsBeingEdited = new MutableListModel<Row>([], {\n identifiedWith: this.identityOf\n });\n this._editorSessionByRowId = chain(this._editorSessions).indexBy('rowId');\n this.editing = chain(this._editorSessions).count().isGreaterThan(0);\n this.dataSource = chain(this.sourceOfTruth).replaceAll(this.rowsBeingEdited);\n this.firstEditableColumn = chain(this.columns).select(c => c.hasEditorPortal()).first();\n this.firstVisibleColumn = chain(this._visibleColumnTracker).first();\n this.lastVisibleColumn = chain(this._visibleColumnTracker).last();\n\n this.rowSelectionDisabledOnAllColumns = chain(this._visibleColumnTracker).select(column => column.isRowSelectionEnabled()).count().equals(0);\n }\n\n get rowsBeingEdited(): ListModel<Row> {\n return this._rowsBeingEdited.readonly;\n }\n\n readonly trackBy = (index: number, item: Row) => {\n return this.identityOf ? this.identityOf(item) : index;\n };\n\n get columns(): ListModel<ColumnModel<Row>> {\n return this._columns.readonly;\n }\n\n get visibleColumns(): ListModel<ColumnModel<Row>> {\n return this._visibleColumnTracker.readonly;\n }\n\n pluck<P extends Types.ValuePropertiesOf<Row>>(property: P, options?: { columnId: string }): PropertyColumnModel<Row, P> {\n const columnId = options?.columnId || property.toString();\n return this.addColumn(new PropertyColumnModel<Row, P>(columnId, property, () => this.getColumnTextProperties(columnId)));\n }\n\n pluckList<P extends Types.ArrayPropertiesOf<Row>>(property: P, options?: { columnId: string }): ListPropertyColumnModel<Row, P> {\n const columnId = options?.columnId || property.toString();\n return this.addColumn(new ListPropertyColumnModel<Row, P>(columnId, property, () => this.getColumnTextProperties(columnId)));\n }\n\n protected _addSelectionColumn(selectionModel?: SelectionModel<Row>, visible?: ValueModel<boolean> | boolean): SelectionColumnModel<Row> {\n assert.isNil(this.selectionColumnModel);\n const columnId = 'selection-column';\n this.selectionColumnModel = new SelectionColumnModel<Row>(columnId, () => this.getColumnTextProperties(columnId), selectionModel);\n this.addRowClass('aup-row-selected', row => this.selectionColumnModel.isSelected(row));\n const selectionColumnModel = this.addColumn(this.selectionColumnModel);\n if (!_.isNil(visible)) {\n selectionColumnModel.visibleWhile(visible instanceof ValueModel ? visible : ValueModel.constant(visible));\n }\n return selectionColumnModel;\n }\n\n addEditControls(saveCommand: UnaryCommand<DirtyTrackingForm<Row>, boolean>): EditorControlColumnModel<Row> {\n this.saveCommand = saveCommand;\n const columnId = 'editControls';\n return this.addColumn(new EditorControlColumnModel<Row>(columnId, saveCommand, () => this.getColumnTextProperties(columnId)));\n }\n\n addCustomColumn<V>(columnId: string, dataAccessor: (row: Row) => V): CustomValueColumnModel<Row, V> {\n return this.addColumn(new CustomValueColumnModel<Row, V>(columnId, () => this.getColumnTextProperties(columnId), dataAccessor));\n }\n\n addComponentColumn<C extends CellRenderer<Row>>(columnId: string, component: ComponentType<C>, onInit?: OnComponentInit<C>): CustomValueColumnModel<Row, Row>\n addComponentColumn<C extends CellRenderer<Row>>(columnId: string, component: ComponentType<C>, options?: CellRendererOptions<Row, C>): CustomValueColumnModel<Row, Row>\n addComponentColumn<C extends CellRenderer<Row>>(columnId: string, component: ComponentType<C>, onComponentInitOrOptions?: OnComponentInit<C> | CellRendererOptions<Row, C>): CustomValueColumnModel<Row, Row> {\n return this.addColumn(new CustomValueColumnModel<Row, Row>(columnId, () => this.getColumnTextProperties(columnId), row => row)).cellRenderer(component, onComponentInitOrOptions);\n }\n\n addTemplateColumn<V>(columnId: string): CustomTemplateColumnModel<Row> {\n return this.addColumn(new CustomTemplateColumnModel<Row>(columnId, () => this.getColumnTextProperties(columnId)));\n }\n\n addRowClass(className: string, predicate: (row: Row) => boolean) {\n this.rowClassNamePredicates.push(new RowClass<Row>(className, predicate));\n }\n\n getRowClasses(row: Row): string[] {\n const classNames: string[] = [];\n this.rowClassNamePredicates.forEach(i => {\n if (i.matches(row)) {\n classNames.push(i.className);\n }\n });\n return classNames;\n }\n\n useFormFactory(factory: (row: Row) => DirtyTrackingForm<Row>): this {\n this._createForm = factory;\n return this;\n }\n\n protected addColumn<C extends ColumnModel<Row>>(column: C): C {\n if (this._columnsById.get(column.columnId)) {\n lang.illegalState(`Column with id=${column.columnId} already exists`);\n } else {\n this._columns.push(column);\n this._visibleColumnTracker.addColumn(column);\n }\n return column;\n }\n\n // removeColumn(column: ColumnModel<Row>) {\n //\n // }\n\n columnTextProperties(columnTextProperties: { [columnName: string]: ColumnTextProperties }) {\n this._columnTextPropertiesLookup = columnTextProperties;\n }\n\n getColumnTextProperties(columnId: string): ColumnTextProperties {\n return this._columnTextPropertiesLookup ? this._columnTextPropertiesLookup[columnId] : undefined;\n }\n\n startEditSession(row: Row): EditSession<Row> {\n const rowId = this.identityOf(row);\n if (this._rowsBeingEdited.query().indexOf(row) > -1) {\n return lang.illegalState(`Row with id=${rowId} already being edited`);\n } else {\n const editSession = new EditSession<Row>(rowId, row, this._createForm(row), this.saveCommand);\n const { when } = Dsl.disposeWith(editSession);\n when(editSession.liveRowValue).changes((editedValue) => {\n this._rowsBeingEdited.replaceOrPush(editedValue);\n }, { initialValue: 'triggerChangeUnlessNil' });\n\n this._editorSessions.push(editSession);\n editSession.onDispose(() => {\n this._rowsBeingEdited.remove(editSession.liveRowValue.value);\n this._editorSessions.remove(editSession);\n });\n return editSession;\n }\n }\n\n getEditSessionFor(row: Row): EditSession<Row> {\n return this._editorSessionByRowId.get(this.identityOf(row));\n }\n\n cancelAllEditorSessions() {\n this._editorSessions.runInTransaction((draft) => {\n this._rowsBeingEdited.runInTransaction(() => {\n draft.value.forEach(session => session.dispose());\n });\n });\n }\n\n isRowSelectionEnabledFor(column: ColumnModel<Row>): boolean {\n return this.isRowSelectionEnabled() && column.isRowSelectionEnabled();\n }\n\n isRowSelectionEnabled() {\n return this.hasSelectionModel() && !this.rowSelectionDisabledOnAllColumns.value;\n }\n\n hasSelectionModel() {\n return !!this.selectionColumnModel?.selectionModel.getDelegate()\n }\n\n isHoverEnabled(): boolean {\n return this.isRowSelectionEnabled() || this.rowClickListeners.listenerCount > 0;\n }\n\n isCursorEnabled(column: ColumnModel<Row>) {\n return this.isRowSelectionEnabledFor(column) || this.rowClickListeners.listenerCount > 0;\n }\n\n selectRow(row: Row) {\n this.selectionColumnModel?.selectRow(row);\n }\n\n onRowClicked(callback: (row: Row) => void): Disposable {\n return this.rowClickListeners.add(callback);\n }\n\n _notifyCellClicked(columnModel: ColumnModel<Row>, row: Row) {\n if (this.isRowSelectionEnabledFor(columnModel)) {\n this.selectRow(row);\n }\n this.rowClickListeners.fire(l => l(row));\n }\n}\n\n\nTrackExternal.oneTimeBinding(AbstractTableModel);\n"]}
|
|
1
|
+
{"version":3,"file":"abstract-table-model.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/abstract-table-model.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EAGN,iBAAiB,EAEjB,GAAG,EACH,iBAAiB,EACjB,gBAAgB,EAChB,IAAI,EAIJ,gBAAgB,EAEhB,aAAa,EAGb,UAAU,EAEX,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAGL,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EAEvB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,oGAAoG;AACpG,oGAAoG;AAEpG,MAAM,QAAQ;IACZ,YAAqB,SAAiB,EACjB,OAA8B;QAD9B,cAAS,GAAT,SAAS,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAuB;IACnD,CAAC;CACF;AAGD,MAAM,OAAO,kBAAwB,SAAQ,gBAAgB;IAyB3D,YAA8B,aA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CAAC,aAAa,GAAG,CAAC,CAAC;IAC3F,CAAC;IAED,SAAS,CAAC,GAAQ;;QAChB,MAAA,IAAI,CAAC,oBAAoB,0CAAE,SAAS,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,YAAY,CAAC,QAA4B;QACvC,OAAO,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED,kBAAkB,CAAC,WAA6B,EAAE,GAAQ;QACxD,IAAI,IAAI,CAAC,wBAAwB,CAAC,WAAW,CAAC,EAAE;YAC9C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;SACrB;QACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3C,CAAC;CACF;AAGD,aAAa,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { ComponentType } from '@angular/cdk/overlay';\nimport {\n assert,\n BooleanValueModelChain,\n CanIdentify,\n DirtyTrackingForm,\n Disposable,\n Dsl,\n EventListenerList,\n GarbageCollector,\n lang,\n ListModel,\n ListModelChain,\n MapModelChain,\n MutableListModel,\n SelectionModel,\n TrackExternal,\n Types,\n UnaryCommand,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { ColumnListModel } from './column-list-model';\nimport { CellRenderer } from './table/cell-renderer';\nimport {\n CellRendererOptions,\n ColumnModel,\n CustomTemplateColumnModel,\n CustomValueColumnModel,\n EditorControlColumnModel,\n ListPropertyColumnModel,\n OnComponentInit,\n PropertyColumnModel,\n SelectionColumnModel\n} from './table/column-model';\nimport { ColumnTextProperties } from './table/column-text-properties';\nimport { EditSession } from './table/edit-session';\n\n// export type StringPropertiesOf<T> = { [K in keyof T]: T[K] extends string ? K : never }[keyof T];\n// export type NumberPropertiesOf<T> = { [K in keyof T]: T[K] extends number ? K : never }[keyof T];\n\nclass RowClass<Row> {\n constructor(readonly className: string,\n readonly matches: (row: Row) => boolean) {\n }\n}\n\n\nexport class AbstractTableModel<Row> extends GarbageCollector {\n\n private readonly _columnList = this.registerDisposable(new ColumnListModel<Row>());\n\n private _editorSessions = new MutableListModel<EditSession<Row>>();\n private readonly _rowsBeingEdited: MutableListModel<Row>;\n private readonly rowClassNamePredicates: RowClass<Row>[] = [];\n\n private _columnTextPropertiesLookup: { [columnName: string]: ColumnTextProperties };\n\n readonly identityOf: CanIdentify<Row>['identityOf'];\n private saveCommand: UnaryCommand<DirtyTrackingForm<Row>, boolean>;\n private _editorSessionByRowId: MapModelChain<any, EditSession<Row>>;\n\n readonly editing: BooleanValueModelChain;\n readonly dataSource: ListModelChain<Row>;\n readonly firstEditableColumn: ValueModelChain<ColumnModel<Row>>;\n private selectionColumnModel: SelectionColumnModel<Row>;\n private rowSelectionDisabledOnAllColumns: BooleanValueModelChain;\n private readonly rowClickListeners = new EventListenerList<(row: Row) => void>();\n readonly firstVisibleColumn: ValueModel<ColumnModel<Row>>;\n readonly lastVisibleColumn: ValueModel<ColumnModel<Row>>;\n\n private _createForm: (row: Row) => DirtyTrackingForm<Row> = (row) => new DirtyTrackingForm<Row>();\n\n protected constructor(private sourceOfTruth: ListModel<Row>) {\n super();\n this.identityOf = sourceOfTruth.identityOf;\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this._rowsBeingEdited = new MutableListModel<Row>([], {\n identifiedWith: this.identityOf\n });\n this._editorSessionByRowId = chain(this._editorSessions).indexBy('rowId');\n this.editing = chain(this._editorSessions).count().isGreaterThan(0);\n this.dataSource = chain(this.sourceOfTruth).replaceAll(this.rowsBeingEdited);\n\n this.firstEditableColumn = chain(this.columns).select(c => c.hasEditorPortal()).first();\n this.firstVisibleColumn = chain(this._columnList).first();\n this.lastVisibleColumn = chain(this._columnList).last();\n\n this.rowSelectionDisabledOnAllColumns = chain(this._columnList).select(column => column.isRowSelectionEnabled()).count().equals(0);\n\n }\n\n get rowsBeingEdited(): ListModel<Row> {\n return this._rowsBeingEdited.readonly;\n }\n\n readonly trackBy = (index: number, item: Row) => {\n return this.identityOf ? this.identityOf(item) : index;\n };\n\n get columns(): ListModel<ColumnModel<Row>> {\n return this._columnList.allColumns;\n }\n\n get visibleColumns(): ListModel<ColumnModel<Row>> {\n return this._columnList.readonly;\n }\n\n pluck<P extends Types.ValuePropertiesOf<Row>>(property: P, options?: { columnId: string }): PropertyColumnModel<Row, P> {\n const columnId = options?.columnId || property.toString();\n return this.addColumn(new PropertyColumnModel<Row, P>(columnId, property, () => this.getColumnTextProperties(columnId)));\n }\n\n pluckList<P extends Types.ArrayPropertiesOf<Row>>(property: P, options?: { columnId: string }): ListPropertyColumnModel<Row, P> {\n const columnId = options?.columnId || property.toString();\n return this.addColumn(new ListPropertyColumnModel<Row, P>(columnId, property, () => this.getColumnTextProperties(columnId)));\n }\n\n protected _addSelectionColumn(selectionModel?: SelectionModel<Row>, visible?: ValueModel<boolean> | boolean): SelectionColumnModel<Row> {\n assert.isNil(this.selectionColumnModel);\n const columnId = 'selection-column';\n this.selectionColumnModel = new SelectionColumnModel<Row>(columnId, () => this.getColumnTextProperties(columnId), selectionModel);\n this.addRowClass('aup-row-selected', row => this.selectionColumnModel.isSelected(row));\n const selectionColumnModel = this.addColumn(this.selectionColumnModel, 0);\n if (!_.isNil(visible)) {\n selectionColumnModel.visibleWhile(visible instanceof ValueModel ? visible : ValueModel.constant(visible));\n }\n return selectionColumnModel;\n }\n\n addEditControls(saveCommand: UnaryCommand<DirtyTrackingForm<Row>, boolean>): EditorControlColumnModel<Row> {\n this.saveCommand = saveCommand;\n const columnId = 'editControls';\n return this.addColumn(new EditorControlColumnModel<Row>(columnId, saveCommand, () => this.getColumnTextProperties(columnId)));\n }\n\n addCustomColumn<V>(columnId: string, dataAccessor: (row: Row) => V): CustomValueColumnModel<Row, V> {\n return this.addColumn(new CustomValueColumnModel<Row, V>(columnId, () => this.getColumnTextProperties(columnId), dataAccessor));\n }\n\n addComponentColumn<C extends CellRenderer<Row>>(columnId: string, component: ComponentType<C>, onInit?: OnComponentInit<C>): CustomValueColumnModel<Row, Row>\n addComponentColumn<C extends CellRenderer<Row>>(columnId: string, component: ComponentType<C>, options?: CellRendererOptions<Row, C>): CustomValueColumnModel<Row, Row>\n addComponentColumn<C extends CellRenderer<Row>>(columnId: string, component: ComponentType<C>, onComponentInitOrOptions?: OnComponentInit<C> | CellRendererOptions<Row, C>): CustomValueColumnModel<Row, Row> {\n return this.addColumn(new CustomValueColumnModel<Row, Row>(columnId, () => this.getColumnTextProperties(columnId), row => row)).cellRenderer(component, onComponentInitOrOptions);\n }\n\n addTemplateColumn<V>(columnId: string): CustomTemplateColumnModel<Row> {\n return this.addColumn(new CustomTemplateColumnModel<Row>(columnId, () => this.getColumnTextProperties(columnId)));\n }\n\n addRowClass(className: string, predicate: (row: Row) => boolean) {\n this.rowClassNamePredicates.push(new RowClass<Row>(className, predicate));\n }\n\n getRowClasses(row: Row): string[] {\n const classNames: string[] = [];\n this.rowClassNamePredicates.forEach(i => {\n if (i.matches(row)) {\n classNames.push(i.className);\n }\n });\n return classNames;\n }\n\n useFormFactory(factory: (row: Row) => DirtyTrackingForm<Row>): this {\n this._createForm = factory;\n return this;\n }\n\n protected addColumn<C extends ColumnModel<Row>>(column: C, index?: number): C {\n return this._columnList.addColumn(column, index);\n }\n\n // removeColumn(column: ColumnModel<Row>) {\n //\n // }\n\n columnTextProperties(columnTextProperties: { [columnName: string]: ColumnTextProperties }) {\n this._columnTextPropertiesLookup = columnTextProperties;\n }\n\n getColumnTextProperties(columnId: string): ColumnTextProperties {\n return this._columnTextPropertiesLookup ? this._columnTextPropertiesLookup[columnId] : undefined;\n }\n\n startEditSession(row: Row): EditSession<Row> {\n const rowId = this.identityOf(row);\n if (this._rowsBeingEdited.query().indexOf(row) > -1) {\n return lang.illegalState(`Row with id=${rowId} already being edited`);\n } else {\n const editSession = new EditSession<Row>(rowId, row, this._createForm(row), this.saveCommand);\n const { when } = Dsl.disposeWith(editSession);\n when(editSession.liveRowValue).changes((editedValue) => {\n this._rowsBeingEdited.replaceOrPush(editedValue);\n }, { initialValue: 'triggerChangeUnlessNil' });\n\n this._editorSessions.push(editSession);\n editSession.onDispose(() => {\n this._rowsBeingEdited.remove(editSession.liveRowValue.value);\n this._editorSessions.remove(editSession);\n });\n return editSession;\n }\n }\n\n getEditSessionFor(row: Row): EditSession<Row> {\n return this._editorSessionByRowId.get(this.identityOf(row));\n }\n\n cancelAllEditorSessions() {\n this._editorSessions.runInTransaction((draft) => {\n this._rowsBeingEdited.runInTransaction(() => {\n draft.value.forEach(session => session.dispose());\n });\n });\n }\n\n isRowSelectionEnabledFor(column: ColumnModel<Row>): boolean {\n return this.isRowSelectionEnabled() && column.isRowSelectionEnabled();\n }\n\n isRowSelectionEnabled() {\n return this.hasSelectionModel() && !this.rowSelectionDisabledOnAllColumns.value;\n }\n\n hasSelectionModel() {\n return !!this.selectionColumnModel?.selectionModel.getDelegate();\n }\n\n isHoverEnabled(): boolean {\n return this.isRowSelectionEnabled() || this.rowClickListeners.listenerCount > 0;\n }\n\n isCursorEnabled(column: ColumnModel<Row>) {\n return this.isRowSelectionEnabledFor(column) || this.rowClickListeners.listenerCount > 0;\n }\n\n selectRow(row: Row) {\n this.selectionColumnModel?.selectRow(row);\n }\n\n onRowClicked(callback: (row: Row) => void): Disposable {\n return this.rowClickListeners.add(callback);\n }\n\n _notifyCellClicked(columnModel: ColumnModel<Row>, row: Row) {\n if (this.isRowSelectionEnabledFor(columnModel)) {\n this.selectRow(row);\n }\n this.rowClickListeners.fire(l => l(row));\n }\n}\n\n\nTrackExternal.oneTimeBinding(AbstractTableModel);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"AbstractTableModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"GarbageCollector","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AbstractTableModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"GarbageCollector","line":49,"character":45},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@coolon/pectin","name":"ListModel","line":74,"character":47,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":74,"character":57,"context":{"typeName":"Row"}}]}]}],"pluck":[{"__symbolic":"method"}],"pluckList":[{"__symbolic":"method"}],"_addSelectionColumn":[{"__symbolic":"method"}],"addEditControls":[{"__symbolic":"method"}],"addCustomColumn":[{"__symbolic":"method"}],"addComponentColumn":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"addTemplateColumn":[{"__symbolic":"method"}],"addRowClass":[{"__symbolic":"method"}],"getRowClasses":[{"__symbolic":"method"}],"useFormFactory":[{"__symbolic":"method"}],"addColumn":[{"__symbolic":"method"}],"columnTextProperties":[{"__symbolic":"method"}],"getColumnTextProperties":[{"__symbolic":"method"}],"startEditSession":[{"__symbolic":"method"}],"getEditSessionFor":[{"__symbolic":"method"}],"cancelAllEditorSessions":[{"__symbolic":"method"}],"isRowSelectionEnabledFor":[{"__symbolic":"method"}],"isRowSelectionEnabled":[{"__symbolic":"method"}],"hasSelectionModel":[{"__symbolic":"method"}],"isHoverEnabled":[{"__symbolic":"method"}],"isCursorEnabled":[{"__symbolic":"method"}],"selectRow":[{"__symbolic":"method"}],"onRowClicked":[{"__symbolic":"method"}],"_notifyCellClicked":[{"__symbolic":"method"}]}}}}]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AbstractComputedListModel, Dsl, lang, MutableListModel } from '@coolon/pectin';
|
|
2
|
+
import * as _ from 'lodash';
|
|
3
|
+
export class ColumnListModel extends AbstractComputedListModel {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this._allColumns = new MutableListModel();
|
|
7
|
+
const { chain } = Dsl.disposeWith(this);
|
|
8
|
+
this.columnsById = chain(this._allColumns).indexBy('columnId');
|
|
9
|
+
}
|
|
10
|
+
get allColumns() {
|
|
11
|
+
return this._allColumns.readonly;
|
|
12
|
+
}
|
|
13
|
+
getColumn(id) {
|
|
14
|
+
return this.columnsById.get(id);
|
|
15
|
+
}
|
|
16
|
+
hasColumn(id) {
|
|
17
|
+
return !!this.columnsById.get(id);
|
|
18
|
+
}
|
|
19
|
+
addColumn(column, index) {
|
|
20
|
+
if (this.hasColumn(column.columnId)) {
|
|
21
|
+
lang.illegalState(`Column with id=${column.columnId} already exists`);
|
|
22
|
+
}
|
|
23
|
+
this.runInTransaction(() => {
|
|
24
|
+
if (!_.isNil(index)) {
|
|
25
|
+
this._allColumns.insert(index, column);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this._allColumns.push(column);
|
|
29
|
+
}
|
|
30
|
+
this.trackSource(column.visible);
|
|
31
|
+
});
|
|
32
|
+
return column;
|
|
33
|
+
}
|
|
34
|
+
doComputeValue() {
|
|
35
|
+
return this._allColumns.value.filter(c => c.visible.value);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=column-list-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-list-model.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/column-list-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,GAAG,EAAE,IAAI,EAA4B,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,MAAM,OAAO,eAAqB,SAAQ,yBAAoD;IAK5F;QACE,KAAK,EAAE,CAAC;QAJO,gBAAW,GAAG,IAAI,gBAAgB,EAAoB,CAAC;QAKtE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACjE,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,SAAS,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IAED,SAAS,CAAC,EAAU;QAClB,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,SAAS,CAA6B,MAAS,EAAE,KAAc;QAC7D,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;YACnC,IAAI,CAAC,YAAY,CAAC,kBAAkB,MAAM,CAAC,QAAQ,iBAAiB,CAAC,CAAC;SACvE;QACD,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;YACzB,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;gBACnB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;aACxC;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aAC/B;YACD,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC;CACF","sourcesContent":["import { AbstractComputedListModel, Dsl, lang, ListModel, MapModelChain, MutableListModel } from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { ColumnModel } from './table/column-model';\n\nexport class ColumnListModel<Row> extends AbstractComputedListModel<ColumnModel<Row>, boolean> {\n\n private readonly _allColumns = new MutableListModel<ColumnModel<Row>>();\n private readonly columnsById: MapModelChain<string, ColumnModel<Row>>;\n\n constructor() {\n super();\n const { chain } = Dsl.disposeWith(this);\n this.columnsById = chain(this._allColumns).indexBy('columnId');\n }\n\n get allColumns(): ListModel<ColumnModel<Row>> {\n return this._allColumns.readonly;\n }\n\n getColumn(id: string): ColumnModel<Row> {\n return this.columnsById.get(id);\n }\n\n hasColumn(id: string): boolean {\n return !!this.columnsById.get(id);\n }\n\n addColumn<C extends ColumnModel<Row>>(column: C, index?: number): C {\n if (this.hasColumn(column.columnId)) {\n lang.illegalState(`Column with id=${column.columnId} already exists`);\n }\n this.runInTransaction(() => {\n if (!_.isNil(index)) {\n this._allColumns.insert(index, column);\n } else {\n this._allColumns.push(column);\n }\n this.trackSource(column.visible);\n });\n return column;\n }\n\n doComputeValue(): ColumnModel<Row>[] {\n return this._allColumns.value.filter(c => c.visible.value);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ColumnListModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"AbstractComputedListModel","line":4,"character":42},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor"}],"getColumn":[{"__symbolic":"method"}],"hasColumn":[{"__symbolic":"method"}],"addColumn":[{"__symbolic":"method"}],"doComputeValue":[{"__symbolic":"method"}]}}}}]
|
|
@@ -2765,35 +2765,55 @@ ColumnTemplateDirective.propDecorators = {
|
|
|
2765
2765
|
aupColumnTemplateAutoPadChild: [{ type: Input }]
|
|
2766
2766
|
};
|
|
2767
2767
|
|
|
2768
|
-
|
|
2769
|
-
// export type NumberPropertiesOf<T> = { [K in keyof T]: T[K] extends number ? K : never }[keyof T];
|
|
2770
|
-
class RowClass {
|
|
2771
|
-
constructor(className, matches) {
|
|
2772
|
-
this.className = className;
|
|
2773
|
-
this.matches = matches;
|
|
2774
|
-
}
|
|
2775
|
-
}
|
|
2776
|
-
class VisibleColumnListModel extends AbstractComputedListModel {
|
|
2768
|
+
class ColumnListModel extends AbstractComputedListModel {
|
|
2777
2769
|
constructor() {
|
|
2778
|
-
super(
|
|
2779
|
-
this.
|
|
2770
|
+
super();
|
|
2771
|
+
this._allColumns = new MutableListModel();
|
|
2772
|
+
const { chain } = Dsl.disposeWith(this);
|
|
2773
|
+
this.columnsById = chain(this._allColumns).indexBy('columnId');
|
|
2774
|
+
}
|
|
2775
|
+
get allColumns() {
|
|
2776
|
+
return this._allColumns.readonly;
|
|
2777
|
+
}
|
|
2778
|
+
getColumn(id) {
|
|
2779
|
+
return this.columnsById.get(id);
|
|
2780
2780
|
}
|
|
2781
|
-
|
|
2781
|
+
hasColumn(id) {
|
|
2782
|
+
return !!this.columnsById.get(id);
|
|
2783
|
+
}
|
|
2784
|
+
addColumn(column, index) {
|
|
2785
|
+
if (this.hasColumn(column.columnId)) {
|
|
2786
|
+
lang.illegalState(`Column with id=${column.columnId} already exists`);
|
|
2787
|
+
}
|
|
2782
2788
|
this.runInTransaction(() => {
|
|
2783
|
-
|
|
2789
|
+
if (!_.isNil(index)) {
|
|
2790
|
+
this._allColumns.insert(index, column);
|
|
2791
|
+
}
|
|
2792
|
+
else {
|
|
2793
|
+
this._allColumns.push(column);
|
|
2794
|
+
}
|
|
2784
2795
|
this.trackSource(column.visible);
|
|
2785
2796
|
});
|
|
2797
|
+
return column;
|
|
2786
2798
|
}
|
|
2787
2799
|
doComputeValue() {
|
|
2788
|
-
return this.
|
|
2800
|
+
return this._allColumns.value.filter(c => c.visible.value);
|
|
2801
|
+
}
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
// export type StringPropertiesOf<T> = { [K in keyof T]: T[K] extends string ? K : never }[keyof T];
|
|
2805
|
+
// export type NumberPropertiesOf<T> = { [K in keyof T]: T[K] extends number ? K : never }[keyof T];
|
|
2806
|
+
class RowClass {
|
|
2807
|
+
constructor(className, matches) {
|
|
2808
|
+
this.className = className;
|
|
2809
|
+
this.matches = matches;
|
|
2789
2810
|
}
|
|
2790
2811
|
}
|
|
2791
2812
|
class AbstractTableModel extends GarbageCollector {
|
|
2792
2813
|
constructor(sourceOfTruth) {
|
|
2793
2814
|
super();
|
|
2794
2815
|
this.sourceOfTruth = sourceOfTruth;
|
|
2795
|
-
this.
|
|
2796
|
-
this._visibleColumnTracker = new VisibleColumnListModel();
|
|
2816
|
+
this._columnList = this.registerDisposable(new ColumnListModel());
|
|
2797
2817
|
this._editorSessions = new MutableListModel();
|
|
2798
2818
|
this.rowClassNamePredicates = [];
|
|
2799
2819
|
this.rowClickListeners = new EventListenerList();
|
|
@@ -2803,7 +2823,6 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
2803
2823
|
};
|
|
2804
2824
|
this.identityOf = sourceOfTruth.identityOf;
|
|
2805
2825
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
2806
|
-
this._columnsById = chain(this._columns).indexBy('columnId');
|
|
2807
2826
|
this._rowsBeingEdited = new MutableListModel([], {
|
|
2808
2827
|
identifiedWith: this.identityOf
|
|
2809
2828
|
});
|
|
@@ -2811,18 +2830,18 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
2811
2830
|
this.editing = chain(this._editorSessions).count().isGreaterThan(0);
|
|
2812
2831
|
this.dataSource = chain(this.sourceOfTruth).replaceAll(this.rowsBeingEdited);
|
|
2813
2832
|
this.firstEditableColumn = chain(this.columns).select(c => c.hasEditorPortal()).first();
|
|
2814
|
-
this.firstVisibleColumn = chain(this.
|
|
2815
|
-
this.lastVisibleColumn = chain(this.
|
|
2816
|
-
this.rowSelectionDisabledOnAllColumns = chain(this.
|
|
2833
|
+
this.firstVisibleColumn = chain(this._columnList).first();
|
|
2834
|
+
this.lastVisibleColumn = chain(this._columnList).last();
|
|
2835
|
+
this.rowSelectionDisabledOnAllColumns = chain(this._columnList).select(column => column.isRowSelectionEnabled()).count().equals(0);
|
|
2817
2836
|
}
|
|
2818
2837
|
get rowsBeingEdited() {
|
|
2819
2838
|
return this._rowsBeingEdited.readonly;
|
|
2820
2839
|
}
|
|
2821
2840
|
get columns() {
|
|
2822
|
-
return this.
|
|
2841
|
+
return this._columnList.allColumns;
|
|
2823
2842
|
}
|
|
2824
2843
|
get visibleColumns() {
|
|
2825
|
-
return this.
|
|
2844
|
+
return this._columnList.readonly;
|
|
2826
2845
|
}
|
|
2827
2846
|
pluck(property, options) {
|
|
2828
2847
|
const columnId = (options === null || options === void 0 ? void 0 : options.columnId) || property.toString();
|
|
@@ -2837,7 +2856,7 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
2837
2856
|
const columnId = 'selection-column';
|
|
2838
2857
|
this.selectionColumnModel = new SelectionColumnModel(columnId, () => this.getColumnTextProperties(columnId), selectionModel);
|
|
2839
2858
|
this.addRowClass('aup-row-selected', row => this.selectionColumnModel.isSelected(row));
|
|
2840
|
-
const selectionColumnModel = this.addColumn(this.selectionColumnModel);
|
|
2859
|
+
const selectionColumnModel = this.addColumn(this.selectionColumnModel, 0);
|
|
2841
2860
|
if (!_.isNil(visible)) {
|
|
2842
2861
|
selectionColumnModel.visibleWhile(visible instanceof ValueModel ? visible : ValueModel.constant(visible));
|
|
2843
2862
|
}
|
|
@@ -2873,15 +2892,8 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
2873
2892
|
this._createForm = factory;
|
|
2874
2893
|
return this;
|
|
2875
2894
|
}
|
|
2876
|
-
addColumn(column) {
|
|
2877
|
-
|
|
2878
|
-
lang.illegalState(`Column with id=${column.columnId} already exists`);
|
|
2879
|
-
}
|
|
2880
|
-
else {
|
|
2881
|
-
this._columns.push(column);
|
|
2882
|
-
this._visibleColumnTracker.addColumn(column);
|
|
2883
|
-
}
|
|
2884
|
-
return column;
|
|
2895
|
+
addColumn(column, index) {
|
|
2896
|
+
return this._columnList.addColumn(column, index);
|
|
2885
2897
|
}
|
|
2886
2898
|
// removeColumn(column: ColumnModel<Row>) {
|
|
2887
2899
|
//
|
|
@@ -8383,5 +8395,5 @@ VisibilityService.ctorParameters = () => [
|
|
|
8383
8395
|
* Generated bundle index. Do not edit.
|
|
8384
8396
|
*/
|
|
8385
8397
|
|
|
8386
|
-
export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT, AbstractActivityTriggerComponent, AbstractInputActivity, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractTableComponent, AbstractTableModel, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityBodyComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, ActivityTitleComponent, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnModel, ColumnTemplateDirective, CommandComponent, CommandContainer, CommandDirective, CommandFace, CommandFaceComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DecoratedTreeNode, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EventCleanUpSession, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, HEADER_CELL_RENDERER_PORTAL, HighlightPipe, HighlightTextModelDirective, HorizontalAlignment, IconComponent, InPlaceInteractionContextComponent, InlineActivityTriggerComponent, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ListPropertyColumnModel, ModalActivityTriggerComponent, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NotAuthorisedNoticeComponent, NumberInputComponent, POPUP_CONTAINER, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, PaginatorComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceAccessGuard, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupActivityTriggerComponent, PopupAwareComponent, PopupInteractionContextComponent, PopupMenuComponent, PopupMenuRendererComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectCellRendererComponent, SelectHeaderCellRendererComponent, SelectInputActivity, SelectInputComponent, SelectionColumnModel, SelfAndDescendantsVisitor, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellRendererComponent, TableComponent, TableHeaderCellRendererComponent, TableModel, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, TreeExpansionModel, TreeInheritanceIconComponent, TreeLabelCellRendererComponent, TreeLabelColumnModel, TreeTableComponent, TreeTableModel, TreeToListModel, UrlService, UrlSnapshot, VerticalFocusContainerComponent, VisibilityService, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, ɵ0 };
|
|
8398
|
+
export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT, AbstractActivityTriggerComponent, AbstractInputActivity, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractTableComponent, AbstractTableModel, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityBodyComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, ActivityTitleComponent, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnListModel, ColumnModel, ColumnTemplateDirective, CommandComponent, CommandContainer, CommandDirective, CommandFace, CommandFaceComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DecoratedTreeNode, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EventCleanUpSession, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, HEADER_CELL_RENDERER_PORTAL, HighlightPipe, HighlightTextModelDirective, HorizontalAlignment, IconComponent, InPlaceInteractionContextComponent, InlineActivityTriggerComponent, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ListPropertyColumnModel, ModalActivityTriggerComponent, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NotAuthorisedNoticeComponent, NumberInputComponent, POPUP_CONTAINER, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, PaginatorComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceAccessGuard, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupActivityTriggerComponent, PopupAwareComponent, PopupInteractionContextComponent, PopupMenuComponent, PopupMenuRendererComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectCellRendererComponent, SelectHeaderCellRendererComponent, SelectInputActivity, SelectInputComponent, SelectionColumnModel, SelfAndDescendantsVisitor, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellRendererComponent, TableComponent, TableHeaderCellRendererComponent, TableModel, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, TreeExpansionModel, TreeInheritanceIconComponent, TreeLabelCellRendererComponent, TreeLabelColumnModel, TreeTableComponent, TreeTableModel, TreeToListModel, UrlService, UrlSnapshot, VerticalFocusContainerComponent, VisibilityService, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, ɵ0 };
|
|
8387
8399
|
//# sourceMappingURL=coolon-angular-ui-powerups.js.map
|