From 632c932bbae88dcde98ceaf53e7535bd9a1397ba Mon Sep 17 00:00:00 2001 From: Junior Lopes Date: Tue, 23 Jan 2024 08:53:49 +0100 Subject: [PATCH 1/2] =?UTF-8?q?fix=20f=C3=B6r=20studs=20n=C3=A4r=20man=20v?= =?UTF-8?q?=C3=A4ljer=20rad?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/controls/selectablelist/selectablelist.component.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/komponentkartan/src/lib/controls/selectablelist/selectablelist.component.scss b/projects/komponentkartan/src/lib/controls/selectablelist/selectablelist.component.scss index e44a2387..e4c26130 100644 --- a/projects/komponentkartan/src/lib/controls/selectablelist/selectablelist.component.scss +++ b/projects/komponentkartan/src/lib/controls/selectablelist/selectablelist.component.scss @@ -12,6 +12,7 @@ vgr-selectablelist-header, vgr-selectablelist-row { + border-left: 4px solid transparent; display: table-row; height: 32px; } From a7eb65ade05745bc02783e4520c20927dd7a8ce4 Mon Sep 17 00:00:00 2001 From: Martin Noren Date: Thu, 1 Feb 2024 14:20:28 +0100 Subject: [PATCH 2/2] =?UTF-8?q?lagt=20till=20input=20f=C3=B6r=20att=20v?= =?UTF-8?q?=C3=A4lja=20f=C3=B6rsta=20item=20i=20listan?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../selectablelist/selectablelist.component.ts | 3 ++- .../selectablelist-documentation.component.html | 12 +++++++++++- .../selectablelist-documentation.component.ts | 9 +++------ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/projects/komponentkartan/src/lib/controls/selectablelist/selectablelist.component.ts b/projects/komponentkartan/src/lib/controls/selectablelist/selectablelist.component.ts index 549263c2..6da56d27 100644 --- a/projects/komponentkartan/src/lib/controls/selectablelist/selectablelist.component.ts +++ b/projects/komponentkartan/src/lib/controls/selectablelist/selectablelist.component.ts @@ -46,6 +46,7 @@ export class SelectablelistComponent implements AfterContentInit, OnChanges, OnD @HostBinding('attr.tabIndex') tabIndex = 0; @Input() active: boolean; + @Input() setFirstSelectable: boolean = true; @Input() useScrollbar: boolean = true; @Input() maxHeight: number; @HostBinding('attr.id') @Input() id: string; @@ -174,7 +175,7 @@ export class SelectablelistComponent implements AfterContentInit, OnChanges, OnD this.handleRowClicked(row); }); - if (this.active) { + if (this.active && this.setFirstSelectable) { setTimeout(() => { this.selectFirstSelectable(); }, 200); diff --git a/src/app/selectablelist-documentation/selectablelist-documentation.component.html b/src/app/selectablelist-documentation/selectablelist-documentation.component.html index 26dc3f1a..9d24f979 100644 --- a/src/app/selectablelist-documentation/selectablelist-documentation.component.html +++ b/src/app/selectablelist-documentation/selectablelist-documentation.component.html @@ -18,7 +18,7 @@

Exempel

Lägg till fler rader Ta bort rader - + Utbetalning avser @@ -58,11 +58,21 @@

<vgr-selectablelist>

Talar om huruvida tabellen är aktiverad eller inte. Default värde är false. [active]="true" + + setFirstSelectable: boolean + Talar om huruvida första posten i tabellen automatiskt skall väljas. Default värde är true. + [setFirstSelectable]="true" + useScrollbar: boolean Användaren kan välja om man vill ha med en synlig scrollbar eller inte. Default värde är true. [useScrollbar]="false" + + maxHeight: number + Användaren kan välja maxhöjd på listan utan att scrollbaren syns. Överskrids maxhöjden så kommer scrollbaren att synas. + [maxHeight]="220" + selectedChanged: EventEmitter<any> Event som triggas när man väljer en ny rad i tabellen diff --git a/src/app/selectablelist-documentation/selectablelist-documentation.component.ts b/src/app/selectablelist-documentation/selectablelist-documentation.component.ts index 61f48b7c..4c7b65ff 100644 --- a/src/app/selectablelist-documentation/selectablelist-documentation.component.ts +++ b/src/app/selectablelist-documentation/selectablelist-documentation.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; import { HtmlEncodeService } from '../html-encode.service'; @Component({ @@ -6,7 +6,7 @@ import { HtmlEncodeService } from '../html-encode.service'; templateUrl: './selectablelist-documentation.component.html', styleUrls: ['./selectablelist-documentation.component.scss'] }) -export class SelectablelistDocumentationComponent implements OnInit { +export class SelectablelistDocumentationComponent { justeringar = [ { @@ -61,7 +61,7 @@ export class SelectablelistDocumentationComponent implements OnInit { } ] - exampleCode = ` + exampleCode = ` Utbetalning avser @@ -85,9 +85,6 @@ export class SelectablelistDocumentationComponent implements OnInit { htmlEncoder.prepareHighlightedSection(this.exampleCode, 'HTML'); } - ngOnInit(): void { - } - onSelectablelistChanged(event) { }