From ccf7bb1753ec7cea7cd79750c71e6099ef2b3209 Mon Sep 17 00:00:00 2001 From: Bryan Cunningham Date: Thu, 13 Nov 2025 15:53:05 -0500 Subject: [PATCH] [CL-736] migrate chip select to use signals (#17136) * migrate chip select to use signals * Have Claude address feedback and create spec file * remove eslint disable comment * fix failing tests * remove unnecessary tests * improved documentation * remove unnecessary test logic * consolidate tests and remove fragile selectors --- .../chip-select/chip-select.component.html | 18 +- .../chip-select/chip-select.component.spec.ts | 486 ++++++++++++++++++ .../src/chip-select/chip-select.component.ts | 97 ++-- 3 files changed, 545 insertions(+), 56 deletions(-) create mode 100644 libs/components/src/chip-select/chip-select.component.spec.ts diff --git a/libs/components/src/chip-select/chip-select.component.html b/libs/components/src/chip-select/chip-select.component.html index d43e09e833..ee252b35fe 100644 --- a/libs/components/src/chip-select/chip-select.component.html +++ b/libs/components/src/chip-select/chip-select.component.html @@ -3,11 +3,11 @@ class="tw-inline-flex tw-items-center tw-rounded-full tw-w-full tw-border-solid tw-border tw-gap-1.5 tw-group/chip-select" [ngClass]="{ 'tw-bg-text-muted hover:tw-bg-secondary-700 tw-text-contrast hover:!tw-border-secondary-700': - selectedOption && !disabled, + selectedOption && !disabled(), 'tw-bg-transparent hover:tw-border-secondary-700 !tw-text-muted hover:tw-bg-secondary-100': - !selectedOption && !disabled, - 'tw-bg-secondary-300 tw-text-muted tw-border-transparent': disabled, - 'tw-border-text-muted': !disabled, + !selectedOption && !disabled(), + 'tw-bg-secondary-300 tw-text-muted tw-border-transparent': disabled(), + 'tw-border-text-muted': !disabled(), 'tw-ring-2 tw-ring-primary-600 tw-ring-offset-1': focusVisibleWithin(), }" > @@ -17,11 +17,11 @@ class="tw-inline-flex tw-gap-1.5 tw-items-center tw-justify-between tw-bg-transparent hover:tw-bg-transparent tw-border-none tw-outline-none tw-w-full tw-py-1 tw-ps-3 last:tw-pe-3 [&:not(:last-child)]:tw-pe-0 tw-truncate tw-text-[color:inherit] tw-text-[length:inherit]" data-fvw-target [ngClass]="{ - 'tw-cursor-not-allowed': disabled, - 'group-hover/chip-select:tw-text-secondary-700': !selectedOption && !disabled, + 'tw-cursor-not-allowed': disabled(), + 'group-hover/chip-select:tw-text-secondary-700': !selectedOption && !disabled(), }" [bitMenuTriggerFor]="menu" - [disabled]="disabled" + [disabled]="disabled()" [title]="label" #menuTrigger="menuTrigger" (click)="setMenuWidth()" @@ -45,10 +45,10 @@