@coolon/angular-ui-powerups 12.0.6 → 12.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/coolon-angular-ui-powerups.umd.js +300 -300
- 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 +11 -6
- 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/abstract-table.component.js.map +1 -1
- package/esm2015/lib/components/tables/table/table-model.js +18 -12
- package/esm2015/lib/components/tables/table/table-model.js.map +1 -1
- package/esm2015/lib/components/tables/table/table-model.metadata.json +1 -1
- package/esm2015/lib/components/tables/tree-table/decorated-tree-node.js +151 -146
- package/esm2015/lib/components/tables/tree-table/decorated-tree-node.js.map +1 -1
- package/esm2015/lib/components/tables/tree-table/decorated-tree-node.metadata.json +1 -1
- package/esm2015/lib/components/tables/tree-table/flattened-tree-list-model.js +29 -0
- package/esm2015/lib/components/tables/tree-table/flattened-tree-list-model.js.map +1 -0
- package/esm2015/lib/components/tables/tree-table/flattened-tree-list-model.metadata.json +1 -0
- package/esm2015/lib/components/tables/tree-table/tree-expansion-model.js +9 -8
- package/esm2015/lib/components/tables/tree-table/tree-expansion-model.js.map +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.js.map +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.metadata.json +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.js +9 -9
- package/esm2015/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.js.map +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.metadata.json +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-label-column-model.js.map +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-label-column-model.metadata.json +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-table-component.js.map +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-table-component.metadata.json +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-table-model.js +9 -20
- package/esm2015/lib/components/tables/tree-table/tree-table-model.js.map +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-table-model.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +240 -228
- 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 +6 -5
- package/lib/components/tables/table/table-model.d.ts +12 -7
- package/lib/components/tables/tree-table/decorated-tree-node.d.ts +26 -40
- package/lib/components/tables/tree-table/{tree-to-list-model.d.ts → flattened-tree-list-model.d.ts} +4 -4
- package/lib/components/tables/tree-table/tree-expansion-model.d.ts +10 -11
- package/lib/components/tables/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.d.ts +1 -2
- package/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.d.ts +5 -5
- package/lib/components/tables/tree-table/tree-label-column-model.d.ts +4 -6
- package/lib/components/tables/tree-table/tree-table-component.d.ts +2 -3
- package/lib/components/tables/tree-table/tree-table-model.d.ts +9 -8
- package/package.json +14 -14
- package/esm2015/lib/components/tables/tree-table/tree-to-list-model.js +0 -25
- package/esm2015/lib/components/tables/tree-table/tree-to-list-model.js.map +0 -1
- package/esm2015/lib/components/tables/tree-table/tree-to-list-model.metadata.json +0 -1
|
@@ -64,12 +64,12 @@ export * from "./tables/table/table-cell-renderer/table-cell-renderer.component"
|
|
|
64
64
|
export * from "./tables/table/table-header-cell-renderer/table-header-cell-renderer.component";
|
|
65
65
|
export * from "./tables/table/table-row-menu/table-row-menu.component";
|
|
66
66
|
export * from "./tables/tree-table/decorated-tree-node";
|
|
67
|
+
export * from "./tables/tree-table/flattened-tree-list-model";
|
|
67
68
|
export * from "./tables/tree-table/tree-expansion-model";
|
|
68
69
|
export * from "./tables/tree-table/tree-label-column-model";
|
|
69
70
|
export * from "./tables/tree-table/tree-node";
|
|
70
71
|
export * from "./tables/tree-table/tree-table-component";
|
|
71
72
|
export * from "./tables/tree-table/tree-table-model";
|
|
72
|
-
export * from "./tables/tree-table/tree-to-list-model";
|
|
73
73
|
export * from "./tables/tree-table/visitable.class";
|
|
74
74
|
export * from "./tables/tree-table/tree-inheritance-icon/tree-inheritance-icon.component";
|
|
75
75
|
export * from "./tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component";
|
|
@@ -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,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,cAA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;AACrD,cAAc,
|
|
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,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yDAAyD,CAAC;AACxE,cAAc,iDAAiD,CAAC;AAChE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yCAAyC,CAAC;AACxD,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+CAA+C,CAAC;AAC9D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,0BAA0B,CAAC;AACzC,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,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,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/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/flattened-tree-list-model\";\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/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/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-
|
|
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/flattened-tree-list-model"},{"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/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,4 +1,4 @@
|
|
|
1
|
-
import { assert, DirtyTrackingForm, Dsl, EventListenerList, GarbageCollector, lang, MutableListModel, TrackExternal, ValueModel } from '@coolon/pectin';
|
|
1
|
+
import { assert, DelegatingListModel, DirtyTrackingForm, Dsl, EventListenerList, GarbageCollector, lang, MutableListModel, TrackExternal, ValueModel } from '@coolon/pectin';
|
|
2
2
|
import * as _ from 'lodash';
|
|
3
3
|
import { ColumnListModel } from './column-list-model';
|
|
4
4
|
import { CustomTemplateColumnModel, CustomValueColumnModel, EditorControlColumnModel, ListPropertyColumnModel, PropertyColumnModel, SelectionColumnModel } from './table/column-model';
|
|
@@ -12,9 +12,9 @@ class RowClass {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
export class AbstractTableModel extends GarbageCollector {
|
|
15
|
-
constructor(
|
|
15
|
+
constructor() {
|
|
16
16
|
super();
|
|
17
|
-
this.
|
|
17
|
+
this._dataSource = new DelegatingListModel();
|
|
18
18
|
this._columnList = this.registerDisposable(new ColumnListModel());
|
|
19
19
|
this._editorSessions = new MutableListModel();
|
|
20
20
|
this.rowClassNamePredicates = [];
|
|
@@ -23,19 +23,24 @@ export class AbstractTableModel extends GarbageCollector {
|
|
|
23
23
|
this.trackBy = (index, item) => {
|
|
24
24
|
return this.identityOf ? this.identityOf(item) : index;
|
|
25
25
|
};
|
|
26
|
-
this.identityOf = sourceOfTruth.identityOf;
|
|
27
26
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
28
27
|
this._rowsBeingEdited = new MutableListModel([], {
|
|
29
|
-
identifiedWith: this.identityOf
|
|
28
|
+
identifiedWith: row => this.identityOf(row)
|
|
30
29
|
});
|
|
31
30
|
this._editorSessionByRowId = chain(this._editorSessions).indexBy('rowId');
|
|
32
31
|
this.editing = chain(this._editorSessions).count().isGreaterThan(0);
|
|
33
|
-
this.dataSource = chain(this.
|
|
32
|
+
this.dataSource = chain(this._dataSource).replaceAll(this.rowsBeingEdited);
|
|
34
33
|
this.firstEditableColumn = chain(this.columns).select(c => c.hasEditorPortal()).first();
|
|
35
34
|
this.firstVisibleColumn = chain(this._columnList).first();
|
|
36
35
|
this.lastVisibleColumn = chain(this._columnList).last();
|
|
37
36
|
this.rowSelectionDisabledOnAllColumns = chain(this._columnList).select(column => column.isRowSelectionEnabled()).count().equals(0);
|
|
38
37
|
}
|
|
38
|
+
setDataSource(sourceOfTruth) {
|
|
39
|
+
this._dataSource.setDelegate(sourceOfTruth);
|
|
40
|
+
}
|
|
41
|
+
identityOf(row) {
|
|
42
|
+
return this._dataSource.identityOf(row);
|
|
43
|
+
}
|
|
39
44
|
get rowsBeingEdited() {
|
|
40
45
|
return this._rowsBeingEdited.readonly;
|
|
41
46
|
}
|
|
@@ -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,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,YAA2B,aAA6B;QACtD,KAAK,EAAE,CAAC;QADiB,kBAAa,GAAb,aAAa,CAAgB;QAvBvC,gBAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,eAAe,EAAO,CAAC,CAAC;QAE3E,oBAAe,GAAG,IAAI,gBAAgB,EAAoB,CAAC;QAElD,2BAAsB,GAAoB,EAAE,CAAC;QAa7C,sBAAiB,GAAG,IAAI,iBAAiB,EAAsB,CAAC;QAIzE,gBAAW,GAAyC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,iBAAiB,EAAO,CAAC;QAyBzF,YAAO,GAAG,CAAC,KAAa,EAAE,IAAS,EAAE,EAAE;YAC9C,OAAO,IAAI,CAAC,UAAU,C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AC,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 public 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
|
+
{"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,EAEN,mBAAmB,EACnB,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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CAAC;IAClF,CAAC;IAED,iBAAiB;;QACf,OAAO,CAAC,CAAC,CAAA,MAAA,IAAI,CAAC,oBAAoB,0CAAE,cAAc,CAAC,WAAW,EAAE,CAAA,CAAC;IACnE,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,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 assert,\n BooleanValueModelChain,\n DelegatingListModel,\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 _dataSource = new DelegatingListModel<Row>();\n readonly dataSource: ListModelChain<Row>;\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 private saveCommand: UnaryCommand<DirtyTrackingForm<Row>, boolean>;\n private _editorSessionByRowId: MapModelChain<any, EditSession<Row>>;\n\n readonly editing: BooleanValueModelChain;\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 public constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this._rowsBeingEdited = new MutableListModel<Row>([], {\n identifiedWith: row => this.identityOf(row)\n });\n this._editorSessionByRowId = chain(this._editorSessions).indexBy('rowId');\n this.editing = chain(this._editorSessions).count().isGreaterThan(0);\n this.dataSource = chain(this._dataSource).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 protected setDataSource(sourceOfTruth: ListModel<Row>) {\n this._dataSource.setDelegate(sourceOfTruth);\n }\n\n identityOf(row: Row): any {\n return this._dataSource.identityOf(row);\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":49,"character":45},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","
|
|
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"}],"setDataSource":[{"__symbolic":"method"}],"identityOf":[{"__symbolic":"method"}],"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"}]}}}}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-table.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/abstract-table.component.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,WAAW,EACX,KAAK,EACL,MAAM,EAIP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,GAAG,EAGH,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,UAAU,EACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAe,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAKH,MAAM,OAAO,sBAA4B,SAAQ,oBAAoB;IAiCnE,YAAY,UAAsB,EAAE,MAAc;QAChD,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAxB5B;;;;WAIG;QAGH,oBAAe,GAAG,KAAK,CAAC;QASxB,kEAAkE;QACjD,iBAAY,GAAG,IAAI,iBAAiB,CAAS,EAAE,CAAC,CAAC;QACjD,cAAS,GAAG,IAAI,iBAAiB,CAAS,EAAE,CAAC,CAAC;QAG/D,iBAAY,GAAG,qBAAqB,CAAC;QAInC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAE9C,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAChE,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5C,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAErC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YAC1D,4GAA4G;YAC5G,MAAM,WAAW,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,kBAAkB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;YACtF,OAAO,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACvD,CAAC,EAAE;YACD,SAAS,EAAE,CAAC,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAAC;YAC/C,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;SAC5E,CAAC,CAAC;IAEL,CAAC;IAED,IACI,UAAU;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;IAC1B,CAAC;
|
|
1
|
+
{"version":3,"file":"abstract-table.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/abstract-table.component.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,WAAW,EACX,KAAK,EACL,MAAM,EAIP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,GAAG,EAGH,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,UAAU,EACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAe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AAC,iBAAiB,CAAC;;0DACjB","sourcesContent":["import {\n Component,\n ElementRef,\n HostBinding,\n Input,\n NgZone,\n OnInit,\n TemplateRef,\n ViewContainerRef\n} from '@angular/core';\nimport {\n Dsl, ListModel,\n ListModelChain,\n MapModelChain,\n MutableValueModel,\n StoreInValueModel,\n TrackExternal,\n ValueModel\n} from '@coolon/pectin';\nimport { lang } from '@coolon/typescript-utilities';\nimport { ResizeAwareComponent } from '../resize-aware.component';\nimport { AbstractTableModel } from './abstract-table-model';\nimport { ColumnModel, CustomTemplateColumnModel } from './table/column-model';\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 *\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@Component({\n selector: 'aup-abstract-table',\n template: ''\n})\nexport class AbstractTableComponent<Row> extends ResizeAwareComponent implements OnInit {\n\n @Input()\n @TrackExternal({ defaultValue: true })\n showHeaderModel: ValueModel<boolean>;\n\n @Input()\n @StoreInValueModel('showHeaderModel')\n showHeader: boolean;\n\n /**\n * Set to true to enable scrolling. Once enabled the table will have 0 implicit height. You will either\n * need to set it explicitly e.g. height: 400px; or by using flex or grid layout to make it fill it's\n * containment area.\n */\n @Input()\n @HostBinding('class.enable-scrolling')\n enableScrolling = false;\n\n columns: ListModelChain<ColumnModel<Row>>;\n columnIds: ListModelChain<string>;\n private columnsById: MapModelChain<string, ColumnModel<Row>>;\n\n readonly visibleRowCount: ValueModel<number>;\n\n\n // TODO: support user defined header and row heights via css vars.\n private readonly headerHeight = new MutableValueModel<number>(56);\n private readonly rowHeight = new MutableValueModel<number>(48);\n\n @HostBinding('class')\n baseCssClass = 'aup-table-component';\n\n constructor(elementRef: ElementRef, ngZone: NgZone) {\n super(elementRef, ngZone);\n const { chain, when } = Dsl.disposeWith(this);\n\n const actualHeaderHeight = chain(this.showHeaderModel).map(show => {\n return show ? this.headerHeight.value : 0;\n }, { dependsOn: this.headerHeight });\n\n this.visibleRowCount = chain(this.boundsModel).map(bounds => {\n // TODO: this doesn't take into account any css styling adjustments etc. Will invistigate if it's an issue.\n const rawRowCount = (bounds.height - actualHeaderHeight.value) / this.rowHeight.value;\n return rawRowCount < 1 ? 0 : Math.floor(rawRowCount);\n }, {\n dependsOn: [actualHeaderHeight, this.rowHeight],\n postponeWhile: chain(this.boundsModel).pluckNumeric('height').isLessThan(1)\n });\n\n }\n\n @HostBinding('class.hide-header')\n get hideHeader() {\n return !this.showHeader;\n }\n\n getModel(): AbstractTableModel<Row> {\n return lang.abstractMethod(this.constructor);\n }\n\n ngOnInit(): void {\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.columns = chain(this.getModel().columns);\n this.columnIds = chain(this.columns).pluck('columnId');\n this.columnsById = chain(this.columns).indexBy('columnId');\n }\n\n isEditing(row: Row): boolean {\n return !!this.getModel().getEditSessionFor(row);\n }\n\n registerColumnTemplate(columnId: string, templateRef: TemplateRef<any>, viewContainer: ViewContainerRef, fillCell: boolean, padChild: boolean) {\n const column = this.columnsById.get(columnId);\n if (column instanceof CustomTemplateColumnModel) {\n column.setTemplate(templateRef, viewContainer, fillCell, padChild);\n }\n }\n\n notifyCellClicked(columnModel: ColumnModel<Row>, row: Row) {\n this.getModel()._notifyCellClicked(columnModel, row);\n }\n\n // @Trace()\n isFirstVisibleColumn(columnId: string): boolean {\n return this.getModel().firstVisibleColumn.query().value?.columnId === columnId;\n }\n\n // @Trace()\n isLastVisibleColumn(columnId: string): boolean {\n return this.getModel().lastVisibleColumn.query().value?.columnId === columnId;\n }\n\n getColumnClasses(columnId: string) {\n const classes = [`aup-col-${this.columnsById.get(columnId).dasherisedColumnId}`];\n if (this.isFirstVisibleColumn(columnId)) {\n classes.push('first-visible-column');\n }\n if (this.isLastVisibleColumn(columnId)) {\n classes.push('last-visible-column');\n }\n return classes;\n }\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import { AbstractTableModel } from '../abstract-table-model';
|
|
|
2
2
|
/**
|
|
3
3
|
* Example:
|
|
4
4
|
* @example
|
|
5
|
-
* const model = TableModel
|
|
5
|
+
* const model = new TableModel(heroList, table => {
|
|
6
6
|
* table.pluck("firstName");
|
|
7
7
|
* table.pluck("lastName");
|
|
8
8
|
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
@@ -34,7 +34,7 @@ import { AbstractTableModel } from '../abstract-table-model';
|
|
|
34
34
|
*
|
|
35
35
|
* Selection models
|
|
36
36
|
* @example
|
|
37
|
-
* const model = TableModel
|
|
37
|
+
* const model = new TableModel(heroList, table => {
|
|
38
38
|
* table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
|
|
39
39
|
* table.pluck("firstName");
|
|
40
40
|
* table.pluck("lastName");
|
|
@@ -42,7 +42,7 @@ import { AbstractTableModel } from '../abstract-table-model';
|
|
|
42
42
|
*
|
|
43
43
|
* Custom cell renderers and editors
|
|
44
44
|
* @example
|
|
45
|
-
* const model = TableModel
|
|
45
|
+
* const model = new TableModel(heroList, table => {
|
|
46
46
|
* table.pluck("favoriteColor")
|
|
47
47
|
* .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {
|
|
48
48
|
* // configure your component with what ever you need.
|
|
@@ -54,7 +54,7 @@ import { AbstractTableModel } from '../abstract-table-model';
|
|
|
54
54
|
*
|
|
55
55
|
* Template columns
|
|
56
56
|
* @example
|
|
57
|
-
* const model = TableModel
|
|
57
|
+
* const model = new TableModel(heroList, table => {
|
|
58
58
|
* table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
|
|
59
59
|
* table.addTemplateColumn("myTemplate");
|
|
60
60
|
* });
|
|
@@ -71,7 +71,7 @@ import { AbstractTableModel } from '../abstract-table-model';
|
|
|
71
71
|
* fullName:
|
|
72
72
|
* headerText: "Full Name"
|
|
73
73
|
*
|
|
74
|
-
* const model = TableModel
|
|
74
|
+
* const model = new TableModel(heroList, table => {
|
|
75
75
|
* table.pluck("favoriteColor").cellRenderer(...).cellEditor(...);
|
|
76
76
|
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
77
77
|
*
|
|
@@ -79,14 +79,20 @@ import { AbstractTableModel } from '../abstract-table-model';
|
|
|
79
79
|
* });
|
|
80
80
|
*/
|
|
81
81
|
export class TableModel extends AbstractTableModel {
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
constructor(sourceOfTruth, builder) {
|
|
83
|
+
super();
|
|
84
|
+
if (builder) {
|
|
85
|
+
builder(this);
|
|
86
|
+
}
|
|
87
|
+
this.setDataSource(sourceOfTruth);
|
|
84
88
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
/**
|
|
90
|
+
* @deprecated use new TableModel(sourceOfTruth, table => {...}); instead.
|
|
91
|
+
* @param sourceOfTruth
|
|
92
|
+
* @param builder
|
|
93
|
+
*/
|
|
94
|
+
static fromList(sourceOfTruth, builder) {
|
|
95
|
+
return new TableModel(sourceOfTruth, builder);
|
|
90
96
|
}
|
|
91
97
|
addSelectionColumn(selectionModel, showSelectionColumn) {
|
|
92
98
|
return this._addSelectionColumn(selectionModel, showSelectionColumn);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-model.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/table/table-model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8EG;AACH,MAAM,OAAO,UAAgB,SAAQ,kBAAuB;IAE1D,
|
|
1
|
+
{"version":3,"file":"table-model.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/table/table-model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8EG;AACH,MAAM,OAAO,UAAgB,SAAQ,kBAAuB;IAE1D,YAAY,aAA6B,EAAE,OAA0C;QACnF,KAAK,EAAE,CAAC;QACR,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,IAAI,CAAC,CAAC;SACf;QACD,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAM,aAA6B,EAAE,OAA+C;QACjG,OAAO,IAAI,UAAU,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAGD,kBAAkB,CAAC,cAAoC,EAAE,mBAAmD;QAC1G,OAAO,IAAI,CAAC,mBAAmB,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;IACvE,CAAC;CACF","sourcesContent":["import { Constructable, ListModel, SelectionModel, ValueModel } from '@coolon/pectin';\nimport { AbstractTableModel } from '../abstract-table-model';\nimport { SelectionColumnModel } from './column-model';\n\n/**\n * Example:\n * @example\n * const model = new TableModel(heroList, table => {\n * table.pluck(\"firstName\");\n * table.pluck(\"lastName\");\n * table.addCustomColumn(\"fullName\", hero => `${hero.firstName} ${hero.lastName}`);\n * });\n *\n * Editable tables\n * @example\n * const saveCommand = UnaryCommand.create((form: Form<Hero>) => {\n * if (form.validate()) {\n * // normal form save stuff\n * return true; // finish editing\n * }\n * return false; // continue editiing\n * }\n * const colorsNames: ListModel<string> = ...;\n * const model = TableModel.fromList(heroList, table => {\n * table.pluck(\"firstName\").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }\n * table.pluck(\"lastName\").cellEditor(StringInputComponent, {\n * validators: [Validator.present(\"We need a last name\")]\n * });\n * table.pluck(\"age\").cellEditor(NumberInputComponent);\n * table.pluck(\"favoriteColor\").cellEditor(SelectInputComponent, {\n * initialiseComponent(component: SelectInputComponent) {\n * selectInput.optionsModel = colorsNames; // <- initialise our component\n * }\n * });\n * table.addEditControls(saveCommand); // <- required to enable editing\n * });\n *\n * Selection models\n * @example\n * const model = new TableModel(heroList, table => {\n * table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model\n * table.pluck(\"firstName\");\n * table.pluck(\"lastName\");\n * });\n *\n * Custom cell renderers and editors\n * @example\n * const model = new TableModel(heroList, table => {\n * table.pluck(\"favoriteColor\")\n * .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {\n * // configure your component with what ever you need.\n * });\n * .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }\n * .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }\n * table.addCustomColumn(\"fullName\", hero => `${hero.firstName} ${hero.lastName}`);\n * });\n *\n * Template columns\n * @example\n * const model = new TableModel(heroList, table => {\n * table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model\n * table.addTemplateColumn(\"myTemplate\");\n * });\n *\n * <div *aupColumnTemplate=\"let hero; columnId: 'myTemplate'\">{{hero.age}}</div>\n *\n * I18n\n * @example\n * [table.yml]\n * table:\n * columns(ColumnTextProperties[]):\n * firstName:\n * headerText: \"First Name\"\n * fullName:\n * headerText: \"Full Name\"\n *\n * const model = new TableModel(heroList, table => {\n * table.pluck(\"favoriteColor\").cellRenderer(...).cellEditor(...);\n * table.addCustomColumn(\"fullName\", hero => `${hero.firstName} ${hero.lastName}`);\n *\n * table.columnTextProperties(I18n.table.columns); // <- configures all columns\n * });\n */\nexport class TableModel<Row> extends AbstractTableModel<Row> {\n\n constructor(sourceOfTruth: ListModel<Row>, builder?: (table: TableModel<Row>) => void) {\n super();\n if (builder) {\n builder(this);\n }\n this.setDataSource(sourceOfTruth);\n }\n\n /**\n * @deprecated use new TableModel(sourceOfTruth, table => {...}); instead.\n * @param sourceOfTruth\n * @param builder\n */\n static fromList<Row>(sourceOfTruth: ListModel<Row>, builder?: (tableModel: TableModel<Row>) => void): TableModel<Row> {\n return new TableModel(sourceOfTruth, builder);\n }\n\n\n addSelectionColumn(selectionModel?: SelectionModel<Row>, showSelectionColumn?: ValueModel<boolean> | boolean): SelectionColumnModel<Row> {\n return this._addSelectionColumn(selectionModel, showSelectionColumn);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"TableModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-table-model","name":"AbstractTableModel","line":83,"character":37},"arity":1,"members":{"
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"TableModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-table-model","name":"AbstractTableModel","line":83,"character":37},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@coolon/pectin","name":"ListModel","line":85,"character":29,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":85,"character":39,"context":{"typeName":"Row"}}]},{"__symbolic":"error","message":"Expression form not supported","line":85,"character":55}]}],"addSelectionColumn":[{"__symbolic":"method"}]},"statics":{"fromList":{"__symbolic":"function","parameters":["sourceOfTruth","builder"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"TableModel"},"arguments":[{"__symbolic":"reference","name":"sourceOfTruth"},{"__symbolic":"reference","name":"builder"}]}}}}}}]
|