@coolon/angular-ui-powerups 1.18.0 → 1.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/assets/table.scss +12 -1
- package/bundles/coolon-angular-ui-powerups.umd.js +64 -21
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +2 -2
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/components/card-container/card-container.component.js +1 -1
- package/esm2015/lib/components/card-container/card-container.component.metadata.json +1 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/table/column-model.js +45 -9
- package/esm2015/lib/components/table/column-model.js.map +1 -1
- package/esm2015/lib/components/table/column-model.metadata.json +1 -1
- package/esm2015/lib/components/table/table-model.js +13 -5
- package/esm2015/lib/components/table/table-model.js.map +1 -1
- package/esm2015/lib/components/table/table-model.metadata.json +1 -1
- package/esm2015/lib/components/table/table.component.js +6 -7
- package/esm2015/lib/components/table/table.component.js.map +1 -1
- package/esm2015/lib/components/table/table.component.metadata.json +1 -1
- package/esm5/lib/components/card-container/card-container.component.js +1 -1
- package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm5/lib/components/table/column-model.js +45 -9
- package/esm5/lib/components/table/column-model.js.map +1 -1
- package/esm5/lib/components/table/table-model.js +13 -5
- package/esm5/lib/components/table/table-model.js.map +1 -1
- package/esm5/lib/components/table/table.component.js +6 -7
- package/esm5/lib/components/table/table.component.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +65 -22
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +65 -22
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/table/column-model.d.ts +15 -9
- package/lib/components/table/table-model.d.ts +5 -2
- package/lib/components/table/table.component.d.ts +5 -6
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ import { MatButtonModule } from '@angular/material/button';
|
|
|
13
13
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
14
14
|
import { MatIconModule } from '@angular/material/icon';
|
|
15
15
|
import { MatTableModule } from '@angular/material/table';
|
|
16
|
-
import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, TrackExternal, Command, FocusManager, DelegatingFormListModel, DelegatingFormValueModel, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MutableValueModel,
|
|
16
|
+
import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, TrackExternal, Command, FocusManager, DelegatingFormListModel, DelegatingFormValueModel, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MutableValueModel, MultipleSelectionModel, MutableListModel, Form, Deferred, Trace, Guard, DebugContext, Binding, Functions } from '@coolon/pectin';
|
|
17
17
|
import { assert as assert$1, Opts, lang as lang$1, Klass } from '@coolon/typescript-utilities';
|
|
18
18
|
import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
19
19
|
import ___default, { isEqual, isNil } from 'lodash';
|
|
@@ -406,7 +406,7 @@ var CardContainerComponent = /** @class */ (function (_super) {
|
|
|
406
406
|
Component({
|
|
407
407
|
selector: 'aup-card-container',
|
|
408
408
|
template: "<div class=\"card-container\">\n <ng-content></ng-content>\n\n <div class=\"add-card-container\" *ngIf=\"addCardCommand.enabled.value\" [pectinCommand]=\"addCardCommand\">\n <aup-icon icon=\"mat:add\"></aup-icon>\n </div>\n\n <div class=\"add-card-template\" *ngIf=\"addCardTemplate\">\n <ng-container [ngTemplateOutlet]=\"addCardTemplate\"></ng-container>\n </div>\n\n</div>\n",
|
|
409
|
-
styles: [":root{--aup-default-padding:var(--default-padding, 18px);--aup-default-background:white}.router-outlet-container>*{position:absolute;top:0;left:0;bottom:0;right:0}[no-tab-header]>mat-tab-header{display:none}[full-height-tabs] .mat-tab-body-wrapper,mat-tab-group.full-height-tabs .mat-tab-body-wrapper{flex:1}[full-height-tabs] .mat-tab-body-wrapper .mat-tab-body-content,[full-height-tabs] .mat-tab-body-wrapper mat-tab-body,mat-tab-group.full-height-tabs .mat-tab-body-wrapper .mat-tab-body-content,mat-tab-group.full-height-tabs .mat-tab-body-wrapper mat-tab-body{display:flex;flex-direction:column;justify-content:stretch}.dialog-interaction-context{max-width:95vw!important;max-height:95vh!important}.dialog-interaction-context mat-dialog-container{max-width:95vw!important;max-height:95vh!important;padding:0}.aup-popup-interaction-panel{background:var(--aup-default-background,#fff);box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);transition:box-shadow 280ms cubic-bezier(.4,0,.2,1)}.aup-input-activity{padding:calc(var(--aup-default-padding)/2)}.aup-input-component{display:block}.aup-input-component input,.aup-input-component mat-form-field{width:100%}.aup-input-component input mat-hint.faux-error,.aup-input-component mat-form-field mat-hint.faux-error{color:#f44336}aup-table-cell-renderer>.aup-input-component .mat-form-field-flex{padding-top:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-infix{width:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-label-wrapper{display:none}aup-table{--default-column-gap:var(--column-gap, 24px)}aup-table .mat-table td.mat-cell:first-of-type,aup-table .mat-table td.mat-footer-cell:first-of-type,aup-table .mat-table th.mat-header-cell:first-of-type{padding-left:0}aup-table aup-table-cell-renderer,aup-table aup-table-header-cell-renderer{display:flex;flex-direction:column;align-items:stretch;justify-content:center;height:100%;min-height:47px}aup-table aup-table-cell-renderer.first-column,aup-table aup-table-cell-renderer:not(.first-column),aup-table aup-table-header-cell-renderer.first-column,aup-table aup-table-header-cell-renderer:not(.first-column){padding-left:var(--default-column-gap)}aup-table aup-table-cell-renderer.fillCell{justify-content:stretch;padding-left:0!important}aup-table aup-table-cell-renderer.padChild>:first-child{padding-left:var(--default-column-gap);flex:1}:host{--resolved-card-gap:var(--card-gap, 16px);--resolved-card-width:var(--card-width, 300px);--resolved-card-height:var(--card-height, auto);--resolved-card-min-height:var(--card-min-height, auto);--resolved-card-background:var(--card-background, #fcfcfb);flex:1;display:block;background:var(--resolved-card-background)}.card-container{display:-ms-grid;display:grid;grid-template-columns:repeat(auto-fill,var(--resolved-card-width));grid-template-rows:repeat(auto-fit,minmax(0,var(--resolved-card-height)));grid-gap:var(--resolved-card-gap);box-sizing:border-box;padding:var(--resolved-card-gap);min-height:calc(var(--resolved-card-height) + 2 * var(--resolved-card-gap));min-width:calc(var(--resolved-card-width) + 2 * var(--resolved-card-gap));width:calc((var(--resolved-card-width) + var(--resolved-card-gap)) * 2 + var(--grid-gap));max-width:100%}.add-card-container{width:var(--resolved-card-width);height:var(--resolved-card-height);min-height:var(--resolved-card-min-height);display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;border:2px dashed rgba(0,0,0,.1);border-radius:6px;font-weight:300;cursor:pointer;color:rgba(0,0,0,.54);background-color:rgba(255,255,255,.8);transition:280ms cubic-bezier(.4,0,.2,1)}.add-card-container mat-icon{font-size:200%}.add-card-container:hover{transition:280ms cubic-bezier(.4,0,.2,1);border-color:transparent;background-color:#fff;color:rgba(0,0,0,.54)}.add-card-container:hover:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.add-card-template-container{width:var(--resolved-card-width);height:var(--resolved-card-height);display:flex;flex-direction:column;align-items:stretch;justify-content:stretch}"]
|
|
409
|
+
styles: [":root{--aup-default-padding:var(--default-padding, 18px);--aup-default-background:white}.router-outlet-container>*{position:absolute;top:0;left:0;bottom:0;right:0}[no-tab-header]>mat-tab-header{display:none}[full-height-tabs] .mat-tab-body-wrapper,mat-tab-group.full-height-tabs .mat-tab-body-wrapper{flex:1}[full-height-tabs] .mat-tab-body-wrapper .mat-tab-body-content,[full-height-tabs] .mat-tab-body-wrapper mat-tab-body,mat-tab-group.full-height-tabs .mat-tab-body-wrapper .mat-tab-body-content,mat-tab-group.full-height-tabs .mat-tab-body-wrapper mat-tab-body{display:flex;flex-direction:column;justify-content:stretch}.dialog-interaction-context{max-width:95vw!important;max-height:95vh!important}.dialog-interaction-context mat-dialog-container{max-width:95vw!important;max-height:95vh!important;padding:0}.aup-popup-interaction-panel{background:var(--aup-default-background,#fff);box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);transition:box-shadow 280ms cubic-bezier(.4,0,.2,1)}.aup-input-activity{padding:calc(var(--aup-default-padding)/2)}.aup-input-component{display:block}.aup-input-component input,.aup-input-component mat-form-field{width:100%}.aup-input-component input mat-hint.faux-error,.aup-input-component mat-form-field mat-hint.faux-error{color:#f44336}aup-table-cell-renderer>.aup-input-component .mat-form-field-flex{padding-top:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-infix{width:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-label-wrapper{display:none}aup-table{--default-column-gap:var(--column-gap, 24px);--resolved-row-hover-background-color:var(--row-hover-background-color, rgba(0, 0, 0, 0.05))}aup-table .mat-table td.mat-cell:first-of-type,aup-table .mat-table td.mat-footer-cell:first-of-type,aup-table .mat-table th.mat-header-cell:first-of-type{padding-left:0}aup-table .mat-table tr.enable-hover:hover{background-color:var(--resolved-row-hover-background-color)}aup-table .mat-table td.enable-cursor{cursor:pointer}aup-table aup-table-cell-renderer,aup-table aup-table-header-cell-renderer{display:flex;flex-direction:column;align-items:stretch;justify-content:center;height:100%;min-height:47px}aup-table aup-table-cell-renderer.first-column,aup-table aup-table-cell-renderer:not(.first-column),aup-table aup-table-header-cell-renderer.first-column,aup-table aup-table-header-cell-renderer:not(.first-column){padding-left:var(--default-column-gap)}aup-table aup-table-cell-renderer.fillCell{justify-content:stretch;padding-left:0!important}aup-table aup-table-cell-renderer.padChild>:first-child{padding-left:var(--default-column-gap);flex:1}:host{--resolved-card-gap:var(--card-gap, 16px);--resolved-card-width:var(--card-width, 300px);--resolved-card-height:var(--card-height, auto);--resolved-card-min-height:var(--card-min-height, auto);--resolved-card-background:var(--card-background, #fcfcfb);flex:1;display:block;background:var(--resolved-card-background)}.card-container{display:-ms-grid;display:grid;grid-template-columns:repeat(auto-fill,var(--resolved-card-width));grid-template-rows:repeat(auto-fit,minmax(0,var(--resolved-card-height)));grid-gap:var(--resolved-card-gap);box-sizing:border-box;padding:var(--resolved-card-gap);min-height:calc(var(--resolved-card-height) + 2 * var(--resolved-card-gap));min-width:calc(var(--resolved-card-width) + 2 * var(--resolved-card-gap));width:calc((var(--resolved-card-width) + var(--resolved-card-gap)) * 2 + var(--grid-gap));max-width:100%}.add-card-container{width:var(--resolved-card-width);height:var(--resolved-card-height);min-height:var(--resolved-card-min-height);display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;border:2px dashed rgba(0,0,0,.1);border-radius:6px;font-weight:300;cursor:pointer;color:rgba(0,0,0,.54);background-color:rgba(255,255,255,.8);transition:280ms cubic-bezier(.4,0,.2,1)}.add-card-container mat-icon{font-size:200%}.add-card-container:hover{transition:280ms cubic-bezier(.4,0,.2,1);border-color:transparent;background-color:#fff;color:rgba(0,0,0,.54)}.add-card-container:hover:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.add-card-template-container{width:var(--resolved-card-width);height:var(--resolved-card-height);display:flex;flex-direction:column;align-items:stretch;justify-content:stretch}"]
|
|
410
410
|
}),
|
|
411
411
|
__metadata("design:paramtypes", [])
|
|
412
412
|
], CardContainerComponent);
|
|
@@ -1391,6 +1391,7 @@ var ColumnModel = /** @class */ (function () {
|
|
|
1391
1391
|
function ColumnModel(columnId, defaults) {
|
|
1392
1392
|
this.columnId = columnId;
|
|
1393
1393
|
this.defaults = defaults;
|
|
1394
|
+
this._selectRowOnClick = undefined;
|
|
1394
1395
|
this.cellHeaderRenderer(DefaultHeaderCellRendererComponent, function (component, column) {
|
|
1395
1396
|
component.headerText = column.getHeaderText();
|
|
1396
1397
|
});
|
|
@@ -1447,6 +1448,19 @@ var ColumnModel = /** @class */ (function () {
|
|
|
1447
1448
|
ColumnModel.prototype.updatePortalContent = function (host) {
|
|
1448
1449
|
this._cellRendererPortalRef.pushState(host);
|
|
1449
1450
|
};
|
|
1451
|
+
ColumnModel.prototype.selectRowOnClick = function (selectOnRowClick) {
|
|
1452
|
+
this._selectRowOnClick = selectOnRowClick;
|
|
1453
|
+
return this;
|
|
1454
|
+
};
|
|
1455
|
+
ColumnModel.prototype.isRowSelectionEnabled = function () {
|
|
1456
|
+
return this._selectRowOnClick;
|
|
1457
|
+
};
|
|
1458
|
+
ColumnModel.prototype.isRowSelectionExplicitlyEnabled = function () {
|
|
1459
|
+
return this._selectRowOnClick === true;
|
|
1460
|
+
};
|
|
1461
|
+
ColumnModel.prototype.isRowSelectionExplicitlyDisabled = function () {
|
|
1462
|
+
return this._selectRowOnClick === false;
|
|
1463
|
+
};
|
|
1450
1464
|
__decorate([
|
|
1451
1465
|
Memoize(),
|
|
1452
1466
|
__metadata("design:type", Function),
|
|
@@ -1498,6 +1512,9 @@ var PropertyColumnModel = /** @class */ (function (_super) {
|
|
|
1498
1512
|
this._format = formatter;
|
|
1499
1513
|
return this;
|
|
1500
1514
|
};
|
|
1515
|
+
PropertyColumnModel.prototype.selectRowOnClick = function (selectOnRowClick) {
|
|
1516
|
+
return _super.prototype.selectRowOnClick.call(this, selectOnRowClick);
|
|
1517
|
+
};
|
|
1501
1518
|
return PropertyColumnModel;
|
|
1502
1519
|
}(ColumnModel));
|
|
1503
1520
|
var ListPropertyColumnModel = /** @class */ (function (_super) {
|
|
@@ -1537,6 +1554,9 @@ var ListPropertyColumnModel = /** @class */ (function (_super) {
|
|
|
1537
1554
|
this._format = formatter;
|
|
1538
1555
|
return this;
|
|
1539
1556
|
};
|
|
1557
|
+
ListPropertyColumnModel.prototype.selectRowOnClick = function (selectOnRowClick) {
|
|
1558
|
+
return _super.prototype.selectRowOnClick.call(this, selectOnRowClick);
|
|
1559
|
+
};
|
|
1540
1560
|
return ListPropertyColumnModel;
|
|
1541
1561
|
}(ColumnModel));
|
|
1542
1562
|
var CustomValueColumnModel = /** @class */ (function (_super) {
|
|
@@ -1554,6 +1574,9 @@ var CustomValueColumnModel = /** @class */ (function (_super) {
|
|
|
1554
1574
|
}));
|
|
1555
1575
|
return this;
|
|
1556
1576
|
};
|
|
1577
|
+
CustomValueColumnModel.prototype.selectRowOnClick = function (selectOnRowClick) {
|
|
1578
|
+
return _super.prototype.selectRowOnClick.call(this, selectOnRowClick);
|
|
1579
|
+
};
|
|
1557
1580
|
return CustomValueColumnModel;
|
|
1558
1581
|
}(ColumnModel));
|
|
1559
1582
|
var EditorControlColumnModel = /** @class */ (function (_super) {
|
|
@@ -1587,19 +1610,22 @@ var CustomTemplateColumnModel = /** @class */ (function (_super) {
|
|
|
1587
1610
|
CustomTemplateColumnModel.prototype.setTemplate = function (templateRef, viewContainer, fillCell, padChild) {
|
|
1588
1611
|
this.config.registerPortal(templateRef, viewContainer, fillCell, padChild);
|
|
1589
1612
|
};
|
|
1613
|
+
CustomTemplateColumnModel.prototype.selectRowOnClick = function (selectOnRowClick) {
|
|
1614
|
+
return _super.prototype.selectRowOnClick.call(this, selectOnRowClick);
|
|
1615
|
+
};
|
|
1590
1616
|
return CustomTemplateColumnModel;
|
|
1591
1617
|
}(ColumnModel));
|
|
1592
1618
|
var SelectionColumnModel = /** @class */ (function (_super) {
|
|
1593
1619
|
__extends(SelectionColumnModel, _super);
|
|
1594
|
-
function SelectionColumnModel(columnId, defaults, selectionModel
|
|
1620
|
+
function SelectionColumnModel(columnId, defaults, selectionModel) {
|
|
1595
1621
|
var _this = _super.call(this, columnId, defaults) || this;
|
|
1596
1622
|
_this.selectionModel = selectionModel;
|
|
1597
|
-
|
|
1598
|
-
_this.selectOnRowClick
|
|
1623
|
+
_this._enableHeaderControls = true;
|
|
1624
|
+
_this.selectOnRowClick(false);
|
|
1599
1625
|
if (selectionModel instanceof MultipleSelectionModel) {
|
|
1600
1626
|
_this.cellHeaderRenderer(SelectHeaderCellRendererComponent, function (component) {
|
|
1601
1627
|
component.selectionModel = selectionModel;
|
|
1602
|
-
component.enableHeaderControls =
|
|
1628
|
+
component.enableHeaderControls = _this._enableHeaderControls;
|
|
1603
1629
|
});
|
|
1604
1630
|
}
|
|
1605
1631
|
_this.configureCellRenderer(new ComponentCellRendererPortalRef(SelectCellRendererComponent, function (component, rowData) {
|
|
@@ -1611,10 +1637,20 @@ var SelectionColumnModel = /** @class */ (function (_super) {
|
|
|
1611
1637
|
SelectionColumnModel.prototype.getDefaultHeaderText = function () {
|
|
1612
1638
|
return '';
|
|
1613
1639
|
};
|
|
1614
|
-
SelectionColumnModel.prototype.
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1640
|
+
SelectionColumnModel.prototype.isRowSelectionEnabledByDefault = function () {
|
|
1641
|
+
return this.isRowSelectionExplicitlyEnabled();
|
|
1642
|
+
};
|
|
1643
|
+
SelectionColumnModel.prototype.selectOnRowClick = function (selectOnRowClick) {
|
|
1644
|
+
// note we're using different method name as the selection column treats this
|
|
1645
|
+
// state as the default for all columns.
|
|
1646
|
+
return _super.prototype.selectRowOnClick.call(this, selectOnRowClick);
|
|
1647
|
+
};
|
|
1648
|
+
SelectionColumnModel.prototype.enableHeaderControls = function (enable) {
|
|
1649
|
+
this._enableHeaderControls = enable;
|
|
1650
|
+
return this;
|
|
1651
|
+
};
|
|
1652
|
+
SelectionColumnModel.prototype.selectRow = function (row) {
|
|
1653
|
+
this.selectionModel.selectCommand.execute(row);
|
|
1618
1654
|
};
|
|
1619
1655
|
return SelectionColumnModel;
|
|
1620
1656
|
}(ColumnModel));
|
|
@@ -1708,6 +1744,7 @@ var TableModel = /** @class */ (function () {
|
|
|
1708
1744
|
this.editing = chain(this._editorSessions).count().isGreaterThan(0);
|
|
1709
1745
|
this.dataSource = chain(this.sourceOfTruth).replaceAll(this.rowsBeingEdited);
|
|
1710
1746
|
this.firstEditableColumn = chain(this.columns).select(function (c) { return c.hasEditorPortal(); }).first();
|
|
1747
|
+
this.hasColumnsWithRowSelectionExplicitlyEnabled = chain(this._columns).findIndex(function (column) { return column.isRowSelectionExplicitlyEnabled(); }).isGreaterThanOrEqualTo(0);
|
|
1711
1748
|
}
|
|
1712
1749
|
TableModel_1 = TableModel;
|
|
1713
1750
|
TableModel.fromList = function (sourceOfTruth, builder) {
|
|
@@ -1741,9 +1778,9 @@ var TableModel = /** @class */ (function () {
|
|
|
1741
1778
|
TableModel.prototype.pluckList = function (property) {
|
|
1742
1779
|
return this.addColumn(new ListPropertyColumnModel(property, this));
|
|
1743
1780
|
};
|
|
1744
|
-
TableModel.prototype.addSelectionColumn = function (selectionModel
|
|
1781
|
+
TableModel.prototype.addSelectionColumn = function (selectionModel) {
|
|
1745
1782
|
assert.isNil(this.selectionColumnModel);
|
|
1746
|
-
this.selectionColumnModel = new SelectionColumnModel('selection', this, selectionModel
|
|
1783
|
+
this.selectionColumnModel = new SelectionColumnModel('selection', this, selectionModel);
|
|
1747
1784
|
return this.addColumn(this.selectionColumnModel);
|
|
1748
1785
|
};
|
|
1749
1786
|
TableModel.prototype.addEditControls = function (saveCommand) {
|
|
@@ -1807,12 +1844,19 @@ var TableModel = /** @class */ (function () {
|
|
|
1807
1844
|
});
|
|
1808
1845
|
});
|
|
1809
1846
|
};
|
|
1810
|
-
TableModel.prototype.
|
|
1847
|
+
TableModel.prototype.isRowSelectionEnabledFor = function (column) {
|
|
1811
1848
|
var _a;
|
|
1812
|
-
(_a =
|
|
1849
|
+
return this.selectionColumnModel && ((_a = column.isRowSelectionEnabled()) !== null && _a !== void 0 ? _a : this.isRowSelectionEnabledByDefault());
|
|
1850
|
+
};
|
|
1851
|
+
TableModel.prototype.isRowSelectionEnabledByDefault = function () {
|
|
1852
|
+
return this.selectionColumnModel.isRowSelectionEnabledByDefault();
|
|
1813
1853
|
};
|
|
1814
1854
|
TableModel.prototype.isRowSelectionEnabled = function () {
|
|
1815
|
-
return this.
|
|
1855
|
+
return this.hasColumnsWithRowSelectionExplicitlyEnabled.value || this.isRowSelectionEnabledByDefault();
|
|
1856
|
+
};
|
|
1857
|
+
TableModel.prototype.selectRow = function (row) {
|
|
1858
|
+
var _a;
|
|
1859
|
+
(_a = this.selectionColumnModel) === null || _a === void 0 ? void 0 : _a.selectRow(row);
|
|
1816
1860
|
};
|
|
1817
1861
|
var TableModel_1;
|
|
1818
1862
|
TableModel.ctorParameters = function () { return [
|
|
@@ -1872,11 +1916,10 @@ var TableComponent = /** @class */ (function (_super) {
|
|
|
1872
1916
|
column.setTemplate(templateRef, viewContainer, fillCell, padChild);
|
|
1873
1917
|
}
|
|
1874
1918
|
};
|
|
1875
|
-
TableComponent.prototype.
|
|
1876
|
-
this.tableModel.
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
return this.tableModel.isRowSelectionEnabled();
|
|
1919
|
+
TableComponent.prototype.onCellClicked = function (columnModel, row) {
|
|
1920
|
+
if (this.tableModel.isRowSelectionEnabledFor(columnModel)) {
|
|
1921
|
+
this.tableModel.selectRow(row);
|
|
1922
|
+
}
|
|
1880
1923
|
};
|
|
1881
1924
|
__decorate([
|
|
1882
1925
|
Input(),
|
|
@@ -1886,8 +1929,8 @@ var TableComponent = /** @class */ (function (_super) {
|
|
|
1886
1929
|
TableComponent = __decorate([
|
|
1887
1930
|
Component({
|
|
1888
1931
|
selector: 'aup-table',
|
|
1889
|
-
template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.getTrackByFunction()\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value;\"
|
|
1890
|
-
styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{flex:1}
|
|
1932
|
+
template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.getTrackByFunction()\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"onCellClicked(column, row)\" [class.enable-cursor]=\"tableModel.isRowSelectionEnabledFor(column)\">\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value;\" [class.enable-hover]=\"tableModel.isRowSelectionEnabled()\"></tr>\n\n</table>\n",
|
|
1933
|
+
styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{flex:1}"]
|
|
1891
1934
|
}),
|
|
1892
1935
|
__metadata("design:paramtypes", [])
|
|
1893
1936
|
], TableComponent);
|