From 2d765c45ae724fae49dfd4bff6dace8cd11d0ce7 Mon Sep 17 00:00:00 2001 From: Henrik Sejer Pedersen Date: Tue, 28 Feb 2023 14:38:27 +0100 Subject: [PATCH 1/4] Add null as permitted type in disclosure input of kirby-item --- libs/designsystem/item/src/item.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/designsystem/item/src/item.component.ts b/libs/designsystem/item/src/item.component.ts index 1e0f5c483e..3c5c1a0f5d 100644 --- a/libs/designsystem/item/src/item.component.ts +++ b/libs/designsystem/item/src/item.component.ts @@ -19,7 +19,7 @@ export class ItemComponent { selected: boolean; @HostBinding('class.disclosure') @Input() - disclosure: 'link' | 'arrow-more' | 'arrow-down' | 'arrow-up'; + disclosure: 'link' | 'arrow-more' | 'arrow-down' | 'arrow-up' | null; @Input() selectable: boolean; @Input() From 5ebbc0a5a5d8e9249ad073583b88cb5d2c31fec4 Mon Sep 17 00:00:00 2001 From: Henrik Sejer Pedersen Date: Wed, 1 Mar 2023 10:12:04 +0100 Subject: [PATCH 2/4] update the showcase API table to reflect the change --- .../src/app/showcase/item-showcase/item-showcase.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/cookbook/src/app/showcase/item-showcase/item-showcase.component.ts b/apps/cookbook/src/app/showcase/item-showcase/item-showcase.component.ts index e129510053..0e083f4eed 100644 --- a/apps/cookbook/src/app/showcase/item-showcase/item-showcase.component.ts +++ b/apps/cookbook/src/app/showcase/item-showcase/item-showcase.component.ts @@ -33,7 +33,7 @@ export class ItemShowcaseComponent { name: 'disclosure', description: 'Set disclosure icon', defaultValue: 'null', - type: ["'link' | 'arrow-more' | 'arrow-down' | 'arrow-up'"], + type: ["'link' | 'arrow-more' | 'arrow-down' | 'arrow-up' | 'null'"], }, { name: 'reorderable', From b95a4707525a790cc32f13c9effb59c49d767ba0 Mon Sep 17 00:00:00 2001 From: Henrik Sejer Pedersen Date: Wed, 1 Mar 2023 10:34:37 +0100 Subject: [PATCH 3/4] fix typo --- .../src/app/showcase/item-showcase/item-showcase.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/cookbook/src/app/showcase/item-showcase/item-showcase.component.ts b/apps/cookbook/src/app/showcase/item-showcase/item-showcase.component.ts index 0e083f4eed..43059063af 100644 --- a/apps/cookbook/src/app/showcase/item-showcase/item-showcase.component.ts +++ b/apps/cookbook/src/app/showcase/item-showcase/item-showcase.component.ts @@ -33,7 +33,7 @@ export class ItemShowcaseComponent { name: 'disclosure', description: 'Set disclosure icon', defaultValue: 'null', - type: ["'link' | 'arrow-more' | 'arrow-down' | 'arrow-up' | 'null'"], + type: ["'link' | 'arrow-more' | 'arrow-down' | 'arrow-up' | null"], }, { name: 'reorderable', From 5da793216d87a520ed540cff5292f954a3dccd53 Mon Sep 17 00:00:00 2001 From: Henrik Sejer Pedersen Date: Tue, 7 Mar 2023 13:06:49 +0100 Subject: [PATCH 4/4] add test for correct padding when disclosure is reset to null --- .../item/src/item.component.spec.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libs/designsystem/item/src/item.component.spec.ts b/libs/designsystem/item/src/item.component.spec.ts index 99db43679f..a7953e087a 100644 --- a/libs/designsystem/item/src/item.component.spec.ts +++ b/libs/designsystem/item/src/item.component.spec.ts @@ -93,4 +93,22 @@ describe('ItemComponent', () => { }); }); }); + + describe('when disclosure is reset to null', () => { + it('should reset inner-padding-end to s', () => { + spectator.component.disclosure = 'arrow-more'; + spectator.detectChanges(); + + expect(spectator.query('ion-item')).toHaveComputedStyle({ + '--inner-padding-end': size('xxs'), + }); + + spectator.component.disclosure = null; + spectator.detectChanges(); + + expect(spectator.query('ion-item')).toHaveComputedStyle({ + '--inner-padding-end': size('s'), + }); + }); + }); });