From 7be44fec59b62da285fc2f112c17ce93ed7dc362 Mon Sep 17 00:00:00 2001 From: Jakob Vogelsang Date: Wed, 7 May 2025 13:36:03 +0200 Subject: [PATCH] feat: add disable key to SelectItem --- .github/workflows/test-on-pr-branch.yml | 4 ++-- .github/workflows/update-screenshots.yml | 2 +- SelectionList.ts | 3 +++ selection-list.spec.ts | 3 +++ web-test-runner.config.js | 7 +++---- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-on-pr-branch.yml b/.github/workflows/test-on-pr-branch.yml index 31b663a..cc19e50 100644 --- a/.github/workflows/test-on-pr-branch.yml +++ b/.github/workflows/test-on-pr-branch.yml @@ -3,7 +3,7 @@ on: pull_request jobs: unit: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -22,7 +22,7 @@ jobs: - name: Run unit tests run: npm run-script test:unit visual: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/update-screenshots.yml b/.github/workflows/update-screenshots.yml index d1a8b84..9b273bc 100644 --- a/.github/workflows/update-screenshots.yml +++ b/.github/workflows/update-screenshots.yml @@ -4,7 +4,7 @@ on: workflow_dispatch jobs: test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/SelectionList.ts b/SelectionList.ts index 32537ca..4622c00 100644 --- a/SelectionList.ts +++ b/SelectionList.ts @@ -21,6 +21,8 @@ export type SelectItem = { startingIcon?: string; /** Whether an icon is selected */ selected: boolean; + /** wether an item shall be display but disabled */ + disabled?: boolean; }; /** List component to select from a set of options */ @@ -63,6 +65,7 @@ export class SelectionList extends FilterListBase { { - const result = defaultGetImageDiff(options); + const result = defaultGetImageDiff(options); if (result.diffPercentage < thresholdPercentage) result.diffPercentage = 0; return result;