@danske/sapphire-angular 1.15.0 → 1.16.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/esm2020/lib/table/src/table-row.directive.mjs +22 -6
- package/fesm2015/danske-sapphire-angular.mjs +19 -5
- package/fesm2015/danske-sapphire-angular.mjs.map +1 -1
- package/fesm2020/danske-sapphire-angular.mjs +19 -5
- package/fesm2020/danske-sapphire-angular.mjs.map +1 -1
- package/lib/table/src/table-row.directive.d.ts +3 -1
- package/package.json +2 -2
|
@@ -5312,10 +5312,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
|
|
|
5312
5312
|
|
|
5313
5313
|
class TableRowDirective {
|
|
5314
5314
|
onRowClick() {
|
|
5315
|
-
this.
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5315
|
+
if (!this.disabled) {
|
|
5316
|
+
this.table.rowAction.emit({
|
|
5317
|
+
index: this.table.rows?.toArray().findIndex((row) => row === this) ?? -1,
|
|
5318
|
+
rowData: this.rowData,
|
|
5319
|
+
});
|
|
5320
|
+
}
|
|
5319
5321
|
}
|
|
5320
5322
|
getColumnHeadCell(cell) {
|
|
5321
5323
|
const index = this.cells.toArray().indexOf(cell);
|
|
@@ -5325,16 +5327,26 @@ class TableRowDirective {
|
|
|
5325
5327
|
this.table = table;
|
|
5326
5328
|
this.cells = new QueryList();
|
|
5327
5329
|
this.rowData = null;
|
|
5330
|
+
this.disabled = false;
|
|
5328
5331
|
}
|
|
5329
5332
|
}
|
|
5330
5333
|
TableRowDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: TableRowDirective, deps: [{ token: forwardRef(() => TableComponent) }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5331
|
-
TableRowDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.0", type: TableRowDirective, selector: "tr[sp-table-tr]", inputs: { rowData: "rowData" }, host: { listeners: { "click": "onRowClick()" }, classAttribute: "sapphire-table__row" }, queries: [{ propertyName: "cells", predicate: TableCellDirective }], hostDirectives: [{ directive: UseComponentStyles }], ngImport: i0 });
|
|
5334
|
+
TableRowDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.0", type: TableRowDirective, selector: "tr[sp-table-tr]", inputs: { rowData: "rowData", disabled: "disabled" }, host: { listeners: { "click": "onRowClick()" }, properties: { "class.js-hover": "disabled" }, classAttribute: "sapphire-table__row" }, queries: [{ propertyName: "cells", predicate: TableCellDirective }], hostDirectives: [{ directive: UseComponentStyles }], ngImport: i0 });
|
|
5335
|
+
__decorate([
|
|
5336
|
+
CoerceBoolean
|
|
5337
|
+
], TableRowDirective.prototype, "disabled", void 0);
|
|
5332
5338
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: TableRowDirective, decorators: [{
|
|
5333
5339
|
type: Directive,
|
|
5334
5340
|
args: [{
|
|
5335
5341
|
selector: 'tr[sp-table-tr]',
|
|
5336
5342
|
host: {
|
|
5337
5343
|
class: 'sapphire-table__row',
|
|
5344
|
+
/**
|
|
5345
|
+
* We want the css hover styles to not be applied for the disabled rows.
|
|
5346
|
+
* The "js-hover" class basically means that we're taking over the hover
|
|
5347
|
+
* styles from css.
|
|
5348
|
+
*/
|
|
5349
|
+
'[class.js-hover]': 'disabled',
|
|
5338
5350
|
},
|
|
5339
5351
|
hostDirectives: [UseComponentStyles],
|
|
5340
5352
|
}]
|
|
@@ -5346,6 +5358,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
|
|
|
5346
5358
|
args: [TableCellDirective]
|
|
5347
5359
|
}], rowData: [{
|
|
5348
5360
|
type: Input
|
|
5361
|
+
}], disabled: [{
|
|
5362
|
+
type: Input
|
|
5349
5363
|
}], onRowClick: [{
|
|
5350
5364
|
type: HostListener,
|
|
5351
5365
|
args: ['click']
|